From: Vitaly SMETANNIKOV Date: Thu, 10 Nov 2016 14:13:34 +0000 (+0300) Subject: Issue #1860: fix end lines with spaces X-Git-Tag: V_2.6.0~97 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=423c10234142d14d0d5de89383f2f96a4ec5930f;p=modules%2Fshaper.git Issue #1860: fix end lines with spaces --- diff --git a/findEndLines.sh b/findEndLines.sh new file mode 100755 index 000000000..b6e51e282 --- /dev/null +++ b/findEndLines.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +find . \( -name "*.h" -o -name "*.cpp" \) -exec cpplint.py --filter=-,+whitespace/end_of_line --verbose=0 --counting=detailed {} \+ 2>&1 | grep -v Done | tee ./tofix + +python correction_auto_2.py --cpplint_output_file ./tofix + +rm ./tofix \ No newline at end of file diff --git a/src/BuildAPI/BuildAPI_Face.h b/src/BuildAPI/BuildAPI_Face.h index c614eb411..5e48dc044 100644 --- a/src/BuildAPI/BuildAPI_Face.h +++ b/src/BuildAPI/BuildAPI_Face.h @@ -36,7 +36,7 @@ public: virtual ~BuildAPI_Face(); INTERFACE_1(BuildPlugin_Face::ID(), - baseObjects, BuildPlugin_Face::BASE_OBJECTS_ID(), + baseObjects, BuildPlugin_Face::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */) /// Modify base attribute of the feature. diff --git a/src/BuildAPI/BuildAPI_Vertex.h b/src/BuildAPI/BuildAPI_Vertex.h index f14e87897..6bc594fdf 100644 --- a/src/BuildAPI/BuildAPI_Vertex.h +++ b/src/BuildAPI/BuildAPI_Vertex.h @@ -36,7 +36,7 @@ public: virtual ~BuildAPI_Vertex(); INTERFACE_1(BuildPlugin_Vertex::ID(), - baseObjects, BuildPlugin_Vertex::BASE_OBJECTS_ID(), + baseObjects, BuildPlugin_Vertex::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */) /// Modify base attribute of the feature. diff --git a/src/BuildPlugin/BuildPlugin_Shell.cpp b/src/BuildPlugin/BuildPlugin_Shell.cpp index b90e74945..687341cf1 100644 --- a/src/BuildPlugin/BuildPlugin_Shell.cpp +++ b/src/BuildPlugin/BuildPlugin_Shell.cpp @@ -72,7 +72,7 @@ void BuildPlugin_Shell::execute() ResultBodyPtr aResultBody = document()->createBody(data(), anIndex); aResultBody->store(aShell); for(ListOfShape::const_iterator anIt = aShapes.cbegin(); anIt != aShapes.cend(); ++anIt) { - for(GeomAPI_ShapeExplorer + for(GeomAPI_ShapeExplorer aFaceExp(*anIt, GeomAPI_Shape::FACE); aFaceExp.more(); aFaceExp.next()) { GeomShapePtr aFace = aFaceExp.current(); ListOfShape aHistory; diff --git a/src/BuildPlugin/BuildPlugin_Validators.cpp b/src/BuildPlugin/BuildPlugin_Validators.cpp index 4ff1e7dfb..613e34362 100644 --- a/src/BuildPlugin/BuildPlugin_Validators.cpp +++ b/src/BuildPlugin/BuildPlugin_Validators.cpp @@ -79,7 +79,7 @@ bool BuildPlugin_ValidatorBaseForBuild::isValid(const AttributePtr& theAttribute } // Check that it is shape on sketch. - ResultConstructionPtr aConstruction = + ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aContext); if(aConstruction.get()) { if(aConstruction->isInfinite()) { @@ -87,7 +87,7 @@ bool BuildPlugin_ValidatorBaseForBuild::isValid(const AttributePtr& theAttribute return false; } - std::shared_ptr anEdges = + std::shared_ptr anEdges = std::dynamic_pointer_cast(aContextShape); if(anEdges.get()) { if(aShape->isEqual(aContextShape)) { @@ -200,7 +200,7 @@ bool BuildPlugin_ValidatorBaseForFace::isValid(const std::shared_ptrlocation(), aPln->xDirection(), + GeomAlgoAPI_SketchBuilder::createFaces(aPln->location(), aPln->xDirection(), aPln->direction(), anEdges, aFaces); if(aFaces.empty()) { theError = "Selected objects does not have closed contours."; @@ -230,7 +230,7 @@ bool BuildPlugin_ValidatorBaseForFace::isValid(const std::shared_ptrattributeType() != ModelAPI_AttributeSelectionList::typeId()) { - std::string aMsg = + std::string aMsg = "Error: BuildPlugin_ValidatorSubShapesSelection does not support attribute type \"" "%1\"\n Only \"%2\" supported."; Events_InfoMessage("BuildPlugin_Validators", aMsg). diff --git a/src/BuildPlugin/BuildPlugin_Validators.h b/src/BuildPlugin/BuildPlugin_Validators.h index 4edd43894..347ef5f22 100644 --- a/src/BuildPlugin/BuildPlugin_Validators.h +++ b/src/BuildPlugin/BuildPlugin_Validators.h @@ -12,7 +12,7 @@ /// \class BuildPlugin_ValidatorBaseForBuild /// \ingroup Validators -/// \brief A validator for selection base shapes for build features. +/// \brief A validator for selection base shapes for build features. /// Allows to select shapes on sketch and /// whole objects with allowed type. class BuildPlugin_ValidatorBaseForBuild: public ModelAPI_AttributeValidator diff --git a/src/BuildPlugin/BuildPlugin_Wire.cpp b/src/BuildPlugin/BuildPlugin_Wire.cpp index 15a832b7d..c8004f617 100644 --- a/src/BuildPlugin/BuildPlugin_Wire.cpp +++ b/src/BuildPlugin/BuildPlugin_Wire.cpp @@ -128,7 +128,7 @@ bool BuildPlugin_Wire::addContour() continue; } GeomShapePtr aContextShape = aConstruction->shape(); - std::shared_ptr aPlanarEdges = + std::shared_ptr aPlanarEdges = std::dynamic_pointer_cast(aContextShape); if(!aPlanarEdges.get()) { continue; @@ -151,17 +151,17 @@ bool BuildPlugin_Wire::addContour() AttributeSelectionPtr aSelection = *aListIt; std::shared_ptr anEdgeInList(new GeomAPI_Edge(aSelection->value())); - ResultConstructionPtr aConstruction = + ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aSelection->context()); // Iterate on wires and add wire with this edge. std::shared_ptr aFoundWire; for(int anIndex = 0; anIndex < aConstruction->facesNum(); ++anIndex) { std::shared_ptr aFace = aConstruction->face(anIndex); - for(GeomAPI_ShapeExplorer + for(GeomAPI_ShapeExplorer aWireExp(aFace, GeomAPI_Shape::WIRE); aWireExp.more(); aWireExp.next()) { GeomShapePtr aWireOnFace = aWireExp.current(); - for(GeomAPI_ShapeExplorer + for(GeomAPI_ShapeExplorer anExp(aWireOnFace, GeomAPI_Shape::EDGE); anExp.more(); anExp.next()) { std::shared_ptr anEdgeOnFace(new GeomAPI_Edge(anExp.current())); if(anEdgeInList->isEqual(anEdgeOnFace)) { @@ -177,7 +177,7 @@ bool BuildPlugin_Wire::addContour() // If wire with the same edge found. Add all other edges to list. if(aFoundWire.get()) { - for(GeomAPI_ShapeExplorer + for(GeomAPI_ShapeExplorer anExp(aFoundWire, GeomAPI_Shape::EDGE); anExp.more(); anExp.next()) { std::shared_ptr anEdgeOnFace(new GeomAPI_Edge(anExp.current())); ListOfShape::const_iterator anEdgesIt = anAddedEdges.cbegin(); @@ -196,7 +196,7 @@ bool BuildPlugin_Wire::addContour() } if(!isAnyContourAdded) { - Events_InfoMessage("BuildPlugin_Wire", + Events_InfoMessage("BuildPlugin_Wire", "Error: Contours already closed or no contours found for selected edges.").send(); return false; } diff --git a/src/Config/Config_Common.cpp b/src/Config/Config_Common.cpp index 46a3f3ce1..cb866a7d5 100644 --- a/src/Config/Config_Common.cpp +++ b/src/Config/Config_Common.cpp @@ -55,7 +55,7 @@ bool isAttributeNode(xmlNodePtr theNode) if(!isElementNode(theNode)) return false; // it's parent is "feature" or "source" or page ("case" or "box") - if(!hasParent(theNode, NODE_FEATURE, NODE_SOURCE, + if(!hasParent(theNode, NODE_FEATURE, NODE_SOURCE, WDG_GROUP, WDG_OPTIONALBOX, WDG_TOOLBOX_BOX, WDG_SWITCH_CASE, NULL)) return false; @@ -233,7 +233,7 @@ std::string getProperty(xmlNodePtr theNode, const char* thePropName) xmlFree(aPropChars); std::string::iterator new_end = std::unique(result.begin(), result.end(), BothAreSpaces); - result.erase(new_end, result.end()); + result.erase(new_end, result.end()); return result; } diff --git a/src/Config/Config_DataModelReader.cpp b/src/Config/Config_DataModelReader.cpp index b9c000104..20e820350 100644 --- a/src/Config/Config_DataModelReader.cpp +++ b/src/Config/Config_DataModelReader.cpp @@ -31,7 +31,7 @@ void Config_DataModelReader::processNode(xmlNodePtr theNode) if (aName.empty() || aGroupType.empty()) Events_InfoMessage("Config_DataModelReader", "Reading dataModel.xml: wrong folder definition.").send(); - + std::string aIcon = getProperty(theNode, NODE_ICON); std::string aEmpty = getProperty(theNode, SHOW_EMPTY); std::string aFeatures = getProperty(theNode, FOLDER_FEATURES); @@ -91,7 +91,7 @@ int Config_DataModelReader::subFolderId(std::string theType) const return -1; } -std::string getFolderFeatures(const std::string& theFolderName, +std::string getFolderFeatures(const std::string& theFolderName, const std::vector& theNames, const std::vector& theFeatures) { diff --git a/src/Config/Config_DataModelReader.h b/src/Config/Config_DataModelReader.h index a66ad0f02..7246fddb4 100755 --- a/src/Config/Config_DataModelReader.h +++ b/src/Config/Config_DataModelReader.h @@ -35,7 +35,7 @@ class Config_DataModelReader : public Config_XMLReader /// Returns name of type of tree items in root CONFIG_EXPORT std::string rootType() const { return myRootTypes; } - /// Returns number of folders under root + /// Returns number of folders under root CONFIG_EXPORT size_t rootFoldersNumber() const { return myRootFolderNames.size(); } /// Returns name of the folder by its Id @@ -67,7 +67,7 @@ class Config_DataModelReader : public Config_XMLReader /// Returns name of type of tree items in sub document CONFIG_EXPORT std::string subType() const { return mySubTypes; } - /// Returns number of folders under sub document + /// Returns number of folders under sub document CONFIG_EXPORT size_t subFoldersNumber() const { return mySubFolderNames.size(); } /// Returns name of the folder by its Id diff --git a/src/Config/Config_FeatureReader.cpp b/src/Config/Config_FeatureReader.cpp index ed25f9821..5427e7dd3 100644 --- a/src/Config/Config_FeatureReader.cpp +++ b/src/Config/Config_FeatureReader.cpp @@ -51,7 +51,7 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode) Events_ID aMenuItemEvent = Events_Loop::eventByName(myEventGenerated); if (isNode(theNode, NODE_FEATURE, NULL)) { storeAttribute(theNode, _ID); - std::shared_ptr + std::shared_ptr aMessage(new Config_FeatureMessage(aMenuItemEvent, this)); fillFeature(theNode, aMessage); myFeatures.push_back(getProperty(theNode, _ID)); @@ -89,7 +89,7 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode) aSwitchNode = hasParentRecursive(aCaseNode, WDG_TOOLBOX, NULL); } if (!xmlStrcmp(aName, (const xmlChar *) WDG_OPTIONALBOX)) { - /// the box is optional, attribute is in case + /// the box is optional, attribute is in case /// if the optional attribute value is not empty aSwitchNode = aCaseNode; } @@ -97,7 +97,7 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode) aSwitchNodeID = getProperty(aSwitchNode, _ID); aCases.push_back(std::make_pair(aSwitchNodeID, aCaseNodeID)); - aCaseNode = hasParentRecursive(aSwitchNode, WDG_SWITCH_CASE, + aCaseNode = hasParentRecursive(aSwitchNode, WDG_SWITCH_CASE, WDG_TOOLBOX_BOX, WDG_OPTIONALBOX, NULL); } aMessage->setCases(aCases); @@ -126,7 +126,7 @@ bool Config_FeatureReader::processChildren(xmlNodePtr theNode) { bool result = isNode(theNode, NODE_WORKBENCH, NODE_GROUP, NULL); if(!result && myIsProcessWidgets) { - result = isNode(theNode, NODE_FEATURE, + result = isNode(theNode, NODE_FEATURE, WDG_GROUP, WDG_OPTIONALBOX, WDG_TOOLBOX, WDG_TOOLBOX_BOX, WDG_SWITCH, WDG_SWITCH_CASE, NULL); @@ -150,7 +150,7 @@ void Config_FeatureReader::fillFeature(xmlNodePtr theFeatureNode, //Internal feature has no visual representation. return; } - + outFeatureMessage->setText(getProperty(theFeatureNode, FEATURE_TEXT)); outFeatureMessage->setTooltip(getProperty(theFeatureNode, FEATURE_TOOLTIP)); outFeatureMessage->setIcon(getProperty(theFeatureNode, FEATURE_ICON)); diff --git a/src/Config/Config_FeatureReader.h b/src/Config/Config_FeatureReader.h index 409af6c7e..8a976a59a 100644 --- a/src/Config/Config_FeatureReader.h +++ b/src/Config/Config_FeatureReader.h @@ -46,7 +46,7 @@ class Config_FeatureReader : public Config_XMLReader virtual bool processChildren(xmlNodePtr aNode); /// Fills feature message - void fillFeature(xmlNodePtr theRoot, + void fillFeature(xmlNodePtr theRoot, const std::shared_ptr& outFeatureMessage); private: diff --git a/src/Config/Config_ModuleReader.cpp b/src/Config/Config_ModuleReader.cpp index 1b206fba6..ddb274240 100644 --- a/src/Config/Config_ModuleReader.cpp +++ b/src/Config/Config_ModuleReader.cpp @@ -219,11 +219,11 @@ void Config_ModuleReader::loadLibrary(const std::string& theLibName) DWORD dwLastError = ::GetLastError(); LPSTR messageBuffer = NULL; size_t size = ::FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - dwLastError, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + NULL, + dwLastError, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&messageBuffer, 0, NULL); anErrorMsg += ": " + std::string(messageBuffer, size); #else diff --git a/src/Config/Config_ModuleReader.h b/src/Config/Config_ModuleReader.h index a8b1910bc..881a10d2d 100644 --- a/src/Config/Config_ModuleReader.h +++ b/src/Config/Config_ModuleReader.h @@ -42,7 +42,7 @@ class Config_ModuleReader : public Config_XMLReader /// Returns list of module's xml files CONFIG_EXPORT const std::set& modulePluginFiles() const; /// Returns module name: an xml attribute from the root of the plugins.xml: - /// e.g \code \endcode + /// e.g \code \endcode CONFIG_EXPORT std::string getModuleName(); /// Detects type of the given plugin and loads it using loadLibrary or loadScript. CONFIG_EXPORT static void loadPlugin(const std::string& thePluginName); @@ -70,7 +70,7 @@ class Config_ModuleReader : public Config_XMLReader std::string addPlugin(const std::string& aPluginLibrary, const std::string& aPluginScript, const std::string& aPluginConf); - /// Save feature in myFeaturesInFiles. + /// Save feature in myFeaturesInFiles. /// Generates an error if the feature name is already registered. void addFeature(const std::string& theFeatureName, const std::string& thePluginConfig); diff --git a/src/Config/Config_PropManager.cpp b/src/Config/Config_PropManager.cpp index de17ec1a5..1928fbfc3 100644 --- a/src/Config/Config_PropManager.cpp +++ b/src/Config/Config_PropManager.cpp @@ -13,7 +13,7 @@ bool stringToBoolean(const std::string& theInt); Config_Properties Config_PropManager::myProps; -Config_Prop* Config_PropManager::registerProp(const std::string& theSection, +Config_Prop* Config_PropManager::registerProp(const std::string& theSection, const std::string& theName, const std::string& theTitle, Config_Prop::PropType theType, diff --git a/src/Config/Config_Translator.cpp b/src/Config/Config_Translator.cpp index c292159bd..3760faca3 100644 --- a/src/Config/Config_Translator.cpp +++ b/src/Config/Config_Translator.cpp @@ -132,8 +132,8 @@ std::string Config_Translator::translate(const std::string& theContext, std::string Config_Translator::codec(const std::string& theContext) -{ - return (myCodecs.count(theContext) > 0)? myCodecs[theContext] : "UTF-8"; +{ + return (myCodecs.count(theContext) > 0)? myCodecs[theContext] : "UTF-8"; } diff --git a/src/Config/Config_ValidatorReader.cpp b/src/Config/Config_ValidatorReader.cpp index 8a7236b21..d15293f67 100644 --- a/src/Config/Config_ValidatorReader.cpp +++ b/src/Config/Config_ValidatorReader.cpp @@ -70,7 +70,7 @@ void Config_ValidatorReader::processValidator(xmlNodePtr theNode) { Events_ID aValidatoEvent = Events_Loop::eventByName(EVENT_VALIDATOR_LOADED); Events_Loop* aEvLoop = Events_Loop::loop(); - std::shared_ptr + std::shared_ptr aMessage(new Config_ValidatorMessage(aValidatoEvent, this)); std::string aValidatorId; std::list aParameters; diff --git a/src/Config/Config_XMLReader.cpp b/src/Config/Config_XMLReader.cpp index 1dab4ac3d..1a53ece53 100644 --- a/src/Config/Config_XMLReader.cpp +++ b/src/Config/Config_XMLReader.cpp @@ -36,7 +36,7 @@ Config_XMLReader::Config_XMLReader(const std::string& theXmlFileName) : myXmlDoc(NULL) { - std::string prefix = ""; + std::string prefix = ""; Config_Prop* aProp = Config_PropManager::findProp("Plugins", "default_path"); if (aProp) prefix = aProp->value(); @@ -51,7 +51,7 @@ Config_XMLReader::Config_XMLReader(const std::string& theXmlFileName) myDocumentPath = prefix + FSEP + theXmlFileName; std::ifstream aTestFile(myDocumentPath); - if (!aTestFile) + if (!aTestFile) Events_InfoMessage("Config_XMLReader", "Unable to open %1").arg(myDocumentPath).send(); aTestFile.close(); } @@ -201,6 +201,6 @@ bool Config_XMLReader::cleanupAttribute(const char* theNodeName, const char* the } const char* Config_XMLReader::encoding() const -{ - return (const char*) myXmlDoc->encoding; +{ + return (const char*) myXmlDoc->encoding; } \ No newline at end of file diff --git a/src/Config/Config_def.h b/src/Config/Config_def.h index d572bbfd6..f6ae53da6 100644 --- a/src/Config/Config_def.h +++ b/src/Config/Config_def.h @@ -17,4 +17,4 @@ #endif #endif -#endif //CONFIG_H \ No newline at end of file +#endif //CONFIG_H diff --git a/src/ConnectorAPI/ConnectorAPI_Connector.cpp b/src/ConnectorAPI/ConnectorAPI_Connector.cpp index 35b12b263..3586637f9 100644 --- a/src/ConnectorAPI/ConnectorAPI_Connector.cpp +++ b/src/ConnectorAPI/ConnectorAPI_Connector.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2014-2016 CEA/DEN, EDF R&D // Name : ConnectorAPI_Connector.cpp -// Purpose: +// Purpose: // // History: // 16/06/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/ConnectorAPI/ConnectorAPI_Connector.h b/src/ConnectorAPI/ConnectorAPI_Connector.h index 9c8c210ab..07e0e9a55 100644 --- a/src/ConnectorAPI/ConnectorAPI_Connector.h +++ b/src/ConnectorAPI/ConnectorAPI_Connector.h @@ -1,7 +1,7 @@ // Copyright (C) 2014-2016 CEA/DEN, EDF R&D // Name : ConnectorAPI_Connector.h -// Purpose: +// Purpose: // // History: // 16/06/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/ConstructionAPI/ConstructionAPI_Axis.cpp b/src/ConstructionAPI/ConstructionAPI_Axis.cpp index 6883edf46..f05e41edb 100644 --- a/src/ConstructionAPI/ConstructionAPI_Axis.cpp +++ b/src/ConstructionAPI/ConstructionAPI_Axis.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2014-2016 CEA/DEN, EDF R&D // Name : ConstructionAPI_Axis.cpp -// Purpose: +// Purpose: // // History: // 15/06/16 - Sergey POKHODENKO - Creation of the file @@ -88,7 +88,7 @@ ConstructionAPI_Axis::ConstructionAPI_Axis(const std::shared_ptrboolean(ConstructionPlugin_Plane::REVERSE()); theDumper << ", " << anAttrPlane << ", " << anAttrDistance << ", " << anAttrReverse; - } else if(aCreationMethodOption == + } else if(aCreationMethodOption == ConstructionPlugin_Plane::CREATION_METHOD_BY_COINCIDENT_TO_POINT()) { - AttributeSelectionPtr anAttrPoint = + AttributeSelectionPtr anAttrPoint = aBase->selection(ConstructionPlugin_Plane::COINCIDENT_POINT()); theDumper << ", " << anAttrPlane << ", " << anAttrPoint; @@ -251,7 +251,7 @@ void ConstructionAPI_Plane::dump(ModelHighAPI_Dumper& theDumper) const theDumper << ", " << anAttrPlane << ", " << anAttrAxis << ", " << anAttrAngle; } - } else if(aCreationMethod == + } else if(aCreationMethod == ConstructionPlugin_Plane::CREATION_METHOD_BY_TWO_PARALLEL_PLANES()) { AttributeSelectionPtr anAttrPlane1 = aBase->selection(ConstructionPlugin_Plane::PLANE1()); AttributeSelectionPtr anAttrPlane2 = aBase->selection(ConstructionPlugin_Plane::PLANE2()); diff --git a/src/ConstructionAPI/ConstructionAPI_Plane.h b/src/ConstructionAPI/ConstructionAPI_Plane.h index b2d206e8c..b3bab93bb 100644 --- a/src/ConstructionAPI/ConstructionAPI_Plane.h +++ b/src/ConstructionAPI/ConstructionAPI_Plane.h @@ -1,7 +1,7 @@ // Copyright (C) 2014-2016 CEA/DEN, EDF R&D // Name : ConstructionAPI_Plane.h -// Purpose: +// Purpose: // // History: // 27/05/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/ConstructionAPI/ConstructionAPI_Point.cpp b/src/ConstructionAPI/ConstructionAPI_Point.cpp index 2c86fbbb7..95e89ca4b 100644 --- a/src/ConstructionAPI/ConstructionAPI_Point.cpp +++ b/src/ConstructionAPI/ConstructionAPI_Point.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2014-2016 CEA/DEN, EDF R&D // Name : ConstructionAPI_Point.cpp -// Purpose: +// Purpose: // // History: // 29/03/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/ConstructionAPI/ConstructionAPI_Point.h b/src/ConstructionAPI/ConstructionAPI_Point.h index aa454fcfb..dc626968b 100644 --- a/src/ConstructionAPI/ConstructionAPI_Point.h +++ b/src/ConstructionAPI/ConstructionAPI_Point.h @@ -1,7 +1,7 @@ // Copyright (C) 2014-2016 CEA/DEN, EDF R&D // Name : ConstructionAPI_Point.h -// Purpose: +// Purpose: // // History: // 29/03/16 - Sergey POKHODENKO - Creation of the file @@ -121,4 +121,4 @@ PointPtr addPoint(const std::shared_ptr & thePart, const ModelHighAPI_Selection& theObject1, const ModelHighAPI_Selection& theObject2);*/ -#endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_ */ +#endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_ */ diff --git a/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp b/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp index 8c59aa01c..2f504c2c5 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp @@ -4,7 +4,7 @@ // Created: 12 Dec 2014 // Author: Vitaly Smetannikov -// Modified by CEA (delegation to Alyotech) : 29 Mar 2016 +// Modified by CEA (delegation to Alyotech) : 29 Mar 2016 #include "ConstructionPlugin_Axis.h" @@ -43,7 +43,7 @@ void ConstructionPlugin_Axis::initAttributes() { data()->addAttribute(ConstructionPlugin_Axis::METHOD(), ModelAPI_AttributeString::typeId()); - + // Attributes needed to build the axis using the "two points" method data()->addAttribute(ConstructionPlugin_Axis::POINT_FIRST(), ModelAPI_AttributeSelection::typeId()); @@ -59,11 +59,11 @@ void ConstructionPlugin_Axis::initAttributes() ModelAPI_AttributeDouble::typeId()); data()->addAttribute(ConstructionPlugin_Axis::Z_DIRECTION(), ModelAPI_AttributeDouble::typeId()); - ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ConstructionPlugin_Axis::X_DIRECTION()); - ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ConstructionPlugin_Axis::Y_DIRECTION()); - ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ConstructionPlugin_Axis::Z_DIRECTION()); //Attributes needed to build the axis using the "three dimensions" method @@ -125,13 +125,13 @@ void ConstructionPlugin_Axis::createAxisByPointAndDirection() AttributeDoublePtr aXAttr = data()->real(ConstructionPlugin_Axis::X_DIRECTION()); AttributeDoublePtr aYAttr = data()->real(ConstructionPlugin_Axis::Y_DIRECTION()); AttributeDoublePtr aZAttr = data()->real(ConstructionPlugin_Axis::Z_DIRECTION()); - if ((aRef1.get() != NULL) && (aXAttr.get() != NULL) && + if ((aRef1.get() != NULL) && (aXAttr.get() != NULL) && (aYAttr.get() != NULL) && (aZAttr.get() != NULL)) { GeomShapePtr aShape1 = aRef1->value(); if (!aShape1.get()) aShape1 = aRef1->context()->shape(); - std::shared_ptr aVertex(new GeomAPI_Vertex(aXAttr->value(), + std::shared_ptr aVertex(new GeomAPI_Vertex(aXAttr->value(), aYAttr->value(), aZAttr->value())); if (aShape1->isVertex() && (!aShape1->isEqual(aVertex))) { @@ -171,7 +171,7 @@ void ConstructionPlugin_Axis::createAxisByDimensions() double aDY = data()->real(DY())->value(); double aDZ = data()->real(DZ())->value(); - if (fabs(aDX) < MINIMAL_LENGTH() && fabs(aDY) < MINIMAL_LENGTH() && + if (fabs(aDX) < MINIMAL_LENGTH() && fabs(aDY) < MINIMAL_LENGTH() && fabs(aDZ) < MINIMAL_LENGTH()) { setError("Axis builder with dimensions :: all dimensions are null", false); return ; @@ -182,7 +182,7 @@ void ConstructionPlugin_Axis::createAxisByDimensions() ResultConstructionPtr aConstr = document()->createConstruction(data()); aConstr->setInfinite(true); aConstr->setShape(anEdge); - setResult(aConstr); + setResult(aConstr); } void ConstructionPlugin_Axis::createAxisByLine() diff --git a/src/ConstructionPlugin/ConstructionPlugin_Axis.h b/src/ConstructionPlugin/ConstructionPlugin_Axis.h index afd1e45fc..222dc35a3 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Axis.h +++ b/src/ConstructionPlugin/ConstructionPlugin_Axis.h @@ -4,7 +4,7 @@ // Created: 12 Dec 2014 // Author: Vitaly Smetannikov -// Modified by CEA (delegation to Alyotech) : 29 Mar 2016 +// Modified by CEA (delegation to Alyotech) : 29 Mar 2016 #ifndef ConstructionPlugin_Axis_H #define ConstructionPlugin_Axis_H diff --git a/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp b/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp index 754a5aa46..a121c4191 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp @@ -89,7 +89,7 @@ void ConstructionPlugin_Plane::execute() GeomShapePtr aShape; std::string aCreationMethod = string(CREATION_METHOD())->value(); - if(aCreationMethod == CREATION_METHOD_BY_GENERAL_EQUATION() || + if(aCreationMethod == CREATION_METHOD_BY_GENERAL_EQUATION() || aCreationMethod == "PlaneByGeneralEquation") { aShape = createByGeneralEquation(); } else if(aCreationMethod == CREATION_METHOD_BY_THREE_POINTS()) { @@ -129,7 +129,7 @@ bool ConstructionPlugin_Plane::customisePresentation(ResultPtr theResult, AISObj { std::vector aColor; // get color from the attribute of the result - if (theResult.get() != NULL && + if (theResult.get() != NULL && theResult->data()->attribute(ModelAPI_Result::COLOR_ID()).get() != NULL) { AttributeIntArrayPtr aColorAttr = theResult->data()->intArray(ModelAPI_Result::COLOR_ID()); if (aColorAttr.get() && aColorAttr->size()) { @@ -165,7 +165,7 @@ std::shared_ptr ConstructionPlugin_Plane::createByGeneralEquation anAttrC->isInitialized() && anAttrD->isInitialized() ) { double aA = anAttrA->value(), aB = anAttrB->value(), aC = anAttrC->value(), aD = anAttrD->value(); - std::shared_ptr aPlane = + std::shared_ptr aPlane = std::shared_ptr(new GeomAPI_Pln(aA, aB, aC, aD)); std::string kDefaultPlaneSize = "200"; double aSize = Config_PropManager::integer(SKETCH_TAB_NAME, "planes_size", kDefaultPlaneSize); @@ -332,7 +332,7 @@ std::shared_ptr ConstructionPlugin_Plane::createByRotation() } std::shared_ptr anEdge(new GeomAPI_Edge(anAxisShape)); - std::shared_ptr anAxis = + std::shared_ptr anAxis = std::shared_ptr(new GeomAPI_Ax1(anEdge->line()->location(), anEdge->line()->direction())); @@ -391,7 +391,7 @@ GeomShapePtr faceByThreeVertices(const std::shared_ptr theV1, anObjects.push_back(theV1); anObjects.push_back(theV2); anObjects.push_back(theV3); - std::list > aBoundingPoints = + std::list > aBoundingPoints = GeomAlgoAPI_ShapeTools::getBoundingBox(anObjects, 1.0); GeomShapePtr aRes = GeomAlgoAPI_ShapeTools::fitPlaneToBox(aFace, aBoundingPoints); @@ -431,7 +431,7 @@ std::shared_ptr makeRectangularFace(const std::shared_ptr aResFace = GeomAlgoAPI_FaceBuilder::planarFace(thePln, - aMinX2d - aWgap, aMinY2d - aHgap, aMaxX2d - aMinX2d + 2. * aWgap, + aMinX2d - aWgap, aMinY2d - aHgap, aMaxX2d - aMinX2d + 2. * aWgap, aMaxY2d - aMinY2d + 2. * aHgap); return aResFace; diff --git a/src/ConstructionPlugin/ConstructionPlugin_Validators.cpp b/src/ConstructionPlugin/ConstructionPlugin_Validators.cpp index e9d239b82..1a65f5320 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Validators.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Validators.cpp @@ -29,7 +29,7 @@ bool ConstructionPlugin_ValidatorPointLines::isValid(const AttributePtr& theAttr { FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner()); - AttributeSelectionPtr aLineAttribute1 = + AttributeSelectionPtr aLineAttribute1 = std::dynamic_pointer_cast(theAttribute); AttributeSelectionPtr aLineAttribute2 = aFeature->selection(theArguments.front()); @@ -87,7 +87,7 @@ bool ConstructionPlugin_ValidatorPointLineAndPlaneNotParallel::isValid( { FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner()); - AttributeSelectionPtr anAttribute1 = + AttributeSelectionPtr anAttribute1 = std::dynamic_pointer_cast(theAttribute); AttributeSelectionPtr anAttribute2 = aFeature->selection(theArguments.front()); @@ -211,7 +211,7 @@ bool ConstructionPlugin_ValidatorPlaneLinePoint::isValid( { FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner()); - AttributeSelectionPtr anAttribute1 = + AttributeSelectionPtr anAttribute1 = std::dynamic_pointer_cast(theAttribute); AttributeSelectionPtr anAttribute2 = aFeature->selection(theArguments.front()); @@ -322,7 +322,7 @@ bool ConstructionPlugin_ValidatorAxisTwoNotParallelPlanes::isValid( { FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner()); - AttributeSelectionPtr anAttribute1 = + AttributeSelectionPtr anAttribute1 = std::dynamic_pointer_cast(theAttribute); AttributeSelectionPtr anAttribute2 = aFeature->selection(theArguments.front()); diff --git a/src/Events/Events_InfoMessage.cpp b/src/Events/Events_InfoMessage.cpp index 92e4c7c25..54324c1ec 100644 --- a/src/Events/Events_InfoMessage.cpp +++ b/src/Events/Events_InfoMessage.cpp @@ -10,26 +10,26 @@ #pragma warning(disable : 4996) // for sprintf #endif -void Events_InfoMessage::addParameter(double theParam) -{ +void Events_InfoMessage::addParameter(double theParam) +{ char aBuf[50]; int n = sprintf(aBuf, "%g", theParam); std::string aStr(aBuf); - myParameters.push_back(aStr); + myParameters.push_back(aStr); } -void Events_InfoMessage::addParameter(int theParam) -{ +void Events_InfoMessage::addParameter(int theParam) +{ char aBuf[50]; int n = sprintf(aBuf, "%d", theParam); std::string aStr(aBuf); - myParameters.push_back(aStr); + myParameters.push_back(aStr); } -void Events_InfoMessage::send() -{ +void Events_InfoMessage::send() +{ std::shared_ptr aMsg(new Events_InfoMessage(*this)); - Events_Loop::loop()->send(aMsg); + Events_Loop::loop()->send(aMsg); } @@ -54,7 +54,7 @@ std::string insertParameters(const std::string& theString, const std::list void Events_Listener::groupWhileFlush(const std::shared_ptr& theMessage) { - std::shared_ptr aGroup = + std::shared_ptr aGroup = std::dynamic_pointer_cast(theMessage); if (aGroup) { std::map >::iterator aMyGroup = myGroups.find( diff --git a/src/Events/Events_LongOp.cpp b/src/Events/Events_LongOp.cpp index 35558de6a..f298a9ae5 100644 --- a/src/Events/Events_LongOp.cpp +++ b/src/Events/Events_LongOp.cpp @@ -35,7 +35,7 @@ void Events_LongOp::start(void* theSender) MY_SENDERS[theSender]++; if (toSend) { - std::shared_ptr aNewOne = + std::shared_ptr aNewOne = std::shared_ptr(new Events_LongOp(theSender)); Events_Loop::loop()->send(aNewOne); } @@ -51,7 +51,7 @@ void Events_LongOp::end(void* theSender) MY_SENDERS[theSender] = aCount - 1; } if (MY_SENDERS.empty()) { - std::shared_ptr aNewOne = + std::shared_ptr aNewOne = std::shared_ptr(new Events_LongOp(theSender)); Events_Loop::loop()->send(aNewOne); } diff --git a/src/Events/Events_Loop.cpp b/src/Events/Events_Loop.cpp index 8e026f733..eaaf57be8 100644 --- a/src/Events/Events_Loop.cpp +++ b/src/Events/Events_Loop.cpp @@ -59,7 +59,7 @@ void Events_Loop::send(const std::shared_ptr& theMessage, bool i // if it is grouped message, just accumulate it bool isFlushedNow = myFlushed.find(theMessage->eventID().myID) != myFlushed.end(); if (isGroup && !isFlushedNow) { - std::shared_ptr aGroup = + std::shared_ptr aGroup = std::dynamic_pointer_cast(theMessage); if (aGroup) { std::map >::iterator aMyGroup = myGroups.find( diff --git a/src/Events/Events_Loop.h b/src/Events/Events_Loop.h index b095cc4fc..69ea2ed24 100644 --- a/src/Events/Events_Loop.h +++ b/src/Events/Events_Loop.h @@ -58,7 +58,7 @@ class Events_Loop //! \param isGroup is true for grouping messages if possible EVENTS_EXPORT void send(const std::shared_ptr& theMessage, bool isGroup = true); - //! Registers (or adds if such listener is already registered) a listener + //! Registers (or adds if such listener is already registered) a listener //! that will be called on the event and from the defined sender //! \param theListener the object that will listen (process) the event //! \param theID listen for messages with this ID @@ -77,12 +77,12 @@ class Events_Loop //! Removes messages with the given ID: they are not needed anymore (UPDATE on close) EVENTS_EXPORT void eraseMessages(const Events_ID& theID); - //! Allows to disable flushes: needed in synchronization of document mechanism + //! Allows to disable flushes: needed in synchronization of document mechanism //! (to synchronize all and only then flush create, update, etc in correct order) //! \param theActivate a state about flushe is active. If false, the flush is disabled //! \return the previous active flush state EVENTS_EXPORT bool activateFlushes(const bool theActivate); - + //! Clears all collected messages EVENTS_EXPORT void clear(const Events_ID& theID); diff --git a/src/Events/Events_Message.h b/src/Events/Events_Message.h index 68b757e8f..24e6349d1 100644 --- a/src/Events/Events_Message.h +++ b/src/Events/Events_Message.h @@ -22,7 +22,7 @@ class EVENTS_EXPORT Events_ID { /// pointer to the text-identifier of the event, unique pointer for all events of such type - char* myID; + char* myID; Events_ID(char* theID) { diff --git a/src/ExchangeAPI/ExchangeAPI_Export.cpp b/src/ExchangeAPI/ExchangeAPI_Export.cpp index 5b1dd9a98..f0daad8f1 100644 --- a/src/ExchangeAPI/ExchangeAPI_Export.cpp +++ b/src/ExchangeAPI/ExchangeAPI_Export.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ExchangeAPI_Export.cpp -// Purpose: +// Purpose: // // History: // 07/06/16 - Sergey POKHODENKO - Creation of the file @@ -21,7 +21,7 @@ void exportToFile(const std::shared_ptr & thePart, thePart->addFeature(ExchangePlugin_ExportFeature::ID()); fillAttribute("Regular", aFeature->string(ExchangePlugin_ExportFeature::EXPORT_TYPE_ID())); fillAttribute(theFilePath, aFeature->string(ExchangePlugin_ExportFeature::FILE_PATH_ID())); - fillAttribute(theSelectionList, + fillAttribute(theSelectionList, aFeature->selectionList(ExchangePlugin_ExportFeature::SELECTION_LIST_ID())); fillAttribute(theFileFormat, aFeature->string(ExchangePlugin_ExportFeature::FILE_FORMAT_ID())); aFeature->execute(); @@ -33,12 +33,12 @@ void exportToXAO(const std::shared_ptr & thePart, const std::string & theGeometryName) { // TODO(spo): check that thePart is not empty - std::shared_ptr aFeature = + std::shared_ptr aFeature = thePart->addFeature(ExchangePlugin_ExportFeature::ID()); fillAttribute("XAO", aFeature->string(ExchangePlugin_ExportFeature::EXPORT_TYPE_ID())); fillAttribute(theFilePath, aFeature->string(ExchangePlugin_ExportFeature::XAO_FILE_PATH_ID())); fillAttribute(theAuthor, aFeature->string(ExchangePlugin_ExportFeature::XAO_AUTHOR_ID())); - fillAttribute(theGeometryName, + fillAttribute(theGeometryName, aFeature->string(ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID())); fillAttribute("XAO", aFeature->string(ExchangePlugin_ExportFeature::FILE_FORMAT_ID())); aFeature->execute(); diff --git a/src/ExchangeAPI/ExchangeAPI_Export.h b/src/ExchangeAPI/ExchangeAPI_Export.h index 6a7025f8b..6b1b30812 100644 --- a/src/ExchangeAPI/ExchangeAPI_Export.h +++ b/src/ExchangeAPI/ExchangeAPI_Export.h @@ -1,7 +1,7 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ExchangeAPI_Export.h -// Purpose: +// Purpose: // // History: // 07/06/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/ExchangeAPI/ExchangeAPI_Import.cpp b/src/ExchangeAPI/ExchangeAPI_Import.cpp index 12b987f4a..ff64ff5d9 100644 --- a/src/ExchangeAPI/ExchangeAPI_Import.cpp +++ b/src/ExchangeAPI/ExchangeAPI_Import.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ExchangeAPI_Import.cpp -// Purpose: +// Purpose: // // History: // 07/06/16 - Sergey POKHODENKO - Creation of the file @@ -64,12 +64,12 @@ void ExchangeAPI_Import::dump(ModelHighAPI_Dumper& theDumper) const // to make import have results theDumper << "model.do()" << std::endl; - CompositeFeaturePtr aCompositeFeature = + CompositeFeaturePtr aCompositeFeature = std::dynamic_pointer_cast(aBase); if(aCompositeFeature.get()) { int aNbOfSubs = aCompositeFeature->numberOfSubs(); for(int anIndex = 0; anIndex < aNbOfSubs; ++anIndex) { - std::string aSubFeatureGet = + std::string aSubFeatureGet = theDumper.name(aBase) + ".subFeature(" + std::to_string((long long)anIndex) + ")"; theDumper.dumpSubFeatureNameAndColor(aSubFeatureGet, aCompositeFeature->subFeature(anIndex)); } diff --git a/src/ExchangeAPI/ExchangeAPI_Import.h b/src/ExchangeAPI/ExchangeAPI_Import.h index dd6a3d014..e89524d99 100644 --- a/src/ExchangeAPI/ExchangeAPI_Import.h +++ b/src/ExchangeAPI/ExchangeAPI_Import.h @@ -1,7 +1,7 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ExchangeAPI_Import.h -// Purpose: +// Purpose: // // History: // 07/06/16 - Sergey POKHODENKO - Creation of the file @@ -38,7 +38,7 @@ public: virtual ~ExchangeAPI_Import(); INTERFACE_1(ExchangePlugin_ImportFeature::ID(), - filePath, ExchangePlugin_ImportFeature::FILE_PATH_ID(), + filePath, ExchangePlugin_ImportFeature::FILE_PATH_ID(), ModelAPI_AttributeString, /** File path */ ) diff --git a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp index 2c031fb4f..ddc8e1431 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp @@ -236,7 +236,7 @@ void ExchangePlugin_ExportFeature::exportXAO(const std::string& theFileName) // complex conversion of reference id to element index int aReferenceID = aSelection->Id(); std::string aReferenceString = XAO::XaoUtils::intToString(aReferenceID); - int anElementID = + int anElementID = aXao.getGeometry()->getElementIndexByReference(aGroupDimension, aReferenceString); aXaoGroup->add(anElementID); diff --git a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp index 70bab6e93..e55c4efd9 100644 --- a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp @@ -52,10 +52,10 @@ ExchangePlugin_ImportFeature::~ExchangePlugin_ImportFeature() */ void ExchangePlugin_ImportFeature::initAttributes() { - data()->addAttribute(ExchangePlugin_ImportFeature::FILE_PATH_ID(), + data()->addAttribute(ExchangePlugin_ImportFeature::FILE_PATH_ID(), ModelAPI_AttributeString::typeId()); - AttributePtr aFeaturesAttribute = - data()->addAttribute(ExchangePlugin_ImportFeature::FEATURES_ID(), + AttributePtr aFeaturesAttribute = + data()->addAttribute(ExchangePlugin_ImportFeature::FEATURES_ID(), ModelAPI_AttributeRefList::typeId()); aFeaturesAttribute->setIsArgument(false); diff --git a/src/ExchangePlugin/ExchangePlugin_ImportFeature.h b/src/ExchangePlugin/ExchangePlugin_ImportFeature.h index d882bc759..10a40764d 100644 --- a/src/ExchangePlugin/ExchangePlugin_ImportFeature.h +++ b/src/ExchangePlugin/ExchangePlugin_ImportFeature.h @@ -93,7 +93,7 @@ class ExchangePlugin_ImportFeature : public ModelAPI_CompositeFeature private: /// Loads Naming data structure to the document - void loadNamingDS(std::shared_ptr theGeomShape, + void loadNamingDS(std::shared_ptr theGeomShape, std::shared_ptr theResultBody); }; diff --git a/src/FeaturesAPI/FeaturesAPI_Boolean.cpp b/src/FeaturesAPI/FeaturesAPI_Boolean.cpp index e99beb77c..ec9737156 100644 --- a/src/FeaturesAPI/FeaturesAPI_Boolean.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Boolean.cpp @@ -84,7 +84,7 @@ void FeaturesAPI_Boolean::dump(ModelHighAPI_Dumper& theDumper) const } const std::string& aDocName = theDumper.name(aBase->document()); - AttributeSelectionListPtr anObjects = + AttributeSelectionListPtr anObjects = aBase->selectionList(FeaturesPlugin_Boolean::OBJECT_LIST_ID()); AttributeSelectionListPtr aTools = aBase->selectionList(FeaturesPlugin_Boolean::TOOL_LIST_ID()); diff --git a/src/FeaturesAPI/FeaturesAPI_Extrusion.h b/src/FeaturesAPI/FeaturesAPI_Extrusion.h index 9f6261bd5..8e355717d 100644 --- a/src/FeaturesAPI/FeaturesAPI_Extrusion.h +++ b/src/FeaturesAPI/FeaturesAPI_Extrusion.h @@ -114,7 +114,7 @@ public: /// Modify CreationMethod, to_size, from_size attributes of the feature. FEATURESAPI_EXPORT - void setSizes(const ModelHighAPI_Double& theToSize, + void setSizes(const ModelHighAPI_Double& theToSize, const ModelHighAPI_Double& theFromSize); /// Modify creation_method, to_size, from_size attributes of the feature. diff --git a/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp b/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp index eb73b8ba2..e501b6e13 100644 --- a/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp +++ b/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp @@ -115,7 +115,7 @@ void FeaturesAPI_ExtrusionBoolean::dump(ModelHighAPI_Dumper& theDumper) const AttributeReferencePtr anAttrSketch = aBase->reference(FeaturesPlugin_Extrusion::SKETCH_ID()); AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Extrusion::BASE_OBJECTS_ID()); - AttributeSelectionPtr anAttrDirection = + AttributeSelectionPtr anAttrDirection = aBase->selection(FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID()); theDumper << aBase << " = model.addExtrusion"; @@ -137,10 +137,10 @@ void FeaturesAPI_ExtrusionBoolean::dump(ModelHighAPI_Dumper& theDumper) const theDumper << ", " << anAttrToSize << ", " << anAttrFromSize; } else if(aCreationMethod == FeaturesPlugin_Extrusion::CREATION_METHOD_BY_PLANES()) { - AttributeSelectionPtr anAttrToObject = + AttributeSelectionPtr anAttrToObject = aBase->selection(FeaturesPlugin_Extrusion::TO_OBJECT_ID()); AttributeDoublePtr anAttrToOffset = aBase->real(FeaturesPlugin_Extrusion::TO_OFFSET_ID()); - AttributeSelectionPtr anAttrFromObject = + AttributeSelectionPtr anAttrFromObject = aBase->selection(FeaturesPlugin_Extrusion::FROM_OBJECT_ID()); AttributeDoublePtr anAttrFromOffset = aBase->real(FeaturesPlugin_Extrusion::FROM_OFFSET_ID()); @@ -148,7 +148,7 @@ void FeaturesAPI_ExtrusionBoolean::dump(ModelHighAPI_Dumper& theDumper) const ", " << anAttrFromObject << ", " << anAttrFromOffset; } - AttributeSelectionListPtr anAttrBoolObjects = + AttributeSelectionListPtr anAttrBoolObjects = aBase->selectionList(FeaturesPlugin_CompositeBoolean::OBJECTS_ID()); theDumper << ", " << anAttrBoolObjects << ")" << std::endl; @@ -302,7 +302,7 @@ ExtrusionCutPtr addExtrusionCut(const std::shared_ptr& thePar { std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID()); - return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, + return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theSize, theBooleanObjects)); } @@ -313,7 +313,7 @@ ExtrusionCutPtr addExtrusionCut(const std::shared_ptr& thePar const ModelHighAPI_Double& theSize, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID()); return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theDirection, theSize, theBooleanObjects)); @@ -328,7 +328,7 @@ ExtrusionCutPtr addExtrusionCut(const std::shared_ptr& thePar { std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID()); - return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, + return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theToSize, theFromSize, theBooleanObjects)); } @@ -529,7 +529,7 @@ ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr& theP { std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID()); - return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, + return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, theSize, theBooleanObjects)); } @@ -542,7 +542,7 @@ ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr& theP { std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID()); - return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, + return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, theDirection, theSize, theBooleanObjects)); } @@ -553,9 +553,9 @@ ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr& theP const ModelHighAPI_Double& theFromSize, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID()); - return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, + return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, theToSize, theFromSize, theBooleanObjects)); } @@ -607,7 +607,7 @@ ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr& theP const ModelHighAPI_Double& theFromOffset, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID()); return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, diff --git a/src/FeaturesAPI/FeaturesAPI_Intersection.cpp b/src/FeaturesAPI/FeaturesAPI_Intersection.cpp index 803600f7d..a9653c320 100644 --- a/src/FeaturesAPI/FeaturesAPI_Intersection.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Intersection.cpp @@ -60,9 +60,9 @@ void FeaturesAPI_Intersection::dump(ModelHighAPI_Dumper& theDumper) const FeaturePtr aBase = feature(); const std::string& aDocName = theDumper.name(aBase->document()); - AttributeSelectionListPtr anAttrObjects = + AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Intersection::OBJECT_LIST_ID()); - AttributeSelectionListPtr anAttrTools = + AttributeSelectionListPtr anAttrTools = aBase->selectionList(FeaturesPlugin_Intersection::TOOL_LIST_ID()); theDumper << aBase << " = model.addIntersection(" << aDocName << ", " diff --git a/src/FeaturesAPI/FeaturesAPI_Pipe.cpp b/src/FeaturesAPI/FeaturesAPI_Pipe.cpp index 97ce2d8a2..40213134d 100644 --- a/src/FeaturesAPI/FeaturesAPI_Pipe.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Pipe.cpp @@ -118,7 +118,7 @@ void FeaturesAPI_Pipe::dump(ModelHighAPI_Dumper& theDumper) const FeaturePtr aBase = feature(); const std::string& aDocName = theDumper.name(aBase->document()); - AttributeSelectionListPtr anAttrObjects = + AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Pipe::BASE_OBJECTS_ID()); AttributeSelectionPtr anAttrPath = aBase->selection(FeaturesPlugin_Pipe::PATH_OBJECT_ID()); diff --git a/src/FeaturesAPI/FeaturesAPI_Placement.h b/src/FeaturesAPI/FeaturesAPI_Placement.h index b6068a7b9..4650ff1eb 100644 --- a/src/FeaturesAPI/FeaturesAPI_Placement.h +++ b/src/FeaturesAPI/FeaturesAPI_Placement.h @@ -41,11 +41,11 @@ public: virtual ~FeaturesAPI_Placement(); INTERFACE_5(FeaturesPlugin_Placement::ID(), - objects, FeaturesPlugin_Placement::OBJECTS_LIST_ID(), + objects, FeaturesPlugin_Placement::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList, /** Main objects */, startShape, FeaturesPlugin_Placement::START_SHAPE_ID(), ModelAPI_AttributeSelection, /** Start shape */, - endShape, FeaturesPlugin_Placement::END_SHAPE_ID(), + endShape, FeaturesPlugin_Placement::END_SHAPE_ID(), ModelAPI_AttributeSelection, /** End shape */, reverseDirection, FeaturesPlugin_Placement::REVERSE_ID(), ModelAPI_AttributeBoolean, /** Reverse direction flag */, diff --git a/src/FeaturesAPI/FeaturesAPI_Recover.h b/src/FeaturesAPI/FeaturesAPI_Recover.h index 862e018a2..2263ae84f 100644 --- a/src/FeaturesAPI/FeaturesAPI_Recover.h +++ b/src/FeaturesAPI/FeaturesAPI_Recover.h @@ -39,9 +39,9 @@ public: virtual ~FeaturesAPI_Recover(); INTERFACE_3(FeaturesPlugin_Recover::ID(), - baseFeature, FeaturesPlugin_Recover::BASE_FEATURE(), + baseFeature, FeaturesPlugin_Recover::BASE_FEATURE(), ModelAPI_AttributeReference, /** Concealed feature */, - recoveredList, FeaturesPlugin_Recover::RECOVERED_ENTITIES(), + recoveredList, FeaturesPlugin_Recover::RECOVERED_ENTITIES(), ModelAPI_AttributeRefList, /** Recover list*/, isPersistent, FeaturesPlugin_Recover::PERSISTENT(), ModelAPI_AttributeBoolean, /** Is persistent flag */) diff --git a/src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.cpp b/src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.cpp index ab5841b5b..5847f8ff2 100644 --- a/src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.cpp +++ b/src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.cpp @@ -59,7 +59,7 @@ void FeaturesAPI_RemoveSubShapes::dump(ModelHighAPI_Dumper& theDumper) const FeaturePtr aBase = feature(); const std::string& aDocName = theDumper.name(aBase->document()); - AttributeSelectionPtr anAttrBaseShape = + AttributeSelectionPtr anAttrBaseShape = aBase->selection(FeaturesPlugin_RemoveSubShapes::BASE_SHAPE_ID()); AttributeSelectionListPtr anAttrSubShapes = aBase->selectionList(FeaturesPlugin_RemoveSubShapes::SUBSHAPES_ID()); diff --git a/src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.h b/src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.h index 86fe3e437..dab90093d 100644 --- a/src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.h +++ b/src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.h @@ -37,9 +37,9 @@ public: virtual ~FeaturesAPI_RemoveSubShapes(); INTERFACE_2(FeaturesPlugin_RemoveSubShapes::ID(), - base, FeaturesPlugin_RemoveSubShapes::BASE_SHAPE_ID(), + base, FeaturesPlugin_RemoveSubShapes::BASE_SHAPE_ID(), ModelAPI_AttributeSelection, /** Base */, - subshapes, FeaturesPlugin_RemoveSubShapes::SUBSHAPES_ID(), + subshapes, FeaturesPlugin_RemoveSubShapes::SUBSHAPES_ID(), ModelAPI_AttributeSelectionList, /** Subshapes */) /// Modify objects attribute of the feature. diff --git a/src/FeaturesAPI/FeaturesAPI_Revolution.cpp b/src/FeaturesAPI/FeaturesAPI_Revolution.cpp index a0dd09ed4..1df4213f8 100644 --- a/src/FeaturesAPI/FeaturesAPI_Revolution.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Revolution.cpp @@ -162,7 +162,7 @@ void FeaturesAPI_Revolution::dump(ModelHighAPI_Dumper& theDumper) const anAttrSketch->isInitialized() ? theDumper << "[]" : theDumper << anAttrObjects; theDumper << ", " << anAttrAxis; - std::string aCreationMethod = + std::string aCreationMethod = aBase->string(FeaturesPlugin_Revolution::CREATION_METHOD())->value(); if(aCreationMethod == FeaturesPlugin_Revolution::CREATION_METHOD_BY_ANGLES()) { @@ -178,7 +178,7 @@ void FeaturesAPI_Revolution::dump(ModelHighAPI_Dumper& theDumper) const aBase->selection(FeaturesPlugin_Revolution::FROM_OBJECT_ID()); AttributeDoublePtr anAttrFromOffset = aBase->real(FeaturesPlugin_Revolution::FROM_OFFSET_ID()); - theDumper << ", " << anAttrToObject << ", " << anAttrToOffset << + theDumper << ", " << anAttrToObject << ", " << anAttrToOffset << ", " << anAttrFromObject << ", " << anAttrFromOffset; } diff --git a/src/FeaturesAPI/FeaturesAPI_Revolution.h b/src/FeaturesAPI/FeaturesAPI_Revolution.h index fad2ce17b..18de9fbcf 100644 --- a/src/FeaturesAPI/FeaturesAPI_Revolution.h +++ b/src/FeaturesAPI/FeaturesAPI_Revolution.h @@ -58,7 +58,7 @@ public: virtual ~FeaturesAPI_Revolution(); INTERFACE_10(FeaturesPlugin_Revolution::ID(), - sketch, FeaturesPlugin_Revolution::SKETCH_ID(), + sketch, FeaturesPlugin_Revolution::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */, baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */, @@ -93,14 +93,14 @@ public: /// Modify CreationMethod, to_angle, from_angle attributes of the feature. FEATURESAPI_EXPORT - void setAngles(const ModelHighAPI_Double& theToAngle, + void setAngles(const ModelHighAPI_Double& theToAngle, const ModelHighAPI_Double& theFromAngle); /// Modify CreationMethod, to_angle, from_angle attributes of the feature. FEATURESAPI_EXPORT void setAngle(const ModelHighAPI_Double& theAngle); - /// Modify CreationMethod, to_object, to_offset, + /// Modify CreationMethod, to_object, to_offset, /// from_object, from_offset attributes of the feature. FEATURESAPI_EXPORT void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject, diff --git a/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp b/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp index bfdca9b56..175715211 100644 --- a/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp +++ b/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp @@ -129,7 +129,7 @@ void FeaturesAPI_RevolutionBoolean::dump(ModelHighAPI_Dumper& theDumper) const anAttrSketch->isInitialized() ? theDumper << "[]" : theDumper << anAttrObjects; theDumper << ", " << anAttrAxis; - std::string aCreationMethod = + std::string aCreationMethod = aBase->string(FeaturesPlugin_Revolution::CREATION_METHOD())->value(); if(aCreationMethod == FeaturesPlugin_Revolution::CREATION_METHOD_BY_ANGLES()) { @@ -142,12 +142,12 @@ void FeaturesAPI_RevolutionBoolean::dump(ModelHighAPI_Dumper& theDumper) const aBase->selection(FeaturesPlugin_Revolution::TO_OBJECT_ID()); AttributeDoublePtr anAttrToOffset = aBase->real(FeaturesPlugin_Revolution::TO_OFFSET_ID()); - AttributeSelectionPtr anAttrFromObject = + AttributeSelectionPtr anAttrFromObject = aBase->selection(FeaturesPlugin_Revolution::FROM_OBJECT_ID()); - AttributeDoublePtr anAttrFromOffset = + AttributeDoublePtr anAttrFromOffset = aBase->real(FeaturesPlugin_Revolution::FROM_OFFSET_ID()); - theDumper << ", " << anAttrToObject << ", " << anAttrToOffset << + theDumper << ", " << anAttrToObject << ", " << anAttrToOffset << ", " << anAttrFromObject << ", " << anAttrFromOffset; } @@ -246,9 +246,9 @@ RevolutionCutPtr addRevolutionCut(const std::shared_ptr& theP const ModelHighAPI_Double& theSize, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_RevolutionCut::ID()); - return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature, theBaseObjects, + return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature, theBaseObjects, theAxis, theSize, theBooleanObjects)); } @@ -260,7 +260,7 @@ RevolutionCutPtr addRevolutionCut(const std::shared_ptr& theP const ModelHighAPI_Double& theFromAngle, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_RevolutionCut::ID()); return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature, theBaseObjects, @@ -280,7 +280,7 @@ RevolutionCutPtr addRevolutionCut(const std::shared_ptr& theP const ModelHighAPI_Double& theFromOffset, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_RevolutionCut::ID()); return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature, theBaseObjects, @@ -371,9 +371,9 @@ RevolutionFusePtr addRevolutionFuse(const std::shared_ptr& th const ModelHighAPI_Double& theSize, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID()); - return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature, theBaseObjects, + return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature, theBaseObjects, theAxis, theSize, theBooleanObjects)); } @@ -385,7 +385,7 @@ RevolutionFusePtr addRevolutionFuse(const std::shared_ptr& th const ModelHighAPI_Double& theFromAngle, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID()); return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature, theBaseObjects, @@ -405,7 +405,7 @@ RevolutionFusePtr addRevolutionFuse(const std::shared_ptr& th const ModelHighAPI_Double& theFromOffset, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID()); return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature, theBaseObjects, diff --git a/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.h b/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.h index 10daa0d3d..6cf0ba4dc 100644 --- a/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.h +++ b/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.h @@ -75,7 +75,7 @@ public: FEATURESAPI_EXPORT void setAngle(const ModelHighAPI_Double& theAngle); - /// Modify creation_method, to_object, to_offset, from_object, + /// Modify creation_method, to_object, to_offset, from_object, /// from_offset attributes of the feature. FEATURESAPI_EXPORT void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject, diff --git a/src/FeaturesAPI/FeaturesAPI_Translation.cpp b/src/FeaturesAPI/FeaturesAPI_Translation.cpp index 07717134d..6b0995482 100644 --- a/src/FeaturesAPI/FeaturesAPI_Translation.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Translation.cpp @@ -86,6 +86,6 @@ TranslationPtr addTranslation(const std::shared_ptr& thePart, const ModelHighAPI_Double& theDistance) { std::shared_ptr aFeature = thePart->addFeature(FeaturesAPI_Translation::ID()); - return TranslationPtr(new FeaturesAPI_Translation(aFeature, theMainObjects, + return TranslationPtr(new FeaturesAPI_Translation(aFeature, theMainObjects, theAxisObject, theDistance)); } diff --git a/src/FeaturesAPI/FeaturesAPI_Union.cpp b/src/FeaturesAPI/FeaturesAPI_Union.cpp index ca8f0d6fc..2d85df81a 100644 --- a/src/FeaturesAPI/FeaturesAPI_Union.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Union.cpp @@ -49,7 +49,7 @@ void FeaturesAPI_Union::dump(ModelHighAPI_Dumper& theDumper) const AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID()); - theDumper << aBase << " = model.addUnion(" << aDocName << + theDumper << aBase << " = model.addUnion(" << aDocName << ", " << anAttrObjects << ")" << std::endl; } diff --git a/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp index dedb288a0..d265fb37c 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp @@ -37,7 +37,7 @@ void FeaturesPlugin_Boolean::initAttributes() { data()->addAttribute(FeaturesPlugin_Boolean::TYPE_ID(), ModelAPI_AttributeInteger::typeId()); - AttributeSelectionListPtr aSelection = + AttributeSelectionListPtr aSelection = std::dynamic_pointer_cast(data()->addAttribute( FeaturesPlugin_Boolean::OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList::typeId())); @@ -76,7 +76,7 @@ void FeaturesPlugin_Boolean::execute() std::map, ListOfShape> aCompSolidsObjects; // Getting objects. - AttributeSelectionListPtr anObjectsSelList = + AttributeSelectionListPtr anObjectsSelList = selectionList(FeaturesPlugin_Boolean::OBJECT_LIST_ID()); for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) { AttributeSelectionPtr anObjectAttr = anObjectsSelList->value(anObjectsIndex); @@ -88,7 +88,7 @@ void FeaturesPlugin_Boolean::execute() ResultCompSolidPtr aResCompSolidPtr = ModelAPI_Tools::compSolidOwner(aContext); if(aResCompSolidPtr.get()) { std::shared_ptr aContextShape = aResCompSolidPtr->shape(); - std::map, ListOfShape>::iterator + std::map, ListOfShape>::iterator anIt = aCompSolidsObjects.begin(); for(; anIt != aCompSolidsObjects.end(); anIt++) { if(anIt->first->isEqual(aContextShape)) { @@ -138,7 +138,7 @@ void FeaturesPlugin_Boolean::execute() } // For solids cut each object with all tools. - for(ListOfShape::iterator + for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end(); anObjectsIt++) { std::shared_ptr anObject = *anObjectsIt; ListOfShape aListWithObject; @@ -148,13 +148,13 @@ void FeaturesPlugin_Boolean::execute() switch(aType) { case BOOL_CUT: { - aBoolAlgo = + aBoolAlgo = GeomAlgoAPI_Boolean(aListWithObject, aTools, GeomAlgoAPI_Boolean::BOOL_CUT); aResShape = aBoolAlgo.shape(); break; } case BOOL_COMMON: { - aBoolAlgo = + aBoolAlgo = GeomAlgoAPI_Boolean(aListWithObject, aTools, GeomAlgoAPI_Boolean::BOOL_COMMON); aResShape = aBoolAlgo.shape(); break; @@ -199,7 +199,7 @@ void FeaturesPlugin_Boolean::execute() if(GeomAlgoAPI_ShapeTools::volume(aResShape) > 1.e-27) { std::shared_ptr aResultBody = document()->createBody(data(), aResultIndex); - loadNamingDS(aResultBody, anObject, aTools, aResShape, + loadNamingDS(aResultBody, anObject, aTools, aResShape, aBoolAlgo, *aBoolAlgo.mapOfSubShapes().get()); setResult(aResultBody, aResultIndex); aResultIndex++; @@ -207,7 +207,7 @@ void FeaturesPlugin_Boolean::execute() } // Compsolids handling - for(std::map, ListOfShape>::iterator + for(std::map, ListOfShape>::iterator anIt = aCompSolidsObjects.begin(); anIt != aCompSolidsObjects.end(); anIt++) { std::shared_ptr aCompSolid = anIt->first; @@ -215,7 +215,7 @@ void FeaturesPlugin_Boolean::execute() // Collecting solids from compsolids which will not be modified in boolean operation. ListOfShape aNotUsedSolids; - for(GeomAPI_ShapeExplorer + for(GeomAPI_ShapeExplorer anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) { std::shared_ptr aSolidInCompSolid = anExp.current(); ListOfShape::iterator anIt = aUsedInOperationSolids.begin(); @@ -287,9 +287,9 @@ void FeaturesPlugin_Boolean::execute() aMapOfShapes.merge(aFillerAlgo->mapOfSubShapes()); if(GeomAlgoAPI_ShapeTools::volume(aFillerAlgo->shape()) > 1.e-27) { - std::shared_ptr aResultBody = + std::shared_ptr aResultBody = document()->createBody(data(), aResultIndex); - loadNamingDS(aResultBody, aCompSolid, aTools, + loadNamingDS(aResultBody, aCompSolid, aTools, aFillerAlgo->shape(), aMakeShapeList, aMapOfShapes); setResult(aResultBody, aResultIndex); aResultIndex++; @@ -298,7 +298,7 @@ void FeaturesPlugin_Boolean::execute() break; } case BOOL_FUSE: { - if((anObjects.size() + aTools.size() + + if((anObjects.size() + aTools.size() + aCompSolidsObjects.size() + anEdgesAndFaces.size()) < 2) { std::string aFeatureError = "Error: Not enough objects for boolean operation."; setError(aFeatureError); @@ -310,19 +310,19 @@ void FeaturesPlugin_Boolean::execute() aSolidsToFuse.insert(aSolidsToFuse.end(), anObjects.begin(), anObjects.end()); aSolidsToFuse.insert(aSolidsToFuse.end(), aTools.begin(), aTools.end()); - // Collecting solids from compsolids which will not be modified + // Collecting solids from compsolids which will not be modified // in boolean operation and will be added to result. ListOfShape aShapesToAdd; - for(std::map, ListOfShape>::iterator + for(std::map, ListOfShape>::iterator anIt = aCompSolidsObjects.begin(); anIt != aCompSolidsObjects.end(); anIt++) { std::shared_ptr aCompSolid = anIt->first; ListOfShape& aUsedInOperationSolids = anIt->second; - aSolidsToFuse.insert(aSolidsToFuse.end(), aUsedInOperationSolids.begin(), + aSolidsToFuse.insert(aSolidsToFuse.end(), aUsedInOperationSolids.begin(), aUsedInOperationSolids.end()); // Collect solids from compsolid which will not be modified in boolean operation. - for(GeomAPI_ShapeExplorer + for(GeomAPI_ShapeExplorer anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) { std::shared_ptr aSolidInCompSolid = anExp.current(); ListOfShape::iterator anIt = aUsedInOperationSolids.begin(); @@ -353,13 +353,13 @@ void FeaturesPlugin_Boolean::execute() aMapOfShapes.merge(aCutAlgo->mapOfSubShapes()); } } - anOriginalShapes.insert(anOriginalShapes.end(), anEdgesAndFaces.begin(), + anOriginalShapes.insert(anOriginalShapes.end(), anEdgesAndFaces.begin(), anEdgesAndFaces.end()); // If we have compsolids then cut with not used solids all others. if(!aShapesToAdd.empty()) { aSolidsToFuse.clear(); - for(ListOfShape::iterator + for(ListOfShape::iterator anIt = anOriginalShapes.begin(); anIt != anOriginalShapes.end(); anIt++) { ListOfShape aOneObjectList; aOneObjectList.push_back(*anIt); @@ -449,9 +449,9 @@ void FeaturesPlugin_Boolean::execute() std::shared_ptr aBackShape = anOriginalShapes.back(); anOriginalShapes.pop_back(); - std::shared_ptr aResultBody = + std::shared_ptr aResultBody = document()->createBody(data(), aResultIndex); - loadNamingDS(aResultBody, aBackShape, anOriginalShapes, + loadNamingDS(aResultBody, aBackShape, anOriginalShapes, aShape, aMakeShapeList, aMapOfShapes); setResult(aResultBody, aResultIndex); aResultIndex++; @@ -476,17 +476,17 @@ void FeaturesPlugin_Boolean::execute() // Collecting solids from compsolids which will not be modified in // boolean operation and will be added to result. ListOfShape aShapesToAdd; - for(std::map, ListOfShape>::iterator + for(std::map, ListOfShape>::iterator anIt = aCompSolidsObjects.begin(); anIt != aCompSolidsObjects.end(); anIt++) { std::shared_ptr aCompSolid = anIt->first; ListOfShape& aUsedInOperationSolids = anIt->second; anOriginalShapes.push_back(aCompSolid); - aShapesToSmash.insert(aShapesToSmash.end(), aUsedInOperationSolids.begin(), + aShapesToSmash.insert(aShapesToSmash.end(), aUsedInOperationSolids.begin(), aUsedInOperationSolids.end()); // Collect solids from compsolid which will not be modified in boolean operation. - for(GeomAPI_ShapeExplorer + for(GeomAPI_ShapeExplorer anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) { std::shared_ptr aSolidInCompSolid = anExp.current(); ListOfShape::iterator anIt = aUsedInOperationSolids.begin(); @@ -582,9 +582,9 @@ void FeaturesPlugin_Boolean::execute() std::shared_ptr aFrontShape = anOriginalShapes.front(); anOriginalShapes.pop_front(); - std::shared_ptr aResultBody = + std::shared_ptr aResultBody = document()->createBody(data(), aResultIndex); - loadNamingDS(aResultBody, aFrontShape, anOriginalShapes, + loadNamingDS(aResultBody, aFrontShape, anOriginalShapes, aShape, aMakeShapeList, aMapOfShapes); setResult(aResultBody, aResultIndex); aResultIndex++; @@ -616,7 +616,7 @@ void FeaturesPlugin_Boolean::loadNamingDS(std::shared_ptr t const int aModifyTag = 1; const int aDeletedTag = 2; /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids - const int aSubsolidsTag = 3; + const int aSubsolidsTag = 3; const int anEdgesAndFacesTag = 10000; theResultBody->storeModified(theBaseShape, theResultShape, aSubsolidsTag); @@ -627,12 +627,12 @@ void FeaturesPlugin_Boolean::loadNamingDS(std::shared_ptr t theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::FACE, aModifyTag, aModName, theMapOfShapes); - theResultBody->loadDeletedShapes(&theMakeShape, theBaseShape, + theResultBody->loadDeletedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::FACE, aDeletedTag); int aTag; std::string aName; - for(ListOfShape::const_iterator + for(ListOfShape::const_iterator anIter = theTools.begin(); anIter != theTools.end(); anIter++) { if((*anIter)->shapeType() == GeomAPI_Shape::EDGE) { aTag = anEdgesAndFacesTag; @@ -645,7 +645,7 @@ void FeaturesPlugin_Boolean::loadNamingDS(std::shared_ptr t aTag = aModifyTag; aName = aModName; } - theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, + theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, aName == aModEName ? GeomAPI_Shape::EDGE : GeomAPI_Shape::FACE, aTag, aName, theMapOfShapes); theResultBody->loadDeletedShapes(&theMakeShape, *anIter, GeomAPI_Shape::FACE, aDeletedTag); diff --git a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp index 44ea7eddd..f3dbf0683 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp @@ -36,7 +36,7 @@ void FeaturesPlugin_CompositeBoolean::executeCompositeBoolean() // Getting tools. ListOfShape aTools; - for(ListOfMakeShape::const_iterator + for(ListOfMakeShape::const_iterator anIt = aGenMakeShapes.cbegin(); anIt != aGenMakeShapes.cend(); ++anIt) { aTools.push_back((*anIt)->shape()); } @@ -133,7 +133,7 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, } // For solids cut each object with all tools. - for(ListOfShape::const_iterator + for(ListOfShape::const_iterator anIt = anObjects.cbegin(); anIt != anObjects.cend(); ++anIt) { GeomShapePtr anObject = *anIt; ListOfShape aListWithObject; @@ -162,7 +162,7 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, // Collecting solids from compsolids which will not be modified in boolean operation. ListOfShape aShapesToAdd; - for(GeomAPI_ShapeExplorer + for(GeomAPI_ShapeExplorer anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) { GeomShapePtr aSolidInCompSolid = anExp.current(); ListOfShape::const_iterator aUsedShapesIt = aUsedShapes.cbegin(); @@ -224,7 +224,7 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, } } - if((anObjects.size() + aTools.size() + + if((anObjects.size() + aTools.size() + aCompSolidsObjects.size() + anEdgesAndFaces.size()) < 2) { myFeature->setError("Error: Not enough objects for boolean operation."); return false; @@ -235,7 +235,7 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, aSolidsToFuse.insert(aSolidsToFuse.end(), anObjects.begin(), anObjects.end()); aSolidsToFuse.insert(aSolidsToFuse.end(), aTools.begin(), aTools.end()); - // Collecting solids from compsolids which will not be + // Collecting solids from compsolids which will not be // modified in boolean operation and will be added to result. ListOfShape aShapesToAdd; for(std::map::iterator anIt = aCompSolidsObjects.begin(); @@ -245,7 +245,7 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, aSolidsToFuse.insert(aSolidsToFuse.end(), aUsedShapes.begin(), aUsedShapes.end()); // Collect solids from compsolid which will not be modified in boolean operation. - for(GeomAPI_ShapeExplorer + for(GeomAPI_ShapeExplorer anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) { GeomShapePtr aSolidInCompSolid = anExp.current(); ListOfShape::iterator anIt = aUsedShapes.begin(); @@ -372,7 +372,7 @@ void FeaturesPlugin_CompositeBoolean::storeModificationHistory(ResultBodyPtr the aTag = aModTag; aName = aModName; } - theResultBody->loadAndOrientModifiedShapes(theMakeShape.get(), *anIt, + theResultBody->loadAndOrientModifiedShapes(theMakeShape.get(), *anIt, (*anIt)->shapeType() == GeomAPI_Shape::EDGE ? GeomAPI_Shape::EDGE : GeomAPI_Shape::FACE, aTag, aName, *aMap.get()); theResultBody->loadDeletedShapes(theMakeShape.get(), *anIt, GeomAPI_Shape::FACE, aDelTag); diff --git a/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.cpp b/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.cpp index da470abe1..06320e03c 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.cpp @@ -69,7 +69,7 @@ int FeaturesPlugin_CompositeSketch::numberOfSubs(bool forTree) const } //================================================================================================= -std::shared_ptr FeaturesPlugin_CompositeSketch::subFeature(const int theIndex, +std::shared_ptr FeaturesPlugin_CompositeSketch::subFeature(const int theIndex, bool forTree) { if(theIndex == 0) { @@ -149,7 +149,7 @@ void FeaturesPlugin_CompositeSketch::getBaseShapes(ListOfShape& theBaseShapesLis } ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aBaseObjectSelection->context()); - if(aConstruction.get() && !aBaseShape->isEqual(aConstruction->shape()) && + if(aConstruction.get() && !aBaseShape->isEqual(aConstruction->shape()) && aST == GeomAPI_Shape::WIRE) { // It is a wire on the sketch, store it to make face later. aSketchWiresMap[aConstruction].push_back(aBaseShape); @@ -172,7 +172,7 @@ void FeaturesPlugin_CompositeSketch::getBaseShapes(ListOfShape& theBaseShapesLis aBaseShape = aConstruction->shape(); if(aBaseShape.get() && !aBaseShape->isNull()) { GeomAPI_Shape::ShapeType aST = aBaseShape->shapeType(); - if(aST != GeomAPI_Shape::VERTEX && aST != GeomAPI_Shape::EDGE && + if(aST != GeomAPI_Shape::VERTEX && aST != GeomAPI_Shape::EDGE && aST != GeomAPI_Shape::WIRE && aST != GeomAPI_Shape::FACE && aST != GeomAPI_Shape::SHELL) { setError("Error: Selected shapes has unsupported type."); @@ -213,7 +213,7 @@ void FeaturesPlugin_CompositeSketch::getBaseShapes(ListOfShape& theBaseShapesLis ListOfShape aShells; ListOfShape aFreeFaces; GeomShapePtr aFacesCompound = GeomAlgoAPI_CompoundBuilder::compound(aBaseFacesList); - GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL, + GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL, aShells, aFreeFaces); theBaseShapesList.insert(theBaseShapesList.end(), aFreeFaces.begin(), aFreeFaces.end()); theBaseShapesList.insert(theBaseShapesList.end(), aShells.begin(), aShells.end()); @@ -304,30 +304,30 @@ void FeaturesPlugin_CompositeSketch::storeGenerationHistory(ResultBodyPtr theRes } } - if(aShapeTypeToExplode == GeomAPI_Shape::VERTEX || + if(aShapeTypeToExplode == GeomAPI_Shape::VERTEX || aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) { - theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(), theBaseShape, + theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(), theBaseShape, GeomAPI_Shape::VERTEX, - theTag++, aGenName + "Edge", + theTag++, aGenName + "Edge", *aMapOfSubShapes.get()); } - if(aShapeTypeToExplode == GeomAPI_Shape::EDGE || + if(aShapeTypeToExplode == GeomAPI_Shape::EDGE || aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) { - theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(), + theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(), theBaseShape, GeomAPI_Shape::EDGE, theTag++, aGenName + "Face", *aMapOfSubShapes.get()); } - std::shared_ptr aMakeSweep = + std::shared_ptr aMakeSweep = std::dynamic_pointer_cast(theMakeShape); if(aMakeSweep.get()) { // Store from shapes. - storeShapes(theResultBody, aBaseShapeType, aMapOfSubShapes, + storeShapes(theResultBody, aBaseShapeType, aMapOfSubShapes, aMakeSweep->fromShapes(), "From_", theTag); // Store to shapes. - storeShapes(theResultBody, aBaseShapeType, aMapOfSubShapes, + storeShapes(theResultBody, aBaseShapeType, aMapOfSubShapes, aMakeSweep->toShapes(), "To_", theTag); } } diff --git a/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.h b/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.h index 46620a2ed..5cfefa7e4 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.h +++ b/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.h @@ -40,7 +40,7 @@ public: FEATURESPLUGIN_EXPORT virtual int numberOfSubs(bool forTree = false) const; /// \return the sub-feature by zero-base index. - FEATURESPLUGIN_EXPORT virtual + FEATURESPLUGIN_EXPORT virtual std::shared_ptr subFeature(const int theIndex, bool forTree = false); /// \return the sub-feature unique identifier in this composite feature by zero-base index. diff --git a/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.cpp index 2fa5ea282..b4cd6e44a 100755 --- a/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.cpp @@ -27,6 +27,6 @@ void FeaturesPlugin_ExtrusionBoolean::storeGenerationHistory(ResultBodyPtr theRe const std::shared_ptr theMakeShape, int& theTag) { - FeaturesPlugin_Extrusion::storeGenerationHistory(theResultBody, theBaseShape, + FeaturesPlugin_Extrusion::storeGenerationHistory(theResultBody, theBaseShape, theMakeShape, theTag); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.h b/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.h index 76a45d8c5..e524805b9 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.h +++ b/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.h @@ -13,7 +13,7 @@ /// \class FeaturesPlugin_ExtrusionBoolean /// \ingroup Plugins /// \brief Interface for the composite extrusion feature. -class FeaturesPlugin_ExtrusionBoolean: public FeaturesPlugin_Extrusion, +class FeaturesPlugin_ExtrusionBoolean: public FeaturesPlugin_Extrusion, public FeaturesPlugin_CompositeBoolean { public: diff --git a/src/FeaturesPlugin/FeaturesPlugin_Intersection.cpp b/src/FeaturesPlugin/FeaturesPlugin_Intersection.cpp index 55a254d73..3e04656b1 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Intersection.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Intersection.cpp @@ -24,9 +24,9 @@ FeaturesPlugin_Intersection::FeaturesPlugin_Intersection() //================================================================================================= void FeaturesPlugin_Intersection::initAttributes() { - data()->addAttribute(FeaturesPlugin_Intersection::OBJECT_LIST_ID(), + data()->addAttribute(FeaturesPlugin_Intersection::OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList::typeId()); - data()->addAttribute(FeaturesPlugin_Intersection::TOOL_LIST_ID(), + data()->addAttribute(FeaturesPlugin_Intersection::TOOL_LIST_ID(), ModelAPI_AttributeSelectionList::typeId()); } @@ -36,10 +36,10 @@ void FeaturesPlugin_Intersection::execute() ListOfShape anObjects, aTools; // Getting objects. - AttributeSelectionListPtr anObjectsSelList = + AttributeSelectionListPtr anObjectsSelList = selectionList(FeaturesPlugin_Intersection::OBJECT_LIST_ID()); for (int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) { - std::shared_ptr anObjectAttr = + std::shared_ptr anObjectAttr = anObjectsSelList->value(anObjectsIndex); std::shared_ptr anObject = anObjectAttr->value(); if (!anObject.get()) { @@ -49,7 +49,7 @@ void FeaturesPlugin_Intersection::execute() } // Getting tools. - AttributeSelectionListPtr aToolsSelList = + AttributeSelectionListPtr aToolsSelList = selectionList(FeaturesPlugin_Intersection::TOOL_LIST_ID()); for (int aToolsIndex = 0; aToolsIndex < aToolsSelList->size(); aToolsIndex++) { std::shared_ptr aToolAttr = aToolsSelList->value(aToolsIndex); @@ -68,7 +68,7 @@ void FeaturesPlugin_Intersection::execute() int aResultIndex = 0; // Create result for each object. - for (ListOfShape::iterator + for (ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end(); anObjectsIt++) { std::shared_ptr anObject = *anObjectsIt; ListOfShape aListWithObject; aListWithObject.push_back(anObject); @@ -112,7 +112,7 @@ void FeaturesPlugin_Intersection::loadNamingDS(std::shared_ptr aMapOfShapes = theMakeShape.mapOfSubShapes(); const int aDeletedTag = 1; /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids - const int aSubsolidsTag = 2; + const int aSubsolidsTag = 2; const int aModifyTag = 100000; int aModifyToolsTag = 200000; std::ostringstream aStream; diff --git a/src/FeaturesPlugin/FeaturesPlugin_Intersection.h b/src/FeaturesPlugin/FeaturesPlugin_Intersection.h index 1b87fff36..844766c58 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Intersection.h +++ b/src/FeaturesPlugin/FeaturesPlugin_Intersection.h @@ -18,7 +18,7 @@ class GeomAlgoAPI_MakeShape; /// \class FeaturesPlugin_Intersection /// \ingroup Plugins /// \brief Intersection feature takes a list of shapes as objects and list of shapes as tools. -/// The types of objects and tools may be different: +/// The types of objects and tools may be different: /// whole objects, compsoilds, solids, shells, faces or edges. /// The result is less than the minimal dimension from pair of intersection: /// for two solids or two faces it is wire, for the edge and face it is vertex, etc. diff --git a/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp b/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp index 9268f95d7..5272cd818 100755 --- a/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp @@ -131,7 +131,7 @@ void FeaturesPlugin_Partition::storeResult( const std::shared_ptr theMakeShape, const int theIndex) { - // Find base. The most complicated is the real modified object (#1799 if box is partitioned by + // Find base. The most complicated is the real modified object (#1799 if box is partitioned by // two planes the box is the base, not planes, independently on the order in the list). GeomShapePtr aBaseShape; for(ListOfShape::const_iterator anIt = theObjects.cbegin(); anIt != theObjects.cend(); ++anIt) { @@ -163,7 +163,7 @@ void FeaturesPlugin_Partition::storeResult( const int aDelTag = 1; /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids - const int aSubTag = 2; + const int aSubTag = 2; int aModTag = aSubTag + 10000; const std::string aModName = "Modified"; @@ -204,7 +204,7 @@ GeomShapePtr findBase(const GeomShapePtr theObjectShape, GeomShapePtr anObjectSubShape = anObjectSubShapesExp.current(); ListOfShape aModifiedShapes; theMakeShape->modified(anObjectSubShape, aModifiedShapes); - for(ListOfShape::const_iterator + for(ListOfShape::const_iterator aModIt = aModifiedShapes.cbegin(); aModIt != aModifiedShapes.cend(); ++aModIt) { GeomShapePtr aModShape = *aModIt; if(aMapOfSubShapes->isBound(aModShape)) { diff --git a/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp b/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp index af528e2ff..b02103c32 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp @@ -78,7 +78,7 @@ void FeaturesPlugin_Pipe::execute() GeomAPI_Shape::ShapeType aST = aBaseShape->shapeType(); ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aBaseObjectSelection->context()); - if(aConstruction.get() && !aBaseShape->isEqual(aConstruction->shape()) && + if(aConstruction.get() && !aBaseShape->isEqual(aConstruction->shape()) && aST == GeomAPI_Shape::WIRE) { // It is a wire on the sketch, store it to make face later. aSketchWiresMap[aConstruction].push_back(aBaseShape); @@ -89,7 +89,7 @@ void FeaturesPlugin_Pipe::execute() } } else { // This may be the whole sketch result selected, check and get faces. - ResultConstructionPtr aConstruction = + ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aBaseObjectSelection->context()); if(!aConstruction.get()) { setError("Error: One of selected sketches does not have results."); @@ -105,7 +105,7 @@ void FeaturesPlugin_Pipe::execute() } } else { for(int aFaceIndex = 0; aFaceIndex < aFacesNum; aFaceIndex++) { - std::shared_ptr aBaseFace = + std::shared_ptr aBaseFace = std::dynamic_pointer_cast(aConstruction->face(aFaceIndex)); if(!aBaseFace.get() || aBaseFace->isNull()) { setError("Error: One of the faces on selected sketch is Null."); @@ -135,9 +135,9 @@ void FeaturesPlugin_Pipe::execute() if(aCreationMethod == CREATION_METHOD_SIMPLE()) { ListOfShape aShells; ListOfShape aFreeFaces; - std::shared_ptr aFacesCompound = + std::shared_ptr aFacesCompound = GeomAlgoAPI_CompoundBuilder::compound(aBaseFacesList); - GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL, + GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL, aShells, aFreeFaces); aBaseShapesList.insert(aBaseShapesList.end(), aFreeFaces.begin(), aFreeFaces.end()); aBaseShapesList.insert(aBaseShapesList.end(), aShells.begin(), aShells.end()); @@ -151,7 +151,7 @@ void FeaturesPlugin_Pipe::execute() setError("Error: Path selection is empty."); return; } - std::shared_ptr aPathShape = + std::shared_ptr aPathShape = std::dynamic_pointer_cast(aPathSelection->value()); if(!aPathShape.get()) { // Probaply it is a construction. @@ -210,7 +210,7 @@ void FeaturesPlugin_Pipe::execute() // Generating result for each object. int aResultIndex = 0; - if(aCreationMethod == CREATION_METHOD_SIMPLE() || + if(aCreationMethod == CREATION_METHOD_SIMPLE() || aCreationMethod == CREATION_METHOD_BINORMAL()) { for(ListOfShape::const_iterator anIter = aBaseShapesList.cbegin(); anIter != aBaseShapesList.cend(); anIter++) { @@ -317,23 +317,23 @@ void FeaturesPlugin_Pipe::storeResult(const std::shared_ptr theBa } } - if(aShapeTypeToExplode == GeomAPI_Shape::VERTEX || + if(aShapeTypeToExplode == GeomAPI_Shape::VERTEX || aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) { aResultBody->loadAndOrientGeneratedShapes(&thePipeAlgo, theBaseShape, GeomAPI_Shape::VERTEX, aGenTag++, aGenName + "Edge", *aMapOfSubShapes.get()); } - if(aShapeTypeToExplode == GeomAPI_Shape::EDGE || + if(aShapeTypeToExplode == GeomAPI_Shape::EDGE || aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) { aResultBody->loadAndOrientGeneratedShapes(&thePipeAlgo, theBaseShape, GeomAPI_Shape::EDGE, aGenTag++, aGenName + "Face", *aMapOfSubShapes.get()); } - aResultBody->loadAndOrientGeneratedShapes(&thePipeAlgo, theBaseShape, aShapeTypeToExplode, + aResultBody->loadAndOrientGeneratedShapes(&thePipeAlgo, theBaseShape, aShapeTypeToExplode, aGenTag++, aGenName, *aMapOfSubShapes.get()); // Store from shapes. int aFromTag = aGenTag; - storeShapes(aResultBody, aBaseShapeType, aMapOfSubShapes, + storeShapes(aResultBody, aBaseShapeType, aMapOfSubShapes, thePipeAlgo.fromShapes(), "From_", aFromTag); // Store to shapes. @@ -358,7 +358,7 @@ void FeaturesPlugin_Pipe::storeResult(const ListOfShape& theBaseShapes, int aGenTag = 1; std::shared_ptr aMapOfSubShapes = thePipeAlgo.mapOfSubShapes(); - for(ListOfShape::const_iterator + for(ListOfShape::const_iterator anIter = theBaseShapes.cbegin(); anIter != theBaseShapes.cend(); anIter++) { GeomShapePtr aBaseShape = *anIter; GeomAPI_Shape::ShapeType aBaseShapeType = aBaseShape->shapeType(); @@ -398,7 +398,7 @@ void FeaturesPlugin_Pipe::storeResult(const ListOfShape& theBaseShapes, // Store to shapes. int aToTag = aFromTag; - storeShapes(aResultBody, theBaseShapes.back()->shapeType(), + storeShapes(aResultBody, theBaseShapes.back()->shapeType(), aMapOfSubShapes, thePipeAlgo.toShapes(), "To", aToTag); diff --git a/src/FeaturesPlugin/FeaturesPlugin_Pipe.h b/src/FeaturesPlugin/FeaturesPlugin_Pipe.h index 9fedeee8c..9d7932466 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Pipe.h +++ b/src/FeaturesPlugin/FeaturesPlugin_Pipe.h @@ -17,7 +17,7 @@ /// \class FeaturesPlugin_Pipe /// \ingroup Plugins /// \brief Feature for creation of extrusion along a path. -/// Pipe creates extrusion of objects along a path. +/// Pipe creates extrusion of objects along a path. /// It produces the following results from objects:\n /// Vertex -> Edge\n /// Edge -> Face\n diff --git a/src/FeaturesPlugin/FeaturesPlugin_Placement.cpp b/src/FeaturesPlugin/FeaturesPlugin_Placement.cpp index d3fc14903..5702921e2 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Placement.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Placement.cpp @@ -27,7 +27,7 @@ FeaturesPlugin_Placement::FeaturesPlugin_Placement() void FeaturesPlugin_Placement::initAttributes() { - AttributeSelectionListPtr aSelection = + AttributeSelectionListPtr aSelection = std::dynamic_pointer_cast(data()->addAttribute( OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList::typeId())); @@ -47,7 +47,7 @@ void FeaturesPlugin_Placement::execute() return; } for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) { - std::shared_ptr anObjectAttr = + std::shared_ptr anObjectAttr = anObjectsSelList->value(anObjectsIndex); std::shared_ptr anObject = anObjectAttr->value(); if(!anObject.get()) { // may be for not-activated parts @@ -144,7 +144,7 @@ void FeaturesPlugin_Placement::execute() anObjectsIt++, aContext++) { // for part results just set transformation - if ((*aContext)->groupName() == ModelAPI_ResultPart::group()) { + if ((*aContext)->groupName() == ModelAPI_ResultPart::group()) { ResultPartPtr anOrigin = std::dynamic_pointer_cast(*aContext); ResultPartPtr aResultPart = document()->copyPart(anOrigin, data(), aResultIndex); aResultPart->setTrsf(aContextRes, aTrsf); @@ -171,7 +171,7 @@ void FeaturesPlugin_Placement::execute() } //LoadNamingDS - std::shared_ptr aResultBody = + std::shared_ptr aResultBody = document()->createBody(data(), aResultIndex); loadNamingDS(aTransformAlgo, aResultBody, aBaseShape); setResult(aResultBody, aResultIndex); diff --git a/src/FeaturesPlugin/FeaturesPlugin_RemoveSubShapes.cpp b/src/FeaturesPlugin/FeaturesPlugin_RemoveSubShapes.cpp index e29d8558f..222880d87 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_RemoveSubShapes.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_RemoveSubShapes.cpp @@ -45,7 +45,7 @@ void FeaturesPlugin_RemoveSubShapes::attributeChanged(const std::string& theID) aSubShapesAttrList->clear(); ResultPtr aContext = aShapeAttrSelection->context(); - ResultCompSolidPtr aResultCompSolid = + ResultCompSolidPtr aResultCompSolid = std::dynamic_pointer_cast(aContext); if(!aResultCompSolid.get()) { return; diff --git a/src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp b/src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp index 4ef29b4da..d4005402a 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp @@ -61,7 +61,7 @@ void FeaturesPlugin_Revolution::execute() int aResultIndex = 0; ListOfShape::const_iterator aBaseIt = aBaseShapesList.cbegin(); ListOfMakeShape::const_iterator anAlgoIt = aMakeShapesList.cbegin(); - for(; aBaseIt != aBaseShapesList.cend() && anAlgoIt != aMakeShapesList.cend(); + for(; aBaseIt != aBaseShapesList.cend() && anAlgoIt != aMakeShapesList.cend(); ++aBaseIt, ++anAlgoIt) { storeResult(*aBaseIt, *anAlgoIt, aResultIndex++); } @@ -134,7 +134,7 @@ bool FeaturesPlugin_Revolution::makeRevolutions(ListOfShape& theBaseShapes, } // Generating result for each base shape. - for(ListOfShape::const_iterator + for(ListOfShape::const_iterator anIter = theBaseShapes.cbegin(); anIter != theBaseShapes.cend(); anIter++) { GeomShapePtr aBaseShape = *anIter; diff --git a/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.h b/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.h index 371cc0905..2d6fab5af 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.h +++ b/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.h @@ -13,7 +13,7 @@ /// \class FeaturesPlugin_RevolutionBoolean /// \ingroup Plugins /// \brief Interface for the composite revolution feature. -class FeaturesPlugin_RevolutionBoolean : public FeaturesPlugin_Revolution, +class FeaturesPlugin_RevolutionBoolean : public FeaturesPlugin_Revolution, public FeaturesPlugin_CompositeBoolean { public: diff --git a/src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp b/src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp index 59b02f42e..1e0dd3c29 100755 --- a/src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp @@ -22,11 +22,11 @@ FeaturesPlugin_Rotation::FeaturesPlugin_Rotation() //================================================================================================= void FeaturesPlugin_Rotation::initAttributes() { - AttributeSelectionListPtr aSelection = + AttributeSelectionListPtr aSelection = std::dynamic_pointer_cast(data()->addAttribute( FeaturesPlugin_Rotation::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList::typeId())); - data()->addAttribute(FeaturesPlugin_Rotation::AXIS_OBJECT_ID(), + data()->addAttribute(FeaturesPlugin_Rotation::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection::typeId()); data()->addAttribute(FeaturesPlugin_Rotation::ANGLE_ID(), ModelAPI_AttributeDouble::typeId()); } @@ -37,13 +37,13 @@ void FeaturesPlugin_Rotation::execute() // Getting objects. ListOfShape anObjects; std::list aContextes; - AttributeSelectionListPtr anObjectsSelList = + AttributeSelectionListPtr anObjectsSelList = selectionList(FeaturesPlugin_Rotation::OBJECTS_LIST_ID()); if (anObjectsSelList->size() == 0) { return; } for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) { - std::shared_ptr anObjectAttr = + std::shared_ptr anObjectAttr = anObjectsSelList->value(anObjectsIndex); std::shared_ptr anObject = anObjectAttr->value(); if(!anObject.get()) { @@ -60,12 +60,12 @@ void FeaturesPlugin_Rotation::execute() selection(FeaturesPlugin_Rotation::AXIS_OBJECT_ID()); if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(anObjRef->value())); - } else if (anObjRef && !anObjRef->value() && anObjRef->context() && + } else if (anObjRef && !anObjRef->value() && anObjRef->context() && anObjRef->context()->shape() && anObjRef->context()->shape()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(anObjRef->context()->shape())); } if(anEdge) { - anAxis = std::shared_ptr(new GeomAPI_Ax1(anEdge->line()->location(), + anAxis = std::shared_ptr(new GeomAPI_Ax1(anEdge->line()->location(), anEdge->line()->direction())); } @@ -75,7 +75,7 @@ void FeaturesPlugin_Rotation::execute() // Rotating each object. int aResultIndex = 0; std::list::iterator aContext = aContextes.begin(); - for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end(); + for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end(); anObjectsIt++, aContext++) { std::shared_ptr aBaseShape = *anObjectsIt; bool isPart = (*aContext)->groupName() == ModelAPI_ResultPart::group(); diff --git a/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp b/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp index a060576f0..30b64de12 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp @@ -24,7 +24,7 @@ FeaturesPlugin_Translation::FeaturesPlugin_Translation() //================================================================================================= void FeaturesPlugin_Translation::initAttributes() { - AttributeSelectionListPtr aSelection = + AttributeSelectionListPtr aSelection = std::dynamic_pointer_cast(data()->addAttribute( FeaturesPlugin_Translation::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList::typeId())); @@ -40,13 +40,13 @@ void FeaturesPlugin_Translation::execute() // Getting objects. ListOfShape anObjects; std::list aContextes; - AttributeSelectionListPtr anObjectsSelList = + AttributeSelectionListPtr anObjectsSelList = selectionList(FeaturesPlugin_Translation::OBJECTS_LIST_ID()); if (anObjectsSelList->size() == 0) { return; } for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) { - std::shared_ptr anObjectAttr = + std::shared_ptr anObjectAttr = anObjectsSelList->value(anObjectsIndex); std::shared_ptr anObject = anObjectAttr->value(); if(!anObject.get()) { // may be for not-activated parts @@ -60,16 +60,16 @@ void FeaturesPlugin_Translation::execute() //Getting axis. std::shared_ptr anAxis; std::shared_ptr anEdge; - std::shared_ptr anObjRef = + std::shared_ptr anObjRef = selection(FeaturesPlugin_Translation::AXIS_OBJECT_ID()); if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(anObjRef->value())); - } else if (anObjRef && !anObjRef->value() && anObjRef->context() && + } else if (anObjRef && !anObjRef->value() && anObjRef->context() && anObjRef->context()->shape() && anObjRef->context()->shape()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(anObjRef->context()->shape())); } if(anEdge) { - anAxis = std::shared_ptr(new GeomAPI_Ax1(anEdge->line()->location(), + anAxis = std::shared_ptr(new GeomAPI_Ax1(anEdge->line()->location(), anEdge->line()->direction())); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_Union.cpp b/src/FeaturesPlugin/FeaturesPlugin_Union.cpp index a7c62749a..7cafc45fe 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Union.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Union.cpp @@ -34,7 +34,7 @@ void FeaturesPlugin_Union::execute() std::map, ListOfShape> aCompSolidsObjects; // Getting objects. - AttributeSelectionListPtr anObjectsSelList = + AttributeSelectionListPtr anObjectsSelList = selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID()); for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) { AttributeSelectionPtr anObjectAttr = anObjectsSelList->value(anObjectsIndex); @@ -46,7 +46,7 @@ void FeaturesPlugin_Union::execute() ResultCompSolidPtr aResCompSolidPtr = ModelAPI_Tools::compSolidOwner(aContext); if(aResCompSolidPtr.get()) { std::shared_ptr aContextShape = aResCompSolidPtr->shape(); - std::map, ListOfShape>::iterator + std::map, ListOfShape>::iterator anIt = aCompSolidsObjects.begin(); for(; anIt != aCompSolidsObjects.end(); anIt++) { if(anIt->first->isEqual(aContextShape)) { @@ -65,7 +65,7 @@ void FeaturesPlugin_Union::execute() // Collecting solids from compsolids which will not be modified in // boolean operation and will be added to result. ListOfShape aShapesToAdd; - for(std::map, ListOfShape>::iterator + for(std::map, ListOfShape>::iterator anIt = aCompSolidsObjects.begin(); anIt != aCompSolidsObjects.end(); anIt++) { std::shared_ptr aCompSolid = anIt->first; @@ -150,7 +150,7 @@ void FeaturesPlugin_Union::execute() const int aModifyTag = 1; const int aDeletedTag = 2; /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids - const int aSubsolidsTag = 3; + const int aSubsolidsTag = 3; const std::string aModName = "Modified"; std::shared_ptr aResultBody = document()->createBody(data()); diff --git a/src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp b/src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp index c7a92abe0..23d0c1b68 100755 --- a/src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp @@ -22,7 +22,7 @@ bool FeaturesPlugin_ValidatorTransform::isValid(const AttributePtr& theAttribute return false; } - std::shared_ptr aCurSelList = + std::shared_ptr aCurSelList = std::dynamic_pointer_cast(theAttribute); DocumentPtr aDocument = theAttribute->owner()->document(); diff --git a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp index 107815387..5f27c10ce 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp @@ -44,7 +44,7 @@ bool FeaturesPlugin_ValidatorPipePath::isValid(const AttributePtr& theAttribute, const std::list& theArguments, Events_InfoMessage& theError) const { - AttributeSelectionPtr aPathAttrSelection = + AttributeSelectionPtr aPathAttrSelection = std::dynamic_pointer_cast(theAttribute); if(!aPathAttrSelection.get()) { theError = "Error: This validator can only work with path selector in \"Pipe\" feature."; @@ -58,7 +58,7 @@ bool FeaturesPlugin_ValidatorPipePath::isValid(const AttributePtr& theAttribute, return false; } GeomShapePtr aContextShape = aContext->shape(); - if(aPathShape.get() && aPathShape->shapeType() == GeomAPI_Shape::WIRE && + if(aPathShape.get() && aPathShape->shapeType() == GeomAPI_Shape::WIRE && !aPathShape->isEqual(aContextShape)) { theError = "Error: Local selection of wires not allowed."; return false; @@ -108,7 +108,7 @@ bool FeaturesPlugin_ValidatorPipeLocations::isValid( return false; } - if(aLocationsSelectionList->size() > 0 && + if(aLocationsSelectionList->size() > 0 && aLocationsSelectionList->size() != aBaseObjectsSelectionList->size()) { theError = "Error: Number of locations should be the same as base objects."; return false; @@ -118,7 +118,7 @@ bool FeaturesPlugin_ValidatorPipeLocations::isValid( } //================================================================================================== -bool FeaturesPlugin_ValidatorPipeLocations::isNotObligatory(std::string theFeature, +bool FeaturesPlugin_ValidatorPipeLocations::isNotObligatory(std::string theFeature, std::string theAttribute) { return false; @@ -157,10 +157,10 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theA return false; } - ResultConstructionPtr aResultConstruction = + ResultConstructionPtr aResultConstruction = std::dynamic_pointer_cast(aContext); if(!aResultConstruction.get()) { - // It is not a result construction. + // It is not a result construction. // If shape is compound check that it contains only faces and edges. GeomShapePtr aShape = aSelectionAttr->value(); if(!aShape.get()) { @@ -209,7 +209,7 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theA } if(aSelectedWiresFromObjects.isBound(aWire)) { - theError = + theError = "Error: Objects with such wire already selected. Don't allow to select this object."; return false; } @@ -236,7 +236,7 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute std::string anAttributeType = theAttribute->attributeType(); if(anAttributeType == ModelAPI_AttributeSelectionList::typeId()) { - AttributeSelectionListPtr aListAttr = + AttributeSelectionListPtr aListAttr = std::dynamic_pointer_cast(theAttribute); for(int anIndex = 0; anIndex < aListAttr->size(); ++anIndex) { // If at least one attribute is invalid, the result is false. @@ -246,7 +246,7 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute } } else if(anAttributeType == ModelAPI_AttributeSelection::typeId()) { // Getting context. - AttributeSelectionPtr anAttr = + AttributeSelectionPtr anAttr = std::dynamic_pointer_cast(theAttribute); ResultPtr aContext = anAttr->context(); if(!aContext.get()) { @@ -264,7 +264,7 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute return false; } - ResultConstructionPtr aConstruction = + ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aContext); if(aConstruction.get()) { // Construciotn selected. Check that is is not infinite. @@ -280,7 +280,7 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute } } else { // Shape on construction selected. Check that it is a face or wire. - if(aShape->shapeType() == GeomAPI_Shape::WIRE || + if(aShape->shapeType() == GeomAPI_Shape::WIRE || aShape->shapeType() == GeomAPI_Shape::FACE) { return true; } @@ -380,7 +380,7 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid( return false; } - std::list::const_iterator + std::list::const_iterator anArgsIt = theArguments.begin(), aLast = theArguments.end(); AttributePtr aCheckAttribute = theFeature->attribute(*anArgsIt); @@ -413,7 +413,7 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid( std::shared_ptr aDirEdge(new GeomAPI_Edge(aDirShape)); // If faces selected check that direction not parallel with them. - AttributeSelectionListPtr aListAttr = + AttributeSelectionListPtr aListAttr = std::dynamic_pointer_cast(aCheckAttribute); for(int anIndex = 0; anIndex < aListAttr->size(); ++anIndex) { AttributeSelectionPtr anAttr = aListAttr->value(anIndex); @@ -422,9 +422,9 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid( aShapeInList = anAttr->context()->shape(); } bool isParallel = true; - if(aShapeInList->shapeType() == GeomAPI_Shape::FACE || + if(aShapeInList->shapeType() == GeomAPI_Shape::FACE || aShapeInList->shapeType() == GeomAPI_Shape::SHELL) { - for(GeomAPI_ShapeExplorer + for(GeomAPI_ShapeExplorer anExp(aShapeInList, GeomAPI_Shape::FACE); anExp.more(); anExp.next()) { std::shared_ptr aFace(new GeomAPI_Face(anExp.current())); isParallel = GeomAlgoAPI_ShapeTools::isParallel(aDirEdge, aFace); @@ -433,7 +433,7 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid( } } } else if(aShapeInList->shapeType() == GeomAPI_Shape::COMPOUND) { - std::shared_ptr aPlanarEdges = + std::shared_ptr aPlanarEdges = std::dynamic_pointer_cast(aShapeInList); if(aPlanarEdges.get()) { std::shared_ptr aSketchDir = aPlanarEdges->norm(); @@ -450,7 +450,7 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid( isParallel = false; } if(isParallel) { - theError = + theError = "Error: Direction is parallel to one of the selected face or face on selected shell."; return false; } @@ -460,7 +460,7 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid( } //================================================================================================== -bool FeaturesPlugin_ValidatorExtrusionDir::isNotObligatory(std::string theFeature, +bool FeaturesPlugin_ValidatorExtrusionDir::isNotObligatory(std::string theFeature, std::string theAttribute) { return false; @@ -476,7 +476,7 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isShapesCanBeEmpty(const AttributePtr std::string anAttributeType = theAttribute->attributeType(); if(anAttributeType == ModelAPI_AttributeSelectionList::typeId()) { - AttributeSelectionListPtr aListAttr = + AttributeSelectionListPtr aListAttr = std::dynamic_pointer_cast(theAttribute); for(int anIndex = 0; anIndex < aListAttr->size(); ++anIndex) { // If at least one attribute is invalid, the result is false. @@ -486,7 +486,7 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isShapesCanBeEmpty(const AttributePtr } } else if(anAttributeType == ModelAPI_AttributeSelection::typeId()) { // Getting context. - AttributeSelectionPtr anAttr = + AttributeSelectionPtr anAttr = std::dynamic_pointer_cast(theAttribute); ResultPtr aContext = anAttr->context(); if(!aContext.get()) { @@ -519,10 +519,10 @@ bool FeaturesPlugin_ValidatorBooleanSelection::isValid(const AttributePtr& theAt const std::list& theArguments, Events_InfoMessage& theError) const { - AttributeSelectionListPtr anAttrSelectionList = + AttributeSelectionListPtr anAttrSelectionList = std::dynamic_pointer_cast(theAttribute); if(!anAttrSelectionList.get()) { - theError = + theError = "Error: This validator can only work with selection list attributes in \"Boolean\" feature."; return false; } @@ -589,7 +589,7 @@ bool FeaturesPlugin_ValidatorPartitionSelection::isValid(const AttributePtr& the const std::list& theArguments, Events_InfoMessage& theError) const { - AttributeSelectionListPtr anAttrSelectionList = + AttributeSelectionListPtr anAttrSelectionList = std::dynamic_pointer_cast(theAttribute); if(!anAttrSelectionList.get()) { theError = "Error: This validator can only work with selection list in \"Partition\" feature."; @@ -610,14 +610,14 @@ bool FeaturesPlugin_ValidatorPartitionSelection::isValid(const AttributePtr& the } ResultPtr aContext = aSelectAttr->context(); - ResultConstructionPtr aResultConstruction = + ResultConstructionPtr aResultConstruction = std::dynamic_pointer_cast(aContext); if(aResultConstruction.get()) { theError = "Error: Only body shapes and construction planes are allowed for selection."; return false; } - ResultCompSolidPtr aResultCompsolid = + ResultCompSolidPtr aResultCompsolid = std::dynamic_pointer_cast(aContext); if(aResultCompsolid.get()) { continue; @@ -636,10 +636,10 @@ bool FeaturesPlugin_ValidatorRemoveSubShapesSelection::isValid(const AttributePt const std::list& theArguments, Events_InfoMessage& theError) const { - AttributeSelectionListPtr aSubShapesAttrList = + AttributeSelectionListPtr aSubShapesAttrList = std::dynamic_pointer_cast(theAttribute); if(!aSubShapesAttrList.get()) { - theError = + theError = "Error: This validator can only work with selection list in \"Remove Sub-Shapes\" feature."; return false; } @@ -752,7 +752,7 @@ bool FeaturesPlugin_ValidatorUnionSelection::isValid(const AttributePtr& theAttr const std::list& theArguments, Events_InfoMessage& theError) const { - AttributeSelectionListPtr aBaseObjectsAttrList = + AttributeSelectionListPtr aBaseObjectsAttrList = std::dynamic_pointer_cast(theAttribute); if(!aBaseObjectsAttrList.get()) { theError = "Error: This validator can only work with selection list in \"%1\" feature."; @@ -763,7 +763,7 @@ bool FeaturesPlugin_ValidatorUnionSelection::isValid(const AttributePtr& theAttr for(int anIndex = 0; anIndex < aBaseObjectsAttrList->size(); ++anIndex) { bool isSameFound = false; AttributeSelectionPtr anAttrSelectionInList = aBaseObjectsAttrList->value(anIndex); - ResultCompSolidPtr aResult = + ResultCompSolidPtr aResult = std::dynamic_pointer_cast(anAttrSelectionInList->context()); if(!aResult.get()) { continue; @@ -791,7 +791,7 @@ bool FeaturesPlugin_ValidatorUnionArguments::isValid( } // Get base objects attribute list. - AttributeSelectionListPtr aBaseObejctsAttrList = + AttributeSelectionListPtr aBaseObejctsAttrList = theFeature->selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID()); if(!aBaseObejctsAttrList.get()) { theError = "Error: Could not get \"%1\" attribute."; diff --git a/src/GeomAPI/GeomAPI_AISObject.cpp b/src/GeomAPI/GeomAPI_AISObject.cpp index bc6aa29a4..7f2fd8011 100644 --- a/src/GeomAPI/GeomAPI_AISObject.cpp +++ b/src/GeomAPI/GeomAPI_AISObject.cpp @@ -44,7 +44,7 @@ GeomAPI_AISObject::GeomAPI_AISObject() GeomAPI_AISObject::~GeomAPI_AISObject() { if (!empty()) { - // This is necessary for correct deletion of Handle entity. + // This is necessary for correct deletion of Handle entity. // Without this Handle does not decremented counter to 0 Handle(AIS_InteractiveObject) *anAIS = implPtr(); anAIS->Nullify(); @@ -75,7 +75,7 @@ void GeomAPI_AISObject::createShape(std::shared_ptr theShape) // Set default point as a '+' symbol Handle(AIS_Shape) aShape = new AIS_Shape(aTDS); Handle(Prs3d_Drawer) aDrawer = aShape->Attributes(); - if (aDrawer->HasOwnPointAspect()) + if (aDrawer->HasOwnPointAspect()) aDrawer->PointAspect()->SetTypeOfMarker(Aspect_TOM_PLUS); else aDrawer->SetPointAspect(new Prs3d_PointAspect(Aspect_TOM_PLUS, Quantity_NOC_YELLOW, 1.)); @@ -181,7 +181,7 @@ void GeomAPI_AISObject::createRadius(std::shared_ptr theCircle, // TODO: a bug in AIS_RadiusDimension: // The anchor point can't be myCirc.Location() - an exception is raised. // But we need exactly this case... - // We want to show a radius dimension starting from the circle centre and + // We want to show a radius dimension starting from the circle centre and // ending at the user-defined point. // Also, if anchor point coincides with myP2, the radius dimension is not displayed at all. std::shared_ptr anAnchor = theCircle->project(theFlyoutPoint); diff --git a/src/GeomAPI/GeomAPI_AISObject.h b/src/GeomAPI/GeomAPI_AISObject.h index 1030aa06b..70e06b9be 100644 --- a/src/GeomAPI/GeomAPI_AISObject.h +++ b/src/GeomAPI/GeomAPI_AISObject.h @@ -26,14 +26,14 @@ class GeomAPI_AISObject : public GeomAPI_Interface { public: /// \brief Creation of empty AIS object - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_AISObject(); - GEOMAPI_EXPORT + GEOMAPI_EXPORT ~GeomAPI_AISObject(); /// \brief Creates AIS_Shape object using specified shape - GEOMAPI_EXPORT + GEOMAPI_EXPORT void createShape(std::shared_ptr theShape); /// Reyirns shape used for the presentation creation (can be NULL) @@ -46,7 +46,7 @@ class GeomAPI_AISObject : public GeomAPI_Interface * \param[in] thePlane the plane which contains all points above * \param[in] theDistance value of the distance to be shown */ - GEOMAPI_EXPORT + GEOMAPI_EXPORT void createDistance(std::shared_ptr theStartPoint, std::shared_ptr theEndPoint, std::shared_ptr theFlyoutPoint, @@ -57,7 +57,7 @@ class GeomAPI_AISObject : public GeomAPI_Interface * e.g. the distance points are equal. * \return a boolean result */ - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool isEmptyDistanceGeometry(); /** \brief Creates AIS_RadiusDimension object @@ -65,7 +65,7 @@ class GeomAPI_AISObject : public GeomAPI_Interface * \param[in] theFlyoutPoint the flyout of dimension * \param[in] theRadius value of the radius to be shown */ - GEOMAPI_EXPORT + GEOMAPI_EXPORT void createRadius(std::shared_ptr theCircle, std::shared_ptr theFlyoutPoint, double theRadius); @@ -75,7 +75,7 @@ class GeomAPI_AISObject : public GeomAPI_Interface * \param[in] theFlyoutPoint the flyout point for relation * \param[in] thePlane the plane which contains the lines */ - GEOMAPI_EXPORT + GEOMAPI_EXPORT void createParallel(std::shared_ptr theLine1, std::shared_ptr theLine2, std::shared_ptr theFlyoutPoint, @@ -86,7 +86,7 @@ class GeomAPI_AISObject : public GeomAPI_Interface * \param[in] theLine2 second parallel line * \param[in] thePlane the plane which contains the lines */ - GEOMAPI_EXPORT + GEOMAPI_EXPORT void createPerpendicular(std::shared_ptr theLine1, std::shared_ptr theLine2, std::shared_ptr thePlane); @@ -95,14 +95,14 @@ class GeomAPI_AISObject : public GeomAPI_Interface * \param[in] theShape the object * \param[in] thePlane the plane which contains the lines */ - GEOMAPI_EXPORT + GEOMAPI_EXPORT void createFixed(std::shared_ptr theShape, std::shared_ptr thePlane); /** \brief Assigns the color for the shape * \param[in] theColor index of the color */ - GEOMAPI_EXPORT + GEOMAPI_EXPORT void setColor(const int& theColor); /** \brief Assigns the color for the shape @@ -111,7 +111,7 @@ class GeomAPI_AISObject : public GeomAPI_Interface * \param[in] theB value of the blue component * \returns true if the presentation color is changed */ - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool setColor(int theR, int theG, int theB); /** \brief Returns the color for the shape @@ -119,52 +119,52 @@ class GeomAPI_AISObject : public GeomAPI_Interface * \param[in] theG value of the green component * \param[in] theB value of the blue component */ - GEOMAPI_EXPORT + GEOMAPI_EXPORT void getColor(int& theR, int& theG, int& theB); /** \brief Assigns the deflection to the shape * \param[in] theDeflection value of deflection */ - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool setDeflection(const double theDeflection); /** \brief Returns deflection for the shape * \return double value */ - GEOMAPI_EXPORT + GEOMAPI_EXPORT double getDeflection() const; /// \return Current width of the lines of shape - GEOMAPI_EXPORT + GEOMAPI_EXPORT double width(); /// \brief Assigns the width of the lines of shape - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool setWidth(const double& theWidth); /// \brief Checks if the object is empty - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool empty() const; /// Return shape type according to TopAbs_ShapeEnum if the AIS is AIS_Shape /// Otherwise returns -1 - GEOMAPI_EXPORT + GEOMAPI_EXPORT int getShapeType() const; /// Sets marker type for vertex. /// The type has to be defined according to Acpect_TypeOfMarker - GEOMAPI_EXPORT + GEOMAPI_EXPORT void setPointMarker(int theType, double theScale); /// Set line type of edges /// Has to be defined according to Aspect_TypeOfLine /// \returns true if the object value differs from the current - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool setLineStyle(int theStyle); /// Set transparency of the presentation (theVal = 0 ... 1) /// \returns true if the object value differs from the current - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool setTransparensy(double theVal); }; diff --git a/src/GeomAPI/GeomAPI_Angle2d.h b/src/GeomAPI/GeomAPI_Angle2d.h index f7000e0a9..8f7ee596f 100644 --- a/src/GeomAPI/GeomAPI_Angle2d.h +++ b/src/GeomAPI/GeomAPI_Angle2d.h @@ -47,7 +47,7 @@ public: GEOMAPI_EXPORT double angleRadian(); /// Returns \c true if the line is reversed during angle calculation. - /// If theIndex = 0, the result corresponds to the first line, + /// If theIndex = 0, the result corresponds to the first line, /// if theIndex = 1, the to the second line GEOMAPI_EXPORT bool isReversed(int theIndex); }; diff --git a/src/GeomAPI/GeomAPI_Ax1.h b/src/GeomAPI/GeomAPI_Ax1.h index 8abe3e896..ecd9911e6 100644 --- a/src/GeomAPI/GeomAPI_Ax1.h +++ b/src/GeomAPI/GeomAPI_Ax1.h @@ -18,39 +18,39 @@ class GeomAPI_Ax1 : public GeomAPI_Interface { public: /// Default constructor. - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Ax1(); /** \brief Constructor. * \param[in] theOrigin point of origin. * \param[in] theDir direction of axis. */ - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Ax1(std::shared_ptr theOrigin, std::shared_ptr theDir); /// Sets origin point. - GEOMAPI_EXPORT + GEOMAPI_EXPORT void setOrigin(const std::shared_ptr& theOrigin); /// \return the plane origin point. - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr origin() const; /// Sets direction vector. - GEOMAPI_EXPORT + GEOMAPI_EXPORT void setDir(const std::shared_ptr& theDir); /// \return direction vector. - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr dir() const; /// Reverses the unit vector of this axis and assigns the result to this axis. - GEOMAPI_EXPORT + GEOMAPI_EXPORT void reverse(); /// \return reversed unit vector of this axis. - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr reversed(); }; diff --git a/src/GeomAPI/GeomAPI_Ax2.h b/src/GeomAPI/GeomAPI_Ax2.h index e190f78b2..1ad5bcc1a 100644 --- a/src/GeomAPI/GeomAPI_Ax2.h +++ b/src/GeomAPI/GeomAPI_Ax2.h @@ -18,7 +18,7 @@ class GeomAPI_Ax2 : public GeomAPI_Interface { public: /// Default constructor. - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Ax2(); /** \brief Constructor. @@ -26,7 +26,7 @@ public: * \param[in] theN direction of axis. * \param[in] theVX x direction of axis. */ - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Ax2(std::shared_ptr theOrigin, std::shared_ptr theN, std::shared_ptr theVX); @@ -35,24 +35,24 @@ public: * \param[in] theOrigin point of origin. * \param[in] theDir direction of axis. */ - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Ax2(std::shared_ptr theOrigin, std::shared_ptr theDir); /// Sets origin point. - GEOMAPI_EXPORT + GEOMAPI_EXPORT void setOrigin(const std::shared_ptr& theOrigin); /// \return the plane origin point. - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr origin() const; /// Sets direction vector. - GEOMAPI_EXPORT + GEOMAPI_EXPORT void setDir(const std::shared_ptr& theDir); /// \return direction vector. - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr dir() const; }; diff --git a/src/GeomAPI/GeomAPI_Ax3.cpp b/src/GeomAPI/GeomAPI_Ax3.cpp index 7dd2632ce..c2de37372 100644 --- a/src/GeomAPI/GeomAPI_Ax3.cpp +++ b/src/GeomAPI/GeomAPI_Ax3.cpp @@ -26,8 +26,8 @@ GeomAPI_Ax3::GeomAPI_Ax3() GeomAPI_Ax3::GeomAPI_Ax3(std::shared_ptr theOrigin, std::shared_ptr theDirX, std::shared_ptr theNorm) -: GeomAPI_Interface(new gp_Ax3(theOrigin->impl(), - theNorm->impl(), +: GeomAPI_Interface(new gp_Ax3(theOrigin->impl(), + theNorm->impl(), theDirX->impl())) { } diff --git a/src/GeomAPI/GeomAPI_Ax3.h b/src/GeomAPI/GeomAPI_Ax3.h index 589fbf70d..47cbb2a4a 100644 --- a/src/GeomAPI/GeomAPI_Ax3.h +++ b/src/GeomAPI/GeomAPI_Ax3.h @@ -20,61 +20,61 @@ class GeomAPI_Ax3 : public GeomAPI_Interface { public: /// Default constructor - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Ax3(); /// Constructor /// \param theOrigin point of origin /// \param theDirX direction of X axis /// \param theNorm direction of normal vector - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Ax3(std::shared_ptr theOrigin, std::shared_ptr theDirX, std::shared_ptr theNorm); /// Sets origin point - GEOMAPI_EXPORT + GEOMAPI_EXPORT void setOrigin(const std::shared_ptr& theOrigin); /// Returns the plane origin point - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr origin() const; /// Sets X direction vector - GEOMAPI_EXPORT + GEOMAPI_EXPORT void setDirX(const std::shared_ptr& theDirX); /// Returns X direction vector - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr dirX() const; /// Sets Y direction vector - GEOMAPI_EXPORT + GEOMAPI_EXPORT void setDirY(const std::shared_ptr& theDirY); /// Returns Y direction vector - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr dirY() const; /// Sets Z direction vector - GEOMAPI_EXPORT + GEOMAPI_EXPORT void setNormal(const std::shared_ptr& theNorm); /// Returns Z direction vector - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr normal() const; /// Converts 2d coordinates from the plane to 3d space point /// \param theX X coordinate /// \param theY Y coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr to3D(double theX, double theY) const; /// Converts 3d to 2d coordinates of the plane /// \param theX X coordinate /// \param theY Y coordinate /// \param theZ Z coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr to2D(double theX, double theY, double theZ) const; }; diff --git a/src/GeomAPI/GeomAPI_Circ.cpp b/src/GeomAPI/GeomAPI_Circ.cpp index 8988870ca..02683098d 100644 --- a/src/GeomAPI/GeomAPI_Circ.cpp +++ b/src/GeomAPI/GeomAPI_Circ.cpp @@ -90,7 +90,7 @@ const bool GeomAPI_Circ::parameter(const std::shared_ptr thePoint, double& theParameter) const { Handle(Geom_Circle) aCurve = new Geom_Circle(*MY_CIRC); - return GeomLib_Tool::Parameter(aCurve, thePoint->impl(), + return GeomLib_Tool::Parameter(aCurve, thePoint->impl(), theTolerance, theParameter) == Standard_True; } diff --git a/src/GeomAPI/GeomAPI_Circ2d.h b/src/GeomAPI/GeomAPI_Circ2d.h index d6ad5c755..df362c3e8 100644 --- a/src/GeomAPI/GeomAPI_Circ2d.h +++ b/src/GeomAPI/GeomAPI_Circ2d.h @@ -22,12 +22,12 @@ class GeomAPI_Circ2d : public GeomAPI_Interface { public: /// Creation of circle defined by center point and circle radius - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Circ2d(const std::shared_ptr& theCenter, const std::shared_ptr& theCirclePoint); /// Creation of circle defined by center point, direction and circle radius - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Circ2d(const std::shared_ptr& theCenter, const std::shared_ptr& theDir, double theRadius); @@ -38,15 +38,15 @@ class GeomAPI_Circ2d : public GeomAPI_Interface const std::shared_ptr& theThirdPoint); /// Return center of the circle - GEOMAPI_EXPORT + GEOMAPI_EXPORT const std::shared_ptr center() const; /// Return radius of the circle - GEOMAPI_EXPORT + GEOMAPI_EXPORT double radius() const; /// Project point on line - GEOMAPI_EXPORT + GEOMAPI_EXPORT const std::shared_ptr project( const std::shared_ptr& thePoint) const; diff --git a/src/GeomAPI/GeomAPI_Curve.h b/src/GeomAPI/GeomAPI_Curve.h index ecb8a79f8..c258f1fc6 100644 --- a/src/GeomAPI/GeomAPI_Curve.h +++ b/src/GeomAPI/GeomAPI_Curve.h @@ -21,36 +21,36 @@ class GeomAPI_Curve : public GeomAPI_Interface { public: /// Creation of empty (null) shape - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Curve(); /// Creates a curve from the shape (edge) - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Curve(const std::shared_ptr& theShape); /// Returns true if curve is not initialized - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool isNull() const; /// Returns whether the curve is linear - GEOMAPI_EXPORT + GEOMAPI_EXPORT virtual bool isLine() const; /// Returns whether the curve is circular - GEOMAPI_EXPORT + GEOMAPI_EXPORT virtual bool isCircle() const; /// Returns start parameter of the curve - GEOMAPI_EXPORT + GEOMAPI_EXPORT double startParam() const { return myStart; } /// Returns end parameter of the curve - GEOMAPI_EXPORT + GEOMAPI_EXPORT double endParam() const { return myEnd; } /// Returns point on the curve by parameter /// \param theParam parameter on the curve - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr getPoint(double theParam); private: diff --git a/src/GeomAPI/GeomAPI_DataMapOfShapeMapOfShapes.h b/src/GeomAPI/GeomAPI_DataMapOfShapeMapOfShapes.h index a2c020c27..ce6ae9133 100644 --- a/src/GeomAPI/GeomAPI_DataMapOfShapeMapOfShapes.h +++ b/src/GeomAPI/GeomAPI_DataMapOfShapeMapOfShapes.h @@ -22,7 +22,7 @@ public: /// \brief Binds list of shapes to the key shape. /// \param[in] theKey key shape. - /// \param[in] theItems list of shapes. + /// \param[in] theItems list of shapes. /// If shapes have duplications in list only one will be stored. /// \returns true if items bound successfully. GEOMAPI_EXPORT bool bind(const std::shared_ptr theKey, diff --git a/src/GeomAPI/GeomAPI_DataMapOfShapeShape.cpp b/src/GeomAPI/GeomAPI_DataMapOfShapeShape.cpp index a5b88c522..e71acbbe0 100644 --- a/src/GeomAPI/GeomAPI_DataMapOfShapeShape.cpp +++ b/src/GeomAPI/GeomAPI_DataMapOfShapeShape.cpp @@ -25,11 +25,11 @@ int GeomAPI_DataMapOfShapeShape::size() return implPtr()->Extent(); } -bool GeomAPI_DataMapOfShapeShape::bind(std::shared_ptr theKey, +bool GeomAPI_DataMapOfShapeShape::bind(std::shared_ptr theKey, std::shared_ptr theItem) { bool flag(false); - if (implPtr()->Bind(theKey->impl(), + if (implPtr()->Bind(theKey->impl(), theItem->impl())) flag = true; return flag; @@ -60,14 +60,14 @@ bool GeomAPI_DataMapOfShapeShape::isBound (std::shared_ptr theKey return flag; } -const std::shared_ptr +const std::shared_ptr GeomAPI_DataMapOfShapeShape::find(std::shared_ptr theKey) { - std::shared_ptr aShape(new GeomAPI_Shape()); + std::shared_ptr aShape(new GeomAPI_Shape()); aShape->setImpl( new TopoDS_Shape(impl().Find(theKey->impl()))); return aShape; -} +} bool GeomAPI_DataMapOfShapeShape::unBind(std::shared_ptr theKey) { diff --git a/src/GeomAPI/GeomAPI_DataMapOfShapeShape.h b/src/GeomAPI/GeomAPI_DataMapOfShapeShape.h index a507f6ed2..545608fde 100644 --- a/src/GeomAPI/GeomAPI_DataMapOfShapeShape.h +++ b/src/GeomAPI/GeomAPI_DataMapOfShapeShape.h @@ -33,7 +33,7 @@ class GeomAPI_DataMapOfShapeShape : public GeomAPI_Interface /// Adds \a theKey to me with \a theItem. Returns True if the Key was not already in the map. GEOMAPI_EXPORT - bool bind (const std::shared_ptr theKey, + bool bind (const std::shared_ptr theKey, const std::shared_ptr theItem); /// Merges two maps. diff --git a/src/GeomAPI/GeomAPI_Dir.cpp b/src/GeomAPI/GeomAPI_Dir.cpp index 52cab10c0..cbd8880a0 100644 --- a/src/GeomAPI/GeomAPI_Dir.cpp +++ b/src/GeomAPI/GeomAPI_Dir.cpp @@ -63,7 +63,7 @@ double GeomAPI_Dir::angle(const std::shared_ptr& theArg) const return MY_DIR->Angle(theArg->impl()); } -bool GeomAPI_Dir::isParallel(const std::shared_ptr theDir, +bool GeomAPI_Dir::isParallel(const std::shared_ptr theDir, const double theTolerance) const { return MY_DIR->IsParallel(theDir->impl(), theTolerance) == Standard_True; diff --git a/src/GeomAPI/GeomAPI_Dir.h b/src/GeomAPI/GeomAPI_Dir.h index 6a84d1c40..9231e58f7 100644 --- a/src/GeomAPI/GeomAPI_Dir.h +++ b/src/GeomAPI/GeomAPI_Dir.h @@ -21,44 +21,44 @@ class GeomAPI_Dir : public GeomAPI_Interface { public: /// Creation of direction by coordinates - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Dir(const double theX, const double theY, const double theZ); /// Creation of direction by coordinates - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Dir(const std::shared_ptr& theCoords); /// returns X coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT double x() const; /// returns Y coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT double y() const; /// returns Z coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT double z() const; /// returns coordinates of the direction - GEOMAPI_EXPORT + GEOMAPI_EXPORT const std::shared_ptr xyz(); /// inverses the direction GEOMAPI_EXPORT void reverse(); /// result is a scalar product of directions - GEOMAPI_EXPORT + GEOMAPI_EXPORT double dot(const std::shared_ptr& theArg) const; /// result is a cross product of two directions - GEOMAPI_EXPORT + GEOMAPI_EXPORT const std::shared_ptr cross(const std::shared_ptr& theArg) const; /// calculates angle between two directions - GEOMAPI_EXPORT + GEOMAPI_EXPORT double angle(const std::shared_ptr& theArg) const; - /// \return true if the angle between this unit vector and + /// \return true if the angle between this unit vector and /// theDir unit vector is equal to 0 or to Pi. - GEOMAPI_EXPORT - bool isParallel(const std::shared_ptr theDir, + GEOMAPI_EXPORT + bool isParallel(const std::shared_ptr theDir, const double theTolerance = 1.e-7) const; diff --git a/src/GeomAPI/GeomAPI_Dir2d.h b/src/GeomAPI/GeomAPI_Dir2d.h index 2e8cc227e..812904d72 100644 --- a/src/GeomAPI/GeomAPI_Dir2d.h +++ b/src/GeomAPI/GeomAPI_Dir2d.h @@ -21,35 +21,35 @@ class GeomAPI_Dir2d : public GeomAPI_Interface { public: /// Creation of direction by coordinates - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Dir2d(const double theX, const double theY); /// Creation of direction by coordinates - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Dir2d(const std::shared_ptr& theCoords); /// returns X coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT double x() const; /// returns Y coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT double y() const; /// returns coordinates of the direction - GEOMAPI_EXPORT + GEOMAPI_EXPORT const std::shared_ptr xy(); /// inverses the direction GEOMAPI_EXPORT void reverse(); /// result is a scalar product of directions - GEOMAPI_EXPORT + GEOMAPI_EXPORT double dot(const std::shared_ptr& theArg) const; /// result is a cross product of two directions - GEOMAPI_EXPORT + GEOMAPI_EXPORT double cross(const std::shared_ptr& theArg) const; /// calculates angle between two directions - GEOMAPI_EXPORT + GEOMAPI_EXPORT double angle(const std::shared_ptr& theArg) const; }; diff --git a/src/GeomAPI/GeomAPI_Edge.cpp b/src/GeomAPI/GeomAPI_Edge.cpp index 0a590bd99..21aa2c5ed 100644 --- a/src/GeomAPI/GeomAPI_Edge.cpp +++ b/src/GeomAPI/GeomAPI_Edge.cpp @@ -175,7 +175,7 @@ bool GeomAPI_Edge::isEqual(const std::shared_ptr theEdge) const gp_Pnt aInPnt1 = aInAdaptor.Value(aInStart); gp_Pnt aInPnt2 = aInAdaptor.Value(aInEnd); - if ((!aMyPnt1.IsEqual(aInPnt1, Precision::Confusion())) || + if ((!aMyPnt1.IsEqual(aInPnt1, Precision::Confusion())) || (!aMyPnt2.IsEqual(aInPnt2, Precision::Confusion()))) return false; diff --git a/src/GeomAPI/GeomAPI_Edge.h b/src/GeomAPI/GeomAPI_Edge.h index afe8243ea..83eaad634 100644 --- a/src/GeomAPI/GeomAPI_Edge.h +++ b/src/GeomAPI/GeomAPI_Edge.h @@ -23,47 +23,47 @@ class GeomAPI_Edge : public GeomAPI_Shape { public: /// Makes an undefined Edge (no geometry). - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Edge(); /// Creation of edge by the edge-shape - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Edge(const std::shared_ptr& theShape); /// Verifies that the edge is a line - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool isLine() const; /// Verifies that the edge is a circle - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool isCircle() const; /// Verifies that the edge is an arc of circle - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool isArc() const; - /// Returns the first vertex coordinates of the edge - GEOMAPI_EXPORT + /// Returns the first vertex coordinates of the edge + GEOMAPI_EXPORT std::shared_ptr firstPoint(); - /// Returns the Last vertex coordinates of the edge - GEOMAPI_EXPORT + /// Returns the Last vertex coordinates of the edge + GEOMAPI_EXPORT std::shared_ptr lastPoint(); /// Returns a circle if edge is based on the circle curve - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr circle(); /// Returns a line if edge is based on the linear curve - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr line(); /// Returns true if the current edge is geometrically equal to the given edge - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool isEqual(const std::shared_ptr theEdge) const; /// Returns range of parameter on the curve - GEOMAPI_EXPORT + GEOMAPI_EXPORT void getRange(double& theFirst, double& theLast) const; /// Returns true, if the edge is fully placed in the specified plane diff --git a/src/GeomAPI/GeomAPI_Face.cpp b/src/GeomAPI/GeomAPI_Face.cpp index 096c4bd16..e6453787e 100644 --- a/src/GeomAPI/GeomAPI_Face.cpp +++ b/src/GeomAPI/GeomAPI_Face.cpp @@ -77,7 +77,7 @@ bool GeomAPI_Face::isCylindrical() const { const TopoDS_Shape& aShape = const_cast(this)->impl(); Handle(Geom_Surface) aSurf = BRep_Tool::Surface(TopoDS::Face(aShape)); - Handle(Geom_RectangularTrimmedSurface) aTrimmed = + Handle(Geom_RectangularTrimmedSurface) aTrimmed = Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurf); if (!aTrimmed.IsNull()) aSurf = aTrimmed->BasisSurface(); diff --git a/src/GeomAPI/GeomAPI_Face.h b/src/GeomAPI/GeomAPI_Face.h index c47bc036a..54fb506c1 100644 --- a/src/GeomAPI/GeomAPI_Face.h +++ b/src/GeomAPI/GeomAPI_Face.h @@ -19,23 +19,23 @@ class GeomAPI_Face : public GeomAPI_Shape { public: /// Creation of empty (null) shape - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Face(); /// Creation of face by the face-shape - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Face(const std::shared_ptr& theShape); /// Returns true if the current face is geometrically equal to the given face - GEOMAPI_EXPORT + GEOMAPI_EXPORT virtual bool isEqual(const std::shared_ptr theFace) const; /// Returns true if the face is a cylindrical face - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool isCylindrical() const; /// Returns the base plane of the face (if it is planar) with location in the center of the face - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr getPlane() const; }; diff --git a/src/GeomAPI/GeomAPI_ICustomPrs.h b/src/GeomAPI/GeomAPI_ICustomPrs.h index 1129c1014..c249b11c3 100644 --- a/src/GeomAPI/GeomAPI_ICustomPrs.h +++ b/src/GeomAPI/GeomAPI_ICustomPrs.h @@ -26,7 +26,7 @@ public: GEOMAPI_EXPORT virtual ~GeomAPI_ICustomPrs(); /// Modifies the given presentation in the custom way. - virtual bool customisePresentation(std::shared_ptr theResult, + virtual bool customisePresentation(std::shared_ptr theResult, AISObjectPtr thePrs, std::shared_ptr theDefaultPrs) = 0; }; diff --git a/src/GeomAPI/GeomAPI_Lin.cpp b/src/GeomAPI/GeomAPI_Lin.cpp index 1c980e017..348bf01a8 100644 --- a/src/GeomAPI/GeomAPI_Lin.cpp +++ b/src/GeomAPI/GeomAPI_Lin.cpp @@ -117,7 +117,7 @@ bool GeomAPI_Lin::contains(const std::shared_ptr thePoint, bool GeomAPI_Lin::isParallel(const std::shared_ptr theLin) const { - return MY_LIN->Direction().IsParallel(theLin->impl().Direction(), + return MY_LIN->Direction().IsParallel(theLin->impl().Direction(), Precision::Confusion()) == Standard_True; } diff --git a/src/GeomAPI/GeomAPI_Lin.h b/src/GeomAPI/GeomAPI_Lin.h index 520c87a91..f2eaebfb2 100644 --- a/src/GeomAPI/GeomAPI_Lin.h +++ b/src/GeomAPI/GeomAPI_Lin.h @@ -22,11 +22,11 @@ class GeomAPI_Lin : public GeomAPI_Interface { public: /// Creation of line defined by cordinates of start and end points - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Lin(const double theStartX, const double theStartY, const double theStartZ, const double theEndX, const double theEndY, const double theEndZ); /// Creation of line defined by start and end points - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Lin(const std::shared_ptr& theStart, const std::shared_ptr& theEnd); /// Creation of line defined by origin and direction @@ -35,26 +35,26 @@ class GeomAPI_Lin : public GeomAPI_Interface const std::shared_ptr& theDirection); /// Returns point on the line (first point) - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr location(); /// Returns a line direction - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr direction(); /// Distance between two points - GEOMAPI_EXPORT + GEOMAPI_EXPORT double distance(const std::shared_ptr& thePoint) const; /// Intersection of two lines - GEOMAPI_EXPORT + GEOMAPI_EXPORT const std::shared_ptr intersect( const std::shared_ptr& theLine) const; /// Project point on line - GEOMAPI_EXPORT + GEOMAPI_EXPORT const std::shared_ptr project( const std::shared_ptr& thePoint) const; - /// \return true if this line contains thePoint, that is, + /// \return true if this line contains thePoint, that is, /// if the distance between thePoint and this line /// is less than or equal to theLinearTolerance. GEOMAPI_EXPORT diff --git a/src/GeomAPI/GeomAPI_Lin2d.cpp b/src/GeomAPI/GeomAPI_Lin2d.cpp index 51849328d..3f956050f 100644 --- a/src/GeomAPI/GeomAPI_Lin2d.cpp +++ b/src/GeomAPI/GeomAPI_Lin2d.cpp @@ -103,6 +103,6 @@ std::shared_ptr GeomAPI_Lin2d::shiftedLocation(double theShift) c aVec.Reverse(); aVec.Scale(theShift); gp_Lin2d aLin = MY_LIN2D->Translated(aVec); - return std::shared_ptr(new GeomAPI_Pnt2d(aLin.Location().X(), + return std::shared_ptr(new GeomAPI_Pnt2d(aLin.Location().X(), aLin.Location().Y())); } diff --git a/src/GeomAPI/GeomAPI_Lin2d.h b/src/GeomAPI/GeomAPI_Lin2d.h index 91cc546b7..6619c4ff7 100644 --- a/src/GeomAPI/GeomAPI_Lin2d.h +++ b/src/GeomAPI/GeomAPI_Lin2d.h @@ -22,11 +22,11 @@ class GeomAPI_Lin2d : public GeomAPI_Interface { public: /// Creation of line defined by cordinates of start and end points - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Lin2d(const double theStartX, const double theStartY, const double theEndX, const double theEndY); /// Creation of line defined by start and end points - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Lin2d(const std::shared_ptr& theStart, const std::shared_ptr& theEnd); /// Creation of line defined by origin and direction @@ -35,31 +35,31 @@ class GeomAPI_Lin2d : public GeomAPI_Interface const std::shared_ptr& theDirection); /// Returns point on the line (first point) - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr location(); /// Returns a line direction - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr direction(); /// Distance between two points - GEOMAPI_EXPORT + GEOMAPI_EXPORT double distance(const std::shared_ptr& theOther) const; /// Intersection of two lines - GEOMAPI_EXPORT + GEOMAPI_EXPORT const std::shared_ptr intersect( const std::shared_ptr& theLine) const; /// Project point on line - GEOMAPI_EXPORT + GEOMAPI_EXPORT const std::shared_ptr project( const std::shared_ptr& thePoint) const; - /// Computes the cross product of the line direction and a vector + /// Computes the cross product of the line direction and a vector /// from the line start point to the point - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool isRight(const std::shared_ptr& thePoint) const; /// Returns a location point shifted on theShift in perpendicular direction - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr shiftedLocation(double theShift) const; }; diff --git a/src/GeomAPI/GeomAPI_PlanarEdges.cpp b/src/GeomAPI/GeomAPI_PlanarEdges.cpp index e49d39e6d..26e91026a 100644 --- a/src/GeomAPI/GeomAPI_PlanarEdges.cpp +++ b/src/GeomAPI/GeomAPI_PlanarEdges.cpp @@ -62,28 +62,28 @@ bool GeomAPI_PlanarEdges::isEdge() const { return false; } -std::shared_ptr GeomAPI_PlanarEdges::origin() const +std::shared_ptr GeomAPI_PlanarEdges::origin() const { if (hasPlane()) return myPlane->origin(); return std::shared_ptr(); } -std::shared_ptr GeomAPI_PlanarEdges::dirX() const +std::shared_ptr GeomAPI_PlanarEdges::dirX() const { if (hasPlane()) return myPlane->dirX(); return std::shared_ptr(); } -std::shared_ptr GeomAPI_PlanarEdges::dirY() const +std::shared_ptr GeomAPI_PlanarEdges::dirY() const { if (hasPlane()) return myPlane->dirY(); return std::shared_ptr(); } -std::shared_ptr GeomAPI_PlanarEdges::norm() const +std::shared_ptr GeomAPI_PlanarEdges::norm() const { if (hasPlane()) return myPlane->normal(); diff --git a/src/GeomAPI/GeomAPI_PlanarEdges.h b/src/GeomAPI/GeomAPI_PlanarEdges.h index 15fb093f0..b32559adc 100644 --- a/src/GeomAPI/GeomAPI_PlanarEdges.h +++ b/src/GeomAPI/GeomAPI_PlanarEdges.h @@ -66,7 +66,7 @@ class GeomAPI_PlanarEdges : public GeomAPI_Shape const std::shared_ptr& theNorm); /// Returns whether the shapes are equal - GEOMAPI_EXPORT + GEOMAPI_EXPORT virtual bool isEqual(const std::shared_ptr theShape) const; private: diff --git a/src/GeomAPI/GeomAPI_Pln.cpp b/src/GeomAPI/GeomAPI_Pln.cpp index 41bf4e1c4..ba5960e87 100644 --- a/src/GeomAPI/GeomAPI_Pln.cpp +++ b/src/GeomAPI/GeomAPI_Pln.cpp @@ -56,7 +56,7 @@ void GeomAPI_Pln::coefficients(double& theA, double& theB, double& theC, double& impl().Coefficients(theA, theB, theC, theD); } -bool GeomAPI_Pln::isCoincident(const std::shared_ptr thePlane, +bool GeomAPI_Pln::isCoincident(const std::shared_ptr thePlane, const double theTolerance) { if(!thePlane.get()) { @@ -65,7 +65,7 @@ bool GeomAPI_Pln::isCoincident(const std::shared_ptr thePlane, const gp_Pln& aMyPln = impl(); const gp_Pln& anOtherPln = thePlane->impl(); - return (aMyPln.Contains(anOtherPln.Location(), theTolerance) && + return (aMyPln.Contains(anOtherPln.Location(), theTolerance) && aMyPln.Axis().IsParallel(anOtherPln.Axis(), theTolerance)); } @@ -81,7 +81,7 @@ bool GeomAPI_Pln::isParallel(const std::shared_ptr theLine) return Abs(aDot) < Precision::SquareConfusion(); } -std::shared_ptr +std::shared_ptr GeomAPI_Pln::intersect(const std::shared_ptr& theLine) const { std::shared_ptr aLineDir = theLine->direction()->xyz(); @@ -99,7 +99,7 @@ std::shared_ptr new GeomAPI_Pnt(aLineLoc->added(aLineDir->multiplied(aParam)))); } -std::shared_ptr +std::shared_ptr GeomAPI_Pln::project(const std::shared_ptr& thePoint) const { std::shared_ptr aNormal = direction()->xyz(); @@ -107,7 +107,7 @@ std::shared_ptr std::shared_ptr aVec = thePoint->xyz()->decreased(aLocation); double aDot = aNormal->dot(aVec); - std::shared_ptr aProjection = + std::shared_ptr aProjection = aLocation->added(aVec->decreased(aNormal->multiplied(aDot))); return std::shared_ptr(new GeomAPI_Pnt(aProjection)); } diff --git a/src/GeomAPI/GeomAPI_Pln.h b/src/GeomAPI/GeomAPI_Pln.h index d97fefc97..704c2a0ce 100644 --- a/src/GeomAPI/GeomAPI_Pln.h +++ b/src/GeomAPI/GeomAPI_Pln.h @@ -24,32 +24,32 @@ class GeomAPI_Pln : public GeomAPI_Interface { public: /// Creation of plane by the axis placement - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Pln(const std::shared_ptr& theAxis); /// Creation of plane by the point and normal - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Pln(const std::shared_ptr& thePoint, const std::shared_ptr& theNormal); /// Creation of plane by coefficients (Ax+By+Cz+D=0) - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Pln(const double theA, const double theB, const double theC, const double theD); /// Returns a point of this plane - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr location() const; /// Returns a plane normal - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr direction() const; /// Returns a plane x direction - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr xDirection() const; /// Returns the plane coefficients (Ax+By+Cz+D=0) - GEOMAPI_EXPORT + GEOMAPI_EXPORT void coefficients(double& theA, double& theB, double& theC, double& theD); /// Returns true if planes are coincident. diff --git a/src/GeomAPI/GeomAPI_Pnt.h b/src/GeomAPI/GeomAPI_Pnt.h index 17c2c0db8..137b6f729 100644 --- a/src/GeomAPI/GeomAPI_Pnt.h +++ b/src/GeomAPI/GeomAPI_Pnt.h @@ -24,56 +24,56 @@ class GeomAPI_Pnt : public GeomAPI_Interface { public: /// Creation of point by coordinates - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Pnt(const double theX, const double theY, const double theZ); /// Creation of point by coordinates - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Pnt(const std::shared_ptr& theCoords); /// returns X coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT double x() const; /// returns Y coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT double y() const; /// returns Z coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT double z() const; /// sets X coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT void setX(const double theX); /// sets Y coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT void setY(const double theY); /// sets Z coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT void setZ(const double theZ); /// returns coordinates of the point - GEOMAPI_EXPORT + GEOMAPI_EXPORT const std::shared_ptr xyz(); /// Distance between two points - GEOMAPI_EXPORT + GEOMAPI_EXPORT double distance(const std::shared_ptr& theOther) const; /// Returns whether the distance between two points is less then precision confusion - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool isEqual(const std::shared_ptr& theOther) const; /// Projects a point to the plane defined by the origin and 2 axes vectors in this plane - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr to2D(const std::shared_ptr& theOrigin, const std::shared_ptr& theDirX, const std::shared_ptr& theDirY); /// Projects a point to the plane defined by the origin and 2 axes vectors in this plane - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr to2D(const std::shared_ptr& thePln) const; /// Translates the point along direction theDir on distance theDist - GEOMAPI_EXPORT + GEOMAPI_EXPORT void translate(const std::shared_ptr& theDir, double theDist); }; diff --git a/src/GeomAPI/GeomAPI_Pnt2d.h b/src/GeomAPI/GeomAPI_Pnt2d.h index d3b3426cd..2ab01f2a3 100644 --- a/src/GeomAPI/GeomAPI_Pnt2d.h +++ b/src/GeomAPI/GeomAPI_Pnt2d.h @@ -23,42 +23,42 @@ class GeomAPI_Pnt2d : public GeomAPI_Interface { public: /// Creation of point by coordinates - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Pnt2d(const double theX, const double theY); /// Creation of point by coordinates - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Pnt2d(const std::shared_ptr& theCoords); /// returns X coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT double x() const; /// returns Y coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT double y() const; /// sets X coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT void setX(const double theX); /// sets Y coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT void setY(const double theY); /// Returns the 3D point - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::shared_ptr to3D(const std::shared_ptr& theOrigin, const std::shared_ptr& theDirX, const std::shared_ptr& theDirY); /// returns coordinates of the point - GEOMAPI_EXPORT + GEOMAPI_EXPORT const std::shared_ptr xy(); /// Distance between two points - GEOMAPI_EXPORT + GEOMAPI_EXPORT double distance(const std::shared_ptr& theOther) const; /// Returns whether the distance between two points is less then precision confusion - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool isEqual(const std::shared_ptr& theOther) const; }; diff --git a/src/GeomAPI/GeomAPI_Shape.cpp b/src/GeomAPI/GeomAPI_Shape.cpp index 31cb11086..8472939eb 100644 --- a/src/GeomAPI/GeomAPI_Shape.cpp +++ b/src/GeomAPI/GeomAPI_Shape.cpp @@ -118,7 +118,7 @@ bool GeomAPI_Shape::isConnectedTopology() const if (aShape.IsNull() || aShape.ShapeType() != TopAbs_COMPOUND) return false; // list of simple elements that are not detected in connection to others - NCollection_List aNotConnected; + NCollection_List aNotConnected; addSimpleToList(aShape, aNotConnected); if (aNotConnected.IsEmpty()) // an empty compound return false; @@ -141,7 +141,7 @@ bool GeomAPI_Shape::isConnectedTopology() const bool aConnected = false; NCollection_List::Iterator aNewIter(aNewConnected); for(; !aConnected && aNewIter.More(); aNewIter.Next()) { - // checking topological connecion of aNotIter and aNewIter + // checking topological connecion of aNotIter and aNewIter // (if shapes are connected, vertices are connected for sure) TopExp_Explorer anExp2(aNewIter.Value(), TopAbs_VERTEX); for(; !aConnected && anExp2.More(); anExp2.Next()) { diff --git a/src/GeomAPI/GeomAPI_Shape.h b/src/GeomAPI/GeomAPI_Shape.h index 9d2b8b278..6c6e9a954 100644 --- a/src/GeomAPI/GeomAPI_Shape.h +++ b/src/GeomAPI/GeomAPI_Shape.h @@ -35,7 +35,7 @@ public: public: /// Creation of empty (null) shape - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Shape(); /// \return a new Shape with the same Orientation and Location and a new TShape with the same @@ -43,39 +43,39 @@ public: GEOMAPI_EXPORT std::shared_ptr emptyCopied() const; /// Returns true if the underlied shape is null - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool isNull() const; /// Returns whether the shapes are equal - GEOMAPI_EXPORT + GEOMAPI_EXPORT virtual bool isEqual(const std::shared_ptr theShape) const; /// Returns whether the shape is a vertex - GEOMAPI_EXPORT + GEOMAPI_EXPORT virtual bool isVertex() const; /// Returns whether the shape is an edge - GEOMAPI_EXPORT + GEOMAPI_EXPORT virtual bool isEdge() const; /// Returns whether the shape is a face - GEOMAPI_EXPORT + GEOMAPI_EXPORT virtual bool isFace() const; /// Returns whether the shape is a compound - GEOMAPI_EXPORT + GEOMAPI_EXPORT virtual bool isCompound() const; /// Returns whether the shape is a compound of solids - GEOMAPI_EXPORT + GEOMAPI_EXPORT virtual bool isCompoundOfSolids() const; /// Returns whether the shape is a compound where all elements are topologically connected - GEOMAPI_EXPORT + GEOMAPI_EXPORT virtual bool isConnectedTopology() const; /// Returns whether the shape is a solid - GEOMAPI_EXPORT + GEOMAPI_EXPORT virtual bool isSolid() const; /// Returns whether the shape is a compsolid @@ -106,12 +106,12 @@ public: /// Computes boundary dimensions of the shape /// Returns False if it is not possible - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool computeSize(double& theXmin, double& theYmin, double& theZmin, double& theXmax, double& theYmax, double& theZmax) const; /// Returns the shape as BRep stream - GEOMAPI_EXPORT + GEOMAPI_EXPORT std::string getShapeStream() const; }; diff --git a/src/GeomAPI/GeomAPI_ShapeIterator.h b/src/GeomAPI/GeomAPI_ShapeIterator.h index 25a40590d..fc67172d5 100644 --- a/src/GeomAPI/GeomAPI_ShapeIterator.h +++ b/src/GeomAPI/GeomAPI_ShapeIterator.h @@ -12,7 +12,7 @@ /// \class GeomAPI_ShapeIterator /// \ingroup DataModel -/// \brief Iterates on the underlying shape underlying a given GeomAPI_Shape object, +/// \brief Iterates on the underlying shape underlying a given GeomAPI_Shape object, /// providing access /// to its component sub-shapes. Each component shape is returned as a GeomAPI_Shape with /// an orientation, and a compound of the original values and the relative values. diff --git a/src/GeomAPI/GeomAPI_XY.h b/src/GeomAPI/GeomAPI_XY.h index 8fdf2853e..c685c6ec0 100644 --- a/src/GeomAPI/GeomAPI_XY.h +++ b/src/GeomAPI/GeomAPI_XY.h @@ -19,42 +19,42 @@ class GeomAPI_XY : public GeomAPI_Interface { public: /// Creation by coordinates - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_XY(const double theX, const double theY); /// returns X coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT double x() const; /// returns Y coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT double y() const; /// sets X coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT void setX(const double theX); /// sets Y coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT void setY(const double theY); /// result is sum of coordinates of this and the given argument - GEOMAPI_EXPORT + GEOMAPI_EXPORT const std::shared_ptr added(const std::shared_ptr& theArg); /// result is difference between coordinates of this and the given argument - GEOMAPI_EXPORT + GEOMAPI_EXPORT const std::shared_ptr decreased(const std::shared_ptr& theArg); /// result is coordinates multiplied by the argument - GEOMAPI_EXPORT + GEOMAPI_EXPORT const std::shared_ptr multiplied(const double theArg); /// result is a scalar product of two triplets - GEOMAPI_EXPORT + GEOMAPI_EXPORT double dot(const std::shared_ptr& theArg) const; /// result is a cross product of two triplets - GEOMAPI_EXPORT + GEOMAPI_EXPORT double cross(const std::shared_ptr& theArg) const; /// Distance between two pairs - GEOMAPI_EXPORT + GEOMAPI_EXPORT double distance(const std::shared_ptr& theOther) const; }; diff --git a/src/GeomAPI/GeomAPI_XYZ.h b/src/GeomAPI/GeomAPI_XYZ.h index 38f189db6..de2f98903 100644 --- a/src/GeomAPI/GeomAPI_XYZ.h +++ b/src/GeomAPI/GeomAPI_XYZ.h @@ -19,48 +19,48 @@ class GeomAPI_XYZ : public GeomAPI_Interface { public: /// Creation by coordinates - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_XYZ(const double theX, const double theY, const double theZ); /// returns X coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT double x() const; /// returns Y coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT double y() const; /// returns Z coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT double z() const; /// sets X coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT void setX(const double theX); /// sets Y coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT void setY(const double theY); /// sets Z coordinate - GEOMAPI_EXPORT + GEOMAPI_EXPORT void setZ(const double theZ); /// result is sum of coordinates of this and the given argument - GEOMAPI_EXPORT + GEOMAPI_EXPORT const std::shared_ptr added(const std::shared_ptr& theArg); /// result is difference between coordinates of this and the given argument - GEOMAPI_EXPORT + GEOMAPI_EXPORT const std::shared_ptr decreased(const std::shared_ptr& theArg); /// result is coordinates multiplied by the argument - GEOMAPI_EXPORT + GEOMAPI_EXPORT const std::shared_ptr multiplied(const double theArg); /// result is a scalar product of two triplets - GEOMAPI_EXPORT + GEOMAPI_EXPORT double dot(const std::shared_ptr& theArg) const; /// result is a cross product of two triplets - GEOMAPI_EXPORT + GEOMAPI_EXPORT const std::shared_ptr cross(const std::shared_ptr& theArg) const; /// Distance between two triplets - GEOMAPI_EXPORT + GEOMAPI_EXPORT double distance(const std::shared_ptr& theOther) const; }; diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp index d198302d7..edf075360 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp @@ -32,7 +32,7 @@ void GeomAlgoAPI_Boolean::build(const ListOfShape& theObjects, // Getting objects. TopTools_ListOfShape anObjects; - for(ListOfShape::const_iterator + for(ListOfShape::const_iterator anObjectsIt = theObjects.begin(); anObjectsIt != theObjects.end(); anObjectsIt++) { anObjects.Append((*anObjectsIt)->impl()); @@ -40,7 +40,7 @@ void GeomAlgoAPI_Boolean::build(const ListOfShape& theObjects, // Getting tools. TopTools_ListOfShape aTools; - for(ListOfShape::const_iterator + for(ListOfShape::const_iterator aToolsIt = theTools.begin(); aToolsIt != theTools.end(); aToolsIt++) { aTools.Append((*aToolsIt)->impl()); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Box.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Box.cpp index ee03a2224..c8b7baa94 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Box.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Box.cpp @@ -42,30 +42,30 @@ bool GeomAlgoAPI_Box::check() void GeomAlgoAPI_Box::build() { myCreatedFaces.clear(); - + // Construct the box BRepPrimAPI_MakeBox *aBoxMaker = new BRepPrimAPI_MakeBox(myDx, myDy, myDz); aBoxMaker->Build(); - + // Test the algorithm if (!aBoxMaker->IsDone()) { myError = "Box builder with dimensions :: algorithm failed."; return; } - + TopoDS_Shape aResult = aBoxMaker->Shape(); std::shared_ptr aShape(new GeomAPI_Shape()); aShape->setImpl(new TopoDS_Shape(aResult)); setShape(aShape); - + // Test on the shapes if (!aShape.get() || aShape->isNull()) { myError = "Box builder with dimensions :: resulting shape is null."; return; } - + setImpl(aBoxMaker); - + setDone(true); } @@ -79,16 +79,16 @@ void GeomAlgoAPI_Box::prepareNamingFaces() std::shared_ptr aShapeBack(new GeomAPI_Shape); aShapeBack->setImpl(new TopoDS_Shape(aBoxMaker.BackFace())); myCreatedFaces["Back"] = aShapeBack; - std::shared_ptr aShapeTop(new GeomAPI_Shape); + std::shared_ptr aShapeTop(new GeomAPI_Shape); aShapeTop->setImpl(new TopoDS_Shape(aBoxMaker.TopFace())); myCreatedFaces["Top"] = aShapeTop; - std::shared_ptr aShapeBottom(new GeomAPI_Shape); + std::shared_ptr aShapeBottom(new GeomAPI_Shape); aShapeBottom->setImpl(new TopoDS_Shape(aBoxMaker.BottomFace())); myCreatedFaces["Bottom"] = aShapeBottom; - std::shared_ptr aShapeLeft(new GeomAPI_Shape); + std::shared_ptr aShapeLeft(new GeomAPI_Shape); aShapeLeft->setImpl(new TopoDS_Shape(aBoxMaker.LeftFace())); myCreatedFaces["Left"] = aShapeLeft; - std::shared_ptr aShapeRight(new GeomAPI_Shape); + std::shared_ptr aShapeRight(new GeomAPI_Shape); aShapeRight->setImpl(new TopoDS_Shape(aBoxMaker.RightFace())); myCreatedFaces["Right"] = aShapeRight; } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Box.h b/src/GeomAlgoAPI/GeomAlgoAPI_Box.h index 23bcb8d35..4f772eed4 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Box.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Box.h @@ -16,24 +16,24 @@ */ class GeomAlgoAPI_Box : public GeomAlgoAPI_MakeShape { - public: + public: GEOMALGOAPI_EXPORT GeomAlgoAPI_Box(); - + /// Creates a box using the dimensions. /// \param theDx The dimension on X /// \param theDy The dimension on Y /// \param theDz The dimension on Z GEOMALGOAPI_EXPORT GeomAlgoAPI_Box(const double theDx, const double theDy, const double theDz); - + /// Checks if each dimension "Dx", Dy" and "Dz" for the box construction is OK. GEOMALGOAPI_EXPORT bool check(); - + /// Builds the box with the dimensions "Dx", "Dy" and "Dz". GEOMALGOAPI_EXPORT void build(); - + /// Prepare the naming (redifined because it is specific for a box). GEOMALGOAPI_EXPORT void prepareNamingFaces(); - + private: double myDx; /// Dimension on X to create a box. double myDy; /// Dimension on Y to create a box. diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_BoxPoints.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_BoxPoints.cpp index dcfd835c5..c177f86ee 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_BoxPoints.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_BoxPoints.cpp @@ -33,33 +33,33 @@ bool GeomAlgoAPI_BoxPoints::check() void GeomAlgoAPI_BoxPoints::build() { myCreatedFaces.clear(); - + const gp_Pnt& aFirstPoint = myFirstPoint->impl(); const gp_Pnt& aSecondPoint = mySecondPoint->impl(); // Construct the box BRepPrimAPI_MakeBox *aBoxMaker = new BRepPrimAPI_MakeBox(aFirstPoint, aSecondPoint); aBoxMaker->Build(); - + // Test the algorithm if(!aBoxMaker->IsDone()) { myError = "Box builder with two points :: algorithm failed."; return; } - + TopoDS_Shape aResult = aBoxMaker->Shape(); - + std::shared_ptr aShape(new GeomAPI_Shape()); aShape->setImpl(new TopoDS_Shape(aResult)); setShape(aShape); - + // Tests on the shape if (!aShape.get() || aShape->isNull()) { myError = "Box builder with two points :: resulting shape is null."; return; } - + setImpl(aBoxMaker); - + setDone(true); } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_BoxPoints.h b/src/GeomAlgoAPI/GeomAlgoAPI_BoxPoints.h index 159715f21..f6cedd3aa 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_BoxPoints.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_BoxPoints.h @@ -16,19 +16,19 @@ */ class GeomAlgoAPI_BoxPoints : public GeomAlgoAPI_Box { - public: + public: /// Creates a box using the two points that defined a diagonal. /// \param theFirstPoint One extermity of the diagonal /// \param theSecondPoint The other extremity of the diagonal GEOMALGOAPI_EXPORT GeomAlgoAPI_BoxPoints(std::shared_ptr theFirstPoint, std::shared_ptr theSecondPoint); - + /// \return true if the data of the construction of the box were correct. GEOMALGOAPI_EXPORT bool check(); - + /// Builds the box. GEOMALGOAPI_EXPORT void build(); - + private: std::shared_ptr myFirstPoint; /// First point to create a box. std::shared_ptr mySecondPoint; /// Second point to create a box. diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.h b/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.h index 36caf8779..594729ad9 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.h @@ -28,7 +28,7 @@ class GEOMALGOAPI_EXPORT GeomAlgoAPI_CompoundBuilder static std::shared_ptr compound( std::list > theShapes); - /// Produces the integerr identifier of the shape theSub in theContext (needed for + /// Produces the integerr identifier of the shape theSub in theContext (needed for /// groups export to old GEOM) /// \returns zero if theSub not found in theContext static int id( diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_DFLoader.h b/src/GeomAlgoAPI/GeomAlgoAPI_DFLoader.h index e5ac0f254..ceae16de9 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_DFLoader.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_DFLoader.h @@ -13,7 +13,7 @@ * \ingroup DataAlgo * \brief Defines several static methods useful for Data Framework filling */ -class GEOMALGOAPI_EXPORT GeomAlgoAPI_DFLoader +class GEOMALGOAPI_EXPORT GeomAlgoAPI_DFLoader { public: /// Refine result diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.cpp index 1f8b01832..fed51bda4 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.cpp @@ -39,7 +39,7 @@ std::shared_ptr GeomAlgoAPI_EdgeBuilder::line( std::shared_ptr GeomAlgoAPI_EdgeBuilder::line( double theDX, double theDY, double theDZ) { - + const gp_Pnt& aStart = gp_Pnt(0, 0, 0); const gp_Pnt& anEnd = gp_Pnt(theDX, theDY, theDZ); @@ -68,7 +68,7 @@ std::shared_ptr GeomAlgoAPI_EdgeBuilder::cylinderAxis( Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aFace, aLoc); if (aSurf.IsNull()) return aResult; - Handle(Geom_RectangularTrimmedSurface) aTrimmed = + Handle(Geom_RectangularTrimmedSurface) aTrimmed = Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurf); if (!aTrimmed.IsNull()) aSurf = aTrimmed->BasisSurface(); @@ -86,7 +86,7 @@ std::shared_ptr GeomAlgoAPI_EdgeBuilder::cylinderAxis( for(int aX = 0; aX < 2; aX++) { for(int aY = 0; aY < 2; aY++) { for(int aZ = 0; aZ < 2; aZ++) { - gp_XYZ aBoxVertex(aX == 0 ? aBoxMin.X() : aBoxMax.X(), + gp_XYZ aBoxVertex(aX == 0 ? aBoxMin.X() : aBoxMax.X(), aY == 0 ? aBoxMin.Y() : aBoxMax.Y(), aZ == 0 ? aBoxMin.Z() : aBoxMax.Z()); gp_XYZ aVec(aBoxVertex - anAxis.Location().XYZ()); double aProjParam = aVec.Dot(anAxis.Direction().XYZ()); @@ -117,7 +117,7 @@ std::shared_ptr GeomAlgoAPI_EdgeBuilder::cylinderAxis( gp_Pnt anEnd(anAxis.Location().XYZ() - anAxis.Direction().XYZ() * 100.); anEnd.Transform(aLoc.Transformation()); */ - + BRepBuilderAPI_MakeEdge anEdgeBuilder(aStart, anEnd); std::shared_ptr aRes(new GeomAPI_Edge); TopoDS_Edge anEdge = anEdgeBuilder.Edge(); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Exception.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Exception.cpp index 53338dae7..b5b9cd5d7 100755 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Exception.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Exception.cpp @@ -19,6 +19,6 @@ GeomAlgoAPI_Exception::~GeomAlgoAPI_Exception() throw() //================================================================================================= const char* GeomAlgoAPI_Exception::what() const throw() -{ +{ return myMessageError.c_str(); } \ No newline at end of file diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Exception.h b/src/GeomAlgoAPI/GeomAlgoAPI_Exception.h index 790af42b5..df0e54abd 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Exception.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Exception.h @@ -13,15 +13,15 @@ */ class GeomAlgoAPI_Exception : public std::exception { - public: + public: /// Create an exception /// \param theMessageError Error message to be displayed GEOMALGOAPI_EXPORT GeomAlgoAPI_Exception(std::string theMessageError); - /// Destroyer + /// Destroyer GEOMALGOAPI_EXPORT ~GeomAlgoAPI_Exception() throw(); - /// Allows to collet the error + /// Allows to collet the error GEOMALGOAPI_EXPORT const char* what() const throw(); - + private: std::string myMessageError; /// Error message to be displayed. }; diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.cpp index e0aff60b9..0dce2f9f9 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.cpp @@ -78,7 +78,7 @@ std::shared_ptr GeomAlgoAPI_FaceBuilder::planarFace( gp_Pln aPlane(aA, aB, aC, aD); // half of the size in each direction from the center - BRepBuilderAPI_MakeFace aFaceBuilder(aPlane, theX, theX + theWidth, + BRepBuilderAPI_MakeFace aFaceBuilder(aPlane, theX, theX + theWidth, theY, theY + theHeight); std::shared_ptr aRes(new GeomAPI_Face()); aRes->setImpl(new TopoDS_Face(aFaceBuilder.Face())); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Intersection.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Intersection.cpp index 273937e2d..41ef88765 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Intersection.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Intersection.cpp @@ -37,7 +37,7 @@ void GeomAlgoAPI_Intersection::build(const ListOfShape& theObjects, // Getting objects. TopTools_ListOfShape anObjects; - for (ListOfShape::const_iterator + for (ListOfShape::const_iterator anObjectsIt = theObjects.begin(); anObjectsIt != theObjects.end(); anObjectsIt++) { const TopoDS_Shape& aShape = (*anObjectsIt)->impl(); if(!aShape.IsNull()) { @@ -48,7 +48,7 @@ void GeomAlgoAPI_Intersection::build(const ListOfShape& theObjects, // Getting tools. TopTools_ListOfShape aTools; - for (ListOfShape::const_iterator + for (ListOfShape::const_iterator aToolsIt = theTools.begin(); aToolsIt != theTools.end(); aToolsIt++) { const TopoDS_Shape& aShape = (*aToolsIt)->impl(); if(!aShape.IsNull()) { diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp index 289427164..dad018f0c 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp @@ -238,13 +238,13 @@ bool GeomAlgoAPI_MakeShape::checkValid(std::string theMessage){ for(TopExp_Explorer anExp(aTopoDSShape,TopAbs_SOLID); anExp.More(); anExp.Next()) { aNbVolumes ++; } - + if (aNbVolumes != 1) { myError = theMessage + " :: connexity error, the resulting shape is made of several separate solids."; return false; } - + return true ; } - + diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h index 649684ee0..91b9781c6 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h @@ -37,7 +37,7 @@ public: /// \brief Constructor by builder and builder type. /// \param[in] theBuilder pointer to the builder. /// \param[in] theBuilderType builder type. - template explicit GeomAlgoAPI_MakeShape(T* theBuilder, + template explicit GeomAlgoAPI_MakeShape(T* theBuilder, const BuilderType theBuilderType = OCCT_BRepBuilderAPI_MakeShape) : GeomAPI_Interface(theBuilder), myBuilderType(theBuilderType) @@ -48,7 +48,7 @@ public: /// \brief Initializes internals. /// \param[in] theBuilder pointer to the builder. /// \param[in] theBuilderType builder type. - template void initialize(T* theBuilder, + template void initialize(T* theBuilder, const BuilderType theBuilderType = OCCT_BRepBuilderAPI_MakeShape) { setImpl(theBuilder); @@ -122,8 +122,8 @@ protected: /// Error occurred during the execution of an algorithm. std::string myError; /// Map of created faces with their name for naming. - std::map< std::string, std::shared_ptr > myCreatedFaces; - + std::map< std::string, std::shared_ptr > myCreatedFaces; + private: /// \brief Initializes internals. void initialize(); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.cpp index 86a01cf6a..96c663b41 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.cpp @@ -79,7 +79,7 @@ void GeomAlgoAPI_MakeShapeList::modified(const std::shared_ptr th bool GeomAlgoAPI_MakeShapeList::isDeleted(const std::shared_ptr theShape) { - for(ListOfMakeShape::iterator aBuilderIt = myListOfMakeShape.begin(); + for(ListOfMakeShape::iterator aBuilderIt = myListOfMakeShape.begin(); aBuilderIt != myListOfMakeShape.end(); aBuilderIt++) { std::shared_ptr aMakeShape = *aBuilderIt; if(aMakeShape->isDeleted(theShape)) { @@ -105,7 +105,7 @@ void GeomAlgoAPI_MakeShapeList::result(const std::shared_ptr theS aResultShapesMap.Add(theShape->impl()); aResultShapesList.Append(theShape->impl()); - for(ListOfMakeShape::iterator aBuilderIt = myListOfMakeShape.begin(); + for(ListOfMakeShape::iterator aBuilderIt = myListOfMakeShape.begin(); aBuilderIt != myListOfMakeShape.end(); aBuilderIt++) { std::shared_ptr aMakeShape = *aBuilderIt; NCollection_Map aTempShapes; @@ -127,7 +127,7 @@ void GeomAlgoAPI_MakeShapeList::result(const std::shared_ptr theS } ListOfShape aModifiedShapes; aMakeShape->modified(aShape, aModifiedShapes); - for(ListOfShape::const_iterator + for(ListOfShape::const_iterator anIt = aModifiedShapes.cbegin(); anIt != aModifiedShapes.cend(); anIt++) { const TopoDS_Shape& anItShape = (*anIt)->impl(); aTempShapes.Add(anItShape); @@ -139,7 +139,7 @@ void GeomAlgoAPI_MakeShapeList::result(const std::shared_ptr theS if(hasResults) { const TopoDS_Shape& aTopoDSShape = aShapeIt.Value(); if(aResultShapesMap.Remove(aTopoDSShape) == Standard_True) { - for(NCollection_List::Iterator + for(NCollection_List::Iterator aResIt(aResultShapesList); aResIt.More(); aResIt.Next()) { if(aTopoDSShape.IsEqual(aResIt.Value())) { aResultShapesList.Remove(aResIt); @@ -152,7 +152,7 @@ void GeomAlgoAPI_MakeShapeList::result(const std::shared_ptr theS anAlgoShapes.Unite(aTempShapes); } - for(NCollection_List::Iterator + for(NCollection_List::Iterator aShapeIt(aResultShapesList); aShapeIt.More(); aShapeIt.Next()) { std::shared_ptr aShape(new GeomAPI_Shape()); aShape->setImpl(new TopoDS_Shape(aShapeIt.Value())); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Partition.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Partition.cpp index a19419b73..eeb832f2f 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Partition.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Partition.cpp @@ -47,14 +47,14 @@ void GeomAlgoAPI_Partition::build(const ListOfShape& theObjects, this->setBuilderType(OCCT_BOPAlgo_Builder); // Getting objects. - for (ListOfShape::const_iterator + for (ListOfShape::const_iterator anObjectsIt = theObjects.begin(); anObjectsIt != theObjects.end(); anObjectsIt++) { const TopoDS_Shape& aShape = (*anObjectsIt)->impl(); anOperation->AddArgument(aShape); } // Getting tools. - for (ListOfShape::const_iterator + for (ListOfShape::const_iterator aToolsIt = theTools.begin(); aToolsIt != theTools.end(); aToolsIt++) { const TopoDS_Shape& aShape = (*aToolsIt)->impl(); anOperation->AddTool(aShape); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_PaveFiller.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_PaveFiller.cpp index 76df6cbb9..2718e5c98 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_PaveFiller.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_PaveFiller.cpp @@ -15,7 +15,7 @@ #include //================================================================================================= -GeomAlgoAPI_PaveFiller::GeomAlgoAPI_PaveFiller(const ListOfShape& theListOfShape, +GeomAlgoAPI_PaveFiller::GeomAlgoAPI_PaveFiller(const ListOfShape& theListOfShape, const bool theIsMakeCompSolids) { build(theListOfShape, theIsMakeCompSolids); @@ -28,7 +28,7 @@ void GeomAlgoAPI_PaveFiller::build(const ListOfShape& theListOfShape, { BOPAlgo_PaveFiller aPaveFiller; BOPCol_ListOfShape aListOfShape; - for(ListOfShape::const_iterator + for(ListOfShape::const_iterator anIt = theListOfShape.cbegin(); anIt != theListOfShape.cend(); anIt++) { const TopoDS_Shape& aShape = (*anIt)->impl(); if(aShape.ShapeType() == TopAbs_COMPOUND) { diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_PaveFiller.h b/src/GeomAlgoAPI/GeomAlgoAPI_PaveFiller.h index 5a63fbf5e..3df2e330b 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_PaveFiller.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_PaveFiller.h @@ -14,7 +14,7 @@ /// \class GeomAlgoAPI_PaveFiller /// \ingroup DataAlgo -/// \brief Finds the common parts from the list of shapes and +/// \brief Finds the common parts from the list of shapes and /// breaks it to shapes with shared subshapes. class GeomAlgoAPI_PaveFiller : public GeomAlgoAPI_MakeShape { @@ -22,7 +22,7 @@ public: /// \brief Constructor. /// \param[in] theListOfShape list of shape which should be splitted. /// \param[in] theIsMakeCompSolids if true gather shapes with shared faces to compsolids. - GEOMALGOAPI_EXPORT GeomAlgoAPI_PaveFiller(const ListOfShape& theListOfShape, + GEOMALGOAPI_EXPORT GeomAlgoAPI_PaveFiller(const ListOfShape& theListOfShape, const bool theIsMakeCompSolids = false); private: diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Pipe.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Pipe.cpp index ca7b81140..8c1bef7bd 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Pipe.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Pipe.cpp @@ -183,7 +183,7 @@ void GeomAlgoAPI_Pipe::build(const ListOfShape& theBaseShapes, const ListOfShape& theLocations, const GeomShapePtr thePathShape) { - if(theBaseShapes.empty() || + if(theBaseShapes.empty() || (!theLocations.empty() && theLocations.size() != theBaseShapes.size())) { return; } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Pipe.h b/src/GeomAlgoAPI/GeomAlgoAPI_Pipe.h index fb0f0b6c0..6f0085225 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Pipe.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Pipe.h @@ -15,7 +15,7 @@ /// \class GeomAlgoAPI_Pipe /// \ingroup DataAlgo -/// \brief Allows to create extrusion of objects along a path. +/// \brief Allows to create extrusion of objects along a path. /// It produces the following results from objects:\n /// Vertex -> Edge\n /// Edge -> Face\n diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Placement.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Placement.cpp index af06ddd81..58128437f 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Placement.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Placement.cpp @@ -123,7 +123,7 @@ void GeomAlgoAPI_Placement::build(const std::shared_ptr& theSourc gp_Vec(aSrcDstPoints[1 - anInd], aSrcDstPoints[anInd])); if (aVec.SquareMagnitude() < Precision::SquareConfusion()) { // normal and points direction are collinear - if (Abs(aSrcDstNormals[1 - anInd].Y()) >= Precision::Confusion() || + if (Abs(aSrcDstNormals[1 - anInd].Y()) >= Precision::Confusion() || Abs(aSrcDstNormals[1 - anInd].Z()) >= Precision::Confusion()) aVec = gp::DX(); else @@ -163,7 +163,7 @@ void GeomAlgoAPI_Placement::build(const std::shared_ptr& theSourc gp_Vec aVec(aSrcDstPoints[anInd], aSrcDstPoints[1 - anInd]); aVec.Cross(aSrcDstDirections[anInd]); if (aVec.SquareMagnitude() < Precision::SquareConfusion()) { // point is on line - if (Abs(aSrcDstDirections[1 - anInd].Y()) >= Precision::Confusion() || + if (Abs(aSrcDstDirections[1 - anInd].Y()) >= Precision::Confusion() || Abs(aSrcDstDirections[1 - anInd].Z()) >= Precision::Confusion()) aVec = gp::DX(); else diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Placement.h b/src/GeomAlgoAPI/GeomAlgoAPI_Placement.h index b15249340..aa24acab6 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Placement.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Placement.h @@ -25,10 +25,10 @@ public: /// \param[in] theDestSolid invariant shape /// \param[in] theSourceShape a shape on the solid to be made coincident with destination object /// \param[in] theDestShape destination object - /// \param[in] theIsReverse indicates that the solid materials should be on the same side + /// \param[in] theIsReverse indicates that the solid materials should be on the same side /// against the destination plane /// \param[in] theIsCentering indicates the planes should be centered - /// \param[in] theSimpleTransform makes just transformation of shape + /// \param[in] theSimpleTransform makes just transformation of shape /// without changing of topology or geometry GEOMALGOAPI_EXPORT GeomAlgoAPI_Placement(const std::shared_ptr theSourceSolid, const std::shared_ptr theDestSolid, diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp index 69cdabbfd..cad4bc3cc 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp @@ -26,7 +26,7 @@ #include //================================================================================================== -std::shared_ptr +std::shared_ptr GeomAlgoAPI_PointBuilder::vertex(const std::shared_ptr thePoint) { const gp_Pnt& aPnt = thePoint->impl(); @@ -51,7 +51,7 @@ std::shared_ptr GeomAlgoAPI_PointBuilder::vertex(const double th } //================================================================================================== -std::shared_ptr +std::shared_ptr GeomAlgoAPI_PointBuilder::point(const std::shared_ptr theVertex) { TopoDS_Shape aShape = theVertex->impl(); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.h b/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.h index be219a503..0d5287acf 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.h @@ -33,7 +33,7 @@ public: /// \brief Creates vertex by edge and distance on it. /// \param[in] theEdge edge. /// \param[in] theValue distance value. - /// \param[in] theIsPercent if true theValue will be treated + /// \param[in] theIsPercent if true theValue will be treated /// as a percentage of theEdge total length. /// \param[in] theIsReverse if true the distance will be measured from the edge end point. /// \return created vertex. @@ -62,7 +62,7 @@ public: /// \param[in] theEdge linear edge. /// \param[in] theFace planar face. /// \return created vertex. - static std::shared_ptr + static std::shared_ptr vertexByIntersection(const std::shared_ptr theEdge, const std::shared_ptr theFace); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp index acc94d25f..55db84bdf 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp @@ -77,7 +77,7 @@ GeomAlgoAPI_Prism::GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape, const GeomShapePtr theFromShape, const double theFromSize) { - build(theBaseShape, std::shared_ptr(), theToShape, + build(theBaseShape, std::shared_ptr(), theToShape, theToSize, theFromShape, theFromSize); } @@ -101,7 +101,7 @@ void GeomAlgoAPI_Prism::build(const GeomShapePtr& theBaseShape, const double theFromSize) { if(!theBaseShape.get() || - (((!theFromShape.get() && !theToShape.get()) || + (((!theFromShape.get() && !theToShape.get()) || (theFromShape.get() && theToShape.get() && theFromShape->isEqual(theToShape))) && (theFromSize == -theToSize))) { return; @@ -190,7 +190,7 @@ void GeomAlgoAPI_Prism::build(const GeomShapePtr& theBaseShape, // Moving base shape. gp_Trsf aTrsf; aTrsf.SetTranslation(aDirVec * -theFromSize); - BRepBuilderAPI_Transform* aTransformBuilder = + BRepBuilderAPI_Transform* aTransformBuilder = new BRepBuilderAPI_Transform(aBaseShape, aTrsf); if(!aTransformBuilder) { return; @@ -203,7 +203,7 @@ void GeomAlgoAPI_Prism::build(const GeomShapePtr& theBaseShape, TopoDS_Shape aMovedBase = aTransformBuilder->Shape(); // Making prism. - BRepPrimAPI_MakePrism* aPrismBuilder = + BRepPrimAPI_MakePrism* aPrismBuilder = new BRepPrimAPI_MakePrism(aMovedBase, aDirVec * (theFromSize + theToSize)); if(!aPrismBuilder) { return; @@ -303,7 +303,7 @@ void GeomAlgoAPI_Prism::build(const GeomShapePtr& theBaseShape, TopoDS_Shape aMovedBase = aTransformBuilder->Shape(); // Making prism. - BRepPrimAPI_MakePrism* aPrismBuilder = + BRepPrimAPI_MakePrism* aPrismBuilder = new BRepPrimAPI_MakePrism(aMovedBase, aDirVec * 2 * aPrismLength); if(!aPrismBuilder) { return; @@ -471,12 +471,12 @@ void storeGenerationHistory(GeomAlgoAPI_Prism* thePrismAlgo, if(theType == TopAbs_VERTEX) { gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(aShape)); IntTools_Context anIntTools; - if(anIntTools.IsValidPointForFace(aPnt, + if(anIntTools.IsValidPointForFace(aPnt, theToFace, Precision::Confusion()) == Standard_True) { aGeomSh->setImpl(new TopoDS_Shape(aShape)); thePrismAlgo->addToShape(aGeomSh); } - if(anIntTools.IsValidPointForFace(aPnt, + if(anIntTools.IsValidPointForFace(aPnt, theFromFace, Precision::Confusion()) == Standard_True) { aGeomSh->setImpl(new TopoDS_Shape(aShape)); thePrismAlgo->addFromShape(aGeomSh); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Prism.h b/src/GeomAlgoAPI/GeomAlgoAPI_Prism.h index af7f4501b..d751d4122 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Prism.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Prism.h @@ -34,7 +34,7 @@ public: /// \brief Creates extrusion for the given shape along the normal for this shape. /// \param[in] theBaseShape vertex, edge, wire, face or shell. - /// \param[in] theDirection direction of extrusion. + /// \param[in] theDirection direction of extrusion. /// Can be empty if theBaseShape is planar wire or face. /// \param[in] theToSize offset for "to" plane. /// \param[in] theFromSize offset for "from" plane. @@ -45,10 +45,10 @@ public: /// \brief Creates extrusion for the given shape along the normal for this shape. /// \param[in] theBaseShape planar face or wire to be extruded. - /// \param[in] theToShape top bounding shape. Can be empty. + /// \param[in] theToShape top bounding shape. Can be empty. /// In this case offset will be applied to the basis. /// \param[in] theToSize offset for "to" plane. - /// \param[in] theFromShape bottom bounding shape. Can be empty. + /// \param[in] theFromShape bottom bounding shape. Can be empty. /// In this case offset will be applied to the basis. /// \param[in] theFromSize offset for "from" plane. GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape, @@ -59,7 +59,7 @@ public: /// \brief Creates extrusion for the given shape along the normal for this shape. /// \param[in] theBaseShape planar face or wire to be extruded. - /// \param[in] theDirection direction of extrusion. + /// \param[in] theDirection direction of extrusion. /// Can be empty if theBaseShape is planar wire or face. /// \param[in] theToShape top bounding shape. Can be empty. /// In this case offset will be applied to the basis. diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp index 82c9b6ab4..feed9c765 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp @@ -104,7 +104,7 @@ void GeomAlgoAPI_Revolution::build(const GeomShapePtr& theBaseSh const double theFromAngle) { if(!theBaseShape || !theAxis || - (((!theFromShape && !theToShape) || + (((!theFromShape && !theToShape) || (theFromShape && theToShape && theFromShape->isEqual(theToShape))) && (theFromAngle == -theToAngle))) { return; @@ -220,7 +220,7 @@ void GeomAlgoAPI_Revolution::build(const GeomShapePtr& theBaseSh } } else if(theFromShape && theToShape) { // Case 2: When both bounding planes were set. // Making revolution to the 360 angle. - BRepPrimAPI_MakeRevol* aRevolBuilder = + BRepPrimAPI_MakeRevol* aRevolBuilder = new BRepPrimAPI_MakeRevol(aBaseShape, anAxis, 2 * M_PI, Standard_True); if(!aRevolBuilder) { return; @@ -262,10 +262,10 @@ void GeomAlgoAPI_Revolution::build(const GeomShapePtr& theBaseSh // Rotating bounding planes to the specified angle. gp_Trsf aFromTrsf; gp_Trsf aToTrsf; - double aFromRotAngle = - ((aFromPln.Axis().Direction() * aBasePlane->Axis().Direction()) > 0) ? -theFromAngle : + double aFromRotAngle = + ((aFromPln.Axis().Direction() * aBasePlane->Axis().Direction()) > 0) ? -theFromAngle : theFromAngle; - double aToRotAngle = + double aToRotAngle = ((aToPln.Axis().Direction() * aBasePlane->Axis().Direction()) > 0) ? -theToAngle : theToAngle; aFromTrsf.SetRotation(anAxis,aFromRotAngle / 180.0 * M_PI); @@ -317,7 +317,7 @@ void GeomAlgoAPI_Revolution::build(const GeomShapePtr& theBaseSh aResult = aGeomShape->impl(); } - // If after cut we got more than one solids then take closest + // If after cut we got more than one solids then take closest // to the center of mass of the base face. aResult = findClosest(aResult, aBaseCentre); @@ -330,7 +330,7 @@ void GeomAlgoAPI_Revolution::build(const GeomShapePtr& theBaseSh } } else { //Case 3: When only one bounding plane was set. // Making revolution to the 360 angle. - BRepPrimAPI_MakeRevol* aRevolBuilder = + BRepPrimAPI_MakeRevol* aRevolBuilder = new BRepPrimAPI_MakeRevol(aBaseShape, anAxis, 2 * M_PI, Standard_True); if(!aRevolBuilder) { return; @@ -485,18 +485,18 @@ void GeomAlgoAPI_Revolution::build(const GeomShapePtr& theBaseSh aResult = aGeomShape->impl(); } - // If after cut we got more than one solids then take + // If after cut we got more than one solids then take // closest to the center of mass of the base face. aResult = findClosest(aResult, aBaseCentre); // Setting naming. if(aShapeTypeToExp == TopAbs_COMPOUND) { - storeGenerationHistory(this, aResult, TopAbs_EDGE, + storeGenerationHistory(this, aResult, TopAbs_EDGE, aRotatedBoundingFace, aModifiedBaseShape, isFromFaceSet); - storeGenerationHistory(this, aResult, TopAbs_FACE, + storeGenerationHistory(this, aResult, TopAbs_FACE, aRotatedBoundingFace, aModifiedBaseShape, isFromFaceSet); } else { - storeGenerationHistory(this, aResult, aShapeTypeToExp, + storeGenerationHistory(this, aResult, aShapeTypeToExp, aRotatedBoundingFace, aModifiedBaseShape, isFromFaceSet); } } @@ -669,16 +669,16 @@ void storeGenerationHistory(GeomAlgoAPI_Revolution* theRevolutionAlgo, if(theType == TopAbs_VERTEX) { gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(aShape)); IntTools_Context anIntTools; - if(anIntTools.IsValidPointForFace(aPnt, TopoDS::Face(theRotatedBoundingFace), + if(anIntTools.IsValidPointForFace(aPnt, TopoDS::Face(theRotatedBoundingFace), Precision::Confusion()) == Standard_True) { aGeomSh->setImpl(new TopoDS_Shape(aShape)); - theIsFromFaceSet ? theRevolutionAlgo->addFromShape(aGeomSh) : + theIsFromFaceSet ? theRevolutionAlgo->addFromShape(aGeomSh) : theRevolutionAlgo->addToShape(aGeomSh); } if(anIntTools.IsValidPointForFace(aPnt, TopoDS::Face(theModifiedBaseShape), Precision::Confusion()) == Standard_True) { aGeomSh->setImpl(new TopoDS_Shape(aShape)); - theIsFromFaceSet ? theRevolutionAlgo->addToShape(aGeomSh) : + theIsFromFaceSet ? theRevolutionAlgo->addToShape(aGeomSh) : theRevolutionAlgo->addFromShape(aGeomSh); } } else if(theType == TopAbs_EDGE) { @@ -687,29 +687,29 @@ void storeGenerationHistory(GeomAlgoAPI_Revolution* theRevolutionAlgo, anEdgeCheck.Perform(); if(anEdgeCheck.MaxDistance() < Precision::Confusion()) { aGeomSh->setImpl(new TopoDS_Shape(aShape)); - theIsFromFaceSet ? theRevolutionAlgo->addFromShape(aGeomSh) : + theIsFromFaceSet ? theRevolutionAlgo->addFromShape(aGeomSh) : theRevolutionAlgo->addToShape(aGeomSh); } anEdgeCheck.Init(anEdge, TopoDS::Face(theModifiedBaseShape)); anEdgeCheck.Perform(); if(anEdgeCheck.MaxDistance() < Precision::Confusion()) { aGeomSh->setImpl(new TopoDS_Shape(aShape)); - theIsFromFaceSet ? theRevolutionAlgo->addToShape(aGeomSh) : + theIsFromFaceSet ? theRevolutionAlgo->addToShape(aGeomSh) : theRevolutionAlgo->addFromShape(aGeomSh); } } else { Handle(Geom_Surface) aFaceSurface = BRep_Tool::Surface(TopoDS::Face(aShape)); - Handle(Geom_Surface) aBoundingSurface = + Handle(Geom_Surface) aBoundingSurface = BRep_Tool::Surface(TopoDS::Face(theRotatedBoundingFace)); Handle(Geom_Surface) aBaseSurface = BRep_Tool::Surface(TopoDS::Face(theModifiedBaseShape)); if(aFaceSurface == aBoundingSurface) { aGeomSh->setImpl(new TopoDS_Shape(aShape)); - theIsFromFaceSet ? theRevolutionAlgo->addFromShape(aGeomSh) : + theIsFromFaceSet ? theRevolutionAlgo->addFromShape(aGeomSh) : theRevolutionAlgo->addToShape(aGeomSh); } if(aFaceSurface == aBaseSurface) { aGeomSh->setImpl(new TopoDS_Shape(aShape)); - theIsFromFaceSet ? theRevolutionAlgo->addToShape(aGeomSh) : + theIsFromFaceSet ? theRevolutionAlgo->addToShape(aGeomSh) : theRevolutionAlgo->addFromShape(aGeomSh); } } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.h b/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.h index 7bb8530e4..b429437c1 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.h @@ -39,10 +39,10 @@ public: /// \brief Creates revolution for the given shape. /// \param[in] theBaseShape face for revolution. /// \param[in] theAxis axis for revolution. - /// \param[in] theToShape to bounding shape. Can be empty. + /// \param[in] theToShape to bounding shape. Can be empty. /// In this case offset will be applied to the basis. /// \param[in] theToAngle to angle. - /// \param[in] theFromShape from bounding shape. Can be empty. + /// \param[in] theFromShape from bounding shape. Can be empty. /// In this case offset will be applied to the basis. /// \param[in] theFromAngle from angle. GEOMALGOAPI_EXPORT GeomAlgoAPI_Revolution(const GeomShapePtr theBaseShape, diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Sewing.h b/src/GeomAlgoAPI/GeomAlgoAPI_Sewing.h index 19ae52661..363d8b936 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Sewing.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Sewing.h @@ -14,7 +14,7 @@ /// \class GeomAlgoAPI_Sewing /// \ingroup DataAlgo -/// \brief Allows creation of connected topology (shells) +/// \brief Allows creation of connected topology (shells) /// from a set of separate topological elements (faces). class GeomAlgoAPI_Sewing : public GeomAlgoAPI_MakeShape { diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp index 8112334bb..f6126bddc 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp @@ -22,13 +22,13 @@ namespace GeomAlgoAPI_ShapeAPI const double theDz) throw (GeomAlgoAPI_Exception) { GeomAlgoAPI_Box aBoxAlgo(theDx,theDy,theDz); - + if (!aBoxAlgo.check()) { throw GeomAlgoAPI_Exception(aBoxAlgo.getError()); } - + aBoxAlgo.build(); - + if(!aBoxAlgo.isDone()) { throw GeomAlgoAPI_Exception(aBoxAlgo.getError()); } @@ -37,20 +37,20 @@ namespace GeomAlgoAPI_ShapeAPI } return aBoxAlgo.shape(); } - + //====================================================================================== std::shared_ptr GeomAlgoAPI_ShapeAPI::makeBox( std::shared_ptr theFirstPoint, std::shared_ptr theSecondPoint) throw (GeomAlgoAPI_Exception) { GeomAlgoAPI_BoxPoints aBoxAlgo(theFirstPoint, theSecondPoint); - + if (!aBoxAlgo.check()) { throw GeomAlgoAPI_Exception(aBoxAlgo.getError()); } - + aBoxAlgo.build(); - + if(!aBoxAlgo.isDone()) { throw GeomAlgoAPI_Exception(aBoxAlgo.getError()); } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h index dc9328be1..e016a3c94 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h @@ -27,9 +27,9 @@ public: /// \param theDy The dimension on Y /// \param theDz The dimension on Z /// \return a shape - static std::shared_ptr makeBox(const double theDx, const double theDy, + static std::shared_ptr makeBox(const double theDx, const double theDy, const double theDz) throw (GeomAlgoAPI_Exception); - + /// Creates a box using the two points that defined a diagonal. /// \param theFirstPoint One extermity of the diagonal /// \param theSecondPoint The other extremity of the diagonal diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeBuilder.cpp index cc3e24bfe..bb00981c2 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeBuilder.cpp @@ -128,7 +128,7 @@ void GeomAlgoAPI_ShapeBuilder::addInternal(const std::shared_ptr // Copy sub-shapes from list to new shape. BRep_Builder aBuilder; std::shared_ptr aMakeShapeCustom(new GeomAlgoAPI_MakeShapeCustom()); - for(ListOfShape::const_iterator + for(ListOfShape::const_iterator anIt = theShapesToAdd.cbegin(); anIt != theShapesToAdd.cend(); ++anIt) { TopoDS_Shape aShapeToAdd = (*anIt)->impl(); TopoDS_Shape aModShapeToAdd = aShapeToAdd; @@ -160,7 +160,7 @@ void GeomAlgoAPI_ShapeBuilder::addInternal(const std::shared_ptr if(aBaseShapeType == TopAbs_WIRE) { if(aShapeToAddType == TopAbs_VERTEX) { // Find on which edge vertex is lie and add to this edge. - for(TopExp_Explorer + for(TopExp_Explorer aResultExp(aResultShape, TopAbs_EDGE); aResultExp.More(); aResultExp.Next()) { TopoDS_Shape anEdge = aResultExp.Current(); BRepExtrema_DistShapeShape aDist(anEdge, aShapeToAdd); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp index 3258f9590..5bc4fe03f 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp @@ -146,7 +146,7 @@ std::shared_ptr GeomAlgoAPI_ShapeTools::combineShapes( // Get all shapes with common subshapes and free shapes. NCollection_Map aFreeShapes; NCollection_Vector> aShapesWithCommonSubshapes; - for(BOPCol_IndexedDataMapOfShapeListOfShape::Iterator + for(BOPCol_IndexedDataMapOfShapeListOfShape::Iterator anIter(aMapSA); anIter.More(); anIter.Next()) { const TopoDS_Shape& aShape = anIter.Key(); BOPCol_ListOfShape& aListOfShape = anIter.ChangeValue(); @@ -169,10 +169,10 @@ std::shared_ptr GeomAlgoAPI_ShapeTools::combineShapes( aFreeShapes.Remove(aF); aFreeShapes.Remove(aL); aListOfShape.Clear(); - for(NCollection_List::Iterator + for(NCollection_List::Iterator aTempIter(aTempList); aTempIter.More(); aTempIter.Next()) { const TopoDS_Shape& aTempShape = aTempIter.Value(); - for(BOPCol_IndexedDataMapOfShapeListOfShape::Iterator + for(BOPCol_IndexedDataMapOfShapeListOfShape::Iterator anIter(aMapSA); anIter.More(); anIter.Next()) { BOPCol_ListOfShape& aTempListOfShape = anIter.ChangeValue(); if(aTempListOfShape.IsEmpty()) { @@ -203,24 +203,24 @@ std::shared_ptr GeomAlgoAPI_ShapeTools::combineShapes( } // Combine shapes with common subshapes. - for(NCollection_Vector>::Iterator + for(NCollection_Vector>::Iterator anIter(aShapesWithCommonSubshapes); anIter.More(); anIter.Next()) { TopoDS_Shell aShell; TopoDS_CompSolid aCSolid; TopoDS_Builder aBuilder; - theType == + theType == GeomAPI_Shape::COMPSOLID ? aBuilder.MakeCompSolid(aCSolid) : aBuilder.MakeShell(aShell); NCollection_Map& aShapesMap = anIter.ChangeValue(); for(TopExp_Explorer anExp(aShapesComp, aTA); anExp.More(); anExp.Next()) { const TopoDS_Shape& aShape = anExp.Current(); if(aShapesMap.Contains(aShape)) { - theType == + theType == GeomAPI_Shape::COMPSOLID ? aBuilder.Add(aCSolid, aShape) : aBuilder.Add(aShell, aShape); aShapesMap.Remove(aShape); } } std::shared_ptr aGeomShape(new GeomAPI_Shape); - TopoDS_Shape* aSh = theType == GeomAPI_Shape::COMPSOLID ? new TopoDS_Shape(aCSolid) : + TopoDS_Shape* aSh = theType == GeomAPI_Shape::COMPSOLID ? new TopoDS_Shape(aCSolid) : new TopoDS_Shape(aShell); aGeomShape->setImpl(aSh); theCombinedShapes.push_back(aGeomShape); @@ -244,11 +244,11 @@ std::shared_ptr GeomAlgoAPI_ShapeTools::combineShapes( TopoDS_Compound aResultComp; TopoDS_Builder aBuilder; aBuilder.MakeCompound(aResultComp); - for(ListOfShape::const_iterator anIter = theCombinedShapes.cbegin(); + for(ListOfShape::const_iterator anIter = theCombinedShapes.cbegin(); anIter != theCombinedShapes.cend(); anIter++) { aBuilder.Add(aResultComp, (*anIter)->impl()); } - for(ListOfShape::const_iterator anIter = theFreeShapes.cbegin(); + for(ListOfShape::const_iterator anIter = theFreeShapes.cbegin(); anIter != theFreeShapes.cend(); anIter++) { aBuilder.Add(aResultComp, (*anIter)->impl()); } @@ -259,7 +259,7 @@ std::shared_ptr GeomAlgoAPI_ShapeTools::combineShapes( } //================================================================================================== -static void addSimpleShapeToList(const TopoDS_Shape& theShape, +static void addSimpleShapeToList(const TopoDS_Shape& theShape, NCollection_List& theList) { if(theShape.IsNull()) { @@ -309,17 +309,17 @@ std::shared_ptr GeomAlgoAPI_ShapeTools::groupSharedTopology( NCollection_List aGroupedShapes; aGroupedShapes.Append(anUngroupedShapes.First()); anUngroupedShapes.RemoveFirst(); - for(NCollection_List::Iterator aGroupIt(aGroupedShapes); + for(NCollection_List::Iterator aGroupIt(aGroupedShapes); aGroupIt.More(); aGroupIt.Next()) { const TopoDS_Shape& aGroupShape = aGroupIt.Value(); - for(NCollection_List::Iterator anUngroupedIt(anUngroupedShapes); + for(NCollection_List::Iterator anUngroupedIt(anUngroupedShapes); anUngroupedIt.More(); anUngroupedIt.Next()) { const TopoDS_Shape& anUngroupedShape = anUngroupedIt.Value(); bool isFound = false; - for(TopExp_Explorer aGroupShapeExp(aGroupShape, TopAbs_VERTEX); + for(TopExp_Explorer aGroupShapeExp(aGroupShape, TopAbs_VERTEX); aGroupShapeExp.More(); aGroupShapeExp.Next()) { const TopoDS_Shape& aVertex1 = aGroupShapeExp.Current(); - for(TopExp_Explorer anUngroupedShapeExp(anUngroupedShape, TopAbs_VERTEX); + for(TopExp_Explorer anUngroupedShapeExp(anUngroupedShape, TopAbs_VERTEX); anUngroupedShapeExp.More(); anUngroupedShapeExp.Next()) { const TopoDS_Shape& aVertex2 = anUngroupedShapeExp.Current(); if(aVertex1.IsSame(aVertex2)) { @@ -345,7 +345,7 @@ std::shared_ptr GeomAlgoAPI_ShapeTools::groupSharedTopology( BRep_Builder aBuilder; aBuilder.MakeCompound(aCompound); ListOfShape aCompSolids, aFreeSolids; - for(NCollection_Vector>::Iterator + for(NCollection_Vector>::Iterator anIt(aGroups); anIt.More(); anIt.Next()) { NCollection_List aGroup = anIt.Value(); GeomShapePtr aGeomShape(new GeomAPI_Shape()); @@ -376,7 +376,7 @@ std::list > Bnd_Box aBndBox; // Getting box. - for (ListOfShape::const_iterator + for (ListOfShape::const_iterator anObjectsIt = theShapes.begin(); anObjectsIt != theShapes.end(); anObjectsIt++) { const TopoDS_Shape& aShape = (*anObjectsIt)->impl(); BRepBndLib::Add(aShape, aBndBox); @@ -405,7 +405,7 @@ std::list > } //================================================================================================== -std::shared_ptr +std::shared_ptr GeomAlgoAPI_ShapeTools::faceToInfinitePlane(const std::shared_ptr theFace) { if (!theFace.get()) @@ -463,7 +463,7 @@ std::shared_ptr GeomAlgoAPI_ShapeTools::fitPlaneToBox( IntAna_Quadric aQuadric(aFacePln); Standard_Real UMin, UMax, VMin, VMax; UMin = UMax = VMin = VMax = 0; - for (std::list >::const_iterator + for (std::list >::const_iterator aPointsIt = thePoints.begin(); aPointsIt != thePoints.end(); aPointsIt++) { const gp_Pnt& aPnt = (*aPointsIt)->impl(); gp_Lin aLin(aPnt, aFacePln.Axis().Direction()); @@ -620,7 +620,7 @@ bool GeomAlgoAPI_ShapeTools::isSubShapeInsideShape( // No intersections found. Edge is inside or outside face. Check it. BRepAdaptor_Curve aCurveAdaptor(anEdge); gp_Pnt aPointToCheck = - aCurveAdaptor.Value((aCurveAdaptor.FirstParameter() + + aCurveAdaptor.Value((aCurveAdaptor.FirstParameter() + aCurveAdaptor.LastParameter()) / 2.0); Handle(Geom_Surface) aSurface = BRep_Tool::Surface(aFace); ShapeAnalysis_Surface aSAS(aSurface); @@ -652,7 +652,7 @@ bool GeomAlgoAPI_ShapeTools::isShapeValid(const std::shared_ptr t } //================================================================================================== -std::shared_ptr +std::shared_ptr GeomAlgoAPI_ShapeTools::getFaceOuterWire(const std::shared_ptr theFace) { GeomShapePtr anOuterWire; @@ -719,7 +719,7 @@ void GeomAlgoAPI_ShapeTools::splitShape(const std::shared_ptr& th aBOP.Perform(); if (aBOP.ErrorStatus()) return; - + // Collect splits const TopTools_ListOfShape& aSplits = aBOP.Modified(aBaseEdge); TopTools_ListIteratorOfListOfShape anIt(aSplits); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h index 49aaef252..22c886787 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h @@ -30,11 +30,11 @@ public: /// \return the total volume of the solids of the current shape or 0.0 if it can be computed. GEOMALGOAPI_EXPORT static double volume(const std::shared_ptr theShape); - /// \return the centre of mass of the current face. + /// \return the centre of mass of the current face. /// The coordinates returned for the center of mass - /// are expressed in the absolute Cartesian coordinate system. + /// are expressed in the absolute Cartesian coordinate system. /// (This function works only for surfaces). - GEOMALGOAPI_EXPORT static std::shared_ptr + GEOMALGOAPI_EXPORT static std::shared_ptr centreOfMass(const std::shared_ptr theShape); /// \brief Combines faces with common edges to shells, or solids to compsolids. @@ -51,19 +51,19 @@ public: /// \brief Groups shapes with shared topology to compounds. /// \param[in] theCompound compound of shapes. /// \return compound of compounds with shared topology. - GEOMALGOAPI_EXPORT static std::shared_ptr + GEOMALGOAPI_EXPORT static std::shared_ptr groupSharedTopology(const std::shared_ptr theCompound); /// \brief Calculates bounding box for theShapes /// \return list of eight points. /// \param[in] theShapes list of shapes. /// \param[in] theEnlarge enlarges bounding box size. - GEOMALGOAPI_EXPORT static - std::list > getBoundingBox(const ListOfShape& theShapes, + GEOMALGOAPI_EXPORT static + std::list > getBoundingBox(const ListOfShape& theShapes, const double theEnlarge = 0.0); /// \return infinite plane received from theFace plane. - GEOMALGOAPI_EXPORT static std::shared_ptr + GEOMALGOAPI_EXPORT static std::shared_ptr faceToInfinitePlane(const std::shared_ptr theFace); /// \brief Enlarges or reduces plane to fit bounding box. @@ -109,7 +109,7 @@ public: GEOMALGOAPI_EXPORT static bool isShapeValid(const std::shared_ptr theShape); /// \return outer wire for face. If theShape has different type returns empty pointer. - GEOMALGOAPI_EXPORT static + GEOMALGOAPI_EXPORT static std::shared_ptr getFaceOuterWire(const std::shared_ptr theFace); /// \return true if edge is parallel to face. diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp index 2bd7775e3..3b3b4d548 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp @@ -149,7 +149,7 @@ void GeomAlgoAPI_SketchBuilder::createFaces(const std::shared_ptr& const std::shared_ptr& theWire, std::list >& theResultFaces) { - std::shared_ptr aWire = + std::shared_ptr aWire = std::dynamic_pointer_cast(theWire); if(aWire) { // Filter wires, return only faces. diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.h b/src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.h index 7f3913144..418ff026d 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.h @@ -19,7 +19,7 @@ class GeomAlgoAPI_WireBuilder public: /// \brief Creates a wire from edges and wires. /// \param[in] theShapes list of shapes. Only edges and wires allowed. - /// The edges are not to be consecutive. + /// The edges are not to be consecutive. /// But they are to be all connected geometrically or topologically. /// \return wire created from theShapes. Empty in case of error or bad input. GEOMALGOAPI_EXPORT static std::shared_ptr wire(const ListOfShape& theShapes); diff --git a/src/GeomData/GeomData_Point.h b/src/GeomData/GeomData_Point.h index e6dc4ba55..2aa587a1d 100644 --- a/src/GeomData/GeomData_Point.h +++ b/src/GeomData/GeomData_Point.h @@ -21,8 +21,8 @@ class ModelAPI_ExpressionDouble; class GeomData_Point : public GeomDataAPI_Point { enum { NUM_COMPONENTS = 3 }; - /// Expressions for X, Y and Z - std::shared_ptr myExpression[NUM_COMPONENTS]; + /// Expressions for X, Y and Z + std::shared_ptr myExpression[NUM_COMPONENTS]; public: /// Defines the double value GEOMDATA_EXPORT virtual void setValue(const double theX, const double theY, const double theZ); @@ -39,7 +39,7 @@ class GeomData_Point : public GeomDataAPI_Point GEOMDATA_EXPORT virtual std::shared_ptr pnt(); /// Defines the calculated double value - GEOMDATA_EXPORT virtual + GEOMDATA_EXPORT virtual void setCalculatedValue(const double theX, const double theY, const double theZ); /// Defines the text values @@ -67,7 +67,7 @@ class GeomData_Point : public GeomDataAPI_Point GEOMDATA_EXPORT virtual std::string expressionError(int theComponent); /// Defines the used parameters - GEOMDATA_EXPORT virtual void setUsedParameters(int theComponent, + GEOMDATA_EXPORT virtual void setUsedParameters(int theComponent, const std::set& theUsedParameters); /// Returns the used parameters diff --git a/src/GeomData/GeomData_Point2D.cpp b/src/GeomData/GeomData_Point2D.cpp index 6873674b0..30b47115d 100644 --- a/src/GeomData/GeomData_Point2D.cpp +++ b/src/GeomData/GeomData_Point2D.cpp @@ -114,7 +114,7 @@ std::string GeomData_Point2D::expressionError(int theComponent) return myExpression[theComponent]->error(); } -void GeomData_Point2D::setUsedParameters(int theComponent, +void GeomData_Point2D::setUsedParameters(int theComponent, const std::set& theUsedParameters) { assert(theComponent >= 0 && theComponent < NUM_COMPONENTS); diff --git a/src/GeomData/GeomData_Point2D.h b/src/GeomData/GeomData_Point2D.h index 017802d5f..a4864c6c4 100644 --- a/src/GeomData/GeomData_Point2D.h +++ b/src/GeomData/GeomData_Point2D.h @@ -60,7 +60,7 @@ class GeomData_Point2D : public GeomDataAPI_Point2D GEOMDATA_EXPORT virtual std::string expressionError(int theComponent); /// Defines the used parameters - GEOMDATA_EXPORT virtual void setUsedParameters(int theComponent, + GEOMDATA_EXPORT virtual void setUsedParameters(int theComponent, const std::set& theUsedParameters); /// Returns the used parameters diff --git a/src/GeomDataAPI/GeomDataAPI_Point.h b/src/GeomDataAPI/GeomDataAPI_Point.h index a68e0762b..126c28001 100644 --- a/src/GeomDataAPI/GeomDataAPI_Point.h +++ b/src/GeomDataAPI/GeomDataAPI_Point.h @@ -23,7 +23,7 @@ class GeomDataAPI_Point : public ModelAPI_Attribute { public: /// Defines the double value - GEOMDATAAPI_EXPORT virtual + GEOMDATAAPI_EXPORT virtual void setValue(const double theX, const double theY, const double theZ) = 0; /// Defines the point GEOMDATAAPI_EXPORT virtual void setValue(const std::shared_ptr& thePoint) = 0; @@ -38,9 +38,9 @@ class GeomDataAPI_Point : public ModelAPI_Attribute GEOMDATAAPI_EXPORT virtual std::shared_ptr pnt() = 0; /// Defines the calculated double value - GEOMDATAAPI_EXPORT virtual + GEOMDATAAPI_EXPORT virtual void setCalculatedValue(const double theX, const double theY, const double theZ) = 0; - + /// Defines the text values GEOMDATAAPI_EXPORT virtual void setText(const std::string& theX, const std::string& theY, @@ -66,14 +66,14 @@ class GeomDataAPI_Point : public ModelAPI_Attribute GEOMDATAAPI_EXPORT virtual bool expressionInvalid(int theComponent) = 0; /// Allows to set expression (text) error (by the parameters listener) - GEOMDATAAPI_EXPORT virtual + GEOMDATAAPI_EXPORT virtual void setExpressionError(int theComponent, const std::string& theError) = 0; /// Returns an expression error GEOMDATAAPI_EXPORT virtual std::string expressionError(int theComponent) = 0; /// Defines the used parameters - GEOMDATAAPI_EXPORT virtual void setUsedParameters(int theComponent, + GEOMDATAAPI_EXPORT virtual void setUsedParameters(int theComponent, const std::set& theUsedParameters) = 0; /// Returns the used parameters diff --git a/src/GeomDataAPI/GeomDataAPI_Point2D.h b/src/GeomDataAPI/GeomDataAPI_Point2D.h index fa8a57158..ae11ff5f6 100644 --- a/src/GeomDataAPI/GeomDataAPI_Point2D.h +++ b/src/GeomDataAPI/GeomDataAPI_Point2D.h @@ -59,14 +59,14 @@ class GeomDataAPI_Point2D : public ModelAPI_Attribute GEOMDATAAPI_EXPORT virtual bool expressionInvalid(int theComponent) = 0; /// Allows to set expression (text) error (by the parameters listener) - GEOMDATAAPI_EXPORT virtual + GEOMDATAAPI_EXPORT virtual void setExpressionError(int theComponent, const std::string& theError) = 0; /// Returns an expression error GEOMDATAAPI_EXPORT virtual std::string expressionError(int theComponent) = 0; /// Defines the used parameters - GEOMDATAAPI_EXPORT virtual void setUsedParameters(int theComponent, + GEOMDATAAPI_EXPORT virtual void setUsedParameters(int theComponent, const std::set& theUsedParameters) = 0; /// Returns the used parameters diff --git a/src/GeomValidators/GeomValidators_BooleanArguments.cpp b/src/GeomValidators/GeomValidators_BooleanArguments.cpp index 92a598c7b..c22b7abd3 100644 --- a/src/GeomValidators/GeomValidators_BooleanArguments.cpp +++ b/src/GeomValidators/GeomValidators_BooleanArguments.cpp @@ -54,7 +54,7 @@ bool GeomValidators_BooleanArguments::isValid(const std::shared_ptrvalue(); GeomShapePtr aShapePtr = aResult->shape(); // it is important to call isEqual of the shape of result. - // It is a GeomAPI_Vertex shape for the point. The shape of the parameter is + // It is a GeomAPI_Vertex shape for the point. The shape of the parameter is // GeomAPI_Shape. It is important to use the realization of the isEqual method from // GeomAPI_Vertex class if (!aShape.get()) { diff --git a/src/GeomValidators/GeomValidators_Different.cpp b/src/GeomValidators/GeomValidators_Different.cpp index 1f75317b3..1e3ce31ad 100644 --- a/src/GeomValidators/GeomValidators_Different.cpp +++ b/src/GeomValidators/GeomValidators_Different.cpp @@ -33,7 +33,7 @@ bool isEqual(const AttributePoint2DPtr& theLeft, const AttributePoint2DPtr& theR bool isEqualAttributes(const AttributePtr& theLeft, const AttributePtr& theRight) { - if (theLeft->attributeType() == GeomDataAPI_Point2D::typeId() && + if (theLeft->attributeType() == GeomDataAPI_Point2D::typeId() && theRight->attributeType() == GeomDataAPI_Point2D::typeId()) return isEqual(std::dynamic_pointer_cast(theLeft), std::dynamic_pointer_cast(theRight)); @@ -60,8 +60,8 @@ bool GeomValidators_Different::isValid(const std::shared_ptr& Events_InfoMessage& theError) const { std::map > anAttributesMap; - // For all attributes referred by theArguments - // sort it using attributeType() and store into anAttributesMap + // For all attributes referred by theArguments + // sort it using attributeType() and store into anAttributesMap std::list::const_iterator anArgumentIt = theArguments.begin(); for (; anArgumentIt != theArguments.end(); ++anArgumentIt) { AttributePtr anAttribute = theFeature->attribute(*anArgumentIt); @@ -69,7 +69,7 @@ bool GeomValidators_Different::isValid(const std::shared_ptr& } // Search differences inside each attribute list - std::map >::const_iterator + std::map >::const_iterator anAttributesMapIt = anAttributesMap.begin(); for (; anAttributesMapIt != anAttributesMap.end(); ++anAttributesMapIt) { const std::list& anAttributes = anAttributesMapIt->second; @@ -82,12 +82,12 @@ bool GeomValidators_Different::isValid(const std::shared_ptr& std::list::const_iterator aFindIt = std::find_if(aNextIt, anAttributes.end(), IsEqual(*anAttributeIt)); if (aFindIt != anAttributes.end()) { - theError = "Attributes " + (*anAttributeIt)->id() + " and " + + theError = "Attributes " + (*anAttributeIt)->id() + " and " + (*aFindIt)->id() + " are equal." ; return false; } ++anAttributeIt; - ++aNextIt; + ++aNextIt; } } } diff --git a/src/GeomValidators/GeomValidators_Different.h b/src/GeomValidators/GeomValidators_Different.h index 61fbeb0d7..f7771c197 100644 --- a/src/GeomValidators/GeomValidators_Different.h +++ b/src/GeomValidators/GeomValidators_Different.h @@ -28,7 +28,7 @@ public: const std::list& theArguments, Events_InfoMessage& theError) const; - GEOMVALIDATORS_EXPORT virtual + GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature, std::string theAttribute); }; diff --git a/src/GeomValidators/GeomValidators_DifferentShapes.cpp b/src/GeomValidators/GeomValidators_DifferentShapes.cpp index 7eefe2626..01eb0409a 100644 --- a/src/GeomValidators/GeomValidators_DifferentShapes.cpp +++ b/src/GeomValidators/GeomValidators_DifferentShapes.cpp @@ -16,7 +16,7 @@ bool GeomValidators_DifferentShapes::isValid(const AttributePtr& theAttribute, Events_InfoMessage& theError) const { FeaturePtr aFeature = std::dynamic_pointer_cast(theAttribute->owner()); - AttributeSelectionPtr aSelectionAttribute = + AttributeSelectionPtr aSelectionAttribute = std::dynamic_pointer_cast(theAttribute); GeomShapePtr aShape = aSelectionAttribute->value(); if (!aShape.get()) { @@ -27,7 +27,7 @@ bool GeomValidators_DifferentShapes::isValid(const AttributePtr& theAttribute, std::string aCurrentAttributeId = theAttribute->id(); // get all feature attributes - std::list anAttrs = + std::list anAttrs = aFeature->data()->attributes(ModelAPI_AttributeSelection::typeId()); if (anAttrs.size() > 0 && aShape.get() != NULL) { std::list::iterator anAttr = anAttrs.begin(); @@ -35,7 +35,7 @@ bool GeomValidators_DifferentShapes::isValid(const AttributePtr& theAttribute, AttributePtr anAttribute = *anAttr; // take into concideration only other attributes if (anAttribute.get() != NULL && anAttribute->id() != aCurrentAttributeId) { - aSelectionAttribute = + aSelectionAttribute = std::dynamic_pointer_cast(anAttribute); // the shape of the attribute should be not the same if (aSelectionAttribute.get() != NULL) { diff --git a/src/GeomValidators/GeomValidators_Face.cpp b/src/GeomValidators/GeomValidators_Face.cpp index dd4155263..1979d7d71 100644 --- a/src/GeomValidators/GeomValidators_Face.cpp +++ b/src/GeomValidators/GeomValidators_Face.cpp @@ -27,7 +27,7 @@ GeomAbs_SurfaceType faceType(const std::string& theType) std::string aType = std::string(theType.c_str()); if (MyFaceTypes.find(aType) != MyFaceTypes.end()) return MyFaceTypes[aType]; - + Events_InfoMessage("GeomValidators_Face", "Face type defined in XML is not implemented!").send(); return GeomAbs_Plane; } diff --git a/src/GeomValidators/GeomValidators_FeatureKind.cpp b/src/GeomValidators/GeomValidators_FeatureKind.cpp index c6036e414..25fcc90ce 100755 --- a/src/GeomValidators/GeomValidators_FeatureKind.cpp +++ b/src/GeomValidators/GeomValidators_FeatureKind.cpp @@ -36,7 +36,7 @@ bool GeomValidators_FeatureKind::isValid(const AttributePtr& theAttribute, std::string anAttributeType = theAttribute->attributeType(); if (anAttributeType == ModelAPI_AttributeSelectionList::typeId()) { - AttributeSelectionListPtr aSelectionListAttr = + AttributeSelectionListPtr aSelectionListAttr = std::dynamic_pointer_cast(theAttribute); // all context objects should be sketch entities for (int i = 0, aSize = aSelectionListAttr->size(); i < aSize && isSketchEntities; i++) { @@ -60,7 +60,7 @@ bool GeomValidators_FeatureKind::isValid(const AttributePtr& theAttribute, } } if (anAttributeType == ModelAPI_AttributeSelection::typeId()) { - AttributeSelectionPtr aSelectAttr = + AttributeSelectionPtr aSelectAttr = std::dynamic_pointer_cast(theAttribute); ObjectPtr anObject = aSelectAttr->context(); // a context of the selection attribute is a feature result. It can be a case when the result @@ -93,7 +93,7 @@ bool GeomValidators_FeatureKind::isValid(const AttributePtr& theAttribute, } } if (anAttributeType == ModelAPI_AttributeRefAttr::typeId()) { - std::shared_ptr aRef = + std::shared_ptr aRef = std::dynamic_pointer_cast(theAttribute); isSketchEntities = false; if (aRef->isObject()) { @@ -106,7 +106,7 @@ bool GeomValidators_FeatureKind::isValid(const AttributePtr& theAttribute, } } if (anAttributeType == ModelAPI_AttributeReference::typeId()) { - AttributeReferencePtr aRefAttr = + AttributeReferencePtr aRefAttr = std::dynamic_pointer_cast(theAttribute); ObjectPtr anObject = aRefAttr->value(); // a context of the selection attribute is a feature result. It can be a case when the result diff --git a/src/GeomValidators/GeomValidators_Finite.cpp b/src/GeomValidators/GeomValidators_Finite.cpp index c8f5d02ad..2c871d438 100755 --- a/src/GeomValidators/GeomValidators_Finite.cpp +++ b/src/GeomValidators/GeomValidators_Finite.cpp @@ -20,23 +20,23 @@ bool GeomValidators_Finite::isValid(const AttributePtr& theAttribute, const std::string anAttributeType = theAttribute->attributeType(); if(anAttributeType == ModelAPI_AttributeSelection::typeId()) { - AttributeSelectionPtr aSelectionAttr = + AttributeSelectionPtr aSelectionAttr = std::dynamic_pointer_cast(theAttribute); ResultPtr aResult = aSelectionAttr->context(); - ResultConstructionPtr aConstruction = + ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aResult); if (aConstruction.get() && aConstruction->isInfinite()) { aValid = false; theError = "Infinite result is selected."; } } else if(anAttributeType == ModelAPI_AttributeSelectionList::typeId()) { - AttributeSelectionListPtr aSelectionListAttr = + AttributeSelectionListPtr aSelectionListAttr = std::dynamic_pointer_cast(theAttribute); for (int i = 0, aSize = aSelectionListAttr->size(); i < aSize; i++) { AttributeSelectionPtr aSelectAttr = aSelectionListAttr->value(i); ResultPtr aResult = aSelectAttr->context(); if (aResult.get() && aResult->groupName() == ModelAPI_ResultConstruction::group()) { - ResultConstructionPtr aConstruction = + ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aResult); if (aConstruction.get() && aConstruction->isInfinite()) { aValid = false; diff --git a/src/GeomValidators/GeomValidators_IntersectionSelection.cpp b/src/GeomValidators/GeomValidators_IntersectionSelection.cpp index 9e108be80..7ecbf5f38 100644 --- a/src/GeomValidators/GeomValidators_IntersectionSelection.cpp +++ b/src/GeomValidators/GeomValidators_IntersectionSelection.cpp @@ -21,7 +21,7 @@ bool GeomValidators_IntersectionSelection::isValid(const AttributePtr& theAttrib return false; } FeaturePtr aFeature = std::dynamic_pointer_cast(theAttribute->owner()); - AttributeSelectionListPtr anAttrSelectionList = + AttributeSelectionListPtr anAttrSelectionList = std::dynamic_pointer_cast(theAttribute); for(int anIndex = 0; anIndex < anAttrSelectionList->size(); ++anIndex) { AttributeSelectionPtr anAttrSelection = anAttrSelectionList->value(anIndex); diff --git a/src/GeomValidators/GeomValidators_MinObjectsSelected.cpp b/src/GeomValidators/GeomValidators_MinObjectsSelected.cpp index 31f8d0c3d..3c44a2ddc 100644 --- a/src/GeomValidators/GeomValidators_MinObjectsSelected.cpp +++ b/src/GeomValidators/GeomValidators_MinObjectsSelected.cpp @@ -17,7 +17,7 @@ bool GeomValidators_MinObjectsSelected::isValid(const std::shared_ptrvalue(); } - if((anObjectsNb > 0 && aToolsNb > 0) || + if((anObjectsNb > 0 && aToolsNb > 0) || (isCombine && anObjectsNb != 0 && (anObjectsNb + aToolsNb > 1))) { return true; } @@ -53,7 +53,7 @@ bool GeomValidators_PartitionArguments::isValid(const std::shared_ptrregisterValidator("GeomValidators_ShapeType", new GeomValidators_ShapeType); aFactory->registerValidator("GeomValidators_ZeroOffset", new GeomValidators_ZeroOffset); - aFactory->registerValidator("GeomValidators_IntersectionSelection", + aFactory->registerValidator("GeomValidators_IntersectionSelection", new GeomValidators_IntersectionSelection); aFactory->registerValidator("GeomValidators_FeatureKind", new GeomValidators_FeatureKind); - aFactory->registerValidator("GeomValidators_MinObjectsSelected", + aFactory->registerValidator("GeomValidators_MinObjectsSelected", new GeomValidators_MinObjectsSelected); // register this plugin diff --git a/src/GeomValidators/GeomValidators_Positive.cpp b/src/GeomValidators/GeomValidators_Positive.cpp index 17c38fb19..6737f289a 100644 --- a/src/GeomValidators/GeomValidators_Positive.cpp +++ b/src/GeomValidators/GeomValidators_Positive.cpp @@ -26,7 +26,7 @@ GeomValidators_Positive::GeomValidators_Positive() aFactory->registerValidator("GeomValidators_Positive", this); } -bool GeomValidators_Positive::isValid(const AttributePtr& theAttribute, +bool GeomValidators_Positive::isValid(const AttributePtr& theAttribute, const std::list& theArguments, Events_InfoMessage& theError) const { diff --git a/src/GeomValidators/GeomValidators_ShapeType.cpp b/src/GeomValidators/GeomValidators_ShapeType.cpp index 4a417818a..6c0077c6a 100755 --- a/src/GeomValidators/GeomValidators_ShapeType.cpp +++ b/src/GeomValidators/GeomValidators_ShapeType.cpp @@ -22,7 +22,7 @@ typedef std::map EdgeTypes; static EdgeTypes MyShapeTypes; -GeomValidators_ShapeType::TypeOfShape +GeomValidators_ShapeType::TypeOfShape GeomValidators_ShapeType::shapeType(const std::string& theType) { if (MyShapeTypes.size() == 0) { @@ -52,7 +52,7 @@ std::string getShapeTypeDescription(const GeomValidators_ShapeType::TypeOfShape& std::string aValue = ""; if (MyShapeTypes.size() != 0) { - std::map::const_iterator + std::map::const_iterator anIt = MyShapeTypes.begin(), aLast = MyShapeTypes.end(); for (; anIt != aLast; anIt++) { if (anIt->second == theType) @@ -107,7 +107,7 @@ bool GeomValidators_ShapeType::isValidAttribute(const AttributePtr& theAttribute std::string anAttributeType = theAttribute->attributeType(); if (anAttributeType == ModelAPI_AttributeSelection::typeId()) { - AttributeSelectionPtr anAttr = + AttributeSelectionPtr anAttr = std::dynamic_pointer_cast(theAttribute); GeomShapePtr aShape = anAttr->value(); if (aShape.get()) @@ -178,7 +178,7 @@ bool GeomValidators_ShapeType::isValidObject(const ObjectPtr& theObject, ResultPtr aResult = std::dynamic_pointer_cast(theObject); if( theShapeType==Plane ) { - ResultConstructionPtr aResultConstruction = + ResultConstructionPtr aResultConstruction = std::dynamic_pointer_cast(theObject); FeaturePtr aFeature = ModelAPI_Feature::feature(theObject); const std::string& aKind = aFeature->getKind(); diff --git a/src/GeomValidators/GeomValidators_Tools.cpp b/src/GeomValidators/GeomValidators_Tools.cpp index d9136fe2f..a364bf0d3 100644 --- a/src/GeomValidators/GeomValidators_Tools.cpp +++ b/src/GeomValidators/GeomValidators_Tools.cpp @@ -19,19 +19,19 @@ namespace GeomValidators_Tools { ObjectPtr anObject; std::string anAttrType = theAttribute->attributeType(); if (anAttrType == ModelAPI_AttributeRefAttr::typeId()) { - AttributeRefAttrPtr anAttr = + AttributeRefAttrPtr anAttr = std::dynamic_pointer_cast(theAttribute); if (anAttr != NULL && anAttr->isObject()) anObject = anAttr->object(); } if (anAttrType == ModelAPI_AttributeSelection::typeId()) { - AttributeSelectionPtr anAttr = + AttributeSelectionPtr anAttr = std::dynamic_pointer_cast(theAttribute); if (anAttr != NULL) anObject = anAttr->context(); } if (anAttrType == ModelAPI_AttributeReference::typeId()) { - AttributeReferencePtr anAttr = + AttributeReferencePtr anAttr = std::dynamic_pointer_cast(theAttribute); if (anAttr.get() != NULL) anObject = anAttr->value(); diff --git a/src/GeomValidators/GeomValidators_Tools.h b/src/GeomValidators/GeomValidators_Tools.h index 3912db484..b4a44fe58 100644 --- a/src/GeomValidators/GeomValidators_Tools.h +++ b/src/GeomValidators/GeomValidators_Tools.h @@ -17,7 +17,7 @@ namespace GeomValidators_Tools { // Returns the object from the attribute - /// \param theObj an object + /// \param theObj an object GEOMVALIDATORS_EXPORT ObjectPtr getObject(const AttributePtr& theAttribute); }; diff --git a/src/GeomValidators/GeomValidators_ZeroOffset.cpp b/src/GeomValidators/GeomValidators_ZeroOffset.cpp index 34aec623f..0c98260fa 100644 --- a/src/GeomValidators/GeomValidators_ZeroOffset.cpp +++ b/src/GeomValidators/GeomValidators_ZeroOffset.cpp @@ -43,12 +43,12 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr& ListOfShape aFacesList; if(theFeature->selection(*anIt)) { AttributeSelectionPtr aFaceSelection = theFeature->selection(*anIt); - ResultConstructionPtr aConstruction = + ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aFaceSelection->context()); if(aConstruction.get()) { int aSketchFacesNum = aConstruction->facesNum(); for(int aFaceIndex = 0; aFaceIndex < aSketchFacesNum; aFaceIndex++) { - std::shared_ptr aFace = + std::shared_ptr aFace = std::dynamic_pointer_cast(aConstruction->face(aFaceIndex)); if(aFace->isFace() && aFace->isPlanar()) { aFacesList.push_back(aFace); @@ -70,7 +70,7 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr& if(!aContextShape.get()) { break; } - ResultConstructionPtr aConstruction = + ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aContext); if(!aConstruction.get()) { break; @@ -178,7 +178,7 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr& } std::shared_ptr aPln = aFace->getPlane(); if(aPln.get()) { - for(ListOfShape::const_iterator + for(ListOfShape::const_iterator anIter = aFacesList.cbegin(); anIter != aFacesList.cend(); anIter++) { std::shared_ptr aSketchShape = *anIter; std::shared_ptr aSketchFace(new GeomAPI_Face(aSketchShape)); diff --git a/src/GeomValidators/GeomValidators_ZeroOffset.h b/src/GeomValidators/GeomValidators_ZeroOffset.h index 06348e145..8fbb9e28a 100644 --- a/src/GeomValidators/GeomValidators_ZeroOffset.h +++ b/src/GeomValidators/GeomValidators_ZeroOffset.h @@ -29,7 +29,7 @@ public: Events_InfoMessage& theError) const; /// \return true if the attribute in feature is not obligatory for the feature execution. - GEOMVALIDATORS_EXPORT virtual + GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature, std::string theAttribute); }; diff --git a/src/InitializationPlugin/InitializationPlugin_Plugin.cpp b/src/InitializationPlugin/InitializationPlugin_Plugin.cpp index a82ff65e4..ee76b04d2 100644 --- a/src/InitializationPlugin/InitializationPlugin_Plugin.cpp +++ b/src/InitializationPlugin/InitializationPlugin_Plugin.cpp @@ -153,7 +153,7 @@ FeaturePtr InitializationPlugin_Plugin::createAxis(DocumentPtr theDoc, FeaturePt aAxis->data()->setName("OZ"); } // don't show automatically created feature in the features history - aAxis->setInHistory(aAxis, false); + aAxis->setInHistory(aAxis, false); aAxis->execute(); aAxis->data()->execState(ModelAPI_StateDone); aAxis->firstResult()->data()->execState(ModelAPI_StateDone); diff --git a/src/InitializationPlugin/InitializationPlugin_Plugin.h b/src/InitializationPlugin/InitializationPlugin_Plugin.h index 64d4c951f..6f06f059f 100644 --- a/src/InitializationPlugin/InitializationPlugin_Plugin.h +++ b/src/InitializationPlugin/InitializationPlugin_Plugin.h @@ -40,7 +40,7 @@ class InitializationPlugin_Plugin : public Events_Listener /// \param theX - X coordinate /// \param theY - Y coordinate /// \param theZ - Z coordinate - FeaturePtr createPoint(DocumentPtr theDoc, const std::string& theName, + FeaturePtr createPoint(DocumentPtr theDoc, const std::string& theName, double theX, double theY, double theZ); /// Creates an axis which is started from origin point @@ -49,7 +49,7 @@ class InitializationPlugin_Plugin : public Events_Listener /// \param theX - X of direction point /// \param theY - Y of direction point /// \param theZ - Z of direction point - FeaturePtr createAxis(DocumentPtr theDoc, FeaturePtr theOrigin, + FeaturePtr createAxis(DocumentPtr theDoc, FeaturePtr theOrigin, double theX, double theY, double theZ); }; diff --git a/src/Model/Model_Application.h b/src/Model/Model_Application.h index 728c2a807..3593decba 100644 --- a/src/Model/Model_Application.h +++ b/src/Model/Model_Application.h @@ -8,11 +8,11 @@ #ifndef Model_Application_H_ #define Model_Application_H_ -#include +#include #include #include -// Define handle class +// Define handle class DEFINE_STANDARD_HANDLE(Model_Application, TDocStd_Application) /**\class Model_Application @@ -32,7 +32,7 @@ public: /// \param Model_Application is the class name that is covered by the OCCT Handle DEFINE_STANDARD_RTTI(Model_Application); - //! Retuns the application: one per process + //! Retuns the application: one per process MODEL_EXPORT static Handle_Model_Application getApplication(); //! Returns the document by the identifier //! \returns false of document is not yet created/not loaded @@ -79,7 +79,7 @@ public: //! \param theFormats sequence of allowed formats for input/output virtual void Formats(TColStd_SequenceOfExtendedString& theFormats); //! Constructor - //! Use method GetInstance() method to obtain + //! Use method GetInstance() method to obtain //! the static instance of the object (or derive your own application) Model_Application(); diff --git a/src/Model/Model_AttributeDocRef.h b/src/Model/Model_AttributeDocRef.h index d6403fef8..cf7d1c445 100644 --- a/src/Model/Model_AttributeDocRef.h +++ b/src/Model/Model_AttributeDocRef.h @@ -20,7 +20,7 @@ class Model_AttributeDocRef : public ModelAPI_AttributeDocRef { /// persistent and unique identifier of the document in the application - Handle(TDataStd_Integer) myID; + Handle(TDataStd_Integer) myID; public: /// Defines the document referenced from this attribute diff --git a/src/Model/Model_AttributeIntArray.cpp b/src/Model/Model_AttributeIntArray.cpp index c05a9e19c..15e84ece9 100644 --- a/src/Model/Model_AttributeIntArray.cpp +++ b/src/Model/Model_AttributeIntArray.cpp @@ -77,6 +77,6 @@ Model_AttributeIntArray::Model_AttributeIntArray(TDF_Label& theLabel) void Model_AttributeIntArray::reinit() { // check the attribute could be already presented in this doc (after load document) - myIsInitialized = + myIsInitialized = myLab.FindAttribute(TDataStd_IntegerArray::GetID(), myArray) == Standard_True; } diff --git a/src/Model/Model_AttributeIntArray.h b/src/Model/Model_AttributeIntArray.h index 190d3d5a6..cef3477fa 100644 --- a/src/Model/Model_AttributeIntArray.h +++ b/src/Model/Model_AttributeIntArray.h @@ -24,7 +24,7 @@ class Model_AttributeIntArray : public ModelAPI_AttributeIntArray { - /// The OCCT array that keeps all values. + /// The OCCT array that keeps all values. Handle_TDataStd_IntegerArray myArray; /// Stores the label as a field to set array if size is not null (null array is buggy in OCAF) TDF_Label myLab; diff --git a/src/Model/Model_AttributeRefAttrList.cpp b/src/Model/Model_AttributeRefAttrList.cpp index 2b56f8b78..7da878e87 100755 --- a/src/Model/Model_AttributeRefAttrList.cpp +++ b/src/Model/Model_AttributeRefAttrList.cpp @@ -28,7 +28,7 @@ void Model_AttributeRefAttrList::append(ObjectPtr theObject) void Model_AttributeRefAttrList::append(AttributePtr theAttr) { - std::shared_ptr aData = + std::shared_ptr aData = std::dynamic_pointer_cast(theAttr->owner()->data()); myRef->Append(aData->label().Father()); // store label of the object myIDs->Append(theAttr->id().c_str()); // store the ID of the referenced attribute @@ -45,7 +45,7 @@ void Model_AttributeRefAttrList::remove(ObjectPtr theObject) if (theObject.get() != NULL) { aTheObjLab = std::dynamic_pointer_cast(theObject->data())->label().Father(); } - std::shared_ptr aDoc = + std::shared_ptr aDoc = std::dynamic_pointer_cast(owner()->document()); // remove from the both lists by clearing the list and then appending one by one // TODO: in OCCT 7.0 there are methods for removing by index, seems will be more optimal @@ -78,7 +78,7 @@ void Model_AttributeRefAttrList::remove(AttributePtr theAttr) if (theAttr->owner().get() != NULL) { aTheObjLab = std::dynamic_pointer_cast(theAttr->owner()->data())->label().Father(); } - std::shared_ptr aDoc = + std::shared_ptr aDoc = std::dynamic_pointer_cast(owner()->document()); // remove from the both lists by clearing the list and then appending one by one // TODO: in OCCT 7.0 there are methods for removing by index, seems will be more optimal @@ -90,7 +90,7 @@ void Model_AttributeRefAttrList::remove(AttributePtr theAttr) TDF_ListIteratorOfLabelList aRefIter(aRefList); TDataStd_ListIteratorOfListOfExtendedString anIDIter(anIDList); for (; aRefIter.More(); aRefIter.Next(), anIDIter.Next()) { - if (aOneisDeleted || anIDIter.Value() != theAttr->id().c_str() || + if (aOneisDeleted || anIDIter.Value() != theAttr->id().c_str() || // append now only not removed aRefIter.Value() != aTheObjLab || // append now only not removed (aTheObjLab.IsNull() && aDoc->objects()->object(aRefIter.Value()) != NULL)) { @@ -145,7 +145,7 @@ std::list > Model_AttributeRefAttrList::list( ObjectPtr anObj; if (!aLIter.Value().IsNull()) { anObj = aDoc->objects()->object(aLIter.Value()); - aResult.push_back(std::pair(anObj, + aResult.push_back(std::pair(anObj, anObj->data()->attribute(TCollection_AsciiString(anIDIter.Value()).ToCString()))); } else { aResult.push_back(std::pair(ObjectPtr(), AttributePtr())); @@ -190,7 +190,7 @@ bool Model_AttributeRefAttrList::isInList(const AttributePtr& theAttr) std::shared_ptr aDoc = std::dynamic_pointer_cast( owner()->document()); if (aDoc) { - std::shared_ptr aData = + std::shared_ptr aData = std::dynamic_pointer_cast(theAttr->owner()->data()); if (aData.get() && aData->isValid()) { TDF_Label anObjLab = aData->label().Father(); diff --git a/src/Model/Model_AttributeRefList.cpp b/src/Model/Model_AttributeRefList.cpp index bb7a1dd26..388c4dfd5 100644 --- a/src/Model/Model_AttributeRefList.cpp +++ b/src/Model/Model_AttributeRefList.cpp @@ -137,7 +137,7 @@ bool Model_AttributeRefList::isInitialized() } ObjectPtr Model_AttributeRefList::iteratedObject(TDF_ListIteratorOfLabelList& theLIter, - TDataStd_ListIteratorOfListOfExtendedString& theExtIter, + TDataStd_ListIteratorOfListOfExtendedString& theExtIter, std::shared_ptr theDoc) const { ObjectPtr anObj; @@ -224,7 +224,7 @@ bool Model_AttributeRefList::isInList(const ObjectPtr& theObj) ObjectPtr Model_AttributeRefList::object(const int theIndex, const bool theWithEmpty) const { - std::shared_ptr aDoc = + std::shared_ptr aDoc = std::dynamic_pointer_cast(owner()->document()); if (aDoc) { int anIndex = -1; @@ -254,7 +254,7 @@ void Model_AttributeRefList::substitute(const ObjectPtr& theCurrent, const Objec TDF_Label aCurrentLab = aData->label().Father(); TDF_Label aNewLab; if (theNew.get() && theNew->data()->isValid()) { // the new may be null - std::shared_ptr aNewData = + std::shared_ptr aNewData = std::dynamic_pointer_cast(theNew->data()); aNewLab = aNewData->label().Father(); } else { @@ -280,7 +280,7 @@ void Model_AttributeRefList::exchange(const ObjectPtr& theObject1, const ObjectP if (aData1.get() && aData1->isValid()) { TDF_Label aLab1 = aData1->label().Father(); if (theObject2.get() && theObject2->data()->isValid()) { // the new may be null - std::shared_ptr aData2 = + std::shared_ptr aData2 = std::dynamic_pointer_cast(theObject2->data()); if (aData2.get() && aData2->isValid()) { TDF_Label aLab2 = aData2->label().Father(); diff --git a/src/Model/Model_AttributeReference.cpp b/src/Model/Model_AttributeReference.cpp index 0d502ded0..4d08bb209 100644 --- a/src/Model/Model_AttributeReference.cpp +++ b/src/Model/Model_AttributeReference.cpp @@ -72,7 +72,7 @@ ObjectPtr Model_AttributeReference::value() if (myRef->Label().FindAttribute(TDataStd_AsciiString::GetID(), anEntry)) { std::shared_ptr aDR = std::dynamic_pointer_cast(aRefDoc); TDF_Label aRefLab; - TDF_Tool::Label(aDR->objects()->featuresLabel().Data(), + TDF_Tool::Label(aDR->objects()->featuresLabel().Data(), anEntry->Get().ToCString(), aRefLab); if (!aRefLab.IsNull()) { return aDR->objects()->object(aRefLab); diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index 54b3d0f83..3dadaf30b 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -130,7 +130,7 @@ void Model_AttributeSelection::setValue(const ResultPtr& theContext, if (theContext->groupName() == ModelAPI_ResultBody::group()) { // do not select the whole shape for body:it is already must be in the data framework // equal and null selected objects mean the same: object is equal to context, - if (theContext->shape().get() && + if (theContext->shape().get() && (theContext->shape()->isEqual(theSubShape) || !theSubShape.get())) { aSelLab.ForgetAllAttributes(true); TDataStd_UAttribute::Set(aSelLab, kSIMPLE_REF_ID); @@ -142,14 +142,14 @@ void Model_AttributeSelection::setValue(const ResultPtr& theContext, // to sub, so the whole result is selected aSelLab.ForgetAllAttributes(true); TDataStd_UAttribute::Set(aSelLab, kCONSTUCTION_SIMPLE_REF_ID); - ResultConstructionPtr aConstruction = + ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(theContext); if (aConstruction->isInfinite()) { // For correct naming selection, put the shape into the naming structure. // It seems sub-shapes are not needed: only this shape is (and can be ) selected. TNaming_Builder aBuilder(aSelLab); aBuilder.Generated(theContext->shape()->impl()); - std::shared_ptr aMyDoc = + std::shared_ptr aMyDoc = std::dynamic_pointer_cast(owner()->document()); //std::string aName = contextName(theContext); // for selection in different document, add the document name @@ -209,7 +209,7 @@ std::shared_ptr Model_AttributeSelection::value() if (myRef.isInitialized()) { if (aSelLab.IsAttribute(kSIMPLE_REF_ID)) { // it is just reference to shape, not sub-shape ResultPtr aContext = context(); - if (!aContext.get()) + if (!aContext.get()) return aResult; // empty result return aContext->shape(); } @@ -247,7 +247,7 @@ std::shared_ptr Model_AttributeSelection::value() aResult = std::shared_ptr(new GeomAPI_Shape); aResult->setImpl(new TopoDS_Shape(aSelShape)); } else { // for simple construction element: just shape of this construction element - ResultConstructionPtr aConstr = + ResultConstructionPtr aConstr = std::dynamic_pointer_cast(context()); if (aConstr) { return aConstr->shape(); @@ -272,7 +272,7 @@ bool Model_AttributeSelection::isInitialized() ResultPtr aContext = context(); return aContext.get() != NULL; } - if (aSelLab.IsAttribute(kCONSTUCTION_SIMPLE_REF_ID)) { + if (aSelLab.IsAttribute(kCONSTUCTION_SIMPLE_REF_ID)) { // it is just reference to construction, nothing is in value return true; } @@ -281,7 +281,7 @@ bool Model_AttributeSelection::isInitialized() if (selectionLabel().FindAttribute(TNaming_NamedShape::GetID(), aSelection)) { return !aSelection->Get().IsNull(); } else { // for simple construction element: just shape of this construction element - ResultConstructionPtr aConstr = + ResultConstructionPtr aConstr = std::dynamic_pointer_cast(context()); if (aConstr.get()) { return aConstr->shape().get() != NULL; @@ -343,7 +343,7 @@ TDF_LabelMap& Model_AttributeSelection::scope() std::list > allFeatures = aMyDoc->allFeatures(); std::list >::iterator aFIter = allFeatures.begin(); bool aMePassed = false; - CompositeFeaturePtr aComposite = + CompositeFeaturePtr aComposite = std::dynamic_pointer_cast(owner()); FeaturePtr aFeature = std::dynamic_pointer_cast(owner()); CompositeFeaturePtr aCompositeOwner, aCompositeOwnerOwner; @@ -362,7 +362,7 @@ TDF_LabelMap& Model_AttributeSelection::scope() } if (isGroup) aMePassed = false; bool isInScope = !aMePassed; - if (!isInScope && aComposite.get()) { + if (!isInScope && aComposite.get()) { // try to add sub-elements of composite if this is composite if (aComposite->isSub(*aFIter)) isInScope = true; @@ -402,15 +402,15 @@ bool Model_AttributeSelection::update() { TDF_Label aSelLab = selectionLabel(); ResultPtr aContext = context(); - if (!aContext.get()) + if (!aContext.get()) return setInvalidIfFalse(aSelLab, false); if (aSelLab.IsAttribute(kSIMPLE_REF_ID)) { // it is just reference to shape, not sub-shape return setInvalidIfFalse(aSelLab, aContext->shape() && !aContext->shape()->isNull()); } - if (aSelLab.IsAttribute(kCONSTUCTION_SIMPLE_REF_ID)) { + if (aSelLab.IsAttribute(kCONSTUCTION_SIMPLE_REF_ID)) { // it is just reference to construction, not sub-shape // if there is a sketch, the sketch-naming must be updated - ResultConstructionPtr aConstruction = + ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aContext); if (!aConstruction->isInfinite()) { BRep_Builder aCompoundBuilder; @@ -428,7 +428,7 @@ bool Model_AttributeSelection::update() // It seems sub-shapes are not needed: only this shape is (and can be ) selected. TNaming_Builder aBuilder(aSelLab); aBuilder.Generated(aContext->shape()->impl()); - std::shared_ptr aMyDoc = + std::shared_ptr aMyDoc = std::dynamic_pointer_cast(owner()->document()); //std::string aName = contextName(aContext); //aMyDoc->addNamingName(aSelLab, aName); @@ -468,11 +468,11 @@ bool Model_AttributeSelection::update() } else if (aContext->groupName() == ModelAPI_ResultConstruction::group()) { // construction: identification by the results indexes, recompute faces and // take the face that more close by the indexes - ResultConstructionPtr aConstructionContext = + ResultConstructionPtr aConstructionContext = std::dynamic_pointer_cast(aContext); FeaturePtr aContextFeature = aContext->document()->feature(aContext); // sketch sub-element - if (aConstructionContext && + if (aConstructionContext && std::dynamic_pointer_cast(aContextFeature).get()) { TDF_Label aLab = myRef.myRef->Label(); @@ -485,16 +485,16 @@ bool Model_AttributeSelection::update() // selected indexes will be needed in each "if" Handle(TDataStd_IntPackedMap) aSubIds; std::shared_ptr aNewSelected; - bool aNoIndexes = + bool aNoIndexes = !aLab.FindAttribute(TDataStd_IntPackedMap::GetID(), aSubIds) || aSubIds->Extent() == 0; // for now working only with composite features - CompositeFeaturePtr aComposite = + CompositeFeaturePtr aComposite = std::dynamic_pointer_cast(aContextFeature); if (!aComposite.get() || aComposite->numberOfSubs() == 0) { return setInvalidIfFalse(aSelLab, false); } - if (aShapeType == TopAbs_FACE || aShapeType == TopAbs_WIRE) { + if (aShapeType == TopAbs_FACE || aShapeType == TopAbs_WIRE) { // compound is for the whole sketch selection // If this is a wire with plane defined then it is a sketch-like object if (!aConstructionContext->facesNum()) // no faces, update can not work correctly @@ -506,7 +506,7 @@ bool Model_AttributeSelection::update() } else { // searching for most looks-like initial face by the indexes // prepare edges of the current result for the fast searching // curves and orientations of edges - NCollection_DataMap allCurves; + NCollection_DataMap allCurves; const int aSubNum = aComposite->numberOfSubs(); for(int a = 0; a < aSubNum; a++) { int aSubID = aComposite->subFeatureId(a); @@ -515,7 +515,7 @@ bool Model_AttributeSelection::update() const std::list >& aResults = aSub->results(); std::list >::const_iterator aRes; for(aRes = aResults.cbegin(); aRes != aResults.cend(); aRes++) { - ResultConstructionPtr aConstr = + ResultConstructionPtr aConstr = std::dynamic_pointer_cast(*aRes); if (aConstr->shape() && aConstr->shape()->isEdge()) { const TopoDS_Shape& aResShape = aConstr->shape()->impl(); @@ -543,8 +543,8 @@ bool Model_AttributeSelection::update() setInvalidIfFalse(aSelLab, true); owner()->data()->sendAttributeUpdated(this); return true; - } else { - // if the selection is not found, put the empty shape: + } else { + // if the selection is not found, put the empty shape: // it's better to have disappeared shape, than the old, the lost one TNaming_Builder anEmptyBuilder(selectionLabel()); return setInvalidIfFalse(aSelLab, false); @@ -560,7 +560,7 @@ bool Model_AttributeSelection::update() std::list >::const_iterator aResIter = aFeature->results().cbegin(); for(;aResIter != aFeature->results().cend(); aResIter++) { - ResultConstructionPtr aRes = + ResultConstructionPtr aRes = std::dynamic_pointer_cast(*aResIter); if (aRes && aRes->shape() && aRes->shape()->isEdge()) { // found! selectConstruction(aContext, aRes->shape()); @@ -589,7 +589,7 @@ bool Model_AttributeSelection::update() std::list >::const_iterator aResIter = aFeature->results().cbegin(); for(;aResIter != aFeature->results().cend(); aResIter++) { - ResultConstructionPtr aRes = + ResultConstructionPtr aRes = std::dynamic_pointer_cast(*aResIter); if (aRes && aRes->shape()) { if (aRes->shape()->isVertex() && aVertexNum == 0) { // found! @@ -638,7 +638,7 @@ void Model_AttributeSelection::selectBody( if (aBody) { aContext = aBody->shape()->impl(); } else { - ResultPtr aResult = + ResultPtr aResult = std::dynamic_pointer_cast(myRef.value()); if (aResult) { aContext = aResult->shape()->impl(); @@ -656,7 +656,7 @@ void Model_AttributeSelection::selectBody( while(!aNewContext.IsNull() && isUpdated) { // searching for the very last shape that was produced from this one isUpdated = false; - if (!TNaming_Tool::HasLabel(aSelLab, aNewContext)) + if (!TNaming_Tool::HasLabel(aSelLab, aNewContext)) // to avoid crash of TNaming_SameShapeIterator if pure shape does not exists break; for(TNaming_SameShapeIterator anIter(aNewContext, aSelLab); anIter.More(); anIter.Next()) { @@ -696,7 +696,7 @@ void Model_AttributeSelection::selectBody( } if (!isFound) { // sub-shape is not found in the up-to-date instance of the context shape setInvalidIfFalse(aSelLab, false); - Events_InfoMessage("Model_AttributeSelection", + Events_InfoMessage("Model_AttributeSelection", "Failed to select sub-shape already modified").send(); return; } @@ -708,20 +708,20 @@ void Model_AttributeSelection::selectBody( if (aFeatureOwner.get()) aFeatureOwner->eraseResults(); if (!aContext.IsNull()) { - aSel.Select(aNewSub, aNewContext); + aSel.Select(aNewSub, aNewContext); } } /// registers the name of the shape in the label (theID == 0) of sub label (theID is a tag) -/// if theID is zero, +/// if theID is zero, /// theOrientation is additional information about the positioning of edge relatively to face -/// it is stored in the integer attribute of the edge sub-label: +/// it is stored in the integer attribute of the edge sub-label: /// -1 is out, 1 is in, 0 is not needed static void registerSubShape(TDF_Label theMainLabel, TopoDS_Shape theShape, const int theID, const FeaturePtr& theContextFeature, std::shared_ptr theDoc, std::map& theOrientations, // name of sub-elements by ID to be exported instead of indexes - std::map& theSubNames, + std::map& theSubNames, Handle(TDataStd_IntPackedMap) theRefs = Handle(TDataStd_IntPackedMap)(), const int theOrientation = 0) { @@ -768,10 +768,10 @@ static void registerSubShape(TDF_Label theMainLabel, TopoDS_Shape theShape, void Model_AttributeSelection::selectConstruction( const ResultPtr& theContext, const std::shared_ptr& theSubShape) { - std::shared_ptr aMyDoc = + std::shared_ptr aMyDoc = std::dynamic_pointer_cast(owner()->document()); FeaturePtr aContextFeature = theContext->document()->feature(theContext); - CompositeFeaturePtr aComposite = + CompositeFeaturePtr aComposite = std::dynamic_pointer_cast(aContextFeature); const TopoDS_Shape& aSubShape = theSubShape->impl(); if (!aComposite || aComposite->numberOfSubs() == 0) { @@ -793,7 +793,7 @@ void Model_AttributeSelection::selectConstruction( TColStd_MapOfTransient allCurves; if (aShapeType == TopAbs_VERTEX) { // compare positions aVertexPos = BRep_Tool::Pnt(TopoDS::Vertex(aSubShape)); - } else { + } else { for(TopExp_Explorer anEdgeExp(aSubShape, TopAbs_EDGE); anEdgeExp.More(); anEdgeExp.Next()) { TopoDS_Edge anEdge = TopoDS::Edge(anEdgeExp.Current()); Standard_Real aFirst, aLast; @@ -813,7 +813,7 @@ void Model_AttributeSelection::selectConstruction( std::list >::const_iterator aRes = aResults.cbegin(); // there may be many shapes (circle and center): register if at least one is in selection for(; aRes != aResults.cend(); aRes++) { - ResultConstructionPtr aConstr = + ResultConstructionPtr aConstr = std::dynamic_pointer_cast(*aRes); if (!aConstr->shape()) { continue; @@ -873,7 +873,7 @@ void Model_AttributeSelection::selectConstruction( for(; anEdgeExp.More(); anEdgeExp.Next(), aTagIndex += kSTART_VERTEX_DELTA) { TopoDS_Vertex aV = TopoDS::Vertex(anEdgeExp.Current()); - std::stringstream anAdditionalName; + std::stringstream anAdditionalName; registerSubShape( selectionLabel(), aV, aTagIndex, aContextFeature, aMyDoc, anOrientations, aSubNames); @@ -889,7 +889,7 @@ void Model_AttributeSelection::selectConstruction( TNaming_Builder aBuilder(selectionLabel()); aBuilder.Generated(aSubShape); registerSubShape( - selectionLabel(), aSubShape, 0, aContextFeature, aMyDoc, anOrientations, aSubNames, aRefs); + selectionLabel(), aSubShape, 0, aContextFeature, aMyDoc, anOrientations, aSubNames, aRefs); } bool Model_AttributeSelection::selectPart( @@ -901,7 +901,7 @@ bool Model_AttributeSelection::selectPart( return true; // postponed naming if (theUpdate) { Handle(TDataStd_Integer) anIndex; - if (selectionLabel().FindAttribute(TDataStd_Integer::GetID(), anIndex)) { + if (selectionLabel().FindAttribute(TDataStd_Integer::GetID(), anIndex)) { // by internal selection if (anIndex->Get() > 0) { // update the selection by index @@ -974,7 +974,7 @@ void Model_AttributeSelection::selectSubShape( } Model_SelectionNaming aSelNaming(selectionLabel()); - std::shared_ptr aDoc = + std::shared_ptr aDoc = std::dynamic_pointer_cast(owner()->document()); std::shared_ptr aShapeToBeSelected; ResultPtr aCont; @@ -1105,7 +1105,7 @@ void Model_AttributeSelection::updateInHistory() Handle(TNaming_NamedShape) aContNS; if (!aContLab.FindAttribute(TNaming_NamedShape::GetID(), aContNS)) return; - std::shared_ptr aDoc = + std::shared_ptr aDoc = std::dynamic_pointer_cast(aContext->document()); FeaturePtr aThisFeature = std::dynamic_pointer_cast(owner()); FeaturePtr aCurrentModifierFeat = aDoc->feature(aContext); @@ -1133,7 +1133,7 @@ void Model_AttributeSelection::updateInHistory() break; if (aModifierFeat == aThisFeature || aDoc->objects()->isLater(aModifierFeat, aThisFeature)) continue; // the modifier feature is later than this, so, should not be used - if (aCurrentModifierFeat == aModifierFeat || + if (aCurrentModifierFeat == aModifierFeat || aDoc->objects()->isLater(aCurrentModifierFeat, aModifierFeat)) continue; // the current modifier is later than the found, so, useless Handle(TNaming_NamedShape) aNewNS; diff --git a/src/Model/Model_AttributeSelection.h b/src/Model/Model_AttributeSelection.h index 408680092..144ff01c9 100644 --- a/src/Model/Model_AttributeSelection.h +++ b/src/Model/Model_AttributeSelection.h @@ -54,7 +54,7 @@ public: /// Returns a textual string of the selection /// \param theDefaultValue a name, which is returned if the naming name can not be obtained MODEL_EXPORT virtual std::string namingName(const std::string& theDefaultValue = ""); - + /// Returns an Id of the selection /// NOTE: This method has been added for temporary export of groups towards old GEOM /// It should then be removed when a direct use of objects from SHAPER @@ -66,7 +66,7 @@ public: MODEL_EXPORT virtual void setId(int theID); /// Selects (i.e. creates Naming data structure) of sub-shape specifed by textual name - MODEL_EXPORT virtual void selectSubShape(const std::string& theType, + MODEL_EXPORT virtual void selectSubShape(const std::string& theType, const std::string& theSubShapeName); /// Returns true if attribute was initialized by some value diff --git a/src/Model/Model_AttributeSelectionList.cpp b/src/Model/Model_AttributeSelectionList.cpp index 4f9bfb710..aa9ff1cc0 100644 --- a/src/Model/Model_AttributeSelectionList.cpp +++ b/src/Model/Model_AttributeSelectionList.cpp @@ -43,7 +43,7 @@ void Model_AttributeSelectionList::append( int aNewTag = mySize->Get() + 1; TDF_Label aNewLab = mySize->Label().FindChild(aNewTag); - std::shared_ptr aNewAttr = + std::shared_ptr aNewAttr = std::shared_ptr(new Model_AttributeSelection(aNewLab)); if (owner()) { aNewAttr->setObject(owner()); @@ -53,7 +53,7 @@ void Model_AttributeSelectionList::append( aNewAttr->setValue(theContext, theSubShape, theTemporarily); if (theTemporarily) myTmpAttr = aNewAttr; - else + else myTmpAttr.reset(); owner()->data()->sendAttributeUpdated(this); } @@ -64,7 +64,7 @@ void Model_AttributeSelectionList::append( int aNewTag = mySize->Get() + 1; TDF_Label aNewLab = mySize->Label().FindChild(aNewTag); - std::shared_ptr aNewAttr = + std::shared_ptr aNewAttr = std::shared_ptr(new Model_AttributeSelection(aNewLab)); if (owner()) { aNewAttr->setObject(owner()); @@ -82,13 +82,13 @@ void Model_AttributeSelectionList::removeTemporaryValues() } } -void Model_AttributeSelectionList::removeLast() +void Model_AttributeSelectionList::removeLast() { int anOldSize = mySize->Get(); if (anOldSize != 0) { mySize->Set(anOldSize - 1); TDF_Label aLab = mySize->Label().FindChild(anOldSize); - std::shared_ptr aOldAttr = + std::shared_ptr aOldAttr = std::shared_ptr(new Model_AttributeSelection(aLab)); aOldAttr->setObject(owner()); REMOVE_BACK_REF(aOldAttr->context()); @@ -98,10 +98,10 @@ void Model_AttributeSelectionList::removeLast() } } -// copies named shapes: we need the implementation of this +// copies named shapes: we need the implementation of this static void CopyNS(const Handle(TNaming_NamedShape)& theFrom, const Handle(TDF_Attribute)& theTo) -{ +{ TDF_Label aLab = theTo->Label(); TNaming_Builder B(aLab); @@ -129,10 +129,10 @@ static void CopyNS(const Handle(TNaming_NamedShape)& theFrom, case TNaming_GENERATED : B.Generated(aOldIter.Value(), aNewIter.Value()); break; - case TNaming_MODIFY : + case TNaming_MODIFY : B.Modify(aOldIter.Value(), aNewIter.Value()); break; - case TNaming_DELETE : + case TNaming_DELETE : B.Delete (aOldIter.Value()); break; case TNaming_SELECTED : @@ -158,7 +158,7 @@ static void copyAttrs(TDF_Label theSource, TDF_Label theDestination) { Handle(TNaming_NamedShape) aNS = Handle(TNaming_NamedShape)::DownCast(anAttrIter.Value()); if (aNS.IsNull()) { // no relocation, empty map - Handle(TDF_RelocationTable) aRelocTable = new TDF_RelocationTable(); + Handle(TDF_RelocationTable) aRelocTable = new TDF_RelocationTable(); anAttrIter.Value()->Paste(aTargetAttr, aRelocTable); } else { CopyNS(aNS, aTargetAttr); @@ -187,7 +187,7 @@ void Model_AttributeSelectionList::remove(const std::set& theIndices) } } else { // this is removed, so remove everything from this label TDF_Label aLab = mySize->Label().FindChild(aCurrent + 1); - std::shared_ptr aOldAttr = + std::shared_ptr aOldAttr = std::shared_ptr(new Model_AttributeSelection(aLab)); aOldAttr->setObject(owner()); REMOVE_BACK_REF(aOldAttr->context()); @@ -259,7 +259,7 @@ void Model_AttributeSelectionList::setSelectionType(const std::string& theType) mySelectionType->Set(theType.c_str()); } -std::shared_ptr +std::shared_ptr Model_AttributeSelectionList::value(const int theIndex) { if (myTmpAttr.get() && theIndex == size() - 1) { @@ -269,7 +269,7 @@ std::shared_ptr // create a new attribute each time, by demand // supporting of old attributes is too slow (synch each time) and buggy on redo // (if attribute is deleted and created, the abort updates attriute and makes the Attr invalid) - std::shared_ptr aNewAttr = + std::shared_ptr aNewAttr = std::shared_ptr(new Model_AttributeSelection(aLabel)); aNewAttr->setID(id()); if (owner()) { @@ -286,7 +286,7 @@ void Model_AttributeSelectionList::clear() TDF_ChildIterator aSubIter(mySize->Label()); for(; aSubIter.More(); aSubIter.Next()) { TDF_Label aLab = aSubIter.Value(); - std::shared_ptr aNewAttr = + std::shared_ptr aNewAttr = std::shared_ptr(new Model_AttributeSelection(aLab)); if (owner()) { aNewAttr->setObject(owner()); diff --git a/src/Model/Model_AttributeValidator.cpp b/src/Model/Model_AttributeValidator.cpp index 0f7c48082..83188ebe4 100644 --- a/src/Model/Model_AttributeValidator.cpp +++ b/src/Model/Model_AttributeValidator.cpp @@ -14,8 +14,8 @@ #include #include -bool Model_AttributeValidator::isValid(const AttributePtr& theAttribute, - const std::list& theArguments, +bool Model_AttributeValidator::isValid(const AttributePtr& theAttribute, + const std::list& theArguments, Events_InfoMessage& theError) const { if (theAttribute->attributeType() == ModelAPI_AttributeInteger::typeId()) { @@ -28,7 +28,7 @@ bool Model_AttributeValidator::isValid(const AttributePtr& theAttribute, } } else if (theAttribute->attributeType() == ModelAPI_AttributeDouble::typeId()) { - AttributeDoublePtr anAttribue = + AttributeDoublePtr anAttribue = std::dynamic_pointer_cast(theAttribute); if (!anAttribue->expressionError().empty()) { theError = "Expression error: %1"; @@ -37,7 +37,7 @@ bool Model_AttributeValidator::isValid(const AttributePtr& theAttribute, } } else if (theAttribute->attributeType() == GeomDataAPI_Point::typeId()) { - AttributePointPtr anAttribue = + AttributePointPtr anAttribue = std::dynamic_pointer_cast(theAttribute); const char* aComponent[] = {"X", "Y", "Z"}; @@ -54,7 +54,7 @@ bool Model_AttributeValidator::isValid(const AttributePtr& theAttribute, } } else if (theAttribute->attributeType() == GeomDataAPI_Point2D::typeId()) { - AttributePoint2DPtr anAttribue = + AttributePoint2DPtr anAttribue = std::dynamic_pointer_cast(theAttribute); const char* aComponent[] = {"X", "Y"}; diff --git a/src/Model/Model_BodyBuilder.cpp b/src/Model/Model_BodyBuilder.cpp index 193014737..38b154348 100755 --- a/src/Model/Model_BodyBuilder.cpp +++ b/src/Model/Model_BodyBuilder.cpp @@ -66,7 +66,7 @@ static void evolutionToSelectionRec(TDF_Label theLab, const bool theFlag) { } else { TDataStd_Integer::Set(theLab, anEvolution); } - + for(TNaming_Iterator anIter(aName); anIter.More(); anIter.Next()) { // iterator goes in reversed order relatively to the Builder, to, make the list reversed aShapePairs.push_front(std::pair @@ -115,7 +115,7 @@ void Model_BodyBuilder::store(const std::shared_ptr& theShape, if (aData) { TDF_Label& aShapeLab = aData->shapeLab(); // clean builders - clean(); + clean(); // store the new shape as primitive TNaming_Builder aBuilder(aShapeLab); if (!theShape) @@ -135,7 +135,7 @@ void Model_BodyBuilder::store(const std::shared_ptr& theShape, } } - aBuilder.Generated(aShape); + aBuilder.Generated(aShape); // register name aShapeLab.ForgetAttribute(TDF_Reference::GetID()); if(!aBuilder.NamedShape()->IsEmpty()) { @@ -159,7 +159,7 @@ void Model_BodyBuilder::storeGenerated(const std::shared_ptr& the if (aData) { TDF_Label& aShapeLab = aData->shapeLab(); // clean builders - clean(); + clean(); // store the new shape as primitive TNaming_Builder aBuilder(aShapeLab); if (!theFromShape || !theToShape) @@ -193,7 +193,7 @@ void Model_BodyBuilder::storeModified(const std::shared_ptr& theO if (aData) { TDF_Label& aShapeLab = aData->shapeLab(); // clean builders - clean(); + clean(); // store the new shape as primitive TNaming_Builder aBuilder(aShapeLab); if (!theOldShape || !theNewShape) @@ -205,7 +205,7 @@ void Model_BodyBuilder::storeModified(const std::shared_ptr& theO if (aShapeNew.IsNull()) return; // null shape inside aBuilder.Modify(aShapeOld, aShapeNew); - if (theDecomposeSolidsTag && aShapeNew.ShapeType() == TopAbs_COMPOUND) { + if (theDecomposeSolidsTag && aShapeNew.ShapeType() == TopAbs_COMPOUND) { // make sub elements as subs // register name if it is possible @@ -230,12 +230,12 @@ void Model_BodyBuilder::storeModified(const std::shared_ptr& theO if(!aName.IsEmpty()) { TCollection_AsciiString aShapeType = aShape.ShapeType() == TopAbs_EDGE ? "_Edge_" : aShape.ShapeType() == TopAbs_FACE ? "_Face_" : - aShape.ShapeType() == TopAbs_SOLID ? "_Solid_" : + aShape.ShapeType() == TopAbs_SOLID ? "_Solid_" : "_Shape_"; - std::string aSolidName = + std::string aSolidName = (aName + aShapeType + TCollection_AsciiString(aTag - theDecomposeSolidsTag)) .ToCString(); - std::shared_ptr aDoc = + std::shared_ptr aDoc = std::dynamic_pointer_cast(document()); aDoc->addNamingName(aSubBuilder.NamedShape()->Label(), aSolidName); TDataStd_Name::Set(aSubBuilder.NamedShape()->Label(), aSolidName.c_str()); @@ -246,7 +246,7 @@ void Model_BodyBuilder::storeModified(const std::shared_ptr& theO if(aBuilder.NamedShape()->Label().FindAttribute(TDataStd_Name::GetID(),anAttr)) { std::string aName (TCollection_AsciiString(anAttr->Get()).ToCString()); if(!aName.empty()) { - std::shared_ptr aDoc = + std::shared_ptr aDoc = std::dynamic_pointer_cast(document()); aDoc->addNamingName(aBuilder.NamedShape()->Label(), aName); } @@ -259,7 +259,7 @@ void Model_BodyBuilder::storeWithoutNaming(const std::shared_ptr { std::shared_ptr aData = std::dynamic_pointer_cast(data()); if (aData) { - clean(); + clean(); if (!theShape.get()) return; // bad shape TopoDS_Shape aShape = theShape->impl(); @@ -309,7 +309,7 @@ void Model_BodyBuilder::generated( { TopoDS_Shape aShape = theNewShape->impl(); builder(theTag)->Generated(aShape); - if(!theName.empty()) + if(!theName.empty()) buildName(theTag, theName); } @@ -319,7 +319,7 @@ void Model_BodyBuilder::generated(const std::shared_ptr& theOldSh TopoDS_Shape anOldShape = theOldShape->impl(); TopoDS_Shape aNewShape = theNewShape->impl(); builder(theTag)->Generated(anOldShape, aNewShape); - if(!theName.empty()) + if(!theName.empty()) buildName(theTag, theName); TopAbs_ShapeEnum aGenShapeType = aNewShape.ShapeType(); if(aGenShapeType == TopAbs_WIRE || aGenShapeType == TopAbs_SHELL) { @@ -346,7 +346,7 @@ void Model_BodyBuilder::modified(const std::shared_ptr& theOldSha TopoDS_Shape anOldShape = theOldShape->impl(); TopoDS_Shape aNewShape = theNewShape->impl(); builder(theTag)->Modify(anOldShape, aNewShape); - if(!theName.empty()) + if(!theName.empty()) buildName(theTag, theName); } @@ -449,7 +449,7 @@ void Model_BodyBuilder::loadAndOrientGeneratedShapes ( std::shared_ptr aRShape(new GeomAPI_Shape()); aRShape->setImpl((new TopoDS_Shape(aRoot))); theMS->generated(aRShape, aList); - std::list >::const_iterator + std::list >::const_iterator anIt = aList.begin(), aLast = aList.end(); for (; anIt != aLast; anIt++) { TopoDS_Shape aNewShape = (*anIt)->impl(); @@ -464,17 +464,17 @@ void Model_BodyBuilder::loadAndOrientGeneratedShapes ( } TopAbs_ShapeEnum aGenShapeType = aNewShape.ShapeType(); if(aGenShapeType == TopAbs_WIRE || aGenShapeType == TopAbs_SHELL) { - TopAbs_ShapeEnum anExplodeShapeType = + TopAbs_ShapeEnum anExplodeShapeType = aGenShapeType == TopAbs_WIRE ? TopAbs_EDGE : TopAbs_FACE; const TDF_Label aLabel = builder(theTag)->NamedShape()->Label(); int aTag = 1; - std::shared_ptr aDoc = + std::shared_ptr aDoc = std::dynamic_pointer_cast(document()); for(TopExp_Explorer anExp(aNewShape, anExplodeShapeType); anExp.More(); anExp.Next()) { TDF_Label aChildLabel = aLabel.FindChild(aTag); TNaming_Builder aBuilder(aChildLabel); aBuilder.Generated(aRoot, anExp.Current()); - TCollection_AsciiString aChildName = + TCollection_AsciiString aChildName = TCollection_AsciiString((theName + "_").c_str()) + aTag; TDataStd_Name::Set(aChildLabel, aChildName.ToCString()); aTag++; @@ -485,9 +485,9 @@ void Model_BodyBuilder::loadAndOrientGeneratedShapes ( } //======================================================================= -int getDangleShapes(const TopoDS_Shape& theShapeIn, +int getDangleShapes(const TopoDS_Shape& theShapeIn, const TopAbs_ShapeEnum theGeneratedFrom, - TopTools_DataMapOfShapeShape& theDangles) + TopTools_DataMapOfShapeShape& theDangles) { theDangles.Clear(); TopTools_IndexedDataMapOfShapeListOfShape subShapeAndAncestors; @@ -513,21 +513,21 @@ void loadGeneratedDangleShapes( TopTools_DataMapOfShapeShape dangles; if (!getDangleShapes(theShapeIn, theGeneratedFrom, dangles)) return; TopTools_DataMapIteratorOfDataMapOfShapeShape itr(dangles); - for (; itr.More(); itr.Next()) + for (; itr.More(); itr.Next()) theBuilder->Generated(itr.Key(), itr.Value()); } //======================================================================= -void Model_BodyBuilder::loadNextLevels(std::shared_ptr theShape, +void Model_BodyBuilder::loadNextLevels(std::shared_ptr theShape, const std::string& theName, int& theTag) { if(theShape->isNull()) return; - TopoDS_Shape aShape = theShape->impl(); + TopoDS_Shape aShape = theShape->impl(); std::string aName; - if (aShape.ShapeType() == TopAbs_SOLID) { + if (aShape.ShapeType() == TopAbs_SOLID) { TopExp_Explorer expl(aShape, TopAbs_FACE); - for (; expl.More(); expl.Next()) { - builder(theTag)->Generated(expl.Current()); + for (; expl.More(); expl.Next()) { + builder(theTag)->Generated(expl.Current()); TCollection_AsciiString aStr(theTag); aName = theName + aStr.ToCString(); buildName(theTag, aName); @@ -541,7 +541,7 @@ void Model_BodyBuilder::loadNextLevels(std::shared_ptr theShape, if (Faces.Extent() > 1 || (aShape.ShapeType() == TopAbs_SHELL && Faces.Extent() == 1)) { TopExp_Explorer expl(aShape, TopAbs_FACE); for (; expl.More(); expl.Next()) { - builder(theTag)->Generated(expl.Current()); + builder(theTag)->Generated(expl.Current()); TCollection_AsciiString aStr(theTag); aName = theName + aStr.ToCString(); buildName(theTag, aName); @@ -550,7 +550,7 @@ void Model_BodyBuilder::loadNextLevels(std::shared_ptr theShape, } TopTools_IndexedDataMapOfShapeListOfShape anEdgeAndNeighbourFaces; TopExp::MapShapesAndAncestors(aShape, TopAbs_EDGE, TopAbs_FACE, anEdgeAndNeighbourFaces); - for (Standard_Integer i = 1; i <= anEdgeAndNeighbourFaces.Extent(); i++) + for (Standard_Integer i = 1; i <= anEdgeAndNeighbourFaces.Extent(); i++) { const TopTools_ListOfShape& aLL = anEdgeAndNeighbourFaces.FindFromIndex(i); if (aLL.Extent() < 2) { @@ -588,25 +588,25 @@ void Model_BodyBuilder::loadNextLevels(std::shared_ptr theShape, theTag++; } } else { - TopExp_Explorer expl(aShape, TopAbs_EDGE); - for (; expl.More(); expl.Next()) { + TopExp_Explorer expl(aShape, TopAbs_EDGE); + for (; expl.More(); expl.Next()) { builder(theTag)->Generated(expl.Current()); TCollection_AsciiString aStr(theTag); aName = theName + aStr.ToCString(); buildName(theTag, aName); theTag++; - } + } // and load generated vertices. TopTools_DataMapOfShapeShape generated; - if (getDangleShapes(aShape, TopAbs_EDGE, generated)) + if (getDangleShapes(aShape, TopAbs_EDGE, generated)) { TNaming_Builder* pBuilder = builder(theTag++); - loadGeneratedDangleShapes(aShape, TopAbs_EDGE, pBuilder); + loadGeneratedDangleShapes(aShape, TopAbs_EDGE, pBuilder); } } } else if (aShape.ShapeType() == TopAbs_EDGE) { TopExp_Explorer expl(aShape, TopAbs_VERTEX); - for (; expl.More(); expl.Next()) { + for (; expl.More(); expl.Next()) { builder(theTag)->Generated(expl.Current()); TCollection_AsciiString aStr(theTag); aName = theName + aStr.ToCString(); @@ -617,8 +617,8 @@ void Model_BodyBuilder::loadNextLevels(std::shared_ptr theShape, } //======================================================================= -int findAmbiguities(const TopoDS_Shape& theShapeIn, - TopTools_ListOfShape& theList) +int findAmbiguities(const TopoDS_Shape& theShapeIn, + TopTools_ListOfShape& theList) { int aNumEdges(0); theList.Clear(); @@ -641,21 +641,21 @@ int findAmbiguities(const TopoDS_Shape& theShapeIn, if(ancestors1.Extent() == ancestors2.Extent() && ancestors1.Extent() > 1) { int aNum (ancestors2.Extent()); TopTools_ListIteratorOfListOfShape it(ancestors2); - for(;it.More();it.Next()) + for(;it.More();it.Next()) if(aMap1.Contains(it.Value())) aNum--; if(aNum == 0) { - if(aMap2.Add(aKeyEdge1)) + if(aMap2.Add(aKeyEdge1)) aKeyList.Append(aKeyEdge1); if(aMap2.Add(aKeyEdge2)) aKeyList.Append(aKeyEdge2); } } - } // at the end ==> List of edges to be named in addition + } // at the end ==> List of edges to be named in addition } aNumEdges = aKeyList.Extent(); if(aNumEdges) - theList.Assign(aKeyList); - return aNumEdges; + theList.Assign(aKeyList); + return aNumEdges; } //======================================================================= @@ -663,7 +663,7 @@ void Model_BodyBuilder::loadFirstLevel( std::shared_ptr theShape, const std::string& theName, int& theTag) { if(theShape->isNull()) return; - TopoDS_Shape aShape = theShape->impl(); + TopoDS_Shape aShape = theShape->impl(); std::string aName; if (aShape.ShapeType() == TopAbs_COMPOUND || aShape.ShapeType() == TopAbs_COMPSOLID) { TopoDS_Iterator itr(aShape); @@ -673,22 +673,22 @@ void Model_BodyBuilder::loadFirstLevel( aName = theName + aStr.ToCString(); buildName(theTag, aName); if(!theName.empty()) buildName(theTag, aName); - if (itr.Value().ShapeType() == TopAbs_COMPOUND || - itr.Value().ShapeType() == TopAbs_COMPSOLID) + if (itr.Value().ShapeType() == TopAbs_COMPOUND || + itr.Value().ShapeType() == TopAbs_COMPSOLID) { std::shared_ptr itrShape(new GeomAPI_Shape()); itrShape->setImpl(new TopoDS_Shape(itr.Value())); loadFirstLevel(itrShape, theName, theTag); } else { std::shared_ptr itrShape(new GeomAPI_Shape()); - itrShape->setImpl(new TopoDS_Shape(itr.Value())); + itrShape->setImpl(new TopoDS_Shape(itr.Value())); loadNextLevels(itrShape, theName, theTag); } } } else { std::shared_ptr itrShape(new GeomAPI_Shape()); itrShape->setImpl(new TopoDS_Shape(aShape)); - loadNextLevels(itrShape, theName, theTag); + loadNextLevels(itrShape, theName, theTag); } TopTools_ListOfShape aList; if(findAmbiguities(aShape, aList)) { @@ -707,7 +707,7 @@ void Model_BodyBuilder::loadDisconnectedEdges( std::shared_ptr theShape, const std::string& theName, int& theTag) { if(theShape->isNull()) return; - TopoDS_Shape aShape = theShape->impl(); + TopoDS_Shape aShape = theShape->impl(); TopTools_DataMapOfShapeListOfShape edgeNaborFaces; TopTools_ListOfShape empty; TopExp_Explorer explF(aShape, TopAbs_FACE); @@ -725,13 +725,13 @@ void Model_BodyBuilder::loadDisconnectedEdges( break; } } - if (faceIsNew) - edgeNaborFaces.ChangeFind(anEdge).Append(aFace); + if (faceIsNew) + edgeNaborFaces.ChangeFind(anEdge).Append(aFace); } } TopTools_MapOfShape anEdgesToDelete; - TopExp_Explorer anEx(aShape,TopAbs_EDGE); + TopExp_Explorer anEx(aShape,TopAbs_EDGE); std::string aName; for(;anEx.More();anEx.Next()) { Standard_Boolean aC0 = Standard_False; @@ -761,27 +761,27 @@ void Model_BodyBuilder::loadDisconnectedEdges( theTag++; } } - } + } TopTools_MapIteratorOfMapOfShape itDelete(anEdgesToDelete); - for(;itDelete.More();itDelete.Next()) - edgeNaborFaces.UnBind(itDelete.Key()); + for(;itDelete.More();itDelete.Next()) + edgeNaborFaces.UnBind(itDelete.Key()); edgeNaborFaces.UnBind(anEdge1); } if (aC0) { builder(theTag)->Generated(anEdge1); TCollection_AsciiString aStr(theTag); aName = theName + aStr.ToCString(); - buildName(theTag, aName); + buildName(theTag, aName); theTag++; } - } + } } void Model_BodyBuilder::loadDisconnectedVertexes(std::shared_ptr theShape, const std::string& theName, int& theTag) { if(theShape->isNull()) return; - TopoDS_Shape aShape = theShape->impl(); + TopoDS_Shape aShape = theShape->impl(); TopTools_DataMapOfShapeListOfShape vertexNaborEdges; TopTools_ListOfShape empty; TopExp_Explorer explF(aShape, TopAbs_EDGE); @@ -808,11 +808,11 @@ void Model_BodyBuilder::loadDisconnectedVertexes(std::shared_ptr TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itr(vertexNaborEdges); for (; itr.More(); itr.Next()) { const TopTools_ListOfShape& naborEdges = itr.Value(); - if (naborEdges.Extent() < 2) { + if (naborEdges.Extent() < 2) { builder(theTag)->Generated(itr.Key()); TCollection_AsciiString aStr(theTag); aName = theName + aStr.ToCString(); - buildName(theTag, aName); + buildName(theTag, aName); theTag++; } } @@ -843,7 +843,7 @@ std::shared_ptr Model_BodyBuilder::shape() bool Model_BodyBuilder::isLatestEqual(const std::shared_ptr& theShape) { if (theShape.get()) { - TopoDS_Shape aShape = theShape->impl(); + TopoDS_Shape aShape = theShape->impl(); std::shared_ptr aData = std::dynamic_pointer_cast(data()); if (aData) { TDF_Label& aShapeLab = aData->shapeLab(); diff --git a/src/Model/Model_BodyBuilder.h b/src/Model/Model_BodyBuilder.h index 2b8a62990..6f2f868eb 100755 --- a/src/Model/Model_BodyBuilder.h +++ b/src/Model/Model_BodyBuilder.h @@ -22,7 +22,7 @@ class TNaming_Builder; */ class Model_BodyBuilder : public ModelAPI_BodyBuilder { - /// builders that tores the naming history: one per label to allow store several shapes to one + /// builders that tores the naming history: one per label to allow store several shapes to one /// label; index in vector corresponds to the label tag std::vector myBuilders; public: @@ -37,7 +37,7 @@ public: /// Stores the modified shape (called by the execution method). /// \param theOldShape shape that produces result /// \param theNewShape resulting shape - /// \param theDecomposeSolidsTag tag for starting of solids sub-elements placement in case + /// \param theDecomposeSolidsTag tag for starting of solids sub-elements placement in case /// theNewShape is compound of solids, if zero it is not used MODEL_EXPORT virtual void storeModified(const std::shared_ptr& theOldShape, const std::shared_ptr& theNewShape, @@ -52,21 +52,21 @@ public: /// Records the subshape newShape which was generated during a topological construction. /// As an example, consider the case of a face generated in construction of a box. - MODEL_EXPORT virtual void generated(const std::shared_ptr& theNewShape, + MODEL_EXPORT virtual void generated(const std::shared_ptr& theNewShape, const std::string& theName, const int theTag = 1); /// Records the shape newShape which was generated from the shape oldShape during a topological - /// construction. As an example, consider the case of a face generated from an edge in + /// construction. As an example, consider the case of a face generated from an edge in /// construction of a prism. MODEL_EXPORT virtual void generated(const std::shared_ptr& theOldShape, - const std::shared_ptr& theNewShape, + const std::shared_ptr& theNewShape, const std::string& theName, const int theTag = 1); /// Records the shape newShape which is a modification of the shape oldShape. /// As an example, consider the case of a face split or merged in a Boolean operation. MODEL_EXPORT virtual void modified(const std::shared_ptr& theOldShape, - const std::shared_ptr& theNewShape, + const std::shared_ptr& theNewShape, const std::string& theName, const int theTag = 1); /// Records the shape oldShape which was deleted from the current label. @@ -96,23 +96,23 @@ public: const int theTag, const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes); - + /// Loads shapes of the first level (to be used during shape import) MODEL_EXPORT virtual void loadFirstLevel(std::shared_ptr theShape, const std::string& theName, int& theTag); - + /// Loads disconnected edges MODEL_EXPORT virtual void loadDisconnectedEdges(std::shared_ptr theShape, const std::string& theName, int& theTag); /// Loads disconnected vetexes - MODEL_EXPORT virtual void loadDisconnectedVertexes(std::shared_ptr theShape, + MODEL_EXPORT virtual void loadDisconnectedVertexes(std::shared_ptr theShape, const std::string& theName, int& theTag); /// Removes the stored builders MODEL_EXPORT virtual ~Model_BodyBuilder(); - /// Converts evolution of sub-shapes stored in naming structure to selection + /// Converts evolution of sub-shapes stored in naming structure to selection /// (theFlag = true) and back (theFlag = false) MODEL_EXPORT virtual void evolutionToSelection(const bool theFlag); @@ -132,10 +132,10 @@ protected: private: /// Loads shapes of the next level (to be used during shape import) - void loadNextLevels(std::shared_ptr theShape, + void loadNextLevels(std::shared_ptr theShape, const std::string& theName, int& theTag); - /// builds name for the shape kept at the specified tag + /// builds name for the shape kept at the specified tag void buildName(const int theTag, const std::string& theName); friend class Model_ResultBody; diff --git a/src/Model/Model_Data.cpp b/src/Model/Model_Data.cpp index 9f69e4bdd..ce5ab2f90 100644 --- a/src/Model/Model_Data.cpp +++ b/src/Model/Model_Data.cpp @@ -83,9 +83,9 @@ void Model_Data::setLabel(TDF_Label theLab) Standard_Boolean aFlag2 = myFlags->Upper() >= 2 ? myFlags->Value(2) : Standard_True; Handle(TColStd_HArray1OfByte) aNewArray = new TColStd_HArray1OfByte(0, 2); myFlags->SetInternalArray(aNewArray); - myFlags->SetValue(0, aFlag0); - myFlags->SetValue(1, aFlag1); - myFlags->SetValue(2, aFlag2); + myFlags->SetValue(0, aFlag0); + myFlags->SetValue(1, aFlag1); + myFlags->SetValue(2, aFlag2); } } @@ -180,7 +180,7 @@ AttributePtr Model_Data::addAttribute(const std::string& theID, const std::strin anAttr->setObject(myObject); anAttr->setID(theID); } else { - Events_InfoMessage("Model_Data", + Events_InfoMessage("Model_Data", "Can not create unknown type of attribute %1").arg(theAttrType).send(); } return aResult; @@ -222,7 +222,7 @@ std::shared_ptr Model_Data::attribute(const std::string& the const std::string& Model_Data::id(const std::shared_ptr& theAttr) { - std::map >::iterator anAttr = + std::map >::iterator anAttr = myAttrs.begin(); for (; anAttr != myAttrs.end(); anAttr++) { if (anAttr->second == theAttr) @@ -249,7 +249,7 @@ bool Model_Data::isValid() std::list > Model_Data::attributes(const std::string& theType) { std::list > aResult; - std::map >::iterator anAttrsIter = + std::map >::iterator anAttrsIter = myAttrs.begin(); for (; anAttrsIter != myAttrs.end(); anAttrsIter++) { if (theType.empty() || anAttrsIter->second->attributeType() == theType) { @@ -259,10 +259,10 @@ std::list > Model_Data::attributes(const std return aResult; } -std::list Model_Data::attributesIDs(const std::string& theType) +std::list Model_Data::attributesIDs(const std::string& theType) { std::list aResult; - std::map >::iterator anAttrsIter = + std::map >::iterator anAttrsIter = myAttrs.begin(); for (; anAttrsIter != myAttrs.end(); anAttrsIter++) { if (theType.empty() || anAttrsIter->second->attributeType() == theType) { @@ -297,7 +297,7 @@ void Model_Data::blockSendAttributeUpdated(const bool theBlock, const bool theSe if (mySendAttributeUpdated && !myWasChangedButBlocked.empty()) { // so, now it is ok to send the update signal if (theSendMessage) { - // make a copy to avoid iteration on modified list + // make a copy to avoid iteration on modified list // (may be cleared by attribute changed call) std::list aWasChangedButBlocked = myWasChangedButBlocked; myWasChangedButBlocked.clear(); @@ -321,13 +321,13 @@ void Model_Data::erase() // remove in order to clear back references in other objects std::list > > aRefs; referencesToObjects(aRefs); - std::list > >::iterator + std::list > >::iterator anAttrIter = aRefs.begin(); for(; anAttrIter != aRefs.end(); anAttrIter++) { std::list::iterator aReferenced = anAttrIter->second.begin(); for(; aReferenced != anAttrIter->second.end(); aReferenced++) { if (aReferenced->get() && (*aReferenced)->data()->isValid()) { - std::shared_ptr aData = + std::shared_ptr aData = std::dynamic_pointer_cast((*aReferenced)->data()); aData->removeBackReference(myAttrs[anAttrIter->first]); } @@ -412,7 +412,7 @@ int Model_Data::featureId() const void Model_Data::eraseBackReferences() { myRefsToMe.clear(); - std::shared_ptr aRes = + std::shared_ptr aRes = std::dynamic_pointer_cast(myObject); if (aRes) aRes->setIsConcealed(false); @@ -439,7 +439,7 @@ void Model_Data::removeBackReference(AttributePtr theAttr) } } -void Model_Data::addBackReference(FeaturePtr theFeature, std::string theAttrID, +void Model_Data::addBackReference(FeaturePtr theFeature, std::string theAttrID, const bool theApplyConcealment) { // it is possible to add the same attribute twice: may be last time the owner was not Stable... @@ -447,14 +447,14 @@ void Model_Data::addBackReference(FeaturePtr theFeature, std::string theAttrID, if (myRefsToMe.find(anAttribute) == myRefsToMe.end()) myRefsToMe.insert(theFeature->data()->attribute(theAttrID)); - if (theApplyConcealment && theFeature->isStable() && + if (theApplyConcealment && theFeature->isStable() && ModelAPI_Session::get()->validators()->isConcealed(theFeature->getKind(), theAttrID)) { - std::shared_ptr aRes = + std::shared_ptr aRes = std::dynamic_pointer_cast(myObject); // the second condition is for history upper than concealment causer, so the feature result may // be displayed and previewed; also for avoiding of quick show/hide on history // moving deep down - if (aRes && !theFeature->isDisabled() && + if (aRes && !theFeature->isDisabled() && !ModelAPI_Session::get()->validators()->isUnconcealed(aRes, theFeature)) { aRes->setIsConcealed(true); } @@ -470,7 +470,7 @@ void Model_Data::updateConcealmentFlag() if (aFeature.get() && !aFeature->isDisabled() && aFeature->isStable()) { if (ModelAPI_Session::get()->validators()->isConcealed( aFeature->getKind(), (*aRefsIter)->id())) { - std::shared_ptr aRes = + std::shared_ptr aRes = std::dynamic_pointer_cast(myObject); if (aRes.get()) { if (!ModelAPI_Session::get()->validators()->isUnconcealed(aRes, aFeature)) { @@ -482,14 +482,14 @@ void Model_Data::updateConcealmentFlag() } } } - std::shared_ptr aRes = + std::shared_ptr aRes = std::dynamic_pointer_cast(myObject); if (aRes.get()) { aRes->setIsConcealed(false); } } -std::set set_union(const std::set& theLeft, +std::set set_union(const std::set& theLeft, const std::set& theRight) { std::set aResult; @@ -522,7 +522,7 @@ std::list findVariables(const std::set& thePara const std::string& aName = *aParamIt; double aValue; ResultParameterPtr aParam; - // theSearcher is not needed here: in expressions + // theSearcher is not needed here: in expressions // of features the parameters history is not needed if (ModelAPI_Tools::findVariable(FeaturePtr(), aName, aValue, aParam)) aResult.push_back(aParam); @@ -533,7 +533,7 @@ std::list findVariables(const std::set& thePara void Model_Data::referencesToObjects( std::list > >& theRefs) { - static Model_ValidatorsFactory* aValidators = + static Model_ValidatorsFactory* aValidators = static_cast(ModelAPI_Session::get()->validators()); FeaturePtr aMyFeature = std::dynamic_pointer_cast(myObject); diff --git a/src/Model/Model_Data.h b/src/Model/Model_Data.h index c41f1a5ab..f78f2d263 100644 --- a/src/Model/Model_Data.h +++ b/src/Model/Model_Data.h @@ -101,7 +101,7 @@ class Model_Data : public ModelAPI_Data MODEL_EXPORT virtual std::shared_ptr selection(const std::string& theID); /// Returns the attribute that contains selection to a shape - MODEL_EXPORT virtual std::shared_ptr + MODEL_EXPORT virtual std::shared_ptr selectionList(const std::string& theID); /// Returns the attribute that contains reference to an attribute of a feature MODEL_EXPORT virtual std::shared_ptr @@ -153,7 +153,7 @@ class Model_Data : public ModelAPI_Data /// \param theID identifier of the attribute that can be referenced by this ID later /// \param theAttrType type of the created attribute (received from the type method) /// \returns the just created attribute - MODEL_EXPORT virtual AttributePtr + MODEL_EXPORT virtual AttributePtr addAttribute(const std::string& theID, const std::string theAttrType); /// Useful method for "set" methods of the attributes: sends an UPDATE event and @@ -201,7 +201,7 @@ class Model_Data : public ModelAPI_Data MODEL_EXPORT virtual const std::set& refsToMe() {return myRefsToMe;} /// returns all references by attributes of this data - /// \param theRefs returned list of pairs: + /// \param theRefs returned list of pairs: /// id of referenced attribute and list of referenced objects MODEL_EXPORT virtual void referencesToObjects( std::list > >& theRefs); @@ -253,7 +253,7 @@ private: /// \param theFeature feature referenced to this /// \param theAttrID identifier of the attribute that is references from theFeature to this /// \param theApplyConcealment applies consealment flag changes - void addBackReference(FeaturePtr theFeature, std::string theAttrID, + void addBackReference(FeaturePtr theFeature, std::string theAttrID, const bool theApplyConcealment = true); /// Makes the concealment flag up to date for this object-owner. diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index a72221515..61331514c 100755 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -79,7 +79,7 @@ Model_Document::Model_Document(const int theID, const std::string theKind) CDF_Session::CurrentSession()->Directory()->Add(myDoc); #endif myObjs = new Model_Objects(myDoc->Main()); - myDoc->SetUndoLimit(UNDO_LIMIT); + myDoc->SetUndoLimit(UNDO_LIMIT); myTransactionSave = 0; myExecuteFeatures = true; // to have something in the document and avoid empty doc open/save problem @@ -101,7 +101,7 @@ static TCollection_ExtendedString DocFileName(const char* theDirName, const std: { TCollection_ExtendedString aPath((const Standard_CString) theDirName); // remove end-separators - while(aPath.Length() && + while(aPath.Length() && (aPath.Value(aPath.Length()) == '\\' || aPath.Value(aPath.Length()) == '/')) aPath.Remove(aPath.Length()); aPath += _separator_; @@ -142,15 +142,15 @@ bool Model_Document::load(const char* theDirName, const char* theFileName, Docum Events_InfoMessage("Model_Document", "Can not open document: already opened").send(); break; case PCDM_RS_AlreadyRetrievedAndModified: - Events_InfoMessage("Model_Document", + Events_InfoMessage("Model_Document", "Can not open document: already opened and modified").send(); break; case PCDM_RS_NoDriver: - Events_InfoMessage("Model_Document", + Events_InfoMessage("Model_Document", "Can not open document: driver library is not found").send(); break; case PCDM_RS_UnknownFileDriver: - Events_InfoMessage("Model_Document", + Events_InfoMessage("Model_Document", "Can not open document: unknown driver for opening").send(); break; case PCDM_RS_OpenError: @@ -172,7 +172,7 @@ bool Model_Document::load(const char* theDirName, const char* theFileName, Docum Events_InfoMessage("Model_Document", "Can not open document: invalid object").send(); break; case PCDM_RS_UnrecognizedFileFormat: - Events_InfoMessage("Model_Document", + Events_InfoMessage("Model_Document", "Can not open document: unrecognized file format").send(); break; case PCDM_RS_MakeFailure: @@ -189,7 +189,7 @@ bool Model_Document::load(const char* theDirName, const char* theFileName, Docum break; } } - std::shared_ptr aSession = + std::shared_ptr aSession = std::dynamic_pointer_cast(Model_Session::get()); if (!isError) { myDoc = aLoaded; @@ -220,7 +220,7 @@ bool Model_Document::load(const char* theDirName, const char* theFileName, Docum } else { // open failed, but new documnet was created to work with it: inform the model aSession->setActiveDocument(Model_Session::get()->moduleDocument(), false); - } + } return !isError; } @@ -243,7 +243,7 @@ bool Model_Document::save( aStatus = anApp->SaveAs(myDoc, aPath); } catch (Standard_Failure) { Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - Events_InfoMessage("Model_Document", + Events_InfoMessage("Model_Document", "Exception in saving of document: %1").arg(aFail->GetMessageString()).send(); return false; } @@ -251,7 +251,7 @@ bool Model_Document::save( if (!isDone) { switch (aStatus) { case PCDM_SS_DriverFailure: - Events_InfoMessage("Model_Document", + Events_InfoMessage("Model_Document", "Can not save document: save driver-library failure").send(); break; case PCDM_SS_WriteFailure: @@ -286,7 +286,7 @@ bool Model_Document::save( aFile.Copy(aDestination); theResults.push_back(aDestinationDir.ToCString()); } else { - Events_InfoMessage("Model_Document", + Events_InfoMessage("Model_Document", "Can not open file %1 for saving").arg(aSubPath.ToCString()).send(); } } @@ -343,7 +343,7 @@ void Model_Document::startOperation() { incrementTransactionID(); // outside of transaction in order to avoid empty transactions keeping if (myDoc->HasOpenCommand()) { // start of nested command - if (myDoc->CommitCommand()) { + if (myDoc->CommitCommand()) { // commit the current: it will contain all nested after compactification myTransactions.rbegin()->myOCAFNum++; // if has open command, the list is not empty } @@ -464,7 +464,7 @@ static bool isEqualContent(Handle(TDF_Attribute) theAttr1, Handle(TDF_Attribute) return false; } -/// Returns true if the last transaction is actually empty: modification to te same values +/// Returns true if the last transaction is actually empty: modification to te same values /// were performed only static bool isEmptyTransaction(const Handle(TDocStd_Document)& theDoc) { Handle(TDF_Delta) aDelta; @@ -486,7 +486,7 @@ static bool isEmptyTransaction(const Handle(TDocStd_Document)& theDoc) { if (isEqualContent(anADelta->Attribute(), aCurrentAttr)) { continue; // attribute is not changed actually } - } else + } else if (Standard_GUID::IsEqual(anADelta->Attribute()->ID(), TDataStd_AsciiString::GetID())) { continue; // error message is disappeared } @@ -500,17 +500,17 @@ static bool isEmptyTransaction(const Handle(TDocStd_Document)& theDoc) { bool Model_Document::finishOperation() { bool isNestedClosed = !myDoc->HasOpenCommand() && !myNestedNum.empty(); - static std::shared_ptr aSession = + static std::shared_ptr aSession = std::static_pointer_cast(Model_Session::get()); - // open transaction if nested is closed to fit inside + // open transaction if nested is closed to fit inside // all synchronizeBackRefs and flushed consequences if (isNestedClosed) { myDoc->OpenCommand(); } // do it before flashes to enable and recompute nesting features correctly if (myNestedNum.empty() || (isNestedClosed && myNestedNum.size() == 1)) { - // if all nested operations are closed, make current the higher level objects (to perform + // if all nested operations are closed, make current the higher level objects (to perform // it in the python scripts correctly): sketch become current after creation ofsub-elements FeaturePtr aCurrent = currentFeature(false); CompositeFeaturePtr aMain, aNext = ModelAPI_Tools::compositeOwner(aCurrent); @@ -532,7 +532,7 @@ bool Model_Document::finishOperation() if (myDoc->CommitCommand()) myTransactions.rbegin()->myOCAFNum++; } - + // this must be here just after everything is finished but before real transaction stop // to avoid messages about modifications outside of the transaction // and to rebuild everything after all updates and creates @@ -555,7 +555,7 @@ bool Model_Document::finishOperation() aResult = true; // transaction may be empty if this document was created during this transaction (create part) - if (!myTransactions.empty() && myDoc->CommitCommand()) { + if (!myTransactions.empty() && myDoc->CommitCommand()) { // if commit is successfull, just increment counters if (isEmptyTransaction(myDoc)) { // erase this transaction myDoc->Undo(); @@ -593,7 +593,7 @@ static void modifiedLabels(const Handle(TDocStd_Document)& theDoc, TDF_LabelList Handle(TDF_Delta) aDelta; if (isRedo) aDelta = theDoc->GetRedos().First(); - else + else aDelta = theDoc->GetUndos().Last(); TDF_LabelList aDeltaList; aDelta->Labels(aDeltaList); // it clears list, so, use new one and then append to the result @@ -603,17 +603,17 @@ static void modifiedLabels(const Handle(TDocStd_Document)& theDoc, TDF_LabelList // add also label of the modified attributes const TDF_AttributeDeltaList& anAttrs = aDelta->AttributeDeltas(); /// named shape evolution also modifies integer on this label: exclude it - TDF_LabelMap anExcludedInt; + TDF_LabelMap anExcludedInt; for (TDF_ListIteratorOfAttributeDeltaList anAttr(anAttrs); anAttr.More(); anAttr.Next()) { if (anAttr.Value()->Attribute()->ID() == TDataStd_BooleanArray::GetID()) { // Boolean array is used for feature auxiliary attributes only, feature args are not modified - continue; + continue; } if (anAttr.Value()->Attribute()->ID() == TNaming_NamedShape::GetID()) { anExcludedInt.Add(anAttr.Value()->Label()); - // named shape evolution is changed in history update => skip them, + // named shape evolution is changed in history update => skip them, // they are not the features arguents - continue; + continue; } if (anAttr.Value()->Attribute()->ID() == TDataStd_Integer::GetID()) { if (anExcludedInt.Contains(anAttr.Value()->Label())) @@ -692,9 +692,9 @@ bool Model_Document::canUndo() { // issue 406 : if transaction is opened, but nothing to undo behind, can not undo int aCurrentNum = isOperation() ? 1 : 0; - if (myDoc->GetAvailableUndos() > 0 && + if (myDoc->GetAvailableUndos() > 0 && // there is something to undo in nested - (myNestedNum.empty() || *myNestedNum.rbegin() - aCurrentNum > 0) && + (myNestedNum.empty() || *myNestedNum.rbegin() - aCurrentNum > 0) && myTransactions.size() - aCurrentNum > 0 /* for omitting the first useless transaction */) return true; // check other subs contains operation that can be undoed @@ -825,7 +825,7 @@ void Model_Document::operationId(const std::string& theId) FeaturePtr Model_Document::addFeature(std::string theID, const bool theMakeCurrent) { - std::shared_ptr aSession = + std::shared_ptr aSession = std::dynamic_pointer_cast(ModelAPI_Session::get()); FeaturePtr aFeature = aSession->createFeature(theID, this); if (!aFeature) @@ -847,7 +847,7 @@ FeaturePtr Model_Document::addFeature(std::string theID, const bool theMakeCurre FeaturePtr aCurrent = aDocToAdd->currentFeature(false); bool isModified = true; for(CompositeFeaturePtr aComp = std::dynamic_pointer_cast(aCurrent); - aComp.get() && isModified; + aComp.get() && isModified; aComp = std::dynamic_pointer_cast(aCurrent)) { isModified = false; int aSubs = aComp->numberOfSubs(false); @@ -901,9 +901,9 @@ void Model_Document::moveFeature(FeaturePtr theMoved, FeaturePtr theAfterThis) if (aCurrentUp) { setCurrentFeatureUp(); } - // if user adds after high-level feature with nested, + // if user adds after high-level feature with nested, // add it after all nested (otherwise the nested will be disabled) - CompositeFeaturePtr aCompositeAfter = + CompositeFeaturePtr aCompositeAfter = std::dynamic_pointer_cast(theAfterThis); if (aCompositeAfter.get()) { FeaturePtr aSub = aCompositeAfter; @@ -1023,9 +1023,9 @@ void Model_Document::setCurrentFeature( } } - if (theVisible && !theCurrent.get()) { + if (theVisible && !theCurrent.get()) { // needed to avoid disabling of PartSet initial constructions - FeaturePtr aNext = + FeaturePtr aNext = theCurrent.get() ? myObjs->nextFeature(theCurrent) : myObjs->firstFeature(); for (; aNext.get(); aNext = myObjs->nextFeature(theCurrent)) { if (aNext->isInHistory()) { @@ -1068,7 +1068,7 @@ void Model_Document::setCurrentFeature( if (aMain.get()) { if (isSub(aMain, anIter)) // sub-elements of not-disabled feature are not disabled aDisabledFlag = false; - else if (anOwners.find(anIter) != anOwners.end()) + else if (anOwners.find(anIter) != anOwners.end()) // disable the higher-level feature is the nested is the current aDisabledFlag = true; } @@ -1078,7 +1078,7 @@ void Model_Document::setCurrentFeature( // due to the issue 1491 all parameters are kept enabled any time //if (!isCurrentParameter) aDisabledFlag = false; - } else if (isCurrentParameter) { + } else if (isCurrentParameter) { // if paramater is active, all other features become enabled (issue 1307) aDisabledFlag = false; } @@ -1086,8 +1086,8 @@ void Model_Document::setCurrentFeature( if (anIter->setDisabled(aDisabledFlag)) { static Events_ID anUpdateEvent = aLoop->eventByName(EVENT_OBJECT_UPDATED); // state of feature is changed => so inform that it must be updated if it has such state - if (!aDisabledFlag && - (anIter->data()->execState() == ModelAPI_StateMustBeUpdated || + if (!aDisabledFlag && + (anIter->data()->execState() == ModelAPI_StateMustBeUpdated || anIter->data()->execState() == ModelAPI_StateInvalidArgument)) ModelAPI_EventCreator::get()->sendUpdated(anIter, anUpdateEvent); // flush is in the end of this method @@ -1116,7 +1116,7 @@ void Model_Document::setCurrentFeature( void Model_Document::setCurrentFeatureUp() { - // on remove just go up for minimum step: highlight external objects in sketch causes + // on remove just go up for minimum step: highlight external objects in sketch causes // problems if it is true: here and in "setCurrentFeature" FeaturePtr aCurrent = currentFeature(false); if (aCurrent.get()) { // if not, do nothing because null is the upper @@ -1124,9 +1124,9 @@ void Model_Document::setCurrentFeatureUp() // make the higher level composite as current (sketch becomes disabled if line is enabled) if (aPrev.get()) { FeaturePtr aComp = ModelAPI_Tools::compositeOwner(aPrev); - // without cycle (issue 1555): otherwise extrusion fuse + // without cycle (issue 1555): otherwise extrusion fuse // will be enabled and displayed whaen inside sketch - if (aComp.get()) + if (aComp.get()) aPrev = aComp; } // do not flush: it is called only on remove, it will be flushed in the end of transaction @@ -1322,12 +1322,12 @@ std::shared_ptr Model_Document::featureById(const int theId) void Model_Document::synchronizeTransactions() { - Model_Document* aRoot = + Model_Document* aRoot = std::dynamic_pointer_cast(ModelAPI_Session::get()->moduleDocument()).get(); if (aRoot == this) return; // don't need to synchronise root with root - std::shared_ptr aSession = + std::shared_ptr aSession = std::dynamic_pointer_cast(Model_Session::get()); while(myRedos.size() > aRoot->myRedos.size()) { // remove redos in this aSession->setCheckTransactions(false); @@ -1367,7 +1367,7 @@ AttributeSelectionListPtr Model_Document::selectionInPartFeature() if (!mySelectionFeature.get() || !mySelectionFeature->data()->isValid()) { // create a new one mySelectionFeature = FeaturePtr(new Model_SelectionInPartFeature); - + TDF_Label aFeatureLab = generalLabel().FindChild(TAG_SELECTION_FEATURE); std::shared_ptr aData(new Model_Data); aData->setLabel(aFeatureLab.FindChild(1)); @@ -1405,7 +1405,7 @@ static Handle(TNaming_NamedShape) searchForOriginalShape(TopoDS_Shape theShape, Handle(TNaming_NamedShape) aNS; if (aNSLab.FindAttribute(TNaming_NamedShape::GetID(), aNS)) { for(TNaming_Iterator aShapesIter(aNS); aShapesIter.More(); aShapesIter.Next()) { - if (aShapesIter.Evolution() == TNaming_SELECTED || + if (aShapesIter.Evolution() == TNaming_SELECTED || aShapesIter.Evolution() == TNaming_DELETE) continue; // don't use the selection evolution if (aShapesIter.NewShape().IsSame(aShape)) { // found the original shape @@ -1413,7 +1413,7 @@ static Handle(TNaming_NamedShape) searchForOriginalShape(TopoDS_Shape theShape, if (aResult->Evolution() == TNaming_MODIFY) theShape = aShapesIter.OldShape(); // otherwise may me searching for another item of this shape with longer history - if (!theShape.IsNull()) + if (!theShape.IsNull()) break; } } @@ -1472,7 +1472,7 @@ std::shared_ptr Model_Document::producedByFeature( if (aCandidatInThis->Evolution() == TNaming_MODIFY) anOldShape = aShapesIter.OldShape(); // otherwise may me searching for another item of this shape with longer history - if (!anOldShape.IsNull()) + if (!anOldShape.IsNull()) break; } // check that the shape contains aShape as sub-shape to fill container @@ -1496,7 +1496,7 @@ std::shared_ptr Model_Document::producedByFeature( } } if (aCandidatInThis.IsNull()) { - // to fix 1512: searching for original shape of this shape + // to fix 1512: searching for original shape of this shape // if modification of it is not in this result aCandidatInThis = searchForOriginalShape(aShape, myDoc->Main()); if (aCandidatInThis.IsNull()) { diff --git a/src/Model/Model_Document.h b/src/Model/Model_Document.h index 5cedc56a3..0fe3b2988 100644 --- a/src/Model/Model_Document.h +++ b/src/Model/Model_Document.h @@ -52,7 +52,7 @@ class Model_Document : public ModelAPI_Document const char* theDirName, const char* theFileName, std::list& theResults); //! Removes document data - //! \param theForever if it is false, document is just hiden + //! \param theForever if it is false, document is just hiden //! (to keep possibility make it back on Undo/Redo) MODEL_EXPORT virtual void close(const bool theForever = false); @@ -61,7 +61,7 @@ class Model_Document : public ModelAPI_Document //! Finishes the previously started operation (closes the transaction) //! \returns true if transaction in this document is not empty and really was performed MODEL_EXPORT virtual bool finishOperation(); - //! Aborts the operation + //! Aborts the operation MODEL_EXPORT virtual void abortOperation(); //! Returns true if operation has been started, but not yet finished or aborted MODEL_EXPORT virtual bool isOperation() const; @@ -150,7 +150,7 @@ class Model_Document : public ModelAPI_Document MODEL_EXPORT virtual std::shared_ptr internalFeature(const int theIndex); //! Performs synchronization of transactions with the module document: //! If some document is not active (by undo of activation) but in memory, - //! on activation the transactions must be synchronised because all redos performed + //! on activation the transactions must be synchronised because all redos performed //! wihtout this participation MODEL_EXPORT virtual void synchronizeTransactions(); @@ -273,7 +273,7 @@ class Model_Document : public ModelAPI_Document //! Returns true if this document is currently active virtual bool isActive() const; - //! Returns the selection attribute that is used + //! Returns the selection attribute that is used //! for calculation of selection externally from the document std::shared_ptr selectionInPartFeature(); diff --git a/src/Model/Model_Events.cpp b/src/Model/Model_Events.cpp index 34d9522d8..3a060d43f 100644 --- a/src/Model/Model_Events.cpp +++ b/src/Model/Model_Events.cpp @@ -63,7 +63,7 @@ std::shared_ptr Model_ObjectUpdatedMessage::newEmpty() void Model_ObjectUpdatedMessage::Join(const std::shared_ptr& theJoined) { - std::shared_ptr aJoined = + std::shared_ptr aJoined = std::dynamic_pointer_cast(theJoined); std::set::iterator aFIter = aJoined->myObjects.begin(); for (; aFIter != aJoined->myObjects.end(); aFIter++) { @@ -94,7 +94,7 @@ const Events_ID Model_ObjectDeletedMessage::messageId() void Model_ObjectDeletedMessage::Join(const std::shared_ptr& theJoined) { - std::shared_ptr aJoined = + std::shared_ptr aJoined = std::dynamic_pointer_cast(theJoined); std::set::iterator aGIter = aJoined->myGroups.begin(); for (; aGIter != aJoined->myGroups.end(); aGIter++) { diff --git a/src/Model/Model_Expression.cpp b/src/Model/Model_Expression.cpp index 3a1d62ab2..f2f348243 100644 --- a/src/Model/Model_Expression.cpp +++ b/src/Model/Model_Expression.cpp @@ -42,7 +42,7 @@ void Model_Expression::setText(const std::string& theValue) setError(text().empty() ? "" : "Not a double value."); } -std::string Model_Expression::text() const +std::string Model_Expression::text() const { return TCollection_AsciiString(myText->Get()).ToCString(); } diff --git a/src/Model/Model_FeatureValidator.cpp b/src/Model/Model_FeatureValidator.cpp index c8a204e29..eab3761b1 100644 --- a/src/Model/Model_FeatureValidator.cpp +++ b/src/Model/Model_FeatureValidator.cpp @@ -22,11 +22,11 @@ bool Model_FeatureValidator::isValid(const std::shared_ptr& th const std::list& theArguments, Events_InfoMessage& theError) const { - static Model_ValidatorsFactory* aValidators = + static Model_ValidatorsFactory* aValidators = static_cast(ModelAPI_Session::get()->validators()); std::shared_ptr aData = theFeature->data(); - // "Action" features has no data, but still valid. e.g "Remove Part" + // "Action" features has no data, but still valid. e.g "Remove Part" if (!aData->isValid()) { if (!theFeature->isAction()) theError = "There is no data."; @@ -40,7 +40,7 @@ bool Model_FeatureValidator::isValid(const std::shared_ptr& th if (!aValidators->isCase(theFeature, anAttr->id())) continue; // this attribute is not participated in the current case if (!anAttr->isInitialized()) { // attribute is not initialized - std::map >::const_iterator aFeatureFind = + std::map >::const_iterator aFeatureFind = myNotObligatory.find(theFeature->getKind()); if (aFeatureFind == myNotObligatory.end() || // and it is obligatory for filling aFeatureFind->second.find(*it) == aFeatureFind->second.end()) { diff --git a/src/Model/Model_Objects.cpp b/src/Model/Model_Objects.cpp index 1f14f1e00..715bc6896 100644 --- a/src/Model/Model_Objects.cpp +++ b/src/Model/Model_Objects.cpp @@ -126,7 +126,7 @@ void Model_Objects::addFeature(FeaturePtr theFeature, const FeaturePtr theAfterT // in initData it creates new features, appeared later than this TDF_Label aPrevFeateureLab; if (theAfterThis.get()) { // searching for the previous feature label - std::shared_ptr aPrevData = + std::shared_ptr aPrevData = std::dynamic_pointer_cast(theAfterThis->data()); if (aPrevData.get()) { aPrevFeateureLab = aPrevData->label().Father(); @@ -161,7 +161,7 @@ void Model_Objects::addFeature(FeaturePtr theFeature, const FeaturePtr theAfterT /// Appends to the array of references a new referenced label. /// If theIndex is not -1, removes element at this index, not theReferenced. /// \returns the index of removed element -static int RemoveFromRefArray(TDF_Label theArrayLab, TDF_Label theReferenced, +static int RemoveFromRefArray(TDF_Label theArrayLab, TDF_Label theReferenced, const int theIndex = -1) { int aResult = -1; // no returned @@ -200,7 +200,7 @@ void Model_Objects::refsToFeature(FeaturePtr theFeature, std::list::const_iterator aResIter = aResults.cbegin(); for (; aResIter != aResults.cend(); aResIter++) { ResultPtr aResult = (*aResIter); - std::shared_ptr aData = + std::shared_ptr aData = std::dynamic_pointer_cast(aResult->data()); if (aData.get() != NULL) { const std::set& aRefs = aData->refsToMe(); @@ -213,7 +213,7 @@ void Model_Objects::refsToFeature(FeaturePtr theFeature, } } // the dependencies can be in the feature itself - std::shared_ptr aData = + std::shared_ptr aData = std::dynamic_pointer_cast(theFeature->data()); if (aData.get() && !aData->refsToMe().empty()) { const std::set& aRefs = aData->refsToMe(); @@ -226,7 +226,7 @@ void Model_Objects::refsToFeature(FeaturePtr theFeature, } if (!theRefs.empty() && isSendError) { - Events_InfoMessage("Model_Objects", + Events_InfoMessage("Model_Objects", "Feature '%1' is used and can not be deleted").arg(theFeature->data()->name()).send(); } } @@ -240,7 +240,7 @@ void Model_Objects::removeFeature(FeaturePtr theFeature) refsToFeature(theFeature, aRefs, false); std::set >::iterator aRefIter = aRefs.begin(); for(; aRefIter != aRefs.end(); aRefIter++) { - std::shared_ptr aComposite = + std::shared_ptr aComposite = std::dynamic_pointer_cast(*aRefIter); if (aComposite.get() && aComposite->isSub(theFeature)) { aComposite->removeFeature(theFeature); @@ -275,12 +275,12 @@ void Model_Objects::moveFeature(FeaturePtr theMoved, FeaturePtr theAfterThis) Handle(TDataStd_ReferenceArray) aRefs; if (!aFeaturesLab.FindAttribute(TDataStd_ReferenceArray::GetID(), aRefs)) return; - TDF_Label anAfterLab, aMovedLab = + TDF_Label anAfterLab, aMovedLab = std::dynamic_pointer_cast(theMoved->data())->label().Father(); if (theAfterThis.get()) anAfterLab = std::dynamic_pointer_cast(theAfterThis->data())->label().Father(); - Handle(TDataStd_HLabelArray1) aNewArray = + Handle(TDataStd_HLabelArray1) aNewArray = new TDataStd_HLabelArray1(aRefs->Lower(), aRefs->Upper()); int aPassedMovedFrom = 0; // the prev feature location is found and passed int aPassedMovedTo = 0; // the feature is added and this location is passed @@ -332,7 +332,7 @@ void Model_Objects::clearHistory(ObjectPtr theObj) FeaturePtr aFeature = std::dynamic_pointer_cast(theObj); std::string aResultGroup = featureResultGroup(aFeature); if (!aResultGroup.empty()) { - std::map >::iterator aHIter = + std::map >::iterator aHIter = myHistory.find(aResultGroup); if (aHIter != myHistory.end()) myHistory.erase(aHIter); // erase from map => this means that it is not synchronized @@ -353,7 +353,7 @@ void Model_Objects::createHistory(const std::string& theGroupID) for(int a = aRefs->Lower(); a <= aRefs->Upper(); a++) { FeaturePtr aFeature = feature(aRefs->Value(a)); if (aFeature.get()) { - // if feature is in sub-component, remove it from history: + // if feature is in sub-component, remove it from history: // it is in sub-tree of sub-component bool isSub = ModelAPI_Tools::compositeOwner(aFeature).get() != NULL; if (isFeature) { // here may be also disabled features @@ -365,7 +365,7 @@ void Model_Objects::createHistory(const std::string& theGroupID) if (!isSub || theGroupID != ModelAPI_ResultConstruction::group()) { // do not use reference to the list here since results can be changed by "isConcealed" const std::list > aResults = aFeature->results(); - std::list >::const_iterator + std::list >::const_iterator aRIter = aResults.begin(); for (; aRIter != aResults.cend(); aRIter++) { ResultPtr aRes = *aRIter; @@ -476,7 +476,7 @@ std::shared_ptr Model_Objects::objectByName( if (aRIter->get() && (*aRIter)->groupName() == theGroupID) { if ((*aRIter)->data()->name() == theName) return *aRIter; - ResultCompSolidPtr aCompRes = + ResultCompSolidPtr aCompRes = std::dynamic_pointer_cast(*aRIter); if (aCompRes.get()) { int aNumSubs = aCompRes->numberOfSubs(); @@ -610,7 +610,7 @@ std::shared_ptr Model_Objects::featureById(const int theId) } void Model_Objects::synchronizeFeatures( - const TDF_LabelList& theUpdated, const bool theUpdateReferences, + const TDF_LabelList& theUpdated, const bool theUpdateReferences, const bool theOpen, const bool theFlush) { Model_Document* anOwner = std::dynamic_pointer_cast(myDoc).get(); @@ -648,7 +648,7 @@ void Model_Objects::synchronizeFeatures( aFeature = std::dynamic_pointer_cast(ModelAPI_Session::get())->createFeature( TCollection_AsciiString(Handle(TDataStd_Comment)::DownCast(aLabIter.Value())->Get()) .ToCString(), anOwner); - if (!aFeature.get()) { + if (!aFeature.get()) { // somethig is wrong, most probably, the opened document has invalid structure Events_InfoMessage("Model_Objects", "Invalid type of object in the document").send(); aLabIter.Value()->Label().ForgetAllAttributes(); @@ -668,7 +668,7 @@ void Model_Objects::synchronizeFeatures( aKeptFeatures.insert(aFeature); if (anUpdatedMap.Contains(aFeatureLabel)) { if (!theOpen) { // on abort/undo/redo reinitialize attributes is something is changed - std::list > anAttrs = + std::list > anAttrs = aFeature->data()->attributes(""); std::list >::iterator anAttr = anAttrs.begin(); for(; anAttr != anAttrs.end(); anAttr++) @@ -706,7 +706,7 @@ void Model_Objects::synchronizeFeatures( updateHistory(aFeature); aFeature->erase(); - // unbind after the "erase" call: on abort sketch + // unbind after the "erase" call: on abort sketch // is removes sub-objects that corrupts aFIter myFeatures.UnBind(aFIter.Key()); // reinitialize iterator because unbind may corrupt the previous order in the map @@ -718,9 +718,9 @@ void Model_Objects::synchronizeFeatures( if (theUpdateReferences) { synchronizeBackRefs(); } - // update results of the features (after features created because + // update results of the features (after features created because // they may be connected, like sketch and sub elements) - // After synchronisation of back references because sketch + // After synchronisation of back references because sketch // must be set in sub-elements before "execute" by updateResults std::list aComposites; // composites must be updated after their subs (issue 360) TDF_ChildIDIterator aLabIter2(featuresLabel(), TDataStd_Comment::GetID()); @@ -739,7 +739,7 @@ void Model_Objects::synchronizeFeatures( updateResults(*aComposite); } - // the synchronize should be done after updateResults + // the synchronize should be done after updateResults // in order to correct back references of updated results if (theUpdateReferences) { synchronizeBackRefs(); @@ -756,7 +756,7 @@ void Model_Objects::synchronizeFeatures( if (theFlush) { aLoop->flush(aDeleteEvent); // delete should be emitted before create to reacts to aborted feature - aLoop->flush(aCreateEvent); + aLoop->flush(aCreateEvent); aLoop->flush(anUpdateEvent); aLoop->flush(aCreateEvent); // after update of features, there could be results created aLoop->flush(aDeleteEvent); // or deleted @@ -769,7 +769,7 @@ void Model_Objects::synchronizeFeatures( /// synchronises back references for the given object basing on the collected data void Model_Objects::synchronizeBackRefsForObject(const std::set& theNewRefs, - ObjectPtr theObject) + ObjectPtr theObject) { if (!theObject.get() || !theObject->data()->isValid()) return; // invalid @@ -786,9 +786,9 @@ void Model_Objects::synchronizeBackRefsForObject(const std::set& t std::set::iterator aCurrentIter = aData->refsToMe().begin(); while(aCurrentIter != aData->refsToMe().end()) { if (theNewRefs.find(*aCurrentIter) == theNewRefs.end()) { - // for external references from other documents this system + // for external references from other documents this system // is not working: refs are collected from - // different Model_Objects, so before remove check this + // different Model_Objects, so before remove check this // external object exists and still referenced bool aLeaveIt = false; if ((*aCurrentIter)->owner().get() && (*aCurrentIter)->owner()->document() != myDoc && @@ -883,7 +883,7 @@ void Model_Objects::synchronizeBackRefs() (*aRIter)->isConcealed(); } } - // the rest all refs means that feature references to the external document feature: + // the rest all refs means that feature references to the external document feature: // process also them std::map >::iterator anExtIter = allRefs.begin(); for(; anExtIter != allRefs.end(); anExtIter++) { @@ -892,9 +892,9 @@ void Model_Objects::synchronizeBackRefs() } TDF_Label Model_Objects::resultLabel( - const std::shared_ptr& theFeatureData, const int theResultIndex) + const std::shared_ptr& theFeatureData, const int theResultIndex) { - const std::shared_ptr& aData = + const std::shared_ptr& aData = std::dynamic_pointer_cast(theFeatureData); return aData->label().Father().FindChild(TAG_FEATURE_RESULTS).FindChild(theResultIndex + 1); } @@ -906,11 +906,11 @@ void Model_Objects::storeResult(std::shared_ptr theFeatureData, theResult->init(); theResult->setDoc(myDoc); initData(theResult, resultLabel(theFeatureData, theResultIndex), TAG_FEATURE_ARGUMENTS); - if (theResult->data()->name().empty()) { + if (theResult->data()->name().empty()) { // if was not initialized, generate event and set a name std::stringstream aNewName; aNewName<name(); - // if there are several results (issue #899: any number of result), + // if there are several results (issue #899: any number of result), // add unique prefix starting from second if (theResultIndex > 0 || theResult->groupName() == ModelAPI_ResultBody::group()) aNewName<<"_"< Model_Objects::createBody( const std::shared_ptr& theFeatureData, const int theIndex) { TDF_Label aLab = resultLabel(theFeatureData, theIndex); - // for feature create compsolid, but for result sub create body: + // for feature create compsolid, but for result sub create body: // only one level of recursion is supported now ResultPtr aResultOwner = std::dynamic_pointer_cast(theFeatureData->owner()); ObjectPtr anOldObject; @@ -1067,7 +1067,7 @@ void Model_Objects::updateResults(FeaturePtr theFeature) ResultPtr aBody = std::dynamic_pointer_cast(*aResIter); if (aBody.get()) { std::shared_ptr aData = std::dynamic_pointer_cast(aBody->data()); - if (!aData.get() || !aData->isValid() || (!aBody->isDisabled() && aData->isDeleted())) { + if (!aData.get() || !aData->isValid() || (!aBody->isDisabled() && aData->isDeleted())) { // found a disappeared result => remove it theFeature->eraseResultFromList(aBody); // start iterate from beginning because iterator is corrupted by removing @@ -1091,15 +1091,15 @@ void Model_Objects::updateResults(FeaturePtr theFeature) TDF_Label anArgLab = aLabIter.Value(); Handle(TDataStd_Comment) aGroup; if (anArgLab.FindAttribute(TDataStd_Comment::GetID(), aGroup)) { - if (aGroup->Get() == ModelAPI_ResultBody::group().c_str() || + if (aGroup->Get() == ModelAPI_ResultBody::group().c_str() || aGroup->Get() == ModelAPI_ResultCompSolid::group().c_str()) { aNewBody = createBody(theFeature->data(), aResIndex); } else if (aGroup->Get() == ModelAPI_ResultPart::group().c_str()) { - std::shared_ptr aNewP = createPart(theFeature->data(), aResIndex); + std::shared_ptr aNewP = createPart(theFeature->data(), aResIndex); theFeature->setResult(aNewP, aResIndex); if (!aNewP->partDoc().get()) // create the part result: it is better to restore the previous result if it is possible - theFeature->execute(); + theFeature->execute(); break; } else if (aGroup->Get() == ModelAPI_ResultConstruction::group().c_str()) { theFeature->execute(); // construction shapes are needed for sketch solver diff --git a/src/Model/Model_Objects.h b/src/Model/Model_Objects.h index 86cf46e34..23ae72453 100644 --- a/src/Model/Model_Objects.h +++ b/src/Model/Model_Objects.h @@ -36,7 +36,7 @@ class Model_Objects public: //! Registers the fieature in the data structure //! \param theFeature feature that must be added to the data structure - //! \param theAfterThis the feature will be added after this feature; + //! \param theAfterThis the feature will be added after this feature; //! if it is null, the added feature will be the first void addFeature(FeaturePtr theFeature, const FeaturePtr theAfterThis); @@ -87,7 +87,7 @@ class Model_Objects //! Returns the number of features in the group int size(const std::string& theGroupID); - //! Returns all (and disabled) results of the given type. + //! Returns all (and disabled) results of the given type. //! Not fast method (iterates all features). void allResults(const std::string& theGroupID, std::list& theResults); @@ -138,7 +138,7 @@ class Model_Objects //! Returns (creates if needed) the features label TDF_Label featuresLabel() const; - //! Initializes feature with a unique name in this group (unique name is generated as + //! Initializes feature with a unique name in this group (unique name is generated as //! feature type + "_" + index void setUniqueName(FeaturePtr theFeature); @@ -158,7 +158,7 @@ class Model_Objects //! Initializes the data fields of the feature void initData(ObjectPtr theObj, TDF_Label theLab, const int theTag); - //! Allows to store the result in the data tree of the document + //! Allows to store the result in the data tree of the document //! (attaches 'data' of result to tree) void storeResult(std::shared_ptr theFeatureData, std::shared_ptr theResult, @@ -194,7 +194,7 @@ class Model_Objects /// Returns true if theLater is in history of features creation later than theCurrent bool isLater(FeaturePtr theLater, FeaturePtr theCurrent) const; - /// Returns the result group identifier of the given feature (for this at least one result must + /// Returns the result group identifier of the given feature (for this at least one result must /// be created before) std::string featureResultGroup(FeaturePtr theFeature); diff --git a/src/Model/Model_ResultBody.cpp b/src/Model/Model_ResultBody.cpp index 80bce61ab..0cd0fd5d2 100644 --- a/src/Model/Model_ResultBody.cpp +++ b/src/Model/Model_ResultBody.cpp @@ -63,7 +63,7 @@ bool Model_ResultBody::isConcealed() if (aResult) { // hidden unit must be redisplayed (hidden) ModelAPI_EventCreator::get()->sendDeleted(document(), this->groupName()); // redisplay for the viewer (it must be disappeared also) - static Events_ID EVENT_DISP = + static Events_ID EVENT_DISP = Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY); ModelAPI_EventCreator::get()->sendUpdated(data()->owner(), EVENT_DISP); } else { // was not concealed become concealed => delete event diff --git a/src/Model/Model_ResultBody.h b/src/Model/Model_ResultBody.h index e0ae33367..1cc546efb 100644 --- a/src/Model/Model_ResultBody.h +++ b/src/Model/Model_ResultBody.h @@ -25,7 +25,7 @@ */ class Model_ResultBody : public ModelAPI_ResultBody { - /// builders that tores the naming history: one per label to allow store several shapes to one + /// builders that tores the naming history: one per label to allow store several shapes to one /// label; index in vector corresponds to the label tag //std::vector myBuilders; diff --git a/src/Model/Model_ResultCompSolid.cpp b/src/Model/Model_ResultCompSolid.cpp index 687b0ea08..aa771929e 100755 --- a/src/Model/Model_ResultCompSolid.cpp +++ b/src/Model/Model_ResultCompSolid.cpp @@ -79,13 +79,13 @@ void Model_ResultCompSolid::colorConfigInfo(std::string& theSection, std::string theDefault = DEFAULT_COLOR(); } -bool Model_ResultCompSolid::setDisabled(std::shared_ptr theThis, +bool Model_ResultCompSolid::setDisabled(std::shared_ptr theThis, const bool theFlag) { bool aChanged = ModelAPI_ResultBody::setDisabled(theThis, theFlag); if (aChanged) { // state is changed, so modifications are needed myBuilder->evolutionToSelection(theFlag); - updateSubs(shape()); // to set disabled/enabled + updateSubs(shape()); // to set disabled/enabled } return aChanged; } @@ -113,7 +113,7 @@ bool Model_ResultCompSolid::isConcealed() if (aResult) { // hidden unit must be redisplayed (hidden) ModelAPI_EventCreator::get()->sendDeleted(document(), (*aSubIter)->groupName()); // redisplay for the viewer (it must be disappeared also) - static Events_ID EVENT_DISP = + static Events_ID EVENT_DISP = Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY); ModelAPI_EventCreator::get()->sendUpdated(*aSubIter, EVENT_DISP); } else { // was not concealed become concealed => delete event @@ -135,7 +135,7 @@ void Model_ResultCompSolid::setIsConcealed(const bool theValue) if (theValue) { // hidden unit must be redisplayed (hidden) ModelAPI_EventCreator::get()->sendDeleted(document(), (*aSubIter)->groupName()); // redisplay for the viewer (it must be disappeared also) - static Events_ID EVENT_DISP = + static Events_ID EVENT_DISP = Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY); ModelAPI_EventCreator::get()->sendUpdated(*aSubIter, EVENT_DISP); } else { // was not concealed become concealed => delete event diff --git a/src/Model/Model_ResultConstruction.cpp b/src/Model/Model_ResultConstruction.cpp index c1fea0708..d48fd305b 100644 --- a/src/Model/Model_ResultConstruction.cpp +++ b/src/Model/Model_ResultConstruction.cpp @@ -53,7 +53,7 @@ void Model_ResultConstruction::setIsInHistory(const bool isInHistory) int Model_ResultConstruction::facesNum() { if (!myFacesUpToDate) { - std::shared_ptr aWirePtr = + std::shared_ptr aWirePtr = std::dynamic_pointer_cast(myShape); if (aWirePtr.get()) { std::list > aFaces; diff --git a/src/Model/Model_ResultPart.cpp b/src/Model/Model_ResultPart.cpp index 0a4422ad1..74e2b22a1 100644 --- a/src/Model/Model_ResultPart.cpp +++ b/src/Model/Model_ResultPart.cpp @@ -65,11 +65,11 @@ void Model_ResultPart::activate() } std::shared_ptr aDocRef = data()->document(DOC_REF()); - + // activation may cause changes in current features in document, so it must be in transaction bool isNewTransaction = false; SessionPtr aMgr = ModelAPI_Session::get(); - if (!aMgr->isOperation()) { + if (!aMgr->isOperation()) { // open transaction even document is not created to set current docs in setActiveDocument aMgr->startOperation("Activation"); isNewTransaction = true; @@ -103,7 +103,7 @@ std::shared_ptr Model_ResultPart::original() return std::dynamic_pointer_cast(data()->owner()); } -bool Model_ResultPart::isActivated() +bool Model_ResultPart::isActivated() { if (myTrsf.get()) { if (!baseRef().get()) // may be on close @@ -244,7 +244,7 @@ std::string Model_ResultPart::nameInPart(const std::shared_ptr& t if (!aDoc.get()) // the part document is not presented for the moment return ""; TDF_Label anAccessLabel = aDoc->generalLabel(); - // make the selection attribute anyway: + // make the selection attribute anyway: // otherwise just by name it is not stable to search the result std::string aName; // for this the context result is needed @@ -356,7 +356,7 @@ void Model_ResultPart::updateShape() myTrsf.reset(); } -void Model_ResultPart::setTrsf(std::shared_ptr theThis, +void Model_ResultPart::setTrsf(std::shared_ptr theThis, const std::shared_ptr& theTransformation) { updateShape(); diff --git a/src/Model/Model_ResultPart.h b/src/Model/Model_ResultPart.h index fabaacab5..6657705d5 100644 --- a/src/Model/Model_ResultPart.h +++ b/src/Model/Model_ResultPart.h @@ -22,9 +22,9 @@ class Model_ResultPart : public ModelAPI_ResultPart { /// shape of this part created from bodies (updated only of Part deactivation) - TopoDS_Shape myShape; + TopoDS_Shape myShape; /// if it is just copy of original shape, keep just transformation - std::shared_ptr myTrsf; + std::shared_ptr myTrsf; public: /// the reference to the base result document, may be null if this is the root, @@ -39,7 +39,7 @@ class Model_ResultPart : public ModelAPI_ResultPart /// Returns the part-document of this result MODEL_EXPORT virtual std::shared_ptr partDoc(); - /// Returns the original part result: for transfomration features results this is + /// Returns the original part result: for transfomration features results this is /// the original Part feature result MODEL_EXPORT virtual std::shared_ptr original(); @@ -68,7 +68,7 @@ class Model_ResultPart : public ModelAPI_ResultPart /// Updates the shape-result of the part (called on Part feature execution) MODEL_EXPORT virtual void updateShape(); /// Applies the additional transformation of the part - MODEL_EXPORT virtual void setTrsf(std::shared_ptr theThis, + MODEL_EXPORT virtual void setTrsf(std::shared_ptr theThis, const std::shared_ptr& theTransformation); /// Returns the parameters of color definition in the resources config manager diff --git a/src/Model/Model_SelectionNaming.cpp b/src/Model/Model_SelectionNaming.cpp index 72a660ccb..39b32c5e4 100644 --- a/src/Model/Model_SelectionNaming.cpp +++ b/src/Model/Model_SelectionNaming.cpp @@ -52,14 +52,14 @@ std::string Model_SelectionNaming::getShapeName( ResultPtr& theContext, const bool theAnotherDoc, const bool theWholeContext) { std::string aName; - // add the result name to the name of the shape + // add the result name to the name of the shape // (it was in BodyBuilder, but did not work on Result rename) bool isNeedContextName = theContext->shape().get() != NULL; // && !theContext->shape()->isEqual(theSubSh); // check if the subShape is already in DF Handle(TNaming_NamedShape) aNS = TNaming_Tool::NamedShape(theShape, myLab); Handle(TDataStd_Name) anAttr; - if(!aNS.IsNull() && !aNS->IsEmpty()) { // in the document + if(!aNS.IsNull() && !aNS->IsEmpty()) { // in the document if(aNS->Label().FindAttribute(TDataStd_Name::GetID(), anAttr)) { std::shared_ptr aData = std::dynamic_pointer_cast(theContext->data()); @@ -67,7 +67,7 @@ std::string Model_SelectionNaming::getShapeName( // do nothing because this context name will be added later in this method } else { aName = TCollection_AsciiString(anAttr->Get()).ToCString(); - // indexes are added to sub-shapes not primitives + // indexes are added to sub-shapes not primitives // (primitives must not be located at the same label) if(!aName.empty() && aNS->Evolution() != TNaming_PRIMITIVE && isNeedContextName) { const TDF_Label& aLabel = aNS->Label();//theDoc->findNamingName(aName); @@ -143,18 +143,18 @@ std::string Model_SelectionNaming::namingName(ResultPtr& theContext, const bool theAnotherDoc) { std::string aName("Undefined name"); - if(!theContext.get() || theContext->shape()->isNull()) + if(!theContext.get() || theContext->shape()->isNull()) return !theDefaultName.empty() ? theDefaultName : aName; - + // if it is in result of another part - std::shared_ptr aDoc = + std::shared_ptr aDoc = std::dynamic_pointer_cast(theContext->document()); if (theContext->groupName() == ModelAPI_ResultPart::group()) { ResultPartPtr aPart = std::dynamic_pointer_cast(theContext); int anIndex; if (theSubSh.get()) return aPart->data()->name() + "/" + aPart->nameInPart(theSubSh, anIndex); - else + else return aPart->data()->name(); } @@ -173,24 +173,24 @@ std::string Model_SelectionNaming::namingName(ResultPtr& theContext, BRepTools::Write(aContext, "Context.brep"); } #endif - aName = getShapeName(aDoc, aSubShape, theContext, theAnotherDoc, + aName = getShapeName(aDoc, aSubShape, theContext, theAnotherDoc, theContext->shape()->isEqual(theSubSh)); if(aName.empty() ) { // not in the document! TopAbs_ShapeEnum aType = aSubShape.ShapeType(); switch (aType) { case TopAbs_FACE: - // the Face should be in DF. If it is not the case, it is an error ==> to be debugged + // the Face should be in DF. If it is not the case, it is an error ==> to be debugged break; case TopAbs_EDGE: { // name structure: F1 & F2 [& F3 & F4], // where F1 & F2 the faces which gives the Edge in trivial case - // if it is not atrivial case we use localization by neighbours. F3 & F4 - neighbour faces + // if it is not atrivial case we use localization by neighbours. F3 & F4 - neighbour faces if (BRep_Tool::Degenerated(TopoDS::Edge(aSubShape))) { aName = "Degenerated_Edge"; break; - } + } TopTools_IndexedDataMapOfShapeListOfShape aMap; TopExp::MapShapesAndAncestors(aContext, TopAbs_EDGE, TopAbs_FACE, aMap); TopTools_IndexedMapOfShape aSMap; // map for ancestors of the sub-shape @@ -198,8 +198,8 @@ std::string Model_SelectionNaming::namingName(ResultPtr& theContext, if(aMap.Contains(aSubShape)) { const TopTools_ListOfShape& anAncestors = aMap.FindFromKey(aSubShape); // check that it is not a trivial case (F1 & F2: aNumber = 1) - isTrivialCase = isTrivial(anAncestors, aSMap); - } else + isTrivialCase = isTrivial(anAncestors, aSMap); + } else break; TopTools_ListOfShape aListOfNbs; if(!isTrivialCase) { // find Neighbors @@ -226,27 +226,27 @@ std::string Model_SelectionNaming::namingName(ResultPtr& theContext, std::string aFaceName = getShapeName(aDoc, aFace, theContext, theAnotherDoc, false); if(i == 1) aName = aFaceName; - else + else aName += "&" + aFaceName; } TopTools_ListIteratorOfListOfShape itl(aListOfNbs); for (;itl.More();itl.Next()) { std::string aFaceName = getShapeName(aDoc, itl.Value(), theContext, theAnotherDoc, false); aName += "&" + aFaceName; - } + } } break; case TopAbs_VERTEX: - // name structure (Monifold Topology): + // name structure (Monifold Topology): // 1) F1 | F2 | F3 - intersection of 3 faces defines a vertex - trivial case. - // 2) F1 | F2 | F3 [|F4 [|Fn]] - redundant definition, + // 2) F1 | F2 | F3 [|F4 [|Fn]] - redundant definition, // but it should be kept as is to obtain safe recomputation // 2) F1 | F2 - intersection of 2 faces definses a vertex - applicable for case // when 1 faces is cylindrical, conical, spherical or revolution and etc. // 3) E1 | E2 | E3 - intersection of 3 edges defines a vertex - when we have case of a shell // or compound of 2 open faces. - // 4) E1 | E2 - intesection of 2 edges defines a vertex - when we have a case of + // 4) E1 | E2 - intesection of 2 edges defines a vertex - when we have a case of // two independent edges (wire or compound) // implemented 2 first cases { @@ -289,14 +289,14 @@ std::string Model_SelectionNaming::namingName(ResultPtr& theContext, } if(i == 1) aName = anEdgeName; - else + else aName += "&" + anEdgeName; } }//reg else { // dangle vertex: if(aList22.Extent() == 1) //it should be already in DF } - } + } if (isByFaces) { TopTools_ListIteratorOfListOfShape itl(aList); for (int i = 1;itl.More();itl.Next(),i++) { @@ -304,7 +304,7 @@ std::string Model_SelectionNaming::namingName(ResultPtr& theContext, std::string aFaceName = getShapeName(aDoc, aFace, theContext, theAnotherDoc, false); if(i == 1) aName = aFaceName; - else + else aName += "&" + aFaceName; } } @@ -357,7 +357,7 @@ TopAbs_ShapeEnum translateType (const std::string& theType) } if (aShapeTypes.find(theType) != aShapeTypes.end()) return aShapeTypes[theType]; - Events_InfoMessage("Model_SelectionNaming", + Events_InfoMessage("Model_SelectionNaming", "Shape type defined in XML is not implemented!").send(); return TopAbs_SHAPE; } @@ -366,12 +366,12 @@ const TopoDS_Shape getShapeFromNS( const std::string& theSubShapeName, Handle(TNaming_NamedShape) theNS) { TopoDS_Shape aSelection; - std::string::size_type n = theSubShapeName.rfind('/'); + std::string::size_type n = theSubShapeName.rfind('/'); if (n == std::string::npos) n = -1; std::string aSubString = theSubShapeName.substr(n + 1); n = aSubString.rfind('_'); int indx = 1; - if (n != std::string::npos) {// for primitives this is a first + if (n != std::string::npos) {// for primitives this is a first // if we have here the same name as theSubShapeName, there is no index in compound, it is whole Handle(TDataStd_Name) aName; if (!theNS->Label().FindAttribute(TDataStd_Name::GetID(), aName) || @@ -387,14 +387,14 @@ const TopoDS_Shape getShapeFromNS( return anItL.NewShape(); } } - return aSelection; + return aSelection; } const TopoDS_Shape findFaceByName( const std::string& theSubShapeName, std::shared_ptr theDoc) { TopoDS_Shape aFace; - //std::string::size_type n, nb = theSubShapeName.rfind('/'); + //std::string::size_type n, nb = theSubShapeName.rfind('/'); //if (nb == std::string::npos) nb = 0; //std::string aSubString = theSubShapeName.substr(nb + 1); std::string aSubString = theSubShapeName; @@ -422,7 +422,7 @@ size_t ParseName(const std::string& theSubShapeName, std::list& t size_t n1(0), n2(0); // n1 - start position, n2 - position of the delimiter while ((n2 = aName.find('&', n1)) != std::string::npos) { const std::string aName1 = aName.substr(n1, n2 - n1); //name of face - theList.push_back(aName1); + theList.push_back(aName1); n1 = n2 + 1; aLastName = aName.substr(n1); } @@ -453,7 +453,7 @@ const TopoDS_Shape findCommonShape( //fill maps TopTools_ListIteratorOfListOfShape it(theList); for(int i = 0;it.More();it.Next(),i++) { - const TopoDS_Shape& aFace = it.Value(); + const TopoDS_Shape& aFace = it.Value(); if(i < 2) { TopExp_Explorer anExp (aFace, theType); for(;anExp.More();anExp.Next()) { @@ -478,11 +478,11 @@ const TopoDS_Shape findCommonShape( aShape = it2.Key(); if(theList.Extent() == 2) break; - else + else aList.Append(it2.Key()); } } - if(aList.Extent() && aVec.size() > 3) {// list of common edges ==> search ny neighbors + if(aList.Extent() && aVec.size() > 3) {// list of common edges ==> search ny neighbors if(aVec[2].Extent() && aVec[3].Extent()) { TopTools_ListIteratorOfListOfShape it(aList); for(;it.More();it.Next()) { @@ -520,17 +520,17 @@ const TopoDS_Shape findCommonShape( std::string getContextName(const std::string& theSubShapeName) { std::string aName; - std::string::size_type n = theSubShapeName.find('/'); + std::string::size_type n = theSubShapeName.find('/'); if (n == std::string::npos) return theSubShapeName; aName = theSubShapeName.substr(0, n); return aName; } -/// Parses naming name of sketch sub-elements: takes indices and orientation -/// (if theOriented = true) from this name. Map theIDs constains indices -> +/// Parses naming name of sketch sub-elements: takes indices and orientation +/// (if theOriented = true) from this name. Map theIDs constains indices -> /// orientations and start/end vertices: negative is reversed, 2 - start, 3 - end bool parseSubIndices(CompositeFeaturePtr theComp, //< to iterate names - const std::string& theName, const char* theShapeType, + const std::string& theName, const char* theShapeType, std::map& theIDs, const bool theOriented = false) { // collect all IDs in the name @@ -542,7 +542,7 @@ bool parseSubIndices(CompositeFeaturePtr theComp, //< to iterate names std::list >::const_iterator aRes = aResults.cbegin(); // there may be many shapes (circle and center) for(; aRes != aResults.cend(); aRes++) { - ResultConstructionPtr aConstr = + ResultConstructionPtr aConstr = std::dynamic_pointer_cast(*aRes); if (aConstr.get()) { aNames[Model_SelectionNaming::shortName(aConstr)] = theComp->subFeatureId(a); @@ -590,27 +590,27 @@ int Model_SelectionNaming::edgeOrientation(const TopoDS_Shape& theContext, TopoD { if (theContext.ShapeType() != TopAbs_FACE && theContext.ShapeType() != TopAbs_WIRE) return 0; - if (theEdge.Orientation() == TopAbs_FORWARD) + if (theEdge.Orientation() == TopAbs_FORWARD) return 1; - if (theEdge.Orientation() == TopAbs_REVERSED) + if (theEdge.Orientation() == TopAbs_REVERSED) return -1; return 0; // unknown } std::shared_ptr Model_SelectionNaming::findAppropriateFace( - std::shared_ptr& theConstr, + std::shared_ptr& theConstr, NCollection_DataMap& theCurves, const bool theIsWire) { int aBestFound = 0; // best number of found edges (not percentage: issue 1019) int aBestOrient = 0; // for the equal "BestFound" additional parameter is orientation std::shared_ptr aResult; - ResultConstructionPtr aConstructionContext = + ResultConstructionPtr aConstructionContext = std::dynamic_pointer_cast(theConstr); if (!aConstructionContext.get()) return aResult; for(int aFaceIndex = 0; aFaceIndex < aConstructionContext->facesNum(); aFaceIndex++) { int aFound = 0, aNotFound = 0, aSameOrientation = 0; - TopoDS_Face aFace = + TopoDS_Face aFace = TopoDS::Face(aConstructionContext->face(aFaceIndex)->impl()); std::list aFacesWires; // faces or wires to iterate if (theIsWire) { @@ -645,7 +645,7 @@ std::shared_ptr Model_SelectionNaming::findAppropriateFace( } } if (aFound + aNotFound != 0) { - if (aFound > aBestFound || + if (aFound > aBestFound || (aFound == aBestFound && aSameOrientation > aBestOrient)) { aBestFound = aFound; aBestOrient = aSameOrientation; @@ -689,7 +689,7 @@ std::string Model_SelectionNaming::shortName( } // type ::= COMP | COMS | SOLD | SHEL | FACE | WIRE | EDGE | VERT -bool Model_SelectionNaming::selectSubShape(const std::string& theType, +bool Model_SelectionNaming::selectSubShape(const std::string& theType, const std::string& theSubShapeName, std::shared_ptr theDoc, std::shared_ptr& theShapeToBeSelected, std::shared_ptr& theCont) { @@ -717,7 +717,7 @@ bool Model_SelectionNaming::selectSubShape(const std::string& theType, } } } - if (aDoc != theDoc) { + if (aDoc != theDoc) { // so, the first word is the document name => reduce the string for the next manips aSubShapeName = theSubShapeName.substr(aSlash + 1); if (aSubShapeName.empty() && aFoundPart.get()) { // the whole Part result @@ -733,7 +733,7 @@ bool Model_SelectionNaming::selectSubShape(const std::string& theType, // possible this is body where postfix is added to distinguish several shapes on the same label int aSubShapeId = -1; // -1 means sub shape not found // for result body the name wihtout "_" has higher priority than with it: it is always added - if ((!aCont.get()/* || (aCont->groupName() == ModelAPI_ResultBody::group())*/) && + if ((!aCont.get()/* || (aCont->groupName() == ModelAPI_ResultBody::group())*/) && aContName == aSubShapeName) { size_t aPostIndex = aContName.rfind('_'); if (aPostIndex != std::string::npos) { @@ -756,7 +756,7 @@ bool Model_SelectionNaming::selectSubShape(const std::string& theType, TopoDS_Shape aSelection; - switch (aType) + switch (aType) { case TopAbs_FACE: case TopAbs_WIRE: @@ -765,7 +765,7 @@ bool Model_SelectionNaming::selectSubShape(const std::string& theType, } break; case TopAbs_EDGE: - { + { const TDF_Label& aLabel = aDoc->findNamingName(aSubShapeName); if(!aLabel.IsNull()) { Handle(TNaming_NamedShape) aNS; @@ -791,7 +791,7 @@ bool Model_SelectionNaming::selectSubShape(const std::string& theType, case TopAbs_SOLID: case TopAbs_SHELL: default: {//TopAbs_SHAPE - /// case when the whole sketch is selected, so, + /// case when the whole sketch is selected, so, /// selection type is compound, but there is no value if (aCont.get() && aCont->shape().get()) { if (aCont->shape()->impl().ShapeType() == aType) { @@ -824,7 +824,7 @@ bool Model_SelectionNaming::selectSubShape(const std::string& theType, for(; it != aListofNames.end(); it++){ const TopoDS_Shape aFace = findFaceByName(*it, aDoc); if(!aFace.IsNull()) - aList.Append(aFace); + aList.Append(aFace); } aSelection = findCommonShape(aType, aList); } @@ -844,13 +844,13 @@ bool Model_SelectionNaming::selectSubShape(const std::string& theType, return true; } // for sketch sub-elements selected - CompositeFeaturePtr aComposite = + CompositeFeaturePtr aComposite = std::dynamic_pointer_cast(aDoc->feature(aConstr)); if (aComposite.get()) { if (aType == TopAbs_VERTEX || aType == TopAbs_EDGE) { // collect all IDs in the name std::map anIDs; - if (!parseSubIndices(aComposite, aSubShapeName, + if (!parseSubIndices(aComposite, aSubShapeName, aType == TopAbs_EDGE ? "Edge" : "Vertex", anIDs)) return false; @@ -863,7 +863,7 @@ bool Model_SelectionNaming::selectSubShape(const std::string& theType, std::list >::const_iterator aRIt = aResults.cbegin(); // there may be many shapes (circle and center) for(; aRIt != aResults.cend(); aRIt++) { - ResultConstructionPtr aRes = + ResultConstructionPtr aRes = std::dynamic_pointer_cast(*aRIt); if (aRes) { int anOrientation = abs(anIDs[aCompID]); @@ -892,12 +892,12 @@ bool Model_SelectionNaming::selectSubShape(const std::string& theType, // sketch faces is identified by format "Sketch_1/Face-2f-8f-11r" } else if (aType == TopAbs_FACE || aType == TopAbs_WIRE) { std::map anIDs; - if (!parseSubIndices(aComposite, aSubShapeName, + if (!parseSubIndices(aComposite, aSubShapeName, aType == TopAbs_FACE ? "Face" : "Wire", anIDs, true)) return false; // curves and orientations of edges - NCollection_DataMap allCurves; + NCollection_DataMap allCurves; const int aSubNum = aComposite->numberOfSubs(); for(int a = 0; a < aSubNum; a++) { int aSubID = aComposite->subFeatureId(a); @@ -906,7 +906,7 @@ bool Model_SelectionNaming::selectSubShape(const std::string& theType, const std::list >& aResults = aSub->results(); std::list >::const_iterator aRes; for(aRes = aResults.cbegin(); aRes != aResults.cend(); aRes++) { - ResultConstructionPtr aConstr = + ResultConstructionPtr aConstr = std::dynamic_pointer_cast(*aRes); if (aConstr->shape() && aConstr->shape()->isEdge()) { const TopoDS_Shape& aResShape = aConstr->shape()->impl(); @@ -926,7 +926,7 @@ bool Model_SelectionNaming::selectSubShape(const std::string& theType, theShapeToBeSelected = aFoundFW; return true; } - } else if (aType == TopAbs_WIRE) { + } else if (aType == TopAbs_WIRE) { // sketch faces is identified by format "Sketch_1/Face-2f-8f-11r" std::map anIDs; if (!parseSubIndices(aComposite, aSubShapeName, "Wire", anIDs)) @@ -942,7 +942,7 @@ bool Model_SelectionNaming::selectSubShape(const std::string& theType, const std::list >& aResults = aSub->results(); std::list >::const_iterator aRes; for(aRes = aResults.cbegin(); aRes != aResults.cend(); aRes++) { - ResultConstructionPtr aConstr = + ResultConstructionPtr aConstr = std::dynamic_pointer_cast(*aRes); if (aConstr->shape() && aConstr->shape()->isEdge()) { const TopoDS_Shape& aResShape = aConstr->shape()->impl(); @@ -956,7 +956,7 @@ bool Model_SelectionNaming::selectSubShape(const std::string& theType, } } } - std::shared_ptr aFoundFW = + std::shared_ptr aFoundFW = findAppropriateFace(aConstr, allCurves, aType == TopAbs_WIRE); if (aFoundFW.get()) { theShapeToBeSelected = aFoundFW; @@ -967,7 +967,7 @@ bool Model_SelectionNaming::selectSubShape(const std::string& theType, } } if (!aSelection.IsNull()) { - // Select it (must be after N=0 checking, + // Select it (must be after N=0 checking, // since for simple constructions the shape must be null) std::shared_ptr aShapeToBeSelected(new GeomAPI_Shape()); aShapeToBeSelected->setImpl(new TopoDS_Shape(aSelection)); diff --git a/src/Model/Model_SelectionNaming.h b/src/Model/Model_SelectionNaming.h index f97e284fd..e9973deb3 100644 --- a/src/Model/Model_SelectionNaming.h +++ b/src/Model/Model_SelectionNaming.h @@ -31,7 +31,7 @@ public: /// Produces the string-name for the selected shape std::string namingName(ResultPtr& theContext, std::shared_ptr theSubSh, const std::string& theDefaultName, const bool theAnotherDoc); - + /// Makes a selection by the string-name /// \param theType string of the type of the shape /// \param theSubShapeName string-identifier of the selected shape @@ -42,16 +42,16 @@ public: std::shared_ptr theDoc, std::shared_ptr& theShapeToBeSelected, std::shared_ptr& theCont); - /// Searches the face more appropriate to the given curves + /// Searches the face more appropriate to the given curves /// (with higher level of matched parameters) /// \param theConstr construction result that contains one or several faces - /// \param theCurves map from the face edges curves to orientation + /// \param theCurves map from the face edges curves to orientation /// (-1 reversed, 0 unknown, 1 forward) - /// \param theIsWire for wire algorithm isquite the same, + /// \param theIsWire for wire algorithm isquite the same, /// but if in face several wires, it returns the needed wire /// \returns faces fron this construction if found static std::shared_ptr findAppropriateFace( - std::shared_ptr& theConstr, + std::shared_ptr& theConstr, NCollection_DataMap& theCurves, const bool theIsWire); /// Returns orientation of the edge in the context shape diff --git a/src/Model/Model_Session.cpp b/src/Model/Model_Session.cpp index 567dba4d4..75cb32ee0 100644 --- a/src/Model/Model_Session.cpp +++ b/src/Model/Model_Session.cpp @@ -191,7 +191,7 @@ std::shared_ptr Model_Session::moduleDocument() Handle(Model_Application) anApp = Model_Application::getApplication(); bool aFirstCall = !anApp->hasRoot(); if (aFirstCall) { - // to be sure that plugins are loaded, + // to be sure that plugins are loaded, // even before the first "createFeature" call (in unit tests) LoadPluginsInfo(); // creation of the root document is always outside of the transaction, so, avoid checking it @@ -343,7 +343,7 @@ Model_Session::Model_Session() ModelAPI_Session::setSession(std::shared_ptr(this)); // register the configuration reading listener Events_Loop* aLoop = Events_Loop::loop(); - static const Events_ID kFeatureEvent = + static const Events_ID kFeatureEvent = Events_Loop::eventByName(Config_FeatureMessage::MODEL_EVENT()); aLoop->registerListener(this, kFeatureEvent); aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_CREATED), 0, true); @@ -354,11 +354,11 @@ Model_Session::Model_Session() void Model_Session::processEvent(const std::shared_ptr& theMessage) { - static const Events_ID kFeatureEvent = + static const Events_ID kFeatureEvent = Events_Loop::eventByName(Config_FeatureMessage::MODEL_EVENT()); static const Events_ID kValidatorEvent = Events_Loop::eventByName(EVENT_VALIDATOR_LOADED); if (theMessage->eventID() == kFeatureEvent) { - const std::shared_ptr aMsg = + const std::shared_ptr aMsg = std::dynamic_pointer_cast(theMessage); if (aMsg) { @@ -368,7 +368,7 @@ void Model_Session::processEvent(const std::shared_ptr& theMessa aMsg->pluginLibrary(), aMsg->documentKind()); } } else { - const std::shared_ptr aMsgAttr = + const std::shared_ptr aMsgAttr = std::dynamic_pointer_cast(theMessage); if (aMsgAttr) { @@ -387,7 +387,7 @@ void Model_Session::processEvent(const std::shared_ptr& theMessa // plugins information was started to load, so, it will be loaded myPluginsInfoLoaded = true; } else if (theMessage->eventID() == kValidatorEvent) { - std::shared_ptr aMsg = + std::shared_ptr aMsg = std::dynamic_pointer_cast(theMessage); if (aMsg) { if (aMsg->attributeId().empty()) { // feature validator @@ -406,7 +406,7 @@ void Model_Session::processEvent(const std::shared_ptr& theMessa if (theMessage->eventID() == kDeletedEvent) { std::shared_ptr aDeleted = std::dynamic_pointer_cast(theMessage); - if (aDeleted && + if (aDeleted && aDeleted->groups().find(ModelAPI_ResultPart::group()) != aDeleted->groups().end()) { // check that the current feature of the session is still the active Part (even disabled) diff --git a/src/Model/Model_Session.h b/src/Model/Model_Session.h index 09a79a3d2..2afa84a26 100644 --- a/src/Model/Model_Session.h +++ b/src/Model/Model_Session.h @@ -26,13 +26,13 @@ class Model_Session : public ModelAPI_Session, public Events_Listener { bool myPluginsInfoLoaded; ///< it true if plugins information is loaded /// map of feature IDs to plugin name and document kind - std::map > myPlugins; + std::map > myPlugins; std::map myPluginObjs; ///< instances of the already plugins std::string myCurrentPluginName; ///< name of the plugin that must be loaded currently std::shared_ptr myCurrentDoc; ///< current working document - + /// if true, generates error if document is updated outside of transaction - bool myCheckTransactions; + bool myCheckTransactions; bool myOperationAttachedToNext; ///< the current operation must be committed twice, with nested public: @@ -52,14 +52,14 @@ class Model_Session : public ModelAPI_Session, public Events_Listener //! Starts a new operation (opens a transaction) //! \param theId string-identifier of the started transaction - //! \param theAttachedToNested if it is true, - //! it means that this transaction is attached to the nested + //! \param theAttachedToNested if it is true, + //! it means that this transaction is attached to the nested //! where it is located and will be committed on the next commit with the nested MODEL_EXPORT virtual void startOperation( const std::string& theId = "", const bool theAttachedToNested = false); //! Finishes the previously started operation (closes the transaction) MODEL_EXPORT virtual void finishOperation(); - //! Aborts the operation + //! Aborts the operation MODEL_EXPORT virtual void abortOperation(); //! Returns true if operation has been started, but not yet finished or aborted MODEL_EXPORT virtual bool isOperation(); @@ -102,7 +102,7 @@ class Model_Session : public ModelAPI_Session, public Events_Listener MODEL_EXPORT virtual bool isLoadByDemand(const std::string theDocID); /// Registers the plugin that creates features. - /// It is obligatory for each plugin to call this function on loading to be found by + /// It is obligatory for each plugin to call this function on loading to be found by /// the plugin manager on call of the feature) MODEL_EXPORT virtual void registerPlugin(ModelAPI_Plugin* thePlugin); diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 0f0fb1335..31160251c 100755 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -156,7 +156,7 @@ bool Model_Update::addModified(FeaturePtr theFeature, FeaturePtr theReason) { if (theFeature->data()->execState() == ModelAPI_StateDone || theFeature->data()->execState() == ModelAPI_StateExecFailed) // fix issue 1819 theFeature->data()->execState(ModelAPI_StateMustBeUpdated); - else + else return true; // do not need iteration deeply if it is already marked as modified or so #ifdef DEB_UPDATE //std::cout<<"*** Set modified state "<name()<& theMessag std::dynamic_pointer_cast(theMessage); updateSelection(aMsg->objects()); } - // creation is added to "update" to avoid recomputation twice: + // creation is added to "update" to avoid recomputation twice: // on create and immediately after on update if (theMessage->eventID() == kCreatedEvent) { std::shared_ptr aMsg = @@ -248,7 +248,7 @@ void Model_Update::processEvent(const std::shared_ptr& theMessag std::set::const_iterator anObjIter = anObjs.cbegin(); for(; anObjIter != anObjs.cend(); anObjIter++) { if (std::dynamic_pointer_cast((*anObjIter)->document())->executeFeatures()) { - if ((*anObjIter)->groupName() == ModelAPI_Feature::group()) { + if ((*anObjIter)->groupName() == ModelAPI_Feature::group()) { // results creation means enabling, not update ModelAPI_EventCreator::get()->sendUpdated(*anObjIter, kUpdatedEvent); } else { @@ -279,9 +279,9 @@ void Model_Update::processEvent(const std::shared_ptr& theMessag if (anUpdated.get()) { if (addModified(anUpdated, FeaturePtr())) aSomeModified = true; - } else { + } else { // process the updated result as update of features that refers to this result - const std::set >& + const std::set >& aRefs = (*anObjIter)->data()->refsToMe(); std::set >::const_iterator aRefIter = aRefs.cbegin(); for(; aRefIter != aRefs.cend(); aRefIter++) { @@ -313,7 +313,7 @@ void Model_Update::processEvent(const std::shared_ptr& theMessag myIsFinish = false; } // processed features must be only on finish, so clear anyway (to avoid reimport on load) - myProcessOnFinish.clear(); + myProcessOnFinish.clear(); if (!(theMessage->eventID() == kOpStartEvent)) { processFeatures(false); @@ -338,7 +338,7 @@ void Model_Update::processEvent(const std::shared_ptr& theMessag anUpdatedIter++; } } - // the redisplay signal should be flushed in order + // the redisplay signal should be flushed in order // to erase the feature presentation in the viewer // if should be done after removeFeature() of document, // by this reason, upper processFeatures() do not perform this flush @@ -348,7 +348,7 @@ void Model_Update::processEvent(const std::shared_ptr& theMessag myIsParamUpdated = false; myWaitForFinish.clear(); } else if (theMessage->eventID() == kReorderEvent) { - std::shared_ptr aMsg = + std::shared_ptr aMsg = std::dynamic_pointer_cast(theMessage); if (aMsg->reordered().get()) addModified(aMsg->reordered(), aMsg->reordered()); // to update all attributes @@ -443,7 +443,7 @@ bool Model_Update::processFeature(FeaturePtr theFeature) myProcessed[theFeature] = 0; } else { int aCount = myProcessed[theFeature]; - if (aCount > 100) { + if (aCount > 100) { // too many repetition of processing (in VS it may crash on 330 with stack overflow) Events_InfoMessage("Model_Update", "Feature '%1' is updated in infinitive loop").arg(theFeature->data()->name()).send(); @@ -459,7 +459,7 @@ bool Model_Update::processFeature(FeaturePtr theFeature) aIsModified = true; std::set > aNewSet; // contains itself, so, we don't know which was the reason and the reason is any - aNewSet.insert(theFeature); + aNewSet.insert(theFeature); myModified[theFeature] = aNewSet; } } @@ -495,7 +495,7 @@ bool Model_Update::processFeature(FeaturePtr theFeature) return false; } - // evaluate parameter before the sub-elements update: + // evaluate parameter before the sub-elements update: // it updates dependencies on evaluation (#1085) if (theFeature->getKind() == "Parameter") { theFeature->execute(); @@ -505,12 +505,12 @@ bool Model_Update::processFeature(FeaturePtr theFeature) // check all features this feature depended on (recursive call of updateFeature) std::set& aReasons = myModified[theFeature]; bool allSubsUsed = aReasons.find(theFeature) != aReasons.end(); - if (allSubsUsed) { + if (allSubsUsed) { // add all subs in aReasons and temporary remove "theFeature" to avoid processing itself allReasons(theFeature, aReasons); aReasons.erase(theFeature); } - // take reasons one by one (they may be added during the feature process + // take reasons one by one (they may be added during the feature process // (circle by the radius of sketch) std::set aProcessedReasons; while(!aReasons.empty()) { @@ -538,7 +538,7 @@ bool Model_Update::processFeature(FeaturePtr theFeature) bool isPostponedMain = false; CompositeFeaturePtr aCompos = std::dynamic_pointer_cast(theFeature); if (theFeature->getKind() == "ExtrusionSketch" && aCompos.get()) { - CompositeFeaturePtr aCurrentOwner = + CompositeFeaturePtr aCurrentOwner = ModelAPI_Tools::compositeOwner(theFeature->document()->currentFeature(false)); isPostponedMain = aCurrentOwner.get() && aCompos->isSub(aCurrentOwner); } @@ -562,8 +562,8 @@ bool Model_Update::processFeature(FeaturePtr theFeature) // this checking must be after the composite feature sub-elements processing: // composite feature status may depend on it's subelements - if ((theFeature->data()->execState() == ModelAPI_StateInvalidArgument || isReferencedInvalid) && - theFeature->getKind() != "Part") { + if ((theFeature->data()->execState() == ModelAPI_StateInvalidArgument || isReferencedInvalid) && + theFeature->getKind() != "Part") { // don't disable Part because it will make disabled all the features // (performance and problems with the current feature) #ifdef DEB_UPDATE @@ -601,7 +601,7 @@ void Model_Update::redisplayWithResults(FeaturePtr theFeature, const ModelAPI_Ex for (; aRIter != allResults.cend(); aRIter++) { std::shared_ptr aRes = *aRIter; if (!aRes->isDisabled()) { - // update state only for enabled results + // update state only for enabled results // (Placement Result Part may make the original Part Result as invalid) aRes->data()->execState(theState); } @@ -687,7 +687,7 @@ void Model_Update::updateArguments(FeaturePtr theFeature) { for(; anIter != anAttributes.end(); anIter++) { AttributePointPtr aPointAttribute = std::dynamic_pointer_cast(*anIter); - if (aPointAttribute.get() && (!aPointAttribute->textX().empty() || + if (aPointAttribute.get() && (!aPointAttribute->textX().empty() || !aPointAttribute->textY().empty() || !aPointAttribute->textZ().empty())) { if (myIsParamUpdated) { ModelAPI_AttributeEvalMessage::send(aPointAttribute, this); @@ -708,7 +708,7 @@ void Model_Update::updateArguments(FeaturePtr theFeature) { AttributePoint2DPtr aPoint2DAttribute = std::dynamic_pointer_cast(*anIter); if (aPoint2DAttribute.get()) { - if (myIsParamUpdated && (!aPoint2DAttribute->textX().empty() || + if (myIsParamUpdated && (!aPoint2DAttribute->textX().empty() || !aPoint2DAttribute->textY().empty())) { ModelAPI_AttributeEvalMessage::send(aPoint2DAttribute, this); } @@ -719,7 +719,7 @@ void Model_Update::updateArguments(FeaturePtr theFeature) { } } // update the selection attributes if any - list aRefs = + list aRefs = theFeature->data()->attributes(ModelAPI_AttributeSelection::typeId()); list::iterator aRefsIter = aRefs.begin(); for (; aRefsIter != aRefs.end(); aRefsIter++) { @@ -779,8 +779,8 @@ void Model_Update::updateArguments(FeaturePtr theFeature) { theFeature->data()->execState(aState); } -bool Model_Update::isReason(std::shared_ptr& theFeature, - std::shared_ptr theReason) +bool Model_Update::isReason(std::shared_ptr& theFeature, + std::shared_ptr theReason) { std::map, std::set > > ::iterator aReasonsIt = myModified.find(theFeature); @@ -811,7 +811,7 @@ bool Model_Update::isReason(std::shared_ptr& theFeature, } // this case only for not-previewed items update state, nothing is changed in args for it - return false; + return false; } void Model_Update::executeFeature(FeaturePtr theFeature) @@ -834,7 +834,7 @@ void Model_Update::executeFeature(FeaturePtr theFeature) Events_InfoMessage("Model_Update", "Feature %1 has failed during the execution").arg(theFeature->getKind()).send(); } - // The macro feature has to be deleted in any case even its execution is failed + // The macro feature has to be deleted in any case even its execution is failed myWaitForFinish.insert(theFeature); if (aState != ModelAPI_StateDone) { theFeature->eraseResults(); @@ -850,10 +850,10 @@ void Model_Update::updateStability(void* theSender) bool added = false; // object may be was crated ModelAPI_Object* aSender = static_cast(theSender); if (aSender && aSender->document()) { - FeaturePtr aFeatureSender = + FeaturePtr aFeatureSender = std::dynamic_pointer_cast(aSender->data()->owner()); if (aFeatureSender.get()) { - Model_Objects* aDocObjects = + Model_Objects* aDocObjects = std::dynamic_pointer_cast(aSender->document())->objects(); if (aDocObjects) { //aDocObjects->synchronizeBackRefs(); @@ -864,17 +864,17 @@ void Model_Update::updateStability(void* theSender) aRefIt = aRefs.begin(); for(; aRefIt != aRefs.end(); aRefIt++) { if (!aFactory->isConcealed(aFeatureSender->getKind(), aRefIt->first)) - // take into account only concealed references + // take into account only concealed references // (do not remove the sketch constraint and the edge on constraint edit) - continue; + continue; std::list& aRefFeaturesList = aRefIt->second; std::list::iterator aReferenced = aRefFeaturesList.begin(); for(; aReferenced != aRefFeaturesList.end(); aReferenced++) { - // stability is only on results: feature to feature reference mean nested + // stability is only on results: feature to feature reference mean nested // features, that will remove nesting references - if (aReferenced->get() && (*aReferenced)->data()->isValid() && + if (aReferenced->get() && (*aReferenced)->data()->isValid() && (*aReferenced)->groupName() != ModelAPI_Feature::group()) { - std::shared_ptr aData = + std::shared_ptr aData = std::dynamic_pointer_cast((*aReferenced)->data()); if (aFeatureSender->isStable()) { aData->addBackReference(aFeatureSender, aRefIt->first); @@ -900,7 +900,7 @@ void Model_Update::updateSelection(const std::set >::iterator anObj = theObjects.begin(); for(; anObj != theObjects.end(); anObj++) { - list aRefs = + list aRefs = (*anObj)->data()->attributes(ModelAPI_AttributeSelection::typeId()); list::iterator aRefsIter = aRefs.begin(); for (; aRefsIter != aRefs.end(); aRefsIter++) { diff --git a/src/Model/Model_Update.h b/src/Model/Model_Update.h index c5f277138..1e4968827 100644 --- a/src/Model/Model_Update.h +++ b/src/Model/Model_Update.h @@ -30,7 +30,7 @@ class Model_Update : public Events_Listener std::map, std::set > > myModified; /// Features which arguments were modified by not-persistent changes. - /// So, these referencing arguments must be updated + /// So, these referencing arguments must be updated /// due to these features info also before execution). std::map, std::set > > myNotPersistentRefs; @@ -46,7 +46,7 @@ class Model_Update : public Events_Listener std::set > myProcessOnFinish; /// to avoid infinitive cycling: feature -> count of the processing periods during this update std::map, int > myProcessed; - /// if preview in hte property panel is blocked and + /// if preview in hte property panel is blocked and /// any update is postponed until the end of operation bool myIsPreviewBlocked; @@ -74,7 +74,7 @@ protected: void updateArguments(std::shared_ptr theFeature); /// Sends the redisplay events for feature and results, updates the updated status - void redisplayWithResults(std::shared_ptr theFeature, + void redisplayWithResults(std::shared_ptr theFeature, const ModelAPI_ExecState theState); /// On operation start/end/abort the "Just" fileds must be cleared and processed in the right way @@ -88,7 +88,7 @@ protected: /// Updates the properties of object because of stability state changes void updateStability(void* theSender); - /// Returns true if theFeature modification was caused by theReason + /// Returns true if theFeature modification was caused by theReason /// (may be feature of result of this feature) bool isReason( std::shared_ptr& theFeature, std::shared_ptr theReason); diff --git a/src/Model/Model_Validator.cpp b/src/Model/Model_Validator.cpp index 0aa279fcb..0b7a6ea3a 100644 --- a/src/Model/Model_Validator.cpp +++ b/src/Model/Model_Validator.cpp @@ -35,7 +35,7 @@ void Model_ValidatorsFactory::assignValidator(const std::string& theID, myFeatures[theFeatureID] = AttrValidators(); } if (myFeatures[theFeatureID].find(theID) != myFeatures[theFeatureID].end()) { - //Events_Error::send(std::string("Validator ") + theID + + //Events_Error::send(std::string("Validator ") + theID + // " for feature " + theFeatureID + "is already registered"); } else { myFeatures[theFeatureID][theID] = std::list(); @@ -51,7 +51,7 @@ void Model_ValidatorsFactory::assignValidator(const std::string& theID, } if (myFeatures[theFeatureID].find(theID) != myFeatures[theFeatureID].end()) { - //Events_Error::send(std::string("Validator ") + theID + + //Events_Error::send(std::string("Validator ") + theID + // " for feature " + theFeatureID + "is already registered"); } else { myFeatures[theFeatureID][theID] = theArguments; @@ -81,7 +81,7 @@ void Model_ValidatorsFactory::assignValidator(const std::string& theID, void Model_ValidatorsFactory::validators(const std::string& theFeatureID, Validators& theValidators) const { - std::map::const_iterator aFeatureIt = + std::map::const_iterator aFeatureIt = myFeatures.find(theFeatureID); if (aFeatureIt != myFeatures.cend()) { AttrValidators::const_iterator aValidatorsIt = aFeatureIt->second.cbegin(); @@ -97,11 +97,11 @@ void Model_ValidatorsFactory::validators(const std::string& theFeatureID, addDefaultValidators(theValidators); } -void Model_ValidatorsFactory::validators(const std::string& theFeatureID, +void Model_ValidatorsFactory::validators(const std::string& theFeatureID, const std::string& theAttrID, Validators& theValidators) const { - std::map >::const_iterator aFeatureIt = + std::map >::const_iterator aFeatureIt = myAttrs.find(theFeatureID); if (aFeatureIt != myAttrs.cend()) { std::map::const_iterator anAttrIt = @@ -177,7 +177,7 @@ bool Model_ValidatorsFactory::validate(const std::shared_ptr& // Events_Error::send(std::string("Validator ") + aValidatorID + " was not registered"); // continue; //} - const ModelAPI_FeatureValidator* aFValidator = + const ModelAPI_FeatureValidator* aFValidator = dynamic_cast(validator(aValidatorID)); if (aFValidator) { Events_InfoMessage anError; @@ -197,7 +197,7 @@ bool Model_ValidatorsFactory::validate(const std::shared_ptr& //std::map::const_iterator aDefaultVal = myIDs.find(kDefaultId); //if(aDefaultVal != myIDs.end()) { // static const std::list anEmptyArgList; - // const ModelAPI_FeatureValidator* aFValidator = + // const ModelAPI_FeatureValidator* aFValidator = // dynamic_cast(aDefaultVal->second); // if (aFValidator) { // std::string anError; @@ -220,7 +220,7 @@ bool Model_ValidatorsFactory::validate(const std::shared_ptr& std::list aLtAttributes = aData->attributesIDs(kAllTypes); std::list::const_iterator anAttrIt = aLtAttributes.cbegin(); for (; anAttrIt != aLtAttributes.cend(); anAttrIt++) { - const std::string& anAttributeID = *anAttrIt; + const std::string& anAttributeID = *anAttrIt; AttributePtr anAttribute = theFeature->data()->attribute(anAttributeID); std::string aValidatorID; @@ -232,7 +232,7 @@ bool Model_ValidatorsFactory::validate(const std::shared_ptr& theFeature->setError(anError.messageString(), false); theFeature->data()->execState(ModelAPI_StateInvalidArgument); return false; - } + } } return true; @@ -267,13 +267,13 @@ bool Model_ValidatorsFactory::validate(const std::shared_ptr if (!anAttrValidator->isValid(theAttribute, anArguments, theError)) { theValidator = aValidatorID; return false; - } + } } return true; } -void Model_ValidatorsFactory::registerNotObligatory(std::string theFeature, +void Model_ValidatorsFactory::registerNotObligatory(std::string theFeature, std::string theAttribute) { const static std::string kDefaultId = "Model_FeatureValidator"; diff --git a/src/Model/Model_Validator.h b/src/Model/Model_Validator.h index bda886ec9..5ac63fd1b 100644 --- a/src/Model/Model_Validator.h +++ b/src/Model/Model_Validator.h @@ -34,7 +34,7 @@ class Model_ValidatorsFactory : public ModelAPI_ValidatorsFactory std::map myFeatures; /// validators IDs and arguments by feature and attribute IDs std::map > myAttrs; - /// Stores the registered attributes that leads to the concealment of referenced objects in + /// Stores the registered attributes that leads to the concealment of referenced objects in /// data tree. Map from feature kind to set of attribute IDs. std::map > myConcealed; /// Stored the unconcealed results and features that caused the canceled concealment (Recover). @@ -42,7 +42,7 @@ class Model_ValidatorsFactory : public ModelAPI_ValidatorsFactory std::map, std::list > > myUnconcealed; /// Stores the registered attributes must be checked only if the particular case is activated - /// Map from feature kind to map of attribute IDs to pair + /// Map from feature kind to map of attribute IDs to pair // (switchId (ID of the attribute) and case Ids (possible values of the switch attribute)) std::map > > > myCases; @@ -71,7 +71,7 @@ class Model_ValidatorsFactory : public ModelAPI_ValidatorsFactory MODEL_EXPORT virtual void validators(const std::string& theFeatureID, Validators& theResult) const; /// Provides a validator for the attribute, returns NULL if no validator - MODEL_EXPORT virtual void validators(const std::string& theFeatureID, + MODEL_EXPORT virtual void validators(const std::string& theFeatureID, const std::string& theAttrID, Validators& theResult) const; /// Returns registered validator by its Id diff --git a/src/ModelAPI/ModelAPI_Attribute.cpp b/src/ModelAPI/ModelAPI_Attribute.cpp index dd704bd31..97373a087 100644 --- a/src/ModelAPI/ModelAPI_Attribute.cpp +++ b/src/ModelAPI/ModelAPI_Attribute.cpp @@ -37,7 +37,7 @@ void ModelAPI_Attribute::setInitialized() bool ModelAPI_Attribute::blockSetInitialized(const bool theBlock) { bool aBlocked = mySetInitializedBlocked; - + mySetInitializedBlocked = theBlock; return aBlocked; diff --git a/src/ModelAPI/ModelAPI_Attribute.h b/src/ModelAPI/ModelAPI_Attribute.h index e742ff8d5..1ea1523b7 100644 --- a/src/ModelAPI/ModelAPI_Attribute.h +++ b/src/ModelAPI/ModelAPI_Attribute.h @@ -54,7 +54,7 @@ class ModelAPI_Attribute /// \return the previous block value MODELAPI_EXPORT bool blockSetInitialized(const bool theBlock); - /// Set this attribute is argument for result + /// Set this attribute is argument for result /// (change of this attribute requires update of result). /// By default it is true. MODELAPI_EXPORT void setIsArgument(const bool theFlag); diff --git a/src/ModelAPI/ModelAPI_AttributeDouble.h b/src/ModelAPI/ModelAPI_AttributeDouble.h index 927d45a68..fbb95fcf2 100644 --- a/src/ModelAPI/ModelAPI_AttributeDouble.h +++ b/src/ModelAPI/ModelAPI_AttributeDouble.h @@ -48,7 +48,7 @@ class ModelAPI_AttributeDouble : public ModelAPI_Attribute MODELAPI_EXPORT virtual std::string expressionError() = 0; /// Defines the used parameters - MODELAPI_EXPORT virtual + MODELAPI_EXPORT virtual void setUsedParameters(const std::set& theUsedParameters) = 0; /// Returns the used parameters diff --git a/src/ModelAPI/ModelAPI_AttributeInteger.h b/src/ModelAPI/ModelAPI_AttributeInteger.h index 41d2bc9a3..285bd3df4 100644 --- a/src/ModelAPI/ModelAPI_AttributeInteger.h +++ b/src/ModelAPI/ModelAPI_AttributeInteger.h @@ -48,7 +48,7 @@ class ModelAPI_AttributeInteger : public ModelAPI_Attribute MODELAPI_EXPORT virtual std::string expressionError() = 0; /// Defines the used parameters - MODELAPI_EXPORT virtual + MODELAPI_EXPORT virtual void setUsedParameters(const std::set& theUsedParameters) = 0; /// Returns the used parameters diff --git a/src/ModelAPI/ModelAPI_BodyBuilder.h b/src/ModelAPI/ModelAPI_BodyBuilder.h index 39c3f0d6c..d3216d15e 100755 --- a/src/ModelAPI/ModelAPI_BodyBuilder.h +++ b/src/ModelAPI/ModelAPI_BodyBuilder.h @@ -49,27 +49,27 @@ public: /// Records the subshape newShape which was generated during a topological construction. /// As an example, consider the case of a face generated in construction of a box. virtual void generated( - const std::shared_ptr& theNewShape, const std::string& theName, + const std::shared_ptr& theNewShape, const std::string& theName, const int theTag = 1) = 0; /// Records the shape newShape which was generated from the shape oldShape during a topological - /// construction. As an example, consider the case of a face generated from an edge in + /// construction. As an example, consider the case of a face generated from an edge in /// construction of a prism. virtual void generated(const std::shared_ptr& theOldShape, - const std::shared_ptr& theNewShape, const std::string& theName, + const std::shared_ptr& theNewShape, const std::string& theName, const int theTag = 1) = 0; /// Records the shape newShape which is a modification of the shape oldShape. /// As an example, consider the case of a face split or merged in a Boolean operation. virtual void modified(const std::shared_ptr& theOldShape, - const std::shared_ptr& theNewShape, const std::string& theName, + const std::shared_ptr& theNewShape, const std::string& theName, const int theTag = 1) = 0; /// Records the shape oldShape which was deleted from the current label. /// As an example, consider the case of a face removed by a Boolean operation. virtual void deleted( const std::shared_ptr& theOldShape, const int theTag = 1) = 0; - + /// load deleted shapes virtual void loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS, std::shared_ptr theShapeIn, @@ -94,18 +94,18 @@ public: GeomAPI_DataMapOfShapeShape& theSubShapes) = 0; /// load shapes of the first level (to be used during shape import) - virtual void loadFirstLevel(std::shared_ptr theShape, + virtual void loadFirstLevel(std::shared_ptr theShape, const std::string& theName, int& theTag) = 0; - + /// load disconnected edges - virtual void loadDisconnectedEdges(std::shared_ptr theShape, + virtual void loadDisconnectedEdges(std::shared_ptr theShape, const std::string& theName, int& theTag) = 0; /// load disconnected vetexes - virtual void loadDisconnectedVertexes(std::shared_ptr theShape, + virtual void loadDisconnectedVertexes(std::shared_ptr theShape, const std::string& theName,int& theTag) = 0; - /// Converts evolution of sub-shapes stored in naming structure to selection + /// Converts evolution of sub-shapes stored in naming structure to selection /// (theFlag = true) and back (theFlag = false) virtual void evolutionToSelection(const bool theFlag) = 0; diff --git a/src/ModelAPI/ModelAPI_Data.h b/src/ModelAPI/ModelAPI_Data.h index 1dadf03d7..b5ee9cadd 100644 --- a/src/ModelAPI/ModelAPI_Data.h +++ b/src/ModelAPI/ModelAPI_Data.h @@ -7,7 +7,7 @@ #ifndef ModelAPI_Data_H_ #define ModelAPI_Data_H_ -#ifdef _WINDOWS // to avoid too long decorated name warning +#ifdef _WINDOWS // to avoid too long decorated name warning #pragma warning( disable : 4503 ) #endif @@ -75,7 +75,7 @@ class MODELAPI_EXPORT ModelAPI_Data /// Returns the attribute that contains selection to a shape virtual std::shared_ptr selection(const std::string& theID) = 0; /// Returns the attribute that contains selection to a shape - virtual std::shared_ptr + virtual std::shared_ptr selectionList(const std::string& theID) = 0; /// Returns the attribute that contains reference to an attribute of a feature virtual std::shared_ptr refattr(const std::string& theID) = 0; @@ -152,7 +152,7 @@ class MODELAPI_EXPORT ModelAPI_Data virtual const std::set >& refsToMe() = 0; /// returns all references by attributes of this data - /// \param theRefs returned list of pairs: id of referenced attribute and + /// \param theRefs returned list of pairs: id of referenced attribute and /// list of referenced objects virtual void referencesToObjects( std::list > > >& theRefs) =0; diff --git a/src/ModelAPI/ModelAPI_Document.h b/src/ModelAPI/ModelAPI_Document.h index de5ec340e..8e6f138ad 100644 --- a/src/ModelAPI/ModelAPI_Document.h +++ b/src/ModelAPI/ModelAPI_Document.h @@ -49,7 +49,7 @@ public: //! Adds to the document the new feature of the given feature id //! \param theID creates feature and puts it in the document (if it is not action) //! \param theMakeCurrent to make current this new feature in this document - virtual std::shared_ptr addFeature(std::string theID, + virtual std::shared_ptr addFeature(std::string theID, const bool theMakeCurrent = true) = 0; //! Return a list of features, which refers to the feature @@ -65,7 +65,7 @@ public: virtual void removeFeature(std::shared_ptr theFeature) = 0; //! Moves the feature to make it after the given one in the history. - virtual void moveFeature(std::shared_ptr theMoved, + virtual void moveFeature(std::shared_ptr theMoved, std::shared_ptr theAfterThis) = 0; ///! Returns the id of the document @@ -114,7 +114,7 @@ public: virtual std::shared_ptr internalFeature(const int theIndex) = 0; //! Performs synchronization of transactions with the module document: //! If some document is not active (by undo of activation) but in memory, - //! on activation the transactions must be synchronised because all redos performed + //! on activation the transactions must be synchronised because all redos performed //! wihtout this participation virtual void synchronizeTransactions() = 0; @@ -166,7 +166,7 @@ public: const std::shared_ptr& theShape) = 0; /// Returns true if theLater is in history of features creation later than theCurrent - virtual bool isLater(std::shared_ptr theLater, + virtual bool isLater(std::shared_ptr theLater, std::shared_ptr theCurrent) const = 0; //! Internally makes document know that feature was removed or added in history after creation diff --git a/src/ModelAPI/ModelAPI_Events.cpp b/src/ModelAPI/ModelAPI_Events.cpp index 1eeb029cf..1cdf80511 100644 --- a/src/ModelAPI/ModelAPI_Events.cpp +++ b/src/ModelAPI/ModelAPI_Events.cpp @@ -229,7 +229,7 @@ void ModelAPI_ReplaceParameterMessage::setObject(ObjectPtr theObject) // ===== ModelAPI_SolverFailedMessage ===== -ModelAPI_SolverFailedMessage::ModelAPI_SolverFailedMessage(const Events_ID theID, +ModelAPI_SolverFailedMessage::ModelAPI_SolverFailedMessage(const Events_ID theID, const void* theSender) : Events_Message(theID, theSender), myDOF(-1) diff --git a/src/ModelAPI/ModelAPI_Events.h b/src/ModelAPI/ModelAPI_Events.h index 9c1718acb..f162734b1 100644 --- a/src/ModelAPI/ModelAPI_Events.h +++ b/src/ModelAPI/ModelAPI_Events.h @@ -39,7 +39,7 @@ static const char * EVENT_PLUGIN_LOADED = "PluginLoaded"; /// The active document becomes another one static const char * EVENT_DOCUMENT_CHANGED = "CurrentDocumentChanged"; -/// Event ID that order of objects in group is changed, +/// Event ID that order of objects in group is changed, /// so, tree must be fully rectreated (movement of feature) static const char * EVENT_ORDER_UPDATED = "OrderUpdated"; /// Event ID that the sketch is prepared and all grouped messages for the solver may be flushed @@ -125,7 +125,7 @@ public: class MODELAPI_EXPORT ModelAPI_OrderUpdatedMessage : public Events_Message { protected: - /// Creates a message: + /// Creates a message: ModelAPI_OrderUpdatedMessage(const Events_ID theID, const void* theSender = 0); /// The virtual destructor virtual ~ModelAPI_OrderUpdatedMessage(); diff --git a/src/ModelAPI/ModelAPI_Expression.h b/src/ModelAPI/ModelAPI_Expression.h index 00e8acc71..fd00670cc 100644 --- a/src/ModelAPI/ModelAPI_Expression.h +++ b/src/ModelAPI/ModelAPI_Expression.h @@ -48,7 +48,7 @@ class ModelAPI_Expression MODELAPI_EXPORT virtual std::string error() = 0; /// Defines the used parameters (by the parameters listener) - MODELAPI_EXPORT virtual + MODELAPI_EXPORT virtual void setUsedParameters(const std::set& theUsedParameters) = 0; /// Returns the used parameters diff --git a/src/ModelAPI/ModelAPI_Result.h b/src/ModelAPI/ModelAPI_Result.h index b275f308f..3f30c57c7 100644 --- a/src/ModelAPI/ModelAPI_Result.h +++ b/src/ModelAPI/ModelAPI_Result.h @@ -26,7 +26,7 @@ class ModelAPI_Result : public ModelAPI_Object public: /// Reference to the color of the result. - /// The integer array is used. It contains tree values for red green and blue values. + /// The integer array is used. It contains tree values for red green and blue values. /// The values are in [0, 255] range inline static const std::string& COLOR_ID() { @@ -49,7 +49,7 @@ class ModelAPI_Result : public ModelAPI_Object MODELAPI_EXPORT virtual void setIsConcealed(const bool theValue); /// Enables/disables the result. The disabled result does not participate in any calculation - /// and visualization: like it was removed. But it keeps the general parameters: colors, + /// and visualization: like it was removed. But it keeps the general parameters: colors, /// visibility, etc. /// \param theThis pointer to this object, needed to generate all events if it is necessary /// \param theFlag makes disabled if it is true diff --git a/src/ModelAPI/ModelAPI_ResultBody.cpp b/src/ModelAPI/ModelAPI_ResultBody.cpp index eb5067d40..e5f023f11 100644 --- a/src/ModelAPI/ModelAPI_ResultBody.cpp +++ b/src/ModelAPI/ModelAPI_ResultBody.cpp @@ -86,7 +86,7 @@ void ModelAPI_ResultBody::generated(const std::shared_ptr& theNew } void ModelAPI_ResultBody::generated(const std::shared_ptr& theOldShape, - const std::shared_ptr& theNewShape, const std::string& theName, + const std::shared_ptr& theNewShape, const std::string& theName, const int theTag) { myBuilder->generated(theOldShape, theNewShape, theName, theTag); @@ -105,7 +105,7 @@ void ModelAPI_ResultBody::deleted( { myBuilder->deleted(theOldShape, theTag); } - + void ModelAPI_ResultBody::loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS, std::shared_ptr theShapeIn, const int theKindOfShape, @@ -116,7 +116,7 @@ void ModelAPI_ResultBody::loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS, void ModelAPI_ResultBody::loadAndOrientModifiedShapes (GeomAlgoAPI_MakeShape* theMS, std::shared_ptr theShapeIn, const int theKindOfShape, const int theTag, - const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes, + const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes, const bool theIsStoreSeparate) { myBuilder->loadAndOrientModifiedShapes( @@ -131,7 +131,7 @@ void ModelAPI_ResultBody::loadAndOrientGeneratedShapes (GeomAlgoAPI_MakeShape* t theMS, theShapeIn, theKindOfShape, theTag, theName, theSubShapes); } -void ModelAPI_ResultBody::loadFirstLevel(std::shared_ptr theShape, +void ModelAPI_ResultBody::loadFirstLevel(std::shared_ptr theShape, const std::string& theName, int& theTag) { myBuilder->loadFirstLevel(theShape, theName, theTag); diff --git a/src/ModelAPI/ModelAPI_ResultBody.h b/src/ModelAPI/ModelAPI_ResultBody.h index 8b532746d..959259934 100644 --- a/src/ModelAPI/ModelAPI_ResultBody.h +++ b/src/ModelAPI/ModelAPI_ResultBody.h @@ -61,7 +61,7 @@ public: /// \brief Stores the shape (called by the execution method). /// param[in] theShape shape to store. - /// param[in] theIsStoreSameShapes if false stores reference to the same shape + /// param[in] theIsStoreSameShapes if false stores reference to the same shape /// if it is already in document. MODELAPI_EXPORT virtual void store(const std::shared_ptr& theShape, const bool theIsStoreSameShapes = true); @@ -86,11 +86,11 @@ public: MODELAPI_EXPORT virtual void generated(const std::shared_ptr& theNewShape, const std::string& theName, const int theTag = 1); - /// Records the shape newShape which was generated from the shape oldShape during a topological - /// construction. As an example, consider the case of a face generated from an edge in + /// Records the shape newShape which was generated from the shape oldShape during a topological + /// construction. As an example, consider the case of a face generated from an edge in /// construction of a prism. MODELAPI_EXPORT virtual void generated(const std::shared_ptr& theOldShape, - const std::shared_ptr& theNewShape, const std::string& theName, + const std::shared_ptr& theNewShape, const std::string& theName, const int theTag = 1); /// Records the shape newShape which is a modification of the shape oldShape. @@ -103,7 +103,7 @@ public: /// As an example, consider the case of a face removed by a Boolean operation. MODELAPI_EXPORT virtual void deleted( const std::shared_ptr& theOldShape, const int theTag = 1); - + /// load deleted shapes MODELAPI_EXPORT virtual void loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS, std::shared_ptr theShapeIn, @@ -112,7 +112,7 @@ public: /// load and orient modified shapes MODELAPI_EXPORT virtual void loadAndOrientModifiedShapes (GeomAlgoAPI_MakeShape* theMS, std::shared_ptr theShapeIn, const int theKindOfShape, const int theTag, - const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes, + const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes, const bool theIsStoreSeparate = false); /// load and orient generated shapes MODELAPI_EXPORT virtual void loadAndOrientGeneratedShapes (GeomAlgoAPI_MakeShape* theMS, @@ -120,9 +120,9 @@ public: const int theTag, const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes); /// load shapes of the first level (to be used during shape import) - MODELAPI_EXPORT virtual void loadFirstLevel(std::shared_ptr theShape, + MODELAPI_EXPORT virtual void loadFirstLevel(std::shared_ptr theShape, const std::string& theName, int& theTag); - + /// load disconnected edges MODELAPI_EXPORT virtual void loadDisconnectedEdges(std::shared_ptr theShape, const std::string& theName, int& theTag); diff --git a/src/ModelAPI/ModelAPI_ResultPart.h b/src/ModelAPI/ModelAPI_ResultPart.h index 1d66dba18..4345f303c 100644 --- a/src/ModelAPI/ModelAPI_ResultPart.h +++ b/src/ModelAPI/ModelAPI_ResultPart.h @@ -52,7 +52,7 @@ class ModelAPI_ResultPart : public ModelAPI_Result /// Returns the part-document of this result virtual std::shared_ptr partDoc() = 0; - /// Returns the original part result: for transfomration features results this is + /// Returns the original part result: for transfomration features results this is /// the original Part feature result virtual std::shared_ptr original() = 0; @@ -69,7 +69,7 @@ class ModelAPI_ResultPart : public ModelAPI_Result virtual bool updateInPart(const int theIndex) = 0; /// Applies the additional transformation of the part - virtual void setTrsf(std::shared_ptr theThis, + virtual void setTrsf(std::shared_ptr theThis, const std::shared_ptr& theTransformation) = 0; /// Returns the shape by the name in the part diff --git a/src/ModelAPI/ModelAPI_Session.cpp b/src/ModelAPI/ModelAPI_Session.cpp index cd2e11acf..11f3df4c2 100644 --- a/src/ModelAPI/ModelAPI_Session.cpp +++ b/src/ModelAPI/ModelAPI_Session.cpp @@ -60,7 +60,7 @@ std::shared_ptr ModelAPI_Session::get() } /// instance of the events creator, one pre application -const ModelAPI_EventCreator* MY_API_CREATOR = 0; +const ModelAPI_EventCreator* MY_API_CREATOR = 0; const ModelAPI_EventCreator* ModelAPI_EventCreator::get() { diff --git a/src/ModelAPI/ModelAPI_Session.h b/src/ModelAPI/ModelAPI_Session.h index 3b0c4d413..40984fb03 100644 --- a/src/ModelAPI/ModelAPI_Session.h +++ b/src/ModelAPI/ModelAPI_Session.h @@ -46,14 +46,14 @@ class MODELAPI_EXPORT ModelAPI_Session //! Starts a new operation (opens a transaction) //! \param theId of operation for history (optional) - //! \param theAttachedToNested if it is true, - //! it means that this transaction is attached to the nested + //! \param theAttachedToNested if it is true, + //! it means that this transaction is attached to the nested //! where it is located and will be committed on the next commit with the nested virtual void startOperation( const std::string& theId = "", const bool theAttachedToNested = false) = 0; //! Finishes the previously started operation (closes the transaction) virtual void finishOperation() = 0; - //! Aborts the operation + //! Aborts the operation virtual void abortOperation() = 0; //! Returns true if operation has been started, but not yet finished or aborted virtual bool isOperation() = 0; @@ -74,7 +74,7 @@ class MODELAPI_EXPORT ModelAPI_Session virtual std::list redoList() = 0; /// Registers the plugin that creates features. - /// It is obligatory for each plugin to call this function on loading to be found by + /// It is obligatory for each plugin to call this function on loading to be found by /// the plugin manager on call of the feature) virtual void registerPlugin(ModelAPI_Plugin* thePlugin) = 0; diff --git a/src/ModelAPI/ModelAPI_Tools.cpp b/src/ModelAPI/ModelAPI_Tools.cpp index 90b84bc98..cc56c2a37 100755 --- a/src/ModelAPI/ModelAPI_Tools.cpp +++ b/src/ModelAPI/ModelAPI_Tools.cpp @@ -104,7 +104,7 @@ void shapesOfType(const FeaturePtr& theFeature, } } -const char* toString(ModelAPI_ExecState theExecState) +const char* toString(ModelAPI_ExecState theExecState) { #define TO_STRING(__NAME__) case __NAME__: return #__NAME__; switch (theExecState) { @@ -159,7 +159,7 @@ std::string getFeatureError(const FeaturePtr& theFeature) return anError; } -ObjectPtr objectByName(const DocumentPtr& theDocument, const std::string& theGroup, +ObjectPtr objectByName(const DocumentPtr& theDocument, const std::string& theGroup, const std::string& theName) { for (int anIndex = 0; anIndex < theDocument->size(theGroup); ++anIndex) { @@ -186,7 +186,7 @@ bool findVariable(const DocumentPtr& theDocument, FeaturePtr theSearcher, return true; } -bool findVariable(FeaturePtr theSearcher, const std::string& theName, double& outValue, +bool findVariable(FeaturePtr theSearcher, const std::string& theName, double& outValue, ResultParameterPtr& theParam, const DocumentPtr& theDocument) { SessionPtr aSession = ModelAPI_Session::get(); @@ -205,9 +205,9 @@ bool findVariable(FeaturePtr theSearcher, const std::string& theName, double& ou ResultPtr findPartResult(const DocumentPtr& theMain, const DocumentPtr& theSub) { - // to optimize and avoid of crash on partset document close + // to optimize and avoid of crash on partset document close // (don't touch the sub-document structure) - if (theMain != theSub) { + if (theMain != theSub) { for (int a = theMain->size(ModelAPI_ResultPart::group()) - 1; a >= 0; a--) { ResultPartPtr aPart = std::dynamic_pointer_cast( theMain->object(ModelAPI_ResultPart::group(), a)); @@ -221,7 +221,7 @@ ResultPtr findPartResult(const DocumentPtr& theMain, const DocumentPtr& theSub) FeaturePtr findPartFeature(const DocumentPtr& theMain, const DocumentPtr& theSub) { - // to optimize and avoid of crash on partset document close + // to optimize and avoid of crash on partset document close // (don't touch the sub-document structure) if (theMain != theSub) { for (int a = theMain->size(ModelAPI_Feature::group()) - 1; a >= 0; a--) { @@ -264,7 +264,7 @@ ResultCompSolidPtr compSolidOwner(const ResultPtr& theSub) if (aBody.get()) { FeaturePtr aFeatureOwner = aBody->document()->feature(aBody); if (aFeatureOwner.get()) { - std::list >::const_iterator aResIter = + std::list >::const_iterator aResIter = aFeatureOwner->results().cbegin(); for(; aResIter != aFeatureOwner->results().cend(); aResIter++) { ResultCompSolidPtr aComp = std::dynamic_pointer_cast(*aResIter); @@ -369,7 +369,7 @@ bool removeFeatures(const std::set& theFeatures, } } if (isDone && theFlushRedisplay) { - // the redisplay signal should be flushed in order to erase + // the redisplay signal should be flushed in order to erase // the feature presentation in the viewer // if should be done after removeFeature() of document Events_Loop::loop()->flush(Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY)); @@ -418,7 +418,7 @@ void addRefsToFeature(const FeaturePtr& theFeature, #endif if (theReferences.find(aRefFeature) == theReferences.end()) theReferences.insert(aRefFeature); - addRefsToFeature(aRefFeature, theReferencesMap, theProcessedReferences, + addRefsToFeature(aRefFeature, theReferencesMap, theProcessedReferences, theRecLevel, theReferences); } } @@ -452,7 +452,7 @@ void findReferences(const std::set& theFeatures, aLast = aSelRefFeatures.end(); for (; anIt != aLast; anIt++) { FeaturePtr aCFeature = *anIt; - CompositeFeaturePtr aComposite = + CompositeFeaturePtr aComposite = std::dynamic_pointer_cast(aCFeature); if (aComposite.get() && aComposite->isSub(aFeature)) continue; /// composite of the current feature should be skipped @@ -462,7 +462,7 @@ void findReferences(const std::set& theFeatures, } if (theUseRecursion) { #ifdef DEBUG_CYCLING_1550 - findReferences(aSelRefFeatures, theReferences, theUseComposite, + findReferences(aSelRefFeatures, theReferences, theUseComposite, theUseRecursion, theRecLevel); #else findReferences(theReferences[aFeature], theReferences, theUseComposite, theUseRecursion, @@ -527,7 +527,7 @@ void findAllReferences(const std::set& theFeatures, std::cout << " Ref: " << getFeatureInfo(aFeature) << std::endl; #endif aRecLevel++; - addRefsToFeature(aFeature, aMainList, theReferences, + addRefsToFeature(aFeature, aMainList, theReferences, aRecLevel, aResultRefList/*aMainRefList*/); } theReferences[aMainListFeature] = aResultRefList; @@ -555,7 +555,7 @@ void findRefsToFeatures(const std::set& theFeatures, std::set::const_iterator aRefIt = aRefList.begin(), aRefLast = aRefList.end(); for (; aRefIt != aRefLast; aRefIt++) { FeaturePtr aRefFeature = *aRefIt; - CompositeFeaturePtr aComposite = + CompositeFeaturePtr aComposite = std::dynamic_pointer_cast(aRefFeature); if (aComposite.get() && aComposite->isSub(aFeature)) continue; /// composite of the current feature should not be removed diff --git a/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp b/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp index 206057239..0ee9df16e 100755 --- a/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp +++ b/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp @@ -203,10 +203,10 @@ namespace ModelGeomAlgo_Point2D { std::string aValue = "not defined"; std::string aType = theAttribute->attributeType(); if (aType == GeomDataAPI_Point2D::typeId()) { - std::shared_ptr aPoint = + std::shared_ptr aPoint = std::dynamic_pointer_cast(theAttribute); if (aPoint.get() && aPoint->isInitialized()) { - aValue = std::string("(" + doubleToString(aPoint->x()) + ", "+ + aValue = std::string("(" + doubleToString(aPoint->x()) + ", "+ doubleToString(aPoint->y()) + ")"); } } diff --git a/src/ModelHighAPI/ModelHighAPI_Double.cpp b/src/ModelHighAPI/ModelHighAPI_Double.cpp index aee0ec811..c0b77a6a0 100644 --- a/src/ModelHighAPI/ModelHighAPI_Double.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Double.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Double.cpp -// Purpose: +// Purpose: // // History: // 29/03/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/ModelHighAPI/ModelHighAPI_Double.h b/src/ModelHighAPI/ModelHighAPI_Double.h index 3e3b0fee5..a7f20f475 100644 --- a/src/ModelHighAPI/ModelHighAPI_Double.h +++ b/src/ModelHighAPI/ModelHighAPI_Double.h @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Double.h -// Purpose: +// Purpose: // // History: // 29/03/16 - Sergey POKHODENKO - Creation of the file @@ -48,4 +48,4 @@ private: //-------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------- -#endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_DOUBLE_H_ */ +#endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_DOUBLE_H_ */ diff --git a/src/ModelHighAPI/ModelHighAPI_Dumper.cpp b/src/ModelHighAPI/ModelHighAPI_Dumper.cpp index 2216f59f5..2764c1798 100644 --- a/src/ModelHighAPI/ModelHighAPI_Dumper.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Dumper.cpp @@ -230,13 +230,13 @@ bool ModelHighAPI_Dumper::process(const std::shared_ptr& theD CompositeFeaturePtr aCompFeat = std::dynamic_pointer_cast(*aFeatIt); if (aCompFeat) // iteratively process composite features isOk = process(aCompFeat) && isOk; - else if (!isDumped(*aFeatIt)) // dump common feature + else if (!isDumped(*aFeatIt)) // dump common feature dumpFeature(*aFeatIt); } return isOk; } -bool ModelHighAPI_Dumper::process(const std::shared_ptr& theComposite, +bool ModelHighAPI_Dumper::process(const std::shared_ptr& theComposite, bool isForce) { // increase composite features stack @@ -351,7 +351,7 @@ bool ModelHighAPI_Dumper::exportTo(const std::string& theFileName) for (ModulesMap::const_iterator aModIt = myModules.begin(); aModIt != myModules.end(); ++aModIt) { aFile << "from " << aModIt->first << " import "; - if (aModIt->second.empty() || + if (aModIt->second.empty() || aModIt->second.find(std::string()) != aModIt->second.end()) aFile << "*"; // import whole module else { @@ -426,7 +426,7 @@ void ModelHighAPI_Dumper::dumpEntitySetName() } // set result deflection if (!isDefaultDeflection(*aResIt)) { - AttributeDoublePtr aDeflectionAttr = + AttributeDoublePtr aDeflectionAttr = (*aResIt)->data()->real(ModelAPI_Result::DEFLECTION_ID()); if(aDeflectionAttr.get() && aDeflectionAttr->isInitialized()) { *this << *aResIt; @@ -646,7 +646,7 @@ ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(const ResultPtr& theResult) FeaturePtr aFeature = ModelAPI_Feature::feature(theResult); int anIndex = 0; std::list aResults = aFeature->results(); - for(std::list::const_iterator + for(std::list::const_iterator anIt = aResults.cbegin(); anIt != aResults.cend(); ++anIt, ++anIndex) { if(theResult->isSame(*anIt)) { break; @@ -788,7 +788,7 @@ ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<( return *this; } - myDumpBuffer << "\"" << aShape->shapeTypeStr() << "\", \"" << + myDumpBuffer << "\"" << aShape->shapeTypeStr() << "\", \"" << theAttrSelect->namingName() << "\")"; return *this; } @@ -819,7 +819,7 @@ ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<( } else { isAdded = true; } - myDumpBuffer << "model.selection(\"" << + myDumpBuffer << "model.selection(\"" << aShape->shapeTypeStr() << "\", \"" << anAttribute->namingName() << "\")"; } diff --git a/src/ModelHighAPI/ModelHighAPI_Dumper.h b/src/ModelHighAPI/ModelHighAPI_Dumper.h index ace8be67a..d12454861 100644 --- a/src/ModelHighAPI/ModelHighAPI_Dumper.h +++ b/src/ModelHighAPI/ModelHighAPI_Dumper.h @@ -76,7 +76,7 @@ public: /// Add module to list of imported modules /// \param theModuleName name of the module to be imported - /// \param theObject name of the entity to be imported + /// \param theObject name of the entity to be imported /// from the module (if empty, while module will be imported) MODELHIGHAPI_EXPORT void importModule(const std::string& theModuleName, @@ -84,13 +84,13 @@ public: /// Returns name of specified entity /// \param theEntity [in] named entity - /// \param theSaveNotDumped [in] + /// \param theSaveNotDumped [in] /// if \c true, the entity should be stored as not dumped (will be dumped automatically) - /// \param theUseEntityName [in] + /// \param theUseEntityName [in] /// if \c true, the entity name should be used "as is" without changing default name /// \return name of the entity MODELHIGHAPI_EXPORT - const std::string& name(const EntityPtr& theEntity, bool theSaveNotDumped = true, + const std::string& name(const EntityPtr& theEntity, bool theSaveNotDumped = true, bool theUseEntityName = false); /// Returns name of parent composite feature for specified entity @@ -188,31 +188,31 @@ public: ModelHighAPI_Dumper& operator<<(const ResultPtr& theResult); /// Dump Attribute - MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& + MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& operator<<(const std::shared_ptr& theAttr); /// Dump Object - MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& + MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& operator<<(const std::shared_ptr& theObject); /// Dump AttributeRefAttr - MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& + MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& operator<<(const std::shared_ptr& theRefAttr); /// Dump AttributeRefAttrList as follows: /// "[obj1, obj2, obj3, ...]" - MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& + MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& operator<<(const std::shared_ptr& theRefAttrList); /// Dump AttributeRefList as follows: /// "[obj1, obj2, obj3, ...]" - MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& + MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& operator<<(const std::shared_ptr& theRefList); /// Dump AttributeSelection - MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& + MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& operator<<(const std::shared_ptr& theAttrSelect); /// Dump AttributeSelectionList - MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& + MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& operator<<(const std::shared_ptr& theAttrSelList); /// Dump AttributeReference - MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& + MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& operator<<(const std::shared_ptr& theReference); /// Clear dump buffer @@ -233,14 +233,14 @@ private: bool process(const std::shared_ptr& theDoc); /// Dump composite feature and all it sub-features - bool process(const std::shared_ptr& theComposite, + bool process(const std::shared_ptr& theComposite, bool isForce = false); /// Iterate all features in composite feature and dump them into intermediate buffer /// \param theComposite [in] parent composite feature /// \param theDumpModelDo [in] shows that command "model.do()" should be written at the end MODELHIGHAPI_EXPORT - bool processSubs(const std::shared_ptr& theComposite, + bool processSubs(const std::shared_ptr& theComposite, bool theDumpModelDo = false); /// Check the entity is already dumped @@ -276,9 +276,9 @@ private: EntityPtr myEntity; ///< last dumped entity bool myUserName; ///< the entity hase user-defined name /// results of this entity, which has user-defined names or specific colors - std::list myResults; + std::list myResults; - LastDumpedEntity(EntityPtr theEntity, bool theUserName, + LastDumpedEntity(EntityPtr theEntity, bool theUserName, const std::list& theResults) : myEntity(theEntity), myUserName(theUserName), myResults(theResults) {} @@ -298,7 +298,7 @@ private: protected: /// list of entities, used by other features but not dumped yet - std::set myNotDumpedEntities; + std::set myNotDumpedEntities; friend class SketchAPI_Sketch; }; diff --git a/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp b/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp index 6417e5241..99f992f49 100644 --- a/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp +++ b/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp @@ -64,7 +64,7 @@ std::string ModelHighAPI_FeatureStore::compare(FeaturePtr theFeature) { for(; aRes != allResults.end() && aResIter != myRes.end(); aRes++, aResIter++) { anError = compareData((*aRes)->data(), *aResIter); if (!anError.empty()) - return "Results of feature '" + theFeature->name() + "' '" + (*aRes)->data()->name() + + return "Results of feature '" + theFeature->name() + "' '" + (*aRes)->data()->name() + "' differ:" + anError; } if (aRes != allResults.end()) { @@ -76,11 +76,11 @@ std::string ModelHighAPI_FeatureStore::compare(FeaturePtr theFeature) { return ""; // ok } -void ModelHighAPI_FeatureStore::storeData(std::shared_ptr theData, +void ModelHighAPI_FeatureStore::storeData(std::shared_ptr theData, std::map& theAttrs) { // store name to keep also this information and output if needed - theAttrs["__name__"] = theData->name(); + theAttrs["__name__"] = theData->name(); std::list > allAttrs = theData->attributes(""); std::list >::iterator anAttr = allAttrs.begin(); for(; anAttr != allAttrs.end(); anAttr++) { @@ -93,7 +93,7 @@ void ModelHighAPI_FeatureStore::storeData(std::shared_ptr theData } } -std::string ModelHighAPI_FeatureStore::compareData(std::shared_ptr theData, +std::string ModelHighAPI_FeatureStore::compareData(std::shared_ptr theData, std::map& theAttrs) { std::map aThis; @@ -104,7 +104,7 @@ std::string ModelHighAPI_FeatureStore::compareData(std::shared_ptrfirst + "'"; } if (theAttrs[aThisIter->first] != aThisIter->second) { - return "attribute '" + aThisIter->first + "' is different (original != current) '" + + return "attribute '" + aThisIter->first + "' is different (original != current) '" + theAttrs[aThisIter->first] + "' != '" + aThisIter->second + "'"; } } @@ -118,7 +118,7 @@ std::string ModelHighAPI_FeatureStore::compareData(std::shared_ptrid() == "SolverError" && + if (theAttr->id() == "SolverError" && std::dynamic_pointer_cast(theAttr->owner())->getKind() == "Sketch") return ""; } @@ -195,11 +195,11 @@ std::string ModelHighAPI_FeatureStore::dumpAttr(const AttributePtr& theAttr) { aResult<<"__empty__"; } } else if (aType == ModelAPI_AttributeSelection::typeId()) { - AttributeSelectionPtr anAttr = + AttributeSelectionPtr anAttr = std::dynamic_pointer_cast(theAttr); aResult<namingName(); } else if (aType == ModelAPI_AttributeSelectionList::typeId()) { - AttributeSelectionListPtr anAttr = + AttributeSelectionListPtr anAttr = std::dynamic_pointer_cast(theAttr); for(int a = 0; a < anAttr->size(); a++) { if (a != 0) @@ -207,7 +207,7 @@ std::string ModelHighAPI_FeatureStore::dumpAttr(const AttributePtr& theAttr) { aResult<value(a)->namingName(); } } else if (aType == ModelAPI_AttributeRefAttr::typeId()) { - AttributeRefAttrPtr anAttr = + AttributeRefAttrPtr anAttr = std::dynamic_pointer_cast(theAttr); ObjectPtr anObj = anAttr->isObject() ? anAttr->object() : anAttr->attr()->owner(); if (anObj.get()) { @@ -219,10 +219,10 @@ std::string ModelHighAPI_FeatureStore::dumpAttr(const AttributePtr& theAttr) { aResult<<"__empty__"; } } else if (aType == ModelAPI_AttributeRefList::typeId()) { - AttributeRefListPtr anAttr = + AttributeRefListPtr anAttr = std::dynamic_pointer_cast(theAttr); // for sketch sub-features the empty values may be skipped and order is not important - bool isSketchFeatures = anAttr->id() == "Features" && + bool isSketchFeatures = anAttr->id() == "Features" && std::dynamic_pointer_cast(anAttr->owner())->getKind() == "Sketch"; std::list aList = anAttr->list(); std::list aResList; // list of resulting strings @@ -239,7 +239,7 @@ std::string ModelHighAPI_FeatureStore::dumpAttr(const AttributePtr& theAttr) { aResult<<*aR<<" "; } } else if (aType == ModelAPI_AttributeRefAttrList::typeId()) { - AttributeRefAttrListPtr anAttr = + AttributeRefAttrListPtr anAttr = std::dynamic_pointer_cast(theAttr); std::list > aList = anAttr->list(); std::list >::iterator aL = aList.begin(); @@ -257,12 +257,12 @@ std::string ModelHighAPI_FeatureStore::dumpAttr(const AttributePtr& theAttr) { } } } else if (aType == ModelAPI_AttributeIntArray::typeId()) { - AttributeIntArrayPtr anAttr = + AttributeIntArrayPtr anAttr = std::dynamic_pointer_cast(theAttr); for(int a = 0; a < anAttr->size(); a++) aResult<value(a)<<" "; } else if (aType == ModelAPI_AttributeDoubleArray::typeId()) { - AttributeDoubleArrayPtr anAttr = + AttributeDoubleArrayPtr anAttr = std::dynamic_pointer_cast(theAttr); for(int a = 0; a < anAttr->size(); a++) aResult<value(a)<<" "; diff --git a/src/ModelHighAPI/ModelHighAPI_FeatureStore.h b/src/ModelHighAPI/ModelHighAPI_FeatureStore.h index fbe83c015..4cd0d0f4c 100644 --- a/src/ModelHighAPI/ModelHighAPI_FeatureStore.h +++ b/src/ModelHighAPI/ModelHighAPI_FeatureStore.h @@ -41,11 +41,11 @@ public: private: /// stores the information about all attributes of data in map - void storeData(std::shared_ptr theData, + void storeData(std::shared_ptr theData, std::map& theAttrs); /// compares the information about all attributes of data with map /// returns not empty string with error if something is different - std::string compareData(std::shared_ptr theData, + std::string compareData(std::shared_ptr theData, std::map& theAttrs); /// dumps the attribute content to the string std::string dumpAttr(const AttributePtr& theAttr); diff --git a/src/ModelHighAPI/ModelHighAPI_Integer.cpp b/src/ModelHighAPI/ModelHighAPI_Integer.cpp index 047b31abb..3742dc5fa 100644 --- a/src/ModelHighAPI/ModelHighAPI_Integer.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Integer.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Integer.cpp -// Purpose: +// Purpose: // // History: // 29/03/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/ModelHighAPI/ModelHighAPI_Integer.h b/src/ModelHighAPI/ModelHighAPI_Integer.h index 36be4ca20..35fb0d77f 100644 --- a/src/ModelHighAPI/ModelHighAPI_Integer.h +++ b/src/ModelHighAPI/ModelHighAPI_Integer.h @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Integer.h -// Purpose: +// Purpose: // // History: // 29/03/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/ModelHighAPI/ModelHighAPI_Interface.cpp b/src/ModelHighAPI/ModelHighAPI_Interface.cpp index 4cb6f5293..07fd0249a 100644 --- a/src/ModelHighAPI/ModelHighAPI_Interface.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Interface.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Interface.cpp -// Purpose: +// Purpose: // // History: // 17/05/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/ModelHighAPI/ModelHighAPI_Interface.h b/src/ModelHighAPI/ModelHighAPI_Interface.h index 9cf22791e..3c95aa903 100644 --- a/src/ModelHighAPI/ModelHighAPI_Interface.h +++ b/src/ModelHighAPI/ModelHighAPI_Interface.h @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Interface.h -// Purpose: +// Purpose: // // History: // 17/05/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/ModelHighAPI/ModelHighAPI_Macro.h b/src/ModelHighAPI/ModelHighAPI_Macro.h index 2b9297018..e37b2efbb 100644 --- a/src/ModelHighAPI/ModelHighAPI_Macro.h +++ b/src/ModelHighAPI/ModelHighAPI_Macro.h @@ -44,7 +44,7 @@ public: //-------------------------------------------------------------------------------------- -// Used in INTERFACE_N inside START_INIT/END_INIT for +// Used in INTERFACE_N inside START_INIT/END_INIT for // set variable with attribute received from feature #define SET_ATTRIBUTE(NAME, TYPE, ATT_NAME) \ VAR_NAME(NAME) = std::dynamic_pointer_cast(feature()->attribute(ATT_NAME)); \ diff --git a/src/ModelHighAPI/ModelHighAPI_RefAttr.cpp b/src/ModelHighAPI/ModelHighAPI_RefAttr.cpp index 6d76c152b..776f40f4b 100644 --- a/src/ModelHighAPI/ModelHighAPI_RefAttr.cpp +++ b/src/ModelHighAPI/ModelHighAPI_RefAttr.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_RefAttr.cpp -// Purpose: +// Purpose: // // History: // 08/06/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/ModelHighAPI/ModelHighAPI_RefAttr.h b/src/ModelHighAPI/ModelHighAPI_RefAttr.h index 3d48f9f5d..d2ada9e90 100644 --- a/src/ModelHighAPI/ModelHighAPI_RefAttr.h +++ b/src/ModelHighAPI/ModelHighAPI_RefAttr.h @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_RefAttr.h -// Purpose: +// Purpose: // // History: // 08/06/16 - Sergey POKHODENKO - Creation of the file @@ -44,11 +44,11 @@ public: virtual ~ModelHighAPI_RefAttr(); /// Fill attribute values - MODELHIGHAPI_EXPORT virtual + MODELHIGHAPI_EXPORT virtual void fillAttribute(const std::shared_ptr & theAttribute) const; /// Append to list attribute - MODELHIGHAPI_EXPORT virtual + MODELHIGHAPI_EXPORT virtual void appendToList(const std::shared_ptr & theAttribute) const; /// Check the object is empty diff --git a/src/ModelHighAPI/ModelHighAPI_Reference.h b/src/ModelHighAPI/ModelHighAPI_Reference.h index e25d33d4d..5dd16ec3a 100644 --- a/src/ModelHighAPI/ModelHighAPI_Reference.h +++ b/src/ModelHighAPI/ModelHighAPI_Reference.h @@ -41,7 +41,7 @@ public: virtual ~ModelHighAPI_Reference(); /// Fill attribute values - MODELHIGHAPI_EXPORT virtual + MODELHIGHAPI_EXPORT virtual void fillAttribute(const std::shared_ptr & theAttribute) const; /// Append to list attribute diff --git a/src/ModelHighAPI/ModelHighAPI_Selection.cpp b/src/ModelHighAPI/ModelHighAPI_Selection.cpp index 72bfdff59..fb0697635 100644 --- a/src/ModelHighAPI/ModelHighAPI_Selection.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Selection.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Selection.cpp -// Purpose: +// Purpose: // // History: // 06/06/16 - Sergey POKHODENKO - Creation of the file @@ -44,10 +44,10 @@ void ModelHighAPI_Selection::fillAttribute( { switch(myVariantType) { case VT_Empty: return; - case VT_ResultSubShapePair: - theAttribute->setValue(myResultSubShapePair.first, myResultSubShapePair.second); + case VT_ResultSubShapePair: + theAttribute->setValue(myResultSubShapePair.first, myResultSubShapePair.second); return; - case VT_TypeSubShapeNamePair: + case VT_TypeSubShapeNamePair: theAttribute->selectSubShape(myTypeSubShapeNamePair.first, myTypeSubShapeNamePair.second); return; } @@ -59,8 +59,8 @@ void ModelHighAPI_Selection::appendToList( { switch(myVariantType) { case VT_Empty: return; - case VT_ResultSubShapePair: - theAttribute->append(myResultSubShapePair.first, myResultSubShapePair.second); + case VT_ResultSubShapePair: + theAttribute->append(myResultSubShapePair.first, myResultSubShapePair.second); return; case VT_TypeSubShapeNamePair: // Note: the reverse order (first - type, second - sub-shape name) @@ -91,8 +91,8 @@ TypeSubShapeNamePair ModelHighAPI_Selection::typeSubShapeNamePair() const std::string ModelHighAPI_Selection::shapeType() const { switch(myVariantType) { - case VT_ResultSubShapePair: - return myResultSubShapePair.second.get() ? myResultSubShapePair.second->shapeTypeStr() : + case VT_ResultSubShapePair: + return myResultSubShapePair.second.get() ? myResultSubShapePair.second->shapeTypeStr() : myResultSubShapePair.first->shape()->shapeTypeStr(); case VT_TypeSubShapeNamePair: return myTypeSubShapeNamePair.first; } @@ -125,7 +125,7 @@ void ModelHighAPI_Selection::setDeflection(double theValue) if (myVariantType != VT_ResultSubShapePair) return; - AttributeDoublePtr aDeflectionAttr = + AttributeDoublePtr aDeflectionAttr = myResultSubShapePair.first->data()->real(ModelAPI_Result::DEFLECTION_ID()); aDeflectionAttr->setValue(theValue); diff --git a/src/ModelHighAPI/ModelHighAPI_Selection.h b/src/ModelHighAPI/ModelHighAPI_Selection.h index c0c65f26e..db78cb69e 100644 --- a/src/ModelHighAPI/ModelHighAPI_Selection.h +++ b/src/ModelHighAPI/ModelHighAPI_Selection.h @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Selection.h -// Purpose: +// Purpose: // // History: // 06/06/16 - Sergey POKHODENKO - Creation of the file @@ -20,7 +20,7 @@ class ModelAPI_AttributeSelection; class ModelAPI_AttributeSelectionList; class ModelAPI_Result; //-------------------------------------------------------------------------------------- -typedef std::pair, std::shared_ptr > +typedef std::pair, std::shared_ptr > ResultSubShapePair; typedef std::pair TypeSubShapeNamePair; //-------------------------------------------------------------------------------------- @@ -45,7 +45,7 @@ public: /// Constructor for result and sub-shape MODELHIGHAPI_EXPORT ModelHighAPI_Selection(const std::shared_ptr& theContext, - const std::shared_ptr& theSubShape = + const std::shared_ptr& theSubShape = std::shared_ptr()); /// Constructor for sub-shape by the textual Name MODELHIGHAPI_EXPORT @@ -56,11 +56,11 @@ public: virtual ~ModelHighAPI_Selection(); /// Fill attribute values - MODELHIGHAPI_EXPORT virtual + MODELHIGHAPI_EXPORT virtual void fillAttribute(const std::shared_ptr & theAttribute) const; /// Append to list attribute - MODELHIGHAPI_EXPORT virtual + MODELHIGHAPI_EXPORT virtual void appendToList(const std::shared_ptr & theAttribute) const; /// \return variant type. diff --git a/src/ModelHighAPI/ModelHighAPI_Services.cpp b/src/ModelHighAPI/ModelHighAPI_Services.cpp index 47f432041..db14a4601 100644 --- a/src/ModelHighAPI/ModelHighAPI_Services.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Services.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Services.cpp -// Purpose: +// Purpose: // // History: // 17/06/16 - Sergey POKHODENKO - Creation of the file @@ -58,7 +58,7 @@ std::string defaultPlane(const std::shared_ptr& theOrigin, return std::string(); // XOY or XOZ - if (fabs(theNormal->x()) < aTol && + if (fabs(theNormal->x()) < aTol && fabs(theDirX->x() - 1.0) < aTol && fabs(theDirX->y()) < aTol && fabs(theDirX->z()) < aTol) { // XOY if (fabs(theNormal->y()) < aTol && fabs(theNormal->z() - 1.0) < aTol) @@ -67,9 +67,9 @@ std::string defaultPlane(const std::shared_ptr& theOrigin, return std::string("XOZ"); } // YOZ - else if (fabs(theNormal->x() - 1.0) < aTol && + else if (fabs(theNormal->x() - 1.0) < aTol && fabs(theNormal->y()) < aTol && fabs(theNormal->z()) < aTol && - fabs(theDirX->x()) < aTol && fabs(theDirX->y() - 1.0) < aTol && + fabs(theDirX->x()) < aTol && fabs(theDirX->y() - 1.0) < aTol && fabs(theDirX->z()) < aTol) return std::string("YOZ"); diff --git a/src/ModelHighAPI/ModelHighAPI_Tools.cpp b/src/ModelHighAPI/ModelHighAPI_Tools.cpp index abb75c38b..76b914b19 100644 --- a/src/ModelHighAPI/ModelHighAPI_Tools.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Tools.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Tools.cpp -// Purpose: +// Purpose: // // History: // 07/06/16 - Sergey POKHODENKO - Creation of the file @@ -205,7 +205,7 @@ GeomAPI_Shape::ShapeType shapeTypeByStr(std::string theShapeTypeStr) { GeomAPI_Shape::ShapeType aShapeType = GeomAPI_Shape::SHAPE; - std::transform(theShapeTypeStr.begin(), theShapeTypeStr.end(), + std::transform(theShapeTypeStr.begin(), theShapeTypeStr.end(), theShapeTypeStr.begin(), ::tolower); if(theShapeTypeStr == "compound") { @@ -280,7 +280,7 @@ std::string storeFeatures(const std::string& theDocName, DocumentPtr theDoc, for(; allIter != allFeatures.end(); allIter++) { FeaturePtr aFeat = *allIter; if (theCompare) { - std::map::iterator + std::map::iterator aFeatFind = aDocFind->second.find(aFeat->name()); if (aFeatFind == aDocFind->second.end()) { return "Document '" + theDocName + "' feature '" + aFeat->name() + "' not found"; @@ -300,7 +300,7 @@ std::string storeFeatures(const std::string& theDocName, DocumentPtr theDoc, std::list::iterator aRes = allResults.begin(); for(; aRes != allResults.end(); aRes++) { // recoursively store features of sub-documents - if ((*aRes)->groupName() == ModelAPI_ResultPart::group()) { + if ((*aRes)->groupName() == ModelAPI_ResultPart::group()) { DocumentPtr aDoc = std::dynamic_pointer_cast(*aRes)->partDoc(); if (aDoc.get()) { std::string anError = storeFeatures((*aRes)->data()->name(), aDoc, theStore, theCompare); @@ -321,7 +321,7 @@ std::string storeFeatures(const std::string& theDocName, DocumentPtr theDoc, aLostName = aLostIter->first; } } - return "For document '" + theDocName + + return "For document '" + theDocName + "' the number of features is decreased, there is no feature '" + aLostName + "'"; } } diff --git a/src/ModelHighAPI/ModelHighAPI_Tools.h b/src/ModelHighAPI/ModelHighAPI_Tools.h index e999efdfc..74198a3cf 100644 --- a/src/ModelHighAPI/ModelHighAPI_Tools.h +++ b/src/ModelHighAPI/ModelHighAPI_Tools.h @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Tools.h -// Purpose: +// Purpose: // // History: // 07/06/16 - Sergey POKHODENKO - Creation of the file @@ -138,4 +138,4 @@ bool checkPythonDump(); //-------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------- -#endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_TOOLS_H_ */ +#endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_TOOLS_H_ */ diff --git a/src/ModuleBase/ModuleBase.h b/src/ModuleBase/ModuleBase.h index 436de02dd..c3cc22039 100644 --- a/src/ModuleBase/ModuleBase.h +++ b/src/ModuleBase/ModuleBase.h @@ -17,4 +17,4 @@ #endif #endif -#endif //MODULEBASE_H \ No newline at end of file +#endif //MODULEBASE_H diff --git a/src/ModuleBase/ModuleBase_ActionInfo.h b/src/ModuleBase/ModuleBase_ActionInfo.h index d796eb4b3..af40d1607 100644 --- a/src/ModuleBase/ModuleBase_ActionInfo.h +++ b/src/ModuleBase/ModuleBase_ActionInfo.h @@ -31,7 +31,7 @@ struct MODULEBASE_EXPORT ModuleBase_ActionInfo bool visible; //!< action's visibility state //! = true if the acton is a modal dialog box else property panel (==false by default) - bool modal; + bool modal; QIcon icon; //!< action's icon QString text; //!< action's text QString iconText; //!< action's descriptive icon text diff --git a/src/ModuleBase/ModuleBase_Dialog.cpp b/src/ModuleBase/ModuleBase_Dialog.cpp index 1e148ac72..2e255c161 100644 --- a/src/ModuleBase/ModuleBase_Dialog.cpp +++ b/src/ModuleBase/ModuleBase_Dialog.cpp @@ -21,11 +21,11 @@ #include -ModuleBase_Dialog::ModuleBase_Dialog(ModuleBase_IWorkshop* theParent, const QString& theId, - const std::string& theDescription) : - QDialog(theParent->desktop()), - myId(theId), - myDescription(theDescription), +ModuleBase_Dialog::ModuleBase_Dialog(ModuleBase_IWorkshop* theParent, const QString& theId, + const std::string& theDescription) : + QDialog(theParent->desktop()), + myId(theId), + myDescription(theDescription), myWorkshop(theParent), myActiveWidget(0) { diff --git a/src/ModuleBase/ModuleBase_Dialog.h b/src/ModuleBase/ModuleBase_Dialog.h index 6112c407a..ac34dd1b7 100644 --- a/src/ModuleBase/ModuleBase_Dialog.h +++ b/src/ModuleBase/ModuleBase_Dialog.h @@ -27,7 +27,7 @@ public: /// \param theParent a workshop object instance /// \param theId an Id of a feature /// \param theDescription an XML description of the feature - ModuleBase_Dialog(ModuleBase_IWorkshop* theParent, const QString& theId, + ModuleBase_Dialog(ModuleBase_IWorkshop* theParent, const QString& theId, const std::string& theDescription); /// Redefinition of virtual method diff --git a/src/ModuleBase/ModuleBase_DoubleSpinBox.cpp b/src/ModuleBase/ModuleBase_DoubleSpinBox.cpp index 89b15fa14..090cf58f3 100644 --- a/src/ModuleBase/ModuleBase_DoubleSpinBox.cpp +++ b/src/ModuleBase/ModuleBase_DoubleSpinBox.cpp @@ -64,12 +64,12 @@ ModuleBase_DoubleSpinBox::ModuleBase_DoubleSpinBox(QWidget* theParent, int thePr // VSR 01/07/2010: Disable thousands separator for spin box // (to avoid inconsistency of double-2-string and string-2-double conversion) QLocale loc; - loc.setNumberOptions(loc.numberOptions() | - QLocale::OmitGroupSeparator | + loc.setNumberOptions(loc.numberOptions() | + QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator); setLocale(loc); - // MPV 15/09/2014: this must be set before setDecimals; + // MPV 15/09/2014: this must be set before setDecimals; // otherwise in release mode setDecimals may crash myPrecision = thePrecision; @@ -293,8 +293,8 @@ QValidator::State ModuleBase_DoubleSpinBox::validate(QString& str, int& pos) con if (overhead == 0) state = v.validate(str, pos); else { - if ((uint)(str.length()) >= overhead && - str.startsWith(pref) && + if ((uint)(str.length()) >= overhead && + str.startsWith(pref) && str.right(suff.length()) == suff) { QString core = str.mid(pref.length(), str.length() - overhead); int corePos = pos - pref.length(); @@ -364,7 +364,7 @@ bool ModuleBase_DoubleSpinBox::enableKeyPressEvent(const bool& theEnable) void ModuleBase_DoubleSpinBox::setValueEnabled(const bool& theEnable) { setReadOnly(!theEnable); - + QPalette aPal = palette(); aPal.setColor(QPalette::All, QPalette::Base, theEnable? myEnabledBaseColor : aPal.color(QPalette::Disabled, QPalette::Base)); diff --git a/src/ModuleBase/ModuleBase_DoubleSpinBox.h b/src/ModuleBase/ModuleBase_DoubleSpinBox.h index c26d17f03..982b1088d 100644 --- a/src/ModuleBase/ModuleBase_DoubleSpinBox.h +++ b/src/ModuleBase/ModuleBase_DoubleSpinBox.h @@ -57,7 +57,7 @@ Q_OBJECT bool enableKeyPressEvent(const bool& theEnable); /// Imitation of disable control value. If theEnable is false, the control becomes - /// read only and base color is disabled. + /// read only and base color is disabled. void setValueEnabled(const bool& theEnable); signals: diff --git a/src/ModuleBase/ModuleBase_Filter.h b/src/ModuleBase/ModuleBase_Filter.h index e7a1a639b..d3a58db9a 100644 --- a/src/ModuleBase/ModuleBase_Filter.h +++ b/src/ModuleBase/ModuleBase_Filter.h @@ -48,7 +48,7 @@ protected: protected: /// current instance of the OCC selection filter - Handle(SelectMgr_Filter) myFilter; + Handle(SelectMgr_Filter) myFilter; }; #endif //ModuleBase_Filter diff --git a/src/ModuleBase/ModuleBase_FilterFactory.cpp b/src/ModuleBase/ModuleBase_FilterFactory.cpp index 7337c2259..b30ad90f5 100644 --- a/src/ModuleBase/ModuleBase_FilterFactory.cpp +++ b/src/ModuleBase/ModuleBase_FilterFactory.cpp @@ -19,7 +19,7 @@ void ModuleBase_FilterFactory::registerFilter(const std::string& theID, ModuleBase_Filter* theFilter) { if (myIDs.find(theID) != myIDs.end()) { - Events_InfoMessage("ModuleBase_FilterFactory", + Events_InfoMessage("ModuleBase_FilterFactory", "Filter %1 is already registered").arg(theID).send(); } else { myIDs[theID] = theFilter; @@ -54,7 +54,7 @@ void ModuleBase_FilterFactory::filters(const std::string& theFeatureID, { SelectMgr_ListOfFilter aFilters; - std::map >::const_iterator aFeature = + std::map >::const_iterator aFeature = myAttrs.find(theFeatureID); if (aFeature != myAttrs.cend()) { std::map::const_iterator anAttr = aFeature->second.find(theAttrID); diff --git a/src/ModuleBase/ModuleBase_FilterValidated.h b/src/ModuleBase/ModuleBase_FilterValidated.h index ac8de7079..2d7f92f83 100644 --- a/src/ModuleBase/ModuleBase_FilterValidated.h +++ b/src/ModuleBase/ModuleBase_FilterValidated.h @@ -39,7 +39,7 @@ public: * \param theOwner the result of selection * \return whether the owner is selectable in the viewer */ - Standard_EXPORT virtual + Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const; DEFINE_STANDARD_RTTI(ModuleBase_FilterValidated) diff --git a/src/ModuleBase/ModuleBase_IErrorMgr.cpp b/src/ModuleBase/ModuleBase_IErrorMgr.cpp index 293c2b80f..d33d88992 100644 --- a/src/ModuleBase/ModuleBase_IErrorMgr.cpp +++ b/src/ModuleBase/ModuleBase_IErrorMgr.cpp @@ -23,7 +23,7 @@ ModuleBase_IErrorMgr::~ModuleBase_IErrorMgr() void ModuleBase_IErrorMgr::setPropertyPanel(ModuleBase_IPropertyPanel* theProp) { - myPropertyPanel = theProp; + myPropertyPanel = theProp; if (myPropertyPanel) { foreach(const ModuleBase_ModelWidget* aWgt, myPropertyPanel->modelWidgets()) { diff --git a/src/ModuleBase/ModuleBase_IModule.cpp b/src/ModuleBase/ModuleBase_IModule.cpp index 6327f8c10..a96d676e5 100644 --- a/src/ModuleBase/ModuleBase_IModule.cpp +++ b/src/ModuleBase/ModuleBase_IModule.cpp @@ -32,7 +32,7 @@ #include ModuleBase_IModule::ModuleBase_IModule(ModuleBase_IWorkshop* theParent) - : QObject(theParent), myWorkshop(theParent) + : QObject(theParent), myWorkshop(theParent) { connect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged())); @@ -72,11 +72,11 @@ void ModuleBase_IModule::launchModal(const QString& theCmdId) void ModuleBase_IModule::launchOperation(const QString& theCmdId) { /// selection should be obtained from workshop before ask if the operation can be started as - /// the canStartOperation method performs commit/abort of previous operation. + /// the canStartOperation method performs commit/abort of previous operation. /// Sometimes commit/abort may cause selection clear(Sketch operation) as a result /// it will be lost and is not used for preselection. ModuleBase_ISelection* aSelection = myWorkshop->selection(); - QList aPreSelected = + QList aPreSelected = aSelection->getSelected(ModuleBase_ISelection::AllControls); if (!myWorkshop->canStartOperation(theCmdId)) @@ -235,7 +235,7 @@ bool ModuleBase_IModule::canActivateSelection(const ObjectPtr& theObject) const return !aFOperation || !aFOperation->hasObject(theObject); } -void ModuleBase_IModule::operationResumed(ModuleBase_Operation* theOperation) +void ModuleBase_IModule::operationResumed(ModuleBase_Operation* theOperation) { emit resumed(theOperation); } diff --git a/src/ModuleBase/ModuleBase_IModule.h b/src/ModuleBase/ModuleBase_IModule.h index d4393e3ac..b74ea6c07 100755 --- a/src/ModuleBase/ModuleBase_IModule.h +++ b/src/ModuleBase/ModuleBase_IModule.h @@ -66,13 +66,13 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject /// Restores the current selection virtual void restoreSelection() {}; - /// Reads description of features from XML file + /// Reads description of features from XML file virtual void createFeatures(); /// Called on creation of menu item in desktop virtual void actionCreated(QAction*); - /// Launching of a edit operation on the feature + /// Launching of a edit operation on the feature /// \param theFeature feature for editing virtual void editFeature(FeaturePtr theFeature); @@ -126,9 +126,9 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject /// Creates custom widgets for property panel /// \param theType a type of widget /// \param theParent the parent object - /// \param theWidgetApi the widget configuration. + /// \param theWidgetApi the widget configuration. /// The attribute of the model widget is obtained from - virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType, + virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType, QWidget* theParent, Config_WidgetAPI* theWidgetApi) { @@ -145,7 +145,7 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject /// It is called as on clearing of property panel as on filling with new widgets virtual void propertyPanelDefined(ModuleBase_Operation* theOperation) {} - /// Have an opportunity to create widgets for the current operation + /// Have an opportunity to create widgets for the current operation /// instead of standard creation in workshop /// \param theOperation a started operation /// \param theWidgets a list of created widgets @@ -207,7 +207,7 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject /// Return true if the custom presentation is activated /// \param theFlag a flag of level of customization, which means that only part of sub-elements /// \return boolean value - virtual bool isCustomPrsActivated(const ModuleBase_CustomizeFlag& theFlag) const + virtual bool isCustomPrsActivated(const ModuleBase_CustomizeFlag& theFlag) const { return false; }; /// Activate custom presentation for the object. Default realization is empty. @@ -225,7 +225,7 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject const bool theUpdateViewer) {} /// Modifies the given presentation in the custom way. - virtual bool customisePresentation(std::shared_ptr theResult, + virtual bool customisePresentation(std::shared_ptr theResult, AISObjectPtr thePrs, GeomCustomPrsPtr theCustomPrs) { return false; }; diff --git a/src/ModuleBase/ModuleBase_IPrefMgr.h b/src/ModuleBase/ModuleBase_IPrefMgr.h index 3d4e7cefd..78e6e5fe9 100644 --- a/src/ModuleBase/ModuleBase_IPrefMgr.h +++ b/src/ModuleBase/ModuleBase_IPrefMgr.h @@ -36,7 +36,7 @@ public: * \param theName - name of the resource * Returns Id of the ctreated item */ - virtual int addPreference(const QString& theLbl, int pId, + virtual int addPreference(const QString& theLbl, int pId, SUIT_PreferenceMgr::PrefItemType theType, const QString& theSection, const QString& theName ) = 0; diff --git a/src/ModuleBase/ModuleBase_IPropertyPanel.h b/src/ModuleBase/ModuleBase_IPropertyPanel.h index f463cefbe..58683af41 100644 --- a/src/ModuleBase/ModuleBase_IPropertyPanel.h +++ b/src/ModuleBase/ModuleBase_IPropertyPanel.h @@ -64,11 +64,11 @@ public: /// Sets widget processed by preselection virtual void setPreselectionWidget(ModuleBase_ModelWidget* theWidget) = 0; - /// Returns the first widget, where canAcceptFocus returns true + /// Returns the first widget, where canAcceptFocus returns true /// \return a widget or null ModuleBase_ModelWidget* findFirstAcceptingValueWidget(); - /// Returns the first widget, where canAcceptFocus returns true + /// Returns the first widget, where canAcceptFocus returns true /// \return a widget or null static ModuleBase_ModelWidget* findFirstAcceptingValueWidget( const QList& theWidgets); diff --git a/src/ModuleBase/ModuleBase_ISelection.h b/src/ModuleBase/ModuleBase_ISelection.h index a8c2707c4..62e017eea 100644 --- a/src/ModuleBase/ModuleBase_ISelection.h +++ b/src/ModuleBase/ModuleBase_ISelection.h @@ -37,10 +37,10 @@ class ModuleBase_ISelection /// Returns a list of viewer selected presentations /// \return list of presentations - virtual QList> + virtual QList> getSelected(const SelectionPlace& thePlace = Browser) const = 0; - /// The values are appended to the first parameter list if the first list does not contain + /// The values are appended to the first parameter list if the first list does not contain /// an item with the same object /// \param theValues a list of new values /// \param theValuesTo a list, that will be changed @@ -95,7 +95,7 @@ class ModuleBase_ISelection //! Return the IO from the viewer presentation. //! \param thePrs a selected object //! \return an interactive object - virtual MODULEBASE_EXPORT + virtual MODULEBASE_EXPORT Handle(AIS_InteractiveObject) getIO(const std::shared_ptr& thePrs) = 0; //! Wraps the object list into the viewer prs list diff --git a/src/ModuleBase/ModuleBase_IViewWindow.h b/src/ModuleBase/ModuleBase_IViewWindow.h index 597d884a3..ed767e032 100644 --- a/src/ModuleBase/ModuleBase_IViewWindow.h +++ b/src/ModuleBase/ModuleBase_IViewWindow.h @@ -20,7 +20,7 @@ public: ModuleBase_IViewWindow(); /// Virtual destructor virtual ~ModuleBase_IViewWindow(); - + /// Returns OCCT object which contains 3d view object virtual Handle(V3d_View) v3dView() const = 0; diff --git a/src/ModuleBase/ModuleBase_IViewer.h b/src/ModuleBase/ModuleBase_IViewer.h index d8a20cb42..c2f46ed9c 100644 --- a/src/ModuleBase/ModuleBase_IViewer.h +++ b/src/ModuleBase/ModuleBase_IViewer.h @@ -101,10 +101,10 @@ Q_OBJECT /// Remember a scale factor for the view object /// \param theView a view object /// \param theVal a scale factor - void SetScale(const Handle(V3d_View)& theView, const double theVal) + void SetScale(const Handle(V3d_View)& theView, const double theVal) { myWindowScale[theView] = theVal; } - /// Method returns True if the viewer can process editing objects + /// Method returns True if the viewer can process editing objects /// by mouse drugging. If this is impossible thet it has to return False. virtual bool canDragByMouse() const { return true; } diff --git a/src/ModuleBase/ModuleBase_IWorkshop.h b/src/ModuleBase/ModuleBase_IWorkshop.h index 5588ef63c..356196f0c 100644 --- a/src/ModuleBase/ModuleBase_IWorkshop.h +++ b/src/ModuleBase/ModuleBase_IWorkshop.h @@ -69,7 +69,7 @@ Q_OBJECT //! Returns the factory of selection filters : the only one instance per application ModuleBase_FilterFactory* selectionFilters() const; - + //! Returns currently active operation virtual ModuleBase_Operation* currentOperation() const = 0; @@ -102,7 +102,7 @@ Q_OBJECT //! \param theAIS a presentation virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const = 0; - //! Select features clearing previous selection. + //! Select features clearing previous selection. //! If the list is empty then selection will be cleared //! \param theValues a list of presentations virtual void setSelected(const QList>& theValues) = 0; diff --git a/src/ModuleBase/ModuleBase_ModelWidget.h b/src/ModuleBase/ModuleBase_ModelWidget.h index 06d3729e5..91c83708b 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.h +++ b/src/ModuleBase/ModuleBase_ModelWidget.h @@ -44,7 +44,7 @@ Q_OBJECT enum EnableState { On, /// the widget value is always enabled Off, /// the widget value is always disabled /// the widget value enable state is defined in preferences - DefinedInPreferences }; + DefinedInPreferences }; /// Constructor /// \param theParent the parent object @@ -77,13 +77,13 @@ Q_OBJECT /// \return the boolean result bool isInternal() const { return myIsInternal; } - /// Returns true, if the obligatory value of the widget is + /// Returns true, if the obligatory value of the widget is /// not defined in the XML or has true value /// \return the boolean result bool isObligatory() const { return myIsObligatory; } - /// Returns true, if the widget value is enabled and might be modified manualy. - /// It returns false if the application preferences allow having disabled value + /// Returns true, if the widget value is enabled and might be modified manualy. + /// It returns false if the application preferences allow having disabled value /// and the internal state tells to disable /// \return the boolean result virtual bool isValueEnabled() const; @@ -130,7 +130,7 @@ Q_OBJECT /// \param theValues a list of presentations virtual void getHighlighted(QList>& theValues) {}; - /// Checks if the selection presentation is valid in widget + /// Checks if the selection presentation is valid in widget /// \param theValue a selected presentation in the view /// \return a boolean value virtual bool isValidSelectionCustom(const std::shared_ptr& theValue) @@ -139,7 +139,7 @@ Q_OBJECT /// Returns widget validator, by default it is NULL. To be created in a child if necessary ModuleBase_WidgetValidator* widgetValidator() { return myWidgetValidator; } - /// Restore value from attribute data to the widget's control. + /// Restore value from attribute data to the widget's control. /// Emits signals before and after store /// \return True in success bool restoreValue(); @@ -148,7 +148,7 @@ Q_OBJECT /// \return True in success bool storeValue(); - /// Set focus to the first control of the current widget. + /// Set focus to the first control of the current widget. /// The focus policy of the control is checked. /// If the widget has the NonFocus focus policy, it is skipped. /// \return the state whether the widget can accept the focus @@ -320,7 +320,7 @@ protected slots: FeaturePtr myFeature; /// Flag which shows that current operation is in editing mode - bool myIsEditing; + bool myIsEditing; /// Flag which shows whether current widget is obligatory /// The non-obligatory widgets should not accept the focus in the property panel @@ -336,7 +336,7 @@ private: /// Value should be computed on execute, like radius for circle's constraint (can not be zero) bool myIsComputedDefault; - /// the default value, which is defined in the XML for this attribute + /// the default value, which is defined in the XML for this attribute std::string myDefaultValue; /// an XML internal state diff --git a/src/ModuleBase/ModuleBase_Operation.cpp b/src/ModuleBase/ModuleBase_Operation.cpp index af08c48fd..853d9fc5f 100644 --- a/src/ModuleBase/ModuleBase_Operation.cpp +++ b/src/ModuleBase/ModuleBase_Operation.cpp @@ -153,9 +153,9 @@ void ModuleBase_Operation::onValueStateChanged(int thePreviousState) } } -void ModuleBase_Operation::setPropertyPanel(ModuleBase_IPropertyPanel* theProp) -{ - myPropertyPanel = theProp; +void ModuleBase_Operation::setPropertyPanel(ModuleBase_IPropertyPanel* theProp) +{ + myPropertyPanel = theProp; } bool ModuleBase_Operation::isGranted(QString theId) const diff --git a/src/ModuleBase/ModuleBase_Operation.h b/src/ModuleBase/ModuleBase_Operation.h index 2e04b5b07..fb47d268b 100644 --- a/src/ModuleBase/ModuleBase_Operation.h +++ b/src/ModuleBase/ModuleBase_Operation.h @@ -64,7 +64,7 @@ Q_OBJECT void setGrantedOperationIds(const QStringList& theList); /// Must return true if this operation can be launched as nested for any current operation - /// and it is not necessary to check this operation on validity. By default + /// and it is not necessary to check this operation on validity. By default /// the operation is not granted. /// The method has to be redefined for granted operations. virtual bool isGranted(QString theId) const; diff --git a/src/ModuleBase/ModuleBase_OperationAction.cpp b/src/ModuleBase/ModuleBase_OperationAction.cpp index ed025343d..953b86727 100755 --- a/src/ModuleBase/ModuleBase_OperationAction.cpp +++ b/src/ModuleBase/ModuleBase_OperationAction.cpp @@ -20,7 +20,7 @@ ModuleBase_OperationAction::~ModuleBase_OperationAction() bool ModuleBase_OperationAction::commit() { - // the action is supposed to perform a single modification, + // the action is supposed to perform a single modification, // so the operation returns modified state setIsModified(true); diff --git a/src/ModuleBase/ModuleBase_OperationDescription.h b/src/ModuleBase/ModuleBase_OperationDescription.h index 3fdc27b1d..18fde94b4 100644 --- a/src/ModuleBase/ModuleBase_OperationDescription.h +++ b/src/ModuleBase/ModuleBase_OperationDescription.h @@ -62,13 +62,13 @@ class MODULEBASE_EXPORT ModuleBase_OperationDescription private: //!< Next fields could be extracted into a subclass; /// the operation identifier - QString myOperationId; + QString myOperationId; /// the short description of the opertaion - QString myDescription; + QString myDescription; /// the xml definition - QString myXmlRepresentation; + QString myXmlRepresentation; }; #endif //ModuleBase_OperationDescription_H diff --git a/src/ModuleBase/ModuleBase_OperationFeature.cpp b/src/ModuleBase/ModuleBase_OperationFeature.cpp index 406d8b3a9..099d42b6f 100755 --- a/src/ModuleBase/ModuleBase_OperationFeature.cpp +++ b/src/ModuleBase/ModuleBase_OperationFeature.cpp @@ -206,13 +206,13 @@ bool ModuleBase_OperationFeature::hasObject(ObjectPtr theObj) const } #ifdef DEBUG_DO_NOT_ACTIVATE_SUB_FEATURE if (aFeature->isMacro()) { - // macro feature may refers to sub-features, + // macro feature may refers to sub-features, // which also should be deactivated when the operation // is active, e.g. rectangle'lines. FeaturePtr anObjectFeature = ModelAPI_Feature::feature(theObj); std::list anAttributes = aFeature->data()->attributes( ModelAPI_AttributeRefList::typeId()); - std::list::const_iterator + std::list::const_iterator anIt = anAttributes.begin(), aLast = anAttributes.end(); bool aFoundObject = false; for (; anIt != aLast && !aFoundObject; anIt++) { @@ -464,7 +464,7 @@ void ModuleBase_OperationFeature::initSelection( for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) aCurrentFeatureResults.append(*aIt); } - + if (aCurrentFeatureResults.empty()) /// filtering of selection is not necessary setPreselection(thePreSelected); else { // create preselection list without results of current feature @@ -488,7 +488,7 @@ void ModuleBase_OperationFeature::clearPreselection() myPreSelection.clear(); } -void ModuleBase_OperationFeature::setPropertyPanel(ModuleBase_IPropertyPanel* theProp) +void ModuleBase_OperationFeature::setPropertyPanel(ModuleBase_IPropertyPanel* theProp) { ModuleBase_Operation::setPropertyPanel(theProp); @@ -505,7 +505,7 @@ void ModuleBase_OperationFeature::setPropertyPanel(ModuleBase_IPropertyPanel* th } // Do not activate widgets by default if the current operation is editing operation - // Because we don't know which widget is going to be edited. + // Because we don't know which widget is going to be edited. if (!isEditOperation()) { // 4. activate the first obligatory widget theProp->activateNextWidget(NULL); diff --git a/src/ModuleBase/ModuleBase_OperationFeature.h b/src/ModuleBase/ModuleBase_OperationFeature.h index 7e1ffb291..a13b2fa80 100755 --- a/src/ModuleBase/ModuleBase_OperationFeature.h +++ b/src/ModuleBase/ModuleBase_OperationFeature.h @@ -114,7 +114,7 @@ Q_OBJECT virtual ModuleBase_ModelWidget* activateByPreselection(const std::string& theGreedAttributeId); /// If the operation works with feature which is sub-feature of another one - /// then this variable has to be initialised by parent feature + /// then this variable has to be initialised by parent feature /// before operation feature creating void setParentFeature(CompositeFeaturePtr theParent); @@ -175,11 +175,11 @@ Q_OBJECT /// Editing feature flag bool myIsEditing; - /// List of pre-selected object + /// List of pre-selected object QList> myPreSelection; /// If the operation works with feature which is sub-feature of another one - /// then this variable has to be initialised by parent feature + /// then this variable has to be initialised by parent feature /// before operation feature creating CompositeFeaturePtr myParentFeature; diff --git a/src/ModuleBase/ModuleBase_PageBase.cpp b/src/ModuleBase/ModuleBase_PageBase.cpp index 272cb3847..daf1bd034 100644 --- a/src/ModuleBase/ModuleBase_PageBase.cpp +++ b/src/ModuleBase/ModuleBase_PageBase.cpp @@ -59,9 +59,9 @@ void ModuleBase_PageBase::clearPage() // Issue #460: this patch is necessary since the row stretch information // is stored independently on the items: when the items are removed - // from the layout the stretch information is kept, so in the next + // from the layout the stretch information is kept, so in the next // filling of the layout some "additional" (old) rows may be stretched - // without necessity. + // without necessity. // In this patch we clear the stretch information specifying the default value: 0. QGridLayout* aLayout = dynamic_cast( pageLayout() ); if( aLayout ) diff --git a/src/ModuleBase/ModuleBase_PagedContainer.cpp b/src/ModuleBase/ModuleBase_PagedContainer.cpp index 0ae12a1fa..42d48907f 100644 --- a/src/ModuleBase/ModuleBase_PagedContainer.cpp +++ b/src/ModuleBase/ModuleBase_PagedContainer.cpp @@ -18,7 +18,7 @@ #include -ModuleBase_PagedContainer::ModuleBase_PagedContainer(QWidget* theParent, +ModuleBase_PagedContainer::ModuleBase_PagedContainer(QWidget* theParent, const Config_WidgetAPI* theData) : ModuleBase_ModelWidget(theParent, theData), myIsFocusOnCurrentPage(false) diff --git a/src/ModuleBase/ModuleBase_Preferences.cpp b/src/ModuleBase/ModuleBase_Preferences.cpp index e26cf8d34..998665852 100644 --- a/src/ModuleBase/ModuleBase_Preferences.cpp +++ b/src/ModuleBase/ModuleBase_Preferences.cpp @@ -189,7 +189,7 @@ public: /// \param theMgr a preferences manager ModuleBase_PrefMgr(ModuleBase_PreferencesMgr* theMgr):myMgr(theMgr) {} - virtual int addPreference(const QString& theLbl, int pId, + virtual int addPreference(const QString& theLbl, int pId, SUIT_PreferenceMgr::PrefItemType theType, const QString& theSection, const QString& theName ) { @@ -210,7 +210,7 @@ private: //********************************************************** //********************************************************** //********************************************************** -ModuleBase_PreferencesDlg::ModuleBase_PreferencesDlg(SUIT_ResourceMgr* theResurces, +ModuleBase_PreferencesDlg::ModuleBase_PreferencesDlg(SUIT_ResourceMgr* theResurces, QWidget* theParent) : QDialog(theParent), myIsChanged(false) @@ -294,13 +294,13 @@ void ModuleBase_PreferencesDlg::createViewerPage(int thePageId) // Create other parameters group in viewer tab int selectionGroup = myPreferences->addItem(tr("Default selection"), viewTab); myPreferences->setItemProperty("columns", 3, selectionGroup); - myPreferences->addItem(tr("Faces"), selectionGroup, + myPreferences->addItem(tr("Faces"), selectionGroup, SUIT_PreferenceMgr::Bool, ModuleBase_Preferences::VIEWER_SECTION, "face-selection"); - myPreferences->addItem(tr("Edges"), selectionGroup, + myPreferences->addItem(tr("Edges"), selectionGroup, SUIT_PreferenceMgr::Bool, ModuleBase_Preferences::VIEWER_SECTION, "edge-selection"); - myPreferences->addItem(tr("Vertices"), selectionGroup, + myPreferences->addItem(tr("Vertices"), selectionGroup, SUIT_PreferenceMgr::Bool, ModuleBase_Preferences::VIEWER_SECTION, "vertex-selection"); @@ -320,7 +320,7 @@ void ModuleBase_PreferencesDlg::createMenuPage(int thePageId) myPreferences->setItemProperty("columns", 1, aSizeGroup); int aRowsNb = myPreferences->addItem(tr("Number of rows"), aSizeGroup, - SUIT_PreferenceMgr::IntSpin, + SUIT_PreferenceMgr::IntSpin, ModuleBase_Preferences::MENU_SECTION, "rows_number"); myPreferences->setItemProperty("min", 1, aRowsNb); diff --git a/src/ModuleBase/ModuleBase_Preferences.h b/src/ModuleBase/ModuleBase_Preferences.h index cae9af663..d666868a5 100644 --- a/src/ModuleBase/ModuleBase_Preferences.h +++ b/src/ModuleBase/ModuleBase_Preferences.h @@ -146,7 +146,7 @@ protected slots: /// Create a viewer page in dialog box void createViewerPage(int thePageId); - + /// Create menu properties page in the dialog box void createMenuPage(int thePageId); diff --git a/src/ModuleBase/ModuleBase_ResultPrs.cpp b/src/ModuleBase/ModuleBase_ResultPrs.cpp index 3a29f95aa..19ceb3e9b 100755 --- a/src/ModuleBase/ModuleBase_ResultPrs.cpp +++ b/src/ModuleBase/ModuleBase_ResultPrs.cpp @@ -52,7 +52,7 @@ ModuleBase_ResultPrs::ModuleBase_ResultPrs(ResultPtr theResult) TopoDS_Shape aShape = aShapePtr->impl(); Set(aShape); Handle(Prs3d_Drawer) aDrawer = Attributes(); - if (aDrawer->HasOwnPointAspect()) + if (aDrawer->HasOwnPointAspect()) aDrawer->PointAspect()->SetTypeOfMarker(Aspect_TOM_PLUS); else aDrawer->SetPointAspect(new Prs3d_PointAspect(Aspect_TOM_PLUS, Quantity_NOC_YELLOW, 1.)); @@ -71,7 +71,7 @@ void ModuleBase_ResultPrs::setAdditionalSelectionPriority(const int thePriority) void ModuleBase_ResultPrs::Compute( const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, - const Handle(Prs3d_Presentation)& thePresentation, + const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode) { std::shared_ptr aShapePtr = ModelAPI_Tools::shape(myResult); @@ -86,7 +86,7 @@ void ModuleBase_ResultPrs::Compute( AIS_Shape::Compute(thePresentationManager, thePresentation, theMode); if (!aReadyToDisplay) { - Events_InfoMessage("ModuleBase_ResultPrs", + Events_InfoMessage("ModuleBase_ResultPrs", "An empty AIS presentation: ModuleBase_ResultPrs").send(); static const Events_ID anEvent = Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION); ModelAPI_EventCreator::get()->sendUpdated(myResult, anEvent); @@ -123,13 +123,13 @@ void ModuleBase_ResultPrs::ComputeSelection(const Handle(SelectMgr_Selection)& a TopoDS_Shape aShape = aShapePtr->impl(); int aPriority = StdSelect_BRepSelectionTool::GetStandardPriority(aShape, TopAbs_COMPSOLID); /// It is important to have priority for the shape of comp solid result less than priority - /// for the presentation shape which is a sub-result. + /// for the presentation shape which is a sub-result. /// Reason is to select the sub-objects before: #1592 aPriority = aPriority - 1; double aDeflection = Prs3d::GetDeflection(aShape, myDrawer); Handle(ModuleBase_BRepOwner) aOwner = new ModuleBase_BRepOwner(aShape, aPriority); - StdSelect_BRepSelectionTool::ComputeSensitive(aShape, aOwner, aSelection, + StdSelect_BRepSelectionTool::ComputeSensitive(aShape, aOwner, aSelection, aDeflection, myDrawer->HLRAngle(), 9, 500); for (aSelection->Init(); aSelection->More(); aSelection->Next()) { @@ -142,12 +142,12 @@ void ModuleBase_ResultPrs::ComputeSelection(const Handle(SelectMgr_Selection)& a } } //AIS_Shape::ComputeSelection(aSelection, 0); - } + } AIS_Shape::ComputeSelection(aSelection, aMode); if (myAdditionalSelectionPriority > 0) { for (aSelection->Init(); aSelection->More(); aSelection->Next()) { - Handle(SelectBasics_EntityOwner) aBasicsOwner = + Handle(SelectBasics_EntityOwner) aBasicsOwner = aSelection->Sensitive()->BaseSensitive()->OwnerId(); if (!aBasicsOwner.IsNull()) aBasicsOwner->Set(aBasicsOwner->Priority() + myAdditionalSelectionPriority); @@ -174,7 +174,7 @@ void ModuleBase_ResultPrs::appendWiresSelection(const Handle(SelectMgr_Selection } } -void ModuleBase_ResultPrs::HilightSelected(const Handle(PrsMgr_PresentationManager3d)& thePM, +void ModuleBase_ResultPrs::HilightSelected(const Handle(PrsMgr_PresentationManager3d)& thePM, const SelectMgr_SequenceOfOwner& theOwners) { Handle(SelectMgr_EntityOwner) anOwner; @@ -198,9 +198,9 @@ void ModuleBase_ResultPrs::HilightSelected(const Handle(PrsMgr_PresentationManag } } } - -void ModuleBase_ResultPrs::HilightOwnerWithColor(const Handle(PrsMgr_PresentationManager3d)& thePM, - const Quantity_NameOfColor theColor, + +void ModuleBase_ResultPrs::HilightOwnerWithColor(const Handle(PrsMgr_PresentationManager3d)& thePM, + const Quantity_NameOfColor theColor, const Handle(SelectMgr_EntityOwner)& theOwner) { Handle(StdSelect_BRepOwner) aOwner = Handle(StdSelect_BRepOwner)::DownCast(theOwner); diff --git a/src/ModuleBase/ModuleBase_ResultPrs.h b/src/ModuleBase/ModuleBase_ResultPrs.h index 597b3b8e7..dc7aff38d 100644 --- a/src/ModuleBase/ModuleBase_ResultPrs.h +++ b/src/ModuleBase/ModuleBase_ResultPrs.h @@ -31,8 +31,8 @@ public: /// \param aShape an owner shape /// \param aPriority drawig priority /// \param ComesFromDecomposition decomposition flag - ModuleBase_BRepOwner(const TopoDS_Shape& aShape, - const Standard_Integer aPriority = 0, + ModuleBase_BRepOwner(const TopoDS_Shape& aShape, + const Standard_Integer aPriority = 0, const Standard_Boolean ComesFromDecomposition = Standard_False) : StdSelect_BRepOwner(aShape, aPriority, ComesFromDecomposition) {} @@ -40,7 +40,7 @@ public: /// \param aPM a presentations manager /// \param aCol a color /// \param aMode a drawing mode - virtual void HilightWithColor (const Handle(PrsMgr_PresentationManager3d)& aPM, + virtual void HilightWithColor (const Handle(PrsMgr_PresentationManager3d)& aPM, const Quantity_NameOfColor aCol, const Standard_Integer aMode = 0) { Selectable()->HilightOwnerWithColor(aPM, aCol, this); } @@ -73,7 +73,7 @@ public: //! Method which draws selected owners ( for fast presentation draw ) Standard_EXPORT virtual void HilightSelected(const Handle(PrsMgr_PresentationManager3d)& thePM, const SelectMgr_SequenceOfOwner& theOwners); - + //! Method which hilight an owner belonging to //! this selectable object ( for fast presentation draw ) Standard_EXPORT virtual void HilightOwnerWithColor( @@ -85,7 +85,7 @@ public: /// Returns selection priorities that will be added to created selection owner /// \return integer value - Standard_EXPORT int getAdditionalSelectionPriority() const + Standard_EXPORT int getAdditionalSelectionPriority() const { return myAdditionalSelectionPriority; } /// Appends a special priority for the mode of selection @@ -117,7 +117,7 @@ private: /// Original shape of the result object TopoDS_Shape myOriginalShape; - /// selection priority that will be added to the standard + /// selection priority that will be added to the standard /// selection priority of the selection entity int myAdditionalSelectionPriority; }; diff --git a/src/ModuleBase/ModuleBase_SelectionValidator.h b/src/ModuleBase/ModuleBase_SelectionValidator.h index 1f686f0cf..e88994c85 100644 --- a/src/ModuleBase/ModuleBase_SelectionValidator.h +++ b/src/ModuleBase/ModuleBase_SelectionValidator.h @@ -26,7 +26,7 @@ public: /// Returns True if selection is valid /// \param theSelection selection instance /// \param theOperation - current operation (can be 0) - virtual bool isValid(const ModuleBase_ISelection* theSelection, + virtual bool isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const; }; diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index adf14c58a..29a44fd5e 100755 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -221,7 +221,7 @@ QPixmap lighter(const QString& theIcon, const int theLighterValue) void setSpinText(ModuleBase_ParamSpinBox* theSpin, const QString& theText) { - if (theSpin->text() == theText) + if (theSpin->text() == theText) return; // In order to avoid extra text setting because it will // reset cursor position in control @@ -445,7 +445,7 @@ QString activeOwners(Handle(AIS_InteractiveContext)& theContext, const bool theS aPtrStr << "[" << anOwner.Access() << "]"; anInfo += aPtrStr.str().c_str(); - Handle(AIS_InteractiveObject) aAISObj = + Handle(AIS_InteractiveObject) aAISObj = Handle(AIS_InteractiveObject)::DownCast(anOwner->Selectable()); if (!aAISObj.IsNull()) { std::ostringstream aPtrStr; @@ -469,7 +469,7 @@ QString activeOwners(Handle(AIS_InteractiveContext)& theContext, const bool theS return aValue; } -QString selectedOwners(Handle(AIS_InteractiveContext)& theContext, +QString selectedOwners(Handle(AIS_InteractiveContext)& theContext, const bool theShapeInfoOnly = true) { QStringList anObjects; @@ -564,7 +564,7 @@ void checkObjects(const QObjectPtrList& theObjects, bool& hasResult, bool& hasFe hasResult |= (aResult.get() != NULL); hasFeature |= (aFeature.get() != NULL); hasParameter |= (aConstruction.get() != NULL); - if (hasFeature) + if (hasFeature) hasCompositeOwner |= (ModelAPI_Tools::compositeOwner(aFeature) != NULL); if (hasFeature && hasResult && hasParameter && hasCompositeOwner) break; @@ -651,7 +651,7 @@ ObjectPtr getObject(const AttributePtr& theAttribute) anObject = anAttr->context(); } if (anAttrType == ModelAPI_AttributeReference::typeId()) { - AttributeReferencePtr anAttr = + AttributeReferencePtr anAttr = std::dynamic_pointer_cast(theAttribute); if (anAttr.get() != NULL) anObject = anAttr->value(); @@ -709,7 +709,7 @@ void getParameters(QStringList& theParameters) } } -std::string findGreedAttribute(ModuleBase_IWorkshop* theWorkshop, +std::string findGreedAttribute(ModuleBase_IWorkshop* theWorkshop, const FeaturePtr& theFeature) { std::string anAttributeId; @@ -735,7 +735,7 @@ bool hasObject(const AttributePtr& theAttribute, const ObjectPtr& theObject, std::string aType = theAttribute->attributeType(); if (aType == ModelAPI_AttributeReference::typeId()) { - AttributeReferencePtr aRef = + AttributeReferencePtr aRef = std::dynamic_pointer_cast(theAttribute); ObjectPtr aObject = aRef->value(); aHasObject = aObject && aObject->isSame(theObject); @@ -743,7 +743,7 @@ bool hasObject(const AttributePtr& theAttribute, const ObjectPtr& theObject, // aRef->setValue(theObject); //} } else if (aType == ModelAPI_AttributeRefAttr::typeId()) { - AttributeRefAttrPtr aRefAttr = + AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast(theAttribute); AttributePtr anAttribute = theWorkshop->module()->findAttribute(theObject, theShape); @@ -772,14 +772,14 @@ bool hasObject(const AttributePtr& theAttribute, const ObjectPtr& theObject, aHasObject = aSelectionListAttr->isInList(aResult, theShape, theTemporarily); } else if (aType == ModelAPI_AttributeRefList::typeId()) { - AttributeRefListPtr aRefListAttr = + AttributeRefListPtr aRefListAttr = std::dynamic_pointer_cast(theAttribute); aHasObject = aRefListAttr->isInList(theObject); //if (!theCheckIfAttributeHasObject || !aRefListAttr->isInList(theObject)) // aRefListAttr->append(theObject); } else if (aType == ModelAPI_AttributeRefAttrList::typeId()) { - AttributeRefAttrListPtr aRefAttrListAttr = + AttributeRefAttrListPtr aRefAttrListAttr = std::dynamic_pointer_cast(theAttribute); AttributePtr anAttribute = theWorkshop->module()->findAttribute(theObject, theShape); @@ -807,14 +807,14 @@ bool setObject(const AttributePtr& theAttribute, const ObjectPtr& theObject, bool isDone = true; std::string aType = theAttribute->attributeType(); if (aType == ModelAPI_AttributeReference::typeId()) { - AttributeReferencePtr aRef = + AttributeReferencePtr aRef = std::dynamic_pointer_cast(theAttribute); ObjectPtr aObject = aRef->value(); if (!(aObject && aObject->isSame(theObject))) { aRef->setValue(theObject); } } else if (aType == ModelAPI_AttributeRefAttr::typeId()) { - AttributeRefAttrPtr aRefAttr = + AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast(theAttribute); AttributePtr anAttribute = theWorkshop->module()->findAttribute(theObject, theShape); @@ -838,12 +838,12 @@ bool setObject(const AttributePtr& theAttribute, const ObjectPtr& theObject, AttributeSelectionListPtr aSelectionListAttr = std::dynamic_pointer_cast(theAttribute); ResultPtr aResult = std::dynamic_pointer_cast(theObject); - if (!theCheckIfAttributeHasObject || + if (!theCheckIfAttributeHasObject || !aSelectionListAttr->isInList(aResult, theShape, theTemporarily)) aSelectionListAttr->append(aResult, theShape, theTemporarily); } else if (aType == ModelAPI_AttributeRefList::typeId()) { - AttributeRefListPtr aRefListAttr = + AttributeRefListPtr aRefListAttr = std::dynamic_pointer_cast(theAttribute); if (!theCheckIfAttributeHasObject || !aRefListAttr->isInList(theObject)) { if (theObject.get()) @@ -853,7 +853,7 @@ bool setObject(const AttributePtr& theAttribute, const ObjectPtr& theObject, } } else if (aType == ModelAPI_AttributeRefAttrList::typeId()) { - AttributeRefAttrListPtr aRefAttrListAttr = + AttributeRefAttrListPtr aRefAttrListAttr = std::dynamic_pointer_cast(theAttribute); AttributePtr anAttribute = theWorkshop->module()->findAttribute(theObject, theShape); @@ -882,7 +882,7 @@ GeomShapePtr getShape(const AttributePtr& theAttribute, ModuleBase_IWorkshop* th std::string aType = theAttribute->attributeType(); if (aType == ModelAPI_AttributeReference::typeId()) { } else if (aType == ModelAPI_AttributeRefAttr::typeId()) { - AttributeRefAttrPtr aRefAttr = + AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast(theAttribute); if (aRefAttr.get() && !aRefAttr->isObject()) { AttributePtr anAttribute = aRefAttr->attr(); @@ -966,7 +966,7 @@ QString wrapTextByWords(const QString& theValue, QWidget* theWidget, } //************************************************************** -void refsToFeatureInFeatureDocument(const ObjectPtr& theObject, +void refsToFeatureInFeatureDocument(const ObjectPtr& theObject, std::set& theRefFeatures) { FeaturePtr aFeature = ModelAPI_Feature::feature(theObject); @@ -1067,11 +1067,11 @@ bool askToDelete(const std::set theFeatures, std::string aNotActivatedNames; if (!ModelAPI_Tools::allDocumentsActivated(aNotActivatedNames)) { if (ModuleBase_Tools::hasModuleDocumentFeature(theFeatures)) - aNotActivatedDocWrn = + aNotActivatedDocWrn = QObject::tr("Selected objects can be used in Part documents which are not loaded:%1.\n") .arg(aNotActivatedNames.c_str()); } - + std::set aFeaturesRefsTo; std::set aFeaturesRefsToParameter; std::set aParameterFeatures; @@ -1161,7 +1161,7 @@ bool askToDelete(const std::set theFeatures, "be deleted.\nOr parameters could be replaced by their values.\n"; aText += QString(QObject::tr(aMsg)) .arg(aParamFeatureNames.join(aSep)); - QPushButton *aReplaceButton = + QPushButton *aReplaceButton = aMessageBox.addButton(QObject::tr("Replace"), QMessageBox::ActionRole); } @@ -1179,7 +1179,7 @@ bool askToDelete(const std::set theFeatures, ModelAPI_ReplaceParameterMessage::send(aObj, 0); } else - theReferencesToDelete.insert(aFeaturesRefsToParameterOnly.begin(), + theReferencesToDelete.insert(aFeaturesRefsToParameterOnly.begin(), aFeaturesRefsToParameterOnly.end()); } return true; @@ -1233,7 +1233,7 @@ void setPointBallHighlighting(AIS_Shape* theAIS) aPixMap = new Image_AlienPixMap(); if(!aPixMap->Load(aFile.c_str())) { // The icon for constraint is not found - static const std::string aMsg = + static const std::string aMsg = "Error: Point market not found by path: \"" + aFile + "\". Falling back."; //Events_InfoMessage("ModuleBase_Tools::setPointBallHighlighting", aMsg).send(); } diff --git a/src/ModuleBase/ModuleBase_Tools.h b/src/ModuleBase/ModuleBase_Tools.h index 6e4e89b41..1f53c21b8 100755 --- a/src/ModuleBase/ModuleBase_Tools.h +++ b/src/ModuleBase/ModuleBase_Tools.h @@ -70,7 +70,7 @@ MODULEBASE_EXPORT void setShadowEffect(QWidget* theWidget, const bool isSetEffec /// \ingroup GUI /// Methods to modify a resource pixmap -/// Create composite pixmap. +/// Create composite pixmap. /// Pixmap \a theAdditionalIcon is drawn over pixmap \a dest with coordinates /// specified relatively to the upper left corner of \a theIcon. @@ -79,10 +79,10 @@ MODULEBASE_EXPORT void setShadowEffect(QWidget* theWidget, const bool isSetEffec /// \return resulting pixmap MODULEBASE_EXPORT QPixmap composite(const QString& theAdditionalIcon, const QString& theIcon); -/// Generates the pixmap lighter than the resources pixmap. +/// Generates the pixmap lighter than the resources pixmap. /// Pixmap \a theIcon is lighted according to the given value. /// If the lighter value is greater than 100, this functions returns a lighter pixmap. -/// Setting lighter value to 150 returns a color that is 50% brighter. +/// Setting lighter value to 150 returns a color that is 50% brighter. /// If the factor is less than 100, /// the return pixmap is darker. If the factor is 0 or negative, the return pixmap is unspecified. @@ -134,7 +134,7 @@ MODULEBASE_EXPORT QAction* createAction(const QIcon& theIcon, const QString& the /// \param theObj an object /// \param isUseAttributesInfo a flag whether the attribute values information is used /// \return a string -MODULEBASE_EXPORT QString objectInfo(const ObjectPtr& theObj, +MODULEBASE_EXPORT QString objectInfo(const ObjectPtr& theObj, const bool isUseAttributesInfo = false); /// Converts the AIS context information in a string information. @@ -172,7 +172,7 @@ MODULEBASE_EXPORT void checkObjects(const QObjectPtrList& theObjects, bool& hasR /// Sets the default coeffient into the driver calculated accordingly the shape type. /// It provides 1.e-4 for a shape withe Edge shape type -/// \param theShape a shape to define the deviation coeffient, +/// \param theShape a shape to define the deviation coeffient, /// \param theDrawer a drawer MODULEBASE_EXPORT void setDefaultDeviationCoefficient(const TopoDS_Shape& theShape, const Handle(Prs3d_Drawer)& theDrawer); @@ -295,7 +295,7 @@ bool MODULEBASE_EXPORT hasModuleDocumentFeature(const std::set& theF /// \param theReferencesToDelete an out set for references features to be removed /// \return true if in message box answer is Yes bool MODULEBASE_EXPORT askToDelete(const std::set aFeatures, - const std::map >& theReferences, QWidget* theParent, std::set& theReferencesToDelete, @@ -306,12 +306,12 @@ bool MODULEBASE_EXPORT askToDelete(const std::set aFeatures, /// of this parameter is to be removed /// \param theObjects a list of objects /// \param theFeatures an out conteiner of features -void MODULEBASE_EXPORT convertToFeatures(const QObjectPtrList& theObjects, +void MODULEBASE_EXPORT convertToFeatures(const QObjectPtrList& theObjects, std::set& theFeatures); /// Returns translation from the given data. -/// If translation is not exists then it returns a string +/// If translation is not exists then it returns a string /// from the info data without translation /// \param theContext context of the message (Feature Id) /// \param theMessage a message which dave to be translated diff --git a/src/ModuleBase/ModuleBase_ViewerFilters.h b/src/ModuleBase/ModuleBase_ViewerFilters.h index d2639b446..ce421b15c 100644 --- a/src/ModuleBase/ModuleBase_ViewerFilters.h +++ b/src/ModuleBase/ModuleBase_ViewerFilters.h @@ -32,13 +32,13 @@ class ModuleBase_ShapeDocumentFilter: public SelectMgr_Filter public: /// Constructor /// \param theWorkshop instance of workshop interface - Standard_EXPORT + Standard_EXPORT ModuleBase_ShapeDocumentFilter(ModuleBase_IWorkshop* theWorkshop): SelectMgr_Filter(), myWorkshop(theWorkshop) {} /// Returns True if the given owner is acceptable for selection /// \param theOwner the selected owner - Standard_EXPORT virtual + Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const; DEFINE_STANDARD_RTTI(ModuleBase_ShapeDocumentFilter) @@ -70,7 +70,7 @@ public: /// Returns True if the given owner is acceptable for selection /// \param theOwner the selected owner - Standard_EXPORT virtual + Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const; DEFINE_STANDARD_RTTI(ModuleBase_ShapeInPlaneFilter) diff --git a/src/ModuleBase/ModuleBase_ViewerPrs.cpp b/src/ModuleBase/ModuleBase_ViewerPrs.cpp index 38e4c71a3..0aa2182e1 100644 --- a/src/ModuleBase/ModuleBase_ViewerPrs.cpp +++ b/src/ModuleBase/ModuleBase_ViewerPrs.cpp @@ -8,9 +8,9 @@ #include -ModuleBase_ViewerPrs::ModuleBase_ViewerPrs(ObjectPtr theResult, - const GeomShapePtr& theShape, - Handle_SelectMgr_EntityOwner theOwner) +ModuleBase_ViewerPrs::ModuleBase_ViewerPrs(ObjectPtr theResult, + const GeomShapePtr& theShape, + Handle_SelectMgr_EntityOwner theOwner) : myResult(theResult), myShape(theShape), myOwner(theOwner) @@ -52,7 +52,7 @@ bool ModuleBase_ViewerPrs::isEqual(ModuleBase_ViewerPrs* thePrs) const // and set in the sub-solid AIS. ViewerPrs of these fictive owners are accepted as equal // as they use the same shape and result(of compsolid) Handle(StdSelect_BRepOwner) aCSolidOwner1 = Handle(StdSelect_BRepOwner)::DownCast(myOwner); - Handle(StdSelect_BRepOwner) aCSolidOwner2 = + Handle(StdSelect_BRepOwner) aCSolidOwner2 = Handle(StdSelect_BRepOwner)::DownCast(thePrs->owner()); isEqualIO = !aCSolidOwner1.IsNull() && !aCSolidOwner2.IsNull(); if (!aCSolidOwner1.IsNull() && !aCSolidOwner2.IsNull()) @@ -94,7 +94,7 @@ bool ModuleBase_ViewerPrs::operator==(const ModuleBase_ViewerPrs& thePrs) // and set in the sub-solid AIS. ViewerPrs of these fictive owners are accepted as equal // as they use the same shape and result(of compsolid) Handle(StdSelect_BRepOwner) aCSolidOwner1 = Handle(StdSelect_BRepOwner)::DownCast(myOwner); - Handle(StdSelect_BRepOwner) aCSolidOwner2 = + Handle(StdSelect_BRepOwner) aCSolidOwner2 = Handle(StdSelect_BRepOwner)::DownCast(thePrs.owner()); isEqualIO = !aCSolidOwner1.IsNull() && !aCSolidOwner2.IsNull(); if (!aCSolidOwner1.IsNull() && !aCSolidOwner1.IsNull()) diff --git a/src/ModuleBase/ModuleBase_WidgetChoice.cpp b/src/ModuleBase/ModuleBase_WidgetChoice.cpp index 5797e7cc8..49e73a243 100644 --- a/src/ModuleBase/ModuleBase_WidgetChoice.cpp +++ b/src/ModuleBase/ModuleBase_WidgetChoice.cpp @@ -22,7 +22,7 @@ #include -ModuleBase_WidgetChoice::ModuleBase_WidgetChoice(QWidget* theParent, +ModuleBase_WidgetChoice::ModuleBase_WidgetChoice(QWidget* theParent, const Config_WidgetAPI* theData) : ModuleBase_ModelWidget(theParent, theData), myCombo(0), myButtons(0) { @@ -49,7 +49,7 @@ ModuleBase_WidgetChoice::ModuleBase_WidgetChoice(QWidget* theParent, std::string aWgtDir = theData->getProperty("buttons_dir"); if (aWgtDir == "horizontal") aBtnLayout = new QHBoxLayout(aGroupBox); - else + else aBtnLayout = new QVBoxLayout(aGroupBox); ModuleBase_Tools::adjustMargins(aBtnLayout); @@ -66,7 +66,7 @@ ModuleBase_WidgetChoice::ModuleBase_WidgetChoice(QWidget* theParent, QPixmap aIcon = ModuleBase_IconFactory::loadPixmap(aIconList.at(aId)); aBtn->setIcon(aIcon); aBtn->setIconSize(aIcon.size()); - + aBtnLayout->addWidget(aBtn); myButtons->addButton(aBtn, aId++); } @@ -94,7 +94,7 @@ ModuleBase_WidgetChoice::ModuleBase_WidgetChoice(QWidget* theParent, myCombo = new QComboBox(this); aLayout->addWidget(myCombo, 1); - + myCombo->addItems(aList); connect(myCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(onCurrentIndexChanged(int))); @@ -104,7 +104,7 @@ ModuleBase_WidgetChoice::ModuleBase_WidgetChoice(QWidget* theParent, ModuleBase_WidgetChoice::~ModuleBase_WidgetChoice() { } - + bool ModuleBase_WidgetChoice::storeValueCustom() { DataPtr aData = myFeature->data(); diff --git a/src/ModuleBase/ModuleBase_WidgetConcealedObjects.cpp b/src/ModuleBase/ModuleBase_WidgetConcealedObjects.cpp index 0624b5844..9da48c21c 100644 --- a/src/ModuleBase/ModuleBase_WidgetConcealedObjects.cpp +++ b/src/ModuleBase/ModuleBase_WidgetConcealedObjects.cpp @@ -89,7 +89,7 @@ bool ModuleBase_WidgetConcealedObjects::restoreValueCustom() } } } - + DataPtr aData = myFeature->data(); AttributeRefListPtr anAttributeList = aData->reflist(attributeID()); int aSize = anAttributeList->size(); diff --git a/src/ModuleBase/ModuleBase_WidgetCreatorFactory.cpp b/src/ModuleBase/ModuleBase_WidgetCreatorFactory.cpp index 27697fef8..d9f10f31c 100755 --- a/src/ModuleBase/ModuleBase_WidgetCreatorFactory.cpp +++ b/src/ModuleBase/ModuleBase_WidgetCreatorFactory.cpp @@ -19,7 +19,7 @@ std::shared_ptr MY_WIDGET_CREATOR_FACTORY; std::shared_ptr ModuleBase_WidgetCreatorFactory::get() { if (!MY_WIDGET_CREATOR_FACTORY) { - MY_WIDGET_CREATOR_FACTORY = + MY_WIDGET_CREATOR_FACTORY = std::shared_ptr(new ModuleBase_WidgetCreatorFactory()); } return MY_WIDGET_CREATOR_FACTORY; @@ -44,7 +44,7 @@ void ModuleBase_WidgetCreatorFactory::registerCreator(const WidgetCreatorPtr& th if (!myPanelToCreator.contains(aKey)) myPanelToCreator[aKey] = theCreator; else { - Events_InfoMessage("ModuleBase_WidgetCreatorFactory", + Events_InfoMessage("ModuleBase_WidgetCreatorFactory", "The %1 panel XML definition has been already used by another widget creator") .arg(aKey).send(); } diff --git a/src/ModuleBase/ModuleBase_WidgetCreatorFactory.h b/src/ModuleBase/ModuleBase_WidgetCreatorFactory.h index 42f6f06d0..cb99f7084 100755 --- a/src/ModuleBase/ModuleBase_WidgetCreatorFactory.h +++ b/src/ModuleBase/ModuleBase_WidgetCreatorFactory.h @@ -38,7 +38,7 @@ class MODULEBASE_EXPORT ModuleBase_WidgetCreatorFactory /// Destructor virtual ~ModuleBase_WidgetCreatorFactory(); - /// The creator is added to the internal container + /// The creator is added to the internal container /// to be used when the createWidgetByType is called /// \param theCreator a new widget creator void registerCreator(const WidgetCreatorPtr& theCreator); @@ -64,7 +64,7 @@ class MODULEBASE_EXPORT ModuleBase_WidgetCreatorFactory /// Create page by its type /// \param theType a type /// \param theParent a parent widget - /// \param theWidgetApi the widget configuration. + /// \param theWidgetApi the widget configuration. /// The attribute of the model widget is obtained from XML /// \return a created page or null ModuleBase_PageBase* createPageByType(const std::string& theType, @@ -74,7 +74,7 @@ class MODULEBASE_EXPORT ModuleBase_WidgetCreatorFactory /// Create widget by its type /// \param theType a type /// \param theParent a parent widget - /// \param theWidgetApi the widget configuration. + /// \param theWidgetApi the widget configuration. /// The attribute of the model widget is obtained from XML /// \param theWorkshop a workshop object instance /// \return a created widget or null diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp index 9e4a2041e..a490c4d25 100644 --- a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp @@ -26,7 +26,7 @@ #include #ifndef DBL_MAX -#define DBL_MAX 1.7976931348623158e+308 +#define DBL_MAX 1.7976931348623158e+308 #endif #ifdef _DEBUG #include diff --git a/src/ModuleBase/ModuleBase_WidgetEditor.h b/src/ModuleBase/ModuleBase_WidgetEditor.h index 97a01ac3b..51d7eff60 100644 --- a/src/ModuleBase/ModuleBase_WidgetEditor.h +++ b/src/ModuleBase/ModuleBase_WidgetEditor.h @@ -36,7 +36,7 @@ Q_OBJECT /// Destructor virtual ~ModuleBase_WidgetEditor(); - /// Set focus to the first control of the current widget. + /// Set focus to the first control of the current widget. /// The focus policy of the control is checked. /// If the widget has the NonFocus focus policy, it is skipped. /// \return the state whether the widget can accept the focus @@ -62,10 +62,10 @@ private: private: ///< the current widget feature - FeaturePtr myFeature; + FeaturePtr myFeature; ///< the kinds of possible features - QStringList myFeatureKinds; + QStringList myFeatureKinds; int myXPosition, myYPosition; }; diff --git a/src/ModuleBase/ModuleBase_WidgetExprEditor.cpp b/src/ModuleBase/ModuleBase_WidgetExprEditor.cpp index cf5b6fc55..1fb6bf1aa 100644 --- a/src/ModuleBase/ModuleBase_WidgetExprEditor.cpp +++ b/src/ModuleBase/ModuleBase_WidgetExprEditor.cpp @@ -194,7 +194,7 @@ void ExpressionEditor::paintEvent( QPaintEvent* theEvent ) QPen anOldpen = aPainter.pen(); aPainter.setPen( aColor ); lineRect.adjust(minLB, 0, 0, 0); - QString elidedText = + QString elidedText = aFontMetrics.elidedText( myPlaceHolderText, Qt::ElideRight, lineRect.width() ); aPainter.drawText( lineRect, va, elidedText ); aPainter.setPen( anOldpen ); @@ -251,7 +251,7 @@ void ModuleBase_WidgetExprEditor::initializeValueByActivate() bool ModuleBase_WidgetExprEditor::storeValueCustom() { - // A rare case when plugin was not loaded. + // A rare case when plugin was not loaded. if(!myFeature) return false; DataPtr aData = myFeature->data(); @@ -284,7 +284,7 @@ bool ModuleBase_WidgetExprEditor::storeValueCustom() bool ModuleBase_WidgetExprEditor::restoreValueCustom() { - // A rare case when plugin was not loaded. + // A rare case when plugin was not loaded. if(!myFeature) return false; DataPtr aData = myFeature->data(); diff --git a/src/ModuleBase/ModuleBase_WidgetFactory.cpp b/src/ModuleBase/ModuleBase_WidgetFactory.cpp index 3b43d7664..d4c1b9ef4 100644 --- a/src/ModuleBase/ModuleBase_WidgetFactory.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFactory.cpp @@ -121,7 +121,7 @@ void ModuleBase_WidgetFactory::createWidget(ModuleBase_PageBase* thePage, bool a ModuleBase_PageBase* aPage = new ModuleBase_PageWidget(aWidget); createWidget(aPage); if (aWdgType == WDG_SWITCH || aWdgType == WDG_TOOLBOX) { - ModuleBase_PagedContainer* aContainer = + ModuleBase_PagedContainer* aContainer = qobject_cast(aWidget); QString anIconPath = qs( myWidgetApi->getProperty( CONTAINER_PAGE_ICON ) ); @@ -180,7 +180,7 @@ void ModuleBase_WidgetFactory::getAttributeTitle(const std::string& theAttribute if (aFound) { theTitle = QString::fromStdString(myWidgetApi->widgetLabel()).toStdString().c_str(); if (theTitle.empty()) - theTitle = + theTitle = QString::fromStdString(myWidgetApi->getProperty(CONTAINER_PAGE_NAME)).toStdString().c_str(); } } diff --git a/src/ModuleBase/ModuleBase_WidgetFeatureSelector.cpp b/src/ModuleBase/ModuleBase_WidgetFeatureSelector.cpp index a181d9e0c..f7bbe4e78 100644 --- a/src/ModuleBase/ModuleBase_WidgetFeatureSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFeatureSelector.cpp @@ -110,7 +110,7 @@ void ModuleBase_WidgetFeatureSelector::activateCustom() { connect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()), Qt::UniqueConnection); - + activateFilters(true); QIntList aShapeTypes; @@ -126,7 +126,7 @@ void ModuleBase_WidgetFeatureSelector::activateCustom() //******************************************************************** bool ModuleBase_WidgetFeatureSelector::storeValueCustom() { - // the value is stored on the selection changed signal processing + // the value is stored on the selection changed signal processing return true; } @@ -218,7 +218,7 @@ void ModuleBase_WidgetFeatureSelector::onSelectionChanged() //******************************************************************** void ModuleBase_WidgetFeatureSelector::updateOnSelectionChanged(const bool theDone) { - // "false" flag should be used here, it connects to the #26658 OCC bug, when the user click in + // "false" flag should be used here, it connects to the #26658 OCC bug, when the user click in // the same place repeatedly without mouse moved. In the case validation by filters is not // perfromed, so an invalid object is selected. E.g. distance constraint, selection of a point. // the 3rd click in the same point allow using this point. diff --git a/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp b/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp index be9184073..d0d00aebb 100644 --- a/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp @@ -67,7 +67,7 @@ ModuleBase_WidgetFileSelector::~ModuleBase_WidgetFileSelector() bool ModuleBase_WidgetFileSelector::storeValueCustom() { - // A rare case when plugin was not loaded. + // A rare case when plugin was not loaded. if (!myFeature) return false; DataPtr aData = myFeature->data(); @@ -80,7 +80,7 @@ bool ModuleBase_WidgetFileSelector::storeValueCustom() bool ModuleBase_WidgetFileSelector::restoreValueCustom() { - // A rare case when plugin was not loaded. + // A rare case when plugin was not loaded. if (!myFeature) return false; DataPtr aData = myFeature->data(); diff --git a/src/ModuleBase/ModuleBase_WidgetIntValue.cpp b/src/ModuleBase/ModuleBase_WidgetIntValue.cpp index dae84951a..8b69bac56 100644 --- a/src/ModuleBase/ModuleBase_WidgetIntValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetIntValue.cpp @@ -28,7 +28,7 @@ #include #ifndef INT_MAX -#define INT_MAX 2147483647 +#define INT_MAX 2147483647 #endif #ifdef _DEBUG diff --git a/src/ModuleBase/ModuleBase_WidgetLabel.cpp b/src/ModuleBase/ModuleBase_WidgetLabel.cpp index bab0894cb..170fb7c50 100644 --- a/src/ModuleBase/ModuleBase_WidgetLabel.cpp +++ b/src/ModuleBase/ModuleBase_WidgetLabel.cpp @@ -61,8 +61,8 @@ bool ModuleBase_WidgetLabel::restoreValueCustom() return true; } -bool ModuleBase_WidgetLabel::focusTo() -{ +bool ModuleBase_WidgetLabel::focusTo() +{ restoreValue(); - return false; + return false; } diff --git a/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp b/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp index ef869fdcd..e8da69f17 100644 --- a/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp +++ b/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp @@ -108,7 +108,7 @@ ModuleBase_WidgetLineEdit::~ModuleBase_WidgetLineEdit() bool ModuleBase_WidgetLineEdit::storeValueCustom() { - // A rare case when plugin was not loaded. + // A rare case when plugin was not loaded. if(!myFeature) return false; DataPtr aData = myFeature->data(); @@ -121,7 +121,7 @@ bool ModuleBase_WidgetLineEdit::storeValueCustom() bool ModuleBase_WidgetLineEdit::restoreValueCustom() { - // A rare case when plugin was not loaded. + // A rare case when plugin was not loaded. if(!myFeature) return false; DataPtr aData = myFeature->data(); diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp index 6b30c97d4..8064ae31f 100755 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp @@ -121,7 +121,7 @@ ModuleBase_WidgetMultiSelector::ModuleBase_WidgetMultiSelector(QWidget* theParen QLabel* aListLabel = new QLabel(!aLabelText.empty() ? aLabelText.c_str() : tr("Selected objects:"), this); aMainLay->addWidget(aListLabel, 1, 0); - // if the xml definition contains one type, an information label + // if the xml definition contains one type, an information label // should be shown near to the latest if (aShapeTypes.size() <= 1) { QString aLabelIcon = QString::fromStdString(theData->widgetIcon()); @@ -188,8 +188,8 @@ void ModuleBase_WidgetMultiSelector::deactivate() //******************************************************************** bool ModuleBase_WidgetMultiSelector::storeValueCustom() { - // the value is stored on the selection changed signal processing - // A rare case when plugin was not loaded. + // the value is stored on the selection changed signal processing + // A rare case when plugin was not loaded. if (!myFeature) return false; @@ -205,7 +205,7 @@ bool ModuleBase_WidgetMultiSelector::storeValueCustom() //******************************************************************** bool ModuleBase_WidgetMultiSelector::restoreValueCustom() { - // A rare case when plugin was not loaded. + // A rare case when plugin was not loaded. if (!myFeature) return false; @@ -423,7 +423,7 @@ void ModuleBase_WidgetMultiSelector::onSelectionChanged() void ModuleBase_WidgetMultiSelector::updateFocus() { - // Set focus to List control in order to make possible + // Set focus to List control in order to make possible // to use Tab key for transfer the focus to next widgets myListControl->setCurrentRow(myListControl->model()->rowCount() - 1); ModuleBase_Tools::setFocus(myListControl, @@ -454,7 +454,7 @@ QIntList ModuleBase_WidgetMultiSelector::shapeTypes() const void ModuleBase_WidgetMultiSelector::setCurrentShapeType(const int theShapeType) { QString aShapeTypeName; - + for (int idx = 0; idx < myTypeCombo->count(); ++idx) { aShapeTypeName = myTypeCombo->itemText(idx); int aRefType = ModuleBase_Tools::shapeType(aShapeTypeName); @@ -576,7 +576,7 @@ void ModuleBase_WidgetMultiSelector::onListSelection() QList aItems = myListControl->selectedItems(); myCopyAction->setEnabled(!aItems.isEmpty()); myDeleteAction->setEnabled(!aItems.isEmpty()); - + myWorkshop->module()->customizeObject(myFeature, ModuleBase_IModule::CustomizeHighlightedObjects, true); } @@ -685,7 +685,7 @@ bool ModuleBase_WidgetMultiSelector::removeUnusedAttributeObjects } else if (aType == ModelAPI_AttributeRefAttrList::typeId()) { std::set anAttributes; - QList::const_iterator + QList::const_iterator anIt = theValues.begin(), aLast = theValues.end(); ObjectPtr anObject; GeomShapePtr aShape; diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.h b/src/ModuleBase/ModuleBase_WidgetMultiSelector.h index 3b38acb5d..d502e1506 100755 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.h +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.h @@ -139,7 +139,7 @@ protected: std::string validatorType(const QString& theType) const; protected: - /// Returns attribute indices selected in the widget selection list + /// Returns attribute indices selected in the widget selection list /// \param theIndices a list of indices void getSelectedAttributeIndices(std::set& theIndices); diff --git a/src/ModuleBase/ModuleBase_WidgetSelector.cpp b/src/ModuleBase/ModuleBase_WidgetSelector.cpp index 3dfcd8e43..a7b536db1 100755 --- a/src/ModuleBase/ModuleBase_WidgetSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetSelector.cpp @@ -60,7 +60,7 @@ void ModuleBase_WidgetSelector::onSelectionChanged() //******************************************************************** void ModuleBase_WidgetSelector::updateOnSelectionChanged(const bool theDone) { - // "false" flag should be used here, it connects to the #26658 OCC bug, when the user click in + // "false" flag should be used here, it connects to the #26658 OCC bug, when the user click in // the same place repeatedly without mouse moved. In the case validation by filters is not // perfromed, so an invalid object is selected. E.g. distance constraint, selection of a point. // the 3rd click in the same point allow using this point. @@ -81,7 +81,7 @@ QIntList ModuleBase_WidgetSelector::getShapeTypes() const { QIntList aShapeTypes = shapeTypes(); // this type should be mentioned in XML, poor selection otherwise - if (/*aShapeTypes.contains(TopAbs_SOLID) ||*/ + if (/*aShapeTypes.contains(TopAbs_SOLID) ||*/ aShapeTypes.contains(ModuleBase_ResultPrs::Sel_Result/*TopAbs_SHAPE*/)) { // it should be selectable for both, "solids" and "objects" types aShapeTypes.append(TopAbs_COMPSOLID); @@ -165,7 +165,7 @@ void ModuleBase_WidgetSelector::activateCustom() { connect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()), Qt::UniqueConnection); - + activateSelectionAndFilters(true); // Restore selection in the viewer by the attribute selection list @@ -198,7 +198,7 @@ bool ModuleBase_WidgetSelector::setSelectionCustom(const ModuleBase_ViewerPrsPtr getGeomSelection(thePrs, anObject, aShape); // the last flag is to be depending on hasObject is called before. To be corrected later - return ModuleBase_Tools::setObject(attribute(), anObject, aShape, + return ModuleBase_Tools::setObject(attribute(), anObject, aShape, myWorkshop, myIsInValidate, true); } diff --git a/src/ModuleBase/ModuleBase_WidgetSelectorStore.cpp b/src/ModuleBase/ModuleBase_WidgetSelectorStore.cpp index d9ed9a366..8c8c9b259 100755 --- a/src/ModuleBase/ModuleBase_WidgetSelectorStore.cpp +++ b/src/ModuleBase/ModuleBase_WidgetSelectorStore.cpp @@ -61,7 +61,7 @@ void ModuleBase_WidgetSelectorStore::restoreAttributeValue(const AttributePtr& t { std::string aType = theAttribute->attributeType(); if (aType == ModelAPI_AttributeSelectionList::typeId()) { - AttributeSelectionListPtr aSelectionListAttr = + AttributeSelectionListPtr aSelectionListAttr = std::dynamic_pointer_cast(theAttribute); aSelectionListAttr->setSelectionType(mySelectionType); // restore selection in the attribute. Indeed there is only one stored object @@ -70,7 +70,7 @@ void ModuleBase_WidgetSelectorStore::restoreAttributeValue(const AttributePtr& t aSelectionListAttr->removeLast(); } else if (aType == ModelAPI_AttributeRefList::typeId()) { - AttributeRefListPtr aRefListAttr = + AttributeRefListPtr aRefListAttr = std::dynamic_pointer_cast(theAttribute); // restore objects in the attribute. Indeed there is only one stored object int aCountAppened = aRefListAttr->size() - mySelectionCount; @@ -87,7 +87,7 @@ void ModuleBase_WidgetSelectorStore::restoreAttributeValue(const AttributePtr& t } else { ModuleBase_Tools::setObject(theAttribute, myObject, myShape, theWorkshop, true, true); - AttributeRefAttrPtr aRefAttr = + AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast(theAttribute); if (aRefAttr) { if (!myIsObject) diff --git a/src/ModuleBase/ModuleBase_WidgetSelectorStore.h b/src/ModuleBase/ModuleBase_WidgetSelectorStore.h index 91a77ba94..e002826d1 100755 --- a/src/ModuleBase/ModuleBase_WidgetSelectorStore.h +++ b/src/ModuleBase/ModuleBase_WidgetSelectorStore.h @@ -43,7 +43,7 @@ class ModuleBase_WidgetSelectorStore private: /// backup parameters of the model attribute. The class processes three types of attribute: - /// Reference, RefAttr and Selection. + /// Reference, RefAttr and Selection. /// Depending on the attribute type, only the attribute parameter /// values are reserved in the backup /// An attribute object diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp index 4652227a8..8b07d5851 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp @@ -103,7 +103,7 @@ ModuleBase_WidgetShapeSelector::~ModuleBase_WidgetShapeSelector() //******************************************************************** bool ModuleBase_WidgetShapeSelector::storeValueCustom() { - // the value is stored on the selection changed signal processing + // the value is stored on the selection changed signal processing return true; } diff --git a/src/ModuleBase/ModuleBase_WidgetSwitch.cpp b/src/ModuleBase/ModuleBase_WidgetSwitch.cpp index 894b442b2..b17759e5a 100644 --- a/src/ModuleBase/ModuleBase_WidgetSwitch.cpp +++ b/src/ModuleBase/ModuleBase_WidgetSwitch.cpp @@ -18,7 +18,7 @@ #include #include -ModuleBase_WidgetSwitch::ModuleBase_WidgetSwitch(QWidget* theParent, +ModuleBase_WidgetSwitch::ModuleBase_WidgetSwitch(QWidget* theParent, const Config_WidgetAPI* theData) : ModuleBase_PagedContainer(theParent, theData) { diff --git a/src/ModuleBase/ModuleBase_WidgetToolbox.cpp b/src/ModuleBase/ModuleBase_WidgetToolbox.cpp index 81b92a044..16a00dabe 100644 --- a/src/ModuleBase/ModuleBase_WidgetToolbox.cpp +++ b/src/ModuleBase/ModuleBase_WidgetToolbox.cpp @@ -19,7 +19,7 @@ #include #include -ModuleBase_WidgetToolbox::ModuleBase_WidgetToolbox(QWidget* theParent, +ModuleBase_WidgetToolbox::ModuleBase_WidgetToolbox(QWidget* theParent, const Config_WidgetAPI* theData) : ModuleBase_PagedContainer(theParent, theData) { diff --git a/src/ModuleBase/ModuleBase_WidgetValidated.cpp b/src/ModuleBase/ModuleBase_WidgetValidated.cpp index e3cf651f0..b0d69053e 100644 --- a/src/ModuleBase/ModuleBase_WidgetValidated.cpp +++ b/src/ModuleBase/ModuleBase_WidgetValidated.cpp @@ -249,7 +249,7 @@ void ModuleBase_WidgetValidated::blockAttribute(const AttributePtr& theAttribute } //******************************************************************** -void ModuleBase_WidgetValidated::storeValidState(const ModuleBase_ViewerPrsPtr& theValue, +void ModuleBase_WidgetValidated::storeValidState(const ModuleBase_ViewerPrsPtr& theValue, const bool theValid) { GeomShapePtr aShape = theValue.get() ? theValue->shape() : GeomShapePtr(); @@ -295,7 +295,7 @@ void ModuleBase_WidgetValidated::storeValidState(const ModuleBase_ViewerPrsPtr& } //******************************************************************** -bool ModuleBase_WidgetValidated::getValidState(const ModuleBase_ViewerPrsPtr& theValue, +bool ModuleBase_WidgetValidated::getValidState(const ModuleBase_ViewerPrsPtr& theValue, bool& theValid) { if (!theValue.get()) @@ -382,7 +382,7 @@ void ModuleBase_WidgetValidated::filterCompSolids(QList for (; anIt != aLast; anIt++) { const ModuleBase_ViewerPrsPtr& aViewerPrs = *anIt; ObjectPtr anObject = aViewerPrs->object(); - ResultCompSolidPtr aResultCompSolid = + ResultCompSolidPtr aResultCompSolid = std::dynamic_pointer_cast(anObject); if(aResultCompSolid.get()) { aCompSolids.insert(aResultCompSolid); diff --git a/src/ModuleBase/ModuleBase_WidgetValidated.h b/src/ModuleBase/ModuleBase_WidgetValidated.h index 2271c2be1..d31bfe768 100644 --- a/src/ModuleBase/ModuleBase_WidgetValidated.h +++ b/src/ModuleBase/ModuleBase_WidgetValidated.h @@ -137,7 +137,7 @@ private: bool isValidAttribute(const AttributePtr& theAttribute) const; protected: - /// Gets the validity state of the presentation in an internal map. + /// Gets the validity state of the presentation in an internal map. /// Returns true if the valid state of value is stored /// \param theValue a viewer presentation /// \param theValid a valid state @@ -168,10 +168,10 @@ private: ObjectPtr myPresentedObject; /// back up of the filtered object #ifdef LIST_OF_VALID_PRS /// cash of valid selection presentations - QList> myValidPrs; + QList> myValidPrs; /// cash of invalid selection presentations - QList> myInvalidPrs; + QList> myInvalidPrs; #else // assume that one presentation selection presentation corresponds only one shape NCollection_DataMap > myValidPrs; diff --git a/src/ModuleBase/ModuleBase_WidgetValidator.cpp b/src/ModuleBase/ModuleBase_WidgetValidator.cpp index e4b1a4fdd..35d8fca62 100755 --- a/src/ModuleBase/ModuleBase_WidgetValidator.cpp +++ b/src/ModuleBase/ModuleBase_WidgetValidator.cpp @@ -63,7 +63,7 @@ void ModuleBase_WidgetValidator::clearValidatedCash() myInvalidPrs.clear(); } -bool ModuleBase_WidgetValidator::getValidState(const ModuleBase_ViewerPrsPtr& theValue, +bool ModuleBase_WidgetValidator::getValidState(const ModuleBase_ViewerPrsPtr& theValue, bool& theValid) { bool aValidPrs = myValidPrs.contains(theValue); @@ -78,7 +78,7 @@ bool ModuleBase_WidgetValidator::getValidState(const ModuleBase_ViewerPrsPtr& th } //******************************************************************** -void ModuleBase_WidgetValidator::storeValidState(const ModuleBase_ViewerPrsPtr& theValue, +void ModuleBase_WidgetValidator::storeValidState(const ModuleBase_ViewerPrsPtr& theValue, const bool theValid) { bool aValidPrs = myInvalidPrs.contains(theValue); diff --git a/src/ModuleBase/ModuleBase_WidgetValidator.h b/src/ModuleBase/ModuleBase_WidgetValidator.h index 912a19858..ee8d6151b 100755 --- a/src/ModuleBase/ModuleBase_WidgetValidator.h +++ b/src/ModuleBase/ModuleBase_WidgetValidator.h @@ -52,7 +52,7 @@ private: //! Clear all validated cash in the widget void clearValidatedCash(); - /// Gets the validity state of the presentation in an internal map. + /// Gets the validity state of the presentation in an internal map. /// Returns true if the valid state of value is stored /// \param theValue a viewer presentation /// \param theValid a valid state @@ -69,10 +69,10 @@ protected: ModuleBase_IWorkshop* myWorkshop; ///< the active workshop /// cash of valid selection presentations - QList> myValidPrs; - + QList> myValidPrs; + /// cash of invalid selection presentations - QList> myInvalidPrs; + QList> myInvalidPrs; }; #endif /* ModuleBase_WidgetValidator_H_ */ diff --git a/src/ParametersAPI/ParametersAPI_Parameter.cpp b/src/ParametersAPI/ParametersAPI_Parameter.cpp index 0f86e784f..d562cf325 100644 --- a/src/ParametersAPI/ParametersAPI_Parameter.cpp +++ b/src/ParametersAPI/ParametersAPI_Parameter.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D --> // Name : ParametersAPI_Parameter.cpp -// Purpose: +// Purpose: // // History: // 16/06/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/ParametersAPI/ParametersAPI_Parameter.h b/src/ParametersAPI/ParametersAPI_Parameter.h index cdf66c71e..e9122a107 100644 --- a/src/ParametersAPI/ParametersAPI_Parameter.h +++ b/src/ParametersAPI/ParametersAPI_Parameter.h @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D --> // Name : ParametersAPI_Parameter.h -// Purpose: +// Purpose: // // History: // 16/06/16 - Sergey POKHODENKO - Creation of the file @@ -39,7 +39,7 @@ public: virtual ~ParametersAPI_Parameter(); INTERFACE_3(ParametersPlugin_Parameter::ID(), - name, ParametersPlugin_Parameter::VARIABLE_ID(), + name, ParametersPlugin_Parameter::VARIABLE_ID(), ModelAPI_AttributeString, /** Name */, expression, ParametersPlugin_Parameter::EXPRESSION_ID(), ModelAPI_AttributeString, /** Expression */, diff --git a/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp b/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp index 791af81bf..dbd603f19 100644 --- a/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp +++ b/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp @@ -92,7 +92,7 @@ void ParametersPlugin_EvalListener::processEvent( } else if (theMessage->eventID() == kReplaceParameterEvent) { processReplaceParameterEvent(theMessage); } else { - Events_InfoMessage("ParametersPlugin_EvalListener", + Events_InfoMessage("ParametersPlugin_EvalListener", "ParametersPlugin python interpreter, unhandled message caught: ") .arg(theMessage->eventID().eventText()).send(); } @@ -111,7 +111,7 @@ double ParametersPlugin_EvalListener::evaluate(FeaturePtr theParameter, // If variable does not exist python interpreter will generate an error. It is OK. // But due to the issue 1479 it should not check the history position of parameters relatively // to feature that contains expression - if (!ModelAPI_Tools::findVariable(/*theParameter*/ FeaturePtr(), + if (!ModelAPI_Tools::findVariable(/*theParameter*/ FeaturePtr(), *it, aValue, aParamRes, theParameter->document())) continue; @@ -129,7 +129,7 @@ void ParametersPlugin_EvalListener::processEvaluationEvent( std::shared_ptr aMessage = std::dynamic_pointer_cast(theMessage); - FeaturePtr aParamFeature = + FeaturePtr aParamFeature = std::dynamic_pointer_cast(aMessage->attribute()->owner()); if (aMessage->attribute()->attributeType() == ModelAPI_AttributeInteger::typeId()) { AttributeIntegerPtr anAttribute = @@ -139,7 +139,7 @@ void ParametersPlugin_EvalListener::processEvaluationEvent( bool isValid = anError.empty(); if (isValid) anAttribute->setCalculatedValue(aValue); - anAttribute->setUsedParameters(isValid ? + anAttribute->setUsedParameters(isValid ? toSet(myInterp->compile(anAttribute->text())) : std::set()); anAttribute->setExpressionInvalid(!isValid); anAttribute->setExpressionError(anAttribute->text().empty() ? "" : anError); @@ -152,7 +152,7 @@ void ParametersPlugin_EvalListener::processEvaluationEvent( bool isValid = anError.empty(); if (isValid) anAttribute->setCalculatedValue(aValue); - anAttribute->setUsedParameters(isValid ? + anAttribute->setUsedParameters(isValid ? toSet(myInterp->compile(anAttribute->text())) : std::set()); anAttribute->setExpressionInvalid(!isValid); anAttribute->setExpressionError(anAttribute->text().empty() ? "" : anError); @@ -175,7 +175,7 @@ void ParametersPlugin_EvalListener::processEvaluationEvent( double aValue = evaluate(aParamFeature, aText[i], anError); bool isValid = anError.empty(); if (isValid) aCalculatedValue[i] = aValue; - anAttribute->setUsedParameters(i, + anAttribute->setUsedParameters(i, isValid ? toSet(myInterp->compile(aText[i])) : std::set()); anAttribute->setExpressionInvalid(i, !isValid); anAttribute->setExpressionError(i, aText[i].empty() ? "" : anError); @@ -200,7 +200,7 @@ void ParametersPlugin_EvalListener::processEvaluationEvent( double aValue = evaluate(aParamFeature, aText[i], anError); bool isValid = anError.empty(); if (isValid) aCalculatedValue[i] = aValue; - anAttribute->setUsedParameters(i, + anAttribute->setUsedParameters(i, isValid ? toSet(myInterp->compile(aText[i])) : std::set()); anAttribute->setExpressionInvalid(i, !isValid); anAttribute->setExpressionError(i, aText[i].empty() ? "" : anError); @@ -260,7 +260,7 @@ void ParametersPlugin_EvalListener::renameInParameter( anExpressionString = renameInPythonExpression(anExpressionString, theOldName, theNewName); - // Issue #588. No need for reevaluating expression. + // Issue #588. No need for reevaluating expression. // Moreover, current history may not contain necessary parameters. anExpressionAttribute->owner()->data()->blockSendAttributeUpdated(true); anExpressionAttribute->setValue(anExpressionString); @@ -355,7 +355,7 @@ void setParameterName(ResultParameterPtr theResultParameter, const std::string& theResultParameter->data()->setName(theName); theResultParameter->data()->blockSendAttributeUpdated(false, false); - std::shared_ptr aParameter = + std::shared_ptr aParameter = std::dynamic_pointer_cast( ModelAPI_Feature::feature(theResultParameter)); @@ -379,7 +379,7 @@ void ParametersPlugin_EvalListener::processObjectRenamedEvent( // check if the renamed object is a result parameter ResultParameterPtr aResultParameter = std::dynamic_pointer_cast(aMessage->object()); - if (!aResultParameter.get()) + if (!aResultParameter.get()) return; // get parameter feature for the result @@ -403,8 +403,8 @@ void ParametersPlugin_EvalListener::processObjectRenamedEvent( // try to update the parameter feature according the new name setParameterName(aResultParameter, aMessage->newName()); - // TODO(spo): replace with - // ModelAPI_Session::get()->validators()->validate(aParameter, + // TODO(spo): replace with + // ModelAPI_Session::get()->validators()->validate(aParameter, // ParametersPlugin_Parameter::VARIABLE_ID()) // when ModelAPI_ValidatorsFactory::validate(const std::shared_ptr& theFeature, // const std::string& theAttribute) const diff --git a/src/ParametersPlugin/ParametersPlugin_EvalListener.h b/src/ParametersPlugin/ParametersPlugin_EvalListener.h index 3b870a879..440904783 100644 --- a/src/ParametersPlugin/ParametersPlugin_EvalListener.h +++ b/src/ParametersPlugin/ParametersPlugin_EvalListener.h @@ -31,7 +31,7 @@ class ParametersPlugin_EvalListener : public Events_Listener PARAMETERSPLUGIN_EXPORT virtual ~ParametersPlugin_EvalListener(); /// Reimplemented from Events_Listener::processEvent(). - PARAMETERSPLUGIN_EXPORT + PARAMETERSPLUGIN_EXPORT virtual void processEvent(const std::shared_ptr& theMessage); protected: diff --git a/src/ParametersPlugin/ParametersPlugin_Plugin.cpp b/src/ParametersPlugin/ParametersPlugin_Plugin.cpp index cc1946413..364e189c6 100644 --- a/src/ParametersPlugin/ParametersPlugin_Plugin.cpp +++ b/src/ParametersPlugin/ParametersPlugin_Plugin.cpp @@ -34,7 +34,7 @@ ParametersPlugin_Plugin::ParametersPlugin_Plugin() aFactory->registerValidator("Parameters_ExpressionValidator", new ParametersPlugin_ExpressionValidator); - myEvalListener = + myEvalListener = std::shared_ptr(new ParametersPlugin_EvalListener()); } diff --git a/src/ParametersPlugin/ParametersPlugin_PyInterp.cpp b/src/ParametersPlugin/ParametersPlugin_PyInterp.cpp index b15dc2ac7..a513b1070 100644 --- a/src/ParametersPlugin/ParametersPlugin_PyInterp.cpp +++ b/src/ParametersPlugin/ParametersPlugin_PyInterp.cpp @@ -43,7 +43,7 @@ ParametersPlugin_PyInterp::positions(const std::string& theExpression, PyObject* aBuiltinModule = PyImport_AddModule("__builtin__"); PyDict_SetItemString(aContext, "__builtins__", aBuiltinModule); - // extend aContext with variables + // extend aContext with variables PyDict_SetItemString(aContext, "expression", PyString_FromString(theExpression.c_str())); PyDict_SetItemString(aContext, "name", PyString_FromString(theName.c_str())); PyDict_SetItemString(aContext, "positions", Py_BuildValue("[]")); @@ -82,7 +82,7 @@ std::list ParametersPlugin_PyInterp::compile(const std::string& the } PyObject *aCodePyObj = - PyObject_CallMethod(aCodeopModule, (char*)"compile_command", (char*)"(s)", + PyObject_CallMethod(aCodeopModule, (char*)"compile_command", (char*)"(s)", theExpression.c_str()); if(!aCodePyObj || aCodePyObj == Py_None || !PyCode_Check(aCodePyObj)) { @@ -160,7 +160,7 @@ double ParametersPlugin_PyInterp::evaluate(const std::string& theExpression, std } catch (const std::invalid_argument&) { theError = "Unable to eval " + anEvalStr; } - + return result; } diff --git a/src/ParametersPlugin/ParametersPlugin_Validators.cpp b/src/ParametersPlugin/ParametersPlugin_Validators.cpp index f1bb988a6..c5804aeae 100644 --- a/src/ParametersPlugin/ParametersPlugin_Validators.cpp +++ b/src/ParametersPlugin/ParametersPlugin_Validators.cpp @@ -45,7 +45,7 @@ bool ParametersPlugin_VariableValidator::isValid(const AttributePtr& theAttribut if (!ModelAPI_Expression::isVariable(aStrAttr->value())) { theError = "Incorrect variable name."; return false; - } + } if (!isUnique(theAttribute, aStrAttr->value())) { theError = "Variable name is not unique."; return false; diff --git a/src/ParametersPlugin/ParametersPlugin_WidgetCreator.cpp b/src/ParametersPlugin/ParametersPlugin_WidgetCreator.cpp index f78e8a247..de7690be5 100644 --- a/src/ParametersPlugin/ParametersPlugin_WidgetCreator.cpp +++ b/src/ParametersPlugin/ParametersPlugin_WidgetCreator.cpp @@ -21,7 +21,7 @@ void ParametersPlugin_WidgetCreator::widgetTypes(std::set& theTypes } -ModuleBase_ModelWidget* +ModuleBase_ModelWidget* ParametersPlugin_WidgetCreator::createWidgetByType(const std::string& theType, QWidget* theParent, Config_WidgetAPI* theWidgetApi, diff --git a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp index 485ad9129..7087b1b9c 100644 --- a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp +++ b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp @@ -55,23 +55,23 @@ class ParametersPlugin_ItemDelegate : public QStyledItemDelegate public: /// Constructor /// \param thaParent a parent - ParametersPlugin_ItemDelegate(QObject* thaParent) : + ParametersPlugin_ItemDelegate(QObject* thaParent) : QStyledItemDelegate(thaParent) {} /// Redefinition of virtual method /// \param painter a painter object /// \param option the item options /// \param index the current index - virtual void paint(QPainter* painter, - const QStyleOptionViewItem& option, + virtual void paint(QPainter* painter, + const QStyleOptionViewItem& option, const QModelIndex& index ) const; - + /// Redefinition of virtual method /// \param parent a parent widget /// \param option the item options /// \param index the current index - virtual QWidget* createEditor(QWidget* parent, - const QStyleOptionViewItem& option, + virtual QWidget* createEditor(QWidget* parent, + const QStyleOptionViewItem& option, const QModelIndex& index) const; /// Returns True if the given index is editable item @@ -96,8 +96,8 @@ bool ParametersPlugin_ItemDelegate::isEditable(const QModelIndex& theIndex) cons return true; } -void ParametersPlugin_ItemDelegate::paint(QPainter* painter, - const QStyleOptionViewItem& option, +void ParametersPlugin_ItemDelegate::paint(QPainter* painter, + const QStyleOptionViewItem& option, const QModelIndex& index ) const { QBrush aBrush = painter->brush(); @@ -114,8 +114,8 @@ void ParametersPlugin_ItemDelegate::paint(QPainter* painter, painter->setBrush(aBrush); } -QWidget* ParametersPlugin_ItemDelegate::createEditor(QWidget* parent, - const QStyleOptionViewItem& option, +QWidget* ParametersPlugin_ItemDelegate::createEditor(QWidget* parent, + const QStyleOptionViewItem& option, const QModelIndex& index) const { myEditingIdx = index; @@ -123,7 +123,7 @@ QWidget* ParametersPlugin_ItemDelegate::createEditor(QWidget* parent, } ///////////////////////////////////////////////////////////////////////////////////////////////// -void ParametersPlugin_TreeWidget::closeEditor(QWidget* theEditor, +void ParametersPlugin_TreeWidget::closeEditor(QWidget* theEditor, QAbstractItemDelegate::EndEditHint theHint) { if (theHint == QAbstractItemDelegate::EditNextItem) { @@ -159,7 +159,7 @@ void ParametersPlugin_TreeWidget::closeEditor(QWidget* theEditor, ///////////////////////////////////////////////////////////////////////////////////////////////// -ParametersPlugin_WidgetParamsMgr::ParametersPlugin_WidgetParamsMgr(QWidget* theParent, +ParametersPlugin_WidgetParamsMgr::ParametersPlugin_WidgetParamsMgr(QWidget* theParent, const Config_WidgetAPI* theData) : ModuleBase_ModelDialogWidget(theParent, theData) { @@ -183,7 +183,7 @@ ParametersPlugin_WidgetParamsMgr::ParametersPlugin_WidgetParamsMgr(QWidget* theP connect(myTable, SIGNAL(itemSelectionChanged()), SLOT(onSelectionChanged())); myDelegate = new ParametersPlugin_ItemDelegate(myTable); - connect(myDelegate, SIGNAL(closeEditor(QWidget*, QAbstractItemDelegate::EndEditHint)), + connect(myDelegate, SIGNAL(closeEditor(QWidget*, QAbstractItemDelegate::EndEditHint)), SLOT(onCloseEditor(QWidget*, QAbstractItemDelegate::EndEditHint))); myTable->setItemDelegate(myDelegate); @@ -246,7 +246,7 @@ void ParametersPlugin_WidgetParamsMgr::selectItemScroll(QTreeWidgetItem* aItem) QModelIndex aParent = myTable->model()->index(0, 0); int aChildIdx = myParameters->indexOfChild(aItem); QModelIndex aIndex = myTable->model()->index(aChildIdx, Col_Name, aParent); - myTable->selectionModel()->select(aIndex, + myTable->selectionModel()->select(aIndex, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); myTable->scrollToItem(aItem); } @@ -409,7 +409,7 @@ void ParametersPlugin_WidgetParamsMgr::onDoubleClick(const QModelIndex& theIndex } } -void ParametersPlugin_WidgetParamsMgr::onCloseEditor(QWidget* theEditor, +void ParametersPlugin_WidgetParamsMgr::onCloseEditor(QWidget* theEditor, QAbstractItemDelegate::EndEditHint theHint) { FeaturePtr aFeature = myParametersList.at(myDelegate->editIndex().row()); @@ -433,12 +433,12 @@ void ParametersPlugin_WidgetParamsMgr::onCloseEditor(QWidget* theEditor, } aStringAttr->setValue(aText.toStdString()); isModified = true; - } + } } break; case Col_Equation: { - AttributeStringPtr aStringAttr = + AttributeStringPtr aStringAttr = aFeature->string(ParametersPlugin_Parameter::EXPRESSION_ID()); if (!aText.isEmpty()) { if (aText != aStringAttr->value().c_str()) { @@ -468,19 +468,19 @@ void ParametersPlugin_WidgetParamsMgr::onCloseEditor(QWidget* theEditor, if (aColumn != Col_Comment) updateParametersPart(); updateFeaturesPart(); - + onSelectionChanged(); } -void ParametersPlugin_WidgetParamsMgr::updateItem(QTreeWidgetItem* theItem, +void ParametersPlugin_WidgetParamsMgr::updateItem(QTreeWidgetItem* theItem, const QList& theFeaturesList) { if (theFeaturesList.count() != theItem->childCount()) { if (theItem->childCount() < theFeaturesList.count()) { - while (theItem->childCount() != theFeaturesList.count()) + while (theItem->childCount() != theFeaturesList.count()) theItem->addChild(createNewItem(theItem)); } else { - while (theItem->childCount() != theFeaturesList.count()) + while (theItem->childCount() != theFeaturesList.count()) theItem->removeChild(theItem->child(theItem->childCount() - 1)); } } @@ -521,7 +521,7 @@ QTreeWidgetItem* ParametersPlugin_WidgetParamsMgr::createNewItem(QTreeWidgetItem QTreeWidgetItem* aItem = new QTreeWidgetItem(aValues); if (theParent == myParameters) aItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled); - else + else aItem->setFlags(Qt::NoItemFlags); return aItem; } @@ -534,7 +534,7 @@ void ParametersPlugin_WidgetParamsMgr::onAdd() return; myParametersList.append(aFeature); - updateParametersPart(); + updateParametersPart(); QTreeWidgetItem* aItem = myParameters->child(myParameters->childCount() - 1); @@ -742,7 +742,7 @@ void ParametersPlugin_WidgetParamsMgr::onSelectionChanged() void ParametersPlugin_WidgetParamsMgr::enableButtons(bool theEnable) { myAddBtn->setEnabled(theEnable); - if (theEnable) + if (theEnable) onSelectionChanged(); else { myInsertBtn->setEnabled(theEnable); @@ -759,7 +759,7 @@ bool ParametersPlugin_WidgetParamsMgr::isValid() bool aIsValid = true; for(int i = 0; i < myParameters->childCount(); i++) { aItem = myParameters->child(i); - if ((aItem->text(Col_Name) == NoName) || + if ((aItem->text(Col_Name) == NoName) || (aItem->text(Col_Equation) == NoValue) || (!ModelAPI_Expression::isVariable(aItem->text(Col_Name).toStdString())) ) { aIsValid = false; diff --git a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.h b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.h index 74ae27962..4946ca1a3 100644 --- a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.h +++ b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.h @@ -128,7 +128,7 @@ private: /// Enable or disable buttons for parameters managemnt void enableButtons(bool theEnable); - QList featuresItems(const QList& theFeatures, + QList featuresItems(const QList& theFeatures, QList& theFeatureList) const; QList parametersItems(const QList& theFeatures) const; diff --git a/src/PartSet/PartSet.h b/src/PartSet/PartSet.h index fa6e6647c..4752d7776 100644 --- a/src/PartSet/PartSet.h +++ b/src/PartSet/PartSet.h @@ -17,4 +17,4 @@ #endif #endif -#endif //PARTSET_H \ No newline at end of file +#endif //PARTSET_H diff --git a/src/PartSet/PartSet_CustomPrs.cpp b/src/PartSet/PartSet_CustomPrs.cpp index c313ef059..0235e1e5d 100755 --- a/src/PartSet/PartSet_CustomPrs.cpp +++ b/src/PartSet/PartSet_CustomPrs.cpp @@ -184,7 +184,7 @@ AISObjectPtr PartSet_CustomPrs::getPresentation( AISObjectPtr anOperationPrs; if (myPresentations.contains(theFlag)) anOperationPrs = myPresentations[theFlag]; - + if (!anOperationPrs.get() && theToCreate) { initPresentation(theFlag); anOperationPrs = myPresentations[theFlag]; @@ -203,7 +203,7 @@ bool PartSet_CustomPrs::redisplay(const ObjectPtr& theObject, bool aRedisplayed = false; if (myIsActive[theFlag]) aRedisplayed = displayPresentation(theFlag, theUpdateViewer); - + return aRedisplayed; } diff --git a/src/PartSet/PartSet_ExternalObjectsMgr.cpp b/src/PartSet/PartSet_ExternalObjectsMgr.cpp index 17ecdeda6..2c8ac1d08 100755 --- a/src/PartSet/PartSet_ExternalObjectsMgr.cpp +++ b/src/PartSet/PartSet_ExternalObjectsMgr.cpp @@ -22,13 +22,13 @@ PartSet_ExternalObjectsMgr::PartSet_ExternalObjectsMgr(const std::string& theExt QString aIsExternal(theExternal.c_str()); if (!aIsExternal.isEmpty()) { QString aStr = aIsExternal.toUpper(); - myUseExternal = (aStr == "TRUE") || (aStr == "YES"); + myUseExternal = (aStr == "TRUE") || (aStr == "YES"); } QString aCanCreateExternal(theCanCreateExternal.c_str()); if (!aCanCreateExternal.isEmpty()) { QString aStr = aCanCreateExternal.toUpper(); - myCanCreateExternal = (aStr == "TRUE") || (aStr == "YES"); + myCanCreateExternal = (aStr == "TRUE") || (aStr == "YES"); } } @@ -37,7 +37,7 @@ bool PartSet_ExternalObjectsMgr::isValidObject(const ObjectPtr& theObject) bool aValid = true; FeaturePtr aFeature = ModelAPI_Feature::feature(theObject); // Do check using of external feature - std::shared_ptr aSPFeature = + std::shared_ptr aSPFeature = std::dynamic_pointer_cast(aFeature); // Do check that we can use external feature @@ -96,7 +96,7 @@ void PartSet_ExternalObjectsMgr::removeExternalObject(const ObjectPtr& theObject if (aFeature.get() != NULL) { QObjectPtrList anObjects; anObjects.append(aFeature); - // the external feature should be removed with all references, + // the external feature should be removed with all references, // composite sketch feature will be ignored workshop(theWorkshop)->deleteFeatures(anObjects); } diff --git a/src/PartSet/PartSet_FilterInfinite.cpp b/src/PartSet/PartSet_FilterInfinite.cpp index 33e6cfd2f..22ad88b99 100755 --- a/src/PartSet/PartSet_FilterInfinite.cpp +++ b/src/PartSet/PartSet_FilterInfinite.cpp @@ -34,7 +34,7 @@ Standard_Boolean PartSet_FilterInfinite::IsOk(const Handle(SelectMgr_EntityOwner ResultPtr aResult = myWorkshop->selection()->getResult(aPrs); // to filter infinite construction results if (aResult.get() && aResult->groupName() == ModelAPI_ResultConstruction::group()) { - ResultConstructionPtr aConstruction = + ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aResult); if (aConstruction.get() && aConstruction->isInfinite()) { Handle(StdSelect_BRepOwner) aBRepOwner = Handle(StdSelect_BRepOwner)::DownCast(theOwner); @@ -48,9 +48,9 @@ Standard_Boolean PartSet_FilterInfinite::IsOk(const Handle(SelectMgr_EntityOwner TopoDS_Shape aResultTopoShape = aResultShape->impl(); aResultShapeType = aResultTopoShape.ShapeType(); } - // for infinite object, the selection is possible only + // for infinite object, the selection is possible only // for shapes of owners, which are coincide - // to the shape of corresponded AIS object. + // to the shape of corresponded AIS object. // In other words, for axis, only edge can be selected // (vertices are not selectable), for planes, // only faces can be selected (not edges or vertices) diff --git a/src/PartSet/PartSet_FilterInfinite.h b/src/PartSet/PartSet_FilterInfinite.h index 2e14b81ba..c58ca058c 100755 --- a/src/PartSet/PartSet_FilterInfinite.h +++ b/src/PartSet/PartSet_FilterInfinite.h @@ -28,7 +28,7 @@ public: /// Returns True if selected presentation can be selected /// \param theOwner an owner of the persentation - Standard_EXPORT virtual Standard_Boolean + Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const; DEFINE_STANDARD_RTTI(PartSet_FilterInfinite) diff --git a/src/PartSet/PartSet_Filters.cpp b/src/PartSet/PartSet_Filters.cpp index 6c4e5e1b2..8d66327f8 100644 --- a/src/PartSet/PartSet_Filters.cpp +++ b/src/PartSet/PartSet_Filters.cpp @@ -33,7 +33,7 @@ Standard_Boolean PartSet_GlobalFilter::IsOk(const Handle(SelectMgr_EntityOwner)& if (ModuleBase_ShapeDocumentFilter::IsOk(theOwner)) { std::shared_ptr aAISObj = AISObjectPtr(new GeomAPI_AISObject()); if (theOwner->HasSelectable()) { - Handle(AIS_InteractiveObject) aAisObj = + Handle(AIS_InteractiveObject) aAisObj = Handle(AIS_InteractiveObject)::DownCast(theOwner->Selectable()); if (!aAisObj.IsNull()) { aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aAisObj)); @@ -52,7 +52,7 @@ Standard_Boolean PartSet_GlobalFilter::IsOk(const Handle(SelectMgr_EntityOwner)& FeaturePtr aFeature = ModelAPI_Feature::feature(aObj); if (aFeature) { aValid = aFeature->getKind() != "Group"; - } else + } else aValid = Standard_True; } } else @@ -69,7 +69,7 @@ Standard_Boolean PartSet_GlobalFilter::IsOk(const Handle(SelectMgr_EntityOwner)& IMPLEMENT_STANDARD_HANDLE(PartSet_CirclePointFilter, SelectMgr_Filter); IMPLEMENT_STANDARD_RTTIEXT(PartSet_CirclePointFilter, SelectMgr_Filter); -Standard_Boolean +Standard_Boolean PartSet_CirclePointFilter::IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const { ModuleBase_Operation* anOperation = myWorkshop->module()->currentOperation(); @@ -91,7 +91,7 @@ Standard_Boolean return Standard_True; } - Handle(ModuleBase_ResultPrs) aResultPrs = + Handle(ModuleBase_ResultPrs) aResultPrs = Handle(ModuleBase_ResultPrs)::DownCast(theOwner->Selectable()); if(aResultPrs.IsNull()) { return Standard_True; diff --git a/src/PartSet/PartSet_Filters.h b/src/PartSet/PartSet_Filters.h index 71d60fe4c..c1bd7dee4 100644 --- a/src/PartSet/PartSet_Filters.h +++ b/src/PartSet/PartSet_Filters.h @@ -26,7 +26,7 @@ public: /// Returns True if selected presentation can be selected /// \param theOwner an owner of the persentation - Standard_EXPORT virtual Standard_Boolean + Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const; DEFINE_STANDARD_RTTI(PartSet_GlobalFilter) @@ -50,7 +50,7 @@ public: /// Returns True if the given owner is acceptable for selection /// \param theOwner the selected owner - Standard_EXPORT virtual Standard_Boolean + Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const; DEFINE_STANDARD_RTTI(PartSet_CirclePointFilter) diff --git a/src/PartSet/PartSet_IconFactory.cpp b/src/PartSet/PartSet_IconFactory.cpp index bf3fcebb3..f6b27be57 100644 --- a/src/PartSet/PartSet_IconFactory.cpp +++ b/src/PartSet/PartSet_IconFactory.cpp @@ -19,7 +19,7 @@ QMap PartSet_IconFactory::myIcons; PartSet_IconFactory::PartSet_IconFactory():ModuleBase_IconFactory() { - Events_Loop::loop()->registerListener(this, + Events_Loop::loop()->registerListener(this, Events_Loop::eventByName(Config_FeatureMessage::GUI_EVENT())); } @@ -60,9 +60,9 @@ QIcon PartSet_IconFactory::getIcon(ObjectPtr theObj) anIconString); } break; - default: break; + default: break; } - } + } if (theObj->data() && theObj->data()->execState() == ModelAPI_StateMustBeUpdated) return QIcon(":pictures/constr_object_modified.png"); @@ -100,7 +100,7 @@ QIcon PartSet_IconFactory::getIcon(ObjectPtr theObj) void PartSet_IconFactory::processEvent(const std::shared_ptr& theMessage) { - if (theMessage->eventID() == + if (theMessage->eventID() == Events_Loop::loop()->eventByName(Config_FeatureMessage::GUI_EVENT())) { std::shared_ptr aFeatureMsg = std::dynamic_pointer_cast(theMessage); diff --git a/src/PartSet/PartSet_MenuMgr.cpp b/src/PartSet/PartSet_MenuMgr.cpp index 640c1b897..ce600a203 100644 --- a/src/PartSet/PartSet_MenuMgr.cpp +++ b/src/PartSet/PartSet_MenuMgr.cpp @@ -178,7 +178,7 @@ bool PartSet_MenuMgr::addViewerMenu(const QMap& theStdActions connect(aSubMenu, SIGNAL(hovered(QAction*)), SLOT(onLineHighlighted(QAction*))); connect(aSubMenu, SIGNAL(aboutToHide()), SLOT(onDetachMenuHide())); connect(aSubMenu, SIGNAL(triggered(QAction*)), SLOT(onLineDetach(QAction*))); - } + } } } } @@ -246,7 +246,7 @@ QColor PartSet_MenuMgr::setLineColor(int theId, const QColor theColor, bool theU } -void addRefCoincidentFeatures(const std::set& theRefList, +void addRefCoincidentFeatures(const std::set& theRefList, std::shared_ptr& theRefPnt, QObjectPtrList& theOutList) { @@ -254,14 +254,14 @@ void addRefCoincidentFeatures(const std::set& theRefList, for (aIt = theRefList.cbegin(); aIt != theRefList.cend(); ++aIt) { std::shared_ptr aAttr = (*aIt); FeaturePtr aConstrFeature = std::dynamic_pointer_cast(aAttr->owner()); - if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) { + if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) { std::shared_ptr aPnt = PartSet_Tools::getCoincedencePoint(aConstrFeature); if (aPnt.get() == NULL) return; gp_Pnt aP = aPnt->impl(); if (theRefPnt->isEqual(aPnt) && (!theOutList.contains(aConstrFeature))) { theOutList.append(aConstrFeature); - } + } } } } @@ -273,7 +273,7 @@ void PartSet_MenuMgr::onLineDetach(QAction* theAction) std::shared_ptr aOrig = PartSet_Tools::getCoincedencePoint(mySelectedFeature); if (!aOrig.get()) return; - + const std::set& aRefsList = aLine->data()->refsToMe(); QObjectPtrList aToDelFeatures; @@ -304,7 +304,7 @@ void PartSet_MenuMgr::onLineDetach(QAction* theAction) anOpMgr->startOperation(anOpAction); aWorkshop->deleteFeatures(aToDelFeatures); - + anOpMgr->commitOperation(); } myCoinsideLines.clear(); @@ -321,7 +321,7 @@ void PartSet_MenuMgr::onDetachMenuHide() myPrevId = -1; } - + void PartSet_MenuMgr::setAuxiliary(const bool isChecked) { ModuleBase_Operation* anOperation = myModule->workshop()->currentOperation(); @@ -373,7 +373,7 @@ void PartSet_MenuMgr::setAuxiliary(const bool isChecked) if (aSketchFeature.get() != NULL) { std::string anAttribute = SketchPlugin_SketchEntity::AUXILIARY_ID(); - std::shared_ptr anAuxiliaryAttr = + std::shared_ptr anAuxiliaryAttr = std::dynamic_pointer_cast( aSketchFeature->data()->attribute(anAttribute)); if (anAuxiliaryAttr) @@ -430,7 +430,7 @@ bool PartSet_MenuMgr::canSetAuxiliary(bool& theValue) const if (aSketchFeature.get() != NULL) { std::string anAttribute = SketchPlugin_SketchEntity::AUXILIARY_ID(); - std::shared_ptr anAuxiliaryAttr = + std::shared_ptr anAuxiliaryAttr = std::dynamic_pointer_cast( aSketchFeature->data()->attribute(anAttribute)); if (anAuxiliaryAttr) @@ -496,7 +496,7 @@ void PartSet_MenuMgr::onEdit(bool) QObjectPtrList aObjects = myModule->workshop()->selection()->selectedObjects(); FeaturePtr aFeature = std::dynamic_pointer_cast(aObjects.first()); if (aFeature == NULL) { - ResultParameterPtr aParam = + ResultParameterPtr aParam = std::dynamic_pointer_cast(aObjects.first()); if (aParam.get() != NULL) { aFeature = ModelAPI_Feature::feature(aParam); diff --git a/src/PartSet/PartSet_MenuMgr.h b/src/PartSet/PartSet_MenuMgr.h index 661226ef6..5061b1fec 100644 --- a/src/PartSet/PartSet_MenuMgr.h +++ b/src/PartSet/PartSet_MenuMgr.h @@ -39,7 +39,7 @@ public: /// Add menu items for viewer into the actions map /// \param theStdActions a map of standard actions - /// \param theParent a parent widget for the + /// \param theParent a parent widget for the /// \param theMenuActions map of action/menu for the desirable index in the viewer menu /// \return true if items are added and there is no necessity to provide standard menu bool addViewerMenu(const QMap& theStdActions, @@ -48,7 +48,7 @@ public: /// Update state of pop-up menu items in viewer /// \param theStdActions - a map of standard actions - void updateViewerMenu(const QMap& theStdActions); + void updateViewerMenu(const QMap& theStdActions); /// Activates a PartSet document void activatePartSet() const; @@ -94,7 +94,7 @@ private: /// \param theValue the current auxiliary value /// \return the boolean result bool canSetAuxiliary(bool& theValue) const; - + /// Changes the sketcher entity construction argument value /// \param isChecked if true, the feature is a construction void setAuxiliary(const bool isChecked); @@ -119,7 +119,7 @@ private: PartSet_Module* myModule; /// the popup menu actions - QMap myActions; + QMap myActions; /// List of lines coincided in a one point mutable QList myCoinsideLines; @@ -130,7 +130,7 @@ private: /// Id of menu item in Detach menu previously selected int myPrevId; - /// Original color of highlighted line + /// Original color of highlighted line QColor myColor; }; diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 04c57f58a..4a74d99f3 100755 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -244,17 +244,17 @@ void PartSet_Module::registerProperties() PLANE_SIZE); Config_PropManager::registerProp(SKETCH_TAB_NAME, "planes_thickness", "Thickness", Config_Prop::Integer, SKETCH_WIDTH); - Config_PropManager::registerProp(SKETCH_TAB_NAME, "rotate_to_plane", + Config_PropManager::registerProp(SKETCH_TAB_NAME, "rotate_to_plane", "Rotate to plane when selected", Config_Prop::Boolean, "false"); } -void PartSet_Module::connectToPropertyPanel(ModuleBase_ModelWidget* theWidget, +void PartSet_Module::connectToPropertyPanel(ModuleBase_ModelWidget* theWidget, const bool isToConnect) { mySketchMgr->connectToPropertyPanel(theWidget, isToConnect); } -void PartSet_Module::operationCommitted(ModuleBase_Operation* theOperation) +void PartSet_Module::operationCommitted(ModuleBase_Operation* theOperation) { if (sketchMgr()->isNestedSketchOperation(theOperation)) { mySketchMgr->commitNestedSketch(theOperation); @@ -263,7 +263,7 @@ void PartSet_Module::operationCommitted(ModuleBase_Operation* theOperation) /// Restart sketcher operations automatically if (!mySketchReentrantMgr->operationCommitted(theOperation)) { - ModuleBase_OperationFeature* aFOperation = + ModuleBase_OperationFeature* aFOperation = dynamic_cast(theOperation); if (aFOperation && !aFOperation->isEditOperation()) { // the selection is cleared after commit the create operation @@ -305,7 +305,7 @@ void PartSet_Module::operationStarted(ModuleBase_Operation* theOperation) bool isOperationCommitted = false; if (!aFOperation->isEditOperation()) { std::string aGreedAttributeId = ModuleBase_Tools::findGreedAttribute(workshop(), aFeature); - // if there is a greed attribute, automatic commit by preselection + // if there is a greed attribute, automatic commit by preselection // for this feature is prohibited aFilledWidget = aFOperation->activateByPreselection(aGreedAttributeId); if (currentOperation() != aFOperation) @@ -313,8 +313,8 @@ void PartSet_Module::operationStarted(ModuleBase_Operation* theOperation) else { if (aGreedAttributeId.empty()) { // a signal should be emitted before the next widget activation - // because, the activation of the next widget will give a focus to the widget. - // As a result the value of the widget is initialized. + // because, the activation of the next widget will give a focus to the widget. + // As a result the value of the widget is initialized. // And commit may happens until the value is entered. if (aFilledWidget) { if (mySketchReentrantMgr->canBeCommittedByPreselection()) @@ -388,7 +388,7 @@ void PartSet_Module::operationResumed(ModuleBase_Operation* theOperation) { ModuleBase_IModule::operationResumed(theOperation); - ModuleBase_OperationFeature* aFOperation = + ModuleBase_OperationFeature* aFOperation = dynamic_cast(theOperation); if (aFOperation) { myCustomPrs->activate(aFOperation->feature(), ModuleBase_IModule::CustomizeArguments, true); @@ -415,7 +415,7 @@ void PartSet_Module::operationStopped(ModuleBase_Operation* theOperation) aDisplayer->updateViewer(); } - QMap::const_iterator + QMap::const_iterator anIt = myHasConstraintShown.begin(), aLast = myHasConstraintShown.end(); for (; anIt != aLast; anIt++) { mySketchMgr->updateBySketchParameters(anIt.key(), anIt.value()); @@ -495,7 +495,7 @@ bool PartSet_Module::canActivateSelection(const ObjectPtr& theObject) const if (isSketchOp || isNestedOp) { // in active sketch operation it is possible to activate operation object in selection // in the edit operation, e.g. points of the line can be moved when the line is edited - ModuleBase_OperationFeature* aFOperation = + ModuleBase_OperationFeature* aFOperation = dynamic_cast(anOperation); aCanActivate = aCanActivate || (aFOperation && aFOperation->isEditOperation()); } @@ -606,7 +606,7 @@ bool PartSet_Module::createWidgets(ModuleBase_Operation* theOperation, { bool aProcessed = false; - ModuleBase_OperationFeature* aFOperation = + ModuleBase_OperationFeature* aFOperation = dynamic_cast(theOperation); XGUI_Workshop* aWorkshop = getWorkshop(); XGUI_PropertyPanel* aPropertyPanel = aWorkshop->propertyPanel(); @@ -621,7 +621,7 @@ bool PartSet_Module::createWidgets(ModuleBase_Operation* theOperation, FeaturePtr aFeature = ModelAPI_Feature::feature(anObject); FeaturePtr anOpFeature = aFOperation->feature(); GeomShapePtr aShape = aSelectedPrs->shape(); - // click on the digit of dimension constrain comes here + // click on the digit of dimension constrain comes here // with an empty shape, so we need the check if (aFeature == anOpFeature && aShape.get() && !aShape->isNull()) { const TopoDS_Shape& aTDShape = aShape->impl(); @@ -669,14 +669,14 @@ void PartSet_Module::onSelectionChanged() if (aFeature) { std::string aId = aFeature->getKind(); if ((aId == SketchPlugin_ConstraintRadius::ID()) || - (aId == SketchPlugin_ConstraintLength::ID()) || + (aId == SketchPlugin_ConstraintLength::ID()) || (aId == SketchPlugin_ConstraintDistance::ID()) || (aId == SketchPlugin_ConstraintAngle::ID())) { editFeature(aFeature); } } } - } + } } void PartSet_Module::onKeyRelease(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent) @@ -820,9 +820,9 @@ bool PartSet_Module::deleteObjects() anOpMgr->startOperation(anOpAction); // WORKAROUND, should be done to avoid viewer highlight update after deletetion of objects - // the problem is in AIS Dimensions recompute + // the problem is in AIS Dimensions recompute // if a line and the dim are removed, line is the first - // it causes the AIS recompute, where the base line is null, + // it causes the AIS recompute, where the base line is null, // the result is empty AIS in the viewer XGUI_Tools::workshop(myWorkshop)->selector()->clearSelection(); @@ -883,7 +883,7 @@ void PartSet_Module::launchOperation(const QString& theCmdId) void PartSet_Module::storeConstraintsState(const std::string& theFeatureKind) { - if (myWorkshop->currentOperation() && + if (myWorkshop->currentOperation() && myWorkshop->currentOperation()->id().toStdString() == SketchPlugin_Sketch::ID()) { const QMap& aShownStates = mySketchMgr->showConstraintStates(); @@ -903,7 +903,7 @@ void PartSet_Module::updateConstraintsState(const std::string& theFeatureKind) } } -void PartSet_Module::onObjectDisplayed(ObjectPtr theObject, AISObjectPtr theAIS) +void PartSet_Module::onObjectDisplayed(ObjectPtr theObject, AISObjectPtr theAIS) { Handle(AIS_InteractiveObject) anAIS = theAIS->impl(); if (!anAIS.IsNull()) { @@ -946,8 +946,8 @@ void PartSet_Module::onViewTransformed(int theTrsfType) Handle(V3d_Viewer) aV3dViewer = aContext->CurrentViewer(); Handle(V3d_View) aView; double aScale = 0; - for (aV3dViewer->InitDefinedViews(); - aV3dViewer->MoreDefinedViews(); + for (aV3dViewer->InitDefinedViews(); + aV3dViewer->MoreDefinedViews(); aV3dViewer->NextDefinedViews()) { Handle(V3d_View) aV = aV3dViewer->DefinedView(); double aS = aV->Scale(); @@ -987,7 +987,7 @@ bool PartSet_Module::isCustomPrsActivated(const ModuleBase_CustomizeFlag& theFla return myCustomPrs->isActive(theFlag); } -void PartSet_Module::activateCustomPrs(const FeaturePtr& theFeature, +void PartSet_Module::activateCustomPrs(const FeaturePtr& theFeature, const ModuleBase_CustomizeFlag& theFlag, const bool theUpdateViewer) { @@ -1071,13 +1071,13 @@ void PartSet_Module::customizeObjectBrowser(QWidget* theObjectBrowser) if (aOB) { QLabel* aLabel = aOB->activeDocLabel(); aLabel->installEventFilter(myMenuMgr); - connect(aLabel, SIGNAL(customContextMenuRequested(const QPoint&)), + connect(aLabel, SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(onActiveDocPopup(const QPoint&))); //QPalette aPalet = aLabel->palette(); //aPalet.setColor(QPalette::Text, QColor(0, 72, 140)); //aLabel->setPalette(aPalet); aOB->treeView()->setExpandsOnDoubleClick(false); - connect(aOB->treeView(), SIGNAL(doubleClicked(const QModelIndex&)), + connect(aOB->treeView(), SIGNAL(doubleClicked(const QModelIndex&)), SLOT(onTreeViewDoubleClick(const QModelIndex&))); } } @@ -1115,7 +1115,7 @@ ObjectPtr PartSet_Module::findPresentedObject(const AISObjectPtr& theAIS) const // if there is an active widget, find the presented object in it if (!anActiveWidget) anActiveWidget = aPanel->preselectionWidget(); - + ModuleBase_WidgetValidated* aWidgetValidated = dynamic_cast (anActiveWidget); if (aWidgetValidated) @@ -1130,7 +1130,7 @@ bool PartSet_Module::canBeShaded(Handle(AIS_InteractiveObject) theAIS) const bool aCanBeShaged = true; Handle(PartSet_ResultSketchPrs) aPrs = Handle(PartSet_ResultSketchPrs)::DownCast(theAIS); - if (!aPrs.IsNull()) + if (!aPrs.IsNull()) aCanBeShaged = false; return aCanBeShaged; @@ -1155,7 +1155,7 @@ void PartSet_Module::addObjectBrowserMenu(QMenu* theMenu) const if (aObject) { ResultPartPtr aPart = std::dynamic_pointer_cast(aObject); FeaturePtr aFeature = std::dynamic_pointer_cast(aObject); - bool isPart = aPart.get() || + bool isPart = aPart.get() || (aFeature.get() && (aFeature->getKind() == PartSetPlugin_Part::ID())); if (isPart) { DocumentPtr aPartDoc; @@ -1164,7 +1164,7 @@ void PartSet_Module::addObjectBrowserMenu(QMenu* theMenu) const } if (aPart.get()) // this may be null is Part feature is disabled aPartDoc = aPart->partDoc(); - + theMenu->addAction(aActivatePartAction); aActivatePartAction->setEnabled((aMgr->activeDocument() != aPartDoc)); @@ -1196,11 +1196,11 @@ void PartSet_Module::processEvent(const std::shared_ptr& theMess // Do not change activation of parts if an operation active static QStringList aAllowActivationList; if (aAllowActivationList.isEmpty()) - aAllowActivationList << - QString(PartSetPlugin_Part::ID().c_str()) << + aAllowActivationList << + QString(PartSetPlugin_Part::ID().c_str()) << QString(PartSetPlugin_Duplicate::ID().c_str()) << QString(PartSetPlugin_Remove::ID().c_str()); - if (myWorkshop->currentOperation() && + if (myWorkshop->currentOperation() && (!aAllowActivationList.contains(myWorkshop->currentOperation()->id()))) return; XGUI_Workshop* aWorkshop = getWorkshop(); @@ -1226,7 +1226,7 @@ void PartSet_Module::processEvent(const std::shared_ptr& theMess bool aHidden; foreach(ObjectPtr aObj, aObjects) { //TODO: replace by redisplay event. - aHidden = !aObj->data() || !aObj->data()->isValid() || + aHidden = !aObj->data() || !aObj->data()->isValid() || aObj->isDisabled() || (!aObj->isDisplayed()); if (!aHidden) aDisplayer->redisplay(aObj, false); @@ -1302,7 +1302,7 @@ void PartSet_Module::onViewCreated(ModuleBase_IViewWindow*) if (aOperation) { ModuleBase_ModelWidget* anActiveWidget = activeWidget(); if (anActiveWidget) { - ModuleBase_WidgetSelector* aWSelector = + ModuleBase_WidgetSelector* aWSelector = dynamic_cast(anActiveWidget); if (aWSelector) aWSelector->activateSelectionAndFilters(true); @@ -1358,7 +1358,7 @@ AttributePtr PartSet_Module::findAttribute(const ObjectPtr& theObject, if (aGeomShape.get()) { TopoDS_Shape aTDSShape = aGeomShape->impl(); - return PartSet_Tools::findAttributeBy2dPoint(theObject, aTDSShape, + return PartSet_Tools::findAttributeBy2dPoint(theObject, aTDSShape, mySketchMgr->activeSketch()); } return anAttribute; diff --git a/src/PartSet/PartSet_Module.h b/src/PartSet/PartSet_Module.h index 6687e7aa6..aeae34146 100755 --- a/src/PartSet/PartSet_Module.h +++ b/src/PartSet/PartSet_Module.h @@ -51,7 +51,7 @@ Q_OBJECT enum RestartingMode { RM_None, /// the operation should not be restarted RM_Forbided, /// the operation should not be restarted after there is no active widget - RM_LastFeatureUsed, /// the operation is restarted and use the previous feature + RM_LastFeatureUsed, /// the operation is restarted and use the previous feature /// for own initialization RM_EmptyFeatureUsed /// the operation is restarted and does not use the previous feature }; @@ -85,7 +85,7 @@ public: /// Call back forlast tuning of property panel before operation performance virtual void propertyPanelDefined(ModuleBase_Operation* theOperation); - /// If there is found selected attribute, widgets are created and contains + /// If there is found selected attribute, widgets are created and contains /// only a widget for the attribute /// It is important for Property Panel filling by sketch point attribute /// \param theOperation a started operation @@ -94,7 +94,7 @@ public: virtual bool createWidgets(ModuleBase_Operation* theOperation, QList& theWidgets) const; - /// Launching of a edit operation on the feature + /// Launching of a edit operation on the feature /// \param theFeature feature for editing virtual void editFeature(FeaturePtr theFeature); @@ -286,7 +286,7 @@ public: /// Update state of pop-up menu items in viewer /// \param theStdActions - a map of standard actions - virtual void updateViewerMenu(const QMap& theStdActions); + virtual void updateViewerMenu(const QMap& theStdActions); /// Returns true if the action should be always enabled /// \param theActionId an action index: Accept or Accept All diff --git a/src/PartSet/PartSet_MouseProcessor.h b/src/PartSet/PartSet_MouseProcessor.h index 0ef59ef8d..6a123df60 100755 --- a/src/PartSet/PartSet_MouseProcessor.h +++ b/src/PartSet/PartSet_MouseProcessor.h @@ -32,12 +32,12 @@ public: /// Processing the mouse release event in the viewer /// \param theWindow a view window /// \param theEvent a mouse event - PARTSET_EXPORT virtual void mouseReleased(ModuleBase_IViewWindow* theWindow, + PARTSET_EXPORT virtual void mouseReleased(ModuleBase_IViewWindow* theWindow, QMouseEvent* theEvent) {} /// Processing the mouse double click event in the viewer /// \param theWindow a view window /// \param theEvent a mouse event - PARTSET_EXPORT virtual void mouseDoubleClick(ModuleBase_IViewWindow* theWindow, + PARTSET_EXPORT virtual void mouseDoubleClick(ModuleBase_IViewWindow* theWindow, QMouseEvent* theEvent) {} }; diff --git a/src/PartSet/PartSet_OperationPrs.cpp b/src/PartSet/PartSet_OperationPrs.cpp index 3204fa097..2724a3297 100755 --- a/src/PartSet/PartSet_OperationPrs.cpp +++ b/src/PartSet/PartSet_OperationPrs.cpp @@ -91,7 +91,7 @@ void PartSet_OperationPrs::useAISWidth() void PartSet_OperationPrs::Compute( const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, - const Handle(Prs3d_Presentation)& thePresentation, + const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode) { #ifdef DEBUG_OPERATION_PRS @@ -108,7 +108,7 @@ void PartSet_OperationPrs::Compute( BRep_Builder aBuilder; TopoDS_Compound aComp; aBuilder.MakeCompound(aComp); - for(NCollection_DataMap::Iterator + for(NCollection_DataMap::Iterator anIter(myShapeToPrsMap); anIter.More(); anIter.Next()) { const TopoDS_Shape& aShape = anIter.Key(); aBuilder.Add(aComp, aShape); @@ -132,7 +132,7 @@ void PartSet_OperationPrs::Compute( } Set(aComp); if (!aReadyToDisplay) { - Events_InfoMessage("PartSet_OperationPrs", + Events_InfoMessage("PartSet_OperationPrs", "An empty AIS presentation: PartSet_OperationPrs").send(); std::shared_ptr aMsg = std::shared_ptr( new Events_Message(Events_Loop::eventByName(EVENT_EMPTY_OPERATION_PRESENTATION))); @@ -171,7 +171,7 @@ void PartSet_OperationPrs::addValue(const ObjectPtr& theObject, const GeomShapeP if (theObject.get()) { ResultPtr aResult = std::dynamic_pointer_cast(theObject); if (aResult.get()) { - ResultCompSolidPtr aCompsolidResult = + ResultCompSolidPtr aCompsolidResult = std::dynamic_pointer_cast(theObject); if (aCompsolidResult.get()) { if (aCompsolidResult->numberOfSubs() > 0) { @@ -189,7 +189,7 @@ void PartSet_OperationPrs::addValue(const ObjectPtr& theObject, const GeomShapeP else { FeaturePtr aFeature = ModelAPI_Feature::feature(theObject); if (aFeature.get()) { - AttributeBooleanPtr aCopyAttr = + AttributeBooleanPtr aCopyAttr = aFeature->data()->boolean(SketchPlugin_SketchEntity::COPY_ID()); if (aCopyAttr.get()) { bool isCopy = aCopyAttr->value(); @@ -260,7 +260,7 @@ void PartSet_OperationPrs::getFeatureShapes(const FeaturePtr& theFeature, std::string anAttrType = anAttribute->attributeType(); if (anAttrType == ModelAPI_AttributeSelectionList::typeId()) { - std::shared_ptr aCurSelList = + std::shared_ptr aCurSelList = std::dynamic_pointer_cast(anAttribute); for(int i = 0; i < aCurSelList->size(); i++) { std::shared_ptr aSelAttribute = aCurSelList->value(i); @@ -294,7 +294,7 @@ void PartSet_OperationPrs::getFeatureShapes(const FeaturePtr& theFeature, ObjectPtr anObject; GeomShapePtr aShape; if (anAttrType == ModelAPI_AttributeRefAttr::typeId()) { - AttributeRefAttrPtr anAttr = + AttributeRefAttrPtr anAttr = std::dynamic_pointer_cast(anAttribute); if (anAttr->isObject()) { anObject = anAttr->object(); @@ -310,13 +310,13 @@ void PartSet_OperationPrs::getFeatureShapes(const FeaturePtr& theFeature, } } if (anAttrType == ModelAPI_AttributeSelection::typeId()) { - AttributeSelectionPtr anAttr = + AttributeSelectionPtr anAttr = std::dynamic_pointer_cast(anAttribute); anObject = anAttr->context(); aShape = anAttr->value(); } if (anAttrType == ModelAPI_AttributeReference::typeId()) { - AttributeReferencePtr anAttr = + AttributeReferencePtr anAttr = std::dynamic_pointer_cast(anAttribute); anObject = anAttr->value(); } @@ -350,7 +350,7 @@ void PartSet_OperationPrs::getResultShapes(const FeaturePtr& theFeature, } void PartSet_OperationPrs::getHighlightedShapes(ModuleBase_IWorkshop* theWorkshop, - QMap >& theObjectShapes) { theObjectShapes.clear(); @@ -393,7 +393,7 @@ bool PartSet_OperationPrs::isSelectionAttribute(const AttributePtr& theAttribute void PartSet_OperationPrs::fillShapeList( const QMap >& theFeatureShapes, ModuleBase_IWorkshop* theWorkshop, - NCollection_DataMap& theShapeToPrsMap) { theShapeToPrsMap.Clear(); diff --git a/src/PartSet/PartSet_OverconstraintListener.cpp b/src/PartSet/PartSet_OverconstraintListener.cpp index 39ee53259..ba05d9bd7 100755 --- a/src/PartSet/PartSet_OverconstraintListener.cpp +++ b/src/PartSet/PartSet_OverconstraintListener.cpp @@ -111,7 +111,7 @@ bool PartSet_OverconstraintListener::appendConflictingObjects( getConflictingColor(aColor); // set error state for new objects and append them in the internal map of objects - std::set::const_iterator + std::set::const_iterator anIt = theConflictingObjects.begin(), aLast = theConflictingObjects.end(); for (; anIt != aLast; anIt++) { ObjectPtr anObject = *anIt; @@ -133,7 +133,7 @@ bool PartSet_OverconstraintListener::repairConflictingObjects( std::set aModifiedObjects; // erase error state of absent current objects in the parameter list std::set::const_iterator anIt, aLast; - for (anIt = theConflictingObjects.begin(), aLast = theConflictingObjects.end(); + for (anIt = theConflictingObjects.begin(), aLast = theConflictingObjects.end(); anIt != aLast; anIt++) { ObjectPtr anObject = *anIt; if (theConflictingObjects.find(anObject) != theConflictingObjects.end()) { // it is found diff --git a/src/PartSet/PartSet_OverconstraintListener.h b/src/PartSet/PartSet_OverconstraintListener.h index c636920af..dd7df2002 100755 --- a/src/PartSet/PartSet_OverconstraintListener.h +++ b/src/PartSet/PartSet_OverconstraintListener.h @@ -42,7 +42,7 @@ public: /// \param theObject an object to be checked /// \return boolean result bool isConflictingObject(const ObjectPtr& theObject); - + /// Returns values of conflicting color /// \param theColor the output container to be filled in [red, green, blue] values void getConflictingColor(std::vector& theColor); diff --git a/src/PartSet/PartSet_PreviewPlanes.cpp b/src/PartSet/PartSet_PreviewPlanes.cpp index 71ddfdb3a..32126f2cb 100755 --- a/src/PartSet/PartSet_PreviewPlanes.cpp +++ b/src/PartSet/PartSet_PreviewPlanes.cpp @@ -119,12 +119,12 @@ void PartSet_PreviewPlanes::showPreviewPlanes(ModuleBase_IWorkshop* theWorkshop) myPreviewDisplayed = true; } -AISObjectPtr PartSet_PreviewPlanes::createPreviewPlane(std::shared_ptr theOrigin, - std::shared_ptr theNorm, +AISObjectPtr PartSet_PreviewPlanes::createPreviewPlane(std::shared_ptr theOrigin, + std::shared_ptr theNorm, const int theRGB[3]) { double aSize = Config_PropManager::integer(SKETCH_TAB_NAME, "planes_size", PLANE_SIZE); - std::shared_ptr aFace = + std::shared_ptr aFace = GeomAlgoAPI_FaceBuilder::squareFace(theOrigin, theNorm, aSize); AISObjectPtr aAIS = AISObjectPtr(new GeomAPI_AISObject()); aAIS->createShape(aFace); diff --git a/src/PartSet/PartSet_PreviewPlanes.h b/src/PartSet/PartSet_PreviewPlanes.h index 6ea902663..e6ee2b9df 100755 --- a/src/PartSet/PartSet_PreviewPlanes.h +++ b/src/PartSet/PartSet_PreviewPlanes.h @@ -60,8 +60,8 @@ private: /// \param theOrigin an origin of the plane /// \param theNorm a normal vector of the plane /// \param theRGB a color of plane presentation [r, g, b] array - AISObjectPtr createPreviewPlane(std::shared_ptr theOrigin, - std::shared_ptr theNorm, + AISObjectPtr createPreviewPlane(std::shared_ptr theOrigin, + std::shared_ptr theNorm, const int theRGB[3]); private: diff --git a/src/PartSet/PartSet_ResultSketchPrs.cpp b/src/PartSet/PartSet_ResultSketchPrs.cpp index e0d6010c5..9cd8bace7 100755 --- a/src/PartSet/PartSet_ResultSketchPrs.cpp +++ b/src/PartSet/PartSet_ResultSketchPrs.cpp @@ -54,7 +54,7 @@ PartSet_ResultSketchPrs::PartSet_ResultSketchPrs(ResultPtr theResult) TopoDS_Shape aShape = aShapePtr->impl(); Set(aShape); Handle(Prs3d_Drawer) aDrawer = Attributes(); - if (aDrawer->HasOwnPointAspect()) + if (aDrawer->HasOwnPointAspect()) aDrawer->PointAspect()->SetTypeOfMarker(Aspect_TOM_PLUS); else aDrawer->SetPointAspect(new Prs3d_PointAspect(Aspect_TOM_PLUS, Quantity_NOC_YELLOW, 1.)); @@ -68,7 +68,7 @@ PartSet_ResultSketchPrs::PartSet_ResultSketchPrs(ResultPtr theResult) void PartSet_ResultSketchPrs::Compute( const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, - const Handle(Prs3d_Presentation)& thePresentation, + const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode) { thePresentation->Clear(); @@ -103,7 +103,7 @@ void PartSet_ResultSketchPrs::Compute( } if (!aReadyToDisplay) { - Events_InfoMessage("PartSet_ResultSketchPrs", + Events_InfoMessage("PartSet_ResultSketchPrs", "An empty AIS presentation: PartSet_ResultSketchPrs").send(); static const Events_ID anEvent = Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION); ModelAPI_EventCreator::get()->sendUpdated(myResult, anEvent); @@ -116,7 +116,7 @@ void debugInfo(const TopoDS_Shape& theShape, const TopAbs_ShapeEnum theType) TopTools_IndexedMapOfShape aSubShapes; TopExp::MapShapes (theShape, theType, aSubShapes); - Standard_Boolean + Standard_Boolean isComesFromDecomposition = !((aSubShapes.Extent() == 1) && (theShape == aSubShapes (1))); int anExtent = aSubShapes.Extent(); for (Standard_Integer aShIndex = 1; aShIndex <= aSubShapes.Extent(); ++aShIndex) @@ -155,7 +155,7 @@ void PartSet_ResultSketchPrs::ComputeSelection(const Handle(SelectMgr_Selection) TopoDS_Compound aComp; aBuilder.MakeCompound(aComp); aBuilder.Add(aComp, myOriginalShape); - + for(NCollection_List::Iterator anIt(mySketchFaceList); anIt.More(); anIt.Next()) { const TopoDS_Shape& aFace = anIt.Value(); aBuilder.Add(aComp, aFace); @@ -211,8 +211,8 @@ void PartSet_ResultSketchPrs::appendShapeSelection(const Handle(SelectMgr_Select void PartSet_ResultSketchPrs::setAuxiliaryPresentationStyle(const bool isAuxiliary) { - Standard_Integer aLineStyle = isAuxiliary? - SketchPlugin_SketchEntity::SKETCH_LINE_STYLE_AUXILIARY() : + Standard_Integer aLineStyle = isAuxiliary? + SketchPlugin_SketchEntity::SKETCH_LINE_STYLE_AUXILIARY() : SketchPlugin_SketchEntity::SKETCH_LINE_STYLE(); Handle(Prs3d_Drawer) aDrawer = Attributes(); @@ -247,7 +247,7 @@ void PartSet_ResultSketchPrs::fillShapes(TopoDS_Shape& theResultShape, return; theFaceList.Clear(); - ResultConstructionPtr aConstruction = + ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(myResult); if (aConstruction.get()) { int aFacesNum = aConstruction->facesNum(); diff --git a/src/PartSet/PartSet_ResultSketchPrs.h b/src/PartSet/PartSet_ResultSketchPrs.h index bb816a81b..2eaa6bff0 100755 --- a/src/PartSet/PartSet_ResultSketchPrs.h +++ b/src/PartSet/PartSet_ResultSketchPrs.h @@ -46,7 +46,7 @@ private: /// \param theShape a shape /// \param theTypeOfSelection type of selection: VERTEX, EDGE, WIRE void appendShapeSelection(const Handle(SelectMgr_Selection)& theSelection, - const TopoDS_Shape& theShape, + const TopoDS_Shape& theShape, const TopAbs_ShapeEnum& theTypeOfSelection); /// Sets color/line style/width of the presentation depending on the parameter state diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index e91a55170..32a636598 100755 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -98,7 +98,7 @@ //#define DEBUG_CURSOR /// Fills attribute and result lists by the selected owner. In case if the attribute is found, -/// by the owner shape, it is put to the list. Otherwise if type of owner shape is edge, +/// by the owner shape, it is put to the list. Otherwise if type of owner shape is edge, /// put the function result as is to the list of results. /// \param theOwner a viewer selected owner /// \param theFeature a feature, where the attribute is searched @@ -291,7 +291,7 @@ void PartSet_SketcherMgr::onAfterValuesChangedInPropertyPanel() restoreSelection(); myCurrentSelection.clear(); - // 3. the flag to disable the update viewer should be set in order to avoid blinking in the + // 3. the flag to disable the update viewer should be set in order to avoid blinking in the // viewer happens by deselect/select the modified objects. The flag should be restored after // the selection processing. The update viewer should be also called. ModuleBase_IWorkshop* aWorkshop = myModule->workshop(); @@ -380,14 +380,14 @@ void PartSet_SketcherMgr::onMousePressed(ModuleBase_IViewWindow* theWnd, QMouseE restoreSelection(); launchEditing(); if (aFeature.get() != NULL) { - std::shared_ptr aSPFeature = + std::shared_ptr aSPFeature = std::dynamic_pointer_cast(aFeature); - if (aSPFeature.get() && + if (aSPFeature.get() && (aSPFeature->getKind() == SketchPlugin_ConstraintRadius::ID() || aSPFeature->getKind() == SketchPlugin_ConstraintAngle::ID())) { DataPtr aData = aSPFeature->data(); AttributePtr aAttr = aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()); - std::shared_ptr aFPAttr = + std::shared_ptr aFPAttr = std::dynamic_pointer_cast(aAttr); aFPAttr->setValue(myCurrentPoint.myCurX, myCurrentPoint.myCurY); } @@ -405,14 +405,14 @@ void PartSet_SketcherMgr::onMousePressed(ModuleBase_IViewWindow* theWnd, QMouseE restoreSelection(); launchEditing(); if (aFeature.get() != NULL) { - std::shared_ptr aSPFeature = + std::shared_ptr aSPFeature = std::dynamic_pointer_cast(aFeature); - if (aSPFeature.get() && + if (aSPFeature.get() && (aSPFeature->getKind() == SketchPlugin_ConstraintRadius::ID() || aSPFeature->getKind() == SketchPlugin_ConstraintAngle::ID())) { DataPtr aData = aSPFeature->data(); AttributePtr aAttr = aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()); - std::shared_ptr aFPAttr = + std::shared_ptr aFPAttr = std::dynamic_pointer_cast(aAttr); aFPAttr->setValue(myCurrentPoint.myCurX, myCurrentPoint.myCurY); } @@ -517,7 +517,7 @@ void PartSet_SketcherMgr::onMouseMoved(ModuleBase_IViewWindow* theWnd, QMouseEve ModuleBase_IWorkshop* aWorkshop = myModule->workshop(); XGUI_ModuleConnector* aConnector = dynamic_cast(aWorkshop); XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer(); - // 3. the flag to disable the update viewer should be set in order to avoid blinking in the + // 3. the flag to disable the update viewer should be set in order to avoid blinking in the // viewer happens by deselect/select the modified objects. The flag should be restored after // the selection processing. The update viewer should be also called. bool isEnableUpdateViewer = aDisplayer->enableUpdateViewer(false); @@ -543,7 +543,7 @@ void PartSet_SketcherMgr::onMouseMoved(ModuleBase_IViewWindow* theWnd, QMouseEve std::string aAttrId = anAttr->id(); DataPtr aData = aFeature->data(); if (aData->isValid()) { - std::shared_ptr aPoint = + std::shared_ptr aPoint = std::dynamic_pointer_cast(aData->attribute(aAttrId)); if (aPoint.get() != NULL) { bool isImmutable = aPoint->setImmutable(true); @@ -664,7 +664,7 @@ void PartSet_SketcherMgr::onAfterContextMenu() myIsPopupMenuActive = false; } -void PartSet_SketcherMgr::get2dPoint(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent, +void PartSet_SketcherMgr::get2dPoint(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent, Point& thePoint) { Handle(V3d_View) aView = theWnd->v3dView(); @@ -678,7 +678,7 @@ void PartSet_SketcherMgr::launchEditing() { if (!myCurrentSelection.empty()) { FeaturePtr aFeature = myCurrentSelection.begin().key(); - std::shared_ptr aSPFeature = + std::shared_ptr aSPFeature = std::dynamic_pointer_cast(aFeature); if (aSPFeature && (!aSPFeature->isExternal())) { myModule->editFeature(aSPFeature); @@ -926,7 +926,7 @@ void PartSet_SketcherMgr::startSketch(ModuleBase_Operation* theOperation) myModule->workshop()->viewer()->addSelectionFilter(myCirclePointFilter); - if (myPlaneFilter.IsNull()) + if (myPlaneFilter.IsNull()) myPlaneFilter = new ModuleBase_ShapeInPlaneFilter(); myModule->workshop()->viewer()->addSelectionFilter(myPlaneFilter); @@ -997,7 +997,7 @@ void PartSet_SketcherMgr::stopSketch(ModuleBase_Operation* theOperation) } if (!aFOperation->isDisplayedOnStart(myCurrentSketch)) myCurrentSketch->setDisplayed(true); - + myCurrentSketch = CompositeFeaturePtr(); myModule->workshop()->viewer()->removeSelectionFilter(myCirclePointFilter); @@ -1119,7 +1119,7 @@ bool PartSet_SketcherMgr::canDisplayObject(const ObjectPtr& theObject) const bool aHasActiveSketch = activeSketch().get() != NULL; if (aHasActiveSketch) { // 1. the sketch feature should not be displayed during the sketch active operation - // it is hidden by a sketch operation start and shown by a sketch stop, just the sketch + // it is hidden by a sketch operation start and shown by a sketch stop, just the sketch // nested features can be visualized FeaturePtr aFeature = ModelAPI_Feature::feature(theObject); if (aFeature.get() != NULL && aFeature == activeSketch()) { @@ -1173,12 +1173,12 @@ bool PartSet_SketcherMgr::canDisplayObject(const ObjectPtr& theObject) const #ifndef DEBUG_DO_NOT_BY_ENTER if (isNestedCreateOperation(getCurrentOperation(), activeSketch())) { ModuleBase_ModelWidget* anActiveWidget = getActiveWidget(); - ModuleBase_WidgetEditor* anEditorWdg = + ModuleBase_WidgetEditor* anEditorWdg = anActiveWidget ? dynamic_cast(anActiveWidget) : 0; // the active widget editor should not influence here. The presentation should be visible // always when this widget is active. if (!anEditorWdg && !myIsPopupMenuActive) { - // during a nested create operation, the feature is redisplayed only + // during a nested create operation, the feature is redisplayed only // if the mouse over view // of there was a value modified in the property panel after the mouse left the view aCanDisplay = canDisplayCurrentCreatedFeature(); @@ -1364,7 +1364,7 @@ bool PartSet_SketcherMgr::isObjectOfSketch(const ObjectPtr& theObject) const void PartSet_SketcherMgr::onPlaneSelected(const std::shared_ptr& thePln) { - if (myPlaneFilter.IsNull()) + if (myPlaneFilter.IsNull()) myPlaneFilter = new ModuleBase_ShapeInPlaneFilter(); myPlaneFilter->setPlane(thePln); @@ -1486,20 +1486,20 @@ void PartSet_SketcherMgr::getSelectionOwners(const FeaturePtr& theFeature, ResultPtr aResult = *aIt; AISObjectPtr aAISObj = aDisplayer->getAISObject(aResult); if (aAISObj.get() == NULL) - continue; + continue; Handle(AIS_InteractiveObject) anAISIO = aAISObj->impl(); - SelectMgr_IndexedMapOfOwner aSelectedOwners; + SelectMgr_IndexedMapOfOwner aSelectedOwners; aConnector->workshop()->selector()->selection()->entityOwners(anAISIO, aSelectedOwners); for ( Standard_Integer i = 1, n = aSelectedOwners.Extent(); i <= n; i++ ) { - Handle(StdSelect_BRepOwner) anOwner = + Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast(aSelectedOwners(i)); if ( anOwner.IsNull() || !anOwner->HasShape() ) continue; const TopoDS_Shape& aShape = anOwner->Shape(); TopAbs_ShapeEnum aShapeType = aShape.ShapeType(); if (aShapeType == TopAbs_VERTEX) { - AttributePtr aPntAttr = + AttributePtr aPntAttr = PartSet_Tools::findAttributeBy2dPoint(theFeature, aShape, theSketch); if (aPntAttr.get() != NULL && aSelectedAttributes.find(aPntAttr) != aSelectedAttributes.end()) { @@ -1516,7 +1516,7 @@ void PartSet_SketcherMgr::getSelectionOwners(const FeaturePtr& theFeature, } } -void PartSet_SketcherMgr::connectToPropertyPanel(ModuleBase_ModelWidget* theWidget, +void PartSet_SketcherMgr::connectToPropertyPanel(ModuleBase_ModelWidget* theWidget, const bool isToConnect) { if (isToConnect) { @@ -1643,7 +1643,7 @@ void PartSet_SketcherMgr::storeSelection(const bool theHighlightedOnly) // 1. it is necessary to save current selection in order to restore it after the features moving myCurrentSelection.clear(); - QList::const_iterator anIt = aStoredPrs.begin(), + QList::const_iterator anIt = aStoredPrs.begin(), aLast = aStoredPrs.end(); CompositeFeaturePtr aSketch = activeSketch(); @@ -1664,7 +1664,7 @@ void PartSet_SketcherMgr::storeSelection(const bool theHighlightedOnly) std::set aSelectedAttributes; std::set aSelectedResults; if (myCurrentSelection.find(aFeature) != myCurrentSelection.end()) { - std::pair, std::set > aPair = + std::pair, std::set > aPair = myCurrentSelection.find(aFeature).value(); aSelectedAttributes = aPair.first; aSelectedResults = aPair.second; @@ -1777,7 +1777,7 @@ void PartSet_SketcherMgr::updateSelectionPriority(ObjectPtr theObject, // 3. External objects (violet color) // 4. Auxiliary segments (dotted) // StdSelect_BRepSelectionTool::Load uses priority calculating: - // Standard_Integer aPriority = + // Standard_Integer aPriority = // (thePriority == -1) ? GetStandardPriority (theShape, theType) : thePriority; // Priority of Vertex is 8, edge(segment) is 7. // It might be not corrected as provides the condition above. diff --git a/src/PartSet/PartSet_SketcherMgr.h b/src/PartSet/PartSet_SketcherMgr.h index 06b553b57..b6cf959d3 100644 --- a/src/PartSet/PartSet_SketcherMgr.h +++ b/src/PartSet/PartSet_SketcherMgr.h @@ -204,7 +204,7 @@ public: /// \param theOperation an operation bool canChangeCursor(ModuleBase_Operation* theOperation) const; - /// Returns state of constraints showing flag + /// Returns state of constraints showing flag const QMap& showConstraintStates(); /// Returns true if the object is a current sketch sub feature of a result of the feature @@ -213,7 +213,7 @@ public: bool isObjectOfSketch(const ObjectPtr& theObject) const; /// Saves the current selection in the viewer into an internal container - /// It obtains the selected attributes. + /// It obtains the selected attributes. /// The highlighted objects can be processes as the selected ones /// \param theHighlightedOnly a boolean flag void storeSelection(const bool theHighlightedOnly = false); @@ -285,7 +285,7 @@ private slots: void onLeaveViewPort(); /// Listens to the value changed signal and display the current operation feature void onBeforeValuesChangedInPropertyPanel(); - /// Listens to the signal about the modification of the values + /// Listens to the signal about the modification of the values /// have been done in the property panel void onAfterValuesChangedInPropertyPanel(); @@ -303,9 +303,9 @@ private: /// Launches the operation from current highlighting void launchEditing(); - /// Converts mouse position to 2d coordinates. + /// Converts mouse position to 2d coordinates. /// Member myCurrentSketch has to be correctly defined - void get2dPoint(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent, + void get2dPoint(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent, Point& thePoint); /// Show distance value editor if it is a distance operation and all attribute references @@ -318,7 +318,7 @@ private: typedef QMap, std::set > > FeatureToSelectionMap; - /// Applyes the current selection to the object in the workshop viewer + /// Applyes the current selection to the object in the workshop viewer /// It includes the selection in all modes of activation, even local context - vertexes, edges /// It gets all results of the feature, find an AIS object in the viewer and takes all BRep /// selection owners. If the owner is vertex, the corresponded attribute is seached in @@ -337,7 +337,7 @@ private: SelectMgr_IndexedMapOfOwner& anOwnersToSelect); /// Returns true if the created feature is visible - /// \param + /// \param bool isVisibleCreatedFeature() const; /// Returns a current operation @@ -349,7 +349,7 @@ private: /// Erase or display the feature of the current operation. If the mouse over the active view or /// a current value is changed by property panel, the feature is displayed otherwise it is hidden - /// \param theOperation an operation which feature is to be displayed, + /// \param theOperation an operation which feature is to be displayed, /// it is nested create operation /// \param isToDisplay a flag about the display or erase the feature void visualizeFeature(const FeaturePtr& theFeature, const bool isEditOperation, @@ -373,7 +373,7 @@ private: bool myDragDone; bool myIsMouseOverWindow; /// the state that the mouse over the view /// the state whether the over view state is processed by mouseMove method - bool myIsMouseOverViewProcessed; + bool myIsMouseOverViewProcessed; bool myIsPopupMenuActive; /// the state of the popup menu is shown Point myCurrentPoint; //Point myClickedPoint; diff --git a/src/PartSet/PartSet_SketcherReetntrantMgr.cpp b/src/PartSet/PartSet_SketcherReetntrantMgr.cpp index cb2bc68cc..6f8ba11fd 100755 --- a/src/PartSet/PartSet_SketcherReetntrantMgr.cpp +++ b/src/PartSet/PartSet_SketcherReetntrantMgr.cpp @@ -220,10 +220,10 @@ bool PartSet_SketcherReetntrantMgr::processMouseReleased(ModuleBase_IViewWindow* /// selection should be obtained from workshop before ask if the operation can be started as /// the canStartOperation method performs commit/abort of previous operation. /// Sometimes commit/abort - /// may cause selection clear(Sketch operation) as a result + /// may cause selection clear(Sketch operation) as a result /// it will be lost and is not used for preselection. ModuleBase_ISelection* aSelection = myWorkshop->selection(); - QList aPreSelected = + QList aPreSelected = aSelection->getSelected(ModuleBase_ISelection::AllControls); restartOperation(); @@ -233,7 +233,7 @@ bool PartSet_SketcherReetntrantMgr::processMouseReleased(ModuleBase_IViewWindow* // fill the first widget by the mouse event point // if the active widget is not the first, it means that the restarted operation is filled by // the current preselection. - PartSet_WidgetPoint2D* aPoint2DWdg = + PartSet_WidgetPoint2D* aPoint2DWdg = dynamic_cast(module()->activeWidget()); ModuleBase_ModelWidget* aFirstWidget = aPanel->findFirstAcceptingValueWidget(); if (aPoint2DWdg && aPoint2DWdg == aFirstWidget) { @@ -273,7 +273,7 @@ void PartSet_SketcherReetntrantMgr::onNoMoreWidgets(const std::string& thePrevio if (!isActiveMgr()) return; - // we should avoid processing of the signal about no more widgets attributes and + // we should avoid processing of the signal about no more widgets attributes and // do this after the restart operaion is finished if it was called // onNoMoreWidgets depends on myIsFlagsBlocked and fill myNoMoreWidgetsAttribute // if it should be called after restart @@ -447,7 +447,7 @@ bool PartSet_SketcherReetntrantMgr::startInternalEdit(const std::string& thePrev // if there is no the next widget to be automatically activated, // the Ok button in property // panel should accept the focus(example is parallel constraint on sketch lines) - QToolButton* anOkBtn = + QToolButton* anOkBtn = dynamic_cast(aPanel)->findButton(PROP_PANEL_OK); if (anOkBtn) anOkBtn->setFocus(Qt::TabFocusReason); @@ -485,7 +485,7 @@ void PartSet_SketcherReetntrantMgr::restartOperation() module()->launchOperation(aFOperation->id()); myIsFlagsBlocked = false; resetFlags(); - // we should avoid processing of the signal about no more widgets attributes and + // we should avoid processing of the signal about no more widgets attributes and // do this after the restart operaion is finished if it was called // onNoMoreWidgets depends on myIsFlagsBlocked and fill myNoMoreWidgetsAttribute // if it should be called after restart @@ -543,7 +543,7 @@ void PartSet_SketcherReetntrantMgr::createInternalFeature() void PartSet_SketcherReetntrantMgr::deleteInternalFeature() { if (myInternalActiveWidget) { - ModuleBase_WidgetSelector* aWSelector = + ModuleBase_WidgetSelector* aWSelector = dynamic_cast(myInternalActiveWidget); if (aWSelector) aWSelector->activateSelectionAndFilters(false); @@ -614,7 +614,7 @@ bool PartSet_SketcherReetntrantMgr::copyReetntrantAttributes(const FeaturePtr& t if (anArcType == SketchPlugin_Arc::ARC_TYPE_TANGENT()) { // get the last point of the previuos arc feature(geom point 2d) std::shared_ptr aSData = theSourceFeature->data(); - std::shared_ptr aSPointAttr = + std::shared_ptr aSPointAttr = std::dynamic_pointer_cast( aSData->attribute(SketchPlugin_Arc::END_ID())); // get point attribute on the current feature @@ -622,7 +622,7 @@ bool PartSet_SketcherReetntrantMgr::copyReetntrantAttributes(const FeaturePtr& t SketchPlugin_Arc::TANGENT_POINT_ID()); aTangentPointAttr->setAttr(aSPointAttr); - std::shared_ptr aNPointAttr = + std::shared_ptr aNPointAttr = std::dynamic_pointer_cast( theNewFeature->data()->attribute(SketchPlugin_Arc::END_ID())); aNPointAttr->setValue(aSPointAttr->x(), aSPointAttr->y()); diff --git a/src/PartSet/PartSet_SketcherReetntrantMgr.h b/src/PartSet/PartSet_SketcherReetntrantMgr.h index 647d214ee..5ae8a76b7 100755 --- a/src/PartSet/PartSet_SketcherReetntrantMgr.h +++ b/src/PartSet/PartSet_SketcherReetntrantMgr.h @@ -29,7 +29,7 @@ class PartSet_Module; /// ('internal' edit operation), with the ability to simultaneously create the next entity /// of same type (re-entrance of the operation). /// OK valids the current edition and exits from the operation (no re-entrance). -/// Cancel removes (undo) the entity currently edited and +/// Cancel removes (undo) the entity currently edited and /// exits from the operation (no re-entrance). class PARTSET_EXPORT PartSet_SketcherReetntrantMgr : public QObject { @@ -39,7 +39,7 @@ Q_OBJECT enum RestartingMode { RM_None, /// the operation should not be restarted RM_Forbided, /// the operation should not be restarted after there is no active widget - RM_LastFeatureUsed, /// the operation is restarted and use + RM_LastFeatureUsed, /// the operation is restarted and use /// the previous feature for own initialization RM_EmptyFeatureUsed /// the operation is restarted and does not use the previous feature }; @@ -166,7 +166,7 @@ private: bool isTangentArc(ModuleBase_Operation* theOperation, const std::shared_ptr& /*theSketch*/) const; - /// Accept All action is enabled if an internal edit is started. + /// Accept All action is enabled if an internal edit is started. /// It updates the state of the button void updateAcceptAllAction(); diff --git a/src/PartSet/PartSet_Tools.cpp b/src/PartSet/PartSet_Tools.cpp index 425e1b5b5..ba73f12ae 100755 --- a/src/PartSet/PartSet_Tools.cpp +++ b/src/PartSet/PartSet_Tools.cpp @@ -158,7 +158,7 @@ Handle(V3d_View) theView, theY = aVec.X() * anY->x() + aVec.Y() * anY->y() + aVec.Z() * anY->z(); } -std::shared_ptr PartSet_Tools::convertTo2D(FeaturePtr theSketch, +std::shared_ptr PartSet_Tools::convertTo2D(FeaturePtr theSketch, const std::shared_ptr& thePnt) { std::shared_ptr aRes; @@ -188,7 +188,7 @@ std::shared_ptr PartSet_Tools::convertTo3D(const double theX, const aData->attribute(SketchPlugin_Sketch::NORM_ID())); std::shared_ptr aY(new GeomAPI_Dir(aNorm->dir()->cross(aX->dir()))); - std::shared_ptr aPnt2d = + std::shared_ptr aPnt2d = std::shared_ptr(new GeomAPI_Pnt2d(theX, theY)); return aPnt2d->to3D(aC->pnt(), aX->dir(), aY); @@ -341,7 +341,7 @@ std::shared_ptr PartSet_Tools::findFirstEqualPoint( ModelAPI_ValidatorsFactory* aValidators = ModelAPI_Session::get()->validators(); for (; anIt != aLast && !aFPoint; anIt++) { - std::shared_ptr aCurPoint = + std::shared_ptr aCurPoint = std::dynamic_pointer_cast(*anIt); if (aCurPoint && aCurPoint->isInitialized() && aValidators->isCase(theFeature, aCurPoint->id()) && @@ -451,8 +451,8 @@ ResultPtr PartSet_Tools::findFixedObjectByExternal(const TopoDS_Shape& theShape, return aResult; } -ResultPtr PartSet_Tools::createFixedObjectByExternal(const TopoDS_Shape& theShape, - const ObjectPtr& theObject, +ResultPtr PartSet_Tools::createFixedObjectByExternal(const TopoDS_Shape& theShape, + const ObjectPtr& theObject, CompositeFeaturePtr theSketch, const bool theTemporary) { @@ -476,10 +476,10 @@ ResultPtr PartSet_Tools::createFixedObjectByExternal(const TopoDS_Shape& theShap std::shared_ptr aPnt2d2 = convertTo2D(theSketch, aPnt2); std::shared_ptr aData = aMyFeature->data(); - std::shared_ptr aPoint1 = + std::shared_ptr aPoint1 = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Line::START_ID())); - std::shared_ptr aPoint2 = + std::shared_ptr aPoint2 = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Line::END_ID())); @@ -516,20 +516,20 @@ ResultPtr PartSet_Tools::createFixedObjectByExternal(const TopoDS_Shape& theShap } if (aMyFeature) { DataPtr aData = aMyFeature->data(); - AttributeSelectionPtr anAttr = + AttributeSelectionPtr anAttr = std::dynamic_pointer_cast (aData->attribute(SketchPlugin_SketchEntity::EXTERNAL_ID())); ResultPtr aRes = std::dynamic_pointer_cast(theObject); // selection shape has no result owner => the trihedron axis - // TODO: make reference to the real axes when + // TODO: make reference to the real axes when // they are implemented in the initialization plugin if (!aRes.get()) { ObjectPtr aPointObj = ModelAPI_Session::get()->moduleDocument()->objectByName( ModelAPI_ResultConstruction::group(), "Origin"); if (aPointObj.get()) { // if initialization plugin performed well aRes = std::dynamic_pointer_cast(aPointObj); - } + } } if (!aRes.get()) { aRes = aMyFeature->firstResult(); @@ -558,37 +558,37 @@ ResultPtr PartSet_Tools::createFixedObjectByExternal(const TopoDS_Shape& theShap if (aMyFeature) { DataPtr aData = aMyFeature->data(); - AttributeSelectionPtr anAttr = + AttributeSelectionPtr anAttr = std::dynamic_pointer_cast (aData->attribute(SketchPlugin_SketchEntity::EXTERNAL_ID())); ResultPtr aRes = std::dynamic_pointer_cast(theObject); - // if there is no object, + // if there is no object, // it means that this is the origin point: search it in the module document if (!aRes.get()) { ObjectPtr aPointObj = ModelAPI_Session::get()->moduleDocument()->objectByName( ModelAPI_ResultConstruction::group(), "Origin"); if (aPointObj.get()) { // if initialization plugin performed well aRes = std::dynamic_pointer_cast(aPointObj); - } + } } // reference to itself with name "Origin" (but this may cause the infinitive cycling) if (!aRes.get()) { // If the point is selected not from Result object - std::shared_ptr aShape = + std::shared_ptr aShape = std::shared_ptr(new GeomAPI_Shape()); aShape->setImpl(new TopoDS_Shape(theShape)); - std::shared_ptr aVertex = + std::shared_ptr aVertex = std::shared_ptr(new GeomAPI_Vertex(aShape)); std::shared_ptr aPnt = aVertex->point(); std::shared_ptr aPnt2d = convertTo2D(theSketch, aPnt); - std::shared_ptr aPoint = + std::shared_ptr aPoint = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Point::COORD_ID())); aPoint->setValue(aPnt2d); - if ((aPnt->x() < Precision::Confusion()) && + if ((aPnt->x() < Precision::Confusion()) && (aPnt->y() < Precision::Confusion()) && (aPnt->z() < Precision::Confusion())) aData->setName("Origin"); @@ -628,12 +628,12 @@ bool PartSet_Tools::isContainPresentation(const QList& return false; } -ResultPtr PartSet_Tools::findExternalEdge(CompositeFeaturePtr theSketch, +ResultPtr PartSet_Tools::findExternalEdge(CompositeFeaturePtr theSketch, std::shared_ptr theEdge) { for (int i = 0; i < theSketch->numberOfSubs(); i++) { FeaturePtr aFeature = theSketch->subFeature(i); - std::shared_ptr aSketchFea = + std::shared_ptr aSketchFea = std::dynamic_pointer_cast(aFeature); // not displayed result of feature projection should not be returned as external edge if (aSketchFea && aSketchFea->canBeDisplayed()) { @@ -641,7 +641,7 @@ ResultPtr PartSet_Tools::findExternalEdge(CompositeFeaturePtr theSketch, std::list aResults = aSketchFea->results(); std::list::const_iterator aIt; for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) { - ResultConstructionPtr aRes = + ResultConstructionPtr aRes = std::dynamic_pointer_cast(*aIt); if (aRes) { std::shared_ptr aShape = aRes->shape(); @@ -658,19 +658,19 @@ ResultPtr PartSet_Tools::findExternalEdge(CompositeFeaturePtr theSketch, } -ResultPtr PartSet_Tools::findExternalVertex(CompositeFeaturePtr theSketch, +ResultPtr PartSet_Tools::findExternalVertex(CompositeFeaturePtr theSketch, std::shared_ptr theVert) { for (int i = 0; i < theSketch->numberOfSubs(); i++) { FeaturePtr aFeature = theSketch->subFeature(i); - std::shared_ptr aSketchFea = + std::shared_ptr aSketchFea = std::dynamic_pointer_cast(aFeature); if (aSketchFea) { if (aSketchFea->isExternal()) { std::list aResults = aSketchFea->results(); std::list::const_iterator aIt; for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) { - ResultConstructionPtr aRes = + ResultConstructionPtr aRes = std::dynamic_pointer_cast(*aIt); if (aRes) { std::shared_ptr aShape = aRes->shape(); @@ -767,7 +767,7 @@ std::shared_ptr PartSet_Tools::getPoint( return std::shared_ptr(); } -FeaturePtr findFirstCoincidenceByData(const DataPtr& theData, +FeaturePtr findFirstCoincidenceByData(const DataPtr& theData, std::shared_ptr thePoint) { FeaturePtr aCoincident; @@ -777,16 +777,16 @@ FeaturePtr findFirstCoincidenceByData(const DataPtr& theData, for (aIt = aRefsList.cbegin(); aIt != aRefsList.cend(); ++aIt) { std::shared_ptr aAttr = (*aIt); FeaturePtr aConstrFeature = std::dynamic_pointer_cast(aAttr->owner()); - if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) { - std::shared_ptr a2dPnt = + if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) { + std::shared_ptr a2dPnt = PartSet_Tools::getPoint(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_A()); - if (a2dPnt.get() && thePoint->isEqual(a2dPnt)) { + if (a2dPnt.get() && thePoint->isEqual(a2dPnt)) { aCoincident = aConstrFeature; break; } else { a2dPnt = PartSet_Tools::getPoint(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_B()); - if (a2dPnt.get() && thePoint->isEqual(a2dPnt)) { + if (a2dPnt.get() && thePoint->isEqual(a2dPnt)) { aCoincident = aConstrFeature; break; } @@ -808,16 +808,16 @@ FeaturePtr PartSet_Tools::findFirstCoincidence(const FeaturePtr& theFeature, for (aIt = aRefsList.cbegin(); aIt != aRefsList.cend(); ++aIt) { std::shared_ptr aAttr = (*aIt); FeaturePtr aConstrFeature = std::dynamic_pointer_cast(aAttr->owner()); - if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) { - std::shared_ptr a2dPnt = + if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) { + std::shared_ptr a2dPnt = PartSet_Tools::getPoint(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_A()); - if (a2dPnt.get() && thePoint->isEqual(a2dPnt)) { + if (a2dPnt.get() && thePoint->isEqual(a2dPnt)) { aCoincident = aConstrFeature; break; } else { a2dPnt = PartSet_Tools::getPoint(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_B()); - if (a2dPnt.get() && thePoint->isEqual(a2dPnt)) { + if (a2dPnt.get() && thePoint->isEqual(a2dPnt)) { aCoincident = aConstrFeature; break; } @@ -847,7 +847,7 @@ void PartSet_Tools::findCoincidences(FeaturePtr theStartCoin, QList& return; AttributeRefAttrPtr aPnt = theStartCoin->refattr(theAttr); - if (!aPnt) + if (!aPnt) return; ObjectPtr aObj = aPnt->object(); FeaturePtr aFeature = std::dynamic_pointer_cast(aObj); @@ -860,13 +860,13 @@ void PartSet_Tools::findCoincidences(FeaturePtr theStartCoin, QList& for (aIt = aRefsList.cbegin(); aIt != aRefsList.cend(); ++aIt) { std::shared_ptr aAttr = (*aIt); FeaturePtr aConstrFeature = std::dynamic_pointer_cast(aAttr->owner()); - if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) { + if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) { if (!theCoincidencies.contains(aConstrFeature)) { std::shared_ptr aPnt = getCoincedencePoint(aConstrFeature); if (aPnt.get() && aOrig->isEqual(aPnt)) { - findCoincidences(aConstrFeature, theList, theCoincidencies, + findCoincidences(aConstrFeature, theList, theCoincidencies, SketchPlugin_ConstraintCoincidence::ENTITY_A()); - findCoincidences(aConstrFeature, theList, theCoincidencies, + findCoincidences(aConstrFeature, theList, theCoincidencies, SketchPlugin_ConstraintCoincidence::ENTITY_B()); } } @@ -878,7 +878,7 @@ void PartSet_Tools::findCoincidences(FeaturePtr theStartCoin, QList& ResultConstructionPtr aResult = std::dynamic_pointer_cast(aObj); if (aResult.get()) { FeaturePtr aFeature = ModelAPI_Feature::feature(aPnt->object()); - if (!theList.contains(aFeature)) + if (!theList.contains(aFeature)) theList.append(aFeature); theCoincidencies.append(theStartCoin); @@ -887,13 +887,13 @@ void PartSet_Tools::findCoincidences(FeaturePtr theStartCoin, QList& for (aIt = aRefsList.cbegin(); aIt != aRefsList.cend(); ++aIt) { std::shared_ptr aAttr = (*aIt); FeaturePtr aConstrFeature = std::dynamic_pointer_cast(aAttr->owner()); - if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) { + if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) { if (!theCoincidencies.contains(aConstrFeature)) { std::shared_ptr aPnt = getCoincedencePoint(aConstrFeature); if (aPnt.get() && aOrig->isEqual(aPnt)) { - findCoincidences(aConstrFeature, theList, theCoincidencies, + findCoincidences(aConstrFeature, theList, theCoincidencies, SketchPlugin_ConstraintCoincidence::ENTITY_A()); - findCoincidences(aConstrFeature, theList, theCoincidencies, + findCoincidences(aConstrFeature, theList, theCoincidencies, SketchPlugin_ConstraintCoincidence::ENTITY_B()); } } @@ -905,15 +905,15 @@ void PartSet_Tools::findCoincidences(FeaturePtr theStartCoin, QList& std::shared_ptr PartSet_Tools::getCoincedencePoint(FeaturePtr theStartCoin) { - std::shared_ptr aPnt = SketcherPrs_Tools::getPoint(theStartCoin.get(), + std::shared_ptr aPnt = SketcherPrs_Tools::getPoint(theStartCoin.get(), SketchPlugin_Constraint::ENTITY_A()); if (aPnt.get() == NULL) aPnt = SketcherPrs_Tools::getPoint(theStartCoin.get(), SketchPlugin_Constraint::ENTITY_B()); return aPnt; } -AttributePtr PartSet_Tools::findAttributeBy2dPoint(ObjectPtr theObj, - const TopoDS_Shape theShape, +AttributePtr PartSet_Tools::findAttributeBy2dPoint(ObjectPtr theObj, + const TopoDS_Shape theShape, FeaturePtr theSketch) { @@ -928,17 +928,17 @@ AttributePtr PartSet_Tools::findAttributeBy2dPoint(ObjectPtr theObj, new GeomAPI_Pnt(aPoint.X(), aPoint.Y(), aPoint.Z())); // find the given point in the feature attributes - std::list anAttiributes = + std::list anAttiributes = aFeature->data()->attributes(GeomDataAPI_Point2D::typeId()); - std::list::const_iterator anIt = anAttiributes.begin(), + std::list::const_iterator anIt = anAttiributes.begin(), aLast = anAttiributes.end(); for (; anIt != aLast && !anAttribute; anIt++) { - std::shared_ptr aCurPoint = + std::shared_ptr aCurPoint = std::dynamic_pointer_cast(*anIt); if (!aCurPoint->isInitialized()) continue; - std::shared_ptr aPnt = + std::shared_ptr aPnt = convertTo3D(aCurPoint->x(), aCurPoint->y(), theSketch); if (aPnt && (aPnt->distance(aValue) < Precision::Confusion())) { anAttribute = aCurPoint; diff --git a/src/PartSet/PartSet_Tools.h b/src/PartSet/PartSet_Tools.h index 7e92c4d24..7826014e1 100755 --- a/src/PartSet/PartSet_Tools.h +++ b/src/PartSet/PartSet_Tools.h @@ -78,14 +78,14 @@ public: /// \param theSketch the sketch feature /// \param thePnt the 3D point in the viewer /// \returns the converted point object - static std::shared_ptr convertTo2D(FeaturePtr theSketch, + static std::shared_ptr convertTo2D(FeaturePtr theSketch, const std::shared_ptr& thePnt); /// \brief Converts the 2D projected coodinates on the sketch plane to the 3D point. /// \param theX the X coordinate /// \param theY the Y coordinate /// \param theSketch the sketch feature - static std::shared_ptr convertTo3D(const double theX, const double theY, + static std::shared_ptr convertTo3D(const double theX, const double theY, FeaturePtr theSketch); /// Returns pointer to the root document. @@ -135,7 +135,7 @@ public: static std::shared_ptr findFirstEqualPoint(const FeaturePtr& theFeature, const std::shared_ptr& thePoint); - /// Creates constrains of the current + /// Creates constrains of the current /// \param theSketch a sketch feature /// \param theFeature a source feature /// \param theAttribute a name of the requried attribute attribute @@ -164,7 +164,7 @@ public: /// \return result of found feature or NULL static std::shared_ptr findFixedObjectByExternal( const TopoDS_Shape& theShape, - const ObjectPtr& theObject, + const ObjectPtr& theObject, CompositeFeaturePtr theSketch); /// Creates a line (arc or circle) by given edge @@ -175,8 +175,8 @@ public: /// \param theTemporary the created external object is temporary, execute is not performed for it /// \return result of created feature static std::shared_ptr createFixedObjectByExternal( - const TopoDS_Shape& theShape, - const ObjectPtr& theObject, + const TopoDS_Shape& theShape, + const ObjectPtr& theObject, CompositeFeaturePtr theSketch, const bool theTemporary = false); @@ -207,7 +207,7 @@ public: /// \param theView a 3D view /// \param theX the output horizontal coordinate of the point /// \param theY the output vertical coordinate of the point - static bool hasVertexShape(const std::shared_ptr& thePrs, + static bool hasVertexShape(const std::shared_ptr& thePrs, FeaturePtr theSketch, Handle_V3d_View theView, double& theX, double& theY); diff --git a/src/PartSet/PartSet_Validators.cpp b/src/PartSet/PartSet_Validators.cpp index 6cd04eb54..b31ef035a 100755 --- a/src/PartSet/PartSet_Validators.cpp +++ b/src/PartSet/PartSet_Validators.cpp @@ -85,19 +85,19 @@ std::shared_ptr sketcherPlane(ModuleBase_Operation* theOperation) ModuleBase_OperationFeature* aFeatureOp = dynamic_cast(theOperation); if (aFeatureOp) { - CompositeFeaturePtr aFeature = + CompositeFeaturePtr aFeature = std::dynamic_pointer_cast(aFeatureOp->feature()); if (aFeature && (aFeature->getKind() == SketchPlugin_Sketch::ID())) return PartSet_Tools::sketchPlane(aFeature); } } - return aEmptyPln; + return aEmptyPln; } bool isEmptySelectionValid(ModuleBase_Operation* theOperation) { - ModuleBase_OperationFeature* aFeatureOp = + ModuleBase_OperationFeature* aFeatureOp = dynamic_cast(theOperation); // during the create operation empty selection is always valid if (!aFeatureOp->isEditOperation()) { @@ -108,7 +108,7 @@ bool isEmptySelectionValid(ModuleBase_Operation* theOperation) std::shared_ptr aPlane = sketcherPlane(theOperation); if (aPlane.get()) return true; - else + else return false; } else @@ -167,7 +167,7 @@ bool PartSet_RadiusSelection::isValid(const ModuleBase_ISelection* theSelection, if (theSelection->getSelected(ModuleBase_ISelection::Viewer).size() == 0) { return isEmptySelectionValid(theOperation); } else { - QList aList = + QList aList = theSelection->getSelected(ModuleBase_ISelection::Viewer); int aCount = 0; foreach (ModuleBase_ViewerPrsPtr aPrs, aList) { @@ -194,7 +194,7 @@ bool PartSet_RigidSelection::isValid(const ModuleBase_ISelection* theSelection, if (theSelection->getSelected(ModuleBase_ISelection::Viewer).size() == 0) { return isEmptySelectionValid(theOperation); } else { - QList aList = + QList aList = theSelection->getSelected(ModuleBase_ISelection::Viewer); return (aList.count() == 1); } @@ -285,7 +285,7 @@ bool PartSet_AngleSelection::isValid(const ModuleBase_ISelection* theSelection, } } -bool PartSet_EqualSelection::isValid(const ModuleBase_ISelection* theSelection, +bool PartSet_EqualSelection::isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const { if (theSelection->getSelected(ModuleBase_ISelection::Viewer).size() == 0) { @@ -374,20 +374,20 @@ std::string PartSet_DifferentObjectsValidator::errorMessage( return anError; } -bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute, +bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute, const std::list& theArguments, Events_InfoMessage& theError) const { FeaturePtr aFeature = std::dynamic_pointer_cast(theAttribute->owner()); - // the type of validated attributes should be equal, attributes with + // the type of validated attributes should be equal, attributes with // different types are not validated // Check RefAttr attributes std::string anAttrType = theAttribute->attributeType(); std::list > anAttrs; if (anAttrType == ModelAPI_AttributeRefAttr::typeId()) { - AttributeRefAttrPtr anAttr = + AttributeRefAttrPtr anAttr = std::dynamic_pointer_cast(theAttribute); bool isObject = anAttr->isObject(); ObjectPtr anObject = anAttr->object(); @@ -422,7 +422,7 @@ bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute } } else if (anAttrType == ModelAPI_AttributeSelection::typeId()) { - AttributeSelectionPtr anAttr = + AttributeSelectionPtr anAttr = std::dynamic_pointer_cast(theAttribute); ResultPtr aContext = anAttr->context(); GeomShapePtr aShape = anAttr->value(); @@ -448,7 +448,7 @@ bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute } } else if (anAttrType == ModelAPI_AttributeReference::typeId()) { - AttributeReferencePtr anAttr = + AttributeReferencePtr anAttr = std::dynamic_pointer_cast(theAttribute); ObjectPtr anObject = anAttr->value(); // Check selection attributes @@ -471,14 +471,14 @@ bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute } } else if(anAttrType == ModelAPI_AttributeSelectionList::typeId()) { - std::shared_ptr aCurSelList = + std::shared_ptr aCurSelList = std::dynamic_pointer_cast(theAttribute); anAttrs = aFeature->data()->attributes(ModelAPI_AttributeSelectionList::typeId()); if(anAttrs.size() > 0) { std::list>::iterator anAttrItr = anAttrs.begin(); for(; anAttrItr != anAttrs.end(); anAttrItr++){ if ((*anAttrItr).get() && (*anAttrItr)->id() != theAttribute->id()){ - std::shared_ptr aRefSelList = + std::shared_ptr aRefSelList = std::dynamic_pointer_cast(*anAttrItr); for(int i = 0; i < aCurSelList->size(); i++) { std::shared_ptr aCurSel = aCurSelList->value(i); @@ -491,7 +491,7 @@ bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute for(int j = 0; j < aRefSelList->size(); j++) { std::shared_ptr aRefSel = aRefSelList->value(j); ResultPtr aRefSelContext = aRefSel->context(); - ResultCompSolidPtr aRefSelCompSolidPtr = + ResultCompSolidPtr aRefSelCompSolidPtr = ModelAPI_Tools::compSolidOwner(aRefSelContext); std::shared_ptr aRefSelCompSolid; if(aRefSelCompSolidPtr.get()) { @@ -549,7 +549,7 @@ bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute return true; } -bool PartSet_CoincidentAttr::isValid(const AttributePtr& theAttribute, +bool PartSet_CoincidentAttr::isValid(const AttributePtr& theAttribute, const std::list& theArguments, Events_InfoMessage& theError) const { diff --git a/src/PartSet/PartSet_Validators.h b/src/PartSet/PartSet_Validators.h index aa2a5d7e6..64c61c9b9 100644 --- a/src/PartSet/PartSet_Validators.h +++ b/src/PartSet/PartSet_Validators.h @@ -23,7 +23,7 @@ class PartSet_DistanceSelection : public ModuleBase_SelectionValidator { public: - PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, + PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const; }; @@ -32,7 +32,7 @@ public: class PartSet_LengthSelection : public ModuleBase_SelectionValidator { public: - PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, + PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const; }; @@ -41,7 +41,7 @@ public: class PartSet_PerpendicularSelection : public ModuleBase_SelectionValidator { public: - PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, + PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection, ModuleBase_Operation* theOperation) const; }; @@ -172,7 +172,7 @@ class PartSet_DifferentObjectsValidator : public ModelAPI_AttributeValidator private: //! Returns error message for the error type //! \param theType a type of error - //! \param thEqualObjectInfo an + //! \param thEqualObjectInfo an std::string errorMessage(const PartSet_DifferentObjectsValidator::ErrorType& theType, const std::string& thEqualObject, const std::string& theFirstAttribute, const std::string& theSecondAttribute) const; diff --git a/src/PartSet/PartSet_WidgetChoice.h b/src/PartSet/PartSet_WidgetChoice.h index d83bc3643..6c70e7f7d 100644 --- a/src/PartSet/PartSet_WidgetChoice.h +++ b/src/PartSet/PartSet_WidgetChoice.h @@ -22,7 +22,7 @@ Q_OBJECT /// Constructor /// \param theParent the parent object /// \param theData the widget configuation. The attribute of the model widget is obtained from - PartSet_WidgetChoice(QWidget* theParent, const Config_WidgetAPI* theData) + PartSet_WidgetChoice(QWidget* theParent, const Config_WidgetAPI* theData) : ModuleBase_WidgetChoice(theParent, theData) {} }; diff --git a/src/PartSet/PartSet_WidgetFileSelector.cpp b/src/PartSet/PartSet_WidgetFileSelector.cpp index c1bf231f2..ca4f96355 100644 --- a/src/PartSet/PartSet_WidgetFileSelector.cpp +++ b/src/PartSet/PartSet_WidgetFileSelector.cpp @@ -29,7 +29,7 @@ bool PartSet_WidgetFileSelector::restoreValueCustom() DataPtr aData = myFeature->data(); AttributeStringPtr aStringAttr = aData->string(ExchangePlugin_ExportFeature::FILE_PATH_ID()); - mySelectedFilter = + mySelectedFilter = formatToFilter(shortFormatToFullFormat(QString::fromStdString(aStringAttr->value()))); return ModuleBase_WidgetFileSelector::restoreValueCustom(); diff --git a/src/PartSet/PartSet_WidgetMultiSelector.cpp b/src/PartSet/PartSet_WidgetMultiSelector.cpp index 60fffb15d..322864def 100755 --- a/src/PartSet/PartSet_WidgetMultiSelector.cpp +++ b/src/PartSet/PartSet_WidgetMultiSelector.cpp @@ -71,7 +71,7 @@ void PartSet_WidgetMultiSelector::getGeomSelection(const ModuleBase_ViewerPrsPtr ModuleBase_WidgetMultiSelector::getGeomSelection(thePrs, theObject, theShape); FeaturePtr aSelectedFeature = ModelAPI_Feature::feature(theObject); - std::shared_ptr aSPFeature = + std::shared_ptr aSPFeature = std::dynamic_pointer_cast(aSelectedFeature); // there is no a sketch feature is selected, but the shape exists, try to create an exernal object // TODO: unite with the same functionality in PartSet_WidgetShapeSelector @@ -87,7 +87,7 @@ void PartSet_WidgetMultiSelector::getGeomSelection(const ModuleBase_ViewerPrsPtr aShape = aResult->shape(); } if (aShape.get() != NULL && !aShape->isNull()) - anExternalObject = + anExternalObject = myExternalObjectMgr->externalObject(theObject, aShape, sketch(), myIsInValidate); } else { diff --git a/src/PartSet/PartSet_WidgetMultiSelector.h b/src/PartSet/PartSet_WidgetMultiSelector.h index 4ec5e1350..3bf11d973 100644 --- a/src/PartSet/PartSet_WidgetMultiSelector.h +++ b/src/PartSet/PartSet_WidgetMultiSelector.h @@ -70,7 +70,7 @@ protected: /// Manager of external objects PartSet_ExternalObjectsMgr* myExternalObjectMgr; - /// Pointer to a sketch + /// Pointer to a sketch CompositeFeaturePtr mySketch; }; diff --git a/src/PartSet/PartSet_WidgetPoint2DFlyout.cpp b/src/PartSet/PartSet_WidgetPoint2DFlyout.cpp index f02e6a2b7..3563e950e 100755 --- a/src/PartSet/PartSet_WidgetPoint2DFlyout.cpp +++ b/src/PartSet/PartSet_WidgetPoint2DFlyout.cpp @@ -18,7 +18,7 @@ #include -PartSet_WidgetPoint2DFlyout::PartSet_WidgetPoint2DFlyout(QWidget* theParent, +PartSet_WidgetPoint2DFlyout::PartSet_WidgetPoint2DFlyout(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, const Config_WidgetAPI* theData) : PartSet_WidgetPoint2D(theParent, theWorkshop, theData) diff --git a/src/PartSet/PartSet_WidgetPoint2DFlyout.h b/src/PartSet/PartSet_WidgetPoint2DFlyout.h index f6eeb7af3..8b1a87cb7 100755 --- a/src/PartSet/PartSet_WidgetPoint2DFlyout.h +++ b/src/PartSet/PartSet_WidgetPoint2DFlyout.h @@ -30,7 +30,7 @@ public: /// Destructor virtual ~PartSet_WidgetPoint2DFlyout() {}; - /// Checks if the selection presentation is valid in widget + /// Checks if the selection presentation is valid in widget /// \param theValue a selected presentation in the view /// \return a boolean value virtual bool isValidSelectionCustom(const std::shared_ptr& theValue); diff --git a/src/PartSet/PartSet_WidgetPoint2d.cpp b/src/PartSet/PartSet_WidgetPoint2d.cpp index c07953f44..df82c9b5f 100644 --- a/src/PartSet/PartSet_WidgetPoint2d.cpp +++ b/src/PartSet/PartSet_WidgetPoint2d.cpp @@ -62,7 +62,7 @@ const double MaxCoordinate = 1e12; static QStringList MyFeaturesForCoincedence; -PartSet_WidgetPoint2D::PartSet_WidgetPoint2D(QWidget* theParent, +PartSet_WidgetPoint2D::PartSet_WidgetPoint2D(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, const Config_WidgetAPI* theData) : ModuleBase_ModelWidget(theParent, theData), myWorkshop(theWorkshop), @@ -131,7 +131,7 @@ bool PartSet_WidgetPoint2D::isValidSelectionCustom(const ModuleBase_ViewerPrsPtr bool aValid = true; PartSet_Module* aModule = dynamic_cast(myWorkshop->module()); - if (aModule->sketchReentranceMgr()->isInternalEditActive()) + if (aModule->sketchReentranceMgr()->isInternalEditActive()) return true; /// when internal edit is started a new feature is created. I has not results, AIS /// the selection is not possible if the current feature has no presentation for the current @@ -381,8 +381,8 @@ void PartSet_WidgetPoint2D::deactivate() myWorkshop->deactivateSubShapesSelection(); } -bool PartSet_WidgetPoint2D::getPoint2d(const Handle(V3d_View)& theView, - const TopoDS_Shape& theShape, +bool PartSet_WidgetPoint2D::getPoint2d(const Handle(V3d_View)& theView, + const TopoDS_Shape& theShape, double& theX, double& theY) const { if (!theShape.IsNull()) { @@ -449,7 +449,7 @@ void PartSet_WidgetPoint2D::mouseReleased(ModuleBase_IViewWindow* theWindow, QMo Handle(V3d_View) aView = theWindow->v3dView(); QList aList = aSelection->getSelected(ModuleBase_ISelection::Viewer); - ModuleBase_ViewerPrsPtr aFirstValue = + ModuleBase_ViewerPrsPtr aFirstValue = aList.size() > 0 ? aList.first() : ModuleBase_ViewerPrsPtr(); if (!aFirstValue.get() && myPreSelected.get()) { aFirstValue = myPreSelected; @@ -487,7 +487,7 @@ void PartSet_WidgetPoint2D::mouseReleased(ModuleBase_IViewWindow* theWindow, QMo isOrphanPoint(aSelectedFeature, mySketch, aX, aY); if (anExternal) { // we should not stop reentrant operation on external objects because - anOrphanPoint = true; + anOrphanPoint = true; // they are not participate in the contour creation excepting external vertices if (aShape.ShapeType() == TopAbs_VERTEX) { FeaturePtr aFixedFeature = ModelAPI_Feature::feature(aFixedObject); @@ -496,9 +496,9 @@ void PartSet_WidgetPoint2D::mouseReleased(ModuleBase_IViewWindow* theWindow, QMo } } else { - // point is taken from mouse event and set in attribute. + // point is taken from mouse event and set in attribute. // It should be done before setting - // coinident constraint to the external line. If a point is created, it should be + // coinident constraint to the external line. If a point is created, it should be // in the mouse clicked point gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theWindow->v3dView()); @@ -509,7 +509,7 @@ void PartSet_WidgetPoint2D::mouseReleased(ModuleBase_IViewWindow* theWindow, QMo } if (aFixedObject.get()) setConstraintWith(aFixedObject); - // fignal updated should be flushed in order to visualize possible created + // fignal updated should be flushed in order to visualize possible created // external objects e.g. selection of trihedron axis when input end arc point updateObject(feature()); @@ -540,7 +540,7 @@ void PartSet_WidgetPoint2D::mouseReleased(ModuleBase_IViewWindow* theWindow, QMo } else if (aShape.ShapeType() == TopAbs_EDGE) { // point is taken from mouse event and set in attribute. It should be done before setting - // coinident constraint to the external line. If a point is created, it should be in + // coinident constraint to the external line. If a point is created, it should be in // the mouse clicked point gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theWindow->v3dView()); PartSet_Tools::convertTo2D(aPoint, mySketch, aView, aX, aY); @@ -549,7 +549,7 @@ void PartSet_WidgetPoint2D::mouseReleased(ModuleBase_IViewWindow* theWindow, QMo setValueState(Stored); // in case of edge selection, Apply state should also be updated isAuxiliaryFeature = PartSet_Tools::isAuxiliarySketchEntity(aObject); } - // it is important to perform updateObject() in order to the current value is + // it is important to perform updateObject() in order to the current value is // processed by Sketch Solver. Test case: line is created from a previous point // to some distance, but in the area of the highlighting of the point. Constraint // coincidence is created, after the solver is performed, the distance between the @@ -580,7 +580,7 @@ void PartSet_WidgetPoint2D::mouseReleased(ModuleBase_IViewWindow* theWindow, QMo //aIgnore.append(feature()); //double aTolerance = aView->Convert(7); - //std::shared_ptr aAttrPnt = + //std::shared_ptr aAttrPnt = // PartSet_Tools::findAttributePoint(mySketch, aX, anY, aTolerance, aIgnore); //if (aAttrPnt.get() != NULL) { // aFeaturePoint->setValue(aAttrPnt->pnt()); @@ -611,7 +611,7 @@ void PartSet_WidgetPoint2D::mouseMoved(ModuleBase_IViewWindow* theWindow, QMouse PartSet_Tools::convertTo2D(aPoint, mySketch, theWindow->v3dView(), aX, anY); if (myState != ModifiedInViewer) storeCurentValue(); - // we need to block the value state change + // we need to block the value state change bool isBlocked = blockValueState(true); setPoint(aX, anY); blockValueState(isBlocked); @@ -639,7 +639,7 @@ bool PartSet_WidgetPoint2D::isFeatureContainsPoint(const FeaturePtr& theFeature, AttributePtr aWidgetAttribute = myFeature->attribute(attributeID()); - std::shared_ptr aPnt2d = + std::shared_ptr aPnt2d = std::shared_ptr(new GeomAPI_Pnt2d(theX, theY)); std::list anAttributes = myFeature->data()->attributes(GeomDataAPI_Point2D::typeId()); diff --git a/src/PartSet/PartSet_WidgetPoint2d.h b/src/PartSet/PartSet_WidgetPoint2d.h index 3c9fc33a4..a12e35d0f 100755 --- a/src/PartSet/PartSet_WidgetPoint2d.h +++ b/src/PartSet/PartSet_WidgetPoint2d.h @@ -50,7 +50,7 @@ Q_OBJECT /// Destructor virtual ~PartSet_WidgetPoint2D(); - /// Checks if the selection presentation is valid in widget + /// Checks if the selection presentation is valid in widget /// \param theValue a selected presentation in the view /// \return a boolean value virtual bool isValidSelectionCustom(const std::shared_ptr& theValue); @@ -152,7 +152,7 @@ protected: /// Compute the feature default value and fill the controls with it /// or store the control value to the feature - /// The widget is not initialize the attribute value in order to avoid the + /// The widget is not initialize the attribute value in order to avoid the /// incorrect visualization in Sketch. E.g. by a line creation, the line should not /// be visualized immediatelly when the end point widget is activated. virtual void initializeValueByActivate(); @@ -163,7 +163,7 @@ protected: /// \param theShape a vertex shape /// \param theX an output value of X coordinate /// \param theY an output value of Y coordinate - bool getPoint2d(const Handle(V3d_View)& theView, const TopoDS_Shape& theShape, + bool getPoint2d(const Handle(V3d_View)& theView, const TopoDS_Shape& theShape, double& theX, double& theY) const; /// Create a coincidence constraint between the attribute and the parameter object diff --git a/src/PartSet/PartSet_WidgetPoint2dDistance.cpp b/src/PartSet/PartSet_WidgetPoint2dDistance.cpp index 79d1217bc..2427983ac 100644 --- a/src/PartSet/PartSet_WidgetPoint2dDistance.cpp +++ b/src/PartSet/PartSet_WidgetPoint2dDistance.cpp @@ -79,7 +79,7 @@ void PartSet_WidgetPoint2dDistance::setPoint(FeaturePtr theFeature, AttributeDoublePtr aReal = aData->real(attributeID()); if (aReal && (aReal->value() != aValue)) { aReal->setValue(aValue); - + ModuleBase_Tools::setSpinValue(mySpinBox, aValue); storeValue(); } @@ -115,7 +115,7 @@ void PartSet_WidgetPoint2dDistance::mouseReleased(ModuleBase_IViewWindow* theWnd emit focusOutWidget(this); } -void PartSet_WidgetPoint2dDistance::mouseMoved(ModuleBase_IViewWindow* theWnd, +void PartSet_WidgetPoint2dDistance::mouseMoved(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent) { if (isEditingMode()) diff --git a/src/PartSet/PartSet_WidgetPoint2dDistance.h b/src/PartSet/PartSet_WidgetPoint2dDistance.h index 63fe24778..c6597a0aa 100644 --- a/src/PartSet/PartSet_WidgetPoint2dDistance.h +++ b/src/PartSet/PartSet_WidgetPoint2dDistance.h @@ -50,7 +50,7 @@ Q_OBJECT virtual ~PartSet_WidgetPoint2dDistance(); - /// Checks if the selection presentation is valid in widget + /// Checks if the selection presentation is valid in widget /// \param theValue a selected presentation in the view /// \return a boolean value virtual bool isValidSelectionCustom(const std::shared_ptr& theValue); @@ -86,7 +86,7 @@ protected: /// \return true if the widget current value is reset virtual bool resetCustom(); - /// Set the second point which defines a value in the widget as + /// Set the second point which defines a value in the widget as /// a distance with a first point defined by feature void setPoint(FeaturePtr theFeature, const std::shared_ptr& thePnt); @@ -100,7 +100,7 @@ protected: protected: /// A reference to workshop ModuleBase_IWorkshop* myWorkshop; - + /// A name of the first point std::string myFirstPntName; diff --git a/src/PartSet/PartSet_WidgetShapeSelector.cpp b/src/PartSet/PartSet_WidgetShapeSelector.cpp index 42d4fb9b7..472b122e8 100755 --- a/src/PartSet/PartSet_WidgetShapeSelector.cpp +++ b/src/PartSet/PartSet_WidgetShapeSelector.cpp @@ -75,9 +75,9 @@ void PartSet_WidgetShapeSelector::getGeomSelection(const ModuleBase_ViewerPrsPtr ModuleBase_WidgetShapeSelector::getGeomSelection(thePrs, theObject, theShape); FeaturePtr aSelectedFeature = ModelAPI_Feature::feature(theObject); - std::shared_ptr aSPFeature = + std::shared_ptr aSPFeature = std::dynamic_pointer_cast(aSelectedFeature); - // there is no a sketch feature is selected, but the shape exists, + // there is no a sketch feature is selected, but the shape exists, // try to create an exernal object // TODO: unite with the same functionality in PartSet_WidgetShapeSelector if (aSPFeature.get() == NULL) { @@ -92,7 +92,7 @@ void PartSet_WidgetShapeSelector::getGeomSelection(const ModuleBase_ViewerPrsPtr aShape = aResult->shape(); } if (aShape.get() != NULL && !aShape->isNull()) - anExternalObject = + anExternalObject = myExternalObjectMgr->externalObject(theObject, aShape, sketch(), myIsInValidate); } else { /// use objects of found selection diff --git a/src/PartSet/PartSet_WidgetShapeSelector.h b/src/PartSet/PartSet_WidgetShapeSelector.h index 8a0ee84de..767528ead 100644 --- a/src/PartSet/PartSet_WidgetShapeSelector.h +++ b/src/PartSet/PartSet_WidgetShapeSelector.h @@ -70,7 +70,7 @@ protected: /// A reference to external objects manager PartSet_ExternalObjectsMgr* myExternalObjectMgr; - /// Pointer to a sketch + /// Pointer to a sketch CompositeFeaturePtr mySketch; bool myUseSketchPlane; ///< state whether the sketch plane filter should be switched on diff --git a/src/PartSet/PartSet_WidgetSketchCreator.cpp b/src/PartSet/PartSet_WidgetSketchCreator.cpp index 9e0325818..8fb404255 100644 --- a/src/PartSet/PartSet_WidgetSketchCreator.cpp +++ b/src/PartSet/PartSet_WidgetSketchCreator.cpp @@ -54,7 +54,7 @@ #define DEBUG_UNDO_INVALID_SKETCH -PartSet_WidgetSketchCreator::PartSet_WidgetSketchCreator(QWidget* theParent, +PartSet_WidgetSketchCreator::PartSet_WidgetSketchCreator(QWidget* theParent, PartSet_Module* theModule, const Config_WidgetAPI* theData) : ModuleBase_WidgetSelector(theParent, theModule->workshop(), theData), @@ -265,7 +265,7 @@ bool PartSet_WidgetSketchCreator::setSelection(QList& t bool aDone = false; if (!startSketchOperation(theValues)) { myIsCustomAttribute = true; - QList::const_iterator + QList::const_iterator anIt = theValues.begin(), aLast = theValues.end(); bool aProcessed = false; for (; anIt != aLast; anIt++) { @@ -279,7 +279,7 @@ bool PartSet_WidgetSketchCreator::setSelection(QList& t emit valuesChanged(); updateObject(myFeature); setVisibleSelectionControl(false); - // manually deactivation because the widget was + // manually deactivation because the widget was // not activated as has no focus acceptin controls deactivate(); emit focusOutWidget(this); @@ -316,7 +316,7 @@ bool PartSet_WidgetSketchCreator::startSketchOperation( /// sketch should not started by object(face) selected as global. If Local face is selected, /// sketch is started if (aResult.get() && aValue->shape().get() && aResult->shape()->isEqual(aValue->shape())) { - ResultConstructionPtr aConstruction = + ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aResult); if (!aConstruction.get() || !aConstruction->isInfinite()) return aSketchStarted; @@ -329,7 +329,7 @@ bool PartSet_WidgetSketchCreator::startSketchOperation( myPreviewPlanes->erasePreviewPlanes(myWorkshop); // Launch Sketch operation - CompositeFeaturePtr aCompFeature = + CompositeFeaturePtr aCompFeature = std::dynamic_pointer_cast(myFeature); // start edit operation for the sketch @@ -354,7 +354,7 @@ bool PartSet_WidgetSketchCreator::focusTo() return true; } else - connect(myModule, SIGNAL(resumed(ModuleBase_Operation*)), + connect(myModule, SIGNAL(resumed(ModuleBase_Operation*)), SLOT(onResumed(ModuleBase_Operation*))); return true; @@ -386,7 +386,7 @@ void PartSet_WidgetSketchCreator::onResumed(ModuleBase_Operation* theOp) // Validate the created sketch. If it is valid, it is set into the composite feature selection // list, otherwise it is removed - CompositeFeaturePtr aCompFeature = + CompositeFeaturePtr aCompFeature = std::dynamic_pointer_cast(myFeature); AttributeSelectionListPtr anAttrList = myFeature->data()->selectionList(myAttributeListID); if (aCompFeature->numberOfSubs() > 0) { @@ -405,7 +405,7 @@ void PartSet_WidgetSketchCreator::onResumed(ModuleBase_Operation* theOp) aMgr->startOperation("Delete invalid Sketch feature", false); // delete invalid sketch - CompositeFeaturePtr aSketchFeature = + CompositeFeaturePtr aSketchFeature = std::dynamic_pointer_cast(aCompFeature->subFeature(0)); QObjectPtrList anObjects; anObjects.append(aSketchFeature); @@ -445,7 +445,7 @@ void PartSet_WidgetSketchCreator::onResumed(ModuleBase_Operation* theOp) } // Hide sketcher result - CompositeFeaturePtr aSketchFeature = + CompositeFeaturePtr aSketchFeature = std::dynamic_pointer_cast(aCompFeature->subFeature(0)); std::list aResults = aSketchFeature->results(); std::list::const_iterator aIt; @@ -520,7 +520,7 @@ void PartSet_WidgetSketchCreator::setSketchObjectToList( } ResultPtr aSketchRes = aSketchFeature->results().front(); - ResultConstructionPtr aConstruction = + ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aSketchRes); if(!aConstruction.get()) { return; diff --git a/src/PartSet/PartSet_WidgetSketchCreator.h b/src/PartSet/PartSet_WidgetSketchCreator.h index 5e8ed26e6..a4c6ef494 100644 --- a/src/PartSet/PartSet_WidgetSketchCreator.h +++ b/src/PartSet/PartSet_WidgetSketchCreator.h @@ -42,7 +42,7 @@ public: /// \return a control list virtual QList getControls() const; - /// Set focus to the first control of the current widget. + /// Set focus to the first control of the current widget. /// The focus policy of the control is checked. /// If the widget has the NonFocus focus policy, it is skipped. /// \return the state whether the widget can accept the focus diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index 33872cf95..702fb6a11 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -97,7 +97,7 @@ PartSet_WidgetSketchLabel::PartSet_WidgetSketchLabel(QWidget* theParent, myViewInverted = new QCheckBox(tr("Reversed"), aViewBox); aViewLayout->addWidget(myViewInverted); - QPushButton* aSetViewBtn = + QPushButton* aSetViewBtn = new QPushButton(QIcon(":icons/plane_view.png"), tr("Set plane view"), aViewBox); connect(aSetViewBtn, SIGNAL(clicked(bool)), this, SLOT(onSetPlaneView())); aViewLayout->addWidget(aSetViewBtn); @@ -285,7 +285,7 @@ void PartSet_WidgetSketchLabel::updateByPlaneSelected(const ModuleBase_ViewerPrs //myLabel->setText(""); //myLabel->setToolTip(""); XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myWorkshop); - disconnect(aWorkshop->selector(), SIGNAL(selectionChanged()), + disconnect(aWorkshop->selector(), SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged())); // 4. deactivate face selection filter activateFilters(false); @@ -388,7 +388,7 @@ bool PartSet_WidgetSketchLabel::fillSketchPlaneBySelection(const FeaturePtr& the if (thePrs->object() && (theFeature != thePrs->object())) { DataPtr aData = theFeature->data(); - AttributeSelectionPtr aSelAttr = + AttributeSelectionPtr aSelAttr = std::dynamic_pointer_cast (aData->attribute(SketchPlugin_SketchEntity::EXTERNAL_ID())); if (aSelAttr) { diff --git a/src/PartSet/PartSet_WidgetSubShapeSelector.cpp b/src/PartSet/PartSet_WidgetSubShapeSelector.cpp index d2beed18e..3db87368e 100755 --- a/src/PartSet/PartSet_WidgetSubShapeSelector.cpp +++ b/src/PartSet/PartSet_WidgetSubShapeSelector.cpp @@ -167,10 +167,10 @@ bool PartSet_WidgetSubShapeSelector::setSelection( FeaturePtr aBaseFeature = ModelAPI_Feature::feature(aBaseObject); std::list a2DPointAttributes = aBaseFeature->data()->attributes( GeomDataAPI_Point2D::typeId()); - std::list::const_iterator anIt = a2DPointAttributes.begin(), + std::list::const_iterator anIt = a2DPointAttributes.begin(), aLast = a2DPointAttributes.end(); for (; anIt != aLast; anIt++) { - std::shared_ptr anAttributePoint = + std::shared_ptr anAttributePoint = std::dynamic_pointer_cast(*anIt); std::shared_ptr aPoint2D = anAttributePoint->pnt(); std::shared_ptr aPoint3D = PartSet_Tools::convertTo3D(aPoint2D->x(), @@ -183,7 +183,7 @@ bool PartSet_WidgetSubShapeSelector::setSelection( /// find the points in coincident features PntToAttributesMap aRefAttributes = myCashedReferences[aBaseObject]; - PntToAttributesMap::const_iterator + PntToAttributesMap::const_iterator aRIt = aRefAttributes.begin(), aRLast = aRefAttributes.end(); for (; aRIt != aRLast; aRIt++) { std::shared_ptr anAttribute = aRIt->first; diff --git a/src/PartSet/PartSet_WidgetSubShapeSelector.h b/src/PartSet/PartSet_WidgetSubShapeSelector.h index b20cf882d..376ffb139 100644 --- a/src/PartSet/PartSet_WidgetSubShapeSelector.h +++ b/src/PartSet/PartSet_WidgetSubShapeSelector.h @@ -119,7 +119,7 @@ protected: std::shared_ptr > PntToAttributesMap; std::map myCashedReferences; - /// Pointer to a sketch + /// Pointer to a sketch CompositeFeaturePtr mySketch; }; diff --git a/src/PartSetAPI/PartSetAPI_Part.cpp b/src/PartSetAPI/PartSetAPI_Part.cpp index 349651cf3..6adbac259 100644 --- a/src/PartSetAPI/PartSetAPI_Part.cpp +++ b/src/PartSetAPI/PartSetAPI_Part.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : PartSetAPI_Part.cpp -// Purpose: +// Purpose: // // History: // 16/06/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/PartSetAPI/PartSetAPI_Part.h b/src/PartSetAPI/PartSetAPI_Part.h index 4913e8195..ccdcfdb5a 100644 --- a/src/PartSetAPI/PartSetAPI_Part.h +++ b/src/PartSetAPI/PartSetAPI_Part.h @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : PartSetAPI_Part.h -// Purpose: +// Purpose: // // History: // 16/06/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/PartSetPlugin/PartSetPlugin_Duplicate.h b/src/PartSetPlugin/PartSetPlugin_Duplicate.h index 8553448bf..dad1fe197 100644 --- a/src/PartSetPlugin/PartSetPlugin_Duplicate.h +++ b/src/PartSetPlugin/PartSetPlugin_Duplicate.h @@ -17,7 +17,7 @@ class PartSetPlugin_Duplicate : public ModelAPI_Feature { public: - + /// Duplicate kind inline static const std::string& ID() { diff --git a/src/PartSetPlugin/PartSetPlugin_Remove.cpp b/src/PartSetPlugin/PartSetPlugin_Remove.cpp index 19ca7ae08..bf5434709 100644 --- a/src/PartSetPlugin/PartSetPlugin_Remove.cpp +++ b/src/PartSetPlugin/PartSetPlugin_Remove.cpp @@ -33,7 +33,7 @@ void PartSetPlugin_Remove::execute() aRoot->refsToFeature(aFeature, aRefFeatures); if (aRefFeatures.empty()) { aRoot->removeFeature(aFeature); - // the redisplay signal should be flushed in order to erase the feature presentation + // the redisplay signal should be flushed in order to erase the feature presentation // in the viewer after removeFeature from the document Events_Loop::loop()->flush(Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY)); } diff --git a/src/PrimitivesAPI/PrimitivesAPI_Box.h b/src/PrimitivesAPI/PrimitivesAPI_Box.h index a753ee92c..9dac5e2a8 100644 --- a/src/PrimitivesAPI/PrimitivesAPI_Box.h +++ b/src/PrimitivesAPI/PrimitivesAPI_Box.h @@ -26,25 +26,25 @@ public: /// Constructor without values. PRIMITIVESAPI_EXPORT explicit PrimitivesAPI_Box(const std::shared_ptr& theFeature); - + /// Constructor with values. PRIMITIVESAPI_EXPORT explicit PrimitivesAPI_Box(const std::shared_ptr& theFeature, const ModelHighAPI_Double& theDx, const ModelHighAPI_Double& theDy, const ModelHighAPI_Double& theDz); - + /// Constructor with values. PRIMITIVESAPI_EXPORT explicit PrimitivesAPI_Box(const std::shared_ptr& theFeature, const ModelHighAPI_Selection& theFirstPoint, const ModelHighAPI_Selection& theSecondPoint); - + /// Destructor. PRIMITIVESAPI_EXPORT virtual ~PrimitivesAPI_Box(); - - INTERFACE_6(PrimitivesPlugin_Box::ID(), + + INTERFACE_6(PrimitivesPlugin_Box::ID(), creationMethod, PrimitivesPlugin_Box::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */, dx, PrimitivesPlugin_Box::DX_ID(), @@ -53,17 +53,17 @@ public: ModelAPI_AttributeDouble, /** Dimension in Y */, dz, PrimitivesPlugin_Box::DZ_ID(), ModelAPI_AttributeDouble, /** Dimension in Z */, - firstPoint, PrimitivesPlugin_Box::POINT_FIRST_ID(), + firstPoint, PrimitivesPlugin_Box::POINT_FIRST_ID(), ModelAPI_AttributeSelection, /** First point */, - secondPoint, PrimitivesPlugin_Box::POINT_SECOND_ID(), + secondPoint, PrimitivesPlugin_Box::POINT_SECOND_ID(), ModelAPI_AttributeSelection, /** Second point */) - + /// Set dimensions PRIMITIVESAPI_EXPORT void setDimensions(const ModelHighAPI_Double& theDx, const ModelHighAPI_Double& theDy, const ModelHighAPI_Double& theDz); - + /// Set points PRIMITIVESAPI_EXPORT void setPoints(const ModelHighAPI_Selection& theFirstPoint, diff --git a/src/PrimitivesAPI/PrimitivesAPI_swig.h b/src/PrimitivesAPI/PrimitivesAPI_swig.h index c3bbe6d35..87ba2a6d5 100644 --- a/src/PrimitivesAPI/PrimitivesAPI_swig.h +++ b/src/PrimitivesAPI/PrimitivesAPI_swig.h @@ -8,7 +8,7 @@ #define PrimitivesAPI_swig_H_ #include - + #include "PrimitivesAPI_Box.h" diff --git a/src/PrimitivesPlugin/PrimitivesPlugin_Box.cpp b/src/PrimitivesPlugin/PrimitivesPlugin_Box.cpp index 35541e240..709c3c8d4 100644 --- a/src/PrimitivesPlugin/PrimitivesPlugin_Box.cpp +++ b/src/PrimitivesPlugin/PrimitivesPlugin_Box.cpp @@ -30,7 +30,7 @@ void PrimitivesPlugin_Box::initAttributes() data()->addAttribute(PrimitivesPlugin_Box::DY_ID(), ModelAPI_AttributeDouble::typeId()); data()->addAttribute(PrimitivesPlugin_Box::DZ_ID(), ModelAPI_AttributeDouble::typeId()); - data()->addAttribute(PrimitivesPlugin_Box::POINT_FIRST_ID(), + data()->addAttribute(PrimitivesPlugin_Box::POINT_FIRST_ID(), ModelAPI_AttributeSelection::typeId()); data()->addAttribute(PrimitivesPlugin_Box::POINT_SECOND_ID(), ModelAPI_AttributeSelection::typeId()); @@ -41,11 +41,11 @@ void PrimitivesPlugin_Box::execute() { AttributeStringPtr aMethodTypeAttr = string(PrimitivesPlugin_Box::CREATION_METHOD()); std::string aMethodType = aMethodTypeAttr->value(); - - if (aMethodType == CREATION_METHOD_BY_DIMENSIONS()) + + if (aMethodType == CREATION_METHOD_BY_DIMENSIONS()) createBoxByDimensions(); - - if (aMethodType == CREATION_METHOD_BY_TWO_POINTS()) + + if (aMethodType == CREATION_METHOD_BY_TWO_POINTS()) createBoxByTwoPoints(); } @@ -57,16 +57,16 @@ void PrimitivesPlugin_Box::createBoxByDimensions() double aDz = real(PrimitivesPlugin_Box::DZ_ID())->value(); std::shared_ptr aBoxAlgo(new GeomAlgoAPI_Box(aDx,aDy,aDz)); - - // These checks should be made to the GUI for the feature but + + // These checks should be made to the GUI for the feature but // the corresponding validator does not exist yet. if (!aBoxAlgo->check()) { // The error is not displayed in a popup window. It must be in the status bar. setError(aBoxAlgo->getError(), false); return; } - - // Build the box + + // Build the box aBoxAlgo->build(); // Check if the creation of the box @@ -78,21 +78,21 @@ void PrimitivesPlugin_Box::createBoxByDimensions() setError(aBoxAlgo->getError()); return; } - + int aResultIndex = 0; - ResultBodyPtr aResultBox = document()->createBody(data(), aResultIndex); + ResultBodyPtr aResultBox = document()->createBody(data(), aResultIndex); loadNamingDS(aBoxAlgo, aResultBox); setResult(aResultBox, aResultIndex); } //================================================================================================= -void PrimitivesPlugin_Box::createBoxByTwoPoints() +void PrimitivesPlugin_Box::createBoxByTwoPoints() { AttributeSelectionPtr aRef1 = data()->selection(PrimitivesPlugin_Box::POINT_FIRST_ID()); AttributeSelectionPtr aRef2 = data()->selection(PrimitivesPlugin_Box::POINT_SECOND_ID()); - + std::shared_ptr aBoxAlgo; - + if ((aRef1.get() != NULL) && (aRef2.get() != NULL)) { GeomShapePtr aShape1 = aRef1->value(); if (!aShape1.get()) //If we can't get the points directly, try getting them from the context @@ -107,16 +107,16 @@ void PrimitivesPlugin_Box::createBoxByTwoPoints() new GeomAlgoAPI_BoxPoints(aFirstPoint,aSecondPoint)); } } - - // These checks should be made to the GUI for the feature but + + // These checks should be made to the GUI for the feature but // the corresponding validator does not exist yet. if (!aBoxAlgo->check()) { // The error is not displayed in a popup window. It must be in the message console. setError(aBoxAlgo->getError(), false); return; } - - // Build the box + + // Build the box aBoxAlgo->build(); // Check if the creation of the box @@ -130,9 +130,9 @@ void PrimitivesPlugin_Box::createBoxByTwoPoints() setError(aBoxAlgo->getError(), false); return; } - + int aResultIndex = 0; - ResultBodyPtr aResultBox = document()->createBody(data(), aResultIndex); + ResultBodyPtr aResultBox = document()->createBody(data(), aResultIndex); loadNamingDS(aBoxAlgo, aResultBox); setResult(aResultBox, aResultIndex); } @@ -143,15 +143,15 @@ void PrimitivesPlugin_Box::loadNamingDS(std::shared_ptr theBoxA { // Load the result theResultBox->store(theBoxAlgo->shape()); - + // Prepare the naming theBoxAlgo->prepareNamingFaces(); - + // Insert to faces int num = 1; - std::map< std::string, std::shared_ptr > listOfFaces = + std::map< std::string, std::shared_ptr > listOfFaces = theBoxAlgo->getCreatedFaces(); - for (std::map< std::string, std::shared_ptr >::iterator + for (std::map< std::string, std::shared_ptr >::iterator it=listOfFaces.begin(); it!=listOfFaces.end(); ++it) { std::shared_ptr aFace = (*it).second; theResultBox->generated(aFace, (*it).first, num++); diff --git a/src/PrimitivesPlugin/PrimitivesPlugin_Box.h b/src/PrimitivesPlugin/PrimitivesPlugin_Box.h index 8db0d5417..c13403c92 100644 --- a/src/PrimitivesPlugin/PrimitivesPlugin_Box.h +++ b/src/PrimitivesPlugin/PrimitivesPlugin_Box.h @@ -39,14 +39,14 @@ class PrimitivesPlugin_Box : public ModelAPI_Feature static const std::string MY_CREATION_METHOD_ID("CreationMethod"); return MY_CREATION_METHOD_ID; } - + /// Attribute name for creation method inline static const std::string& CREATION_METHOD_BY_DIMENSIONS() { static const std::string MY_CREATION_METHOD_ID("BoxByDimensions"); return MY_CREATION_METHOD_ID; } - + /// Attribute name for creation method inline static const std::string& CREATION_METHOD_BY_TWO_POINTS() { @@ -101,7 +101,7 @@ class PrimitivesPlugin_Box : public ModelAPI_Feature /// Request for initialization of data model of the feature: adding all attributes PRIMITIVESPLUGIN_EXPORT virtual void initAttributes(); - + /// Use plugin manager for features creation PrimitivesPlugin_Box(); @@ -112,7 +112,7 @@ class PrimitivesPlugin_Box : public ModelAPI_Feature ///Perform the creation of the box using two points defining a diagonal void createBoxByTwoPoints(); - + ///Perform the creation of the box using three cordinates void createBoxByDimensions(); diff --git a/src/SHAPERGUI/SHAPERGUI.cpp b/src/SHAPERGUI/SHAPERGUI.cpp index fd929836d..c670b0184 100644 --- a/src/SHAPERGUI/SHAPERGUI.cpp +++ b/src/SHAPERGUI/SHAPERGUI.cpp @@ -71,7 +71,7 @@ public: SHAPERGUI_PrefMgr(LightApp_Preferences* theMgr, const QString& theModName): myMgr(theMgr), myModName(theModName) {} - virtual int addPreference(const QString& theLbl, int pId, + virtual int addPreference(const QString& theLbl, int pId, SUIT_PreferenceMgr::PrefItemType theType, const QString& theSection, const QString& theName ) { @@ -146,7 +146,7 @@ void SHAPERGUI::viewManagers(QStringList& theList) const void SHAPERGUI::connectToStudy(CAM_Study* theStudy) { // if there are created viewer managers, we should try to create viewer - // selector and initialize viewer with it. It sets interactive contect to the + // selector and initialize viewer with it. It sets interactive contect to the // proxy viewer. If study is opened, CAM application calls this method before the open() // of data model // the SHAPER data model is specific and during open(load) redisplay signals are flushed, so @@ -190,7 +190,7 @@ bool SHAPERGUI::activateModule(SUIT_Study* theStudy) mySelector = createSelector(OCCViewManagers.first()); } } - // it should be pefromed after the selector creation in order to have AISContext + // it should be pefromed after the selector creation in order to have AISContext myWorkshop->activateModule(); //action(myEraseAll)->setEnabled(false); @@ -384,7 +384,7 @@ QAction* SHAPERGUI::addFeature(const QString& theWBName, const ActionInfo& theIn theInfo.id, theInfo.text, //Issue #650: in the SALOME mode the tooltip should be same as text - theInfo.text, + theInfo.text, theInfo.icon, theInfo.shortcut, theInfo.checkable, @@ -592,16 +592,16 @@ void SHAPERGUI::createPreferences() // Create other parameters group in viewer tab int otherGroup = pref->addItem(tr("Default selection"), viewTab); pref->setItemProperty("columns", 3, otherGroup); - pref->addItem(tr("Faces"), otherGroup, + pref->addItem(tr("Faces"), otherGroup, SUIT_PreferenceMgr::Bool, ModuleBase_Preferences::VIEWER_SECTION, "face-selection"); - pref->addItem(tr("Edges"), otherGroup, + pref->addItem(tr("Edges"), otherGroup, SUIT_PreferenceMgr::Bool, ModuleBase_Preferences::VIEWER_SECTION, "edge-selection"); - pref->addItem(tr("Vertices"), otherGroup, + pref->addItem(tr("Vertices"), otherGroup, SUIT_PreferenceMgr::Bool, ModuleBase_Preferences::VIEWER_SECTION, "vertex-selection"); - + int sensitivityGroup = pref->addItem(tr("Selection sensitivity"), viewTab); pref->setItemProperty("columns", 2, sensitivityGroup); pref->addItem(tr("Vertex"), sensitivityGroup, SUIT_PreferenceMgr::Double, diff --git a/src/SHAPERGUI/SHAPERGUI.h b/src/SHAPERGUI/SHAPERGUI.h index 54097d470..c9c9f91fa 100644 --- a/src/SHAPERGUI/SHAPERGUI.h +++ b/src/SHAPERGUI/SHAPERGUI.h @@ -41,7 +41,7 @@ Q_OBJECT /// \brief Definition of module standard windows virtual void windows(QMap& theWndMap) const; - /// \brief Definition of module viewer + /// \brief Definition of module viewer virtual void viewManagers(QStringList& theList) const; /// \brief The method is called on selection changed event @@ -112,16 +112,16 @@ Q_OBJECT //! Returns list of defined actions (just by SHAPER module) virtual QList commandList() const; - /// Redefinition of virtual function. + /// Redefinition of virtual function. /// \param theClient name of pop-up client /// \param theMenu popup menu instance /// \param theTitle menu title. virtual void contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle); - /// Redefinition of virtual function for preferences creation. + /// Redefinition of virtual function for preferences creation. virtual void createPreferences(); - /// Redefinition of virtual function for preferences changed event. + /// Redefinition of virtual function for preferences changed event. virtual void preferencesChanged(const QString& theSection, const QString& theParam); //! Shows the given text in status bar as a permanent text @@ -207,10 +207,10 @@ Q_OBJECT // the next parameters should be restored after this module deactivation /// The application value of the preferences parameter - bool myIsStorePositions; + bool myIsStorePositions; /// The application value - bool myIsEditEnabled; + bool myIsEditEnabled; /// Popup manager QtxPopupMgr* myPopupMgr; diff --git a/src/SHAPERGUI/SHAPERGUI_DataModel.cpp b/src/SHAPERGUI/SHAPERGUI_DataModel.cpp index ac9a06edc..3d8defd92 100644 --- a/src/SHAPERGUI/SHAPERGUI_DataModel.cpp +++ b/src/SHAPERGUI/SHAPERGUI_DataModel.cpp @@ -159,7 +159,7 @@ void SHAPERGUI_DataModel::removeDirectory(const QString& theDirectoryName) Qtx::rmDir(theDirectoryName); } -bool SHAPERGUI_DataModel::dumpPython(const QString& thePath, CAM_Study* theStudy, +bool SHAPERGUI_DataModel::dumpPython(const QString& thePath, CAM_Study* theStudy, bool isMultiFile, QStringList& theListOfFiles) { LightApp_Study* aStudy = dynamic_cast(theStudy); @@ -178,16 +178,16 @@ bool SHAPERGUI_DataModel::dumpPython(const QString& thePath, CAM_Study* theStudy } AttributeStringPtr aAttr = aFeature->string(ExchangePlugin_Dump::FILE_PATH_ID()); - if (aAttr.get()) + if (aAttr.get()) aAttr->setValue(aFileName); aAttr = aFeature->string(ExchangePlugin_Dump::FILE_FORMAT_ID()); - if (aAttr.get()) + if (aAttr.get()) aAttr->setValue(".py"); ModelAPI_Session::get()->finishOperation(); if (QFile::exists(aFileName.c_str())) { - if (isMultiFile) { + if (isMultiFile) { QFile aInFile(aFileName.c_str()); if (!aInFile.open(QIODevice::ReadOnly | QIODevice::Text)) return false; diff --git a/src/SHAPERGUI/SHAPERGUI_DataModel.h b/src/SHAPERGUI/SHAPERGUI_DataModel.h index 5672caae7..5eb87cc86 100644 --- a/src/SHAPERGUI/SHAPERGUI_DataModel.h +++ b/src/SHAPERGUI/SHAPERGUI_DataModel.h @@ -76,7 +76,7 @@ protected: QString myStudyPath; /// a path to the temporary directory, created by opening a document file - QString myTmpDirectory; + QString myTmpDirectory; /// it should be created because the files reading is postponed in the module. The directory // should be removed after the model document is closed. diff --git a/src/SHAPERGUI/SHAPERGUI_NestedButton.cpp b/src/SHAPERGUI/SHAPERGUI_NestedButton.cpp index bf93cc666..1f269d595 100644 --- a/src/SHAPERGUI/SHAPERGUI_NestedButton.cpp +++ b/src/SHAPERGUI/SHAPERGUI_NestedButton.cpp @@ -105,5 +105,5 @@ void SHAPERGUI_NestedButton::actionStateChanged() } else { QString s = "false"; } - + } diff --git a/src/SHAPERGUI/SHAPERGUI_NestedButton.h b/src/SHAPERGUI/SHAPERGUI_NestedButton.h index 3665ac95d..158064c64 100644 --- a/src/SHAPERGUI/SHAPERGUI_NestedButton.h +++ b/src/SHAPERGUI/SHAPERGUI_NestedButton.h @@ -42,7 +42,7 @@ class SHAPERGUI_NestedButton : public QWidgetAction /// Creates the button representation /// \param theParent a parent widget virtual QWidget * createWidget(QWidget * theParent); - + virtual bool event(QEvent* theEvent); private: diff --git a/src/SHAPERGUI/SHAPERGUI_SalomeViewer.cpp b/src/SHAPERGUI/SHAPERGUI_SalomeViewer.cpp index b00b69648..f2bd66cae 100644 --- a/src/SHAPERGUI/SHAPERGUI_SalomeViewer.cpp +++ b/src/SHAPERGUI/SHAPERGUI_SalomeViewer.cpp @@ -133,13 +133,13 @@ void SHAPERGUI_SalomeViewer::setSelector(SHAPERGUI_OCCSelector* theSel) // TODO: Provide ModuleBase_IViewWindow interface connect(aMgr, SIGNAL(lastViewClosed(SUIT_ViewManager*)), this, SIGNAL(lastViewClosed())); - connect(aMgr, SIGNAL(tryCloseView(SUIT_ViewWindow*)), + connect(aMgr, SIGNAL(tryCloseView(SUIT_ViewWindow*)), this, SLOT(onTryCloseView(SUIT_ViewWindow*))); - connect(aMgr, SIGNAL(deleteView(SUIT_ViewWindow*)), + connect(aMgr, SIGNAL(deleteView(SUIT_ViewWindow*)), this, SLOT(onDeleteView(SUIT_ViewWindow*))); - connect(aMgr, SIGNAL(viewCreated(SUIT_ViewWindow*)), + connect(aMgr, SIGNAL(viewCreated(SUIT_ViewWindow*)), this, SLOT(onViewCreated(SUIT_ViewWindow*))); - connect(aMgr, SIGNAL(activated(SUIT_ViewManager*)), + connect(aMgr, SIGNAL(activated(SUIT_ViewManager*)), this, SLOT(onActivated(SUIT_ViewManager*))); connect(aMgr, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)), this, @@ -254,7 +254,7 @@ void SHAPERGUI_SalomeViewer::onViewCreated(SUIT_ViewWindow* theView) } reconnectActions(aWnd, true); - myWindowScale.insert(aView->getViewPort()->getView(), + myWindowScale.insert(aView->getViewPort()->getView(), aView->getViewPort()->getView()->Camera()->Scale()); emit viewCreated(myView); @@ -352,10 +352,10 @@ void SHAPERGUI_SalomeViewer::fitAll() } //********************************************** -void SHAPERGUI_SalomeViewer::setViewProjection(double theX, double theY, +void SHAPERGUI_SalomeViewer::setViewProjection(double theX, double theY, double theZ, double theTwist) { - if (!mySelector) + if (!mySelector) return; SUIT_ViewManager* aMgr = mySelector->viewer()->getViewManager(); @@ -455,7 +455,7 @@ void SHAPERGUI_SalomeViewer::activateViewer(bool toActivate) foreach (SUIT_ViewWindow* aView, aViews) { OCCViewer_ViewFrame* aOCCView = dynamic_cast(aView); OCCViewer_ViewWindow* aWnd = aOCCView->getView(OCCViewer_ViewFrame::MAIN_VIEW); - disconnect((OCCViewer_ViewWindow*)aWnd, + disconnect((OCCViewer_ViewWindow*)aWnd, SIGNAL(vpTransformationFinished(OCCViewer_ViewWindow::OperationType)), this, SLOT(onViewTransformed(OCCViewer_ViewWindow::OperationType))); reconnectActions(aWnd, false); diff --git a/src/SHAPERGUI/SHAPERGUI_SalomeViewer.h b/src/SHAPERGUI/SHAPERGUI_SalomeViewer.h index 4aa14049e..1deee5167 100644 --- a/src/SHAPERGUI/SHAPERGUI_SalomeViewer.h +++ b/src/SHAPERGUI/SHAPERGUI_SalomeViewer.h @@ -141,7 +141,7 @@ Q_OBJECT /// Update current viewer virtual void update(); - /// Method returns True if the viewer can process editing objects + /// Method returns True if the viewer can process editing objects /// by mouse drugging. If this is impossible thet it has to return False. virtual bool canDragByMouse() const; @@ -168,7 +168,7 @@ Q_OBJECT void onSelectionChanged(); void onViewTransformed(OCCViewer_ViewWindow::OperationType); - /// Emit signal about trihedron visiblity change because SALOME sets + /// Emit signal about trihedron visiblity change because SALOME sets /// the trihedron visible by this signal. /// It is necessary to activate the viewer trihedron in the current selection mode void onViewPortMapped(); diff --git a/src/SketchAPI/SketchAPI_Arc.cpp b/src/SketchAPI/SketchAPI_Arc.cpp index 8428bf784..63c1aa4f6 100644 --- a/src/SketchAPI/SketchAPI_Arc.cpp +++ b/src/SketchAPI/SketchAPI_Arc.cpp @@ -29,7 +29,7 @@ SketchAPI_Arc::SketchAPI_Arc(const std::shared_ptr& theFeature : SketchAPI_SketchEntity(theFeature) { if(initialize()) { - setByCenterStartEnd(theCenterX, theCenterY, theStartX, + setByCenterStartEnd(theCenterX, theCenterY, theStartX, theStartY, theEndX, theEndY, theInversed); } } diff --git a/src/SketchAPI/SketchAPI_Constraint.cpp b/src/SketchAPI/SketchAPI_Constraint.cpp index d8ca207c4..2bf24e028 100644 --- a/src/SketchAPI/SketchAPI_Constraint.cpp +++ b/src/SketchAPI/SketchAPI_Constraint.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_Constraint.cpp -// Purpose: +// Purpose: // // History: // 08/08/16 - Artem ZHIDKOV - Creation of the file @@ -140,7 +140,7 @@ void SketchAPI_Constraint::dump(ModelHighAPI_Dumper& theDumper) const FeaturePtr aFeature = ModelAPI_Feature::feature(aRefAttr->object()); if (!aFeature) return; - AttributeSelectionPtr aAttr = + AttributeSelectionPtr aAttr = aFeature->data()->selection(SketchPlugin_SketchEntity::EXTERNAL_ID()); if (aAttr && aAttr->context().get() != NULL && !aAttr->isInvalid()) return; diff --git a/src/SketchAPI/SketchAPI_Constraint.h b/src/SketchAPI/SketchAPI_Constraint.h index 488563116..df8ec2d9e 100644 --- a/src/SketchAPI/SketchAPI_Constraint.h +++ b/src/SketchAPI/SketchAPI_Constraint.h @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_Constraint.h -// Purpose: +// Purpose: // // History: // 08/08/16 - Artem ZHIDKOV - Creation of the file diff --git a/src/SketchAPI/SketchAPI_IntersectionPoint.cpp b/src/SketchAPI/SketchAPI_IntersectionPoint.cpp index 7723dc240..6c1eb0640 100644 --- a/src/SketchAPI/SketchAPI_IntersectionPoint.cpp +++ b/src/SketchAPI/SketchAPI_IntersectionPoint.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_IntersectionPoint.cpp -// Purpose: +// Purpose: // // History: // 16/06/16 - Sergey POKHODENKO - Creation of the file @@ -69,7 +69,7 @@ void SketchAPI_IntersectionPoint::dump(ModelHighAPI_Dumper& theDumper) const const std::string& aSketchName = theDumper.parentName(aBase); AttributeSelectionPtr aLine = externalLine(); - theDumper << aBase << " = " << + theDumper << aBase << " = " << aSketchName << ".addIntersectionPoint(" << aLine << ")" << std::endl; // dump "auxiliary" flag if necessary SketchAPI_SketchEntity::dump(theDumper); diff --git a/src/SketchAPI/SketchAPI_IntersectionPoint.h b/src/SketchAPI/SketchAPI_IntersectionPoint.h index 4d0b52c86..bdd0be17c 100644 --- a/src/SketchAPI/SketchAPI_IntersectionPoint.h +++ b/src/SketchAPI/SketchAPI_IntersectionPoint.h @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_IntersectionPoint.h -// Purpose: +// Purpose: // // History: // 16/06/16 - Sergey POKHODENKO - Creation of the file @@ -40,9 +40,9 @@ public: virtual ~SketchAPI_IntersectionPoint(); INTERFACE_2(SketchPlugin_IntersectionPoint::ID(), - coordinates, SketchPlugin_IntersectionPoint::COORD_ID(), + coordinates, SketchPlugin_IntersectionPoint::COORD_ID(), GeomDataAPI_Point2D, /** IntersectionPoint coordinates */, - externalLine, SketchPlugin_IntersectionPoint::EXTERNAL_LINE_ID(), + externalLine, SketchPlugin_IntersectionPoint::EXTERNAL_LINE_ID(), ModelAPI_AttributeSelection, /** External line */ ) diff --git a/src/SketchAPI/SketchAPI_Line.cpp b/src/SketchAPI/SketchAPI_Line.cpp index b1ea975ee..3bcf73ced 100644 --- a/src/SketchAPI/SketchAPI_Line.cpp +++ b/src/SketchAPI/SketchAPI_Line.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_Line.cpp -// Purpose: +// Purpose: // // History: // 07/06/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/SketchAPI/SketchAPI_Line.h b/src/SketchAPI/SketchAPI_Line.h index beec3cb87..ec5747bd0 100644 --- a/src/SketchAPI/SketchAPI_Line.h +++ b/src/SketchAPI/SketchAPI_Line.h @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_Line.h -// Purpose: +// Purpose: // // History: // 07/06/16 - Sergey POKHODENKO - Creation of the file @@ -51,7 +51,7 @@ public: virtual ~SketchAPI_Line(); INTERFACE_3(SketchPlugin_Line::ID(), - startPoint, SketchPlugin_Line::START_ID(), + startPoint, SketchPlugin_Line::START_ID(), GeomDataAPI_Point2D, /** Start point */, endPoint, SketchPlugin_Line::END_ID(), GeomDataAPI_Point2D, /** End point */, diff --git a/src/SketchAPI/SketchAPI_Mirror.cpp b/src/SketchAPI/SketchAPI_Mirror.cpp index 38c814fd8..375bb4578 100644 --- a/src/SketchAPI/SketchAPI_Mirror.cpp +++ b/src/SketchAPI/SketchAPI_Mirror.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_Mirror.cpp -// Purpose: +// Purpose: // // History: // 16/06/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/SketchAPI/SketchAPI_Mirror.h b/src/SketchAPI/SketchAPI_Mirror.h index 4c00c3684..518dd8b19 100644 --- a/src/SketchAPI/SketchAPI_Mirror.h +++ b/src/SketchAPI/SketchAPI_Mirror.h @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_Mirror.h -// Purpose: +// Purpose: // // History: // 16/06/16 - Sergey POKHODENKO - Creation of the file @@ -41,13 +41,13 @@ public: virtual ~SketchAPI_Mirror(); INTERFACE_4(SketchPlugin_ConstraintMirror::ID(), - mirrorLine, SketchPlugin_ConstraintMirror::ENTITY_A(), + mirrorLine, SketchPlugin_ConstraintMirror::ENTITY_A(), ModelAPI_AttributeRefAttr, /** Mirror line */, - mirrorList, SketchPlugin_ConstraintMirror::MIRROR_LIST_ID(), + mirrorList, SketchPlugin_ConstraintMirror::MIRROR_LIST_ID(), ModelAPI_AttributeRefList, /** Mirror list */, - referenceObjects, SketchPlugin_ConstraintMirror::ENTITY_B(), + referenceObjects, SketchPlugin_ConstraintMirror::ENTITY_B(), ModelAPI_AttributeRefList, /** Reference objects */, - mirroredObjects, SketchPlugin_ConstraintMirror::ENTITY_C(), + mirroredObjects, SketchPlugin_ConstraintMirror::ENTITY_C(), ModelAPI_AttributeRefList, /** Mirrored objects */ ) diff --git a/src/SketchAPI/SketchAPI_Point.cpp b/src/SketchAPI/SketchAPI_Point.cpp index 2c8820a53..9958088bb 100644 --- a/src/SketchAPI/SketchAPI_Point.cpp +++ b/src/SketchAPI/SketchAPI_Point.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_Point.cpp -// Purpose: +// Purpose: // // History: // 15/06/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/SketchAPI/SketchAPI_Point.h b/src/SketchAPI/SketchAPI_Point.h index 42d9da930..d68064c9f 100644 --- a/src/SketchAPI/SketchAPI_Point.h +++ b/src/SketchAPI/SketchAPI_Point.h @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_Point.h -// Purpose: +// Purpose: // // History: // 15/06/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/SketchAPI/SketchAPI_Projection.cpp b/src/SketchAPI/SketchAPI_Projection.cpp index 0c5c7f0be..1291a8099 100644 --- a/src/SketchAPI/SketchAPI_Projection.cpp +++ b/src/SketchAPI/SketchAPI_Projection.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_Projection.cpp -// Purpose: +// Purpose: // // History: // 16/06/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/SketchAPI/SketchAPI_Projection.h b/src/SketchAPI/SketchAPI_Projection.h index 3906f60b7..b8c3ff397 100644 --- a/src/SketchAPI/SketchAPI_Projection.h +++ b/src/SketchAPI/SketchAPI_Projection.h @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_Projection.h -// Purpose: +// Purpose: // // History: // 16/06/16 - Sergey POKHODENKO - Creation of the file @@ -40,11 +40,11 @@ public: virtual ~SketchAPI_Projection(); INTERFACE_3(SketchPlugin_Projection::ID(), - externalFeature, SketchPlugin_Projection::EXTERNAL_FEATURE_ID(), + externalFeature, SketchPlugin_Projection::EXTERNAL_FEATURE_ID(), ModelAPI_AttributeSelection, /** External feature */, - projectedFeature, SketchPlugin_Projection::PROJECTED_FEATURE_ID(), + projectedFeature, SketchPlugin_Projection::PROJECTED_FEATURE_ID(), ModelAPI_AttributeRefAttr, /** Projected feature */, - external, SketchPlugin_Projection::EXTERNAL_ID(), + external, SketchPlugin_Projection::EXTERNAL_ID(), ModelAPI_AttributeSelection, /** External */ ) diff --git a/src/SketchAPI/SketchAPI_Rectangle.cpp b/src/SketchAPI/SketchAPI_Rectangle.cpp index 88e5d5b22..ce60335d0 100644 --- a/src/SketchAPI/SketchAPI_Rectangle.cpp +++ b/src/SketchAPI/SketchAPI_Rectangle.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_Rectangle.cpp -// Purpose: +// Purpose: // // History: // 17/06/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/SketchAPI/SketchAPI_Rectangle.h b/src/SketchAPI/SketchAPI_Rectangle.h index 8aeda2a98..098d92ff3 100644 --- a/src/SketchAPI/SketchAPI_Rectangle.h +++ b/src/SketchAPI/SketchAPI_Rectangle.h @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_Rectangle.h -// Purpose: +// Purpose: // // History: // 17/06/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/SketchAPI/SketchAPI_Rotation.cpp b/src/SketchAPI/SketchAPI_Rotation.cpp index ea2cea1de..c53964912 100644 --- a/src/SketchAPI/SketchAPI_Rotation.cpp +++ b/src/SketchAPI/SketchAPI_Rotation.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_Rotation.cpp -// Purpose: +// Purpose: // // History: // 16/06/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/SketchAPI/SketchAPI_Rotation.h b/src/SketchAPI/SketchAPI_Rotation.h index 2deebb565..13817ca36 100644 --- a/src/SketchAPI/SketchAPI_Rotation.h +++ b/src/SketchAPI/SketchAPI_Rotation.h @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_Rotation.h -// Purpose: +// Purpose: // // History: // 16/06/16 - Sergey POKHODENKO - Creation of the file @@ -54,11 +54,11 @@ public: ModelAPI_AttributeDouble, /** Angle */, numberOfObjects, SketchPlugin_MultiRotation::NUMBER_OF_OBJECTS_ID(), ModelAPI_AttributeInteger, /** Number of objects */, - valueType, SketchPlugin_MultiRotation::ANGLE_TYPE(), + valueType, SketchPlugin_MultiRotation::ANGLE_TYPE(), ModelAPI_AttributeString, /** Value type */, - referenceObjects, SketchPlugin_MultiRotation::ENTITY_A(), + referenceObjects, SketchPlugin_MultiRotation::ENTITY_A(), ModelAPI_AttributeRefList, /** Reference objects */, - rotatedObjects, SketchPlugin_MultiRotation::ENTITY_B(), + rotatedObjects, SketchPlugin_MultiRotation::ENTITY_B(), ModelAPI_AttributeRefList, /** Rotated objects */ ) diff --git a/src/SketchAPI/SketchAPI_Sketch.cpp b/src/SketchAPI/SketchAPI_Sketch.cpp index ce765e71b..60c8165ef 100644 --- a/src/SketchAPI/SketchAPI_Sketch.cpp +++ b/src/SketchAPI/SketchAPI_Sketch.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_Sketch.cpp -// Purpose: +// Purpose: // // History: // 07/06/16 - Sergey POKHODENKO - Creation of the file @@ -190,27 +190,27 @@ SketchPtr addSketch(const std::shared_ptr & thePart, std::shared_ptr SketchAPI_Sketch::addPoint( double theX, double theY) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Point::ID()); return PointPtr(new SketchAPI_Point(aFeature, theX, theY)); } std::shared_ptr SketchAPI_Sketch::addPoint( const std::shared_ptr & thePoint) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Point::ID()); return PointPtr(new SketchAPI_Point(aFeature, thePoint)); } -std::shared_ptr +std::shared_ptr SketchAPI_Sketch::addPoint(const ModelHighAPI_Selection & theExternal) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Point::ID()); return PointPtr(new SketchAPI_Point(aFeature, theExternal)); } std::shared_ptr SketchAPI_Sketch::addPoint(const std::string & theExternalName) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Point::ID()); return PointPtr(new SketchAPI_Point(aFeature, theExternalName)); } @@ -219,23 +219,23 @@ std::shared_ptr SketchAPI_Sketch::addPoint(const std::string & std::shared_ptr SketchAPI_Sketch::addIntersectionPoint( const ModelHighAPI_Selection & theExternal) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_IntersectionPoint::ID()); return IntersectionPointPtr(new SketchAPI_IntersectionPoint(aFeature, theExternal)); } std::shared_ptr SketchAPI_Sketch::addIntersectionPoint( const std::string & theExternalName) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_IntersectionPoint::ID()); return IntersectionPointPtr(new SketchAPI_IntersectionPoint(aFeature, theExternalName)); } //-------------------------------------------------------------------------------------- -std::shared_ptr SketchAPI_Sketch::addLine(double theX1, double theY1, +std::shared_ptr SketchAPI_Sketch::addLine(double theX1, double theY1, double theX2, double theY2) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Line::ID()); return LinePtr(new SketchAPI_Line(aFeature, theX1, theY1, theX2, theY2)); } @@ -243,29 +243,29 @@ std::shared_ptr SketchAPI_Sketch::addLine( const std::shared_ptr & theStartPoint, const std::shared_ptr & theEndPoint) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Line::ID()); return LinePtr(new SketchAPI_Line(aFeature, theStartPoint, theEndPoint)); } -std::shared_ptr +std::shared_ptr SketchAPI_Sketch::addLine(const ModelHighAPI_Selection & theExternal) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Line::ID()); return LinePtr(new SketchAPI_Line(aFeature, theExternal)); } std::shared_ptr SketchAPI_Sketch::addLine(const std::string & theExternalName) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Line::ID()); return LinePtr(new SketchAPI_Line(aFeature, theExternalName)); } //-------------------------------------------------------------------------------------- -std::shared_ptr SketchAPI_Sketch::addRectangle(double theX1, double theY1, +std::shared_ptr SketchAPI_Sketch::addRectangle(double theX1, double theY1, double theX2, double theY2) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchAPI_Rectangle::ID()); return RectanglePtr(new SketchAPI_Rectangle(aFeature, theX1, theY1, theX2, theY2)); } @@ -273,7 +273,7 @@ std::shared_ptr SketchAPI_Sketch::addRectangle( const std::shared_ptr & theStartPoint, const std::shared_ptr & theEndPoint) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchAPI_Rectangle::ID()); return RectanglePtr(new SketchAPI_Rectangle(aFeature, theStartPoint, theEndPoint)); } @@ -283,7 +283,7 @@ std::shared_ptr SketchAPI_Sketch::addCircle(double theCenterX, double theCenterY, double theRadius) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Circle::ID()); return CirclePtr(new SketchAPI_Circle(aFeature, theCenterX, theCenterY, theRadius)); } @@ -292,7 +292,7 @@ std::shared_ptr SketchAPI_Sketch::addCircle( const std::shared_ptr& theCenter, double theRadius) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Circle::ID()); return CirclePtr(new SketchAPI_Circle(aFeature, theCenter, theRadius)); } @@ -301,7 +301,7 @@ std::shared_ptr SketchAPI_Sketch::addCircle(double theX1, doub double theX2, double theY2, double theX3, double theY3) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Circle::ID()); return CirclePtr(new SketchAPI_Circle(aFeature, theX1, theY1, theX2, theY2, theX3, theY3)); } @@ -311,15 +311,15 @@ std::shared_ptr SketchAPI_Sketch::addCircle( const std::shared_ptr& thePoint2, const std::shared_ptr& thePoint3) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Circle::ID()); return CirclePtr(new SketchAPI_Circle(aFeature, thePoint1, thePoint2, thePoint3)); } -std::shared_ptr +std::shared_ptr SketchAPI_Sketch::addCircle(const ModelHighAPI_Selection & theExternal) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Circle::ID()); return CirclePtr(new SketchAPI_Circle(aFeature, theExternal)); } @@ -327,7 +327,7 @@ std::shared_ptr std::shared_ptr SketchAPI_Sketch::addCircle(const std::string & theExternalName) { // TODO(spo): Add constraint SketchConstraintRigid like in PythonAPI. Is it necessary? - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Circle::ID()); return CirclePtr(new SketchAPI_Circle(aFeature, theExternalName)); } @@ -338,7 +338,7 @@ std::shared_ptr SketchAPI_Sketch::addArc(double theCenterX, doubl double theEndX, double theEndY, bool theInversed) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID()); return ArcPtr(new SketchAPI_Arc(aFeature, theCenterX, theCenterY, @@ -353,7 +353,7 @@ std::shared_ptr SketchAPI_Sketch::addArc( const std::shared_ptr& theEnd, bool theInversed) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID()); return ArcPtr(new SketchAPI_Arc(aFeature, theCenter, theStart, theEnd, theInversed)); } @@ -362,7 +362,7 @@ std::shared_ptr SketchAPI_Sketch::addArc(double theStartX, double double theEndX, double theEndY, double thePassedX, double thePassedY) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID()); return ArcPtr(new SketchAPI_Arc(aFeature, theStartX, theStartY, @@ -375,7 +375,7 @@ std::shared_ptr SketchAPI_Sketch::addArc( const std::shared_ptr& theEnd, const std::shared_ptr& thePassed) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID()); return ArcPtr(new SketchAPI_Arc(aFeature, theStart, theEnd, thePassed)); } @@ -385,7 +385,7 @@ std::shared_ptr SketchAPI_Sketch::addArc( double theEndX, double theEndY, bool theInversed) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID()); return ArcPtr(new SketchAPI_Arc(aFeature, theTangentPoint, theEndX, theEndY, theInversed)); } @@ -395,14 +395,14 @@ std::shared_ptr SketchAPI_Sketch::addArc( const std::shared_ptr& theEnd, bool theInversed) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID()); return ArcPtr(new SketchAPI_Arc(aFeature, theTangentPoint, theEnd, theInversed)); } std::shared_ptr SketchAPI_Sketch::addArc(const ModelHighAPI_Selection & theExternal) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID()); return ArcPtr(new SketchAPI_Arc(aFeature, theExternal)); } @@ -410,7 +410,7 @@ std::shared_ptr SketchAPI_Sketch::addArc(const ModelHighAPI_Selec std::shared_ptr SketchAPI_Sketch::addArc(const std::string & theExternalName) { // TODO(spo): Add constraint SketchConstraintRigid like in PythonAPI. Is it necessary? - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID()); return ArcPtr(new SketchAPI_Arc(aFeature, theExternalName)); } @@ -419,7 +419,7 @@ std::shared_ptr SketchAPI_Sketch::addArc(const std::string & theE std::shared_ptr SketchAPI_Sketch::addProjection( const ModelHighAPI_Selection & theExternalFeature) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Projection::ID()); return ProjectionPtr(new SketchAPI_Projection(aFeature, theExternalFeature)); } @@ -427,7 +427,7 @@ std::shared_ptr SketchAPI_Sketch::addProjection( std::shared_ptr SketchAPI_Sketch::addProjection( const std::string & theExternalName) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Projection::ID()); return ProjectionPtr(new SketchAPI_Projection(aFeature, theExternalName)); } @@ -437,7 +437,7 @@ std::shared_ptr SketchAPI_Sketch::addMirror( const ModelHighAPI_RefAttr & theMirrorLine, const std::list > & theObjects) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_ConstraintMirror::ID()); return MirrorPtr(new SketchAPI_Mirror(aFeature, theMirrorLine, theObjects)); } @@ -450,9 +450,9 @@ std::shared_ptr SketchAPI_Sketch::addTranslation( const ModelHighAPI_Integer & theNumberOfObjects, bool theFullValue) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_MultiTranslation::ID()); - return TranslationPtr(new SketchAPI_Translation(aFeature, theObjects, thePoint1, + return TranslationPtr(new SketchAPI_Translation(aFeature, theObjects, thePoint1, thePoint2, theNumberOfObjects, theFullValue)); } @@ -464,10 +464,10 @@ std::shared_ptr SketchAPI_Sketch::addRotation( const ModelHighAPI_Integer & theNumberOfObjects, bool theFullValue) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_MultiRotation::ID()); return RotationPtr( - new SketchAPI_Rotation(aFeature, theObjects, theCenter, + new SketchAPI_Rotation(aFeature, theObjects, theCenter, theAngle, theNumberOfObjects, theFullValue)); } @@ -477,7 +477,7 @@ std::shared_ptr SketchAPI_Sketch::addSplit( const ModelHighAPI_RefAttr& thePoint1, const ModelHighAPI_RefAttr& thePoint2) { - std::shared_ptr aFeature = + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_ConstraintSplit::ID()); fillAttribute(theFeature, aFeature->reference(SketchPlugin_Constraint::VALUE())); fillAttribute(thePoint1, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A())); @@ -729,7 +729,7 @@ void SketchAPI_Sketch::dump(ModelHighAPI_Dumper& theDumper) const theDumper << aBase << " = model.addSketch(" << aDocName << ", model.standardPlane(\"" << aPlaneName << "\"))" << std::endl; } else { // some other plane - theDumper << aBase << " = model.addSketch(" << aDocName << + theDumper << aBase << " = model.addSketch(" << aDocName << ", " << anExternal<< ")" << std::endl; } } else { diff --git a/src/SketchAPI/SketchAPI_Sketch.h b/src/SketchAPI/SketchAPI_Sketch.h index 60c5e4202..500c06a68 100644 --- a/src/SketchAPI/SketchAPI_Sketch.h +++ b/src/SketchAPI/SketchAPI_Sketch.h @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_Sketch.h -// Purpose: +// Purpose: // // History: // 07/06/16 - Sergey POKHODENKO - Creation of the file @@ -70,9 +70,9 @@ public: GeomDataAPI_Dir, /** Direction of X */, normal, SketchPlugin_Sketch::NORM_ID(), GeomDataAPI_Dir, /** Normal */, - features, SketchPlugin_Sketch::FEATURES_ID(), + features, SketchPlugin_Sketch::FEATURES_ID(), ModelAPI_AttributeRefList, /** Features */, - external, SketchPlugin_SketchEntity::EXTERNAL_ID(), + external, SketchPlugin_SketchEntity::EXTERNAL_ID(), ModelAPI_AttributeSelection, /** External */, solverError, SketchPlugin_Sketch::SOLVER_ERROR(), ModelAPI_AttributeString, /** Solver error */, @@ -109,11 +109,11 @@ public: /// Add intersection point SKETCHAPI_EXPORT - std::shared_ptr + std::shared_ptr addIntersectionPoint(const ModelHighAPI_Selection & theExternal); /// Add point SKETCHAPI_EXPORT - std::shared_ptr + std::shared_ptr addIntersectionPoint(const std::string & theExternalName); /// Add line diff --git a/src/SketchAPI/SketchAPI_SketchEntity.cpp b/src/SketchAPI/SketchAPI_SketchEntity.cpp index b693505d1..914c8baa2 100644 --- a/src/SketchAPI/SketchAPI_SketchEntity.cpp +++ b/src/SketchAPI/SketchAPI_SketchEntity.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_SketchEntity.cpp -// Purpose: +// Purpose: // // History: // 07/06/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/SketchAPI/SketchAPI_SketchEntity.h b/src/SketchAPI/SketchAPI_SketchEntity.h index fdd3b40a9..edf8c665e 100644 --- a/src/SketchAPI/SketchAPI_SketchEntity.h +++ b/src/SketchAPI/SketchAPI_SketchEntity.h @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_SketchEntity.h -// Purpose: +// Purpose: // // History: // 07/06/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/SketchAPI/SketchAPI_Translation.cpp b/src/SketchAPI/SketchAPI_Translation.cpp index 67e8457e9..2d5eaa38c 100644 --- a/src/SketchAPI/SketchAPI_Translation.cpp +++ b/src/SketchAPI/SketchAPI_Translation.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_Translation.cpp -// Purpose: +// Purpose: // // History: // 16/06/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/SketchAPI/SketchAPI_Translation.h b/src/SketchAPI/SketchAPI_Translation.h index aee6e38bf..6c6bbc9ad 100644 --- a/src/SketchAPI/SketchAPI_Translation.h +++ b/src/SketchAPI/SketchAPI_Translation.h @@ -1,6 +1,6 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_Translation.h -// Purpose: +// Purpose: // // History: // 16/06/16 - Sergey POKHODENKO - Creation of the file diff --git a/src/SketchPlugin/SketchPlugin_Arc.cpp b/src/SketchPlugin/SketchPlugin_Arc.cpp index ef74d2d04..90801362d 100644 --- a/src/SketchPlugin/SketchPlugin_Arc.cpp +++ b/src/SketchPlugin/SketchPlugin_Arc.cpp @@ -150,10 +150,10 @@ void SketchPlugin_Arc::execute() std::shared_ptr aCircleShape; if(!isInversed->value()) { - aCircleShape = + aCircleShape = GeomAlgoAPI_EdgeBuilder::lineCircleArc(aCenter, aStartPoint, aEndPoint, aNormal); } else { - aCircleShape = + aCircleShape = GeomAlgoAPI_EdgeBuilder::lineCircleArc(aCenter, aEndPoint, aStartPoint, aNormal); } @@ -195,15 +195,15 @@ AISObjectPtr SketchPlugin_Arc::getAISObject(AISObjectPtr thePrevious) bool aHasPlane = aNDir && !(aNDir->x() == 0 && aNDir->y() == 0 && aNDir->z() == 0); if (aHasPlane) { std::shared_ptr aNormal = aNDir->dir(); - std::shared_ptr + std::shared_ptr aStartPoint(aSketch->to3D(aStartAttr->x(), aStartAttr->y())); std::shared_ptr aEndPoint = aStartPoint; if (aTypeAttr && aTypeAttr->isInitialized() && aTypeAttr->value() == ARC_TYPE_THREE_POINTS()) { - if (aEndAttr->isInitialized() && // + if (aEndAttr->isInitialized() && // aEndAttr->pnt()->distance(aStartAttr->pnt()) > tolerance) { aEndPoint = aSketch->to3D(aEndAttr->x(), aEndAttr->y()); - std::shared_ptr aPassedAttr = + std::shared_ptr aPassedAttr = std::dynamic_pointer_cast( data()->attribute(PASSED_POINT_ID())); if (!aPassedAttr->isInitialized()) { @@ -211,10 +211,10 @@ AISObjectPtr SketchPlugin_Arc::getAISObject(AISObjectPtr thePrevious) // check that center is bad for the current start and end and must be recomputed std::shared_ptr aCircleForArc(new GeomAPI_Circ2d( aCenterAttr->pnt(), aStartAttr->pnt())); - std::shared_ptr aProjection = + std::shared_ptr aProjection = aCircleForArc->project(aEndAttr->pnt()); if (!aProjection.get() || aEndAttr->pnt()->distance(aProjection) > tolerance) { - std::shared_ptr aDir = + std::shared_ptr aDir = aEndAttr->pnt()->xy()->decreased(aStartAttr->pnt()->xy())->multiplied(0.5); double x = aDir->x(); double y = aDir->y(); @@ -231,7 +231,7 @@ AISObjectPtr SketchPlugin_Arc::getAISObject(AISObjectPtr thePrevious) AttributeBooleanPtr isInversed = std::dynamic_pointer_cast(attribute(INVERSED_ID())); - std::shared_ptr aCircleShape = + std::shared_ptr aCircleShape = (isInversed->isInitialized() && isInversed->value()) ? GeomAlgoAPI_EdgeBuilder::lineCircleArc(aCenter, aEndPoint, aStartPoint, aNormal) : GeomAlgoAPI_EdgeBuilder::lineCircleArc(aCenter, aStartPoint, aEndPoint, aNormal); @@ -241,7 +241,7 @@ AISObjectPtr SketchPlugin_Arc::getAISObject(AISObjectPtr thePrevious) } } // make a visible point - std::shared_ptr aCenterPointShape = + std::shared_ptr aCenterPointShape = GeomAlgoAPI_PointBuilder::vertex(aCenter); aShapes.push_back(aCenterPointShape); } @@ -319,10 +319,10 @@ bool SketchPlugin_Arc::isFeatureValid() bool isValid = false; if (anArcType == ARC_TYPE_THREE_POINTS()) - isValid = aStartAttr->isInitialized() && + isValid = aStartAttr->isInitialized() && anEndAttr->isInitialized() && aPassedAttr->isInitialized(); else - isValid = aCenterAttr->isInitialized() && + isValid = aCenterAttr->isInitialized() && aStartAttr->isInitialized() && anEndAttr->isInitialized(); return isValid; @@ -375,7 +375,7 @@ void SketchPlugin_Arc::attributeChanged(const std::string& theID) std::dynamic_pointer_cast(attribute(ARC_TYPE())); // this is before others since here end attribute may be changed, but with the special behavior - if (aTypeAttr->value() == ARC_TYPE_TANGENT() && + if (aTypeAttr->value() == ARC_TYPE_TANGENT() && (theID == TANGENT_POINT_ID() || theID == END_ID())) { SketchPlugin_Sketch* aSketch = sketch(); AttributeRefAttrPtr aTangPtAttr = std::dynamic_pointer_cast( @@ -412,7 +412,7 @@ void SketchPlugin_Arc::attributeChanged(const std::string& theID) std::shared_ptr aMidPnt( new GeomAPI_Pnt2d(aEndPntCoord->added(aTangPnt2d->xy())->multiplied(0.5))); - // compute center of arc by calculating intersection of + // compute center of arc by calculating intersection of // orthogonal line and middle perpendicular std::shared_ptr anOrthoLine(new GeomAPI_Lin2d(aTangPnt2d, anOrthoDir)); std::shared_ptr aMiddleLine(new GeomAPI_Lin2d(aMidPnt, aMidDir)); @@ -452,7 +452,7 @@ void SketchPlugin_Arc::attributeChanged(const std::string& theID) } } // update all other attributes due to the base attributes values - if (aTypeAttr->value() == ARC_TYPE_THREE_POINTS()) { + if (aTypeAttr->value() == ARC_TYPE_THREE_POINTS()) { // update passed point due to start, end and center if (aCenter->distance(aStart) > tolerance && aCenter->distance(anEnd) > tolerance) { // project passed point t othe circle @@ -477,7 +477,7 @@ void SketchPlugin_Arc::attributeChanged(const std::string& theID) std::shared_ptr aMidDir(new GeomAPI_Dir2d(aMidDirXY)); if ((aStartDir->cross(aMidDir) > 0) ^ !isReversed()) aMidDir->reverse(); - std::shared_ptr aPassedPnt = + std::shared_ptr aPassedPnt = aCenter->xy()->added(aMidDir->xy()->multiplied(aCenter->distance(aStart))); std::dynamic_pointer_cast(data()->attribute(PASSED_POINT_ID()))-> setValue(aPassedPnt->x(), aPassedPnt->y()); @@ -497,7 +497,7 @@ void SketchPlugin_Arc::attributeChanged(const std::string& theID) adjustPeriod(aStartParam); adjustPeriod(aEndParam); // use the passed point for the angle calculation - if (aTypeAttr->value() == ARC_TYPE_THREE_POINTS()) { + if (aTypeAttr->value() == ARC_TYPE_THREE_POINTS()) { std::shared_ptr aPassedAttr = std::dynamic_pointer_cast(data()->attribute(PASSED_POINT_ID())); double aPassedParam; @@ -558,7 +558,7 @@ void SketchPlugin_Arc::attributeChanged(const std::string& theID) } if (theID == RADIUS_ID()) { - if (!aStartAttr->isInitialized() || !anEndAttr->isInitialized() || + if (!aStartAttr->isInitialized() || !anEndAttr->isInitialized() || !aCenterAttr->isInitialized()) return; // move center and passed point @@ -572,14 +572,14 @@ void SketchPlugin_Arc::attributeChanged(const std::string& theID) double aRadius = aRadiusAttr->value(); data()->blockSendAttributeUpdated(true); - std::shared_ptr + std::shared_ptr aStartDir(new GeomAPI_Dir2d(aStart->xy()->decreased(aCenter->xy()))); - std::shared_ptr + std::shared_ptr aNewStart = aStartDir->xy()->multiplied(aRadius)->added(aCenter->xy()); aStartAttr->setValue(aNewStart->x(), aNewStart->y()); - std::shared_ptr + std::shared_ptr anEndDir(new GeomAPI_Dir2d(anEnd->xy()->decreased(aCenter->xy()))); - std::shared_ptr + std::shared_ptr aNewEnd = anEndDir->xy()->multiplied(aRadius)->added(aCenter->xy()); anEndAttr->setValue(aNewEnd->x(), aNewEnd->y()); data()->blockSendAttributeUpdated(false); diff --git a/src/SketchPlugin/SketchPlugin_Arc.h b/src/SketchPlugin/SketchPlugin_Arc.h index 812123b04..50ccbf323 100644 --- a/src/SketchPlugin/SketchPlugin_Arc.h +++ b/src/SketchPlugin/SketchPlugin_Arc.h @@ -21,7 +21,7 @@ */ class SketchPlugin_Arc : public SketchPlugin_SketchEntity, public GeomAPI_IPresentable { - /// to avoid cyclic dependencies in automatic updates: they mean that + /// to avoid cyclic dependencies in automatic updates: they mean that /// update is performed right now and automatic updates are not needed bool myStartUpdate, myEndUpdate; /// to avoid (if possible) additional modification of changed coordinate (issue #855) diff --git a/src/SketchPlugin/SketchPlugin_Circle.cpp b/src/SketchPlugin/SketchPlugin_Circle.cpp index 3df29fe2d..d8b4c8441 100644 --- a/src/SketchPlugin/SketchPlugin_Circle.cpp +++ b/src/SketchPlugin/SketchPlugin_Circle.cpp @@ -73,7 +73,7 @@ void SketchPlugin_Circle::execute() // compute a circle point in 3D view std::shared_ptr aCenterAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(CENTER_ID())); - AttributeDoublePtr aRadiusAttr = + AttributeDoublePtr aRadiusAttr = std::dynamic_pointer_cast(data()->attribute(RADIUS_ID())); if (aCenterAttr->isInitialized() && aRadiusAttr->isInitialized()) { std::shared_ptr aCenter(aSketch->to3D(aCenterAttr->x(), aCenterAttr->y())); @@ -107,7 +107,7 @@ AISObjectPtr SketchPlugin_Circle::getAISObject(AISObjectPtr thePrevious) // compute a circle point in 3D view std::shared_ptr aCenterAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(CENTER_ID())); - AttributeDoublePtr aRadiusAttr = + AttributeDoublePtr aRadiusAttr = std::dynamic_pointer_cast(attribute(RADIUS_ID())); if (aCenterAttr->isInitialized() && aRadiusAttr->isInitialized()) { std::shared_ptr aCenter(aSketch->to3D(aCenterAttr->x(), aCenterAttr->y())); @@ -123,7 +123,7 @@ AISObjectPtr SketchPlugin_Circle::getAISObject(AISObjectPtr thePrevious) if (aCircleShape && aRadius != 0) { std::list > aShapes; // make a visible point - std::shared_ptr aCenterPointShape = + std::shared_ptr aCenterPointShape = GeomAlgoAPI_PointBuilder::vertex(aCenter); aShapes.push_back(aCenterPointShape); aShapes.push_back(aCircleShape); @@ -143,7 +143,7 @@ AISObjectPtr SketchPlugin_Circle::getAISObject(AISObjectPtr thePrevious) bool SketchPlugin_Circle::isFeatureValid() { - std::shared_ptr aCenter = + std::shared_ptr aCenter = std::dynamic_pointer_cast(attribute(CENTER_ID())); bool aValid = aCenter->isInitialized(); @@ -204,7 +204,7 @@ void SketchPlugin_Circle::attributeChanged(const std::string& theID) { if (aSelection && !aSelection->isNull() && aSelection->isEdge()) { std::shared_ptr anEdge( new GeomAPI_Edge(aSelection)); std::shared_ptr aCirc = anEdge->circle(); - std::shared_ptr aCenterAttr = + std::shared_ptr aCenterAttr = std::dynamic_pointer_cast(attribute(CENTER_ID())); aCenterAttr->setValue(sketch()->to2D(aCirc->center())); real(RADIUS_ID())->setValue(aCirc->radius()); @@ -233,7 +233,7 @@ void SketchPlugin_Circle::attributeChanged(const std::string& theID) { std::shared_ptr aCenterAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(CENTER_ID())); - AttributeDoublePtr aRadiusAttr = + AttributeDoublePtr aRadiusAttr = std::dynamic_pointer_cast(data()->attribute(RADIUS_ID())); if (aNbInitialized == 1) @@ -272,7 +272,7 @@ void SketchPlugin_Circle::adjustThreePoints() std::dynamic_pointer_cast(attribute(CENTER_ID())); if (!aCenterAttr->isInitialized()) return; - AttributeDoublePtr aRadiusAttr = + AttributeDoublePtr aRadiusAttr = std::dynamic_pointer_cast(attribute(RADIUS_ID())); if (!aRadiusAttr->isInitialized()) return; diff --git a/src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp b/src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp index 432b28eb4..e363ba32b 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp @@ -42,14 +42,14 @@ void SketchPlugin_ConstraintAngle::initAttributes() data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId()); data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId()); - data()->addAttribute(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID(), + data()->addAttribute(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID(), ModelAPI_AttributeDouble::typeId()); - data()->addAttribute(SketchPlugin_ConstraintAngle::TYPE_ID(), + data()->addAttribute(SketchPlugin_ConstraintAngle::TYPE_ID(), ModelAPI_AttributeInteger::typeId()); - data()->addAttribute(SketchPlugin_ConstraintAngle::ANGLE_REVERSED_FIRST_LINE_ID(), + data()->addAttribute(SketchPlugin_ConstraintAngle::ANGLE_REVERSED_FIRST_LINE_ID(), ModelAPI_AttributeBoolean::typeId()); - data()->addAttribute(SketchPlugin_ConstraintAngle::ANGLE_REVERSED_SECOND_LINE_ID(), + data()->addAttribute(SketchPlugin_ConstraintAngle::ANGLE_REVERSED_SECOND_LINE_ID(), ModelAPI_AttributeBoolean::typeId()); } @@ -65,9 +65,9 @@ void SketchPlugin_ConstraintAngle::execute() { std::shared_ptr aData = data(); - std::shared_ptr anAttrA = + std::shared_ptr anAttrA = aData->refattr(SketchPlugin_Constraint::ENTITY_A()); - std::shared_ptr anAttrB = + std::shared_ptr anAttrB = aData->refattr(SketchPlugin_Constraint::ENTITY_B()); if (!anAttrA->isInitialized() || !anAttrB->isInitialized()) return; @@ -80,7 +80,7 @@ void SketchPlugin_ConstraintAngle::execute() anAttrValue->setValue(anAngle); updateConstraintValueByAngleValue(); } - // the value should to be computed here, not in the + // the value should to be computed here, not in the // getAISObject in order to change the model value // inside the object transaction. This is important for creating a constraint by preselection. // The display of the presentation in this case happens after the transaction commit @@ -110,13 +110,13 @@ void SketchPlugin_ConstraintAngle::attributeChanged(const std::string& theID) if (!aLineA || !aLineB) return; - if (theID == SketchPlugin_Constraint::ENTITY_A() || + if (theID == SketchPlugin_Constraint::ENTITY_A() || theID == SketchPlugin_Constraint::ENTITY_B()) { AttributeDoublePtr aValueAttr = real(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID()); AttributeDoublePtr aConstrValueAttr = real(SketchPlugin_Constraint::VALUE()); // only if one of attributes is not initialized, try to compute the current value if (!aValueAttr->isInitialized() || !aConstrValueAttr->isInitialized()) { - if (aValueAttr->isInitialized() && !aConstrValueAttr->isInitialized()) + if (aValueAttr->isInitialized() && !aConstrValueAttr->isInitialized()) // initialize base value of constraint updateConstraintValueByAngleValue(); double anAngle = calculateAngle(); @@ -132,9 +132,9 @@ void SketchPlugin_ConstraintAngle::attributeChanged(const std::string& theID) std::shared_ptr aData = data(); std::shared_ptr aPlane = SketchPlugin_Sketch::plane(sketch()); - FeaturePtr aLineA = + FeaturePtr aLineA = SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_A()); - FeaturePtr aLineB = + FeaturePtr aLineB = SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_B()); // Intersection of lines @@ -217,7 +217,7 @@ double SketchPlugin_ConstraintAngle::getAngleForType(double theAngle, bool isPre anAngle = theAngle - 180.0; else anAngle = 180.0 - theAngle; - + if (anAngle < 0.0) anAngle += 360.0; } diff --git a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp index 02931bcc2..eef61d0a9 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp @@ -71,7 +71,7 @@ AISObjectPtr SketchPlugin_ConstraintDistance::getAISObject(AISObjectPtr thePrevi if (!sketch()) return thePrevious; - AISObjectPtr anAIS = SketcherPrs_Factory::lengthDimensionConstraint(this, + AISObjectPtr anAIS = SketcherPrs_Factory::lengthDimensionConstraint(this, sketch()->coordinatePlane(), thePrevious); return anAIS; @@ -166,12 +166,12 @@ double SketchPlugin_ConstraintDistance::calculateCurrentDistance() void SketchPlugin_ConstraintDistance::attributeChanged(const std::string& theID) { - if (theID == SketchPlugin_Constraint::ENTITY_A() || - theID == SketchPlugin_Constraint::ENTITY_B()) + if (theID == SketchPlugin_Constraint::ENTITY_A() || + theID == SketchPlugin_Constraint::ENTITY_B()) { std::shared_ptr aValueAttr = std::dynamic_pointer_cast< ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_Constraint::VALUE())); - if (!aValueAttr->isInitialized()) { + if (!aValueAttr->isInitialized()) { // only if it is not initialized, try to compute the current value double aDistance = calculateCurrentDistance(); if (aDistance > 0) { // set as value the length of updated references @@ -181,7 +181,7 @@ void SketchPlugin_ConstraintDistance::attributeChanged(const std::string& theID) } else if (theID == SketchPlugin_Constraint::FLYOUT_VALUE_PNT() && !myFlyoutUpdate) { myFlyoutUpdate = true; // Recalculate flyout point in local coordinates of the distance constraint: - // the X coordinate is a length of projection of the flyout point on the + // the X coordinate is a length of projection of the flyout point on the // line binding two distanced points // or a line of projection of the distanced point onto the distanced segment // the Y coordinate is a distance from the flyout point to the line diff --git a/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp b/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp index c2ad12f99..4015ca52a 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp @@ -69,7 +69,7 @@ SketchPlugin_ConstraintFillet::SketchPlugin_ConstraintFillet() void SketchPlugin_ConstraintFillet::initAttributes() { data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::typeId()); - data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), + data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttrList::typeId()); } @@ -99,7 +99,7 @@ void SketchPlugin_ConstraintFillet::execute() aPointsIter != myNewPoints.end(); ++aPointsIter) { AttributePtr aPointAttr = *aPointsIter; - std::shared_ptr aFilletPoint2d = + std::shared_ptr aFilletPoint2d = std::dynamic_pointer_cast(aPointAttr); if(!aFilletPoint2d.get()) { setError("Error: One of the selected points is empty."); @@ -110,7 +110,7 @@ void SketchPlugin_ConstraintFillet::execute() // Obtain base lines for fillet. bool anIsNeedNewObjects = true; FilletFeatures aFilletFeatures; - std::map::iterator aPrevPointsIter = + std::map::iterator aPrevPointsIter = myPointFeaturesMap.find(aPointAttr); if(aPrevPointsIter != myPointFeaturesMap.end()) { anIsNeedNewObjects = false; @@ -124,7 +124,7 @@ void SketchPlugin_ConstraintFillet::execute() // Obtain constraint coincidence for the fillet point. FeaturePtr aConstraintCoincidence; const std::set& aRefsList = aFilletPoint2d->owner()->data()->refsToMe(); - for(std::set::const_iterator + for(std::set::const_iterator anIt = aRefsList.cbegin(); anIt != aRefsList.cend(); ++anIt) { std::shared_ptr anAttr = (*anIt); FeaturePtr aConstrFeature = std::dynamic_pointer_cast(anAttr->owner()); @@ -166,11 +166,11 @@ void SketchPlugin_ConstraintFillet::execute() aBaseEdgeA = *aLinesIt++; aBaseEdgeB = *aLinesIt; - std::pair aBasePairA = - std::make_pair(aBaseEdgeA, + std::pair aBasePairA = + std::make_pair(aBaseEdgeA, aBaseEdgeA->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value()); - std::pair aBasePairB = - std::make_pair(aBaseEdgeB, + std::pair aBasePairB = + std::make_pair(aBaseEdgeB, aBaseEdgeB->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value()); aFilletFeatures.baseEdgesState.push_back(aBasePairA); aFilletFeatures.baseEdgesState.push_back(aBasePairB); @@ -207,10 +207,10 @@ void SketchPlugin_ConstraintFillet::execute() FeaturePtr aBaseFeatures[aNbFeatures] = {aBaseEdgeA, aBaseEdgeB}; FeaturePtr aResultFeatures[aNbFeatures] = {aResultEdgeA, aResultEdgeB}; // tangent directions of the features in coincident point - std::shared_ptr aTangentDir[aNbFeatures]; + std::shared_ptr aTangentDir[aNbFeatures]; bool isStart[aNbFeatures]; // indicates which point the features share // first pair of points relate to first feature, second pair - to second - std::shared_ptr aStartEndPnt[aNbFeatures * 2]; + std::shared_ptr aStartEndPnt[aNbFeatures * 2]; std::string aFeatAttributes[aNbFeatures * 2]; // attributes of features for (int i = 0; i < aNbFeatures; i++) { std::string aStartAttr, aEndAttr; @@ -246,7 +246,7 @@ void SketchPlugin_ConstraintFillet::execute() if (!isStart[i]) aDir = aDir->multiplied(-1.0); } else if (aResultFeatures[i]->getKind() == SketchPlugin_Arc::ID()) { - std::shared_ptr aCenterPoint = + std::shared_ptr aCenterPoint = std::dynamic_pointer_cast( aResultFeatures[i]->attribute(SketchPlugin_Arc::CENTER_ID()))->pnt(); aDir = isStart[i] ? aStartEndPnt[2*i]->xy() : aStartEndPnt[2*i+1]->xy(); @@ -256,7 +256,7 @@ void SketchPlugin_ConstraintFillet::execute() double y = aDir->y(); aDir->setX(-y); aDir->setY(x); - if (isStart[i] == + if (isStart[i] == std::dynamic_pointer_cast(aBaseFeatures[i])->isReversed()) aDir = aDir->multiplied(-1.0); } @@ -266,13 +266,13 @@ void SketchPlugin_ConstraintFillet::execute() // By default, the start point of fillet arc is connected to FeatureA, // and the end point - to FeatureB. But when the angle between TangentDirA and // TangentDirB greater 180 degree, the sequaence of features need to be reversed. - double cosBA = aTangentDir[0]->cross(aTangentDir[1]); // cos(B-A), + double cosBA = aTangentDir[0]->cross(aTangentDir[1]); // cos(B-A), // where A and B - angles between corresponding tanget direction and the X axis bool isReversed = cosBA > 0.0; // Calculate fillet arc parameters std::shared_ptr aCenter, aTangentPntA, aTangentPntB; - calculateFilletCenter(aBaseEdgeA, aBaseEdgeB, aFilletRadius, + calculateFilletCenter(aBaseEdgeA, aBaseEdgeB, aFilletRadius, isStart, aCenter, aTangentPntA, aTangentPntB); if(!aCenter.get() || !aTangentPntA.get() || !aTangentPntB.get()) { setError("Can not create fillet with the specified parameters."); @@ -287,7 +287,7 @@ void SketchPlugin_ConstraintFillet::execute() aResultEdgeB->attribute(aFeatAttributes[2 + (isStart[1] ? 0 : 1)]))-> setValue(aTangentPntB->x(), aTangentPntB->y()); aResultEdgeB->execute(); - // update fillet arc: make the arc correct for sure, so, it is not needed to + // update fillet arc: make the arc correct for sure, so, it is not needed to // process the "attribute updated" // by arc; moreover, it may cause cyclicity in hte mechanism of updater aResultArc->data()->blockSendAttributeUpdated(true); @@ -298,7 +298,7 @@ void SketchPlugin_ConstraintFillet::execute() aTangentPntA = aTangentPntB; aTangentPntB = aTmp; } - std::shared_ptr aStartPoint = + std::shared_ptr aStartPoint = std::dynamic_pointer_cast( aResultArc->attribute(SketchPlugin_Arc::START_ID())); std::shared_ptr aEndPoint = std::dynamic_pointer_cast( @@ -326,7 +326,7 @@ void SketchPlugin_ConstraintFillet::execute() int aFeatInd = isReversed ? 1 : 0; int anAttrInd = (isReversed ? 2 : 0) + (isStart[isReversed ? 1 : 0] ? 0 : 1); aRefAttr->setAttr(aResultFeatures[aFeatInd]->attribute(aFeatAttributes[anAttrInd])); - recalculateAttributes(aResultArc, SketchPlugin_Arc::START_ID(), + recalculateAttributes(aResultArc, SketchPlugin_Arc::START_ID(), aResultFeatures[aFeatInd], aFeatAttributes[anAttrInd]); aConstraint->execute(); aFilletFeatures.resultConstraints.push_back(aConstraint); @@ -341,7 +341,7 @@ void SketchPlugin_ConstraintFillet::execute() aFeatInd = isReversed ? 0 : 1; anAttrInd = (isReversed ? 0 : 2) + (isStart[isReversed ? 0 : 1] ? 0 : 1); aRefAttr->setAttr(aResultFeatures[aFeatInd]->attribute(aFeatAttributes[anAttrInd])); - recalculateAttributes(aResultArc, SketchPlugin_Arc::END_ID(), + recalculateAttributes(aResultArc, SketchPlugin_Arc::END_ID(), aResultFeatures[aFeatInd], aFeatAttributes[anAttrInd]); aConstraint->execute(); aFilletFeatures.resultConstraints.push_back(aConstraint); @@ -368,7 +368,7 @@ void SketchPlugin_ConstraintFillet::execute() aRefAttr = std::dynamic_pointer_cast( aConstraint->attribute(SketchPlugin_Constraint::ENTITY_B())); bool isArc = aResultFeatures[i]->getKind() == SketchPlugin_Arc::ID(); - aRefAttr->setObject(isArc ? aResultFeatures[i]->lastResult() : + aRefAttr->setObject(isArc ? aResultFeatures[i]->lastResult() : aResultFeatures[i]->firstResult()); aConstraint->execute(); aFilletFeatures.resultConstraints.push_back(aConstraint); @@ -467,7 +467,7 @@ void SketchPlugin_ConstraintFillet::attributeChanged(const std::string& theID) myNewPoints.clear(); // Get list of points for fillets and current radius. - AttributeRefAttrListPtr aRefListOfFilletPoints = + AttributeRefAttrListPtr aRefListOfFilletPoints = std::dynamic_pointer_cast( data()->attribute(SketchPlugin_Constraint::ENTITY_A())); AttributeDoublePtr aRadiusAttribute = real(VALUE()); @@ -482,7 +482,7 @@ void SketchPlugin_ConstraintFillet::attributeChanged(const std::string& theID) // Iterate over points to get base lines an calculate radius for fillets. double aMinimumRadius = 0; - std::list> + std::list> aSelectedPointsList = aRefListOfFilletPoints->list(); std::list>::iterator anIter = aSelectedPointsList.begin(); std::set aPointsToSkeep; @@ -507,7 +507,7 @@ void SketchPlugin_ConstraintFillet::attributeChanged(const std::string& theID) // Obtain constraint coincidence for the fillet point. FeaturePtr aConstraintCoincidence; const std::set& aRefsList = aFilletPointAttr->owner()->data()->refsToMe(); - for(std::set::const_iterator + for(std::set::const_iterator anIt = aRefsList.cbegin(); anIt != aRefsList.cend(); ++anIt) { std::shared_ptr anAttr = (*anIt); FeaturePtr aConstrFeature = std::dynamic_pointer_cast(anAttr->owner()); @@ -550,11 +550,11 @@ void SketchPlugin_ConstraintFillet::attributeChanged(const std::string& theID) SketchPlugin_ConstraintCoincidence::ENTITY_B(), aCoincides); - // Remove points from set of coincides. + // Remove points from set of coincides. // Also get all attributes which is equal to this point to exclude it. std::shared_ptr aFilletPnt2d = aFilletPoint2D->pnt(); std::set aNewSetOfCoincides; - for(std::set::iterator + for(std::set::iterator anIt = aCoincides.begin(); anIt != aCoincides.end(); ++anIt) { std::string aFeatureKind = (*anIt)->getKind(); if(aFeatureKind == SketchPlugin_Point::ID()) { @@ -606,7 +606,7 @@ void SketchPlugin_ConstraintFillet::attributeChanged(const std::string& theID) // If we still have more than two coincides remove auxilary entities from set of coincides. if(aCoincides.size() > 2) { aNewSetOfCoincides.clear(); - for(std::set::iterator + for(std::set::iterator anIt = aCoincides.begin(); anIt != aCoincides.end(); ++anIt) { if(!(*anIt)->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value()) { aNewSetOfCoincides.insert(*anIt); @@ -643,7 +643,7 @@ void SketchPlugin_ConstraintFillet::attributeChanged(const std::string& theID) double aDistanceA = getProjectionDistance(anOldFeatureB, aPntA); double aDistanceB = getProjectionDistance(anOldFeatureA, aPntB); double aRadius = aDistanceA < aDistanceB ? aDistanceA / 2.0 : aDistanceB / 2.0; - aMinimumRadius = aMinimumRadius == 0 ? aRadius : + aMinimumRadius = aMinimumRadius == 0 ? aRadius : aRadius < aMinimumRadius ? aRadius : aMinimumRadius; } } @@ -817,14 +817,14 @@ void possibleFilletCenterArcArc( double aMedDist = (aRadA * aRadA - aRadB * aRadB + aCenterDist2) / (2.0 * aCenterDist); double aHeight = sqrt(aRadA * aRadA - aMedDist * aMedDist); - double x1 = theCenterA->x() + + double x1 = theCenterA->x() + (aMedDist * aCenterDir->x() + aCenterDir->y() * aHeight) / aCenterDist; - double y1 = theCenterA->y() + + double y1 = theCenterA->y() + (aMedDist * aCenterDir->y() - aCenterDir->x() * aHeight) / aCenterDist; - double x2 = theCenterA->x() + + double x2 = theCenterA->x() + (aMedDist * aCenterDir->x() - aCenterDir->y() * aHeight) / aCenterDist; - double y2 = theCenterA->y() + + double y2 = theCenterA->y() + (aMedDist * aCenterDir->y() + aCenterDir->x() * aHeight) / aCenterDist; std::shared_ptr aPoint1(new GeomAPI_XY(x1, y1)); @@ -880,7 +880,7 @@ void calculateFilletCenter(FeaturePtr theFeatureA, FeaturePtr theFeatureB, // get and filter possible centers std::list< std::shared_ptr > aSuspectCenters; - possibleFilletCenterLineLine(aStart[0], aDir[0], aStart[1], aDir[1], + possibleFilletCenterLineLine(aStart[0], aDir[0], aStart[1], aDir[1], theRadius, aSuspectCenters); double aDot = 0.0; std::list< std::shared_ptr >::iterator anIt = aSuspectCenters.begin(); @@ -898,7 +898,7 @@ void calculateFilletCenter(FeaturePtr theFeatureA, FeaturePtr theFeatureB, return; } } else if ((theFeatureA->getKind() == SketchPlugin_Arc::ID() && - theFeatureB->getKind() == SketchPlugin_Line::ID()) || + theFeatureB->getKind() == SketchPlugin_Line::ID()) || (theFeatureA->getKind() == SketchPlugin_Line::ID() && theFeatureB->getKind() == SketchPlugin_Arc::ID())) { int aLineInd = theFeatureA->getKind() == SketchPlugin_Line::ID() ? 0 : 1; @@ -916,7 +916,7 @@ void calculateFilletCenter(FeaturePtr theFeatureA, FeaturePtr theFeatureB, // get possible centers and filter them std::list< std::shared_ptr > aSuspectCenters; - possibleFilletCenterLineArc(aStart[aLineInd], aDirLine, aCenter[1-aLineInd], + possibleFilletCenterLineArc(aStart[aLineInd], aDirLine, aCenter[1-aLineInd], anArcRadius, theRadius, aSuspectCenters); double aDot = 0.0; // the line is forward into the arc @@ -973,7 +973,7 @@ void calculateFilletCenter(FeaturePtr theFeatureA, FeaturePtr theFeatureB, // get and filter possible centers std::list< std::shared_ptr > aSuspectCenters; - possibleFilletCenterArcArc(aCenter[0], anArcRadius[0], aCenter[1], + possibleFilletCenterArcArc(aCenter[0], anArcRadius[0], aCenter[1], anArcRadius[1], theRadius, aSuspectCenters); double aDot = 0.0; std::shared_ptr aLineTgPoint, anArcTgPoint; @@ -1015,8 +1015,8 @@ void getPointOnEdge(const FeaturePtr theFeature, aPntEnd = std::dynamic_pointer_cast( theFeature->attribute(SketchPlugin_Line::START_ID()))->pnt(); } - thePoint.reset( - new GeomAPI_Pnt2d(aPntStart->xy()->added( + thePoint.reset( + new GeomAPI_Pnt2d(aPntStart->xy()->added( aPntEnd->xy()->decreased( aPntStart->xy() )->multiplied(1.0 / 3.0) ) ) ); } else { std::shared_ptr aPntTemp; @@ -1076,7 +1076,7 @@ std::set getCoincides(const FeaturePtr& theConstraintCoincidence) { std::set aCoincides; - std::shared_ptr aFilletPnt = + std::shared_ptr aFilletPnt = SketchPlugin_Tools::getCoincidencePoint(theConstraintCoincidence); SketchPlugin_Tools::findCoincidences(theConstraintCoincidence, @@ -1106,7 +1106,7 @@ std::set getCoincides(const FeaturePtr& theConstraintCoincidence) // If we still have more than two coincides remove auxilary entities from set of coincides. if(aCoincides.size() > 2) { aNewSetOfCoincides.clear(); - for(std::set::iterator + for(std::set::iterator anIt = aCoincides.begin(); anIt != aCoincides.end(); ++anIt) { if(!(*anIt)->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value()) { aNewSetOfCoincides.insert(*anIt); diff --git a/src/SketchPlugin/SketchPlugin_ConstraintFillet.h b/src/SketchPlugin/SketchPlugin_ConstraintFillet.h index d965eaff5..d860688dd 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintFillet.h +++ b/src/SketchPlugin/SketchPlugin_ConstraintFillet.h @@ -30,7 +30,7 @@ class SketchPlugin_ConstraintFillet : public SketchPlugin_ConstraintBase /// \struct Struct to store base edges with states, result edges and constraints. struct FilletFeatures { /// list of objects the fillet is based and its states - std::list> baseEdgesState; + std::list> baseEdgesState; std::list resultEdges; ///< list of result edges std::list resultConstraints; ///< list of constraints provided by the fillet }; @@ -81,7 +81,7 @@ private: std::set myNewPoints; ///< set of new points /// map of point and features for fillet - std::map myPointFeaturesMap; + std::map myPointFeaturesMap; bool myListOfPointsChangedInCode; ///< flag to track that list of points changed in code bool myRadiusChangedByUser; ///< flag to track that radius changed by user bool myRadiusChangedInCode; ///< flag to track that radius changed in code diff --git a/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp b/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp index 6b291b643..3d37cf3ae 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp @@ -68,11 +68,11 @@ void SketchPlugin_ConstraintLength::execute() // aValueAttr->setValue(aLenght); //} - // the value should to be computed here, not in the getAISObject + // the value should to be computed here, not in the getAISObject // in order to change the model value // inside the object transaction. This is important for creating a constraint by preselection. // The display of the presentation in this case happens after the transaction commit - AttributePtr aFlyOutAttribute = + AttributePtr aFlyOutAttribute = data()->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()); if (!aFlyOutAttribute->isInitialized()) { compute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()); @@ -93,9 +93,9 @@ bool SketchPlugin_ConstraintLength::compute(const std::string& theAttributeId) std::shared_ptr aFlyOutAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(theAttributeId)); - std::shared_ptr aLine = + std::shared_ptr aLine = std::shared_ptr(new GeomAPI_Lin2d(aStartPoint->pnt(), anEndPoint->pnt())); - if (!aFlyOutAttr->isInitialized() || + if (!aFlyOutAttr->isInitialized() || (fabs(aFlyOutAttr->x()) < tolerance && fabs(aFlyOutAttr->y()) < tolerance)) { double aDist = aPoint1->distance(aPoint2)/5.; std::shared_ptr aFPnt = aLine->shiftedLocation(aDist); @@ -147,7 +147,7 @@ AISObjectPtr SketchPlugin_ConstraintLength::getAISObject(AISObjectPtr thePreviou if (!sketch()) return thePrevious; - AISObjectPtr anAIS = SketcherPrs_Factory::lengthDimensionConstraint(this, + AISObjectPtr anAIS = SketcherPrs_Factory::lengthDimensionConstraint(this, sketch()->coordinatePlane(), thePrevious); return anAIS; } @@ -184,7 +184,7 @@ void SketchPlugin_ConstraintLength::move(double theDeltaX, double theDeltaY) } void SketchPlugin_ConstraintLength::attributeChanged(const std::string& theID) { - if (theID == SketchPlugin_Constraint::ENTITY_A()) + if (theID == SketchPlugin_Constraint::ENTITY_A()) { std::shared_ptr aValueAttr = std::dynamic_pointer_cast< ModelAPI_AttributeDouble>(attribute(SketchPlugin_Constraint::VALUE())); diff --git a/src/SketchPlugin/SketchPlugin_ConstraintMirror.cpp b/src/SketchPlugin/SketchPlugin_ConstraintMirror.cpp index 797d293e3..b32215efa 100755 --- a/src/SketchPlugin/SketchPlugin_ConstraintMirror.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintMirror.cpp @@ -31,7 +31,7 @@ void SketchPlugin_ConstraintMirror::initAttributes() data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId()); data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefList::typeId()); data()->addAttribute(SketchPlugin_Constraint::ENTITY_C(), ModelAPI_AttributeRefList::typeId()); - data()->addAttribute(SketchPlugin_ConstraintMirror::MIRROR_LIST_ID(), + data()->addAttribute(SketchPlugin_ConstraintMirror::MIRROR_LIST_ID(), ModelAPI_AttributeRefList::typeId()); ModelAPI_Session::get()->validators()-> registerNotObligatory(getKind(), SketchPlugin_Constraint::ENTITY_B()); @@ -136,7 +136,7 @@ void SketchPlugin_ConstraintMirror::execute() if (aMirrorIter != aMirroredList.end()) break; // the lists are inconsistent // There is no mirrored object yet, create it - FeaturePtr aNewFeature = + FeaturePtr aNewFeature = SketchPlugin_Sketch::addUniqueNamedCopiedFeature(aFeatureIn, sketch(), true); aNewFeature->execute(); ModelAPI_EventCreator::get()->sendUpdated(aNewFeature, aRedisplayEvent); @@ -211,14 +211,14 @@ void SketchPlugin_ConstraintMirror::erase() static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY); std::list aTargetList = aRefListOfMirrored->list(); - for(std::list::const_iterator aTargetIt = + for(std::list::const_iterator aTargetIt = aTargetList.cbegin(); aTargetIt != aTargetList.cend(); aTargetIt++) { if((*aTargetIt).get()) { ResultPtr aRes = std::dynamic_pointer_cast(*aTargetIt); if(aRes.get()) { FeaturePtr aFeature = aRes->document()->feature(aRes); if(aFeature.get()) { - AttributeBooleanPtr aBooleanAttr = + AttributeBooleanPtr aBooleanAttr = aFeature->boolean(SketchPlugin_SketchEntity::COPY_ID()); if(aBooleanAttr.get()) { if (ModelAPI_Session::get()->isOperation()) // if this is not undo or redo diff --git a/src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.cpp b/src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.cpp index 30817fdc9..c03277b09 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.cpp @@ -41,7 +41,7 @@ AISObjectPtr SketchPlugin_ConstraintPerpendicular::getAISObject(AISObjectPtr the if (!sketch()) return thePrevious; - AISObjectPtr anAIS = SketcherPrs_Factory::perpendicularConstraint(this, + AISObjectPtr anAIS = SketcherPrs_Factory::perpendicularConstraint(this, sketch()->coordinatePlane(), thePrevious); return anAIS; } diff --git a/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp b/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp index 339fe9af3..d43eeddd9 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp @@ -101,17 +101,17 @@ bool SketchPlugin_ConstraintRadius::compute(const std::string& theAttributeId) GeomDataAPI_Point2D>(data()->attribute(theAttributeId)); // Prepare a circle if (aCyrcFeature->getKind() == SketchPlugin_Circle::ID()) { // circle - std::shared_ptr aCenterAttr = + std::shared_ptr aCenterAttr = std::dynamic_pointer_cast( aCyrcFeature->data()->attribute(SketchPlugin_Circle::CENTER_ID())); double aShift = aRadius * 1.1; std::shared_ptr aPnt = aCenterAttr->pnt(); - std::shared_ptr aFPnt = + std::shared_ptr aFPnt = std::shared_ptr(new GeomAPI_Pnt2d(aPnt->x() + aShift, aPnt->y() + aShift)); aFlyoutAttr->setValue(aFPnt); } else { // arc std::shared_ptr aStartAttr = std::dynamic_pointer_cast< - GeomDataAPI_Point2D>(aCyrcFeature->data()->attribute(SketchPlugin_Arc::START_ID())); + GeomDataAPI_Point2D>(aCyrcFeature->data()->attribute(SketchPlugin_Arc::START_ID())); aFlyoutAttr->setValue(aStartAttr->pnt()); } return true; @@ -176,7 +176,7 @@ void SketchPlugin_ConstraintRadius::attributeChanged(const std::string& theID) { if (theID == SketchPlugin_Constraint::ENTITY_A()) { std::shared_ptr aValueAttr = std::dynamic_pointer_cast< ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_Constraint::VALUE())); - if (!aValueAttr->isInitialized()) { + if (!aValueAttr->isInitialized()) { // only if it is not initialized, try to compute the current value std::shared_ptr aCyrcFeature; double aRadius = circleRadius(aCyrcFeature); diff --git a/src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp b/src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp index 418c0dd53..ec34ff9e1 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp @@ -42,9 +42,9 @@ AISObjectPtr SketchPlugin_ConstraintRigid::getAISObject(AISObjectPtr thePrevious ObjectPtr aObj = anAttr->object(); if (aObj.get() != NULL) { FeaturePtr aFeature = ModelAPI_Feature::feature(aObj); - std::shared_ptr aSkFea = + std::shared_ptr aSkFea = std::dynamic_pointer_cast(aFeature); - if (!aSkFea->isExternal()) + if (!aSkFea->isExternal()) isValidRigid = true; } diff --git a/src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp b/src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp index 4ac441841..9ff84a542 100755 --- a/src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp @@ -72,9 +72,9 @@ void SketchPlugin_ConstraintSplit::execute() setError("Error: Base object is not initialized."); return; } - AttributePoint2DPtr aFirstPointAttrOfSplit = + AttributePoint2DPtr aFirstPointAttrOfSplit = getPointOfRefAttr(aData->attribute(SketchPlugin_Constraint::ENTITY_A())); - AttributePoint2DPtr aSecondPointAttrOfSplit = + AttributePoint2DPtr aSecondPointAttrOfSplit = getPointOfRefAttr(aData->attribute(SketchPlugin_Constraint::ENTITY_B())); if (!aFirstPointAttrOfSplit.get() || !aFirstPointAttrOfSplit->isInitialized() || !aSecondPointAttrOfSplit.get() || !aSecondPointAttrOfSplit->isInitialized()) { @@ -120,7 +120,7 @@ void SketchPlugin_ConstraintSplit::execute() std::cout << std::endl; if (!aCoincidenceToFeature.empty()) { - std::cout << "Coincidences to base feature[" << + std::cout << "Coincidences to base feature[" << aCoincidenceToFeature.size() << "]: " << std::endl; std::map::const_iterator anIt = aCoincidenceToFeature.begin(), aLast = aCoincidenceToFeature.end(); @@ -131,7 +131,7 @@ void SketchPlugin_ConstraintSplit::execute() std::cout << i << "-" << getFeatureInfo(aFeature) << std::endl; std::cout << " -Attribute to correct:" << anAttributeId << std::endl; - std::cout << " -Point attribute:" << + std::cout << " -Point attribute:" << ModelGeomAlgo_Point2D::getPointAttributeInfo(aPointAttr) << std::endl; } } @@ -148,14 +148,14 @@ void SketchPlugin_ConstraintSplit::execute() std::cout << i << "-" << getFeatureInfo(aFeature) << std::endl; std::cout << " -Attribute to correct:" << anAttributeId << std::endl; - std::cout << " -Point attribute:" << + std::cout << " -Point attribute:" << ModelGeomAlgo_Point2D::getPointAttributeInfo(aPointAttr) << std::endl; } } - std::map >::const_iterator + std::map >::const_iterator aRefIt = aBaseRefAttributes.begin(), aRefLast = aBaseRefAttributes.end(); - std::cout << std::endl << "References to attributes of base feature [" << + std::cout << std::endl << "References to attributes of base feature [" << aBaseRefAttributes.size() << "]" << std::endl; for (; aRefIt != aRefLast; aRefIt++) { AttributePtr aBaseAttr = aRefIt->first; @@ -171,13 +171,13 @@ void SketchPlugin_ConstraintSplit::execute() FeaturePtr aRFeature = ModelAPI_Feature::feature(aRAttr->owner()); aRefsInfo.append("(" + aRFeature->name() + ") "); } - std::shared_ptr aPointAttr = + std::shared_ptr aPointAttr = std::dynamic_pointer_cast(aBaseAttr); - std::cout << aPointAttr->id().c_str() << + std::cout << aPointAttr->id().c_str() << ": " << "[" << aRefAttributes.size() << "] " << aRefsInfo << std::endl; } std::cout << std::endl; - std::cout << std::endl << "References to base feature [" << + std::cout << std::endl << "References to base feature [" << aRefsToFeature.size() << "]" << std::endl; std::list::const_iterator aRefAttrIt = aRefsToFeature.begin(), aRefAttrLast = aRefsToFeature.end(); @@ -211,7 +211,7 @@ void SketchPlugin_ConstraintSplit::execute() aModifiedAttributes); if (aFeatureKind == SketchPlugin_Circle::ID()) { FeaturePtr aCircleFeature = aBaseFeature; - splitCircle(aSplitFeature, aBaseFeature, anAfterFeature, aFurtherCoincidences, + splitCircle(aSplitFeature, aBaseFeature, anAfterFeature, aFurtherCoincidences, aCreatedFeatures, aModifiedAttributes); updateRefFeatureConstraints(getFeatureResult(aBaseFeature), aRefsToFeature); @@ -247,7 +247,7 @@ void SketchPlugin_ConstraintSplit::execute() } std::cout << "Modifed attributes (constraints to attributes are moved here):" << std::endl; - std::set >::const_iterator + std::set >::const_iterator aPIt = aModifiedAttributes.begin(), aPLast = aModifiedAttributes.end(); std::string aResInfo; for (; aPIt != aPLast; aPIt++) { @@ -349,14 +349,14 @@ AISObjectPtr SketchPlugin_ConstraintSplit::getAISObject(AISObjectPtr thePrevious aPoints.push_back(aStartPoint); std::shared_ptr aSecondPnt2d = aSecondPointAttrOfSplit->pnt(); - std::shared_ptr aSecondPoint = + std::shared_ptr aSecondPoint = sketch()->to3D(aSecondPnt2d->x(), aSecondPnt2d->y()); aPoints.push_back(aSecondPoint); std::set > aSplitShapes; GeomAlgoAPI_ShapeTools::splitShape(aBaseShape, aPoints, aSplitShapes); - std::shared_ptr aShape = + std::shared_ptr aShape = GeomAlgoAPI_ShapeTools::findShape(aPoints, aSplitShapes); AISObjectPtr anAIS = thePrevious; @@ -381,7 +381,7 @@ std::shared_ptr SketchPlugin_ConstraintSplit::getPointOfRef AttributePoint2DPtr aPointAttribute; if (theAttribute->attributeType() == ModelAPI_AttributeRefAttr::typeId()) { - AttributeRefAttrPtr aRefAttr = + AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast(theAttribute); if (aRefAttr.get() && aRefAttr->isInitialized()) { AttributePtr anAttribute = aRefAttr->attr(); @@ -450,14 +450,14 @@ void SketchPlugin_ConstraintSplit::getConstraints(std::set& theFeatu else if (aRefFeatureKind == SketchPlugin_ConstraintTangent::ID()) { if (aBaseFeature->getKind() == SketchPlugin_Circle::ID()) /// TEMPORARY limitaion /// until tangency between arc and line is implemented - theFeaturesToDelete.insert(aRefFeature); + theFeaturesToDelete.insert(aRefFeature); else { std::string anAttributeToBeModified; AttributePoint2DPtr aTangentPoint; ObjectPtr aResult1 = aRefFeature->refattr(SketchPlugin_Constraint::ENTITY_A())->object(); ObjectPtr aResult2 = aRefFeature->refattr(SketchPlugin_Constraint::ENTITY_B())->object(); if (aResult1.get() && aResult2.get()) { - FeaturePtr aCoincidenceFeature = + FeaturePtr aCoincidenceFeature = SketchPlugin_ConstraintCoincidence::findCoincidenceFeature (ModelAPI_Feature::feature(aResult1), ModelAPI_Feature::feature(aResult2)); @@ -483,7 +483,7 @@ void SketchPlugin_ConstraintSplit::getConstraints(std::set& theFeatu theTangentFeatures[aRefFeature] = std::make_pair(anAttributeToBeModified, aTangentPoint); } else /// there is not coincident point between tangent constraint - theFeaturesToDelete.insert(aRefFeature); + theFeaturesToDelete.insert(aRefFeature); } } else if (aRefFeatureKind == SketchPlugin_ConstraintCoincidence::ID()) { @@ -545,11 +545,11 @@ void SketchPlugin_ConstraintSplit::getRefAttributes(const FeaturePtr& theFeature { theRefs.clear(); - std::list aPointAttributes = + std::list aPointAttributes = theFeature->data()->attributes(GeomDataAPI_Point2D::typeId()); std::set aPointAttributesSet; - std::list::const_iterator aPIt = + std::list::const_iterator aPIt = aPointAttributes.begin(), aPLast = aPointAttributes.end(); for (; aPIt != aPLast; aPIt++) aPointAttributesSet.insert(*aPIt); @@ -567,7 +567,7 @@ void SketchPlugin_ConstraintSplit::getRefAttributes(const FeaturePtr& theFeature AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast(anAttr); if (!aRefAttr->isObject()) { /// find attributes referenced to feature point attributes AttributePtr anAttrInRef = aRefAttr->attr(); - if (anAttrInRef.get() && + if (anAttrInRef.get() && aPointAttributesSet.find(anAttrInRef) != aPointAttributesSet.end()) { if (theRefs.find(anAttrInRef) != theRefs.end()) theRefs[anAttrInRef].push_back(aRefAttr); @@ -667,7 +667,7 @@ void SketchPlugin_ConstraintSplit::updateTangentConstraintsToFeature( aFeaturePointAttribute = aFCAttribute; } if (aFeaturePointAttribute.get()) { - FeaturePtr aFeature = + FeaturePtr aFeature = std::dynamic_pointer_cast(aFeaturePointAttribute->owner()); aTangentFeature->refattr(anAttributeId)->setObject(getFeatureResult(aFeature)); } @@ -698,13 +698,13 @@ void SketchPlugin_ConstraintSplit::updateRefAttConstraints( std::cout << "SketchPlugin_ConstraintSplit::updateRefAttConstraints" << std::endl; #endif - std::set >::const_iterator + std::set >::const_iterator anIt = theModifiedAttributes.begin(), aLast = theModifiedAttributes.end(); for (; anIt != aLast; anIt++) { AttributePtr anAttribute = anIt->first; /// not found in references - if (theBaseRefAttributes.find(anAttribute) == theBaseRefAttributes.end()) + if (theBaseRefAttributes.find(anAttribute) == theBaseRefAttributes.end()) continue; std::list aRefAttributes = theBaseRefAttributes.at(anAttribute); std::list::const_iterator aRefIt = aRefAttributes.begin(), @@ -746,9 +746,9 @@ void SketchPlugin_ConstraintSplit::splitLine(FeaturePtr& theSplitFeature, if (aFeatureKind != SketchPlugin_Line::ID()) return; - AttributePoint2DPtr aFirstPointAttrOfSplit = + AttributePoint2DPtr aFirstPointAttrOfSplit = getPointOfRefAttr(data()->attribute(SketchPlugin_Constraint::ENTITY_A())); - AttributePoint2DPtr aSecondPointAttrOfSplit = + AttributePoint2DPtr aSecondPointAttrOfSplit = getPointOfRefAttr(data()->attribute(SketchPlugin_Constraint::ENTITY_B())); AttributePoint2DPtr aStartPointAttrOfBase, anEndPointAttrOfBase; getFeaturePoints(aStartPointAttrOfBase, anEndPointAttrOfBase); @@ -757,23 +757,23 @@ void SketchPlugin_ConstraintSplit::splitLine(FeaturePtr& theSplitFeature, return; } - arrangePointsOnLine(aStartPointAttrOfBase, anEndPointAttrOfBase, + arrangePointsOnLine(aStartPointAttrOfBase, anEndPointAttrOfBase, aFirstPointAttrOfSplit, aSecondPointAttrOfSplit); #ifdef DEBUG_SPLIT std::cout << "Arranged points (to build split between 1st and 2nd points:" << std::endl; - std::cout << "Start point: " << + std::cout << "Start point: " << ModelGeomAlgo_Point2D::getPointAttributeInfo(aStartPointAttrOfBase) << std::endl; - std::cout << "1st point: " << + std::cout << "1st point: " << ModelGeomAlgo_Point2D::getPointAttributeInfo(aFirstPointAttrOfSplit) << std::endl; - std::cout << "2nd point: " << + std::cout << "2nd point: " << ModelGeomAlgo_Point2D::getPointAttributeInfo(aSecondPointAttrOfSplit) << std::endl; - std::cout << "End point: " << + std::cout << "End point: " << ModelGeomAlgo_Point2D::getPointAttributeInfo(anEndPointAttrOfBase) << std::endl; #endif /// create a split feature - theSplitFeature = + theSplitFeature = createLineFeature(aBaseFeature, aFirstPointAttrOfSplit, aSecondPointAttrOfSplit); theCreatedFeatures.insert(theSplitFeature); @@ -827,7 +827,7 @@ void SketchPlugin_ConstraintSplit::splitLine(FeaturePtr& theSplitFeature, // before split feature if (!aStartPointAttrOfBase->pnt()->isEqual(aFirstPointAttrOfSplit->pnt())) { /// move end arc point to start of split - fillAttribute(theBaseFeatureModified->attribute(SketchPlugin_Line::END_ID()), + fillAttribute(theBaseFeatureModified->attribute(SketchPlugin_Line::END_ID()), aFirstPointAttrOfSplit); theBaseFeatureModified->execute(); // to update result aConstraintFeature = createConstraint(SketchPlugin_ConstraintCoincidence::ID(), @@ -879,9 +879,9 @@ void SketchPlugin_ConstraintSplit::splitArc(FeaturePtr& theSplitFeature, if (aFeatureKind != SketchPlugin_Arc::ID()) return; - AttributePoint2DPtr aFirstPointAttrOfSplit = + AttributePoint2DPtr aFirstPointAttrOfSplit = getPointOfRefAttr(data()->attribute(SketchPlugin_Constraint::ENTITY_A())); - AttributePoint2DPtr aSecondPointAttrOfSplit = + AttributePoint2DPtr aSecondPointAttrOfSplit = getPointOfRefAttr(data()->attribute(SketchPlugin_Constraint::ENTITY_B())); AttributePoint2DPtr aStartPointAttrOfBase, anEndPointAttrOfBase; getFeaturePoints(aStartPointAttrOfBase, anEndPointAttrOfBase); @@ -898,13 +898,13 @@ void SketchPlugin_ConstraintSplit::splitArc(FeaturePtr& theSplitFeature, aFirstPointAttrOfSplit, aSecondPointAttrOfSplit); #ifdef DEBUG_SPLIT std::cout << "Arranged points (to build split between 1st and 2nd points:" << std::endl; - std::cout << "Start point: " << + std::cout << "Start point: " << ModelGeomAlgo_Point2D::getPointAttributeInfo(aStartPointAttrOfBase) << std::endl; - std::cout << "1st point: " << + std::cout << "1st point: " << ModelGeomAlgo_Point2D::getPointAttributeInfo(aFirstPointAttrOfSplit) << std::endl; - std::cout << "2nd point: " << + std::cout << "2nd point: " << ModelGeomAlgo_Point2D::getPointAttributeInfo(aSecondPointAttrOfSplit) << std::endl; - std::cout << "End point: " << + std::cout << "End point: " << ModelGeomAlgo_Point2D::getPointAttributeInfo(anEndPointAttrOfBase) << std::endl; #endif @@ -1022,19 +1022,19 @@ void SketchPlugin_ConstraintSplit::splitCircle(FeaturePtr& theSplitFeature, if (aFeatureKind != SketchPlugin_Circle::ID()) return; - AttributePoint2DPtr aFirstPointAttrOfSplit = + AttributePoint2DPtr aFirstPointAttrOfSplit = getPointOfRefAttr(data()->attribute(SketchPlugin_Constraint::ENTITY_A())); - AttributePoint2DPtr aSecondPointAttrOfSplit = + AttributePoint2DPtr aSecondPointAttrOfSplit = getPointOfRefAttr(data()->attribute(SketchPlugin_Constraint::ENTITY_B())); /// split feature - theSplitFeature = + theSplitFeature = createArcFeature(aBaseFeature, aFirstPointAttrOfSplit, aSecondPointAttrOfSplit); bool aSplitReversed = std::dynamic_pointer_cast(theSplitFeature)->isReversed(); theCreatedFeatures.insert(theSplitFeature); /// base feature is a left part of the circle - theBaseFeatureModified = createArcFeature(aBaseFeature, + theBaseFeatureModified = createArcFeature(aBaseFeature, aFirstPointAttrOfSplit, aSecondPointAttrOfSplit); std::dynamic_pointer_cast( theBaseFeatureModified)->setReversed(!aSplitReversed); @@ -1168,7 +1168,7 @@ FeaturePtr SketchPlugin_ConstraintSplit::createArcFeature(const FeaturePtr& theB return aFeature; aFeature = aSketch->addFeature(SketchPlugin_Arc::ID()); - // update fillet arc: make the arc correct for sure, so, it is not needed to process + // update fillet arc: make the arc correct for sure, so, it is not needed to process // the "attribute updated" // by arc; moreover, it may cause cyclicity in hte mechanism of updater aFeature->data()->blockSendAttributeUpdated(true); @@ -1300,7 +1300,7 @@ std::string SketchPlugin_ConstraintSplit::getFeatureInfo( std::string aPointsInfo = ModelGeomAlgo_Point2D::getPontAttributesInfo(theFeature, getEdgeAttributes(theFeature)); /// processing of feature with point 2d attributes, like line, arc, circle - if (!aPointsInfo.empty()) { + if (!aPointsInfo.empty()) { anInfo += ": "; anInfo += "\n"; anInfo += aPointsInfo; diff --git a/src/SketchPlugin/SketchPlugin_ConstraintSplit.h b/src/SketchPlugin/SketchPlugin_ConstraintSplit.h index 1af0db8f7..95cb9a932 100755 --- a/src/SketchPlugin/SketchPlugin_ConstraintSplit.h +++ b/src/SketchPlugin/SketchPlugin_ConstraintSplit.h @@ -115,7 +115,7 @@ private: std::map, IdToPointPair>& theCoincidenceToPoint*/); /// Obtains references to feature point attributes and to feature, - /// e.g. for feature line: 1st container is + /// e.g. for feature line: 1st container is /// <1st line point, list > /// <2nd line point, list<> > /// for feature circle 2nd container is @@ -162,7 +162,7 @@ private: /// \param theAfterFeature a feature between last point of split feature and the end point /// \param thePoints a list of points where coincidences will be build /// \param theCreatedFeatures a container of created features - /// \param theModifiedAttributes a container of attribute on base + /// \param theModifiedAttributes a container of attribute on base /// feature to attribute on new feature void splitLine(std::shared_ptr& theSplitFeature, std::shared_ptr& theBeforeFeature, diff --git a/src/SketchPlugin/SketchPlugin_ExternalValidator.cpp b/src/SketchPlugin/SketchPlugin_ExternalValidator.cpp index a9d232da6..e1fb5b510 100644 --- a/src/SketchPlugin/SketchPlugin_ExternalValidator.cpp +++ b/src/SketchPlugin/SketchPlugin_ExternalValidator.cpp @@ -40,7 +40,7 @@ bool SketchPlugin_ExternalValidator::isValid(const AttributePtr& theAttribute, bool SketchPlugin_ExternalValidator::isExternalAttribute(const AttributePtr& theAttribute) const { bool isExternal = false; - AttributeRefAttrPtr anAttribute = + AttributeRefAttrPtr anAttribute = std::dynamic_pointer_cast(theAttribute); if (anAttribute.get() != NULL) { diff --git a/src/SketchPlugin/SketchPlugin_ExternalValidator.h b/src/SketchPlugin/SketchPlugin_ExternalValidator.h index 4d4eaf073..f18f0746f 100644 --- a/src/SketchPlugin/SketchPlugin_ExternalValidator.h +++ b/src/SketchPlugin/SketchPlugin_ExternalValidator.h @@ -19,7 +19,7 @@ class SketchPlugin_ExternalValidator : public ModelAPI_AttributeValidator { public: - /// returns true if the feature of attribute do not contain external features + /// returns true if the feature of attribute do not contain external features /// in the given attribute and /// among attributes listed in the arguments /// \param theAttribute an attribute to check diff --git a/src/SketchPlugin/SketchPlugin_Feature.cpp b/src/SketchPlugin/SketchPlugin_Feature.cpp index 436cc5e7b..66d11700d 100644 --- a/src/SketchPlugin/SketchPlugin_Feature.cpp +++ b/src/SketchPlugin/SketchPlugin_Feature.cpp @@ -29,7 +29,7 @@ SketchPlugin_Sketch* SketchPlugin_Feature::sketch() const std::set& aBackRefs = data()->refsToMe(); std::set::const_iterator aBackRef = aBackRefs.begin(); for(; aBackRef != aBackRefs.end(); aBackRef++) { - std::shared_ptr aSketch = + std::shared_ptr aSketch = std::dynamic_pointer_cast((*aBackRef)->owner()); if (aSketch) { mySketch = aSketch.get(); diff --git a/src/SketchPlugin/SketchPlugin_IntersectionPoint.cpp b/src/SketchPlugin/SketchPlugin_IntersectionPoint.cpp index d32b9a4c6..a71c02499 100644 --- a/src/SketchPlugin/SketchPlugin_IntersectionPoint.cpp +++ b/src/SketchPlugin/SketchPlugin_IntersectionPoint.cpp @@ -58,7 +58,7 @@ void SketchPlugin_IntersectionPoint::computePoint() std::shared_ptr anEdge; if(aLineAttr && aLineAttr->value() && aLineAttr->value()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(aLineAttr->value())); - } else if(aLineAttr->context() && aLineAttr->context()->shape() && + } else if(aLineAttr->context() && aLineAttr->context()->shape() && aLineAttr->context()->shape()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(aLineAttr->context()->shape())); } @@ -72,7 +72,7 @@ void SketchPlugin_IntersectionPoint::computePoint() if (!anIntersection) return; - std::shared_ptr aCoordAttr = + std::shared_ptr aCoordAttr = std::dynamic_pointer_cast(attribute(COORD_ID())); aCoordAttr->setValue(sketch()->to2D(anIntersection)); } diff --git a/src/SketchPlugin/SketchPlugin_Line.cpp b/src/SketchPlugin/SketchPlugin_Line.cpp index 782f99a24..553d1f2e0 100644 --- a/src/SketchPlugin/SketchPlugin_Line.cpp +++ b/src/SketchPlugin/SketchPlugin_Line.cpp @@ -90,9 +90,9 @@ double SketchPlugin_Line::distanceToPoint(const std::shared_ptr& double aDelta = 0; std::shared_ptr aData = data(); - std::shared_ptr aPoint1 = + std::shared_ptr aPoint1 = std::dynamic_pointer_cast(aData->attribute(START_ID())); - std::shared_ptr aPoint2 = + std::shared_ptr aPoint2 = std::dynamic_pointer_cast(aData->attribute(END_ID())); GeomAPI_Lin2d aLin2d(aPoint1->x(), aPoint1->y(), aPoint2->x(), aPoint2->y()); @@ -132,10 +132,10 @@ void SketchPlugin_Line::attributeChanged(const std::string& theID) { // update arguments due to the selection value if (aSelection && !aSelection->isNull() && aSelection->isEdge()) { std::shared_ptr anEdge( new GeomAPI_Edge(aSelection)); - std::shared_ptr aStartAttr = + std::shared_ptr aStartAttr = std::dynamic_pointer_cast(attribute(START_ID())); aStartAttr->setValue(sketch()->to2D(anEdge->firstPoint())); - std::shared_ptr anEndAttr = + std::shared_ptr anEndAttr = std::dynamic_pointer_cast(attribute(END_ID())); anEndAttr->setValue(sketch()->to2D(anEdge->lastPoint())); updateLenghtValue(); diff --git a/src/SketchPlugin/SketchPlugin_MultiRotation.cpp b/src/SketchPlugin/SketchPlugin_MultiRotation.cpp index f208204bb..cb9b55d1b 100755 --- a/src/SketchPlugin/SketchPlugin_MultiRotation.cpp +++ b/src/SketchPlugin/SketchPlugin_MultiRotation.cpp @@ -114,7 +114,7 @@ void SketchPlugin_MultiRotation::execute() if (!(*aUsedIter)) { aRefListOfShapes->remove(*anInitIter); aRefListOfRotated->remove(*aTargetIter++); - for (int i = 0; i < aCurrentNbCopies && aTargetIter != aTargetList.end(); + for (int i = 0; i < aCurrentNbCopies && aTargetIter != aTargetList.end(); i++, aTargetIter++) { aRefListOfRotated->remove(*aTargetIter); // remove the corresponding feature from the sketch @@ -240,7 +240,7 @@ void SketchPlugin_MultiRotation::erase() if(aRes.get()) { FeaturePtr aFeature = aRes->document()->feature(aRes); if(aFeature.get()) { - AttributeBooleanPtr aBooleanAttr = + AttributeBooleanPtr aBooleanAttr = aFeature->boolean(SketchPlugin_SketchEntity::COPY_ID()); if(aBooleanAttr.get()) { if (ModelAPI_Session::get()->isOperation()) // if this is not undo or redo @@ -264,7 +264,7 @@ ObjectPtr SketchPlugin_MultiRotation::copyFeature(ObjectPtr theObject) if (!aFeature || !aResult) return ObjectPtr(); - FeaturePtr aNewFeature = + FeaturePtr aNewFeature = SketchPlugin_Sketch::addUniqueNamedCopiedFeature(aFeature, sketch(), true); aNewFeature->execute(); diff --git a/src/SketchPlugin/SketchPlugin_MultiTranslation.cpp b/src/SketchPlugin/SketchPlugin_MultiTranslation.cpp index b08545435..1c4086acd 100755 --- a/src/SketchPlugin/SketchPlugin_MultiTranslation.cpp +++ b/src/SketchPlugin/SketchPlugin_MultiTranslation.cpp @@ -71,7 +71,7 @@ void SketchPlugin_MultiTranslation::execute() if (!aStart || !aEnd) return; - std::shared_ptr + std::shared_ptr aShiftVec(new GeomAPI_XY(aEnd->x() - aStart->x(), aEnd->y() - aStart->y())); // Wait all objects being created, then send update events @@ -113,7 +113,7 @@ void SketchPlugin_MultiTranslation::execute() if (!(*aUsedIter)) { aRefListOfShapes->remove(*anInitIter); aRefListOfTranslated->remove(*aTargetIter++); - for (int i = 0; i < aCurrentNbCopies && aTargetIter != aTargetList.end(); + for (int i = 0; i < aCurrentNbCopies && aTargetIter != aTargetList.end(); i++, aTargetIter++) { aRefListOfTranslated->remove(*aTargetIter); // remove the corresponding feature from the sketch @@ -226,7 +226,7 @@ void SketchPlugin_MultiTranslation::erase() if(aRes.get()) { FeaturePtr aFeature = aRes->document()->feature(aRes); if(aFeature.get()) { - AttributeBooleanPtr aBooleanAttr = + AttributeBooleanPtr aBooleanAttr = aFeature->boolean(SketchPlugin_SketchEntity::COPY_ID()); if(aBooleanAttr.get()) { if (ModelAPI_Session::get()->isOperation()) // if this is not undo or redo @@ -250,7 +250,7 @@ ObjectPtr SketchPlugin_MultiTranslation::copyFeature(ObjectPtr theObject) if (!aFeature || !aResult) return ObjectPtr(); - FeaturePtr aNewFeature = + FeaturePtr aNewFeature = SketchPlugin_Sketch::addUniqueNamedCopiedFeature(aFeature, sketch(), true); aNewFeature->execute(); diff --git a/src/SketchPlugin/SketchPlugin_Plugin.cpp b/src/SketchPlugin/SketchPlugin_Plugin.cpp index f446375fa..e69e107b3 100644 --- a/src/SketchPlugin/SketchPlugin_Plugin.cpp +++ b/src/SketchPlugin/SketchPlugin_Plugin.cpp @@ -58,7 +58,7 @@ SketchPlugin_Plugin::SketchPlugin_Plugin() SessionPtr aMgr = ModelAPI_Session::get(); ModelAPI_ValidatorsFactory* aFactory = aMgr->validators(); aFactory->registerValidator("SketchPlugin_DistanceAttr", - new SketchPlugin_DistanceAttrValidator); + new SketchPlugin_DistanceAttrValidator); aFactory->registerValidator("SketchPlugin_ExternalValidator", new SketchPlugin_ExternalValidator); aFactory->registerValidator("SketchPlugin_TangentAttr", @@ -90,20 +90,20 @@ SketchPlugin_Plugin::SketchPlugin_Plugin() // register this plugin ModelAPI_Session::get()->registerPlugin(this); - - Config_PropManager::registerProp("Visualization", "sketch_entity_color", + + Config_PropManager::registerProp("Visualization", "sketch_entity_color", "Sketch entity color", Config_Prop::Color, SKETCH_ENTITY_COLOR); - Config_PropManager::registerProp("Visualization", "sketch_external_color", + Config_PropManager::registerProp("Visualization", "sketch_external_color", "Sketch external entity color", Config_Prop::Color, SKETCH_EXTERNAL_COLOR); - Config_PropManager::registerProp("Visualization", "sketch_auxiliary_color", + Config_PropManager::registerProp("Visualization", "sketch_auxiliary_color", "Sketch auxiliary entity color", Config_Prop::Color, SKETCH_AUXILIARY_COLOR); - Config_PropManager::registerProp("Visualization", "sketch_dimension_color", + Config_PropManager::registerProp("Visualization", "sketch_dimension_color", "Sketch dimension color", Config_Prop::Color, SKETCH_DIMENSION_COLOR); diff --git a/src/SketchPlugin/SketchPlugin_Point.cpp b/src/SketchPlugin/SketchPlugin_Point.cpp index 4ee1f8984..94027d674 100644 --- a/src/SketchPlugin/SketchPlugin_Point.cpp +++ b/src/SketchPlugin/SketchPlugin_Point.cpp @@ -78,7 +78,7 @@ void SketchPlugin_Point::attributeChanged(const std::string& theID) { // update arguments due to the selection value if (aSelection && !aSelection->isNull() && aSelection->isVertex()) { std::shared_ptr aVertex(new GeomAPI_Vertex(aSelection)); - std::shared_ptr aCoordAttr = + std::shared_ptr aCoordAttr = std::dynamic_pointer_cast(attribute(COORD_ID())); aCoordAttr->setValue(sketch()->to2D(aVertex->point())); } diff --git a/src/SketchPlugin/SketchPlugin_Projection.cpp b/src/SketchPlugin/SketchPlugin_Projection.cpp index 795cfe4fb..a39d90d7c 100644 --- a/src/SketchPlugin/SketchPlugin_Projection.cpp +++ b/src/SketchPlugin/SketchPlugin_Projection.cpp @@ -94,7 +94,7 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID) std::shared_ptr anEdge; if (aExtFeature && aExtFeature->value() && aExtFeature->value()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(aExtFeature->value())); - } else if (aExtFeature->context() && aExtFeature->context()->shape() && + } else if (aExtFeature->context() && aExtFeature->context()->shape() && aExtFeature->context()->shape()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(aExtFeature->context()->shape())); } @@ -162,7 +162,7 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID) aProjection = sketch()->addFeature(SketchPlugin_Circle::ID()); // update attributes of projection - std::shared_ptr aCenterPnt = + std::shared_ptr aCenterPnt = std::dynamic_pointer_cast( aProjection->attribute(SketchPlugin_Circle::CENTER_ID())); aCenterPnt->setValue(aCenterInSketch); @@ -182,13 +182,13 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID) aProjection = sketch()->addFeature(SketchPlugin_Arc::ID()); // update attributes of projection - std::shared_ptr aCenterPnt = + std::shared_ptr aCenterPnt = std::dynamic_pointer_cast( aProjection->attribute(SketchPlugin_Arc::CENTER_ID())); - std::shared_ptr aStartPnt = + std::shared_ptr aStartPnt = std::dynamic_pointer_cast( aProjection->attribute(SketchPlugin_Arc::START_ID())); - std::shared_ptr aEndPnt = + std::shared_ptr aEndPnt = std::dynamic_pointer_cast( aProjection->attribute(SketchPlugin_Arc::END_ID())); aStartPnt->setValue(aFirstInSketch); diff --git a/src/SketchPlugin/SketchPlugin_Sketch.cpp b/src/SketchPlugin/SketchPlugin_Sketch.cpp index 83f974248..ca6011196 100755 --- a/src/SketchPlugin/SketchPlugin_Sketch.cpp +++ b/src/SketchPlugin/SketchPlugin_Sketch.cpp @@ -52,7 +52,7 @@ void SketchPlugin_Sketch::initAttributes() data()->addAttribute(SketchPlugin_Sketch::NORM_ID(), GeomDataAPI_Dir::typeId()); data()->addAttribute(SketchPlugin_Sketch::FEATURES_ID(), ModelAPI_AttributeRefList::typeId()); // the selected face, base for the sketcher plane, not obligatory - data()->addAttribute(SketchPlugin_SketchEntity::EXTERNAL_ID(), + data()->addAttribute(SketchPlugin_SketchEntity::EXTERNAL_ID(), ModelAPI_AttributeSelection::typeId()); ModelAPI_Session::get()->validators()->registerNotObligatory( getKind(), SketchPlugin_SketchEntity::EXTERNAL_ID()); @@ -149,7 +149,7 @@ void SketchPlugin_Sketch::removeFeature(std::shared_ptr theFea if (!data()->isValid()) // sketch is already removed (case on undo of sketch), sync is not needed return; AttributeRefListPtr aList = reflist(SketchPlugin_Sketch::FEATURES_ID()); - // if the object is last, remove it from the list + // if the object is last, remove it from the list // (needed to skip empty transaction on edit of sketch feature) if (aList->object(aList->size(true) - 1, true) == theFeature) { aList->remove(theFeature); @@ -187,7 +187,7 @@ int SketchPlugin_Sketch::subFeatureId(const int theIndex) const int aResultIndex = 1; // number of the counted (created) features, started from 1 int aFeatureIndex = -1; // number of the not-empty features in the list for (; anIt != aFeatures.end(); anIt++) { - if (anIt->get()) + if (anIt->get()) aFeatureIndex++; if (aFeatureIndex == theIndex) break; @@ -214,7 +214,7 @@ bool SketchPlugin_Sketch::isSub(ObjectPtr theObject) const void SketchPlugin_Sketch::attributeChanged(const std::string& theID) { if (theID == SketchPlugin_SketchEntity::EXTERNAL_ID()) { - std::shared_ptr aSelection = + std::shared_ptr aSelection = data()->selection(SketchPlugin_SketchEntity::EXTERNAL_ID())->value(); if (aSelection) { // update arguments due to the selection value // update the sketch plane @@ -232,7 +232,7 @@ void SketchPlugin_Sketch::attributeChanged(const std::string& theID) { std::shared_ptr anOrigPnt(new GeomAPI_Pnt(aCoords)); // X axis is preferable to be dirX on the sketch // here can not be very small value to avoid very close to X normal axis (issue 595) - static const double tol = 0.1; + static const double tol = 0.1; bool isX = fabs(anA) - 1.0 < tol && fabs(aB) < tol && fabs(aC) < tol; std::shared_ptr aTempDir( isX ? new GeomAPI_Dir(0, 1, 0) : new GeomAPI_Dir(1, 0, 0)); diff --git a/src/SketchPlugin/SketchPlugin_Sketch.h b/src/SketchPlugin/SketchPlugin_Sketch.h index 1c4e9b5d2..2666bb807 100644 --- a/src/SketchPlugin/SketchPlugin_Sketch.h +++ b/src/SketchPlugin/SketchPlugin_Sketch.h @@ -113,7 +113,7 @@ class SketchPlugin_Sketch : public ModelAPI_CompositeFeature, public GeomAPI_ICu return std::shared_ptr(new GeomAPI_Pnt(aSum)); } - + /// Returns the point projected into the sketch plane /// \param thePnt a source 3d point std::shared_ptr to2D(const std::shared_ptr& thePnt) const @@ -186,7 +186,7 @@ class SketchPlugin_Sketch : public ModelAPI_CompositeFeature, public GeomAPI_ICu SKETCHPLUGIN_EXPORT virtual int numberOfSubs(bool forTree = false) const; /// Returns the sub-feature by zero-base index - SKETCHPLUGIN_EXPORT virtual std::shared_ptr + SKETCHPLUGIN_EXPORT virtual std::shared_ptr subFeature(const int theIndex, bool forTree = false); /// Returns the sub-feature unique identifier in this composite feature by index @@ -213,7 +213,7 @@ class SketchPlugin_Sketch : public ModelAPI_CompositeFeature, public GeomAPI_ICu static void createPoint2DResult(ModelAPI_Feature* theFeature, SketchPlugin_Sketch* theSketch, const std::string& theAttributeID, const int theIndex); - + /// Add new feature and fill the data of the feature by the data of the parameter feature. /// The name of the created feature stays unique. /// \param theFeature a source feature @@ -236,9 +236,9 @@ class SketchPlugin_Sketch : public ModelAPI_CompositeFeature, public GeomAPI_ICu // apply the color of the result to the presentation if (theDefaultPrs.get()) isCustomized = theDefaultPrs->customisePresentation(theResult, thePrs, theDefaultPrs); - // set the sketch presentation bold + // set the sketch presentation bold isCustomized = thePrs->setWidth(2) || isCustomized; - + return isCustomized; } diff --git a/src/SketchPlugin/SketchPlugin_SketchEntity.cpp b/src/SketchPlugin/SketchPlugin_SketchEntity.cpp index 1a37de2cf..2ec1f2dad 100644 --- a/src/SketchPlugin/SketchPlugin_SketchEntity.cpp +++ b/src/SketchPlugin/SketchPlugin_SketchEntity.cpp @@ -16,9 +16,9 @@ void SketchPlugin_SketchEntity::initAttributes() initDerivedClassAttributes(); - AttributePtr anAttr = data()->addAttribute(SketchPlugin_SketchEntity::COPY_ID(), + AttributePtr anAttr = data()->addAttribute(SketchPlugin_SketchEntity::COPY_ID(), ModelAPI_AttributeBoolean::typeId()); anAttr->setIsArgument(false); - ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), SketchPlugin_SketchEntity::COPY_ID()); } diff --git a/src/SketchPlugin/SketchPlugin_SketchEntity.h b/src/SketchPlugin/SketchPlugin_SketchEntity.h index 6888eef83..dd7c0d36e 100644 --- a/src/SketchPlugin/SketchPlugin_SketchEntity.h +++ b/src/SketchPlugin/SketchPlugin_SketchEntity.h @@ -122,7 +122,7 @@ class SketchPlugin_SketchEntity : public SketchPlugin_Feature, public GeomAPI_IC bool isCustomized = theDefaultPrs.get() != NULL && theDefaultPrs->customisePresentation(theResult, thePrs, theDefaultPrs); int aShapeType = thePrs->getShapeType(); - // a compound is processed like the edge because the + // a compound is processed like the edge because the // arc feature uses the compound for presentable AIS if (aShapeType != 6/*an edge*/ && aShapeType != 7/*a vertex*/ && aShapeType != 0/*compound*/) return false; diff --git a/src/SketchPlugin/SketchPlugin_Tools.cpp b/src/SketchPlugin/SketchPlugin_Tools.cpp index 9b332fc96..bbe296981 100644 --- a/src/SketchPlugin/SketchPlugin_Tools.cpp +++ b/src/SketchPlugin/SketchPlugin_Tools.cpp @@ -33,17 +33,17 @@ void clearExpressions(AttributePoint2DPtr theAttribute) void clearExpressions(AttributePtr theAttribute) { // Double - AttributeDoublePtr anAttributeDouble = + AttributeDoublePtr anAttributeDouble = std::dynamic_pointer_cast(theAttribute); if (anAttributeDouble.get()) clearExpressions(anAttributeDouble); // Point - AttributePointPtr anAttributePoint = + AttributePointPtr anAttributePoint = std::dynamic_pointer_cast(theAttribute); if (anAttributePoint.get()) clearExpressions(anAttributePoint); // Point2D - AttributePoint2DPtr anAttributePoint2D = + AttributePoint2DPtr anAttributePoint2D = std::dynamic_pointer_cast(theAttribute); if (anAttributePoint2D.get()) clearExpressions(anAttributePoint2D); @@ -54,7 +54,7 @@ void clearExpressions(FeaturePtr theFeature) if (!theFeature.get()) return; - std::list anAttributes = theFeature->data()->attributes(std::string()); + std::list anAttributes = theFeature->data()->attributes(std::string()); std::list::iterator anAttributeIt = anAttributes.begin(); for (; anAttributeIt != anAttributes.end(); ++anAttributeIt) { clearExpressions(*anAttributeIt); @@ -63,7 +63,7 @@ void clearExpressions(FeaturePtr theFeature) std::shared_ptr getCoincidencePoint(const FeaturePtr theStartCoin) { - std::shared_ptr aPnt = SketcherPrs_Tools::getPoint(theStartCoin.get(), + std::shared_ptr aPnt = SketcherPrs_Tools::getPoint(theStartCoin.get(), SketchPlugin_Constraint::ENTITY_A()); if (aPnt.get() == NULL) aPnt = SketcherPrs_Tools::getPoint(theStartCoin.get(), SketchPlugin_Constraint::ENTITY_B()); diff --git a/src/SketchPlugin/SketchPlugin_Tools.h b/src/SketchPlugin/SketchPlugin_Tools.h index 32dfbb129..61cf44acf 100644 --- a/src/SketchPlugin/SketchPlugin_Tools.h +++ b/src/SketchPlugin/SketchPlugin_Tools.h @@ -14,7 +14,7 @@ namespace SketchPlugin_Tools { -/// Clears text expressions for all attributes of the feature +/// Clears text expressions for all attributes of the feature void clearExpressions(FeaturePtr theFeature); /// \return coincidence point diff --git a/src/SketchPlugin/SketchPlugin_Validators.cpp b/src/SketchPlugin/SketchPlugin_Validators.cpp index dc46d01c4..98c9ee9fc 100755 --- a/src/SketchPlugin/SketchPlugin_Validators.cpp +++ b/src/SketchPlugin/SketchPlugin_Validators.cpp @@ -48,7 +48,7 @@ const double tolerance = 1.e-7; -bool SketchPlugin_DistanceAttrValidator::isValid(const AttributePtr& theAttribute, +bool SketchPlugin_DistanceAttrValidator::isValid(const AttributePtr& theAttribute, const std::list& theArguments, Events_InfoMessage& theError) const { @@ -72,7 +72,7 @@ bool SketchPlugin_DistanceAttrValidator::isValid(const AttributePtr& theAttribut // 1. check whether the references object is a linear ObjectPtr anObject = aRefAttr->object(); - const ModelAPI_AttributeValidator* aShapeValidator = + const ModelAPI_AttributeValidator* aShapeValidator = dynamic_cast( aFactory->validator("GeomValidators_ShapeType")); std::list anArguments; @@ -84,7 +84,7 @@ bool SketchPlugin_DistanceAttrValidator::isValid(const AttributePtr& theAttribut theError = "Circle can not be used in distance constraint"; return false; } - + anArguments.clear(); anArguments.push_back("line"); Events_InfoMessage aLineError; @@ -123,7 +123,7 @@ static bool isCoincident(FeaturePtr theFeature1, FeaturePtr theFeature2) for(std::set::const_iterator aRefIt = aRefsList.begin(); aRefIt != aRefsList.end(); ++aRefIt) { - // Find constraint + // Find constraint FeaturePtr aRefFeature = std::dynamic_pointer_cast((*aRefIt)->owner()); if(aRefFeature->getKind() != SketchPlugin_ConstraintCoincidence::ID()) continue; @@ -159,7 +159,7 @@ static bool hasCoincidentPoint(FeaturePtr theFeature1, FeaturePtr theFeature2) return (isCoincident(theFeature1, theFeature2) && isCoincident(theFeature2, theFeature1)); } -bool SketchPlugin_TangentAttrValidator::isValid(const AttributePtr& theAttribute, +bool SketchPlugin_TangentAttrValidator::isValid(const AttributePtr& theAttribute, const std::list& theArguments, Events_InfoMessage& theError) const { @@ -174,9 +174,9 @@ bool SketchPlugin_TangentAttrValidator::isValid(const AttributePtr& theAttribute SessionPtr aMgr = ModelAPI_Session::get(); ModelAPI_ValidatorsFactory* aFactory = aMgr->validators(); - FeaturePtr anAttributeFeature = + FeaturePtr anAttributeFeature = std::dynamic_pointer_cast(theAttribute->owner()); - AttributeRefAttrPtr aRefAttr = + AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast(theAttribute); bool isObject = aRefAttr->isObject(); @@ -282,7 +282,7 @@ bool SketchPlugin_NotFixedValidator::isValid(const AttributePtr& theAttribute, return true; } -bool SketchPlugin_EqualAttrValidator::isValid(const AttributePtr& theAttribute, +bool SketchPlugin_EqualAttrValidator::isValid(const AttributePtr& theAttribute, const std::list& theArguments, Events_InfoMessage& theError) const { @@ -339,7 +339,7 @@ bool SketchPlugin_EqualAttrValidator::isValid(const AttributePtr& theAttribute, return true; } -bool SketchPlugin_MirrorAttrValidator::isValid(const AttributePtr& theAttribute, +bool SketchPlugin_MirrorAttrValidator::isValid(const AttributePtr& theAttribute, const std::list& theArguments, Events_InfoMessage& theError) const { @@ -370,7 +370,7 @@ bool SketchPlugin_MirrorAttrValidator::isValid(const AttributePtr& theAttribute, return true; } -bool SketchPlugin_CoincidenceAttrValidator::isValid(const AttributePtr& theAttribute, +bool SketchPlugin_CoincidenceAttrValidator::isValid(const AttributePtr& theAttribute, const std::list& theArguments, Events_InfoMessage& theError) const { @@ -393,7 +393,7 @@ bool SketchPlugin_CoincidenceAttrValidator::isValid(const AttributePtr& theAttri return false; } - AttributeRefAttrPtr aRefAttrB = + AttributeRefAttrPtr aRefAttrB = std::dynamic_pointer_cast(theAttribute); // first attribute is a point, it may coincide with any object @@ -435,7 +435,7 @@ bool SketchPlugin_CoincidenceAttrValidator::isValid(const AttributePtr& theAttri } -bool SketchPlugin_CopyValidator::isValid(const AttributePtr& theAttribute, +bool SketchPlugin_CopyValidator::isValid(const AttributePtr& theAttribute, const std::list& theArguments, Events_InfoMessage& theError) const { @@ -446,7 +446,7 @@ bool SketchPlugin_CopyValidator::isValid(const AttributePtr& theAttribute, } FeaturePtr aFeature = std::dynamic_pointer_cast(theAttribute->owner()); - AttributeRefListPtr aSelAttr = + AttributeRefListPtr aSelAttr = std::dynamic_pointer_cast(theAttribute); AttributeRefListPtr aRefListOfInitial = std::dynamic_pointer_cast( @@ -492,16 +492,16 @@ bool SketchPlugin_SolverErrorValidator::isValid( return true; } -bool SketchPlugin_SolverErrorValidator::isNotObligatory(std::string theFeature, +bool SketchPlugin_SolverErrorValidator::isNotObligatory(std::string theFeature, std::string theAttribute) { return true; } -static bool hasSameTangentFeature(const std::set& theRefsList, +static bool hasSameTangentFeature(const std::set& theRefsList, const FeaturePtr theFeature) { - for(std::set::const_iterator + for(std::set::const_iterator anIt = theRefsList.cbegin(); anIt != theRefsList.cend(); ++anIt) { std::shared_ptr aAttr = (*anIt); FeaturePtr aFeature = std::dynamic_pointer_cast(aAttr->owner()); @@ -543,19 +543,19 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut const std::list& theArguments, Events_InfoMessage& theError) const { - std::shared_ptr aFilletFeature = + std::shared_ptr aFilletFeature = std::dynamic_pointer_cast(theAttribute->owner()); - AttributeRefAttrListPtr aPointsRefList = + AttributeRefAttrListPtr aPointsRefList = std::dynamic_pointer_cast(theAttribute); if(aPointsRefList->size() == 0) { theError = "Error: List of points is empty."; return false; } - std::map aPointsFeaturesMap = + std::map aPointsFeaturesMap = aFilletFeature->pointsFeaturesMap(); std::set aSetOfPointsOnResultEdges; - for(std::map::iterator + for(std::map::iterator aPointsIter = aPointsFeaturesMap.begin(); aPointsIter != aPointsFeaturesMap.end(); ++aPointsIter) { @@ -576,13 +576,13 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut } std::list> aPointsList = aPointsRefList->list(); - for(std::list>::const_iterator + for(std::list>::const_iterator aPointsIt = aPointsList.cbegin(); aPointsIt != aPointsList.cend(); aPointsIt++) { ObjectPtr anObject = (*aPointsIt).first; AttributePtr aPointAttribute = (*aPointsIt).second; if (!aPointAttribute.get()) return false; - std::shared_ptr aSelectedPnt = + std::shared_ptr aSelectedPnt = std::dynamic_pointer_cast(aPointAttribute)->pnt(); // If we alredy have some result then: @@ -602,7 +602,7 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut // Obtain constraint coincidence for the fillet point. const std::set& aRefsList = aPointAttribute->owner()->data()->refsToMe(); FeaturePtr aConstraintCoincidence; - for(std::set::const_iterator anIt = aRefsList.cbegin(); + for(std::set::const_iterator anIt = aRefsList.cbegin(); anIt != aRefsList.cend(); ++anIt) { std::shared_ptr aAttr = (*anIt); FeaturePtr aConstrFeature = std::dynamic_pointer_cast(aAttr->owner()); @@ -644,7 +644,7 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut // Remove points from set of coincides. std::set aNewSetOfCoincides; - for(std::set::iterator anIt = aCoinsides.begin(); + for(std::set::iterator anIt = aCoinsides.begin(); anIt != aCoinsides.end(); ++anIt) { if((*anIt)->getKind() != SketchPlugin_Line::ID() && (*anIt)->getKind() != SketchPlugin_Arc::ID()) { @@ -652,7 +652,7 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut } if((*anIt)->getKind() == SketchPlugin_Arc::ID()) { AttributePtr anArcCenter = (*anIt)->attribute(SketchPlugin_Arc::CENTER_ID()); - std::shared_ptr anArcCenterPnt = + std::shared_ptr anArcCenterPnt = std::dynamic_pointer_cast(anArcCenter)->pnt(); double aDistSelectedArcCenter = aSelectedPnt->distance(anArcCenterPnt); if(aDistSelectedArcCenter < tolerance) { @@ -666,7 +666,7 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut // If we still have more than two coincides remove auxilary entities from set of coincides. if(aCoinsides.size() > 2) { aNewSetOfCoincides.clear(); - for(std::set::iterator anIt = aCoinsides.begin(); + for(std::set::iterator anIt = aCoinsides.begin(); anIt != aCoinsides.end(); ++anIt) { if(!(*anIt)->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value()) { aNewSetOfCoincides.insert(*anIt); @@ -691,7 +691,7 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut } std::list aFirstResults = aFirstFeature->results(); - for(std::list::iterator aResIt = aFirstResults.begin(); + for(std::list::iterator aResIt = aFirstResults.begin(); aResIt != aFirstResults.end(); ++aResIt) { ResultPtr aRes = *aResIt; const std::set& aResRefsList = aRes->data()->refsToMe(); @@ -702,28 +702,28 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut } // Check that lines not collinear - if(aFirstFeature->getKind() == SketchPlugin_Line::ID() && + if(aFirstFeature->getKind() == SketchPlugin_Line::ID() && aSecondFeature->getKind() == SketchPlugin_Line::ID()) { std::string aStartAttr = SketchPlugin_Line::START_ID(); std::string anEndAttr = SketchPlugin_Line::END_ID(); std::shared_ptr aFirstStartPnt, aFirstEndPnt, aSecondStartPnt, aSecondEndPnt; - aFirstStartPnt = + aFirstStartPnt = std::dynamic_pointer_cast( aFirstFeature->attribute(aStartAttr))->pnt(); - aFirstEndPnt = + aFirstEndPnt = std::dynamic_pointer_cast(aFirstFeature->attribute(anEndAttr))->pnt(); aSecondStartPnt = std::dynamic_pointer_cast( aSecondFeature->attribute(aStartAttr))->pnt(); - aSecondEndPnt = + aSecondEndPnt = std::dynamic_pointer_cast( aSecondFeature->attribute(anEndAttr))->pnt(); - double aCheck1 = - fabs((aFirstEndPnt->x() - aFirstStartPnt->x()) * + double aCheck1 = + fabs((aFirstEndPnt->x() - aFirstStartPnt->x()) * (aSecondStartPnt->y() - aFirstStartPnt->y()) - (aSecondStartPnt->x() - aFirstStartPnt->x()) * (aFirstEndPnt->y() - aFirstStartPnt->y())); - double aCheck2 = - fabs((aFirstEndPnt->x() - aFirstStartPnt->x()) * + double aCheck2 = + fabs((aFirstEndPnt->x() - aFirstStartPnt->x()) * (aSecondEndPnt->y() - aFirstStartPnt->y()) - (aSecondEndPnt->x() - aFirstStartPnt->x()) * (aFirstEndPnt->y() - aFirstStartPnt->y())); if(aCheck1 < 1.e-7 && aCheck2 < 1.e-7) { @@ -735,7 +735,7 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut return true; } -bool SketchPlugin_MiddlePointAttrValidator::isValid(const AttributePtr& theAttribute, +bool SketchPlugin_MiddlePointAttrValidator::isValid(const AttributePtr& theAttribute, const std::list& theArguments, Events_InfoMessage& theError) const { @@ -750,7 +750,7 @@ bool SketchPlugin_MiddlePointAttrValidator::isValid(const AttributePtr& theAttri SessionPtr aMgr = ModelAPI_Session::get(); ModelAPI_ValidatorsFactory* aFactory = aMgr->validators(); - FeaturePtr anAttributeFeature = + FeaturePtr anAttributeFeature = std::dynamic_pointer_cast(theAttribute->owner()); AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast(theAttribute); AttributeRefAttrPtr anOtherAttr = anAttributeFeature->data()->refattr(aParamA); @@ -856,7 +856,7 @@ bool SketchPlugin_IntersectionValidator::isValid(const AttributePtr& theAttribut std::shared_ptr anEdge; if(aLineAttr && aLineAttr->value() && aLineAttr->value()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(aLineAttr->value())); - } else if(aLineAttr->context() && + } else if(aLineAttr->context() && aLineAttr->context()->shape() && aLineAttr->context()->shape()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(aLineAttr->context()->shape())); } @@ -922,7 +922,7 @@ bool SketchPlugin_SplitValidator::isValid(const AttributePtr& theAttribute, // coincidences to the feature std::set > aRefAttributes; - ModelGeomAlgo_Point2D::getPointsOfReference(anAttrFeature, + ModelGeomAlgo_Point2D::getPointsOfReference(anAttrFeature, SketchPlugin_ConstraintCoincidence::ID(), aRefAttributes, SketchPlugin_Point::ID(), SketchPlugin_Point::COORD_ID()); @@ -930,7 +930,7 @@ bool SketchPlugin_SplitValidator::isValid(const AttributePtr& theAttribute, std::shared_ptr aSFeature = std::dynamic_pointer_cast(anAttrFeature); SketchPlugin_Sketch* aSketch = aSFeature->sketch(); - + std::shared_ptr aData = aSketch->data(); std::shared_ptr aC = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Sketch::ORIGIN_ID())); @@ -939,9 +939,9 @@ bool SketchPlugin_SplitValidator::isValid(const AttributePtr& theAttribute, std::shared_ptr aNorm = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Sketch::NORM_ID())); std::shared_ptr aDirY(new GeomAPI_Dir(aNorm->dir()->cross(aX->dir()))); - + std::list > aPoints; - std::map, std::shared_ptr > + std::map, std::shared_ptr > aPointToAttributes; ModelGeomAlgo_Point2D::getPointsInsideShape(anAttrShape, aRefAttributes, aC->pnt(), aX->dir(), aDirY, aPoints, aPointToAttributes); diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp index dd044ca69..c708e7028 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp @@ -68,12 +68,12 @@ static EntityWrapperPtr createArc(FeaturePtr theFeature, static ConstraintWrapperPtr - createConstraintCoincidence(ConstraintPtr theConstraint, + createConstraintCoincidence(ConstraintPtr theConstraint, const GroupID& theGroupID, std::shared_ptr thePoint1, std::shared_ptr thePoint2); static ConstraintWrapperPtr - createConstraintPointOnEntity(ConstraintPtr theConstraint, + createConstraintPointOnEntity(ConstraintPtr theConstraint, const GroupID& theGroupID, const SketchSolver_ConstraintType& theType, std::shared_ptr thePoint, @@ -334,7 +334,7 @@ std::list PlaneGCSSolver_Builder::createMirror( if (!aPoint2 && theEntity2->type() == ENTITY_POINT) aPoint2 = GCS_POINT_WRAPPER( GCS_ENTITY_WRAPPER(theEntity2)->subEntities().front() ); - std::shared_ptr aMirrorLine = + std::shared_ptr aMirrorLine = std::dynamic_pointer_cast(theMirrorLine); std::shared_ptr aLine = std::dynamic_pointer_cast(aMirrorLine->entity()); @@ -387,7 +387,7 @@ std::list PlaneGCSSolver_Builder::createMirror( aResult.insert(aResult.end(), aMrrList.begin(), aMrrList.end()); } else if (theEntity1->type() == ENTITY_ARC) { - // Do not allow mirrored arc recalculate its position until + // Do not allow mirrored arc recalculate its position until // coordinated of all points recalculated FeaturePtr aMirrArc = theEntity2->baseFeature(); aMirrArc->data()->blockSendAttributeUpdated(true); @@ -404,7 +404,7 @@ std::list PlaneGCSSolver_Builder::createMirror( aMrrList = createMirror(theConstraint, theGroupID, theSketchID, *anIt1, *anIt2, theMirrorLine); aResult.insert(aResult.end(), aMrrList.begin(), aMrrList.end()); - // make symmetric last point of original arc and first point of + // make symmetric last point of original arc and first point of // mirrored arc without additional constraint ++anIt1; --anIt2; @@ -415,9 +415,9 @@ std::list PlaneGCSSolver_Builder::createMirror( 0.0, EntityWrapperPtr(), EntityWrapperPtr(), theEntity1, theEntity2); aResult.insert(aResult.end(), aMrrList.begin(), aMrrList.end()); // ... and make parametric length of arcs the same - std::shared_ptr anArcEnt1 = + std::shared_ptr anArcEnt1 = std::dynamic_pointer_cast(theEntity1); - std::shared_ptr anArcEnt2 = + std::shared_ptr anArcEnt2 = std::dynamic_pointer_cast(theEntity2); std::shared_ptr anArc1 = std::dynamic_pointer_cast(anArcEnt1->entity()); std::shared_ptr anArc2 = std::dynamic_pointer_cast(anArcEnt2->entity()); @@ -622,7 +622,7 @@ std::shared_ptr createScalar( const GroupID& theGroupID, AttributeDoublePtr theDoubleAttr) { - ParameterWrapperPtr aParam = + ParameterWrapperPtr aParam = createParameter(theGroupID, theDoubleAttr ? theDoubleAttr->value() : 0.0); return std::shared_ptr( new PlaneGCSSolver_ScalarWrapper(theDoubleAttr, aParam)); @@ -643,7 +643,7 @@ EntityWrapperPtr createLine(FeaturePtr theFeature, std::shared_ptr aStartEnt, aEndEnt; std::list::const_iterator anIt = theAttributes.begin(); for (; anIt != theAttributes.end(); ++anIt) { - std::shared_ptr aWrapper = + std::shared_ptr aWrapper = std::dynamic_pointer_cast(*anIt); if (!aWrapper) continue; @@ -664,7 +664,7 @@ EntityWrapperPtr createLine(FeaturePtr theFeature, aNewEntity = EntityWrapperPtr(new PlaneGCSSolver_EntityWrapper(theFeature, aLine)); // sub-entities should not change their groups, therefore they are added later - aNewEntity->setGroup(theGroupID); + aNewEntity->setGroup(theGroupID); aNewEntity->setSubEntities(aSubs); return aNewEntity; } @@ -702,7 +702,7 @@ EntityWrapperPtr createCircle(FeaturePtr theFeature, aNewEntity = EntityWrapperPtr(new PlaneGCSSolver_EntityWrapper(theFeature, aCircle)); // sub-entities should not change their groups, therefore they are added later - aNewEntity->setGroup(theGroupID); + aNewEntity->setGroup(theGroupID); aNewEntity->setSubEntities(aSubs); return aNewEntity; } @@ -723,7 +723,7 @@ EntityWrapperPtr createArc(FeaturePtr theFeature, std::shared_ptr aCenterEnt, aStartEnt, aEndEnt; std::list::const_iterator anIt = theAttributes.begin(); for (; anIt != theAttributes.end(); ++anIt) { - std::shared_ptr aWrapper = + std::shared_ptr aWrapper = std::dynamic_pointer_cast(*anIt); if (!aWrapper) continue; @@ -759,7 +759,7 @@ EntityWrapperPtr createArc(FeaturePtr theFeature, aNewEntity = EntityWrapperPtr(new PlaneGCSSolver_EntityWrapper(theFeature, anArc)); // sub-entities should not change their groups, therefore they are added later - aNewEntity->setGroup(theGroupID); + aNewEntity->setGroup(theGroupID); aNewEntity->setSubEntities(aSubs); return aNewEntity; } @@ -797,7 +797,7 @@ ConstraintWrapperPtr createConstraintCoincidence( } ConstraintWrapperPtr createConstraintPointOnEntity( - ConstraintPtr theConstraint, + ConstraintPtr theConstraint, const GroupID& theGroupID, const SketchSolver_ConstraintType& theType, std::shared_ptr thePoint, @@ -813,7 +813,7 @@ ConstraintWrapperPtr createConstraintPointOnEntity( } case ENTITY_ARC: case ENTITY_CIRCLE: { - std::shared_ptr aCirc = + std::shared_ptr aCirc = std::dynamic_pointer_cast(theEntity->entity()); aNewConstr = GCSConstraintPtr( new GCS::ConstraintP2PDistance(*(thePoint->point()), aCirc->center, aCirc->rad)); @@ -939,7 +939,7 @@ ConstraintWrapperPtr createConstraintRadius( std::shared_ptr theValue, std::shared_ptr theEntity) { - std::shared_ptr aCircle = + std::shared_ptr aCircle = std::dynamic_pointer_cast(theEntity->entity()); GCSConstraintPtr aNewConstr(new GCS::ConstraintEqual(aCircle->rad, theValue->parameter())); @@ -1120,17 +1120,17 @@ ConstraintWrapperPtr createConstraintTangent( { GCSConstraintPtr aNewConstr; if (theType == CONSTRAINT_TANGENT_ARC_LINE || theType == CONSTRAINT_TANGENT_CIRCLE_LINE) { - std::shared_ptr aCirc = + std::shared_ptr aCirc = std::dynamic_pointer_cast(theEntity1->entity()); - std::shared_ptr aLine = + std::shared_ptr aLine = std::dynamic_pointer_cast(theEntity2->entity()); - aNewConstr = + aNewConstr = GCSConstraintPtr(new GCS::ConstraintP2LDistance(aCirc->center, *aLine, aCirc->rad)); } else { - std::shared_ptr aCirc1 = + std::shared_ptr aCirc1 = std::dynamic_pointer_cast(theEntity1->entity()); - std::shared_ptr aCirc2 = + std::shared_ptr aCirc2 = std::dynamic_pointer_cast(theEntity2->entity()); double aDX = *(aCirc1->center.x) - *(aCirc2->center.x); @@ -1174,10 +1174,10 @@ void makeMirrorPoints(EntityWrapperPtr theOriginal, (*aMIt)->setValue(aCoord[i]); // update corresponding attribute - AttributePtr anAttr = + AttributePtr anAttr = std::dynamic_pointer_cast(theMirrored)->baseAttribute(); if (anAttr) { - std::shared_ptr aMirroredPnt = + std::shared_ptr aMirroredPnt = std::dynamic_pointer_cast(anAttr); aMirroredPnt->setValue(aCoord[0], aCoord[1]); } @@ -1222,7 +1222,7 @@ void adjustMirror(ConstraintWrapperPtr theConstraint) makeMirrorPoints(aPoints[0], aPoints[1], aMirrorLine); // update scales of constraints - std::shared_ptr aGCSConstraint = + std::shared_ptr aGCSConstraint = std::dynamic_pointer_cast(theConstraint); std::list::const_iterator aCIt = aGCSConstraint->constraints().begin(); for (; aCIt != aGCSConstraint->constraints().end(); ++aCIt) diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.h b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.h index 5f59b6a25..ea9042a6f 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.h +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.h @@ -40,7 +40,7 @@ public: /// \param theGroupID [in] group the constraint belongs to /// \param theSketchID [in] sketch the constraint belongs to /// \param theType [in] type of constraint - /// \param theValue [in] numeric characteristic of constraint + /// \param theValue [in] numeric characteristic of constraint /// (e.g. distance or radius) if applicable /// \param theEntity1 [in] first attribute of constraint /// \param theEntity2 [in] second attribute of constraint @@ -65,9 +65,9 @@ public: /// \param theGroupID [in] group the constraint belongs to /// \param theSketchID [in] sketch the constraint belongs to /// \param theType [in] type of constraint - /// \param theValue [in] numeric characteristic of constraint (angle for multi-rotation) + /// \param theValue [in] numeric characteristic of constraint (angle for multi-rotation) /// if applicable - /// \param theFullValue [in] indicates theValue shows full translation delta/rotation + /// \param theFullValue [in] indicates theValue shows full translation delta/rotation /// angle or delta/angle between neighbor entities /// \param thePoint1 [in] center for multi-rotation or start point for multi-translation /// \param thePoint2 [in] end point for multi-translation (empty for multi-rotation) diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityWrapper.h b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityWrapper.h index 976299a60..5fb99ddb4 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityWrapper.h +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityWrapper.h @@ -16,7 +16,7 @@ class PlaneGCSSolver_EntityWrapper : public SketchSolver_IEntityWrapper { public: - PlaneGCSSolver_EntityWrapper(const FeaturePtr theFeature, + PlaneGCSSolver_EntityWrapper(const FeaturePtr theFeature, const GCSCurvePtr theEntity = GCSCurvePtr()); /// \brief Return PlaneGCS geometric entity diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp index 7522367f6..9a67936ff 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp @@ -91,7 +91,7 @@ SketchSolver_SolveStatus PlaneGCSSolver_Solver::solve() GCS::VEC_I aRedundantID; - // Workaround: the system with tangent constraint + // Workaround: the system with tangent constraint // may fail if the tangent entities are connected smoothly. // Investigate this situation and move constraints to redundant list if (aResult == GCS::Failed && !myTangent.empty()) { @@ -128,7 +128,7 @@ SketchSolver_SolveStatus PlaneGCSSolver_Solver::solve() } } } - // The system with tangent constraints may show redundant constraints + // The system with tangent constraints may show redundant constraints // if the entities are coupled smoothly. // Sometimes tangent constraints are fall to both conflicting and redundant constraints. // Need to check if there are redundant constraints without these tangencies. diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.h b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.h index b9016ceca..525af68ad 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.h +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.h @@ -81,13 +81,13 @@ private: GCS::VEC_pD myParameters; ///< list of unknowns /// list of constraints already processed by the system - ConstraintMap myConstraints; + ConstraintMap myConstraints; std::shared_ptr myEquationSystem; ///< set of equations for solving in FreeGCS GCS::SET_I myConflictingIDs; ///< list of IDs of conflicting constraints /// specifies the conflicting constraints are already collected - bool myConfCollected; + bool myConfCollected; /// list of tangent IDs to check incorrect redundant constraints GCS::SET_I myTangent; diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp index 586f693cc..90e25c458 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp @@ -391,7 +391,7 @@ void PlaneGCSSolver_Storage::processArc(const EntityWrapperPtr& theArc) std::list::const_iterator aSubIt = aSubs.begin(); while ((*aSubIt)->type() == ENTITY_POINT) // search scalar entities ++aSubIt; - double* aStartAngle = + double* aStartAngle = std::dynamic_pointer_cast(*aSubIt++)->scalar(); double* aEndAngle = std::dynamic_pointer_cast(*aSubIt++)->scalar(); @@ -576,7 +576,7 @@ bool PlaneGCSSolver_Storage::isRedundant( std::list >::iterator aCoincIt, aFound1, aFound2; aFound1 = aFound2 = theCoincidentPoints.end(); - for (aCoincIt = theCoincidentPoints.begin(); + for (aCoincIt = theCoincidentPoints.begin(); aCoincIt != theCoincidentPoints.end(); ++aCoincIt) { if (aFound1 == theCoincidentPoints.end() && aCoincIt->find(aParams[0]) != aCoincIt->end()) aFound1 = aCoincIt; @@ -663,7 +663,7 @@ bool isExternalAttribute(const AttributePtr& theAttribute) { if (!theAttribute) return false; - std::shared_ptr aSketchFeature = + std::shared_ptr aSketchFeature = std::dynamic_pointer_cast(theAttribute->owner()); return aSketchFeature.get() && aSketchFeature->isExternal(); } @@ -676,7 +676,7 @@ void PlaneGCSSolver_Storage::refresh(bool theFixedOnly) const std::list aParams; std::list::const_iterator aParIt; for (; anIt != myAttributeMap.end(); ++anIt) { - // the external feature always should keep the up to date values, so, + // the external feature always should keep the up to date values, so, // refresh from the solver is never needed bool isExternal = isExternalAttribute(anIt->first); @@ -784,9 +784,9 @@ EntityWrapperPtr PlaneGCSSolver_Storage::calculateMiddlePoint( theX = anArcPoint[0][0] + anArcPoint[2][0]; theY = anArcPoint[0][1] + anArcPoint[2][1]; } else { - std::shared_ptr + std::shared_ptr aStartDir(new GeomAPI_Dir2d(anArcPoint[1][0], anArcPoint[1][1])); - std::shared_ptr + std::shared_ptr aEndDir(new GeomAPI_Dir2d(anArcPoint[2][0], anArcPoint[2][1])); double anAngle = aStartDir->angle(aEndDir); if (anAngle < 0) @@ -808,9 +808,9 @@ EntityWrapperPtr PlaneGCSSolver_Storage::calculateMiddlePoint( aParameters.push_back(aBuilder->createParameter(myGroupID, aMidPoint->y())); // Create entity (parameters are not filled) GCSPointPtr aPnt(new GCS::Point); - aPnt->x = + aPnt->x = std::dynamic_pointer_cast(aParameters.front())->parameter(); - aPnt->y = + aPnt->y = std::dynamic_pointer_cast(aParameters.back())->parameter(); EntityWrapperPtr aResult(new PlaneGCSSolver_PointWrapper(AttributePtr(), aPnt)); diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.h b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.h index 882cffa12..ccf318aef 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.h +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.h @@ -119,10 +119,10 @@ private: /// additional constraints for correct processing of the arcs std::map > - myArcConstraintMap; + myArcConstraintMap; /// list of removed constraints to notify solver - std::list myRemovedConstraints; + std::list myRemovedConstraints; }; #endif diff --git a/src/SketchSolver/SketchSolver_Builder.cpp b/src/SketchSolver/SketchSolver_Builder.cpp index 7cb7425fe..718ea18ca 100644 --- a/src/SketchSolver/SketchSolver_Builder.cpp +++ b/src/SketchSolver/SketchSolver_Builder.cpp @@ -61,7 +61,7 @@ SolverConstraintPtr SketchSolver_Builder::createConstraint(ConstraintPtr theCons ResultConstructionPtr aRC = std::dynamic_pointer_cast(aRefAttr->object()); if (!aRC) - Events_InfoMessage("SketchSolver_Builder", + Events_InfoMessage("SketchSolver_Builder", SketchSolver_Error::NEED_OBJECT_NOT_FEATURE(), this).send(); } continue; @@ -74,7 +74,7 @@ SolverConstraintPtr SketchSolver_Builder::createConstraint(ConstraintPtr theCons ResultConstructionPtr aRC = std::dynamic_pointer_cast(*aListIter); if (*aListIter && !aRC) - Events_InfoMessage("SketchSolver_Builder", + Events_InfoMessage("SketchSolver_Builder", SketchSolver_Error::NEED_OBJECT_NOT_FEATURE(), this).send(); } } diff --git a/src/SketchSolver/SketchSolver_Builder.h b/src/SketchSolver/SketchSolver_Builder.h index f7775ea91..a2d67beb8 100644 --- a/src/SketchSolver/SketchSolver_Builder.h +++ b/src/SketchSolver/SketchSolver_Builder.h @@ -43,7 +43,7 @@ public: /// \param theGroupID [in] group the constraint belongs to /// \param theSketchID [in] sketch the constraint belongs to /// \param theType [in] type of constraint - /// \param theValue [in] numeric characteristic of constraint + /// \param theValue [in] numeric characteristic of constraint /// (e.g. distance or radius) if applicable /// \param theEntity1 [in] first attribute of constraint /// \param theEntity2 [in] second attribute of constraint @@ -68,9 +68,9 @@ public: /// \param theGroupID [in] group the constraint belongs to /// \param theSketchID [in] sketch the constraint belongs to /// \param theType [in] type of constraint - /// \param theValue [in] numeric characteristic of constraint (angle for multi-rotation) + /// \param theValue [in] numeric characteristic of constraint (angle for multi-rotation) /// if applicable - /// \param theFullValue [in] indicates theValue shows full translation delta/rotation angle or + /// \param theFullValue [in] indicates theValue shows full translation delta/rotation angle or /// delta/angle between neighbor entities /// \param thePoint1 [in] center for multi-rotation or start point for multi-translation /// \param thePoint2 [in] end point for multi-translation (empty for multi-rotation) @@ -119,7 +119,7 @@ public: /// \brief Check if two connected arcs have centers /// in same direction relatively to connection point - SKETCHSOLVER_EXPORT virtual bool isArcArcTangencyInternal(EntityWrapperPtr theArc1, + SKETCHSOLVER_EXPORT virtual bool isArcArcTangencyInternal(EntityWrapperPtr theArc1, EntityWrapperPtr theArc2) const { return false; } }; diff --git a/src/SketchSolver/SketchSolver_Constraint.cpp b/src/SketchSolver/SketchSolver_Constraint.cpp index 13396b8cf..bbf00518a 100644 --- a/src/SketchSolver/SketchSolver_Constraint.cpp +++ b/src/SketchSolver/SketchSolver_Constraint.cpp @@ -258,7 +258,7 @@ bool SketchSolver_Constraint::isUsed(FeaturePtr theFeature) const if ((*aCIt)->isUsed(theFeature)) return true; - std::list anAttrList = + std::list anAttrList = theFeature->data()->attributes(GeomDataAPI_Point2D::typeId()); std::list::const_iterator anAttrIt = anAttrList.begin(); for (; anAttrIt != anAttrList.end(); ++ anAttrIt) diff --git a/src/SketchSolver/SketchSolver_Constraint.h b/src/SketchSolver/SketchSolver_Constraint.h index 2b4a30b0d..69513749c 100644 --- a/src/SketchSolver/SketchSolver_Constraint.h +++ b/src/SketchSolver/SketchSolver_Constraint.h @@ -47,7 +47,7 @@ public: SKETCHSOLVER_EXPORT virtual void update(); /// \brief Tries to remove constraint - /// \return \c false, if current constraint contains another SketchPlugin constraints + /// \return \c false, if current constraint contains another SketchPlugin constraints /// (like for multiple coincidence) SKETCHSOLVER_EXPORT virtual bool remove(); @@ -68,7 +68,7 @@ public: virtual bool isUsed(AttributePtr theAttribute) const; /// \brief Notify constraint, that coincidence appears or removed - virtual void notifyCoincidenceChanged(EntityWrapperPtr theCoincAttr1, + virtual void notifyCoincidenceChanged(EntityWrapperPtr theCoincAttr1, EntityWrapperPtr theCoincAttr2) { /* implement in derived class */ } /// \brief Shows error message @@ -99,7 +99,7 @@ protected: ConstraintPtr myBaseConstraint; ///< base SketchPlugin constraint /// storage, which contains all information about entities and constraints - StoragePtr myStorage; + StoragePtr myStorage; SketchSolver_ConstraintType myType; ///< type of constraint std::list myAttributes; ///< attributes of constraint diff --git a/src/SketchSolver/SketchSolver_ConstraintCollinear.h b/src/SketchSolver/SketchSolver_ConstraintCollinear.h index 6e06053ae..5d6187eb4 100644 --- a/src/SketchSolver/SketchSolver_ConstraintCollinear.h +++ b/src/SketchSolver/SketchSolver_ConstraintCollinear.h @@ -22,7 +22,7 @@ public: virtual ~SketchSolver_ConstraintCollinear() {} /// \brief Notify constraint, that coincidence appears or removed - virtual void notifyCoincidenceChanged(EntityWrapperPtr theCoincAttr1, + virtual void notifyCoincidenceChanged(EntityWrapperPtr theCoincAttr1, EntityWrapperPtr theCoincAttr2); }; diff --git a/src/SketchSolver/SketchSolver_ConstraintDistance.h b/src/SketchSolver/SketchSolver_ConstraintDistance.h index 9448b3c5d..80a6fb5e3 100644 --- a/src/SketchSolver/SketchSolver_ConstraintDistance.h +++ b/src/SketchSolver/SketchSolver_ConstraintDistance.h @@ -40,7 +40,7 @@ private: double myPrevValue; ///< previous value of distance (for correct calculation of a distance sign) /// \c true, if the point if placed rightside of line direction (SLVS_C_PT_LINE_DISTANCE only) - bool myIsNegative; + bool myIsNegative; }; #endif diff --git a/src/SketchSolver/SketchSolver_ConstraintFixed.h b/src/SketchSolver/SketchSolver_ConstraintFixed.h index 57f2d50d8..fd56f87d9 100644 --- a/src/SketchSolver/SketchSolver_ConstraintFixed.h +++ b/src/SketchSolver/SketchSolver_ConstraintFixed.h @@ -29,7 +29,7 @@ public: SketchSolver_ConstraintFixed(FeaturePtr theFeature); /// \brief Tries to remove constraint - /// \return \c false, if current constraint contains another + /// \return \c false, if current constraint contains another /// SketchPlugin constraints (like for multiple coincidence) virtual bool remove(); @@ -40,7 +40,7 @@ protected: /// \brief Generate list of attributes of constraint in order useful for constraints /// \param[out] theValue numerical characteristic of constraint (e.g. distance) /// \param[out] theAttributes list of attributes to be filled - virtual void getAttributes(ParameterWrapperPtr& theValue, + virtual void getAttributes(ParameterWrapperPtr& theValue, std::vector& theAttributes); /// \brief Fixed feature basing on its type diff --git a/src/SketchSolver/SketchSolver_ConstraintFixedArcRadius.h b/src/SketchSolver/SketchSolver_ConstraintFixedArcRadius.h index 70f6e8295..6bb3e67bf 100644 --- a/src/SketchSolver/SketchSolver_ConstraintFixedArcRadius.h +++ b/src/SketchSolver/SketchSolver_ConstraintFixedArcRadius.h @@ -21,7 +21,7 @@ public: SketchSolver_ConstraintFixedArcRadius(FeaturePtr theFeature); /// \brief Tries to remove constraint - /// \return \c false, if current constraint contains another SketchPlugin constraints + /// \return \c false, if current constraint contains another SketchPlugin constraints /// (like for multiple coincidence) virtual bool remove(); diff --git a/src/SketchSolver/SketchSolver_ConstraintLength.cpp b/src/SketchSolver/SketchSolver_ConstraintLength.cpp index 714fe0cce..be89bb53d 100644 --- a/src/SketchSolver/SketchSolver_ConstraintLength.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintLength.cpp @@ -9,7 +9,7 @@ void SketchSolver_ConstraintLength::getAttributes( std::vector& theAttributes) { SketchSolver_Constraint::getAttributes(theValue, theAttributes); - if (!myErrorMsg.empty() || !theAttributes[2] || + if (!myErrorMsg.empty() || !theAttributes[2] || theAttributes[2]->type() != ENTITY_LINE) { theAttributes.clear(); return; diff --git a/src/SketchSolver/SketchSolver_ConstraintMiddle.h b/src/SketchSolver/SketchSolver_ConstraintMiddle.h index 6ab5400fb..bc0053b20 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMiddle.h +++ b/src/SketchSolver/SketchSolver_ConstraintMiddle.h @@ -22,7 +22,7 @@ public: virtual ~SketchSolver_ConstraintMiddle() {} /// \brief Notify constraint, that coincidence appears or removed - virtual void notifyCoincidenceChanged(EntityWrapperPtr theCoincAttr1, + virtual void notifyCoincidenceChanged(EntityWrapperPtr theCoincAttr1, EntityWrapperPtr theCoincAttr2); }; diff --git a/src/SketchSolver/SketchSolver_ConstraintMovement.cpp b/src/SketchSolver/SketchSolver_ConstraintMovement.cpp index 110741c56..916b8d551 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMovement.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMovement.cpp @@ -52,7 +52,7 @@ static std::list movedEntities( std::list aMovedSubs = movedEntities( *anOldIt, theOldStorage, *aNewIt, theNewStorage); // check only the points to be moved (because arcs in PlaneGCS have scalar subs too) - if ((*anOldIt)->type() == ENTITY_POINT && + if ((*anOldIt)->type() == ENTITY_POINT && (aMovedSubs.size() != 1 || aMovedSubs.front() != *anOldIt)) isFullyMoved = false; aMoved.insert(aMoved.end(), aMovedSubs.begin(), aMovedSubs.end()); diff --git a/src/SketchSolver/SketchSolver_ConstraintMovement.h b/src/SketchSolver/SketchSolver_ConstraintMovement.h index 484b7bb56..63211fa4f 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMovement.h +++ b/src/SketchSolver/SketchSolver_ConstraintMovement.h @@ -29,7 +29,7 @@ public: {} /// \brief Tries to remove constraint - /// \return \c false, if current constraint contains another SketchPlugin + /// \return \c false, if current constraint contains another SketchPlugin /// constraints (like for multiple coincidence) virtual bool remove(); @@ -39,9 +39,9 @@ protected: /// \brief Generate list of attributes of constraint in order useful for SolveSpace constraints /// \param[out] theValue numerical characteristic of constraint (e.g. distance) - /// \param[out] theAttributes list of attributes to be filled + /// \param[out] theAttributes list of attributes to be filled /// (list of moved entities or attributes) - virtual void getAttributes(ParameterWrapperPtr& theValue, + virtual void getAttributes(ParameterWrapperPtr& theValue, std::vector& theAttributes); private: diff --git a/src/SketchSolver/SketchSolver_ConstraintMulti.cpp b/src/SketchSolver/SketchSolver_ConstraintMulti.cpp index bd0a82ad3..dbc5b6c89 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMulti.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMulti.cpp @@ -38,7 +38,7 @@ void SketchSolver_ConstraintMulti::getEntities(std::list& theE std::list anObjectList = aRefList->list(); std::list::iterator anObjIt = anObjectList.begin(); // execute for the feature is not called yet - if ((myNumberOfCopies + 1) * myNumberOfObjects != aRefList->size()) + if ((myNumberOfCopies + 1) * myNumberOfObjects != aRefList->size()) myNumberOfCopies = aRefList->size() / myNumberOfObjects - 1; while (anObjIt != anObjectList.end()) { @@ -47,7 +47,7 @@ void SketchSolver_ConstraintMulti::getEntities(std::list& theE continue; // the entity is not created, so it is a copy in "multi" constraint, force its creation - if (!myStorage->update(aFeature)) + if (!myStorage->update(aFeature)) myStorage->update(aFeature, myGroupID, true); theEntities.push_back(myStorage->entity(aFeature)); myFeatures.insert(aFeature); @@ -79,7 +79,7 @@ void SketchSolver_ConstraintMulti::update(bool isForce) AttributeIntegerPtr aNbObjects = myBaseConstraint->integer(nameNbObjects()); if (!anInitialRefList || !aNbObjects) return; // the "Multi" constraint is in queue to remove - bool isUpdated = + bool isUpdated = anInitialRefList->size() != myNumberOfObjects || aNbObjects->value()-1 != myNumberOfCopies; if (!isUpdated) { // additional check that the features and their copies are changed diff --git a/src/SketchSolver/SketchSolver_ConstraintMulti.h b/src/SketchSolver/SketchSolver_ConstraintMulti.h index 820d47821..7a9edc96e 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMulti.h +++ b/src/SketchSolver/SketchSolver_ConstraintMulti.h @@ -34,7 +34,7 @@ public: void update(bool isForce); /// \brief Tries to remove constraint - /// \return \c false, if current constraint contains another SketchPlugin + /// \return \c false, if current constraint contains another SketchPlugin /// constraints (like for multiple coincidence) virtual bool remove(); @@ -65,7 +65,7 @@ protected: /// \brief Returns name of NUMBER_OF_COPIES parameter for corresponding feature virtual const std::string& nameNbObjects() = 0; - + protected: /// \brief Convert absolute coordinates to relative coordinates virtual void getRelative(double theAbsX, double theAbsY, double& theRelX, double& theRelY) = 0; @@ -82,7 +82,7 @@ protected: bool myAdjusted; ///< the constraint is already adjusted (to not do it several times) /// list of features and their copies to find whether some of them are disappeared - std::set myFeatures; + std::set myFeatures; }; #endif diff --git a/src/SketchSolver/SketchSolver_ConstraintMultiRotation.cpp b/src/SketchSolver/SketchSolver_ConstraintMultiRotation.cpp index 524b29a14..910bdaf4f 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMultiRotation.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMultiRotation.cpp @@ -57,7 +57,7 @@ void SketchSolver_ConstraintMultiRotation::process() for (; anEntIt != aBaseEntities.end(); ++anEntIt) { std::list aNewConstraints = aBuilder->createConstraint(myBaseConstraint, myGroupID, mySketchID, myType, - myAngle, isFullValue, aRotationCenter, EntityWrapperPtr(), + myAngle, isFullValue, aRotationCenter, EntityWrapperPtr(), std::list(1, *anEntIt)); aRotConstraints.insert(aRotConstraints.end(), aNewConstraints.begin(), aNewConstraints.end()); } diff --git a/src/SketchSolver/SketchSolver_ConstraintMultiTranslation.cpp b/src/SketchSolver/SketchSolver_ConstraintMultiTranslation.cpp index 32f55074a..4f1741e76 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMultiTranslation.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMultiTranslation.cpp @@ -62,7 +62,7 @@ void SketchSolver_ConstraintMultiTranslation::process() std::list aNewConstraints = aBuilder->createConstraint(myBaseConstraint, myGroupID, mySketchID, myType, 0.0, aFullValue, aStartPoint, aEndPoint, std::list(1, *anEntIt)); - aTransConstraints.insert(aTransConstraints.end(), + aTransConstraints.insert(aTransConstraints.end(), aNewConstraints.begin(), aNewConstraints.end()); } @@ -114,7 +114,7 @@ void SketchSolver_ConstraintMultiTranslation::updateLocal() aSLast = aConstraintEntities.end(); EntityWrapperPtr aStartEntity = *aSIt++; if (aStartPointChanged) { - AttributePtr aStartPointAttr = + AttributePtr aStartPointAttr = aData->attribute(SketchPlugin_MultiTranslation::START_POINT_ID()); myStorage->update(aStartPointAttr); aStartEntity = myStorage->entity(aStartPointAttr); @@ -123,7 +123,7 @@ void SketchSolver_ConstraintMultiTranslation::updateLocal() EntityWrapperPtr anEndEntity = *aSIt++; if (anEndPointChanged) { - AttributePtr anEndPointAttr = + AttributePtr anEndPointAttr = aData->attribute(SketchPlugin_MultiTranslation::END_POINT_ID()); myStorage->update(anEndPointAttr); anEndEntity = myStorage->entity(anEndPointAttr); diff --git a/src/SketchSolver/SketchSolver_ConstraintTangent.cpp b/src/SketchSolver/SketchSolver_ConstraintTangent.cpp index 1a257a530..690587ae2 100644 --- a/src/SketchSolver/SketchSolver_ConstraintTangent.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintTangent.cpp @@ -97,7 +97,7 @@ void SketchSolver_ConstraintTangent::getAttributes( return; } - if (myType == CONSTRAINT_TANGENT_ARC_LINE && + if (myType == CONSTRAINT_TANGENT_ARC_LINE && !hasSingleCoincidence(theAttributes[2], theAttributes[3])) myErrorMsg = SketchSolver_Error::TANGENCY_FAILED(); diff --git a/src/SketchSolver/SketchSolver_Error.h b/src/SketchSolver/SketchSolver_Error.h index 8423eb52e..64e080045 100644 --- a/src/SketchSolver/SketchSolver_Error.h +++ b/src/SketchSolver/SketchSolver_Error.h @@ -27,7 +27,7 @@ class SketchSolver_Error /// Constraints should use objects instead of features as attributes inline static const std::string& NEED_OBJECT_NOT_FEATURE() { - static const std::string + static const std::string MY_ERROR_VALUE("Constraint should be based on object instead of feature"); return MY_ERROR_VALUE; } @@ -67,11 +67,11 @@ class SketchSolver_Error static const std::string MY_ERROR_VALUE("Entity already fixed"); return MY_ERROR_VALUE; } - /// Tangency constraint has been built with wrong attributes + /// Tangency constraint has been built with wrong attributes /// (for example, line and arc have two coincident points) inline static const std::string& TANGENCY_FAILED() { - static const std::string + static const std::string MY_ERROR_VALUE("Unable to create tangency constraint on given attributes"); return MY_ERROR_VALUE; } diff --git a/src/SketchSolver/SketchSolver_Group.cpp b/src/SketchSolver/SketchSolver_Group.cpp index 67e0d6ccc..70f5afbb3 100644 --- a/src/SketchSolver/SketchSolver_Group.cpp +++ b/src/SketchSolver/SketchSolver_Group.cpp @@ -389,12 +389,12 @@ bool SketchSolver_Group::resolveConstraints() return false; } // solution succeeded, store results into correspondent attributes - if (aResult == STATUS_OK || aResult == STATUS_EMPTYSET) { + if (aResult == STATUS_OK || aResult == STATUS_EMPTYSET) { myStorage->setNeedToResolve(false); myStorage->refresh(); updateMultiConstraints(myConstraints); // multi-constraints updated some parameters, need to store them - if (myStorage->isNeedToResolve()) + if (myStorage->isNeedToResolve()) resolveConstraints(); if (myPrevResult != STATUS_OK || myPrevResult == STATUS_UNKNOWN) { @@ -411,8 +411,8 @@ bool SketchSolver_Group::resolveConstraints() // the error message should be changed before sending the message getWorkplane()->string(SketchPlugin_Sketch::SOLVER_ERROR()) ->setValue(SketchSolver_Error::CONSTRAINTS()); - if (myPrevResult != aResult || - myPrevResult == STATUS_UNKNOWN || + if (myPrevResult != aResult || + myPrevResult == STATUS_UNKNOWN || myPrevResult == STATUS_FAILED) { // Obtain list of conflicting constraints std::set aConflicting = myStorage->getConflictingConstraints(mySketchSolver); @@ -489,7 +489,7 @@ void SketchSolver_Group::splitGroup(std::list& theCuts) // New storage will be used in trimmed way to store the list of constraint interacted together. StoragePtr aNewStorage = SketchSolver_Manager::instance()->builder()->createStorage(getId()); // empty vector to avoid creation of solver's constraints - std::list aDummyVec; + std::list aDummyVec; // Obtain constraints, which should be separated std::list anUnusedConstraints; @@ -501,7 +501,7 @@ void SketchSolver_Group::splitGroup(std::list& theCuts) anUnusedConstraints.push_back(aCIter->first); } - // Check the unused constraints once again, + // Check the unused constraints once again, // because they may become interacted with new storage since adding constraints std::list::iterator aUnuseIt = anUnusedConstraints.begin(); while (aUnuseIt != anUnusedConstraints.end()) { @@ -684,7 +684,7 @@ static double featureToVal(FeaturePtr theFeature) aConstraint->attribute(SketchPlugin_Constraint::ENTITY_B())); if (anAttrA && anAttrB && (anAttrA->isObject() || anAttrB->isObject())) // point-on-line and point-on-circle should go before points coincidence constraint - return 2.0; + return 2.0; return 2.5; } if (anID == SketchPlugin_ConstraintDistance::ID() || @@ -727,12 +727,12 @@ std::list SketchSolver_Group:: std::set::const_iterator anObjIter = theObjects.begin(); for (; anObjIter != theObjects.end(); ++anObjIter) { // Operate sketch itself and SketchPlugin features only. - // Also, the Fillet and Split need to be skipped, + // Also, the Fillet and Split need to be skipped, // because there are several separated constraints composing it. FeaturePtr aFeature = std::dynamic_pointer_cast(*anObjIter); if (!aFeature) continue; - std::shared_ptr aSketchFeature = + std::shared_ptr aSketchFeature = std::dynamic_pointer_cast(aFeature); if ((aFeature->getKind() != SketchPlugin_Sketch::ID() && !aSketchFeature) || aFeature->getKind() == SketchPlugin_ConstraintFillet::ID() || diff --git a/src/SketchSolver/SketchSolver_Group.h b/src/SketchSolver/SketchSolver_Group.h index 9312c6a5a..193e1d541 100644 --- a/src/SketchSolver/SketchSolver_Group.h +++ b/src/SketchSolver/SketchSolver_Group.h @@ -170,14 +170,14 @@ private: std::set myTempConstraints; ///< List of temporary constraints /// List of parametric constraints - std::map myParametricConstraints; + std::map myParametricConstraints; StoragePtr myStorage; ///< Container for the set of SolveSpace constraints and their entities SolverPtr mySketchSolver; ///< Solver for set of equations obtained by constraints /// Result of previous solution of the set of constraints - SketchSolver_SolveStatus myPrevResult; + SketchSolver_SolveStatus myPrevResult; std::set myConflictingConstraints; ///< List of conflicting constraints }; diff --git a/src/SketchSolver/SketchSolver_Manager.cpp b/src/SketchSolver/SketchSolver_Manager.cpp index 52499a876..80f1f98ef 100644 --- a/src/SketchSolver/SketchSolver_Manager.cpp +++ b/src/SketchSolver/SketchSolver_Manager.cpp @@ -116,7 +116,7 @@ void SketchSolver_Manager::processEvent( const std::shared_ptr& theMessage) { static const Events_ID aSketchPreparedEvent = Events_Loop::eventByName(EVENT_SKETCH_PREPARED); - // sketch is prepared for resolve: all the needed events + // sketch is prepared for resolve: all the needed events // are collected and must be processed by the solver if (theMessage->eventID() == aSketchPreparedEvent) { flushGrouped(anUpdateEvent); @@ -146,7 +146,7 @@ void SketchSolver_Manager::processEvent( if (isMovedEvt) { std::set::iterator aFeatIter; for (aFeatIter = aFeatures.begin(); aFeatIter != aFeatures.end(); aFeatIter++) { - std::shared_ptr aSFeature = + std::shared_ptr aSFeature = std::dynamic_pointer_cast(*aFeatIter); if (aSFeature && moveEntity(aSFeature)) { // Want to avoid recalculation of DoF too frequently. @@ -154,23 +154,23 @@ void SketchSolver_Manager::processEvent( hasProperFeature = true; } } - if (!hasProperFeature) + if (!hasProperFeature) // in this iteration it will compute nothing, so, no problem with recursion // it is important that solver flushes signal updated after processing move signal as there // is optimization that relies on this update, might be found by key "optimization" myIsComputed = false; } else { - std::list aSketchFeatures = + std::list aSketchFeatures = SketchSolver_Group::selectApplicableFeatures(aFeatures); std::list::iterator aFeatIter = aSketchFeatures.begin(); for (; aFeatIter != aSketchFeatures.end(); ++aFeatIter) { if ((*aFeatIter)->getKind() == SketchPlugin_Sketch::ID()) { - std::shared_ptr aSketch = + std::shared_ptr aSketch = std::dynamic_pointer_cast(*aFeatIter); hasProperFeature = changeWorkplane(aSketch) || hasProperFeature; continue; } - std::shared_ptr aFeature = + std::shared_ptr aFeature = std::dynamic_pointer_cast(*aFeatIter); if (!aFeature) continue; @@ -198,7 +198,7 @@ void SketchSolver_Manager::processEvent( std::dynamic_pointer_cast(theMessage); const std::set& aFeatureGroups = aDeleteMsg->groups(); - // Find SketchPlugin_Sketch::ID() in groups. + // Find SketchPlugin_Sketch::ID() in groups. // The constraint groups should be updated when an object removed from Sketch std::set::const_iterator aFGrIter; for (aFGrIter = aFeatureGroups.begin(); aFGrIter != aFeatureGroups.end(); aFGrIter++) @@ -218,7 +218,7 @@ void SketchSolver_Manager::processEvent( myGroups.erase(aRemoveIt); continue; } - if (!(*aGroupIter)->isConsistent()) { + if (!(*aGroupIter)->isConsistent()) { // some constraints were removed, try to split the group (*aGroupIter)->splitGroup(aSeparatedGroups); if (!(*aGroupIter)->getWorkplane()->string( @@ -318,7 +318,7 @@ bool SketchSolver_Manager::changeFeature(std::shared_ptr t std::set aGroups; findGroups(theFeature, aGroups); - std::shared_ptr aConstraint = + std::shared_ptr aConstraint = std::dynamic_pointer_cast(theFeature); // Process the groups list @@ -346,7 +346,7 @@ bool SketchSolver_Manager::changeFeature(std::shared_ptr t return (*aGroupIter)->updateFeature(theFeature); return (*aGroupIter)->changeConstraint(aConstraint); } - } else if (aGroups.size() > 1) { + } else if (aGroups.size() > 1) { // Several groups applicable for this feature => need to merge them std::set::const_iterator aGroupsIter = aGroups.begin(); @@ -497,7 +497,7 @@ std::shared_ptr SketchSolver_Manager bool SketchSolver_Manager::resolveConstraints(const std::list& theGroups) { bool needToUpdate = false; - const std::list& aGroupsToResolve = theGroups.empty() ? + const std::list& aGroupsToResolve = theGroups.empty() ? myGroups : theGroups; std::list::const_iterator aGroupIter = aGroupsToResolve.begin(); for (; aGroupIter != aGroupsToResolve.end(); aGroupIter++) @@ -508,7 +508,7 @@ bool SketchSolver_Manager::resolveConstraints(const std::list >& thePoints) { typedef std::list strlist; @@ -721,7 +721,7 @@ void SketchSolver_Manager::degreesOfFreedom() } else { aDoF -= 1; if (aCoincPoint[0] && aCoincLine) { - // if the point is already coincident to a line + // if the point is already coincident to a line // (by middle point constraint), do not decrease DoF std::map >::iterator aPtFound = aPointOnLine.find(aCoincPoint[0]); @@ -776,7 +776,7 @@ void SketchSolver_Manager::degreesOfFreedom() if (isExternal(anAttr)) continue; // feature is already fixed since it is external aDoF -= aDoFDelta[anAttr->getKind()]; - std::list aPtAttrs = + std::list aPtAttrs = anAttr->data()->attributes(GeomDataAPI_Point2D::typeId()); aPoints.insert(aPtAttrs.begin(), aPtAttrs.end()); } @@ -823,10 +823,10 @@ void SketchSolver_Manager::degreesOfFreedom() anAttrName = SketchPlugin_Constraint::ENTITY_B(); else { if (aFeature->getKind() == SketchPlugin_MultiRotation::ID()) - aNbCopies = + aNbCopies = aFeature->integer(SketchPlugin_MultiRotation::NUMBER_OF_OBJECTS_ID())->value() - 1; else if (aFeature->getKind() == SketchPlugin_MultiTranslation::ID()) - aNbCopies = + aNbCopies = aFeature->integer(SketchPlugin_MultiTranslation::NUMBER_OF_OBJECTS_ID())->value() - 1; anAttrName = SketchPlugin_Constraint::ENTITY_A(); } diff --git a/src/SketchSolver/SketchSolver_Manager.h b/src/SketchSolver/SketchSolver_Manager.h index 5eab8bc9e..c1e853603 100644 --- a/src/SketchSolver/SketchSolver_Manager.h +++ b/src/SketchSolver/SketchSolver_Manager.h @@ -94,7 +94,7 @@ protected: * \return \c true, if groups are resolved, and features should be updated * (send the Update event) */ - bool resolveConstraints(const std::list& theGroups = + bool resolveConstraints(const std::list& theGroups = std::list()); private: diff --git a/src/SketchSolver/SketchSolver_Storage.cpp b/src/SketchSolver/SketchSolver_Storage.cpp index 5af9d5043..91b36b77c 100644 --- a/src/SketchSolver/SketchSolver_Storage.cpp +++ b/src/SketchSolver/SketchSolver_Storage.cpp @@ -138,7 +138,7 @@ void SketchSolver_Storage::addEntity(FeaturePtr theFeature, void SketchSolver_Storage::addEntity(AttributePtr theAttribute, EntityWrapperPtr theSolverEntity) { - std::map::const_iterator aFound = + std::map::const_iterator aFound = myAttributeMap.find(theAttribute); if (aFound == myAttributeMap.end() || !aFound->second || (theSolverEntity && !aFound->second->isEqual(theSolverEntity))) @@ -184,7 +184,7 @@ bool SketchSolver_Storage::update(FeaturePtr theFeature, const GroupID& theGroup bool isUpdated = false; EntityWrapperPtr aRelated = entity(theFeature); if (!aRelated) { // Feature is not exist, create it - std::shared_ptr aSketchFeature = + std::shared_ptr aSketchFeature = std::dynamic_pointer_cast(theFeature); bool isCopy = isCopyInMulti(aSketchFeature, myConstraintMap); // the feature is a copy in "Multi" constraint and does not used in other constraints @@ -258,8 +258,8 @@ bool SketchSolver_Storage::update(AttributePtr theAttribute, const GroupID& theG if (aFeature->getKind() == SketchPlugin_Arc::ID() && myFeatureMap.find(aFeature) == myFeatureMap.end()) { // Additional checking that all attributes are initialized - if (aFeature->attribute(SketchPlugin_Arc::CENTER_ID())->isInitialized() && - aFeature->attribute(SketchPlugin_Arc::START_ID())->isInitialized() && + if (aFeature->attribute(SketchPlugin_Arc::CENTER_ID())->isInitialized() && + aFeature->attribute(SketchPlugin_Arc::START_ID())->isInitialized() && aFeature->attribute(SketchPlugin_Arc::END_ID())->isInitialized()) { return SketchSolver_Storage::update(aFeature, theGroup, theForce); } else { @@ -271,9 +271,9 @@ bool SketchSolver_Storage::update(AttributePtr theAttribute, const GroupID& theG BuilderPtr aBuilder = SketchSolver_Manager::instance()->builder(); GroupID aGroup = theGroup != GID_UNKNOWN ? theGroup : myGroupID; // Check attribute of external features - std::shared_ptr aSketchFeature = + std::shared_ptr aSketchFeature = std::dynamic_pointer_cast(anAttribute->owner()); - if (aSketchFeature && (aSketchFeature->isExternal() || + if (aSketchFeature && (aSketchFeature->isExternal() || isCopyInMulti(aSketchFeature, myConstraintMap))) aGroup = GID_OUTOFGROUP; aRelated = aBuilder->createAttribute(anAttribute, aGroup); @@ -658,7 +658,7 @@ bool SketchSolver_Storage::removeCoincidence(ConstraintWrapperPtr theConstraint) return true; } -void SketchSolver_Storage::replaceEntities(const std::map& theChange) { std::set anUpdFeatures; @@ -700,7 +700,7 @@ bool SketchSolver_Storage::remove(ConstraintWrapperPtr theConstraint) if (aBaseFeature) isFullyRemoved = SketchSolver_Storage::removeEntity(aBaseFeature) && isFullyRemoved; else - isFullyRemoved = + isFullyRemoved = SketchSolver_Storage::removeEntity((*anIt)->baseAttribute()) && isFullyRemoved; } return isFullyRemoved; @@ -758,7 +758,7 @@ bool SketchSolver_Storage::isInteract(const AttributePtr& theAttribute) const if (!theAttribute) return false; - AttributeRefListPtr aRefList = + AttributeRefListPtr aRefList = std::dynamic_pointer_cast(theAttribute); if (aRefList) { std::list anObjects = aRefList->list(); @@ -817,7 +817,7 @@ bool SketchSolver_Storage::isFixed(EntityWrapperPtr theEntity) const return true; } - std::map >::const_iterator aCIt = + std::map >::const_iterator aCIt = myConstraintMap.begin(); std::list::const_iterator aCWIt; for (; aCIt != myConstraintMap.end(); ++aCIt) { @@ -900,8 +900,8 @@ void SketchSolver_Storage::processArcs() for (; aFIt != myFeatureMap.end(); ++aFIt) if (!aFIt->second && aFIt->first->getKind() == SketchPlugin_Arc::ID()) { // Additional checking the attributes are initialized - if (aFIt->first->attribute(SketchPlugin_Arc::CENTER_ID())->isInitialized() && - aFIt->first->attribute(SketchPlugin_Arc::START_ID())->isInitialized() && + if (aFIt->first->attribute(SketchPlugin_Arc::CENTER_ID())->isInitialized() && + aFIt->first->attribute(SketchPlugin_Arc::START_ID())->isInitialized() && aFIt->first->attribute(SketchPlugin_Arc::END_ID())->isInitialized()) update(aFIt->first); else @@ -988,7 +988,7 @@ void resultToFeatureOrAttribute(const ObjectPtr& theResult, // if the feature has several results, we choose which one is referred const std::list& aResults = aFeature->results(); if (aResults.size() > 1 && theResult != aFeature->lastResult()) { - // actually, the attribute refers to center of arc or circle, + // actually, the attribute refers to center of arc or circle, // but not the edge, get correct attributes std::string anAttrName; if (aFeature->getKind() == SketchPlugin_Arc::ID()) diff --git a/src/SketchSolver/SketchSolver_Storage.h b/src/SketchSolver/SketchSolver_Storage.h index 6a1b1b2e8..c4dd63ddb 100644 --- a/src/SketchSolver/SketchSolver_Storage.h +++ b/src/SketchSolver/SketchSolver_Storage.h @@ -62,7 +62,7 @@ public: /// \param theGroup [in] id of the group where the feature should be placed /// \param theForce [in] forced feature creation /// \return \c true if the feature has been created or updated - SKETCHSOLVER_EXPORT bool update(FeaturePtr theFeature, + SKETCHSOLVER_EXPORT bool update(FeaturePtr theFeature, const GroupID& theGroup = GID_UNKNOWN, bool theForce = false); /// \brief Convert attribute to the form applicable for specific solver and map it @@ -70,7 +70,7 @@ public: /// \param theGroup [in] id of the group where the feature should be placed /// \param theForce [in] forced feature creation /// \return \c true if the attribute has been created or updated - SKETCHSOLVER_EXPORT bool update(AttributePtr theAttribute, + SKETCHSOLVER_EXPORT bool update(AttributePtr theAttribute, const GroupID& theGroup = GID_UNKNOWN, bool theForce = false); /// \brief Returns constraint related to corresponding constraint @@ -169,7 +169,7 @@ protected: void addEntity(FeaturePtr theFeature, EntityWrapperPtr theSolverEntity); - /// \brief Change mapping attribute of a feature and the entity + /// \brief Change mapping attribute of a feature and the entity /// applicable for corresponding solver. /// \param theAttribute [in] original attribute /// \param theSolverEntity [in] solver's entity, created outside @@ -235,7 +235,7 @@ protected: std::map myAttributeMap; /// lists of coincident points (first is a master point, second is a set of slaves) - CoincidentPointsMap myCoincidentPoints; + CoincidentPointsMap myCoincidentPoints; // to be able to update entities from constraints friend class SketchSolver_ConstraintDistance; diff --git a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Builder.cpp b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Builder.cpp index 3d0e38842..814987bcc 100644 --- a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Builder.cpp +++ b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Builder.cpp @@ -143,7 +143,7 @@ std::list SolveSpaceSolver_Builder::createConstraint( aSlvsEntities[i] = (Slvs_hEntity)anOriginal[i]->id(); // entity is not added into a storage, constraint can not be created if (aSlvsEntities[i] == SLVS_E_UNKNOWN) - return std::list(); + return std::list(); aConstrAttrList.push_back(anOriginal[i]); } @@ -257,7 +257,7 @@ std::list SolveSpaceSolver_Builder::createMirror( aResult.insert(aResult.end(), aMrrList.begin(), aMrrList.end()); } else if (theEntity1->type() == ENTITY_ARC) { - // Do not allow mirrored arc recalculate its position until + // Do not allow mirrored arc recalculate its position until // coordinated of all points recalculated FeaturePtr aMirrArc = theEntity2->baseFeature(); aMirrArc->data()->blockSendAttributeUpdated(true); @@ -278,7 +278,7 @@ std::list SolveSpaceSolver_Builder::createMirror( anIt1 = aBaseArcPoints.begin(); anIt2 = aMirrorArcPoints.begin(); for (; anIt1 != aBaseArcPoints.end(); ++anIt1, ++anIt2) { - aMrrList = + aMrrList = createMirror(theConstraint, theGroupID, theSketchID, *anIt1, *anIt2, theMirrorLine); aResult.insert(aResult.end(), aMrrList.begin(), aMrrList.end()); } @@ -335,12 +335,12 @@ EntityWrapperPtr SolveSpaceSolver_Builder::createFeature( else if (aFeatureKind == SketchPlugin_Arc::ID()) return createArc(theFeature, theAttributes, theGroupID, theSketchID); // Point (it has low probability to be an attribute of constraint, so it is checked at the end) - else if (aFeatureKind == SketchPlugin_Point::ID() || + else if (aFeatureKind == SketchPlugin_Point::ID() || aFeatureKind == SketchPlugin_IntersectionPoint::ID()) { AttributePtr aPoint = theFeature->attribute(SketchPlugin_Point::COORD_ID()); if (!aPoint->isInitialized()) return aDummy; - EntityWrapperPtr aSub = theAttributes.empty() ? + EntityWrapperPtr aSub = theAttributes.empty() ? createAttribute(aPoint, theGroupID, theSketchID) : theAttributes.front(); if (!aSub) @@ -392,9 +392,9 @@ EntityWrapperPtr SolveSpaceSolver_Builder::createAttribute( std::shared_ptr aPoint2D = std::dynamic_pointer_cast(theAttribute); if (aPoint2D) { - aParameters.push_back(createParameter(theGroupID, aPoint2D->x(), + aParameters.push_back(createParameter(theGroupID, aPoint2D->x(), !aPoint2D->textX().empty())); - aParameters.push_back(createParameter(theGroupID, aPoint2D->y(), + aParameters.push_back(createParameter(theGroupID, aPoint2D->y(), !aPoint2D->textY().empty())); // Create entity (parameters are not filled) anEntity = Slvs_MakePoint2d(SLVS_E_UNKNOWN, (Slvs_hGroup)theGroupID, @@ -404,7 +404,7 @@ EntityWrapperPtr SolveSpaceSolver_Builder::createAttribute( AttributeDoublePtr aScalar = std::dynamic_pointer_cast(theAttribute); if (aScalar) { - aParameters.push_back(createParameter(theGroupID, aScalar->value(), + aParameters.push_back(createParameter(theGroupID, aScalar->value(), !aScalar->text().empty())); // Create entity (parameter is not filled) anEntity = Slvs_MakeDistance(SLVS_E_UNKNOWN, (Slvs_hGroup)theGroupID, @@ -473,7 +473,7 @@ EntityWrapperPtr SolveSpaceSolver_Builder::createNormal( std::shared_ptr aNorm = std::dynamic_pointer_cast(theNormal); std::shared_ptr aDirX = std::dynamic_pointer_cast(theDirX); if (!aDirX || !aNorm || - (fabs(aDirX->x()) + fabs(aDirX->y()) + fabs(aDirX->z()) < tolerance) || + (fabs(aDirX->x()) + fabs(aDirX->y()) + fabs(aDirX->z()) < tolerance) || !aNorm->isInitialized()) return EntityWrapperPtr(); // calculate Y direction @@ -528,7 +528,7 @@ EntityWrapperPtr createLine(FeaturePtr theFeature, EntityWrapperPtr aStartEnt, aEndEnt; std::list::const_iterator anIt = theAttributes.begin(); for (; anIt != theAttributes.end(); ++anIt) { - std::shared_ptr aSlvsEntity = + std::shared_ptr aSlvsEntity = std::dynamic_pointer_cast(*anIt); if (aSlvsEntity->isBase(aStart)) aStartEnt = aSlvsEntity; @@ -564,7 +564,7 @@ EntityWrapperPtr createCircle(FeaturePtr theFeature, EntityWrapperPtr aCenterEnt, aRadiusEnt, aNormalEnt; std::list::const_iterator anIt = theAttributes.begin(); for (; anIt != theAttributes.end(); ++anIt) { - std::shared_ptr aSlvsEntity = + std::shared_ptr aSlvsEntity = std::dynamic_pointer_cast(*anIt); if (aSlvsEntity->isBase(aCenter)) aCenterEnt = aSlvsEntity; @@ -604,7 +604,7 @@ EntityWrapperPtr createArc(FeaturePtr theFeature, EntityWrapperPtr aCenterEnt, aStartEnt, aEndEnt, aNormalEnt; std::list::const_iterator anIt = theAttributes.begin(); for (; anIt != theAttributes.end(); ++anIt) { - std::shared_ptr aSlvsEntity = + std::shared_ptr aSlvsEntity = std::dynamic_pointer_cast(*anIt); if (aSlvsEntity->isBase(aCenter)) aCenterEnt = aSlvsEntity; @@ -700,7 +700,7 @@ void adjustAngle(ConstraintWrapperPtr theConstraint) aConstraint->baseConstraint()->boolean( SketchPlugin_ConstraintAngle::ANGLE_REVERSED_SECOND_LINE_ID())->value() }; - std::shared_ptr + std::shared_ptr anAngle(new GeomAPI_Angle2d(aLine[0], isReversed[0], aLine[1], isReversed[1])); std::shared_ptr aCenter = anAngle->center(); @@ -746,10 +746,10 @@ void makeMirrorPoints(EntityWrapperPtr theOriginal, (*aMIt)->setValue(aCoord[i]); // update corresponding attribute - AttributePtr anAttr = + AttributePtr anAttr = std::dynamic_pointer_cast(theMirrored)->baseAttribute(); if (anAttr) { - std::shared_ptr aMirroredPnt = + std::shared_ptr aMirroredPnt = std::dynamic_pointer_cast(anAttr); aMirroredPnt->setValue(aCoord[0], aCoord[1]); } diff --git a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Builder.h b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Builder.h index def1ae81a..b39b7ac91 100644 --- a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Builder.h +++ b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Builder.h @@ -38,7 +38,7 @@ public: /// \param theGroupID [in] group the constraint belongs to /// \param theSketchID [in] sketch the constraint belongs to /// \param theType [in] type of constraint - /// \param theValue [in] numeric characteristic of constraint + /// \param theValue [in] numeric characteristic of constraint /// (e.g. distance or radius) if applicable /// \param theEntity1 [in] first attribute of constraint /// \param theEntity2 [in] second attribute of constraint @@ -63,9 +63,9 @@ public: /// \param theGroupID [in] group the constraint belongs to /// \param theSketchID [in] sketch the constraint belongs to /// \param theType [in] type of constraint - /// \param theValue [in] numeric characteristic of constraint + /// \param theValue [in] numeric characteristic of constraint /// (angle for multi-rotation) if applicable - /// \param theFullValue [in] indicates theValue shows full translation + /// \param theFullValue [in] indicates theValue shows full translation /// delta/rotation angle or delta/angle between neighbor entities /// \param thePoint1 [in] center for multi-rotation or start point for multi-translation /// \param thePoint2 [in] end point for multi-translation (empty for multi-rotation) diff --git a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ConstraintWrapper.cpp b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ConstraintWrapper.cpp index 3ee9d559a..ecc8248d9 100644 --- a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ConstraintWrapper.cpp +++ b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ConstraintWrapper.cpp @@ -55,7 +55,7 @@ bool SolveSpaceSolver_ConstraintWrapper::isUsed(AttributePtr theAttribute) const bool SolveSpaceSolver_ConstraintWrapper::isEqual(const ConstraintWrapperPtr& theOther) { - const Slvs_Constraint anOtherConstraint = + const Slvs_Constraint anOtherConstraint = std::dynamic_pointer_cast(theOther)->constraint(); if (mySlvsConstraint.type != anOtherConstraint.type) return false; diff --git a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ParameterWrapper.cpp b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ParameterWrapper.cpp index 1f2c7d451..be61bcbd7 100644 --- a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ParameterWrapper.cpp +++ b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_ParameterWrapper.cpp @@ -30,7 +30,7 @@ double SolveSpaceSolver_ParameterWrapper::value() const bool SolveSpaceSolver_ParameterWrapper::isEqual(const ParameterWrapperPtr& theOther) { - std::shared_ptr anOtherParam = + std::shared_ptr anOtherParam = std::dynamic_pointer_cast(theOther); return anOtherParam && fabs(value() - anOtherParam->value()) < tolerance; } diff --git a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Solver.h b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Solver.h index b1734a71e..e5537ac11 100644 --- a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Solver.h +++ b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Solver.h @@ -9,7 +9,7 @@ #include -// Need to be defined before including SolveSpace to avoid additional +// Need to be defined before including SolveSpace to avoid additional // dependences on Windows platform #if defined(WIN32) && !defined(HAVE_C99_INTEGER_TYPES) typedef unsigned int UINT32; diff --git a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.cpp b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.cpp index 6cae2a9b7..7f3b04385 100644 --- a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.cpp +++ b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.cpp @@ -36,7 +36,7 @@ static bool IsNotEqual(const Slvs_Param& theParam1, const Slvs_Param& theParam2) /// \brief Compare two entities to be different static bool IsNotEqual(const Slvs_Entity& theEntity1, const Slvs_Entity& theEntity2); /// \brief Compare two constraints to be different -static bool IsNotEqual(const Slvs_Constraint& theConstraint1, +static bool IsNotEqual(const Slvs_Constraint& theConstraint1, const Slvs_Constraint& theConstraint2); @@ -123,7 +123,7 @@ bool SolveSpaceSolver_Storage::update(ConstraintWrapperPtr theConstraint) bool SolveSpaceSolver_Storage::update(EntityWrapperPtr theEntity) { bool isUpdated = false; - std::shared_ptr anEntity = + std::shared_ptr anEntity = std::dynamic_pointer_cast(theEntity); Slvs_Entity aSlvsEnt = getEntity((Slvs_hEntity)anEntity->id()); if (aSlvsEnt.h == SLVS_E_UNKNOWN) @@ -204,14 +204,14 @@ bool SolveSpaceSolver_Storage::update(EntityWrapperPtr theEntity) bool SolveSpaceSolver_Storage::update(ParameterWrapperPtr theParameter) { - std::shared_ptr aParameter = + std::shared_ptr aParameter = std::dynamic_pointer_cast(theParameter); const Slvs_Param& aParam = getParameter((Slvs_hParam)aParameter->id()); if (aParam.h != SLVS_E_UNKNOWN && fabs(aParam.val - aParameter->value()) < tolerance) return false; Slvs_Param aParamToUpd = aParameter->parameter(); if (aParamToUpd.group == SLVS_G_UNKNOWN) - aParamToUpd.group = aParameter->isParametric() ? (Slvs_hGroup)GID_OUTOFGROUP : + aParamToUpd.group = aParameter->isParametric() ? (Slvs_hGroup)GID_OUTOFGROUP : (Slvs_hGroup)myGroupID; Slvs_hParam anID = updateParameter(aParamToUpd); if (aParam.h == SLVS_E_UNKNOWN) // new parameter @@ -331,9 +331,9 @@ void SolveSpaceSolver_Storage::addCoincidentPoints( if (theMaster->id() != theSlave->id()) removeEntity((Slvs_hEntity)theSlave->id()); - std::shared_ptr aPointMaster = + std::shared_ptr aPointMaster = std::dynamic_pointer_cast(theMaster); - std::shared_ptr aPointSlave = + std::shared_ptr aPointSlave = std::dynamic_pointer_cast(theSlave); aPointSlave->changeEntity() = aPointMaster->entity(); aPointSlave->setParameters(aPointMaster->parameters()); @@ -449,7 +449,7 @@ void SolveSpaceSolver_Storage::replaceInConstraints( addSameConstraints(*aCIt2, aWrapper); break; } - } else + } else aConstr.h = updateConstraint(aConstr); aWrapper->changeConstraint() = aConstr; @@ -559,9 +559,9 @@ EntityWrapperPtr SolveSpaceSolver_Storage::calculateMiddlePoint( theX = anArcPoint[0][0] + anArcPoint[2][0]; theY = anArcPoint[0][1] + anArcPoint[2][1]; } else { - std::shared_ptr + std::shared_ptr aStartDir(new GeomAPI_Dir2d(anArcPoint[1][0], anArcPoint[1][1])); - std::shared_ptr + std::shared_ptr aEndDir(new GeomAPI_Dir2d(anArcPoint[2][0], anArcPoint[2][1])); double anAngle = aStartDir->angle(aEndDir); if (anAngle < 0) @@ -825,7 +825,7 @@ Slvs_hConstraint SolveSpaceSolver_Storage::updateConstraint(const Slvs_Constrain Slvs_Entity aNewLine2 = Slvs_MakeLineSegment(SLVS_E_UNKNOWN, (Slvs_hGroup)myGroupID, myWorkplaneID, aLine.point[1], aConstraint.ptA); aNewLine2.h = addEntity(aNewLine2); - aConstraint = Slvs_MakeConstraint(SLVS_E_UNKNOWN, (Slvs_hGroup)myGroupID, + aConstraint = Slvs_MakeConstraint(SLVS_E_UNKNOWN, (Slvs_hGroup)myGroupID, SLVS_C_EQUAL_LENGTH_LINES, myWorkplaneID, 0.0, SLVS_E_UNKNOWN, SLVS_E_UNKNOWN, aNewLine1.h, aNewLine2.h); } @@ -959,7 +959,7 @@ bool SolveSpaceSolver_Storage::remove(EntityWrapperPtr theEntity) } } - std::shared_ptr anEntity = + std::shared_ptr anEntity = std::dynamic_pointer_cast(theEntity); bool isFullyRemoved = isCoincide ? true : removeEntity((Slvs_hEntity)anEntity->id()); return (SketchSolver_Storage::remove(theEntity) || isCoincide) && isFullyRemoved; @@ -981,10 +981,10 @@ void SolveSpaceSolver_Storage::refresh(bool theFixedOnly) const for (; anIt != myAttributeMap.end(); ++anIt) { if (!anIt->second) continue; - // the external feature always should keep the up to date values, so, + // the external feature always should keep the up to date values, so, // refresh from the solver is never needed if (anIt->first.get()) { - std::shared_ptr aSketchFeature = + std::shared_ptr aSketchFeature = std::dynamic_pointer_cast(anIt->first->owner()); if (aSketchFeature.get() && aSketchFeature->isExternal()) continue; @@ -1001,7 +1001,7 @@ void SolveSpaceSolver_Storage::refresh(bool theFixedOnly) const bool isUpd[3] = {false}; int i = 0; for (aParIt = aParams.begin(); i < 3 && aParIt != aParams.end(); ++aParIt, ++i) { - std::shared_ptr aWrapper = + std::shared_ptr aWrapper = std::dynamic_pointer_cast(*aParIt); if (!theFixedOnly || aWrapper->group() == GID_OUTOFGROUP || aWrapper->isParametric()) { aWrapper->changeParameter().val = getParameter((Slvs_hParam)aWrapper->id()).val; @@ -1022,7 +1022,7 @@ void SolveSpaceSolver_Storage::refresh(bool theFixedOnly) const aPoint2D->setValue(aCoords[0], aCoords[1]); // Find points coincident with this one (probably not in GID_OUTOFGROUP) std::map::const_iterator aLocIt; - if (theFixedOnly) + if (theFixedOnly) aLocIt = myAttributeMap.begin(); else { aLocIt = anIt; @@ -1031,7 +1031,7 @@ void SolveSpaceSolver_Storage::refresh(bool theFixedOnly) const for (; aLocIt != myAttributeMap.end(); ++aLocIt) { if (!aLocIt->second) continue; - std::shared_ptr aSketchFeature = + std::shared_ptr aSketchFeature = std::dynamic_pointer_cast(aLocIt->first->owner()); if (aSketchFeature && aSketchFeature->isExternal()) continue; @@ -1106,7 +1106,7 @@ void SolveSpaceSolver_Storage::adjustArc(const Slvs_Entity& theArc) if (i > 0) { anArcPoints[i][0] -= anArcPoints[0][0]; anArcPoints[i][1] -= anArcPoints[0][1]; - aDist[i] = sqrt(anArcPoints[i][0] * anArcPoints[i][0] + + aDist[i] = sqrt(anArcPoints[i][0] * anArcPoints[i][0] + anArcPoints[i][1] * anArcPoints[i][1]); } } diff --git a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.h b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.h index de15a1cd5..38c061446 100644 --- a/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.h +++ b/src/SketchSolver/SolveSpaceSolver/SolveSpaceSolver_Storage.h @@ -159,7 +159,7 @@ private: /// /// These constraints may be different and become the same after the substitution /// of point coincidence. - void addSameConstraints(ConstraintWrapperPtr theConstraint1, + void addSameConstraints(ConstraintWrapperPtr theConstraint1, ConstraintWrapperPtr theConstraint2); /// \brief Search constraint equal to the given in terms of SolveSpace notation @@ -169,20 +169,20 @@ private: Slvs_hEntity myWorkplaneID; ///< identifier of workplane /// current parameter index (may differs with the number of parameters) - Slvs_hParam myParamMaxID; + Slvs_hParam myParamMaxID; /// list of parameters used in the current group of constraints (sorted by the identifier) - std::vector myParameters; + std::vector myParameters; Slvs_hEntity myEntityMaxID; ///< current entity index (may differs with the number of entities) /// list of entities used in the current group of constraints (sorted by the identifier) - std::vector myEntities; + std::vector myEntities; /// current constraint index (may differs with the number of constraints) - Slvs_hConstraint myConstrMaxID; + Slvs_hConstraint myConstrMaxID; /// list of constraints used in the current group (sorted by the identifier) - std::vector myConstraints; + std::vector myConstraints; bool myDuplicatedConstraint; ///< shows the storage has same constraint twice diff --git a/src/SketcherPrs/SketcherPrs_Angle.cpp b/src/SketcherPrs/SketcherPrs_Angle.cpp index 0427ff1f4..4376f773f 100644 --- a/src/SketcherPrs/SketcherPrs_Angle.cpp +++ b/src/SketcherPrs/SketcherPrs_Angle.cpp @@ -34,7 +34,7 @@ IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Angle, AIS_AngleDimension); IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Angle, AIS_AngleDimension); -SketcherPrs_Angle::SketcherPrs_Angle(ModelAPI_Feature* theConstraint, +SketcherPrs_Angle::SketcherPrs_Angle(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane) : AIS_AngleDimension(gp_Pnt(0,0,0), gp_Pnt(1,0,0), gp_Pnt(0,1,0)), myConstraint(theConstraint), mySketcherPlane(thePlane), @@ -48,7 +48,7 @@ SketcherPrs_Angle::SketcherPrs_Angle(ModelAPI_Feature* theConstraint, myAspect->MakeUnitsDisplayed(false); myAspect->TextAspect()->SetHeight(SketcherPrs_Tools::getDefaultTextHeight()); myAspect->ArrowAspect()->SetLength(SketcherPrs_Tools::getArrowSize()); - + SetDimensionAspect(myAspect); myStyleListener = new SketcherPrs_DimensionStyleListener(); @@ -76,7 +76,7 @@ bool SketcherPrs_Angle::readyToDisplay(ModelAPI_Feature* theConstraint, DataPtr aData = theConstraint->data(); // Flyout point - std::shared_ptr aFlyoutAttr = + std::shared_ptr aFlyoutAttr = std::dynamic_pointer_cast (aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT())); if (!aFlyoutAttr->isInitialized()) @@ -90,9 +90,9 @@ bool SketcherPrs_Angle::readyToDisplay(ModelAPI_Feature* theConstraint, if (!anAttr2->isInitialized()) return aReadyToDisplay; - FeaturePtr aLineA = + FeaturePtr aLineA = SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_A()); - FeaturePtr aLineB = + FeaturePtr aLineB = SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_B()); if (!aLineA.get() || !aLineB.get()) @@ -117,10 +117,10 @@ bool SketcherPrs_Angle::readyToDisplay(ModelAPI_Feature* theConstraint, aStartA->pnt(), aEndA->pnt(), aStartB->pnt(), aEndB->pnt())); else { std::shared_ptr aLine1(new GeomAPI_Lin2d(aStartA->pnt(), aEndA->pnt())); - bool isReversed1 = + bool isReversed1 = aData->boolean(SketchPlugin_ConstraintAngle::ANGLE_REVERSED_FIRST_LINE_ID())->value(); std::shared_ptr aLine2(new GeomAPI_Lin2d(aStartB->pnt(), aEndB->pnt())); - bool isReversed2 = + bool isReversed2 = aData->boolean(SketchPlugin_ConstraintAngle::ANGLE_REVERSED_SECOND_LINE_ID())->value(); anAng = std::shared_ptr( new GeomAPI_Angle2d(aLine1, isReversed1, aLine2, isReversed2)); @@ -143,11 +143,11 @@ bool SketcherPrs_Angle::readyToDisplay(ModelAPI_Feature* theConstraint, void SketcherPrs_Angle::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, - const Handle(Prs3d_Presentation)& thePresentation, + const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode) { gp_Pnt aFirstPoint, aSecondPoint, aCenterPoint; - bool aReadyToDisplay = readyToDisplay(myConstraint, mySketcherPlane, + bool aReadyToDisplay = readyToDisplay(myConstraint, mySketcherPlane, aFirstPoint, aSecondPoint, aCenterPoint); if (aReadyToDisplay) { myFirstPoint = aFirstPoint; @@ -155,14 +155,14 @@ void SketcherPrs_Angle::Compute(const Handle(PrsMgr_PresentationManager3d)& theP myCenterPoint = aCenterPoint; DataPtr aData = myConstraint->data(); - AttributeDoublePtr anAttributeValue = + AttributeDoublePtr anAttributeValue = aData->real(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID()); myValue.init(anAttributeValue); - std::shared_ptr aFlyoutAttr = + std::shared_ptr aFlyoutAttr = std::dynamic_pointer_cast (aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT())); - std::shared_ptr aFlyoutPnt = + std::shared_ptr aFlyoutPnt = mySketcherPlane->to3D(aFlyoutAttr->x(), aFlyoutAttr->y()); myFlyOutPoint = aFlyoutPnt->impl(); } @@ -247,7 +247,7 @@ void SketcherPrs_Angle::ComputeSelection(const Handle(SelectMgr_Selection)& aSel default: { // there are own selection modes, so the others should be ignored // otherwise, the text selection appears in the viewer - return; + return; } } SetSelToleranceForText2d(SketcherPrs_Tools::getTextHeight()); diff --git a/src/SketcherPrs/SketcherPrs_Angle.h b/src/SketcherPrs/SketcherPrs_Angle.h index de294a98c..f37699848 100644 --- a/src/SketcherPrs/SketcherPrs_Angle.h +++ b/src/SketcherPrs/SketcherPrs_Angle.h @@ -28,7 +28,7 @@ public: /// Constructor /// \param theConstraint a constraint feature /// \param thePlane a coordinate plane of current sketch - Standard_EXPORT SketcherPrs_Angle(ModelAPI_Feature* theConstraint, + Standard_EXPORT SketcherPrs_Angle(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane); /// Destructor @@ -36,7 +36,7 @@ public: DEFINE_STANDARD_RTTI(SketcherPrs_Angle) - /// Returns true if the constraint feature arguments are correcly filled + /// Returns true if the constraint feature arguments are correcly filled /// to build AIS presentation /// \param theConstraint a constraint feature /// \param thePlane a coordinate plane of current sketch diff --git a/src/SketcherPrs/SketcherPrs_Coincident.cpp b/src/SketcherPrs/SketcherPrs_Coincident.cpp index cfb233def..1409192b7 100644 --- a/src/SketcherPrs/SketcherPrs_Coincident.cpp +++ b/src/SketcherPrs/SketcherPrs_Coincident.cpp @@ -32,8 +32,8 @@ IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Coincident, AIS_InteractiveObject); IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Coincident, AIS_InteractiveObject); -SketcherPrs_Coincident::SketcherPrs_Coincident(ModelAPI_Feature* theConstraint, - const std::shared_ptr& thePlane) +SketcherPrs_Coincident::SketcherPrs_Coincident(ModelAPI_Feature* theConstraint, + const std::shared_ptr& thePlane) : AIS_InteractiveObject(), myConstraint(theConstraint), mySketcherPlane(thePlane), myPoint(gp_Pnt(0.0, 0.0, 0.0)), myIsConflicting(false) { @@ -68,7 +68,7 @@ bool SketcherPrs_Coincident::readyToDisplay(ModelAPI_Feature* theConstraint, void SketcherPrs_Coincident::Compute( const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, - const Handle(Prs3d_Presentation)& thePresentation, + const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode) { gp_Pnt aPoint; diff --git a/src/SketcherPrs/SketcherPrs_Coincident.h b/src/SketcherPrs/SketcherPrs_Coincident.h index f6e7d4a36..fd0974843 100644 --- a/src/SketcherPrs/SketcherPrs_Coincident.h +++ b/src/SketcherPrs/SketcherPrs_Coincident.h @@ -27,24 +27,24 @@ public: /// Constructor /// \param theConstraint a constraint object /// \param thePlane plane of a sketch - Standard_EXPORT SketcherPrs_Coincident(ModelAPI_Feature* theConstraint, + Standard_EXPORT SketcherPrs_Coincident(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane); /// Defines color for the presentation /// \param aColor a color object Standard_EXPORT virtual void SetColor(const Quantity_Color& aColor); - + /// Defines color for the presentation /// \param aColor a color name Standard_EXPORT virtual void SetColor(const Quantity_NameOfColor aColor); /// Set state of the presentation, in case of conflicting state, the icon of the presentation is - /// visualized in error color. + /// visualized in error color. /// The state is stored in an internal field, so should be changed when /// constraint become not conflicting /// \param theConflicting a state /// \param theColor a color for conflicting object - Standard_EXPORT void SetConflictingConstraint(const bool& theConflicting, + Standard_EXPORT void SetConflictingConstraint(const bool& theConflicting, const std::vector& theColor); /// Returns true if the constraint feature arguments are correcly filled to build AIS presentation diff --git a/src/SketcherPrs/SketcherPrs_Collinear.cpp b/src/SketcherPrs/SketcherPrs_Collinear.cpp index bd88e9289..cf075c52c 100755 --- a/src/SketcherPrs/SketcherPrs_Collinear.cpp +++ b/src/SketcherPrs/SketcherPrs_Collinear.cpp @@ -19,14 +19,14 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Collinear, SketcherPrs_SymbolPrs); static Handle(Image_AlienPixMap) MyPixMap; -SketcherPrs_Collinear::SketcherPrs_Collinear(ModelAPI_Feature* theConstraint, - const std::shared_ptr& thePlane) +SketcherPrs_Collinear::SketcherPrs_Collinear(ModelAPI_Feature* theConstraint, + const std::shared_ptr& thePlane) : SketcherPrs_SymbolPrs(theConstraint, thePlane) { myPntArray = new Graphic3d_ArrayOfPoints(2); myPntArray->AddVertex(0., 0., 0.); myPntArray->AddVertex(0., 0., 0.); -} +} bool SketcherPrs_Collinear::IsReadyToDisplay(ModelAPI_Feature* theConstraint, const std::shared_ptr&/* thePlane*/) @@ -35,7 +35,7 @@ bool SketcherPrs_Collinear::IsReadyToDisplay(ModelAPI_Feature* theConstraint, ObjectPtr aObj1 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A()); - ObjectPtr aObj2 = + ObjectPtr aObj2 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B()); aReadyToDisplay = SketcherPrs_Tools::getShape(aObj1).get() != NULL && @@ -49,9 +49,9 @@ bool SketcherPrs_Collinear::updateIfReadyToDisplay(double theStep) const if (!IsReadyToDisplay(myConstraint, myPlane)) return false; - ObjectPtr aObj1 = + ObjectPtr aObj1 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A()); - ObjectPtr aObj2 = + ObjectPtr aObj2 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B()); // Set points of the presentation @@ -63,12 +63,12 @@ bool SketcherPrs_Collinear::updateIfReadyToDisplay(double theStep) const return true; } -void SketcherPrs_Collinear::drawLines(const Handle(Prs3d_Presentation)& thePrs, +void SketcherPrs_Collinear::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const { Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs); - Handle(Graphic3d_AspectLine3d) aLineAspect = + Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2); aGroup->SetPrimitivesAspect(aLineAspect); diff --git a/src/SketcherPrs/SketcherPrs_Collinear.h b/src/SketcherPrs/SketcherPrs_Collinear.h index 61f55c0b0..cd75c58d0 100755 --- a/src/SketcherPrs/SketcherPrs_Collinear.h +++ b/src/SketcherPrs/SketcherPrs_Collinear.h @@ -23,7 +23,7 @@ public: /// Constructor /// \param theConstraint a constraint feature /// \param thePlane a coordinate plane of current sketch - Standard_EXPORT SketcherPrs_Collinear(ModelAPI_Feature* theConstraint, + Standard_EXPORT SketcherPrs_Collinear(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane); DEFINE_STANDARD_RTTI(SketcherPrs_Collinear) diff --git a/src/SketcherPrs/SketcherPrs_DimensionStyleListener.cpp b/src/SketcherPrs/SketcherPrs_DimensionStyleListener.cpp index 30a193106..704e2af0c 100755 --- a/src/SketcherPrs/SketcherPrs_DimensionStyleListener.cpp +++ b/src/SketcherPrs/SketcherPrs_DimensionStyleListener.cpp @@ -91,7 +91,7 @@ void SketcherPrs_DimensionStyleListener::updateDimensions(AIS_Dimension* theDime aCustomValue = theTextValue.c_str(); else { // format value string using "sprintf" - TCollection_AsciiString aFormatStr = + TCollection_AsciiString aFormatStr = theDimension->Attributes()->DimensionAspect()->ValueStringFormat(); char aFmtBuffer[256]; sprintf (aFmtBuffer, aFormatStr.ToCString(), theDoubleValue); diff --git a/src/SketcherPrs/SketcherPrs_Equal.cpp b/src/SketcherPrs/SketcherPrs_Equal.cpp index 518774fa3..5e504590a 100644 --- a/src/SketcherPrs/SketcherPrs_Equal.cpp +++ b/src/SketcherPrs/SketcherPrs_Equal.cpp @@ -19,23 +19,23 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Equal, SketcherPrs_SymbolPrs); static Handle(Image_AlienPixMap) MyPixMap; -SketcherPrs_Equal::SketcherPrs_Equal(ModelAPI_Feature* theConstraint, - const std::shared_ptr& thePlane) +SketcherPrs_Equal::SketcherPrs_Equal(ModelAPI_Feature* theConstraint, + const std::shared_ptr& thePlane) : SketcherPrs_SymbolPrs(theConstraint, thePlane) { myPntArray = new Graphic3d_ArrayOfPoints(2); myPntArray->AddVertex(0., 0., 0.); myPntArray->AddVertex(0., 0., 0.); -} +} bool SketcherPrs_Equal::IsReadyToDisplay(ModelAPI_Feature* theConstraint, const std::shared_ptr&/* thePlane*/) { bool aReadyToDisplay = false; - ObjectPtr aObj1 = + ObjectPtr aObj1 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A()); - ObjectPtr aObj2 = + ObjectPtr aObj2 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B()); aReadyToDisplay = SketcherPrs_Tools::getShape(aObj1).get() != NULL && @@ -49,9 +49,9 @@ bool SketcherPrs_Equal::updateIfReadyToDisplay(double theStep) const if (!IsReadyToDisplay(myConstraint, myPlane)) return false; - ObjectPtr aObj1 = + ObjectPtr aObj1 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A()); - ObjectPtr aObj2 = + ObjectPtr aObj2 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B()); // Set points of the presentation @@ -63,12 +63,12 @@ bool SketcherPrs_Equal::updateIfReadyToDisplay(double theStep) const return true; } -void SketcherPrs_Equal::drawLines(const Handle(Prs3d_Presentation)& thePrs, +void SketcherPrs_Equal::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const { Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs); - Handle(Graphic3d_AspectLine3d) aLineAspect = + Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2); aGroup->SetPrimitivesAspect(aLineAspect); diff --git a/src/SketcherPrs/SketcherPrs_Equal.h b/src/SketcherPrs/SketcherPrs_Equal.h index 0e0dd3130..6103dc8be 100644 --- a/src/SketcherPrs/SketcherPrs_Equal.h +++ b/src/SketcherPrs/SketcherPrs_Equal.h @@ -23,7 +23,7 @@ public: /// Constructor /// \param theConstraint a constraint feature /// \param thePlane a coordinate plane of current sketch - Standard_EXPORT SketcherPrs_Equal(ModelAPI_Feature* theConstraint, + Standard_EXPORT SketcherPrs_Equal(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane); DEFINE_STANDARD_RTTI(SketcherPrs_Equal) diff --git a/src/SketcherPrs/SketcherPrs_Factory.cpp b/src/SketcherPrs/SketcherPrs_Factory.cpp index 8c8af38ab..d9e205140 100644 --- a/src/SketcherPrs/SketcherPrs_Factory.cpp +++ b/src/SketcherPrs/SketcherPrs_Factory.cpp @@ -64,7 +64,7 @@ AISObjectPtr SketcherPrs_Factory::horisontalConstraint(ModelAPI_Feature* theCons anAISObj = thePrevious; else { anAISObj = AISObjectPtr(new GeomAPI_AISObject()); - Handle(SketcherPrs_HVDirection) aPrs = + Handle(SketcherPrs_HVDirection) aPrs = new SketcherPrs_HVDirection(theConstraint, thePlane, true); anAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs)); } @@ -75,14 +75,14 @@ AISObjectPtr SketcherPrs_Factory::horisontalConstraint(ModelAPI_Feature* theCons AISObjectPtr SketcherPrs_Factory::verticalConstraint(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane, AISObjectPtr thePrevious) -{ +{ std::shared_ptr anAISObj; if (SketcherPrs_HVDirection::IsReadyToDisplay(theConstraint, thePlane)) { if (thePrevious.get()) anAISObj = thePrevious; else { anAISObj = AISObjectPtr(new GeomAPI_AISObject()); - Handle(SketcherPrs_HVDirection) aPrs = + Handle(SketcherPrs_HVDirection) aPrs = new SketcherPrs_HVDirection(theConstraint, thePlane, false); anAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs)); } @@ -93,15 +93,15 @@ AISObjectPtr SketcherPrs_Factory::verticalConstraint(ModelAPI_Feature* theConstr AISObjectPtr SketcherPrs_Factory::translateConstraint(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane, AISObjectPtr thePrevious) -{ +{ std::shared_ptr anAISObj; if (SketcherPrs_Transformation::IsReadyToDisplay(theConstraint, thePlane)) { if (thePrevious.get()) anAISObj = thePrevious; else { anAISObj = AISObjectPtr(new GeomAPI_AISObject()); - Handle(SketcherPrs_Transformation) aPrs = - new SketcherPrs_Transformation(theConstraint, thePlane, true); + Handle(SketcherPrs_Transformation) aPrs = + new SketcherPrs_Transformation(theConstraint, thePlane, true); anAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs)); } } @@ -111,15 +111,15 @@ AISObjectPtr SketcherPrs_Factory::translateConstraint(ModelAPI_Feature* theConst AISObjectPtr SketcherPrs_Factory::rotateConstraint(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane, AISObjectPtr thePrevious) -{ +{ std::shared_ptr anAISObj; if (SketcherPrs_Transformation::IsReadyToDisplay(theConstraint, thePlane)) { if (thePrevious.get()) anAISObj = thePrevious; else { anAISObj = AISObjectPtr(new GeomAPI_AISObject()); - Handle(SketcherPrs_Transformation) aPrs = - new SketcherPrs_Transformation(theConstraint, thePlane, false); + Handle(SketcherPrs_Transformation) aPrs = + new SketcherPrs_Transformation(theConstraint, thePlane, false); anAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs)); } } diff --git a/src/SketcherPrs/SketcherPrs_HVDirection.cpp b/src/SketcherPrs/SketcherPrs_HVDirection.cpp index 33500e1c5..44d62c5ae 100644 --- a/src/SketcherPrs/SketcherPrs_HVDirection.cpp +++ b/src/SketcherPrs/SketcherPrs_HVDirection.cpp @@ -19,9 +19,9 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_HVDirection, SketcherPrs_SymbolPrs); static Handle(Image_AlienPixMap) MyPixMap; -SketcherPrs_HVDirection::SketcherPrs_HVDirection(ModelAPI_Feature* theConstraint, +SketcherPrs_HVDirection::SketcherPrs_HVDirection(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane, - bool isHorisontal) + bool isHorisontal) : SketcherPrs_SymbolPrs(theConstraint, thePlane), myIsHorisontal(isHorisontal) { } @@ -30,14 +30,14 @@ bool SketcherPrs_HVDirection::IsReadyToDisplay(ModelAPI_Feature* theConstraint, const std::shared_ptr&/* thePlane*/) { bool aReadyToDisplay = false; - ObjectPtr aObj = + ObjectPtr aObj = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A()); aReadyToDisplay = SketcherPrs_Tools::getShape(aObj).get() != NULL; return aReadyToDisplay; } -bool SketcherPrs_HVDirection::updateIfReadyToDisplay(double theStep) const +bool SketcherPrs_HVDirection::updateIfReadyToDisplay(double theStep) const { if (!IsReadyToDisplay(myConstraint, myPlane)) return false; @@ -50,13 +50,13 @@ bool SketcherPrs_HVDirection::updateIfReadyToDisplay(double theStep) const return true; } -void SketcherPrs_HVDirection::drawLines(const Handle(Prs3d_Presentation)& thePrs, +void SketcherPrs_HVDirection::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const { Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs); // Draw constrained object - Handle(Graphic3d_AspectLine3d) aLineAspect = + Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2); aGroup->SetPrimitivesAspect(aLineAspect); diff --git a/src/SketcherPrs/SketcherPrs_HVDirection.h b/src/SketcherPrs/SketcherPrs_HVDirection.h index 39bd961a9..8da2cd498 100644 --- a/src/SketcherPrs/SketcherPrs_HVDirection.h +++ b/src/SketcherPrs/SketcherPrs_HVDirection.h @@ -25,7 +25,7 @@ public: /// \param theConstraint a constraint feature /// \param thePlane a coordinate plane of current sketch /// \param isHorisontal a flag horizontal or vertical presentation - Standard_EXPORT SketcherPrs_HVDirection(ModelAPI_Feature* theConstraint, + Standard_EXPORT SketcherPrs_HVDirection(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane, bool isHorisontal); diff --git a/src/SketcherPrs/SketcherPrs_LengthDimension.cpp b/src/SketcherPrs/SketcherPrs_LengthDimension.cpp index 267cc476e..f47575fe7 100644 --- a/src/SketcherPrs/SketcherPrs_LengthDimension.cpp +++ b/src/SketcherPrs/SketcherPrs_LengthDimension.cpp @@ -63,7 +63,7 @@ bool SketcherPrs_LengthDimension::IsReadyToDisplay(ModelAPI_Feature* theConstrai void SketcherPrs_LengthDimension::Compute( const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, - const Handle(Prs3d_Presentation)& thePresentation, + const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode) { gp_Pnt aPnt1, aPnt2; @@ -106,7 +106,7 @@ bool SketcherPrs_LengthDimension::readyToDisplay(ModelAPI_Feature* theConstraint DataPtr aData = theConstraint->data(); if (theConstraint->getKind() == SketchPlugin_ConstraintLength::ID()) { // The constraint is length - std::shared_ptr anAttr = + std::shared_ptr anAttr = std::dynamic_pointer_cast (aData->attribute(SketchPlugin_Constraint::ENTITY_A())); if (!anAttr) @@ -118,10 +118,10 @@ bool SketcherPrs_LengthDimension::readyToDisplay(ModelAPI_Feature* theConstraint // Get geometry of the object DataPtr aLineData = aFeature->data(); - std::shared_ptr aStartPoint = + std::shared_ptr aStartPoint = std::dynamic_pointer_cast (aLineData->attribute(SketchPlugin_Line::START_ID())); - std::shared_ptr aEndPoint = + std::shared_ptr aEndPoint = std::dynamic_pointer_cast (aLineData->attribute(SketchPlugin_Line::END_ID())); thePnt1 = thePlane->to3D(aStartPoint->x(), aStartPoint->y())->impl(); diff --git a/src/SketcherPrs/SketcherPrs_LengthDimension.h b/src/SketcherPrs/SketcherPrs_LengthDimension.h index ef3087c76..a15ba7ca9 100644 --- a/src/SketcherPrs/SketcherPrs_LengthDimension.h +++ b/src/SketcherPrs/SketcherPrs_LengthDimension.h @@ -32,7 +32,7 @@ public: /// Constructor /// \param theConstraint a constraint feature /// \param thePlane a coordinate plane of current sketch - Standard_EXPORT SketcherPrs_LengthDimension(ModelAPI_Feature* theConstraint, + Standard_EXPORT SketcherPrs_LengthDimension(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane); /// Destructor @@ -40,7 +40,7 @@ public: DEFINE_STANDARD_RTTI(SketcherPrs_LengthDimension) - /// Returns true if the constraint feature arguments are correcly filled + /// Returns true if the constraint feature arguments are correcly filled /// to build AIS presentation /// \param theConstraint a constraint feature /// \param thePlane a coordinate plane of current sketch @@ -51,7 +51,7 @@ protected: /// Redefinition of virtual function Standard_EXPORT virtual void Compute( const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, - const Handle(Prs3d_Presentation)& thePresentation, + const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0); /// Redefinition of virtual function @@ -74,7 +74,7 @@ private: /// Listener to update dimension visualization style SketcherPrs_DimensionStyleListener* myStyleListener; - /// container of values obtained from the constraint, which are necessary + /// container of values obtained from the constraint, which are necessary /// to fill the presentation gp_Pnt myFirstPoint; ///< the dimension first point for measured geometry gp_Pnt mySecondPoint; ///< the dimension first point for measured geometry @@ -82,7 +82,7 @@ private: double myDistance; ///< the flyout distance /// the structure filled by constraint - SketcherPrs_DimensionStyleListener::DimensionValue myValue; + SketcherPrs_DimensionStyleListener::DimensionValue myValue; }; #endif \ No newline at end of file diff --git a/src/SketcherPrs/SketcherPrs_Middle.cpp b/src/SketcherPrs/SketcherPrs_Middle.cpp index 8e2ed6816..9c4bbd354 100755 --- a/src/SketcherPrs/SketcherPrs_Middle.cpp +++ b/src/SketcherPrs/SketcherPrs_Middle.cpp @@ -19,8 +19,8 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Middle, SketcherPrs_SymbolPrs); static Handle(Image_AlienPixMap) MyPixMap; -SketcherPrs_Middle::SketcherPrs_Middle(ModelAPI_Feature* theConstraint, - const std::shared_ptr& thePlane) +SketcherPrs_Middle::SketcherPrs_Middle(ModelAPI_Feature* theConstraint, + const std::shared_ptr& thePlane) : SketcherPrs_SymbolPrs(theConstraint, thePlane) { } @@ -30,9 +30,9 @@ bool SketcherPrs_Middle::IsReadyToDisplay(ModelAPI_Feature* theConstraint, { bool aReadyToDisplay = false; - ObjectPtr aObj1 = + ObjectPtr aObj1 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A()); - ObjectPtr aObj2 = + ObjectPtr aObj2 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B()); // one object is a feature Line, other object is a point result. We check shape of point result @@ -50,17 +50,17 @@ bool SketcherPrs_Middle::updateIfReadyToDisplay(double theStep) const ObjectPtr aPointObject; // find a line result to set middle symbol near it - AttributePtr anAttribute = + AttributePtr anAttribute = SketcherPrs_Tools::getAttribute(myConstraint, SketchPlugin_Constraint::ENTITY_A()); if (!anAttribute.get()) { - ObjectPtr aObj = + ObjectPtr aObj = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A()); std::shared_ptr aShape = SketcherPrs_Tools::getShape(aObj); if (aShape.get() && aShape->isEdge()) aPointObject = aObj; } if (!aPointObject.get()) { - ObjectPtr aObj = + ObjectPtr aObj = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B()); std::shared_ptr aShape = SketcherPrs_Tools::getShape(aObj); if (aShape.get() && aShape->isEdge()) @@ -77,17 +77,17 @@ bool SketcherPrs_Middle::updateIfReadyToDisplay(double theStep) const return true; } -void SketcherPrs_Middle::drawLines(const Handle(Prs3d_Presentation)& thePrs, +void SketcherPrs_Middle::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const { Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs); - Handle(Graphic3d_AspectLine3d) aLineAspect = + Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2); aGroup->SetPrimitivesAspect(aLineAspect); // Draw objects - ObjectPtr aObject = + ObjectPtr aObject = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A()); drawLine(thePrs, theColor, aObject); diff --git a/src/SketcherPrs/SketcherPrs_Middle.h b/src/SketcherPrs/SketcherPrs_Middle.h index 0ba22c9f9..00b6ad0ee 100755 --- a/src/SketcherPrs/SketcherPrs_Middle.h +++ b/src/SketcherPrs/SketcherPrs_Middle.h @@ -23,7 +23,7 @@ public: /// Constructor /// \param theConstraint a constraint feature /// \param thePlane a coordinate plane of current sketch - Standard_EXPORT SketcherPrs_Middle(ModelAPI_Feature* theConstraint, + Standard_EXPORT SketcherPrs_Middle(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane); DEFINE_STANDARD_RTTI(SketcherPrs_Middle) diff --git a/src/SketcherPrs/SketcherPrs_Mirror.cpp b/src/SketcherPrs/SketcherPrs_Mirror.cpp index a086d0f7b..b94f40efa 100644 --- a/src/SketcherPrs/SketcherPrs_Mirror.cpp +++ b/src/SketcherPrs/SketcherPrs_Mirror.cpp @@ -21,11 +21,11 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Mirror, SketcherPrs_SymbolPrs); static Handle(Image_AlienPixMap) MyPixMap; -SketcherPrs_Mirror::SketcherPrs_Mirror(ModelAPI_Feature* theConstraint, - const std::shared_ptr& thePlane) +SketcherPrs_Mirror::SketcherPrs_Mirror(ModelAPI_Feature* theConstraint, + const std::shared_ptr& thePlane) : SketcherPrs_SymbolPrs(theConstraint, thePlane) { -} +} bool SketcherPrs_Mirror::IsReadyToDisplay(ModelAPI_Feature* theConstraint, const std::shared_ptr&/* thePlane*/) @@ -33,19 +33,19 @@ bool SketcherPrs_Mirror::IsReadyToDisplay(ModelAPI_Feature* theConstraint, bool aReadyToDisplay = false; // Get axis of mirror - ObjectPtr aAxisObj = + ObjectPtr aAxisObj = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A()); if (SketcherPrs_Tools::getShape(aAxisObj).get() == NULL) return aReadyToDisplay; std::shared_ptr aData = theConstraint->data(); // Get source objects - std::shared_ptr anAttrB = + std::shared_ptr anAttrB = aData->reflist(SketchPlugin_Constraint::ENTITY_B()); if (anAttrB.get() == NULL) return aReadyToDisplay; // Get mirrored objects - std::shared_ptr anAttrC = + std::shared_ptr anAttrC = aData->reflist(SketchPlugin_Constraint::ENTITY_C()); if (anAttrC.get() == NULL) return aReadyToDisplay; @@ -66,15 +66,15 @@ bool SketcherPrs_Mirror::updateIfReadyToDisplay(double theStep) const return false; // Get axis of mirror - ObjectPtr aAxisObj = + ObjectPtr aAxisObj = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A()); std::shared_ptr aData = myConstraint->data(); // Get source objects - std::shared_ptr anAttrB = + std::shared_ptr anAttrB = aData->reflist(SketchPlugin_Constraint::ENTITY_B()); // Get mirrored objects - std::shared_ptr anAttrC = + std::shared_ptr anAttrC = aData->reflist(SketchPlugin_Constraint::ENTITY_C()); SketcherPrs_PositionMgr* aMgr = SketcherPrs_PositionMgr::get(); @@ -91,7 +91,7 @@ bool SketcherPrs_Mirror::updateIfReadyToDisplay(double theStep) const continue; aP1 = aMgr->getPosition(aObj, this, theStep); myPntArray->SetVertice(i + 1, aP1); - } + } // Get position of each mirrored object for (i = 0; i < aNb; i++) { aObj = anAttrC->object(i); @@ -99,20 +99,20 @@ bool SketcherPrs_Mirror::updateIfReadyToDisplay(double theStep) const continue; aP1 = aMgr->getPosition(aObj, this, theStep); myPntArray->SetVertice(aNb + i + 1, aP1); - } + } return true; } -void SketcherPrs_Mirror::drawLines(const Handle(Prs3d_Presentation)& thePrs, +void SketcherPrs_Mirror::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const { std::shared_ptr aData = myConstraint->data(); - std::shared_ptr anAttrB = + std::shared_ptr anAttrB = aData->reflist(SketchPlugin_Constraint::ENTITY_B()); if (anAttrB.get() == NULL) return; - std::shared_ptr anAttrC = + std::shared_ptr anAttrC = aData->reflist(SketchPlugin_Constraint::ENTITY_C()); if (anAttrC.get() == NULL) return; diff --git a/src/SketcherPrs/SketcherPrs_Mirror.h b/src/SketcherPrs/SketcherPrs_Mirror.h index 3d3d311e8..098d1c279 100644 --- a/src/SketcherPrs/SketcherPrs_Mirror.h +++ b/src/SketcherPrs/SketcherPrs_Mirror.h @@ -23,7 +23,7 @@ public: /// Constructor /// \param theConstraint a constraint feature /// \param thePlane a coordinate plane of current sketch - Standard_EXPORT SketcherPrs_Mirror(ModelAPI_Feature* theConstraint, + Standard_EXPORT SketcherPrs_Mirror(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane); DEFINE_STANDARD_RTTI(SketcherPrs_Mirror) diff --git a/src/SketcherPrs/SketcherPrs_Parallel.cpp b/src/SketcherPrs/SketcherPrs_Parallel.cpp index 9b73b3385..6a6d4bbee 100644 --- a/src/SketcherPrs/SketcherPrs_Parallel.cpp +++ b/src/SketcherPrs/SketcherPrs_Parallel.cpp @@ -20,24 +20,24 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Parallel, SketcherPrs_SymbolPrs); static Handle(Image_AlienPixMap) MyPixMap; -SketcherPrs_Parallel::SketcherPrs_Parallel(ModelAPI_Feature* theConstraint, - const std::shared_ptr& thePlane) +SketcherPrs_Parallel::SketcherPrs_Parallel(ModelAPI_Feature* theConstraint, + const std::shared_ptr& thePlane) : SketcherPrs_SymbolPrs(theConstraint, thePlane) { // Create default array myPntArray = new Graphic3d_ArrayOfPoints(2); myPntArray->AddVertex(0., 0., 0.); myPntArray->AddVertex(0., 0., 0.); -} +} bool SketcherPrs_Parallel::IsReadyToDisplay(ModelAPI_Feature* theConstraint, const std::shared_ptr&/* thePlane*/) { bool aReadyToDisplay = false; - ObjectPtr aObj1 = + ObjectPtr aObj1 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A()); - ObjectPtr aObj2 = + ObjectPtr aObj2 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B()); aReadyToDisplay = SketcherPrs_Tools::getShape(aObj1).get() != NULL && @@ -50,9 +50,9 @@ bool SketcherPrs_Parallel::updateIfReadyToDisplay(double theStep) const if (!IsReadyToDisplay(myConstraint, myPlane)) return false; - ObjectPtr aObj1 = + ObjectPtr aObj1 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A()); - ObjectPtr aObj2 = + ObjectPtr aObj2 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B()); // Compute position of symbols @@ -65,12 +65,12 @@ bool SketcherPrs_Parallel::updateIfReadyToDisplay(double theStep) const } -void SketcherPrs_Parallel::drawLines(const Handle(Prs3d_Presentation)& thePrs, +void SketcherPrs_Parallel::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const { Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs); - Handle(Graphic3d_AspectLine3d) aLineAspect = + Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2); aGroup->SetPrimitivesAspect(aLineAspect); diff --git a/src/SketcherPrs/SketcherPrs_Parallel.h b/src/SketcherPrs/SketcherPrs_Parallel.h index cdadd0560..d5ae25300 100644 --- a/src/SketcherPrs/SketcherPrs_Parallel.h +++ b/src/SketcherPrs/SketcherPrs_Parallel.h @@ -23,7 +23,7 @@ public: /// Constructor /// \param theConstraint a constraint feature /// \param thePlane a coordinate plane of current sketch - Standard_EXPORT SketcherPrs_Parallel(ModelAPI_Feature* theConstraint, + Standard_EXPORT SketcherPrs_Parallel(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane); DEFINE_STANDARD_RTTI(SketcherPrs_Parallel) diff --git a/src/SketcherPrs/SketcherPrs_Perpendicular.cpp b/src/SketcherPrs/SketcherPrs_Perpendicular.cpp index d9d280f99..96a63b3a3 100644 --- a/src/SketcherPrs/SketcherPrs_Perpendicular.cpp +++ b/src/SketcherPrs/SketcherPrs_Perpendicular.cpp @@ -20,7 +20,7 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Perpendicular, SketcherPrs_SymbolPrs); static Handle(Image_AlienPixMap) MyPixMap; -SketcherPrs_Perpendicular::SketcherPrs_Perpendicular(ModelAPI_Feature* theConstraint, +SketcherPrs_Perpendicular::SketcherPrs_Perpendicular(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane) : SketcherPrs_SymbolPrs(theConstraint, thePlane) { @@ -28,16 +28,16 @@ SketcherPrs_Perpendicular::SketcherPrs_Perpendicular(ModelAPI_Feature* theConstr myPntArray = new Graphic3d_ArrayOfPoints(2); myPntArray->AddVertex(0., 0., 0.); myPntArray->AddVertex(0., 0., 0.); -} +} bool SketcherPrs_Perpendicular::IsReadyToDisplay(ModelAPI_Feature* theConstraint, const std::shared_ptr&/* thePlane*/) { bool aReadyToDisplay = false; - ObjectPtr aObj1 = + ObjectPtr aObj1 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A()); - ObjectPtr aObj2 = + ObjectPtr aObj2 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B()); aReadyToDisplay = SketcherPrs_Tools::getShape(aObj1).get() != NULL && @@ -50,9 +50,9 @@ bool SketcherPrs_Perpendicular::updateIfReadyToDisplay(double theStep) const if (!IsReadyToDisplay(myConstraint, myPlane)) return false; - ObjectPtr aObj1 = + ObjectPtr aObj1 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A()); - ObjectPtr aObj2 = + ObjectPtr aObj2 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B()); // Compute position of symbols @@ -65,12 +65,12 @@ bool SketcherPrs_Perpendicular::updateIfReadyToDisplay(double theStep) const } -void SketcherPrs_Perpendicular::drawLines(const Handle(Prs3d_Presentation)& thePrs, +void SketcherPrs_Perpendicular::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const { Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs); - Handle(Graphic3d_AspectLine3d) aLineAspect = + Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2); aGroup->SetPrimitivesAspect(aLineAspect); diff --git a/src/SketcherPrs/SketcherPrs_Perpendicular.h b/src/SketcherPrs/SketcherPrs_Perpendicular.h index 33a6f7495..c1f1622d3 100644 --- a/src/SketcherPrs/SketcherPrs_Perpendicular.h +++ b/src/SketcherPrs/SketcherPrs_Perpendicular.h @@ -25,7 +25,7 @@ public: /// Constructor /// \param theConstraint a constraint feature /// \param thePlane a coordinate plane of current sketch - Standard_EXPORT SketcherPrs_Perpendicular(ModelAPI_Feature* theConstraint, + Standard_EXPORT SketcherPrs_Perpendicular(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane); DEFINE_STANDARD_RTTI(SketcherPrs_Perpendicular) diff --git a/src/SketcherPrs/SketcherPrs_PositionMgr.cpp b/src/SketcherPrs/SketcherPrs_PositionMgr.cpp index 0261528f5..567a97dc1 100644 --- a/src/SketcherPrs/SketcherPrs_PositionMgr.cpp +++ b/src/SketcherPrs/SketcherPrs_PositionMgr.cpp @@ -17,7 +17,7 @@ static SketcherPrs_PositionMgr* MyPosMgr = NULL; // The class is implemented as a singlton SketcherPrs_PositionMgr* SketcherPrs_PositionMgr::get() { - if (MyPosMgr == NULL) + if (MyPosMgr == NULL) MyPosMgr = new SketcherPrs_PositionMgr(); return MyPosMgr; } @@ -27,7 +27,7 @@ SketcherPrs_PositionMgr::SketcherPrs_PositionMgr() } -int SketcherPrs_PositionMgr::getPositionIndex(ObjectPtr theLine, +int SketcherPrs_PositionMgr::getPositionIndex(ObjectPtr theLine, const SketcherPrs_SymbolPrs* thePrs) { if (myShapes.count(theLine) == 1) { @@ -51,7 +51,7 @@ int SketcherPrs_PositionMgr::getPositionIndex(ObjectPtr theLine, } } -gp_Pnt SketcherPrs_PositionMgr::getPosition(ObjectPtr theShape, +gp_Pnt SketcherPrs_PositionMgr::getPosition(ObjectPtr theShape, const SketcherPrs_SymbolPrs* thePrs, double theStep) { @@ -59,12 +59,12 @@ gp_Pnt SketcherPrs_PositionMgr::getPosition(ObjectPtr theShape, gp_Pnt aP; // Central point gp_Vec aVec1; // main vector if (aShape->isEdge()) { - std::shared_ptr aCurve = + std::shared_ptr aCurve = std::shared_ptr(new GeomAPI_Curve(aShape)); std::shared_ptr aPnt1; // Start point of main vector std::shared_ptr aPnt2; // End point of main vector if (aCurve->isLine()) { - std::shared_ptr aEdge = + std::shared_ptr aEdge = std::shared_ptr(new GeomAPI_Edge(aShape)); aPnt1 = aEdge->firstPoint(); @@ -87,7 +87,7 @@ gp_Pnt SketcherPrs_PositionMgr::getPosition(ObjectPtr theShape, aVec1 = gp_Vec(aPnt1->impl(), aPnt2->impl()); } else { // This is a point - std::shared_ptr aVertex = + std::shared_ptr aVertex = std::shared_ptr(new GeomAPI_Vertex(aShape)); std::shared_ptr aPnt = aVertex->point(); aP = aPnt->impl(); @@ -107,7 +107,7 @@ gp_Pnt SketcherPrs_PositionMgr::getPosition(ObjectPtr theShape, // Even position aP.Translate(aShift); if (aPos > 0) { - if (aPos % 4 == 0) + if (aPos % 4 == 0) aM = aPos / 4; else aM = -(aPos + 2) / 4; @@ -116,7 +116,7 @@ gp_Pnt SketcherPrs_PositionMgr::getPosition(ObjectPtr theShape, // Odd position aP.Translate(-aShift); if (aPos > 1) { - if ((aPos - 1) % 4 == 0) + if ((aPos - 1) % 4 == 0) aM = (aPos - 1) / 4; else aM = -(aPos + 1) / 4; diff --git a/src/SketcherPrs/SketcherPrs_PositionMgr.h b/src/SketcherPrs/SketcherPrs_PositionMgr.h index d8a956ff9..d91e9af32 100644 --- a/src/SketcherPrs/SketcherPrs_PositionMgr.h +++ b/src/SketcherPrs/SketcherPrs_PositionMgr.h @@ -27,7 +27,7 @@ public: static SketcherPrs_PositionMgr* get(); /// Returns position of symbol for the given presentation - /// \param theLine constrained object + /// \param theLine constrained object /// \param thePrs a presentation of constraint /// \param theStep step between symbols gp_Pnt getPosition(ObjectPtr theLine, const SketcherPrs_SymbolPrs* thePrs, double theStep = 20); @@ -41,7 +41,7 @@ private: SketcherPrs_PositionMgr(); /// Returns position index of the given constraint - /// \param theLine constrained object + /// \param theLine constrained object /// \param thePrs a presentation of constraint int getPositionIndex(ObjectPtr theLine, const SketcherPrs_SymbolPrs* thePrs); @@ -51,7 +51,7 @@ private: /// The map which contains position of presentation PositionsMap myIndexes; - /// The map contains position index + /// The map contains position index std::map myShapes; }; diff --git a/src/SketcherPrs/SketcherPrs_Radius.cpp b/src/SketcherPrs/SketcherPrs_Radius.cpp index 826ae8379..fe73e5059 100644 --- a/src/SketcherPrs/SketcherPrs_Radius.cpp +++ b/src/SketcherPrs/SketcherPrs_Radius.cpp @@ -26,7 +26,7 @@ static const gp_Circ MyDefCirc(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,0,1)), 1); IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Radius, AIS_RadiusDimension); IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Radius, AIS_RadiusDimension); -SketcherPrs_Radius::SketcherPrs_Radius(ModelAPI_Feature* theConstraint, +SketcherPrs_Radius::SketcherPrs_Radius(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane) : AIS_RadiusDimension(MyDefCirc), myConstraint(theConstraint), mySketcherPlane(thePlane), myCircle(MyDefCirc), @@ -59,7 +59,7 @@ bool SketcherPrs_Radius::readyToDisplay(ModelAPI_Feature* theConstraint, DataPtr aData = theConstraint->data(); // Flyout point - std::shared_ptr aFlyoutAttr = + std::shared_ptr aFlyoutAttr = std::dynamic_pointer_cast (aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT())); if (!aFlyoutAttr->isInitialized()) { @@ -67,7 +67,7 @@ bool SketcherPrs_Radius::readyToDisplay(ModelAPI_Feature* theConstraint, } // Get circle - std::shared_ptr anAttr = + std::shared_ptr anAttr = std::dynamic_pointer_cast (aData->attribute(SketchPlugin_Constraint::ENTITY_A())); if (!anAttr) @@ -84,18 +84,18 @@ bool SketcherPrs_Radius::readyToDisplay(ModelAPI_Feature* theConstraint, if (aCyrcFeature->getKind() == SketchPlugin_Circle::ID()) { // circle aCenterAttr = std::dynamic_pointer_cast( aCyrcFeature->data()->attribute(SketchPlugin_Circle::CENTER_ID())); - AttributeDoublePtr aCircRadius = + AttributeDoublePtr aCircRadius = std::dynamic_pointer_cast( aCyrcFeature->data()->attribute(SketchPlugin_Circle::RADIUS_ID())); aRadius = aCircRadius->value(); } else { // arc aCenterAttr = std::dynamic_pointer_cast( aCyrcFeature->data()->attribute(SketchPlugin_Arc::CENTER_ID())); - //std::shared_ptr aStartAttr = + //std::shared_ptr aStartAttr = // std::dynamic_pointer_cast // (aCyrcFeature->data()->attribute(SketchPlugin_Arc::START_ID())); //theRadius = aCenterAttr->pnt()->distance(aStartAttr->pnt()); - AttributeDoublePtr aCircRadius = + AttributeDoublePtr aCircRadius = std::dynamic_pointer_cast( aCyrcFeature->data()->attribute(SketchPlugin_Arc::RADIUS_ID())); aRadius = aCircRadius->value(); @@ -104,7 +104,7 @@ bool SketcherPrs_Radius::readyToDisplay(ModelAPI_Feature* theConstraint, std::shared_ptr aNormal = thePlane->normal(); GeomAPI_Circ aCircle(aCenter, aNormal, aRadius); - std::shared_ptr anAnchor = + std::shared_ptr anAnchor = SketcherPrs_Tools::getAnchorPoint(theConstraint, thePlane); theCircle = aCircle.impl(); @@ -117,7 +117,7 @@ bool SketcherPrs_Radius::readyToDisplay(ModelAPI_Feature* theConstraint, void SketcherPrs_Radius::Compute( const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, - const Handle(Prs3d_Presentation)& thePresentation, + const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode) { gp_Circ aCircle; @@ -140,7 +140,7 @@ void SketcherPrs_Radius::Compute( GetValueString(aTextSize); SketcherPrs_Tools::updateArrows(DimensionAspect(), GetValue(), aTextSize); - + AIS_RadiusDimension::Compute(thePresentationManager, thePresentation, theMode); if (!aReadyToDisplay) @@ -169,7 +169,7 @@ void SketcherPrs_Radius::ComputeSelection(const Handle(SelectMgr_Selection)& aSe default: { // there are own selection modes, so the others should be ignored // otherwise, the text selection appears in the viewer - return; + return; } } SetSelToleranceForText2d(SketcherPrs_Tools::getTextHeight()); diff --git a/src/SketcherPrs/SketcherPrs_Radius.h b/src/SketcherPrs/SketcherPrs_Radius.h index 6710652ce..28a455aa6 100644 --- a/src/SketcherPrs/SketcherPrs_Radius.h +++ b/src/SketcherPrs/SketcherPrs_Radius.h @@ -28,7 +28,7 @@ public: /// Constructor /// \param theConstraint a constraint feature /// \param thePlane a coordinate plane of current sketch - Standard_EXPORT SketcherPrs_Radius(ModelAPI_Feature* theConstraint, + Standard_EXPORT SketcherPrs_Radius(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane); /// Destructor @@ -36,7 +36,7 @@ public: DEFINE_STANDARD_RTTI(SketcherPrs_Radius) - /// Returns true if the constraint feature arguments are correcly filled + /// Returns true if the constraint feature arguments are correcly filled /// to build AIS presentation /// \param theConstraint a constraint feature /// \param thePlane a coordinate plane of current sketch diff --git a/src/SketcherPrs/SketcherPrs_Rigid.cpp b/src/SketcherPrs/SketcherPrs_Rigid.cpp index d2e993331..ce56fdf9c 100644 --- a/src/SketcherPrs/SketcherPrs_Rigid.cpp +++ b/src/SketcherPrs/SketcherPrs_Rigid.cpp @@ -33,12 +33,12 @@ IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Rigid, SketcherPrs_SymbolPrs); IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Rigid, SketcherPrs_SymbolPrs); -static Handle(Image_AlienPixMap) MyPixMap; +static Handle(Image_AlienPixMap) MyPixMap; -SketcherPrs_Rigid::SketcherPrs_Rigid(ModelAPI_Feature* theConstraint, - const std::shared_ptr& thePlane) +SketcherPrs_Rigid::SketcherPrs_Rigid(ModelAPI_Feature* theConstraint, + const std::shared_ptr& thePlane) : SketcherPrs_SymbolPrs(theConstraint, thePlane) { } @@ -49,7 +49,7 @@ bool SketcherPrs_Rigid::IsReadyToDisplay(ModelAPI_Feature* theConstraint, bool aReadyToDisplay = false; std::shared_ptr aData = theConstraint->data(); - std::shared_ptr anAttr = + std::shared_ptr anAttr = aData->refattr(SketchPlugin_Constraint::ENTITY_A()); AttributePtr aRefAttr = anAttr->attr(); if (anAttr->isObject()) { @@ -66,13 +66,13 @@ bool SketcherPrs_Rigid::IsReadyToDisplay(ModelAPI_Feature* theConstraint, return aReadyToDisplay; } -bool SketcherPrs_Rigid::updateIfReadyToDisplay(double theStep) const +bool SketcherPrs_Rigid::updateIfReadyToDisplay(double theStep) const { if (!IsReadyToDisplay(myConstraint, myPlane)) return false; std::shared_ptr aData = myConstraint->data(); - std::shared_ptr anAttr = + std::shared_ptr anAttr = aData->refattr(SketchPlugin_Constraint::ENTITY_A()); AttributePtr aRefAttr = anAttr->attr(); if (anAttr->isObject()) { @@ -93,7 +93,7 @@ bool SketcherPrs_Rigid::updateIfReadyToDisplay(double theStep) const } -void SketcherPrs_Rigid::drawLines(const Handle(Prs3d_Presentation)& thePrs, +void SketcherPrs_Rigid::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const { ObjectPtr aObj = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A()); @@ -117,7 +117,7 @@ void SketcherPrs_Rigid::drawLines(const Handle(Prs3d_Presentation)& thePrs, return; Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs); - Handle(Graphic3d_AspectLine3d) aLineAspect = + Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2); aGroup->SetPrimitivesAspect(aLineAspect); diff --git a/src/SketcherPrs/SketcherPrs_Rigid.h b/src/SketcherPrs/SketcherPrs_Rigid.h index 1bb7b4a61..0f17fd12c 100644 --- a/src/SketcherPrs/SketcherPrs_Rigid.h +++ b/src/SketcherPrs/SketcherPrs_Rigid.h @@ -25,7 +25,7 @@ public: /// Constructor /// \param theConstraint a constraint feature /// \param thePlane a coordinate plane of current sketch - Standard_EXPORT SketcherPrs_Rigid(ModelAPI_Feature* theConstraint, + Standard_EXPORT SketcherPrs_Rigid(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane); diff --git a/src/SketcherPrs/SketcherPrs_SensitivePoint.h b/src/SketcherPrs/SketcherPrs_SensitivePoint.h index ac9c93ba7..22adc0442 100644 --- a/src/SketcherPrs/SketcherPrs_SensitivePoint.h +++ b/src/SketcherPrs/SketcherPrs_SensitivePoint.h @@ -20,13 +20,13 @@ DEFINE_STANDARD_HANDLE(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity) */ class SketcherPrs_SensitivePoint : public Select3D_SensitiveEntity { -public: +public: //! Constructs a sensitive point object defined by the //! \param OwnerId an Id of the Owner. //! \param theId and Id of its point Standard_EXPORT SketcherPrs_SensitivePoint(const Handle(SelectBasics_EntityOwner)& OwnerId, int theId); - + /// Returns number of sub-elements Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE; @@ -55,7 +55,7 @@ public: DEFINE_STANDARD_RTTI(SketcherPrs_SensitivePoint) -private: +private: int myId; }; diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp index 2e2779c7b..d88e2bb71 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp @@ -166,7 +166,7 @@ public: if (aDataType == GL_NONE) continue; - OpenGl_VertexBuffer::bindAttribute(theGlCtx, anAttrib.Id, aNbComp, + OpenGl_VertexBuffer::bindAttribute(theGlCtx, anAttrib.Id, aNbComp, aDataType, Stride, anOffset); anOffset += Graphic3d_Attribute::Stride (anAttrib.DataType); } @@ -205,7 +205,7 @@ class SketcherPrs_Element: public OpenGl_Element public: /// Constructor /// \param theObj a presentation - SketcherPrs_Element(const Handle(SketcherPrs_SymbolPrs)& theObj) : + SketcherPrs_Element(const Handle(SketcherPrs_SymbolPrs)& theObj) : OpenGl_Element(), myObj(theObj) {} /// Render the current presentation @@ -218,7 +218,7 @@ public: /// Releases OpenGL resources /// \param theContext OpenGL context - virtual void Release (OpenGl_Context* theContext) + virtual void Release (OpenGl_Context* theContext) { if (!myObj.IsNull()) myObj->Release(theContext); @@ -235,7 +235,7 @@ OpenGl_Element* SymbolPrsCallBack(const CALL_DEF_USERDRAW * theUserDraw) { Handle(SketcherPrs_SymbolPrs) anIObj = (SketcherPrs_SymbolPrs*)theUserDraw->Data; if (anIObj.IsNull()) { - std::cout << + std::cout << "VUserDrawCallback error: null object passed, the custom scene element will not be rendered" << std::endl; } @@ -251,7 +251,7 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_SymbolPrs, AIS_InteractiveObject); std::map SketcherPrs_SymbolPrs::myIconsMap; -SketcherPrs_SymbolPrs::SketcherPrs_SymbolPrs(ModelAPI_Feature* theConstraint, +SketcherPrs_SymbolPrs::SketcherPrs_SymbolPrs(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane) : AIS_InteractiveObject(), myConstraint(theConstraint), myPlane(thePlane), myIsConflicting(false) { @@ -308,14 +308,14 @@ void SketcherPrs_SymbolPrs::prepareAspect() // Create an aspect with the icon if (myAspect.IsNull()) { Handle(Image_AlienPixMap) aIcon = icon(); - if (aIcon.IsNull()) + if (aIcon.IsNull()) myAspect = new Graphic3d_AspectMarker3d(); else myAspect = new Graphic3d_AspectMarker3d(aIcon); } } -void SketcherPrs_SymbolPrs::addLine(const Handle(Graphic3d_Group)& theGroup, +void SketcherPrs_SymbolPrs::addLine(const Handle(Graphic3d_Group)& theGroup, std::string theAttrName) const { ObjectPtr aObj = SketcherPrs_Tools::getResult(myConstraint, theAttrName); @@ -348,8 +348,8 @@ void SketcherPrs_SymbolPrs::HilightSelected(const Handle(PrsMgr_PresentationMana } void SketcherPrs_SymbolPrs::HilightOwnerWithColor( - const Handle(PrsMgr_PresentationManager3d)& thePM, - const Quantity_NameOfColor theColor, + const Handle(PrsMgr_PresentationManager3d)& thePM, + const Quantity_NameOfColor theColor, const Handle(SelectMgr_EntityOwner)& theOwner) { thePM->Color(this, theColor); @@ -364,14 +364,14 @@ void SketcherPrs_SymbolPrs::HilightOwnerWithColor( void SketcherPrs_SymbolPrs::Compute( const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, - const Handle(Prs3d_Presentation)& thePresentation, + const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode) { // Create an icon prepareAspect(); Handle(AIS_InteractiveContext) aCtx = GetContext(); - Handle(OpenGl_GraphicDriver) aDriver = + Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(aCtx->CurrentViewer()->Driver()); if (!aDriver.IsNull()) { // register the custom element factory function @@ -381,7 +381,7 @@ void SketcherPrs_SymbolPrs::Compute( // Update points with default shift value // it updates array of points if the presentation is ready to display, or the array of points // contains the previous values - + bool aReadyToDisplay = updateIfReadyToDisplay(20); int aNbVertex = myPntArray->VertexNumber(); @@ -438,7 +438,7 @@ void SketcherPrs_SymbolPrs::SetConflictingConstraint(const bool& theConflicting, if (theConflicting) { if (!myAspect.IsNull()) - myAspect->SetColor (Quantity_Color (theColor[0] / 255., theColor[1] / 255., + myAspect->SetColor (Quantity_Color (theColor[0] / 255., theColor[1] / 255., theColor[2] / 255., Quantity_TOC_RGB)); myIsConflicting = true; } @@ -455,7 +455,7 @@ void SketcherPrs_SymbolPrs::Render(const Handle(OpenGl_Workspace)& theWorkspace) // this method is a combination of OCCT OpenGL functions. The main purpose is to have // equal distance from the source object to symbol indpendently of zoom. // It is base on OCCT 6.9.1 and might need changes when using later OCCT versions. - // The specific SHAPER modifications are marked by ShaperModification:start/end, + // The specific SHAPER modifications are marked by ShaperModification:start/end, // other is OCCT code // do not update presentation for invalid or already removed objects: the presentation @@ -466,7 +466,7 @@ void SketcherPrs_SymbolPrs::Render(const Handle(OpenGl_Workspace)& theWorkspace) const OpenGl_AspectMarker* anAspectMarker = theWorkspace->AspectMarker(Standard_True); const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext(); Handle(OpenGl_View) aView = theWorkspace->ActiveView(); - + // ShaperModification:start double aScale = aView->Camera()->Scale(); // Update points coordinate taking the viewer scale into account @@ -481,29 +481,29 @@ void SketcherPrs_SymbolPrs::Render(const Handle(OpenGl_Workspace)& theWorkspace) } // Update drawing attributes - if (!myVboAttribs->init(aCtx, 0, aAttribs->NbElements, + if (!myVboAttribs->init(aCtx, 0, aAttribs->NbElements, aAttribs->Data(), GL_NONE, aAttribs->Stride)) { myVboAttribs->Release (aCtx.operator->()); myVboAttribs.Nullify(); return; } - + Handle(OpenGl_Texture) aTextureBack = theWorkspace->DisableTexture(); const Handle(OpenGl_PointSprite)& aSpriteNorm = anAspectMarker->SpriteRes(aCtx); - + if (!aSpriteNorm.IsNull() && !aSpriteNorm->IsDisplayList()) { // ShaperModification:start : filling the presentation with color if there is a conflict - const bool toHilight = + const bool toHilight = (theWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT) != 0 || myIsConflicting; // ShaperModification:end - const Handle(OpenGl_PointSprite)& aSprite = - (toHilight && anAspectMarker->SpriteHighlightRes(aCtx)->IsValid())? + const Handle(OpenGl_PointSprite)& aSprite = + (toHilight && anAspectMarker->SpriteHighlightRes(aCtx)->IsValid())? anAspectMarker->SpriteHighlightRes(aCtx) : aSpriteNorm; theWorkspace->EnableTexture (aSprite); - aCtx->ShaderManager()->BindProgram(anAspectMarker, aSprite, Standard_False, + aCtx->ShaderManager()->BindProgram(anAspectMarker, aSprite, Standard_False, Standard_False, anAspectMarker->ShaderProgramRes(aCtx)); const TEL_COLOUR* aLineColor = &anAspectMarker->Color(); if (theWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT) @@ -557,27 +557,27 @@ void SketcherPrs_SymbolPrs::Release (OpenGl_Context* theContext) } } -void SketcherPrs_SymbolPrs::drawShape(const std::shared_ptr& theShape, +void SketcherPrs_SymbolPrs::drawShape(const std::shared_ptr& theShape, const Handle(Prs3d_Presentation)& thePrs) const { if (theShape->isEdge()) { // The shape is edge - std::shared_ptr aCurve = + std::shared_ptr aCurve = std::shared_ptr(new GeomAPI_Curve(theShape)); if (aCurve->isLine()) { // The shape is line - GeomAdaptor_Curve + GeomAdaptor_Curve aCurv(aCurve->impl(), aCurve->startParam(), aCurve->endParam()); StdPrs_Curve::Add(thePrs, aCurv, myDrawer); } else { // The shape is circle or arc - GeomAdaptor_Curve + GeomAdaptor_Curve aAdaptor(aCurve->impl(), aCurve->startParam(), aCurve->endParam()); StdPrs_DeflectionCurve::Add(thePrs,aAdaptor,myDrawer); } } else if (theShape->isVertex()) { // draw vertex - std::shared_ptr aVertex = + std::shared_ptr aVertex = std::shared_ptr(new GeomAPI_Vertex(theShape)); std::shared_ptr aPnt = aVertex->point(); Handle(Geom_CartesianPoint) aPoint = new Geom_CartesianPoint(aPnt->impl()); @@ -586,7 +586,7 @@ void SketcherPrs_SymbolPrs::drawShape(const std::shared_ptr& theS } void SketcherPrs_SymbolPrs::drawListOfShapes( - const std::shared_ptr& theListAttr, + const std::shared_ptr& theListAttr, const Handle(Prs3d_Presentation)& thePrs) const { int aNb = theListAttr->size(); diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.h b/src/SketcherPrs/SketcherPrs_SymbolPrs.h index 54b2bd290..622230433 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.h +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.h @@ -39,20 +39,20 @@ public: /// Constructor /// \param theConstraint a constraint feature /// \param thePlane a coordinate plane of current sketch - Standard_EXPORT SketcherPrs_SymbolPrs(ModelAPI_Feature* theConstraint, + Standard_EXPORT SketcherPrs_SymbolPrs(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane); - + virtual ~SketcherPrs_SymbolPrs(); //! Method which draws selected owners ( for fast presentation draw ) Standard_EXPORT virtual void HilightSelected(const Handle(PrsMgr_PresentationManager3d)& thePM, const SelectMgr_SequenceOfOwner& theOwners); - + //! Method which hilight an owner belonging to //! this selectable object ( for fast presentation draw ) Standard_EXPORT virtual void HilightOwnerWithColor( const Handle(PrsMgr_PresentationManager3d)& thePM, - const Quantity_NameOfColor theColor, + const Quantity_NameOfColor theColor, const Handle(SelectMgr_EntityOwner)& theOwner); /// Returns sketcher plane @@ -69,7 +69,7 @@ public: /// when constraint become not conflicting /// \param theConflicting a state /// \param theColor a color for conflicting object - Standard_EXPORT void SetConflictingConstraint(const bool& theConflicting, + Standard_EXPORT void SetConflictingConstraint(const bool& theConflicting, const std::vector& theColor); /// Render of the presentation @@ -125,13 +125,13 @@ protected: /// Draw a shape into the given presentation scene /// \param theShape the shape to draw /// \param thePrs the presentation scene - void drawShape(const std::shared_ptr& theShape, + void drawShape(const std::shared_ptr& theShape, const Handle(Prs3d_Presentation)& thePrs) const; /// Draw a list of shapes stored in a RefListAttribute /// \param theListAttr the attribute of reference3s list /// \param thePrs the presentation scene - void drawListOfShapes(const std::shared_ptr& theListAttr, + void drawListOfShapes(const std::shared_ptr& theListAttr, const Handle(Prs3d_Presentation)& thePrs) const; protected: @@ -150,7 +150,7 @@ protected: /// An owner object of the presentation Handle(SelectMgr_EntityOwner) myOwner; -private: +private: /// Static map to collect constraints icons {IconName : IconPixMap} static std::map myIconsMap; diff --git a/src/SketcherPrs/SketcherPrs_Tangent.cpp b/src/SketcherPrs/SketcherPrs_Tangent.cpp index a857c3955..640b3b9ab 100644 --- a/src/SketcherPrs/SketcherPrs_Tangent.cpp +++ b/src/SketcherPrs/SketcherPrs_Tangent.cpp @@ -23,24 +23,24 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Tangent, SketcherPrs_SymbolPrs); static Handle(Image_AlienPixMap) MyPixMap; -SketcherPrs_Tangent::SketcherPrs_Tangent(ModelAPI_Feature* theConstraint, - const std::shared_ptr& thePlane) +SketcherPrs_Tangent::SketcherPrs_Tangent(ModelAPI_Feature* theConstraint, + const std::shared_ptr& thePlane) : SketcherPrs_SymbolPrs(theConstraint, thePlane) { // Init default points myPntArray = new Graphic3d_ArrayOfPoints(2); myPntArray->AddVertex(0., 0., 0.); myPntArray->AddVertex(0., 0., 0.); -} +} bool SketcherPrs_Tangent::IsReadyToDisplay(ModelAPI_Feature* theConstraint, const std::shared_ptr&/* thePlane*/) { bool aReadyToDisplay = false; - ObjectPtr aObj1 = + ObjectPtr aObj1 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A()); - ObjectPtr aObj2 = + ObjectPtr aObj2 = SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B()); aReadyToDisplay = SketcherPrs_Tools::getShape(aObj1).get() != NULL && @@ -54,9 +54,9 @@ bool SketcherPrs_Tangent::updateIfReadyToDisplay(double theStep) const if (!IsReadyToDisplay(myConstraint, myPlane)) return false; - ObjectPtr aObj1 = + ObjectPtr aObj1 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A()); - ObjectPtr aObj2 = + ObjectPtr aObj2 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B()); // Compute points coordinates @@ -68,12 +68,12 @@ bool SketcherPrs_Tangent::updateIfReadyToDisplay(double theStep) const return true; } -void SketcherPrs_Tangent::drawLines(const Handle(Prs3d_Presentation)& thePrs, +void SketcherPrs_Tangent::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const { Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs); - Handle(Graphic3d_AspectLine3d) aLineAspect = + Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2); aGroup->SetPrimitivesAspect(aLineAspect); diff --git a/src/SketcherPrs/SketcherPrs_Tangent.h b/src/SketcherPrs/SketcherPrs_Tangent.h index a3cf98bbd..cc2b0cc05 100644 --- a/src/SketcherPrs/SketcherPrs_Tangent.h +++ b/src/SketcherPrs/SketcherPrs_Tangent.h @@ -24,7 +24,7 @@ public: /// Constructor /// \param theConstraint a constraint feature /// \param thePlane a coordinate plane of current sketch - Standard_EXPORT SketcherPrs_Tangent(ModelAPI_Feature* theConstraint, + Standard_EXPORT SketcherPrs_Tangent(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane); DEFINE_STANDARD_RTTI(SketcherPrs_Tangent) diff --git a/src/SketcherPrs/SketcherPrs_Tools.cpp b/src/SketcherPrs/SketcherPrs_Tools.cpp index 833580701..04611afa7 100644 --- a/src/SketcherPrs/SketcherPrs_Tools.cpp +++ b/src/SketcherPrs/SketcherPrs_Tools.cpp @@ -88,13 +88,13 @@ std::shared_ptr getPoint(ModelAPI_Feature* theFeature, } //************************************************************************************* -/// Find an attribute of the given object which corresponds to a vetrex +/// Find an attribute of the given object which corresponds to a vetrex /// defined by a shape /// \param theObject an object /// \param theShape a vertex /// \param thePlane a projection plane (sketcher plane) -std::shared_ptr findGeomPoint(ObjectPtr theObject, - const TopoDS_Shape& theShape, +std::shared_ptr findGeomPoint(ObjectPtr theObject, + const TopoDS_Shape& theShape, const std::shared_ptr& thePlane) { std::shared_ptr aGeomPoint; @@ -109,12 +109,12 @@ std::shared_ptr findGeomPoint(ObjectPtr theObject, new GeomAPI_Pnt(aShapePoint.X(), aShapePoint.Y(), aShapePoint.Z())); // find the given point in the feature attributes - std::list anObjectAttiributes = + std::list anObjectAttiributes = anObjectFeature->data()->attributes(GeomDataAPI_Point2D::typeId()); - std::list::const_iterator anIt = anObjectAttiributes.begin(), + std::list::const_iterator anIt = anObjectAttiributes.begin(), aLast = anObjectAttiributes.end(); for (; anIt != aLast && !aGeomPoint; anIt++) { - std::shared_ptr anAttributePoint = + std::shared_ptr anAttributePoint = std::dynamic_pointer_cast(*anIt); std::shared_ptr anAttributePnt = thePlane->to3D(anAttributePoint->x(), @@ -181,7 +181,7 @@ FeaturePtr getFeatureLine(DataPtr theData, if (!theData.get() || !theData->isValid()) /// essential check as it is called in openGl thread) return aLine; - std::shared_ptr anAttr = + std::shared_ptr anAttr = std::dynamic_pointer_cast(theData->attribute(theAttribute)); if (anAttr) { FeaturePtr aFeature = ModelAPI_Feature::feature(anAttr->object()); @@ -271,7 +271,7 @@ std::shared_ptr getAnchorPoint(const ModelAPI_Feature* theConstrain } else if (aFeature->getKind() == SketchPlugin_Circle::ID()) { // circle aCenter = std::dynamic_pointer_cast( aFeature->attribute(SketchPlugin_Circle::CENTER_ID()))->pnt(); - } else + } else return std::shared_ptr(); std::shared_ptr anOrigin(new GeomAPI_Pnt2d(0.0, 0.0)); @@ -310,7 +310,7 @@ Handle(Prs3d_DimensionAspect) createDimensionAspect() return anAspect; } -void updateArrows(Handle(Prs3d_DimensionAspect) theDimAspect, +void updateArrows(Handle(Prs3d_DimensionAspect) theDimAspect, double theDimValue, double theTextSize) { double anArrowLength = theDimAspect->ArrowAspect()->Length(); @@ -333,7 +333,7 @@ void updateArrows(Handle(Prs3d_DimensionAspect) theDimAspect, void sendEmptyPresentationError(ModelAPI_Feature* theFeature, const std::string theError) { - Events_InfoMessage("SketcherPrs_Tools", + Events_InfoMessage("SketcherPrs_Tools", "An empty AIS presentation: SketcherPrs_LengthDimension").send(); static const Events_ID anEvent = Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION); std::shared_ptr aConstraintPtr(theFeature); diff --git a/src/SketcherPrs/SketcherPrs_Tools.h b/src/SketcherPrs/SketcherPrs_Tools.h index ed6fd0bf0..ac76fdac9 100644 --- a/src/SketcherPrs/SketcherPrs_Tools.h +++ b/src/SketcherPrs/SketcherPrs_Tools.h @@ -62,14 +62,14 @@ namespace SketcherPrs_Tools { /// Enumeration with modes for activation of selection custom presentations enum SelectionModes { /// Start of enumeration - Sel_Mode_First = 100, - + Sel_Mode_First = 100, + /// Selection mode for all constraints exclude dimensions Sel_Constraint, - + /// Selection mode for whole dimension Sel_Dimension_All, - + /// Selection mode for line of dimension Sel_Dimension_Line, diff --git a/src/SketcherPrs/SketcherPrs_Transformation.cpp b/src/SketcherPrs/SketcherPrs_Transformation.cpp index 1058aeb8f..785267baa 100644 --- a/src/SketcherPrs/SketcherPrs_Transformation.cpp +++ b/src/SketcherPrs/SketcherPrs_Transformation.cpp @@ -28,12 +28,12 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Transformation, SketcherPrs_SymbolPrs); static Handle(Image_AlienPixMap) MyPixMap; -SketcherPrs_Transformation::SketcherPrs_Transformation(ModelAPI_Feature* theConstraint, +SketcherPrs_Transformation::SketcherPrs_Transformation(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane, - bool isTranslation) + bool isTranslation) : SketcherPrs_SymbolPrs(theConstraint, thePlane), myIsTranslation(isTranslation) { -} +} bool SketcherPrs_Transformation::IsReadyToDisplay(ModelAPI_Feature* theConstraint, const std::shared_ptr&/* thePlane*/) @@ -42,7 +42,7 @@ bool SketcherPrs_Transformation::IsReadyToDisplay(ModelAPI_Feature* theConstrain std::shared_ptr aData = theConstraint->data(); // Get transformated objects list - std::shared_ptr anAttrB = + std::shared_ptr anAttrB = aData->reflist(SketchPlugin_Constraint::ENTITY_B()); if (anAttrB.get() == NULL) return aReadyToDisplay; @@ -59,12 +59,12 @@ bool SketcherPrs_Transformation::IsReadyToDisplay(ModelAPI_Feature* theConstrain AttributePoint2DPtr aEnd = GeomDataAPI_Point2D::getPoint2D(aData, SketchPlugin_MultiTranslation::END_POINT_ID()); - aReadyToDisplay = + aReadyToDisplay = aStart.get() && aEnd.get() && aStart->isInitialized() && aEnd->isInitialized(); } else if (theConstraint->getKind() == SketchPlugin_MultiRotation::ID()) { // if it is rotation - AttributePoint2DPtr aCenter = + AttributePoint2DPtr aCenter = GeomDataAPI_Point2D::getPoint2D(aData, SketchPlugin_MultiRotation::CENTER_ID()); aReadyToDisplay = aCenter.get() && aCenter->isInitialized(); } @@ -72,7 +72,7 @@ bool SketcherPrs_Transformation::IsReadyToDisplay(ModelAPI_Feature* theConstrain return aReadyToDisplay; } -bool SketcherPrs_Transformation::updateIfReadyToDisplay(double theStep) const +bool SketcherPrs_Transformation::updateIfReadyToDisplay(double theStep) const { if (!IsReadyToDisplay(myConstraint, myPlane)) return false; @@ -104,16 +104,16 @@ bool SketcherPrs_Transformation::updateIfReadyToDisplay(double theStep) const continue; aP1 = aMgr->getPosition(aObj, this, theStep); myPntArray->SetVertice(i + 1, aP1); - } + } return true; } -void SketcherPrs_Transformation::drawLines(const Handle(Prs3d_Presentation)& thePrs, +void SketcherPrs_Transformation::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const { std::shared_ptr aData = myConstraint->data(); - std::shared_ptr anAttrB = + std::shared_ptr anAttrB = aData->reflist(SketchPlugin_Constraint::ENTITY_B()); if (anAttrB.get() == NULL) return; diff --git a/src/SketcherPrs/SketcherPrs_Transformation.h b/src/SketcherPrs/SketcherPrs_Transformation.h index 068ac7c09..419867517 100644 --- a/src/SketcherPrs/SketcherPrs_Transformation.h +++ b/src/SketcherPrs/SketcherPrs_Transformation.h @@ -25,7 +25,7 @@ public: /// \param theConstraint a constraint feature /// \param thePlane a coordinate plane of current sketch /// \param isTranslation a flag is it translation or rotation - Standard_EXPORT SketcherPrs_Transformation(ModelAPI_Feature* theConstraint, + Standard_EXPORT SketcherPrs_Transformation(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane, bool isTranslation); diff --git a/src/XGUI/XGUI_ActionsMgr.cpp b/src/XGUI/XGUI_ActionsMgr.cpp index 510c56c33..26e33d3e2 100644 --- a/src/XGUI/XGUI_ActionsMgr.cpp +++ b/src/XGUI/XGUI_ActionsMgr.cpp @@ -108,13 +108,13 @@ void XGUI_ActionsMgr::updateCommandsStatus() ModuleBase_OperationFeature* aFOperation = dynamic_cast (myOperationMgr->currentOperation()); if (aFOperation) { - anActiveFeature = aFOperation->feature(); + anActiveFeature = aFOperation->feature(); QStringList aNested = allNestedCommands(aFOperation); foreach(QString aAction, myActions.keys()) { if (!aNested.contains(aAction)) setActionEnabled(aAction, false); } - } else + } else setNestedCommandsEnabled(false); updateByPlugins(anActiveFeature); @@ -252,7 +252,7 @@ QAction* XGUI_ActionsMgr::operationStateAction(OperationStateActionId theId) } break; case Preview: { - aResult = ModuleBase_Tools::createAction(QIcon(), tr("See preview"), + aResult = ModuleBase_Tools::createAction(QIcon(), tr("See preview"), aParent, 0, 0, "Compute preview"); aResult->setStatusTip(aResult->toolTip()); } @@ -315,7 +315,7 @@ void XGUI_ActionsMgr::setNestedCommandsEnabled(bool theEnabled, const QString& t void XGUI_ActionsMgr::setNestedStackEnabled(ModuleBase_Operation* theOperation) { - ModuleBase_OperationFeature* anOperation = + ModuleBase_OperationFeature* anOperation = dynamic_cast(theOperation); if(!anOperation || !anOperation->feature()) return; @@ -330,7 +330,7 @@ void XGUI_ActionsMgr::setNestedStackEnabled(ModuleBase_Operation* theOperation) QStringList XGUI_ActionsMgr::allNestedCommands(ModuleBase_Operation* theOperation) { QStringList aFeatures; - ModuleBase_OperationFeature* anOperation = + ModuleBase_OperationFeature* anOperation = dynamic_cast(theOperation); if(!anOperation || !anOperation->feature()) return aFeatures; diff --git a/src/XGUI/XGUI_ActionsMgr.h b/src/XGUI/XGUI_ActionsMgr.h index 191965da6..27f43885a 100644 --- a/src/XGUI/XGUI_ActionsMgr.h +++ b/src/XGUI/XGUI_ActionsMgr.h @@ -84,7 +84,7 @@ class XGUI_EXPORT XGUI_ActionsMgr : public QObject, public Events_Listener /// Return an action by the given id, if it was registered in the manager QAction* action(const QString& theId); - /// Return info (icon, text, etc) about the action by the given id, + /// Return info (icon, text, etc) about the action by the given id, /// if it was registered in the manager ActionInfo actionInfoById(const QString& theId); @@ -100,23 +100,23 @@ class XGUI_EXPORT XGUI_ActionsMgr : public QObject, public Events_Listener //! Updates actions according to current selection in the viewer void updateOnViewSelection(); - + //! Sets all actions to enabled state. void setAllEnabled(); - + //! Sets all nested actions to isEnabled state for the command with given ID. //! If ID is empty - all nested actions will be affected. void setNestedCommandsEnabled(bool isEnabled, const QString& theParent = QString()); - + //! Sets to enabled state all siblings of the given operation and it's parents recursively void setNestedStackEnabled(ModuleBase_Operation* theOperation); - + //! Sets the action with theId to theChecked state. void setActionChecked(const QString& theId, const bool theChecked); - + //! Sets the action with theId to theEnabled state. void setActionEnabled(const QString& theId, const bool theEnabled); - + //! Updates actions according to their "document" tag void updateByDocumentKind(); diff --git a/src/XGUI/XGUI_ColorDialog.cpp b/src/XGUI/XGUI_ColorDialog.cpp index 0df84128d..8c6948b9f 100644 --- a/src/XGUI/XGUI_ColorDialog.cpp +++ b/src/XGUI/XGUI_ColorDialog.cpp @@ -85,7 +85,7 @@ void appendValues(std::vector& theRGB, const int theRed, const int theGreen bool containsValues(std::map >& theColorMap, std::vector& theValues) { - std::map >::const_iterator anIt = theColorMap.begin(), + std::map >::const_iterator anIt = theColorMap.begin(), aLast = theColorMap.end(); bool isFound = false; for (; anIt != aLast && !isFound; anIt++) { diff --git a/src/XGUI/XGUI_ColorDialog.h b/src/XGUI/XGUI_ColorDialog.h index 6dbee367e..661b27808 100644 --- a/src/XGUI/XGUI_ColorDialog.h +++ b/src/XGUI/XGUI_ColorDialog.h @@ -38,14 +38,14 @@ public: /// \param theValue an RGB components value void setColor(const std::vector& theValue); - /// Returns a container with the current color value. + /// Returns a container with the current color value. /// These are tree int values for RGB definition. - /// These value is depend on the random choice and eighter + /// These value is depend on the random choice and eighter /// a next random color or a certain color. /// \return a vector of values std::vector getColor() const; - /// Returns a container with the current color value. + /// Returns a container with the current color value. /// These are tree int values for RGB definition. /// It returns the next random color. /// \return a vector of values diff --git a/src/XGUI/XGUI_ContextMenuMgr.cpp b/src/XGUI/XGUI_ContextMenuMgr.cpp index 1bef5f51f..b99cfdd6b 100644 --- a/src/XGUI/XGUI_ContextMenuMgr.cpp +++ b/src/XGUI/XGUI_ContextMenuMgr.cpp @@ -218,7 +218,7 @@ void XGUI_ContextMenuMgr::onContextMenuRequest(QContextMenuEvent* theEvent) } } -void XGUI_ContextMenuMgr::updateObjectBrowserMenu() +void XGUI_ContextMenuMgr::updateObjectBrowserMenu() { foreach(QAction* aAction, myActions) aAction->setEnabled(false); @@ -340,7 +340,7 @@ void XGUI_ContextMenuMgr::updateViewerMenu() XGUI_SelectionMgr* aSelMgr = myWorkshop->selector(); XGUI_Displayer* aDisplayer = myWorkshop->displayer(); - QList aPrsList = + QList aPrsList = aSelMgr->selection()->getSelected(ModuleBase_ISelection::Viewer); if (aPrsList.size() > 0) { bool isVisible = false; @@ -353,7 +353,7 @@ void XGUI_ContextMenuMgr::updateViewerMenu() if (aRes && aRes->isDisplayed()) { isVisible = true; canBeShaded = myWorkshop->displayer()->canBeShaded(aObject); - isShading = + isShading = (myWorkshop->displayer()->displayMode(aObject) == XGUI_Displayer::Shading); break; } @@ -394,10 +394,10 @@ void XGUI_ContextMenuMgr::updateViewerMenu() } else { foreach(int aMode, aModes) { switch (aMode) { - case TopAbs_VERTEX: + case TopAbs_VERTEX: action("SELECT_VERTEX_CMD")->setChecked(true); break; - case TopAbs_EDGE: + case TopAbs_EDGE: action("SELECT_EDGE_CMD")->setChecked(true); break; case TopAbs_FACE: @@ -407,7 +407,7 @@ void XGUI_ContextMenuMgr::updateViewerMenu() action("SELECT_RESULT_CMD")->setChecked(true); } } - } + } ModuleBase_IModule* aModule = myWorkshop->module(); if (aModule) @@ -566,7 +566,7 @@ void XGUI_ContextMenuMgr::addObjBrowserMenu(QMenu* theMenu) const void XGUI_ContextMenuMgr::addViewerMenu(QMenu* theMenu) const { XGUI_SelectionMgr* aSelMgr = myWorkshop->selector(); - QList aPrsList = + QList aPrsList = aSelMgr->selection()->getSelected(ModuleBase_ISelection::Viewer); int aSelected = aPrsList.size(); QActionsList aActions; @@ -658,7 +658,7 @@ void XGUI_ContextMenuMgr::onRename() { QObjectPtrList anObjects = myWorkshop->selector()->selection()->selectedObjects(); if (!myWorkshop->abortAllOperations()) - return; + return; // restore selection in case if dialog box was shown myWorkshop->objectBrowser()->setObjectsSelected(anObjects); myWorkshop->objectBrowser()->onEditItem(); @@ -686,18 +686,18 @@ void XGUI_ContextMenuMgr::addFeatures(QMenu* theMenu) const return; if ((!aIsRoot) && (aIdx.internalPointer() != aActiveDoc.get())) return; - + // Get name of the selected index aName = aIdx.data().toString(); aLen = aName.indexOf('('); if (aLen != -1) { aName = aName.left(--aLen); } - std::string aFeaturesStr = aIsRoot? + std::string aFeaturesStr = aIsRoot? aDataModelXML->rootFolderFeatures(aName.toStdString()) : aDataModelXML->subFolderFeatures(aName.toStdString()); if (aFeaturesStr.length() > 0) { - QStringList aFeturesList = + QStringList aFeturesList = QString(aFeaturesStr.c_str()).split(",", QString::SkipEmptyParts); foreach(QString aFea, aFeturesList) { QAction* aAction = aActionMgr->action(aFea); diff --git a/src/XGUI/XGUI_CustomPrs.cpp b/src/XGUI/XGUI_CustomPrs.cpp index 8b2b3eee8..f46907497 100644 --- a/src/XGUI/XGUI_CustomPrs.cpp +++ b/src/XGUI/XGUI_CustomPrs.cpp @@ -45,7 +45,7 @@ void getColor(const ResultPtr& theResult, std::vector& theColor) { theColor.clear(); // get color from the attribute of the result - if (theResult.get() != NULL && + if (theResult.get() != NULL && theResult->data()->attribute(ModelAPI_Result::COLOR_ID()).get() != NULL) { AttributeIntArrayPtr aColorAttr = theResult->data()->intArray(ModelAPI_Result::COLOR_ID()); if (aColorAttr.get() && aColorAttr->size()) { @@ -72,7 +72,7 @@ void XGUI_CustomPrs::getDefaultColor(ObjectPtr theObject, const bool isEmptyColo // all AIS objects, where the color is not set, are in black. // The color should be defined in XML or set in the attribute theColor = Config_PropManager::color("Visualization", "object_default_color", "#000000"); - Events_InfoMessage("XGUI_CustomPrs", + Events_InfoMessage("XGUI_CustomPrs", "A default color is not defined in the preferences for this kind of result").send(); } } @@ -137,7 +137,7 @@ bool XGUI_CustomPrs::customisePresentation(ResultPtr theResult, AISObjectPtr the SessionPtr aMgr = ModelAPI_Session::get(); if (aMgr->activeDocument() != theResult->document()) { QColor aQColor(aColor[0], aColor[1], aColor[2]); - QColor aNewColor = + QColor aNewColor = QColor::fromHsvF(aQColor.hueF(), aQColor.saturationF()/3., aQColor.valueF()); aColor[0] = aNewColor.red(); aColor[1] = aNewColor.green(); diff --git a/src/XGUI/XGUI_DataModel.cpp b/src/XGUI/XGUI_DataModel.cpp index 724553906..8d05f330f 100644 --- a/src/XGUI/XGUI_DataModel.cpp +++ b/src/XGUI/XGUI_DataModel.cpp @@ -118,7 +118,7 @@ void XGUI_DataModel::processEvent(const std::shared_ptr& theMess if (aFolderId != -1) { insertRow(aRow, createIndex(aFolderId, 0, -1)); } - } + } } } else { // Object created in sub-document @@ -270,7 +270,7 @@ void XGUI_DataModel::processEvent(const std::shared_ptr& theMess // Update a group under root if (aGroup == myXMLReader->rootType()) // Update objects under root aStartId = foldersCount(); - else // Update objects in folder under root + else // Update objects in folder under root aParent = createIndex(folderId(aGroup), 0, -1); } else { // Update a sub-document @@ -278,7 +278,7 @@ void XGUI_DataModel::processEvent(const std::shared_ptr& theMess // Update sub-document root aParent = findDocumentRootIndex(aDoc.get()); aStartId = foldersCount(aDoc.get()); - } else + } else // update folder in sub-document aParent = createIndex(folderId(aGroup, aDoc.get()), 0, aDoc.get()); } @@ -293,11 +293,11 @@ void XGUI_DataModel::processEvent(const std::shared_ptr& theMess QModelIndex aDocRoot = findDocumentRootIndex(aDoc.get()); if (aDocRoot.isValid()) emit dataChanged(aDocRoot, aDocRoot); - else + else // We have got a new document rebuildDataTree(); } - } + } } //****************************************************** @@ -361,15 +361,15 @@ QModelIndex XGUI_DataModel::objectIndex(const ObjectPtr theObject) const } if (aRow == -1) return QModelIndex(); - else + else return createIndex(aRow, 0, theObject.get()); } SessionPtr aSession = ModelAPI_Session::get(); DocumentPtr aRootDoc = aSession->moduleDocument(); - if (aDoc == aRootDoc && myXMLReader->rootType() == aType) { + if (aDoc == aRootDoc && myXMLReader->rootType() == aType) { // The object from root document aRow += foldersCount(); - } else if (myXMLReader->subType() == aType) { + } else if (myXMLReader->subType() == aType) { // The object from sub document aRow += foldersCount(aDoc.get()); } @@ -394,7 +394,7 @@ QVariant XGUI_DataModel::data(const QModelIndex& theIndex, int theRole) const if (aParentId == -1) { // root folders switch (theRole) { case Qt::DisplayRole: - return QString(myXMLReader->rootFolderName(theIndexRow).c_str()) + + return QString(myXMLReader->rootFolderName(theIndexRow).c_str()) + QString(" (%1)").arg(rowCount(theIndex)); case Qt::DecorationRole: return QIcon(myXMLReader->rootFolderIcon(theIndexRow).c_str()); @@ -422,12 +422,12 @@ QVariant XGUI_DataModel::data(const QModelIndex& theIndex, int theRole) const if (aSubDoc) { // this is a folder of sub document QIntList aMissedIdx = missedFolderIndexes(aSubDoc); int aRow = theIndexRow; - while (aMissedIdx.contains(aRow)) + while (aMissedIdx.contains(aRow)) aRow++; switch (theRole) { case Qt::DisplayRole: - return QString(myXMLReader->subFolderName(aRow).c_str()) + + return QString(myXMLReader->subFolderName(aRow).c_str()) + QString(" (%1)").arg(rowCount(theIndex)); case Qt::DecorationRole: return QIcon(myXMLReader->subFolderIcon(aRow).c_str()); @@ -439,7 +439,7 @@ QVariant XGUI_DataModel::data(const QModelIndex& theIndex, int theRole) const { if (aObj->groupName() == ModelAPI_ResultParameter::group()) { ModelAPI_ResultParameter* aParam = dynamic_cast(aObj); - AttributeDoublePtr aValueAttribute = + AttributeDoublePtr aValueAttribute = aParam->data()->real(ModelAPI_ResultParameter::VALUE()); QString aVal = QString::number(aValueAttribute->value()); QString aTitle = QString(aObj->data()->name().c_str()); @@ -488,7 +488,7 @@ int XGUI_DataModel::rowCount(const QModelIndex& theParent) const } int aId = theParent.internalId(); - if (aId == -1) { + if (aId == -1) { // this is a folder under root int aParentPos = theParent.row(); std::string aType = myXMLReader->rootFolderType(aParentPos); @@ -496,11 +496,11 @@ int XGUI_DataModel::rowCount(const QModelIndex& theParent) const } else { // It is an object which could have children ModelAPI_Document* aDoc = getSubDocument(theParent.internalPointer()); - if (aDoc) { + if (aDoc) { // a folder of sub-document QIntList aMissedIdx = missedFolderIndexes(aDoc); int aRow = theParent.row(); - while (aMissedIdx.contains(aRow)) + while (aMissedIdx.contains(aRow)) aRow++; std::string aType = myXMLReader->subFolderType(aRow); return aDoc->size(aType); @@ -522,10 +522,10 @@ int XGUI_DataModel::rowCount(const QModelIndex& theParent) const } else { // Check for composite object ModelAPI_CompositeFeature* aCompFeature = dynamic_cast(aObj); - if (aCompFeature) + if (aCompFeature) return aCompFeature->numberOfSubs(true); ModelAPI_ResultCompSolid* aCompRes = dynamic_cast(aObj); - if (aCompRes) + if (aCompRes) return aCompRes->numberOfSubs(true); } } @@ -571,7 +571,7 @@ QModelIndex XGUI_DataModel::index(int theRow, int theColumn, const QModelIndex & } else { // It is an object which could have children ModelAPI_Document* aDoc = getSubDocument(theParent.internalPointer()); - if (aDoc) { + if (aDoc) { // It is a folder of sub-document int aParentRow = aParentPos; QIntList aMissedIdx = missedFolderIndexes(aDoc); @@ -600,14 +600,14 @@ QModelIndex XGUI_DataModel::index(int theRow, int theColumn, const QModelIndex & } } else { // Check for composite object - ModelAPI_CompositeFeature* aCompFeature = + ModelAPI_CompositeFeature* aCompFeature = dynamic_cast(aParentObj); if (aCompFeature) { aIndex = objectIndex(aCompFeature->subFeature(theRow)); } else { - ModelAPI_ResultCompSolid* aCompRes = + ModelAPI_ResultCompSolid* aCompRes = dynamic_cast(aParentObj); - if (aCompRes) + if (aCompRes) aIndex = objectIndex(aCompRes->subResult(theRow)); } } @@ -632,7 +632,7 @@ QModelIndex XGUI_DataModel::parent(const QModelIndex& theIndex) const int aId = theIndex.internalId(); if (aId != -1) { // The object is not a root folder ModelAPI_Document* aDoc = getSubDocument(theIndex.internalPointer()); - if (aDoc) { + if (aDoc) { // It is a folder of sub-document return findDocumentRootIndex(aDoc); } @@ -682,7 +682,7 @@ QModelIndex XGUI_DataModel::parent(const QModelIndex& theIndex) const return createIndex(aFolderId, 0, aSubDoc.get()); } } - } + } return QModelIndex(); } @@ -736,13 +736,13 @@ Qt::ItemFlags XGUI_DataModel::flags(const QModelIndex& theIndex) const if (aObj) { // An object - if (aObj->isDisabled()) + if (aObj->isDisabled()) return theIndex.column() == 1? Qt::ItemIsSelectable : aNullFlag; if (aSession->moduleDocument() != aObj->document()) if (aActiveDoc != aObj->document()) return theIndex.column() == 1? Qt::ItemIsSelectable : aNullFlag; - + bool isCompositeSub = false; // An object which is sub-object of a composite object can not be accessible in column 1 if (theIndex.column() == 1) { @@ -750,13 +750,13 @@ Qt::ItemFlags XGUI_DataModel::flags(const QModelIndex& theIndex) const FeaturePtr aFeature = std::dynamic_pointer_cast(aObjPtr); if (aFeature.get()) { CompositeFeaturePtr aCompFea = ModelAPI_Tools::compositeOwner(aFeature); - if (aCompFea.get()) + if (aCompFea.get()) isCompositeSub = true; } else { ResultPtr aResult = std::dynamic_pointer_cast(aObjPtr); if (aResult.get()) { ResultCompSolidPtr aCompRes = ModelAPI_Tools::compSolidOwner(aResult); - if (aCompRes.get()) + if (aCompRes.get()) isCompositeSub = true; } } @@ -826,7 +826,7 @@ QModelIndex XGUI_DataModel::documentRootIndex(DocumentPtr theDoc) const DocumentPtr aRootDoc = aSession->moduleDocument(); if (theDoc == aRootDoc) return QModelIndex(); - else + else return findDocumentRootIndex(theDoc.get()); } @@ -914,7 +914,7 @@ QModelIndex XGUI_DataModel::lastHistoryIndex() const } else { if (aCurDoc == aSession->moduleDocument()) return createIndex(foldersCount() - 1, 1, -1); - else + else return createIndex(foldersCount(aCurDoc.get()) - 1, 1, aCurDoc.get()); } } diff --git a/src/XGUI/XGUI_DataModel.h b/src/XGUI/XGUI_DataModel.h index a6918f628..ed5652d04 100644 --- a/src/XGUI/XGUI_DataModel.h +++ b/src/XGUI/XGUI_DataModel.h @@ -71,7 +71,7 @@ public: virtual QVariant headerData(int theSection, Qt::Orientation theOrient, int theRole = Qt::DisplayRole) const; - /// Returns the number of rows under the given parent. When the parent is valid it means that + /// Returns the number of rows under the given parent. When the parent is valid it means that /// rowCount is returning the number of children of parent. /// \param theParent a parent model index virtual int rowCount(const QModelIndex& theParent = QModelIndex()) const; @@ -81,7 +81,7 @@ public: /// \param theParent a parent model index virtual int columnCount(const QModelIndex& theParent = QModelIndex()) const; - /// Returns the index of the item in the model specified by the given row, + /// Returns the index of the item in the model specified by the given row, /// column and parent index. /// \param theRow a row /// \param theColumn a column @@ -89,7 +89,7 @@ public: virtual QModelIndex index(int theRow, int theColumn, const QModelIndex &theParent = QModelIndex()) const; - /// Returns the parent of the model item with the given index. + /// Returns the parent of the model item with the given index. /// If the item has no parent, an invalid QModelIndex is returned. /// \param theIndex a model index virtual QModelIndex parent(const QModelIndex& theIndex) const; @@ -98,7 +98,7 @@ public: /// \param theParent a parent model index virtual bool hasChildren(const QModelIndex& theParent = QModelIndex()) const; - /// Inserts count rows into the model before the given row. + /// Inserts count rows into the model before the given row. /// Items in the new row will be children of the item represented by the parent model index. /// \param theRow a start row /// \param theCount a nember of rows to insert @@ -134,16 +134,16 @@ private: /// \param theDoc the document object QModelIndex findDocumentRootIndex(const ModelAPI_Document* theDoc) const; - /// Returns number of folders in document. + /// Returns number of folders in document. /// Considered folders which has to be shown only if they are not empty. /// \param theDoc document which has to be checked. If 0 then Root document will be considered int foldersCount(ModelAPI_Document* theDoc = 0) const; /// Retrurns indexes of folders which can not be shown because they are empty - /// \param theDoc document which has to be checked. If 0 then Root document will be considered + /// \param theDoc document which has to be checked. If 0 then Root document will be considered QIntList missedFolderIndexes(ModelAPI_Document* theDoc = 0) const; - /// Returns Id (row) of a folder taking into consideration + /// Returns Id (row) of a folder taking into consideration /// folders which can not be shown non empty /// \param theType Type of the folder /// \param theDoc a document which contains this folder diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index d10b58ebd..414490ede 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -64,7 +64,7 @@ #include /// defines the local context mouse selection sensitivity -const int MOUSE_SENSITIVITY_IN_PIXEL = 10; +const int MOUSE_SENSITIVITY_IN_PIXEL = 10; //#define DEBUG_ACTIVATE_OBJECTS //#define DEBUG_DEACTIVATE @@ -134,7 +134,7 @@ bool XGUI_Displayer::display(ObjectPtr theObject, bool theUpdateViewer) bool aDisplayed = false; if (isVisible(theObject)) { #ifdef DEBUG_COMPOSILID_DISPLAY - ResultCompSolidPtr aCompsolidResult = + ResultCompSolidPtr aCompsolidResult = std::dynamic_pointer_cast(theObject); if (aCompsolidResult.get()) { for(int i = 0; i < aCompsolidResult->numberOfSubs(); i++) { @@ -155,7 +155,7 @@ bool XGUI_Displayer::display(ObjectPtr theObject, bool theUpdateViewer) if (aPrs.get() != NULL) { anAIS = aPrs->getAISObject(anAIS); if (anAIS.get()) { - // correct deviation coefficient for + // correct deviation coefficient for /*Handle(AIS_InteractiveObject) anAISPrs = anAIS->impl(); if (!anAISPrs.IsNull()) { Handle(AIS_Shape) aShapePrs = Handle(AIS_Shape)::DownCast(anAISPrs); @@ -170,7 +170,7 @@ bool XGUI_Displayer::display(ObjectPtr theObject, bool theUpdateViewer) ResultPtr aResult = std::dynamic_pointer_cast(theObject); if (aResult.get() != NULL) { #ifdef DEBUG_COMPOSILID_DISPLAY - ResultCompSolidPtr aCompsolidResult = + ResultCompSolidPtr aCompsolidResult = std::dynamic_pointer_cast(theObject); if (aCompsolidResult.get()) { for(int i = 0; i < aCompsolidResult->numberOfSubs(); i++) { @@ -186,7 +186,7 @@ bool XGUI_Displayer::display(ObjectPtr theObject, bool theUpdateViewer) std::shared_ptr aShapePtr = ModelAPI_Tools::shape(aResult); if (aShapePtr.get() != NULL) { anAIS = AISObjectPtr(new GeomAPI_AISObject()); - Handle(AIS_InteractiveObject) anAISPrs = + Handle(AIS_InteractiveObject) anAISPrs = myWorkshop->module()->createPresentation(aResult); if (anAISPrs.IsNull()) anAISPrs = new ModuleBase_ResultPrs(aResult); @@ -228,7 +228,7 @@ bool canBeShaded(Handle(AIS_InteractiveObject) theAIS, ModuleBase_IModule* theMo return false; } -bool XGUI_Displayer::display(ObjectPtr theObject, AISObjectPtr theAIS, +bool XGUI_Displayer::display(ObjectPtr theObject, AISObjectPtr theAIS, bool isShading, bool theUpdateViewer) { bool aDisplayed = false; @@ -247,12 +247,12 @@ bool XGUI_Displayer::display(ObjectPtr theObject, AISObjectPtr theAIS, if (isShading) anAISIO->Attributes()->SetFaceBoundaryDraw( Standard_True ); anAISIO->SetDisplayMode(aDispMode); - aContext->Display(anAISIO, aDispMode, 0, false, true, AIS_DS_Displayed); + aContext->Display(anAISIO, aDispMode, 0, false, true, AIS_DS_Displayed); aDisplayed = true; emit objectDisplayed(theObject, theAIS); activate(anAISIO, myActiveSelectionModes, theUpdateViewer); - } + } if (theUpdateViewer) updateViewer(); @@ -319,7 +319,7 @@ bool XGUI_Displayer::redisplay(ObjectPtr theObject, bool theUpdateViewer) Handle(AIS_InteractiveContext) aContext = AISContext(); if (!aContext.IsNull() && !aAISIO.IsNull()) { // Check that the visualized shape is the same and the redisplay is not necessary - // Redisplay of AIS object leads to this object selection compute and the selection + // Redisplay of AIS object leads to this object selection compute and the selection // in the browser is lost // this check is not necessary anymore because the selection store/restore is realized // before and after the values modification. @@ -409,7 +409,7 @@ void XGUI_Displayer::deactivate(ObjectPtr theObject, const bool theUpdateViewer) deactivateAIS(anAIS); // the selection from the previous activation modes should be cleared manually (#26172) aContext->LocalContext()->ClearOutdatedSelection(anAIS, true); - ModuleBase_Tools::selectionInfo(aContext, + ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::deactivate -- ClearOutdatedSelection"); if (theUpdateViewer) updateViewer(); @@ -453,7 +453,7 @@ void XGUI_Displayer::getModesOfActivation(ObjectPtr theObject, QIntList& theMode int XGUI_Displayer::getSelectionMode(int theShapeType) { - return (theShapeType > TopAbs_SHAPE) ? theShapeType : + return (theShapeType > TopAbs_SHAPE) ? theShapeType : AIS_Shape::SelectionMode((TopAbs_ShapeEnum)theShapeType); } @@ -464,11 +464,11 @@ bool XGUI_Displayer::isVisible(XGUI_Displayer* theDisplayer, const ObjectPtr& th ResultPtr aResult = std::dynamic_pointer_cast(theObject); if (aPrs.get() || aResult.get()) { aVisible = theDisplayer->isVisible(theObject); - // compsolid is not visualized in the viewer, + // compsolid is not visualized in the viewer, // but should have presentation when all sub solids are // visible. It is useful for highlight presentation where compsolid shape is selectable if (!aVisible && aResult.get() && aResult->groupName() == ModelAPI_ResultCompSolid::group()) { - ResultCompSolidPtr aCompsolidResult = + ResultCompSolidPtr aCompsolidResult = std::dynamic_pointer_cast(aResult); if (aCompsolidResult.get() != NULL) { // change colors for all sub-solids bool anAllSubsVisible = aCompsolidResult->numberOfSubs() > 0; @@ -561,7 +561,7 @@ void XGUI_Displayer::activateObjects(const QIntList& theModes, const QObjectPtrL myActiveSelectionModes = aNewModes; Handle(AIS_InteractiveContext) aContext = AISContext(); // Open local context if there is no one - if (aContext.IsNull() || !aContext->HasOpenedContext()) + if (aContext.IsNull() || !aContext->HasOpenedContext()) return; //aContext->UseDisplayedObjects(); @@ -602,7 +602,7 @@ bool XGUI_Displayer::isActive(ObjectPtr theObject) const Handle(AIS_InteractiveContext) aContext = AISContext(); if (aContext.IsNull() || !isVisible(theObject)) return false; - + AISObjectPtr anObj = myResult2AISObjectMap[theObject]; Handle(AIS_InteractiveObject) anAIS = anObj->impl(); @@ -612,7 +612,7 @@ bool XGUI_Displayer::isActive(ObjectPtr theObject) const } -void XGUI_Displayer::setSelected(const QList& theValues, +void XGUI_Displayer::setSelected(const QList& theValues, bool theUpdateViewer) { Handle(AIS_InteractiveContext) aContext = AISContext(); @@ -621,7 +621,7 @@ void XGUI_Displayer::setSelected(const QList& theValue if (aContext->HasOpenedContext()) { aContext->UnhilightSelected(false); aContext->ClearSelected(false); - NCollection_DataMap> + NCollection_DataMap> aShapesToBeSelected; foreach (ModuleBase_ViewerPrsPtr aPrs, theValues) { @@ -675,7 +675,7 @@ void XGUI_Displayer::setSelected(const QList& theValue } } } - ModuleBase_Tools::selectionInfo(aContext, + ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::setSelected -- AddOrRemoveSelected/UnhilightCurrents(no local context)"); if (theUpdateViewer) updateViewer(); @@ -933,14 +933,14 @@ void XGUI_Displayer::activateAIS(const Handle(AIS_InteractiveObject)& theIO, // the fix from VPA for more suitable selection of sketcher lines if (theIO->Width() > 1) { double aPrecision = theIO->Width() + 2; - if (theMode == getSelectionMode(TopAbs_VERTEX)) - aPrecision = ModuleBase_Preferences::resourceMgr()->doubleValue("Viewer", + if (theMode == getSelectionMode(TopAbs_VERTEX)) + aPrecision = ModuleBase_Preferences::resourceMgr()->doubleValue("Viewer", "point-selection-sensitivity", 20); - else if ((theMode == getSelectionMode(TopAbs_EDGE)) || + else if ((theMode == getSelectionMode(TopAbs_EDGE)) || (theMode == getSelectionMode(TopAbs_WIRE))) - aPrecision = theIO->Width() + - ModuleBase_Preferences::resourceMgr()->doubleValue("Viewer", + aPrecision = theIO->Width() + + ModuleBase_Preferences::resourceMgr()->doubleValue("Viewer", "edge-selection-sensitivity", 2); aContext->SetSelectionSensitivity(theIO, theMode, aPrecision); } @@ -957,17 +957,17 @@ void XGUI_Displayer::activateAIS(const Handle(AIS_InteractiveObject)& theIO, } } -void XGUI_Displayer::deactivateAIS(const Handle(AIS_InteractiveObject)& theIO, +void XGUI_Displayer::deactivateAIS(const Handle(AIS_InteractiveObject)& theIO, const int theMode) const { Handle(AIS_InteractiveContext) aContext = AISContext(); if (!aContext.IsNull()) { if (theMode == -1) aContext->Deactivate(theIO); - else + else aContext->Deactivate(theIO, theMode); ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::deactivateAIS -- Deactivate"); - + #ifdef DEBUG_DEACTIVATE_AIS ObjectPtr anObject = getObject(theIO); anInfo.append(ModuleBase_Tools::objectInfo((*anIt))); @@ -1182,7 +1182,7 @@ void XGUI_Displayer::showOnly(const QObjectPtrList& theList) } bool XGUI_Displayer::canBeShaded(ObjectPtr theObject) const -{ +{ if (!isVisible(theObject)) return false; @@ -1201,7 +1201,7 @@ bool XGUI_Displayer::activate(const Handle(AIS_InteractiveObject)& theIO, Handle(AIS_InteractiveContext) aContext = AISContext(); if (aContext.IsNull() || theIO.IsNull()) return false; - + bool isActivationChanged = false; // deactivate object in all modes, which are not in the list of activation // It seems that after the IO deactivation the selected state of the IO's owners @@ -1211,7 +1211,7 @@ bool XGUI_Displayer::activate(const Handle(AIS_InteractiveObject)& theIO, // If the selection problem happens again, it is possible to write a test scenario and create // a bug. The bug steps are the following: // Create two IO, activate them in 5 modes, select the first IO, deactivate 3 modes for both, - // with clicked SHIFT select the second object. + // with clicked SHIFT select the second object. // The result is the selection of the first IO is lost. TColStd_ListOfInteger aTColModes; aContext->ActivatedModes(theIO, aTColModes); @@ -1233,7 +1233,7 @@ bool XGUI_Displayer::activate(const Handle(AIS_InteractiveObject)& theIO, // the selection from the previous activation modes should be cleared manually (#26172) theIO->ClearSelected(); aContext->LocalContext()->ClearOutdatedSelection(theIO, true); - ModuleBase_Tools::selectionInfo(aContext, + ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::activate -- ClearSelected/ClearOutdatedSelection"); // For performance issues //if (theUpdateViewer) @@ -1293,8 +1293,8 @@ bool XGUI_Displayer::customizeObject(ObjectPtr theObject) } -QColor XGUI_Displayer::setObjectColor(ObjectPtr theObject, - const QColor& theColor, +QColor XGUI_Displayer::setObjectColor(ObjectPtr theObject, + const QColor& theColor, bool theUpdateViewer) { if (!isVisible(theObject)) @@ -1330,7 +1330,7 @@ std::string XGUI_Displayer::getResult2AISObjectMapInfo() const aPtrStr << "aObj = " << aObj.get() << ":"; aPtrStr << "anAIS = " << aAISObj.get() << ":"; aPtrStr << "[" << ModuleBase_Tools::objectInfo(aObj).toStdString().c_str() << "]"; - + aContent.append(aPtrStr.str().c_str()); } return QString("myResult2AISObjectMap: size = %1\n%2\n").arg(myResult2AISObjectMap.size()). @@ -1373,9 +1373,9 @@ void XGUI_Displayer::getPresentations(const ObjectPtr& theObject, } } -void XGUI_Displayer::activateTrihedron(bool theIsActive) -{ - myIsTrihedronActive = theIsActive; +void XGUI_Displayer::activateTrihedron(bool theIsActive) +{ + myIsTrihedronActive = theIsActive; if (!myIsTrihedronActive) { deactivateTrihedron(true); } @@ -1413,14 +1413,14 @@ void XGUI_Displayer::displayTrihedron(bool theToDisplay) const updateViewer(); } -QIntList XGUI_Displayer::activeSelectionModes() const -{ +QIntList XGUI_Displayer::activeSelectionModes() const +{ QIntList aModes; foreach (int aMode, myActiveSelectionModes) { // aMode < 9 is a Shape Enum values aModes << ((aMode < 9)? AIS_Shape::SelectionType(aMode) : aMode); } - return aModes; + return aModes; } void XGUI_Displayer::AddOrRemoveSelectedShapes(Handle(AIS_InteractiveContext) theContext, diff --git a/src/XGUI/XGUI_Displayer.h b/src/XGUI/XGUI_Displayer.h index aa1723060..ea3af4c2c 100644 --- a/src/XGUI/XGUI_Displayer.h +++ b/src/XGUI/XGUI_Displayer.h @@ -42,13 +42,13 @@ class XGUI_EXPORT XGUI_Displayer: public QObject Q_OBJECT public: /// \enum DisplayMode display mode - enum DisplayMode { + enum DisplayMode { /// Mode is not defined - NoMode = -1, + NoMode = -1, /// Wireframe display mode - Wireframe, + Wireframe, /// Shading display mode - Shading + Shading }; /// Constructor @@ -68,7 +68,7 @@ class XGUI_EXPORT XGUI_Displayer: public QObject /// \return true if the object visibility state is changed bool display(ObjectPtr theObject, bool theUpdateViewer = true); - /// Display the given AIS object. + /// Display the given AIS object. /// This object is not added to the displayer internal map of objects /// So, it can not be obtained from displayer. This is just a wrap method of OCC display in /// order to perform the display with correct flags. @@ -94,7 +94,7 @@ class XGUI_EXPORT XGUI_Displayer: public QObject /// empty, select it, otherwise select the result. /// \param theValues a list of presentation to be selected /// \param theUpdateViewer the parameter whether the viewer should be update immediatelly - void setSelected(const QList>& theValues, + void setSelected(const QList>& theValues, bool theUpdateViewer = true); /// Unselect all objects @@ -141,7 +141,7 @@ class XGUI_EXPORT XGUI_Displayer: public QObject /// Remove all selection filters void removeFilters(); - /// Sets a flag to the displayer whether the internal viewer can be updated by + /// Sets a flag to the displayer whether the internal viewer can be updated by /// the updateViewer method call. If it is not enabled, this method do nothing. /// This state maintain recurse, if the update is blocked twice or three times, the /// viewer will not be updated until it is unblocked necessary times @@ -162,7 +162,7 @@ class XGUI_EXPORT XGUI_Displayer: public QObject void activateAIS(const Handle(AIS_InteractiveObject)& theIO, const int theMode, const bool theUpdateViewer) const; - /// Activate interactive context. It is necessary to call ClearOutdatedSelection + /// Activate interactive context. It is necessary to call ClearOutdatedSelection /// after deactivation /// \param theIO an interactive object /// \param theMode a mode to deactivate. When theMode=-1 then all modes will be deactivated @@ -231,7 +231,7 @@ class XGUI_EXPORT XGUI_Displayer: public QObject bool canBeShaded(ObjectPtr theObject) const; /// Set color on presentation of an object if it is displayed - /// \param theObject an object + /// \param theObject an object /// \param theColor a color which has to be set /// \param theUpdateViewer update viewer flag /// \return previously defined color on the object @@ -239,7 +239,7 @@ class XGUI_EXPORT XGUI_Displayer: public QObject /// Returns Trihedron object if it is displayed Handle(AIS_InteractiveObject) getTrihedron() const; - + /// Set trihedron active (used in selection) or non active void activateTrihedron(bool theIsActive); @@ -341,7 +341,7 @@ private: /// of owners in the context only once. /// \param theContext a viewer context. It has opened local context /// \param theShapesToBeSelected a map of shapes. Owner's shape is searched in the map and the - /// owner is selected if it is found there. + /// owner is selected if it is found there. /// Only first owner is processed(according to OCCT logic) static void AddOrRemoveSelectedShapes(Handle(AIS_InteractiveContext) theContext, const NCollection_DataMapmodule()->isActionEnableStateFixed(XGUI_ActionsMgr::AcceptAll); if (!isActionStateEnabled) { anError = myWorkshop->module()->getFeatureError(theFeature); diff --git a/src/XGUI/XGUI_MenuMgr.cpp b/src/XGUI/XGUI_MenuMgr.cpp index 7a56457d2..4ac9ac6a2 100755 --- a/src/XGUI/XGUI_MenuMgr.cpp +++ b/src/XGUI/XGUI_MenuMgr.cpp @@ -43,7 +43,7 @@ XGUI_MenuMgr::XGUI_MenuMgr(XGUI_Workshop* theWorkshop) void XGUI_MenuMgr::processEvent(const std::shared_ptr& theMessage) { //A message to start feature creation received. - if (theMessage->eventID() == + if (theMessage->eventID() == Events_Loop::loop()->eventByName(Config_FeatureMessage::GUI_EVENT())) { std::shared_ptr aFeatureMsg = std::dynamic_pointer_cast(theMessage); @@ -130,7 +130,7 @@ std::shared_ptr XGUI_MenuMgr::findWorkbench(const std::strin aResultWorkbench = aWorkbench; } if (!aResultWorkbench) { - aResultWorkbench = + aResultWorkbench = std::shared_ptr(new XGUI_MenuWorkbench(theWorkbenchName)); myWorkbenches.push_back(aResultWorkbench); } @@ -152,9 +152,9 @@ void XGUI_MenuMgr::createFeatureActions() for (; aGIt != aGLast; aGIt++) { const std::shared_ptr aGroup = *aGIt; std::string aGName = aGroup->getName(); - const std::list >& aFeaturesInfo = + const std::list >& aFeaturesInfo = aGroup->featuresInfo(); - std::list >::const_iterator aFIt = + std::list >::const_iterator aFIt = aFeaturesInfo.begin(), aFLast = aFeaturesInfo.end(); int aFSize = aFeaturesInfo.size(); for(int i = 0; aFIt != aFLast; aFIt++, i++) { diff --git a/src/XGUI/XGUI_MenuMgr.h b/src/XGUI/XGUI_MenuMgr.h index f0259d873..b841c03a1 100755 --- a/src/XGUI/XGUI_MenuMgr.h +++ b/src/XGUI/XGUI_MenuMgr.h @@ -63,7 +63,7 @@ private: XGUI_Workshop* myWorkshop; ///< the current workshop /// container of existing workbenchs - std::list< std::shared_ptr > myWorkbenches; + std::list< std::shared_ptr > myWorkbenches; }; #endif /* XGUI_MENUMGR_H_ */ diff --git a/src/XGUI/XGUI_ModuleConnector.cpp b/src/XGUI/XGUI_ModuleConnector.cpp index 805144797..7231a1b28 100644 --- a/src/XGUI/XGUI_ModuleConnector.cpp +++ b/src/XGUI/XGUI_ModuleConnector.cpp @@ -117,7 +117,7 @@ void XGUI_ModuleConnector::setSelected(const QList& the myWorkshop->selector()->clearSelection(); } else { aDisp->setSelected(theValues); - } + } } void XGUI_ModuleConnector::setStatusBarMessage(const QString& theMessage) @@ -135,7 +135,7 @@ void XGUI_ModuleConnector::processLaunchOperation(ModuleBase_Operation* theOpera XGUI_OperationMgr* anOperationMgr = workshop()->operationMgr(); if (anOperationMgr->startOperation(theOperation)) { - ModuleBase_OperationFeature* aFOperation = + ModuleBase_OperationFeature* aFOperation = dynamic_cast(theOperation); if (aFOperation) { workshop()->propertyPanel()->updateContentWidget(aFOperation->feature()); @@ -168,9 +168,9 @@ void XGUI_ModuleConnector::updateCommandStatus() myWorkshop->updateCommandStatus(); } -QMainWindow* XGUI_ModuleConnector::desktop() const -{ - return myWorkshop->desktop(); +QMainWindow* XGUI_ModuleConnector::desktop() const +{ + return myWorkshop->desktop(); } @@ -178,8 +178,8 @@ std::shared_ptr XGUI_ModuleConnector::featureInfo(const Q { #ifdef HAVE_SALOME return myWorkshop->salomeConnector()->featureInfo(theId); -#else - AppElements_Command* aAction = +#else + AppElements_Command* aAction = dynamic_cast(myWorkshop->actionsMgr()->action(theId)); if (aAction) return aAction->featureMessage(); diff --git a/src/XGUI/XGUI_ModuleConnector.h b/src/XGUI/XGUI_ModuleConnector.h index 0a00cf57b..062ffe450 100644 --- a/src/XGUI/XGUI_ModuleConnector.h +++ b/src/XGUI/XGUI_ModuleConnector.h @@ -81,7 +81,7 @@ Q_OBJECT //! Returns data object by AIS virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const; - //! Select features clearing previous selection. + //! Select features clearing previous selection. //! If the list is empty then selection will be cleared virtual void setSelected(const QList>& theValues); diff --git a/src/XGUI/XGUI_ObjectsBrowser.cpp b/src/XGUI/XGUI_ObjectsBrowser.cpp index 841318435..4512cf1fe 100644 --- a/src/XGUI/XGUI_ObjectsBrowser.cpp +++ b/src/XGUI/XGUI_ObjectsBrowser.cpp @@ -84,7 +84,7 @@ XGUI_DataTree::XGUI_DataTree(QWidget* theParent) setItemDelegateForColumn(0, new XGUI_TreeViewItemDelegate(this)); - connect(this, SIGNAL(doubleClicked(const QModelIndex&)), + connect(this, SIGNAL(doubleClicked(const QModelIndex&)), SLOT(onDoubleClick(const QModelIndex&))); } @@ -127,7 +127,7 @@ void XGUI_DataTree::commitData(QWidget* theEditor) aEntrance = 0; } -void XGUI_DataTree::clear() +void XGUI_DataTree::clear() { dataModel()->clear(); reset(); @@ -157,7 +157,7 @@ void XGUI_DataTree::onDoubleClick(const QModelIndex& theIndex) ObjectPtr aObj = aModel->object(theIndex); DocumentPtr aDoc = aMgr->activeDocument(); - + std::string aOpName = tr("History change").toStdString(); if (aObj.get()) { if (aObj->document() != aDoc) @@ -200,12 +200,12 @@ void XGUI_DataTree::drawRow(QPainter* thePainter, //******************************************************************** //******************************************************************** //******************************************************************** -void XGUI_TreeViewStyle::drawPrimitive(PrimitiveElement theElement, +void XGUI_TreeViewStyle::drawPrimitive(PrimitiveElement theElement, const QStyleOption* theOption, QPainter* thePainter, const QWidget* theWidget) const { if ((theElement == QStyle::PE_PanelItemViewRow) || (theElement == QStyle::PE_PanelItemViewItem)) { - const QStyleOptionViewItemV4* aOptions = + const QStyleOptionViewItemV4* aOptions = qstyleoption_cast(theOption); if (myIndex.isValid() && ((myIndex.flags() & Qt::ItemIsSelectable) == 0)) { QStyle::State aState = aOptions->state; @@ -225,9 +225,9 @@ void XGUI_TreeViewStyle::drawPrimitive(PrimitiveElement theElement, //******************************************************************** //******************************************************************** XGUI_ActiveDocLbl::XGUI_ActiveDocLbl(const QString& theText, QWidget* theParent ) - : QLabel(theText, theParent), - myPreSelectionStyle(""), - myNeutralStyle(""), + : QLabel(theText, theParent), + myPreSelectionStyle(""), + myNeutralStyle(""), mySelectionStyle(""), myIsSelected(false) { @@ -243,7 +243,7 @@ void XGUI_ActiveDocLbl::setTreeView(QTreeView* theView) QColor aHighlightText = aPalet.highlightedText().color(); myPreSelectionStyle = "QLabel {background-color: "; - myPreSelectionStyle += "qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 white, stop:1 " + + myPreSelectionStyle += "qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 white, stop:1 " + aHighlight.lighter(170).name() + ");"; myPreSelectionStyle += "border: 1px solid lightblue; border-radius: 2px }"; @@ -254,7 +254,7 @@ void XGUI_ActiveDocLbl::setTreeView(QTreeView* theView) #if (!defined HAVE_SALOME) && (defined WIN32) mySelectionStyle = "QLabel {background-color: "; mySelectionStyle += "qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgb(236, 245, 255)"; - mySelectionStyle += ", stop:1 rgb(208, 229, 255));"; + mySelectionStyle += ", stop:1 rgb(208, 229, 255));"; mySelectionStyle += "border: 1px solid rgb(132, 172, 221); border-radius: 2px }"; #else mySelectionStyle = "QLabel {background-color: " + aHighlight.name(); @@ -297,7 +297,7 @@ void XGUI_ActiveDocLbl::mouseReleaseEvent( QMouseEvent* e) MYClearing = true; myIsSelected = true; setStyleSheet(mySelectionStyle); - // We can not block signals because on + // We can not block signals because on // clear selection the View state will not be updated myTreeView->clearSelection(); QLabel::mouseReleaseEvent(e); @@ -335,7 +335,7 @@ XGUI_ObjectsBrowser::XGUI_ObjectsBrowser(QWidget* theParent) aLbl->setPixmap(QPixmap(":pictures/assembly.png")); aLbl->setMargin(2); // Do not paint background of the label (in order to show icon) - aLbl->setAutoFillBackground(false); + aLbl->setAutoFillBackground(false); aLabelLay->addWidget(aLbl); @@ -376,8 +376,8 @@ XGUI_ObjectsBrowser::~XGUI_ObjectsBrowser() } void XGUI_ObjectsBrowser::setXMLReader(Config_DataModelReader* theReader) -{ - myDocModel->setXMLReader(theReader); +{ + myDocModel->setXMLReader(theReader); myTreeView->setModel(myDocModel); // It has to be done after setting of model @@ -495,9 +495,9 @@ void XGUI_ObjectsBrowser::setObjectsSelected(const QObjectPtrList& theObjects) } //*************************************************** -void XGUI_ObjectsBrowser::clearContent() -{ - myTreeView->clear(); +void XGUI_ObjectsBrowser::clearContent() +{ + myTreeView->clear(); } void XGUI_ObjectsBrowser::onSelectionChanged(const QItemSelection& theSelected, diff --git a/src/XGUI/XGUI_OperationMgr.cpp b/src/XGUI/XGUI_OperationMgr.cpp index 7810ef773..6c234bee8 100644 --- a/src/XGUI/XGUI_OperationMgr.cpp +++ b/src/XGUI/XGUI_OperationMgr.cpp @@ -150,7 +150,7 @@ QStringList XGUI_OperationMgr::operationList() const { QStringList result; foreach(ModuleBase_Operation* eachOperation, myOperations) { - ModuleBase_OperationFeature* aFOperation = + ModuleBase_OperationFeature* aFOperation = dynamic_cast(eachOperation); if (aFOperation) { FeaturePtr aFeature = aFOperation->feature(); @@ -250,7 +250,7 @@ bool XGUI_OperationMgr::commitAllOperations() (anOperation); if (aFOperation) { FeaturePtr aFeature = aFOperation->feature(); - CompositeFeaturePtr aComposite = + CompositeFeaturePtr aComposite = std::dynamic_pointer_cast(aFeature); isCompositeCommitted = aComposite.get(); if (isCompositeCommitted) @@ -280,7 +280,7 @@ void XGUI_OperationMgr::updateApplyOfOperations(ModuleBase_Operation* theOperati { XGUI_ErrorMgr* anErrorMgr = XGUI_Tools::workshop(myWorkshop)->errorMgr(); if (theOperation) { - ModuleBase_OperationFeature* aFOperation = + ModuleBase_OperationFeature* aFOperation = dynamic_cast(theOperation); if (aFOperation) anErrorMgr->updateAcceptAllAction(aFOperation->feature()); @@ -374,7 +374,7 @@ bool XGUI_OperationMgr::canStartOperation(const QString& theId) } else if (canStopOperation(aCurrentOp)) { // the started operation is granted in the parrent operation, - // e.g. current - Line in Sketch, started Circle + // e.g. current - Line in Sketch, started Circle stopOperation(aCurrentOp); } else { aCanStart = false; @@ -434,7 +434,7 @@ void XGUI_OperationMgr::onBeforeOperationStarted() return; /// Set current feature and remeber old current feature - ModuleBase_OperationFeature* aFOperation = + ModuleBase_OperationFeature* aFOperation = dynamic_cast(aCurrentOperation); if (aFOperation) { SessionPtr aMgr = ModelAPI_Session::get(); @@ -446,7 +446,7 @@ void XGUI_OperationMgr::onBeforeOperationStarted() // When sketch entity operation started, the sketch should be cashed here as the current. // Otherwise(the flag is true), the ExtrusionCut is cashed, when commit happens, the sketch // is disabled, sketch entity is disabled as extrusion cut is created earliest then sketch. - // As a result the sketch disappears from the viewer. + // As a result the sketch disappears from the viewer. // However after commit it is displayed back. aFOperation->setPreviousCurrentFeature(aDoc->currentFeature(false)); @@ -466,8 +466,8 @@ void XGUI_OperationMgr::onBeforeOperationStarted() if (aFOperation->isEditOperation()) {// it should be performed by the feature edit only // in create operation, the current feature is changed by addFeature() aDoc->setCurrentFeature(aFOperation->feature(), false); - // this is the only place where flushes must be called after setCurrentFeature for the - // current moment: after this the opertion is not finished, so, the ObjectBrowser + // this is the only place where flushes must be called after setCurrentFeature for the + // current moment: after this the opertion is not finished, so, the ObjectBrowser // state may be corrupted (issue #1457) static Events_Loop* aLoop = Events_Loop::loop(); static Events_ID aCreateEvent = aLoop->eventByName(EVENT_OBJECT_CREATED); @@ -512,7 +512,7 @@ void XGUI_OperationMgr::onBeforeOperationCommitted() return; /// Restore the previous current feature - ModuleBase_OperationFeature* aFOperation = + ModuleBase_OperationFeature* aFOperation = dynamic_cast(aCurrentOperation); if (aFOperation) { #ifdef DEBUG_CURRENT_FEATURE @@ -532,9 +532,9 @@ void XGUI_OperationMgr::onBeforeOperationCommitted() setCurrentFeature(aFOperation->previousCurrentFeature()); } else { // create operation - // the Top created feature should stays the current. In nested operations, + // the Top created feature should stays the current. In nested operations, // like Line in the Sketch or - // Sketch in ExtrusionCut, a previous feature should be restored on commit. + // Sketch in ExtrusionCut, a previous feature should be restored on commit. // It is performed here // in order to perform it in the current transaction without opening a new one. if (myOperations.front() != aFOperation) @@ -654,7 +654,7 @@ bool XGUI_OperationMgr::onProcessEnter(QObject* theObject) bool isAborted = false; if (!anActiveWgt) { QWidget* aFocusWidget = aPanel->focusWidget(); - QToolButton* aCancelBtn = + QToolButton* aCancelBtn = dynamic_cast(aPanel)->findButton(PROP_PANEL_CANCEL); if (aFocusWidget && aCancelBtn && aFocusWidget == aCancelBtn) { abortOperation(aOperation); @@ -665,15 +665,15 @@ bool XGUI_OperationMgr::onProcessEnter(QObject* theObject) if (!isAborted) { isAccepted = anActiveWgt && anActiveWgt->processEnter(); if (!isAccepted) { - isAccepted = + isAccepted = myWorkshop->module()->processEnter(anActiveWgt ? anActiveWgt->attributeID() : ""); if (!isAccepted) { /// functionality is similar to Apply click - ModuleBase_OperationFeature* aFOperation = + ModuleBase_OperationFeature* aFOperation = dynamic_cast(currentOperation()); - if (!aFOperation || + if (!aFOperation || myWorkshop->module()->getFeatureError(aFOperation->feature()).isEmpty()) { - // key released is emitted to apply the current value to the model + // key released is emitted to apply the current value to the model // if it was modified in PP emit keyEnterReleased(); commitOperation(); diff --git a/src/XGUI/XGUI_PropertyPanel.cpp b/src/XGUI/XGUI_PropertyPanel.cpp index fa2ba0da8..a26f7eab0 100755 --- a/src/XGUI/XGUI_PropertyPanel.cpp +++ b/src/XGUI/XGUI_PropertyPanel.cpp @@ -43,7 +43,7 @@ //#define DEBUG_TAB_WIDGETS XGUI_PropertyPanel::XGUI_PropertyPanel(QWidget* theParent, XGUI_OperationMgr* theMgr) - : ModuleBase_IPropertyPanel(theParent), + : ModuleBase_IPropertyPanel(theParent), myActiveWidget(NULL), myPreselectionWidget(NULL), myPanelPage(NULL), @@ -217,7 +217,7 @@ void XGUI_PropertyPanel::onActivateNextWidget(ModuleBase_ModelWidget* theWidget) // sketch multi rotation -> single/full point) // it is important to check the widget visibility to do not check of the next widget visible // state if the current is not shown. (example: sketch circle re-entrant operation after mouse - // release in the viewer, next, radius, + // release in the viewer, next, radius, // widget should be activated but the first is not visualized) bool isVisible = theWidget->isVisible(); activateNextWidget(theWidget, isVisible); @@ -511,7 +511,7 @@ void XGUI_PropertyPanel::closeEvent(QCloseEvent* theEvent) theEvent->ignore(); else theEvent->accept(); - } else + } else theEvent->ignore(); } else ModuleBase_IPropertyPanel::closeEvent(theEvent); diff --git a/src/XGUI/XGUI_QtEvents.cpp b/src/XGUI/XGUI_QtEvents.cpp index c7af483a0..0e3e939a8 100644 --- a/src/XGUI/XGUI_QtEvents.cpp +++ b/src/XGUI/XGUI_QtEvents.cpp @@ -9,7 +9,7 @@ #include "XGUI_QtEvents.h" -QEvent::Type PostponeMessageQtEvent::PostponeMessageQtEventType = +QEvent::Type PostponeMessageQtEvent::PostponeMessageQtEventType = QEvent::Type(QEvent::registerEventType()); diff --git a/src/XGUI/XGUI_SalomeConnector.h b/src/XGUI/XGUI_SalomeConnector.h index 01625afc5..c8d81dbda 100644 --- a/src/XGUI/XGUI_SalomeConnector.h +++ b/src/XGUI/XGUI_SalomeConnector.h @@ -38,9 +38,9 @@ class XGUI_EXPORT XGUI_SalomeConnector //! \param isAddSeparator boolean flag about adding separator after the action //! returns created action virtual QAction* addFeature(const QString& theWBName, const QString& theId, - const QString& theTitle, const QString& theTip, + const QString& theTitle, const QString& theTip, const QIcon& theIcon, - const QKeySequence& theKeys, bool isCheckable, + const QKeySequence& theKeys, bool isCheckable, const bool isAddSeparator, const QString& theStatusTip) = 0; diff --git a/src/XGUI/XGUI_Selection.cpp b/src/XGUI/XGUI_Selection.cpp index 584c9fd36..d5510051e 100644 --- a/src/XGUI/XGUI_Selection.cpp +++ b/src/XGUI/XGUI_Selection.cpp @@ -124,7 +124,7 @@ void XGUI_Selection::fillPresentation(ModuleBase_ViewerPrsPtr& thePrs, { thePrs->setOwner(theOwner); - Handle(AIS_InteractiveObject) anIO = + Handle(AIS_InteractiveObject) anIO = Handle(AIS_InteractiveObject)::DownCast(theOwner->Selectable()); thePrs->setInteractive(anIO); @@ -140,7 +140,7 @@ void XGUI_Selection::fillPresentation(ModuleBase_ViewerPrsPtr& thePrs, aShape = findAxisShape(anIO); #endif if (!aShape.IsNull()) { - std::shared_ptr aGeomShape = + std::shared_ptr aGeomShape = std::shared_ptr(new GeomAPI_Shape()); aGeomShape->setImpl(new TopoDS_Shape(aShape)); thePrs->setShape(aGeomShape); @@ -157,7 +157,7 @@ void XGUI_Selection::fillPresentation(ModuleBase_ViewerPrsPtr& thePrs, gp_Lin aLine = aAxis->Component()->Lin(); gp_Dir aDir = aLine.Direction(); std::string aAxName; - if (aDir.X() == 1.) + if (aDir.X() == 1.) aAxName = "OX"; else if (aDir.Y() == 1.) aAxName = "OY"; @@ -199,7 +199,7 @@ void XGUI_Selection::fillPresentation(ModuleBase_ViewerPrsPtr& thePrs, } #endif } - + XGUI_Displayer* aDisplayer = myWorkshop->displayer(); ObjectPtr aFeature = aDisplayer->getObject(anIO); @@ -254,7 +254,7 @@ QList XGUI_Selection::getHighlighted() const if (aContext->HasOpenedContext()) { TopoDS_Shape aShape = aContext->DetectedShape(); if (!aShape.IsNull()) { - std::shared_ptr aGeomShape = + std::shared_ptr aGeomShape = std::shared_ptr(new GeomAPI_Shape()); aGeomShape->setImpl(new TopoDS_Shape(aShape)); aPrs->setShape(aGeomShape); @@ -317,7 +317,7 @@ ObjectPtr XGUI_Selection::getSelectableObject(const Handle(SelectMgr_EntityOwner Handle(SelectMgr_EntityOwner) aEO = theOwner; if (!aEO.IsNull()) { - Handle(AIS_InteractiveObject) anObj = + Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast(aEO->Selectable()); anObject = myWorkshop->displayer()->getObject(anObj); } @@ -377,7 +377,7 @@ TopoDS_Shape XGUI_Selection::findAxisShape(Handle(AIS_InteractiveObject) theIO) Handle(Prs3d_DatumAspect) DA = aAxis->Attributes()->DatumAspect(); Handle(Geom_TrimmedCurve) aTLine = new Geom_TrimmedCurve(aLine, 0, DA->FirstAxisLength()); - BRep_Builder aBuilder; + BRep_Builder aBuilder; TopoDS_Edge aEdge; aBuilder.MakeEdge(aEdge, aTLine, Precision::Confusion()); if (!aEdge.IsNull()) diff --git a/src/XGUI/XGUI_Selection.h b/src/XGUI/XGUI_Selection.h index 785aa18a4..4cb69571d 100644 --- a/src/XGUI/XGUI_Selection.h +++ b/src/XGUI/XGUI_Selection.h @@ -36,7 +36,7 @@ class XGUI_EXPORT XGUI_Selection : public ModuleBase_ISelection /// Returns a list of viewer selected presentations /// \return list of presentations - virtual QList> + virtual QList> getSelected(const SelectionPlace& thePlace = Browser) const; /// Fills the viewer presentation parameters by the parameters from the owner diff --git a/src/XGUI/XGUI_SelectionMgr.cpp b/src/XGUI/XGUI_SelectionMgr.cpp index f32ed5012..b4a2bbc5f 100755 --- a/src/XGUI/XGUI_SelectionMgr.cpp +++ b/src/XGUI/XGUI_SelectionMgr.cpp @@ -65,7 +65,7 @@ void XGUI_SelectionMgr::setSelectedOwners(const SelectMgr_IndexedMapOfOwner& the aContext->AddOrRemoveSelected(anOwner, isUpdateViewer); } } - ModuleBase_Tools::selectionInfo(aContext, + ModuleBase_Tools::selectionInfo(aContext, "XGUI_SelectionMgr::setSelectedOwners -- AddOrRemoveSelected"); } @@ -145,7 +145,7 @@ void XGUI_SelectionMgr::onViewerSelection() FeaturePtr aFeature; Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext(); if (!aContext.IsNull()) { - QList aPresentations = + QList aPresentations = selection()->getSelected(ModuleBase_ISelection::Viewer); foreach(ModuleBase_ViewerPrsPtr aPrs, aPresentations) { if (aPrs->object().get()) { @@ -187,7 +187,7 @@ void XGUI_SelectionMgr::clearSelection() bool aBlocked = myWorkshop->objectBrowser()->blockSignals(true); myWorkshop->objectBrowser()->setObjectsSelected(aFeatures); myWorkshop->objectBrowser()->blockSignals(aBlocked); - + QList aSelectedPrs = myWorkshop->selector()->selection()->getSelected(ModuleBase_ISelection::Browser); diff --git a/src/XGUI/XGUI_Tools.cpp b/src/XGUI/XGUI_Tools.cpp index 02beb1150..cd310eef0 100644 --- a/src/XGUI/XGUI_Tools.cpp +++ b/src/XGUI/XGUI_Tools.cpp @@ -44,7 +44,7 @@ QString dir(const QString& path, bool isAbs) QString file(const QString& path, bool withExt) { QString fPath = path; - while (!fPath.isEmpty() && (fPath[fPath.length() - 1] == '\\' || + while (!fPath.isEmpty() && (fPath[fPath.length() - 1] == '\\' || fPath[fPath.length() - 1] == '/')) fPath.remove(fPath.length() - 1, 1); @@ -131,12 +131,12 @@ bool canRename(const ObjectPtr& theObject, const QString& theName) if (std::dynamic_pointer_cast(theObject).get()) { double aValue; ResultParameterPtr aParam; - if (ModelAPI_Tools::findVariable(theObject->document(), + if (ModelAPI_Tools::findVariable(theObject->document(), FeaturePtr(), qPrintable(theName), aValue, aParam)) { const char* aKeyStr = "Selected parameter can not be renamed to: %1. " "There is a parameter with the same name. Its value is: %2."; QString aErrMsg(QObject::tr(aKeyStr).arg(qPrintable(theName)).arg(aValue)); - // We can not use here a dialog box for message - + // We can not use here a dialog box for message - // it will crash editing process in ObjectBrowser Events_InfoMessage("XGUI_Tools", aErrMsg.toStdString()).send(); return false; diff --git a/src/XGUI/XGUI_ViewerProxy.cpp b/src/XGUI/XGUI_ViewerProxy.cpp index 6233d28ff..aad07467f 100644 --- a/src/XGUI/XGUI_ViewerProxy.cpp +++ b/src/XGUI/XGUI_ViewerProxy.cpp @@ -11,7 +11,7 @@ #include #include #endif - + #include #include @@ -66,7 +66,7 @@ Handle(V3d_View) XGUI_ViewerProxy::activeView() const return myWorkshop->salomeConnector()->viewer()->activeView(); #else AppElements_Viewer* aViewer = myWorkshop->mainWindow()->viewer(); - return (aViewer->activeViewWindow()) ? + return (aViewer->activeViewWindow()) ? aViewer->activeViewWindow()->viewPortApp()->getView() : Handle(V3d_View)(); #endif @@ -78,7 +78,7 @@ QWidget* XGUI_ViewerProxy::activeViewPort() const return myWorkshop->salomeConnector()->viewer()->activeViewPort(); #else AppElements_Viewer* aViewer = myWorkshop->mainWindow()->viewer(); - return (aViewer->activeViewWindow()) ? + return (aViewer->activeViewWindow()) ? aViewer->activeViewWindow()->viewPortApp(): 0; #endif } @@ -113,38 +113,38 @@ void XGUI_ViewerProxy::connectToViewer() ModuleBase_IViewer* aViewer = myWorkshop->salomeConnector()->viewer(); connect(aViewer, SIGNAL(lastViewClosed()), this, SIGNAL(lastViewClosed())); - connect(aViewer, SIGNAL(tryCloseView(ModuleBase_IViewWindow*)), + connect(aViewer, SIGNAL(tryCloseView(ModuleBase_IViewWindow*)), this, SIGNAL(tryCloseView(ModuleBase_IViewWindow*))); - connect(aViewer, SIGNAL(deleteView(ModuleBase_IViewWindow*)), + connect(aViewer, SIGNAL(deleteView(ModuleBase_IViewWindow*)), this, SIGNAL(deleteView(ModuleBase_IViewWindow*))); - connect(aViewer, SIGNAL(viewCreated(ModuleBase_IViewWindow*)), + connect(aViewer, SIGNAL(viewCreated(ModuleBase_IViewWindow*)), this, SLOT(onViewCreated(ModuleBase_IViewWindow*))); - connect(aViewer, SIGNAL(activated(ModuleBase_IViewWindow*)), + connect(aViewer, SIGNAL(activated(ModuleBase_IViewWindow*)), this, SIGNAL(activated(ModuleBase_IViewWindow*))); - connect(aViewer, SIGNAL(mousePress(ModuleBase_IViewWindow*, QMouseEvent*)), + connect(aViewer, SIGNAL(mousePress(ModuleBase_IViewWindow*, QMouseEvent*)), this, SIGNAL(mousePress(ModuleBase_IViewWindow*, QMouseEvent*))); - connect(aViewer, SIGNAL(mouseRelease(ModuleBase_IViewWindow*, QMouseEvent*)), + connect(aViewer, SIGNAL(mouseRelease(ModuleBase_IViewWindow*, QMouseEvent*)), this, SIGNAL(mouseRelease(ModuleBase_IViewWindow*, QMouseEvent*))); connect(aViewer, SIGNAL(mouseDoubleClick(ModuleBase_IViewWindow*, QMouseEvent*)), this, SIGNAL(mouseDoubleClick(ModuleBase_IViewWindow*, QMouseEvent*))); - connect(aViewer, SIGNAL(mouseMove(ModuleBase_IViewWindow*, QMouseEvent*)), + connect(aViewer, SIGNAL(mouseMove(ModuleBase_IViewWindow*, QMouseEvent*)), this, SIGNAL(mouseMove(ModuleBase_IViewWindow*, QMouseEvent*))); - connect(aViewer, SIGNAL(keyPress(ModuleBase_IViewWindow*, QKeyEvent*)), + connect(aViewer, SIGNAL(keyPress(ModuleBase_IViewWindow*, QKeyEvent*)), this, SIGNAL(keyPress(ModuleBase_IViewWindow*, QKeyEvent*))); - connect(aViewer, SIGNAL(keyRelease(ModuleBase_IViewWindow*, QKeyEvent*)), + connect(aViewer, SIGNAL(keyRelease(ModuleBase_IViewWindow*, QKeyEvent*)), this, SIGNAL(keyRelease(ModuleBase_IViewWindow*, QKeyEvent*))); connect(aViewer, SIGNAL(selectionChanged()), this, SIGNAL(selectionChanged())); - + connect(aViewer, SIGNAL(viewTransformed(int)), this, SIGNAL(viewTransformed(int))); connect(aViewer, SIGNAL(contextMenuRequested(QContextMenuEvent*)), this, @@ -154,16 +154,16 @@ void XGUI_ViewerProxy::connectToViewer() connect(aViewer, SIGNAL(lastViewClosed()), this, SIGNAL(lastViewClosed())); - connect(aViewer, SIGNAL(tryCloseView(AppElements_ViewWindow*)), + connect(aViewer, SIGNAL(tryCloseView(AppElements_ViewWindow*)), this, SLOT(onTryCloseView(AppElements_ViewWindow*))); - connect(aViewer, SIGNAL(deleteView(AppElements_ViewWindow*)), + connect(aViewer, SIGNAL(deleteView(AppElements_ViewWindow*)), this, SLOT(onDeleteView(AppElements_ViewWindow*))); - connect(aViewer, SIGNAL(viewCreated(AppElements_ViewWindow*)), + connect(aViewer, SIGNAL(viewCreated(AppElements_ViewWindow*)), this, SLOT(onViewCreated(AppElements_ViewWindow*))); - connect(aViewer, SIGNAL(activated(AppElements_ViewWindow*)), + connect(aViewer, SIGNAL(activated(AppElements_ViewWindow*)), this, SLOT(onActivated(AppElements_ViewWindow*))); connect(aViewer, SIGNAL(mousePress(AppElements_ViewWindow*, QMouseEvent*)), this, diff --git a/src/XGUI/XGUI_ViewerProxy.h b/src/XGUI/XGUI_ViewerProxy.h index bf578c424..9969ae9e4 100644 --- a/src/XGUI/XGUI_ViewerProxy.h +++ b/src/XGUI/XGUI_ViewerProxy.h @@ -90,7 +90,7 @@ Q_OBJECT /// Update current viewer virtual void update(); - /// Method returns True if the viewer can process editing objects + /// Method returns True if the viewer can process editing objects /// by mouse drugging. If this is impossible thet it has to return False. virtual bool canDragByMouse() const; diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 45db946d5..64954b4ec 100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -143,7 +143,7 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector) bool aCloc = aResMgr->booleanValue("language", "locale", true); if (aCloc) QLocale::setDefault( QLocale::c() ); - else + else QLocale::setDefault( QLocale::system() ); #endif QString aPath = Config_XMLReader::pluginConfigFile().c_str(); @@ -183,9 +183,9 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector) SLOT(onOperationResumed(ModuleBase_Operation*))); connect(myOperationMgr, SIGNAL(operationStopped(ModuleBase_Operation*)), SLOT(onOperationStopped(ModuleBase_Operation*))); - connect(myOperationMgr, SIGNAL(operationCommitted(ModuleBase_Operation*)), + connect(myOperationMgr, SIGNAL(operationCommitted(ModuleBase_Operation*)), SLOT(onOperationCommitted(ModuleBase_Operation*))); - connect(myOperationMgr, SIGNAL(operationAborted(ModuleBase_Operation*)), + connect(myOperationMgr, SIGNAL(operationAborted(ModuleBase_Operation*)), SLOT(onOperationAborted(ModuleBase_Operation*))); #ifndef HAVE_SALOME @@ -203,21 +203,21 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector) Config_Prop::Color, ModelAPI_ResultBody::DEFAULT_COLOR()); Config_PropManager::registerProp("Visualization", "result_group_color", "Group color", Config_Prop::Color, ModelAPI_ResultGroup::DEFAULT_COLOR()); - Config_PropManager::registerProp("Visualization", "result_construction_color", + Config_PropManager::registerProp("Visualization", "result_construction_color", "Construction color", - Config_Prop::Color, + Config_Prop::Color, ModelAPI_ResultConstruction::DEFAULT_COLOR()); Config_PropManager::registerProp("Visualization", "result_part_color", "Part color", Config_Prop::Color, ModelAPI_ResultPart::DEFAULT_COLOR()); - Config_PropManager::registerProp("Visualization", "body_deflection", + Config_PropManager::registerProp("Visualization", "body_deflection", "Body deflection coefficient", - Config_Prop::Double, + Config_Prop::Double, ModelAPI_ResultBody::DEFAULT_DEFLECTION());//"0.001"); - Config_PropManager::registerProp("Visualization", "construction_deflection", + Config_PropManager::registerProp("Visualization", "construction_deflection", "Construction deflection coefficient", - Config_Prop::Double, + Config_Prop::Double, ModelAPI_ResultConstruction::DEFAULT_DEFLECTION());//"0.0001"); if (ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "face-selection", true)) @@ -269,7 +269,7 @@ void XGUI_Workshop::startApplication() myMainWindow->show(); updateCommandStatus(); #endif - + onNew(); myViewerProxy->connectViewProxy(); @@ -326,7 +326,7 @@ void XGUI_Workshop::initMenu() QAction* aAction = salomeConnector()->addDesktopCommand("UNDO_CMD", tr("Undo"), tr("Undo last command"), QIcon(":pictures/undo.png"), - QKeySequence::Undo, false, + QKeySequence::Undo, false, "MEN_DESK_EDIT"); QString aToolBarTitle = tr( "INF_DESK_TOOLBAR_STANDARD" ); salomeConnector()->addActionInToolbar( aAction,aToolBarTitle ); @@ -343,7 +343,7 @@ void XGUI_Workshop::initMenu() addHistoryMenu(aAction, SIGNAL(updateRedoHistory(const QList&)), SLOT(onRedo(int))); salomeConnector()->addDesktopMenuSeparator("MEN_DESK_EDIT"); - //aAction = salomeConnector()->addDesktopCommand("REBUILD_CMD", tr("Rebuild"), + //aAction = salomeConnector()->addDesktopCommand("REBUILD_CMD", tr("Rebuild"), // tr("Rebuild data objects"), // QIcon(":pictures/rebuild.png"), QKeySequence(), // false, "MEN_DESK_EDIT"); @@ -352,13 +352,13 @@ void XGUI_Workshop::initMenu() //connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onRebuild())); //salomeConnector()->addDesktopMenuSeparator("MEN_DESK_EDIT"); - aAction = salomeConnector()->addDesktopCommand("SAVEAS_CMD", tr("Export native..."), + aAction = salomeConnector()->addDesktopCommand("SAVEAS_CMD", tr("Export native..."), tr("Export the current document into a native file"), QIcon(), QKeySequence(), false, "MEN_DESK_FILE"); connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onSaveAs())); - aAction = salomeConnector()->addDesktopCommand("OPEN_CMD", tr("Import native..."), + aAction = salomeConnector()->addDesktopCommand("OPEN_CMD", tr("Import native..."), tr("Import native file"), QIcon(), QKeySequence(), false, "MEN_DESK_FILE"); @@ -495,7 +495,7 @@ bool XGUI_Workshop::isFeatureOfNested(const FeaturePtr& theFeature) XGUI_SalomeConnector* aSalomeConnector = salomeConnector(); if (aSalomeConnector->isFeatureOfNested(actionsMgr()->action(aFeatureKind.c_str()))) aHasNested = true; -#else +#else AppElements_MainMenu* aMenuBar = mainWindow()->menuObject(); AppElements_Command* aCommand = aMenuBar->feature(aFeatureKind.c_str()); if (aCommand && aCommand->button()->additionalButtonWidget()) @@ -506,7 +506,7 @@ bool XGUI_Workshop::isFeatureOfNested(const FeaturePtr& theFeature) void XGUI_Workshop::fillPropertyPanel(ModuleBase_Operation* theOperation) { - ModuleBase_OperationFeature* aFOperation = + ModuleBase_OperationFeature* aFOperation = dynamic_cast(theOperation); if (!aFOperation) return; @@ -550,7 +550,7 @@ void XGUI_Workshop::fillPropertyPanel(ModuleBase_Operation* theOperation) // update visible state of Preview button #ifdef HAVE_SALOME - bool anIsAutoPreview = + bool anIsAutoPreview = mySalomeConnector->featureInfo(aFeatureKind.c_str())->isAutoPreview(); #else AppElements_MainMenu* aMenuBar = mainWindow()->menuObject(); @@ -880,7 +880,7 @@ bool XGUI_Workshop::onSaveAs() if (aDir.exists() && !aDir.entryInfoList(QDir::NoDotAndDotDot | QDir::AllEntries).isEmpty()) { int answer = QMessageBox::question( desktop(), - // Title of the dialog which asks user if he wants to save study + // Title of the dialog which asks user if he wants to save study // in existing non-empty folder tr("Save"), tr("The directory already contains some files, save anyway?"), @@ -1146,8 +1146,8 @@ void XGUI_Workshop::updateHistory() QDockWidget* XGUI_Workshop::createObjectBrowser(QWidget* theParent) { QDockWidget* aObjDock = new QDockWidget(theParent); - aObjDock->setAllowedAreas(Qt::LeftDockWidgetArea | - Qt::RightDockWidgetArea | + aObjDock->setAllowedAreas(Qt::LeftDockWidgetArea | + Qt::RightDockWidgetArea | Qt::BottomDockWidgetArea); aObjDock->setWindowTitle(tr("Object browser")); aObjDock->setStyleSheet( @@ -1173,8 +1173,8 @@ void XGUI_Workshop::createDockWidgets() aDesktop->addDockWidget(Qt::LeftDockWidgetArea, aObjDock); myPropertyPanel = new XGUI_PropertyPanel(aDesktop, myOperationMgr); myPropertyPanel->setupActions(myActionsMgr); - myPropertyPanel->setAllowedAreas(Qt::LeftDockWidgetArea | - Qt::RightDockWidgetArea | + myPropertyPanel->setAllowedAreas(Qt::LeftDockWidgetArea | + Qt::RightDockWidgetArea | Qt::BottomDockWidgetArea); aDesktop->addDockWidget(Qt::LeftDockWidgetArea, myPropertyPanel); hidePropertyPanel(); ///first; std::set aMainRefList = aMainIt->second; - std::set::const_iterator aRefIt = aMainRefList.begin(), + std::set::const_iterator aRefIt = aMainRefList.begin(), aRefLast = aMainRefList.end(); bool aFeatureOutOfTheList = false; for (; aRefIt != aRefLast && !aFeatureOutOfTheList; aRefIt++) { @@ -1496,7 +1496,7 @@ void XGUI_Workshop::cleanHistory() return; // 1. start operation - aDescription += "by deleting of " + + aDescription += "by deleting of " + aDescription.arg(XGUI_Tools::unionOfObjectNames(anObjects, ", ")); ModuleBase_OperationAction* anOpAction = new ModuleBase_OperationAction(aDescription, module()); operationMgr()->startOperation(anOpAction); @@ -1635,17 +1635,17 @@ std::list toCurrentFeatures(const ObjectPtr& theObject) DocumentPtr aDocument = theObject->document(); std::list anAllFeatures = allFeatures(aDocument); // find the object iterator - std::list::iterator aObjectIt = + std::list::iterator aObjectIt = std::find(anAllFeatures.begin(), anAllFeatures.end(), theObject); if (aObjectIt == anAllFeatures.end()) return aResult; // find the current feature iterator - std::list::iterator aCurrentIt = + std::list::iterator aCurrentIt = std::find(anAllFeatures.begin(), anAllFeatures.end(), aDocument->currentFeature(true)); if (aCurrentIt == anAllFeatures.end()) return aResult; // check the right order - if (std::distance(aObjectIt, anAllFeatures.end()) <= + if (std::distance(aObjectIt, anAllFeatures.end()) <= std::distance(aCurrentIt, anAllFeatures.end())) return aResult; // exclude the object @@ -1677,14 +1677,14 @@ bool XGUI_Workshop::canMoveFeature() QObjectPtrList::const_iterator anIt = aObjects.begin(), aLast = aObjects.end(); for (; anIt != aLast && aCanMove; anIt++) { ObjectPtr aObject = *anIt; - // 1. Get features placed between selected and current in the document + // 1. Get features placed between selected and current in the document std::list aFeaturesBetween = toCurrentFeatures(aObject); // if aFeaturesBetween is empty it means wrong order or aObject is the current feature if (aFeaturesBetween.empty()) aCanMove = false; else { std::set aPlacedFeatures(aFeaturesBetween.begin(), aFeaturesBetween.end()); - // 2. Get all reference features to the selected object in the document + // 2. Get all reference features to the selected object in the document std::set aRefFeatures; ModuleBase_Tools::refsToFeatureInFeatureDocument(aObject, aRefFeatures); @@ -1756,7 +1756,7 @@ void XGUI_Workshop::changeColor(const QObjectPtrList& theObjects) AttributeIntArrayPtr aColorAttr; // 1. find the current color of the object. This is a color of AIS presentation - // The objects are iterated until a first valid color is found + // The objects are iterated until a first valid color is found std::vector aColor; foreach(ObjectPtr anObject, theObjects) { ResultPtr aResult = std::dynamic_pointer_cast(anObject); @@ -1781,7 +1781,7 @@ void XGUI_Workshop::changeColor(const QObjectPtrList& theObjects) return; if (!abortAllOperations()) - return; + return; // 2. show the dialog to change the value XGUI_ColorDialog* aDlg = new XGUI_ColorDialog(desktop()); aDlg->setColor(aColor); @@ -1802,11 +1802,11 @@ void XGUI_Workshop::changeColor(const QObjectPtrList& theObjects) foreach(ObjectPtr anObj, theObjects) { ResultPtr aResult = std::dynamic_pointer_cast(anObj); if (aResult.get() != NULL) { - ResultCompSolidPtr aCompsolidResult = + ResultCompSolidPtr aCompsolidResult = std::dynamic_pointer_cast(aResult); if (aCompsolidResult.get() != NULL) { // change colors for all sub-solids for(int i = 0; i < aCompsolidResult->numberOfSubs(); i++) { - setColor(aCompsolidResult->subResult(i), !isRandomColor ? aColorResult : + setColor(aCompsolidResult->subResult(i), !isRandomColor ? aColorResult : aDlg->getRandomColor()); } } @@ -1847,7 +1847,7 @@ void XGUI_Workshop::changeDeflection(const QObjectPtrList& theObjects) { AttributeDoublePtr aDoubleAttr; // 1. find the current color of the object. This is a color of AIS presentation - // The objects are iterated until a first valid color is found + // The objects are iterated until a first valid color is found double aDeflection = -1; foreach(ObjectPtr anObject, theObjects) { ResultPtr aResult = std::dynamic_pointer_cast(anObject); @@ -1871,7 +1871,7 @@ void XGUI_Workshop::changeDeflection(const QObjectPtrList& theObjects) return; if (!abortAllOperations()) - return; + return; // 2. show the dialog to change the value XGUI_DeflectionDialog* aDlg = new XGUI_DeflectionDialog(desktop()); aDlg->setDeflection(aDeflection); @@ -1890,7 +1890,7 @@ void XGUI_Workshop::changeDeflection(const QObjectPtrList& theObjects) foreach(ObjectPtr anObj, theObjects) { ResultPtr aResult = std::dynamic_pointer_cast(anObj); if (aResult.get() != NULL) { - ResultCompSolidPtr aCompsolidResult = + ResultCompSolidPtr aCompsolidResult = std::dynamic_pointer_cast(aResult); if (aCompsolidResult.get() != NULL) { // change colors for all sub-solids for(int i = 0; i < aCompsolidResult->numberOfSubs(); i++) { @@ -1975,7 +1975,7 @@ void XGUI_Workshop::displayDocumentResults(DocumentPtr theDoc) //************************************************************** void XGUI_Workshop::displayGroupResults(DocumentPtr theDoc, std::string theGroup) { - for (int i = 0; i < theDoc->size(theGroup); i++) + for (int i = 0; i < theDoc->size(theGroup); i++) theDoc->object(theGroup, i)->setDisplayed(true); //displayObject(theDoc->object(theGroup, i)); Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY)); @@ -2078,8 +2078,8 @@ void XGUI_Workshop::synchronizeViewer() synchronizeGroupInViewer(aDoc, ModelAPI_ResultGroup::group(), false); } -void XGUI_Workshop::synchronizeGroupInViewer(const DocumentPtr& theDoc, - const std::string& theGroup, +void XGUI_Workshop::synchronizeGroupInViewer(const DocumentPtr& theDoc, + const std::string& theGroup, bool theUpdateViewer) { ObjectPtr aObj; @@ -2122,8 +2122,8 @@ void XGUI_Workshop::highlightResults(const QObjectPtrList& theObjects) objectBrowser()->setObjectsSelected(aSelList); objectBrowser()->blockSignals(aBlocked); } - if (aHasHidden) - QMessageBox::information(desktop(), tr("Find results"), + if (aHasHidden) + QMessageBox::information(desktop(), tr("Find results"), tr("Results not found"), QMessageBox::Ok); } diff --git a/src/XGUI/XGUI_Workshop.h b/src/XGUI/XGUI_Workshop.h index c8e6b6435..9d67d191e 100755 --- a/src/XGUI/XGUI_Workshop.h +++ b/src/XGUI/XGUI_Workshop.h @@ -58,7 +58,7 @@ class XGUI_EXPORT XGUI_Workshop : public QObject Q_OBJECT public: /// Constructor - /// \param theConnector a Salome connector object. + /// \param theConnector a Salome connector object. /// Used only if the workshop is launched in Salome environment XGUI_Workshop(XGUI_SalomeConnector* theConnector = 0); virtual ~XGUI_Workshop(); @@ -176,7 +176,7 @@ Q_OBJECT void deleteObjects(); //! Searches for selected features unused in other (not selected) features. If one or several - //! selected features are found, a warning message proposes to delete them. It contains + //! selected features are found, a warning message proposes to delete them. It contains //! the list of features to be deleted. void cleanHistory(); @@ -288,8 +288,8 @@ Q_OBJECT /// \param theDoc the document for objects synchronisation /// \param theGroup the group name /// \param theUpdateViewer update viewer flag - void synchronizeGroupInViewer(const DocumentPtr& theDoc, - const std::string& theGroup, + void synchronizeGroupInViewer(const DocumentPtr& theDoc, + const std::string& theGroup, bool theUpdateViewer); /// Update the property panel content by the XML description of the operation and set the panel @@ -312,7 +312,7 @@ Q_OBJECT /// features found in the given list void highlightFeature(const QObjectPtrList& theObjects); - /// Returns Data Model XML reader which contains information about + /// Returns Data Model XML reader which contains information about /// Data structure configuration const Config_DataModelReader* dataModelXMLReader() const { return myDataModelXMLReader; } diff --git a/src/XGUI/XGUI_WorkshopListener.cpp b/src/XGUI/XGUI_WorkshopListener.cpp index 849466192..55bfec3d8 100755 --- a/src/XGUI/XGUI_WorkshopListener.cpp +++ b/src/XGUI/XGUI_WorkshopListener.cpp @@ -159,7 +159,7 @@ void XGUI_WorkshopListener::processEvent(const std::shared_ptr& } } else if (theMessage->eventID() == Events_Loop::eventByName(EVENT_SELFILTER_LOADED)) { - std::shared_ptr aMsg = + std::shared_ptr aMsg = std::dynamic_pointer_cast(theMessage); if (aMsg) { ModuleBase_FilterFactory* aFactory = myWorkshop->selectionFilters(); @@ -177,7 +177,7 @@ void XGUI_WorkshopListener::processEvent(const std::shared_ptr& aDisplayer->enableUpdateViewer(true); } else { //Show error dialog if error message received. - std::shared_ptr anIngfoMsg = + std::shared_ptr anIngfoMsg = std::dynamic_pointer_cast(theMessage); if (anIngfoMsg) { emit errorOccurred(anIngfoMsg); @@ -258,7 +258,7 @@ void XGUI_WorkshopListener:: ObjectPtr aObj = (*aIt); // Hide the object if it is invalid or concealed one - bool aHide = !aObj->data() || !aObj->data()->isValid() || + bool aHide = !aObj->data() || !aObj->data()->isValid() || aObj->isDisabled() || (!aObj->isDisplayed()); if (!aHide) { // check that this is not hidden result ResultPtr aRes = std::dynamic_pointer_cast(aObj); @@ -295,8 +295,8 @@ void XGUI_WorkshopListener:: #endif if (aHide) { //we should provide objects which are hidden in the viewer, e.g. sketch always should - // visualizes all sub-features, if some features are to be hidden, sould be proposed may - // be to removed #1223 + // visualizes all sub-features, if some features are to be hidden, sould be proposed may + // be to removed #1223 // aHiddenObjects.push_back(aObj); aRedisplayed = aDisplayer->erase(aObj, false) || aRedisplayed; #ifdef DEBUG_FEATURE_REDISPLAY @@ -349,7 +349,7 @@ void XGUI_WorkshopListener:: //VSV FitAll updated viewer by itself if (aDoFitAll) myWorkshop->viewer()->fitAll(); - else + else aDisplayer->updateViewer(); } } @@ -393,7 +393,7 @@ void XGUI_WorkshopListener:: // the validity of the data should be checked here in order to avoid display of the objects, // which were created, then deleted, but flush for the creation event happens after that // we should not display disabled objects - bool aHide = !anObject->data()->isValid() || + bool aHide = !anObject->data()->isValid() || anObject->isDisabled() || !anObject->isDisplayed(); if (!aHide) { // check that this is not hidden result @@ -406,14 +406,14 @@ void XGUI_WorkshopListener:: aHide = !aRes->shape().get() || aRes->shape()->isNull(); } if (!aHide) { - // setDisplayed has to be called in order to synchronize internal state of the object + // setDisplayed has to be called in order to synchronize internal state of the object // with list of displayed objects if (myWorkshop->module()->canDisplayObject(anObject)) { anObject->setDisplayed(true); aDisplayed = displayObject(anObject); if (aDisplayed) aDoFitAll = aDoFitAll || neededFitAll(anObject, aNbOfShownObjects); - } else + } else anObject->setDisplayed(false); } } diff --git a/src/XGUI/XGUI_WorkshopListener.h b/src/XGUI/XGUI_WorkshopListener.h index abc801ec1..9813b6c3d 100755 --- a/src/XGUI/XGUI_WorkshopListener.h +++ b/src/XGUI/XGUI_WorkshopListener.h @@ -31,7 +31,7 @@ class XGUI_EXPORT XGUI_WorkshopListener : public QObject, public Events_Listener Q_OBJECT public: /// Constructor. Used only if the workshop is launched in Salome environment - /// \param theWorkshop a reference to workshop. + /// \param theWorkshop a reference to workshop. XGUI_WorkshopListener(ModuleBase_IWorkshop* theWorkshop); virtual ~XGUI_WorkshopListener(); @@ -83,7 +83,7 @@ protected: /// Calls the module method of cusomize object for the feature of the current operation /// Perform cusomize if the force redisplay flag is true or the list of objects contains the /// current operation feature - /// \param theObjects a list of objects to find current operation feature + /// \param theObjects a list of objects to find current operation feature /// if forced redisplay is false /// \param theForceRedisplay a flag to customize object even always /// \return true if the object is modified