Salome HOME
fix coding style
authorrraphael <raphael.raphael@c-s.fr>
Fri, 26 Feb 2021 10:56:27 +0000 (11:56 +0100)
committerrraphael <raphael.raphael@c-s.fr>
Fri, 26 Feb 2021 11:03:57 +0000 (12:03 +0100)
26 files changed:
src/CollectionPlugin/CollectionPlugin_GroupAddition.h
src/CollectionPlugin/CollectionPlugin_GroupMerge.cpp
src/CollectionPlugin/CollectionPlugin_GroupMerge.h
src/CollectionPlugin/CollectionPlugin_GroupShape.cpp
src/CollectionPlugin/CollectionPlugin_GroupShape.h
src/ConstructionPlugin/ConstructionPlugin_Point.cpp
src/ExchangeAPI/ExchangeAPI_Import.cpp
src/ExchangePlugin/ExchangePlugin_Import.cpp
src/ExchangePlugin/ExchangePlugin_Import.h
src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp
src/ExchangePlugin/ExchangePlugin_ImportFeature.h
src/FeaturesPlugin/FeaturesPlugin_Symmetry.cpp
src/FeaturesPlugin/FeaturesPlugin_Tools.cpp
src/GeomAlgoAPI/GeomAlgoAPI_ImageImport.cpp
src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp
src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h
src/ModuleBase/ModuleBase_WidgetValidated.cpp
src/PartSet/PartSet_Module.cpp
src/SketchAPI/SketchAPI_MacroRectangle.cpp
src/SketchAPI/SketchAPI_MacroRectangle.h
src/SketchAPI/SketchAPI_Rectangle.cpp
src/SketchAPI/SketchAPI_Rectangle.h
src/SketchAPI/SketchAPI_Sketch.cpp
src/SketchPlugin/SketchPlugin_MacroRectangle.cpp
src/SketchPlugin/SketchPlugin_Rectangle.cpp
src/SketchPlugin/SketchPlugin_Rectangle.h

index d52da423bf1dd571ae9c474571d50ffa28a04fa9..0af70112037899d7891b72432ff693d56bed603b 100644 (file)
@@ -36,7 +36,7 @@ public:
   {
     static const std::string MY_GROUP_ID("GroupAddition");
     return MY_GROUP_ID;
-  }  
+  }
 
   /// Returns the kind of a feature
   COLLECTIONPLUGIN_EXPORT virtual const std::string& getKind()
index cfef811bb151fdd6952827ec0f13d4879db94ce8..7307d4b7491c7e92e853e2963e4fdc784af88346 100644 (file)
@@ -80,5 +80,5 @@ void CollectionPlugin_GroupMerge::execute(ResultGroupPtr & aGroup)
   aGroup->store(aCompound);
 
   // update the type of selection
-  updateGroupType(LIST_ID());  
+  updateGroupType(LIST_ID());
 }
index e56f40fdb801ff57e42902482edf7e1e7571c03f..8a7c2c43719bf594f35229535358113e13e90e07 100644 (file)
@@ -31,7 +31,7 @@
  */
 class CollectionPlugin_GroupMerge: public CollectionPlugin_GroupOperation
 {
-public:  
+public:
   /// attribute name of selected entities list
   inline static const std::string& LIST_ID()
   {
index 0a0f90d25ea9b9872287ee6c28e46b0e92ef5f17..0373800412e526e4ca0669717fa4ca4bda02d367 100644 (file)
@@ -23,7 +23,7 @@
 #include <TopoDS_Iterator.hxx>
 
 void CollectionPlugin_GroupShape::execute()
-{  
+{
   ResultGroupPtr aGroup;
   CollectionPlugin_GroupMerge::execute(aGroup);
   GeomShapePtr aCompound = aGroup->shape();
index a69a7a2baddd1d00d74a7c42e8028ddcc2568f3a..162b43c818d4f01b6c3065da26b192f45394c41f 100644 (file)
@@ -36,7 +36,7 @@ public:
   {
     static const std::string MY_GROUP_ID("GroupShape");
     return MY_GROUP_ID;
-  }  
+  }
 
   /// Returns the kind of a feature
   COLLECTIONPLUGIN_EXPORT virtual const std::string& getKind()
index 0129d391e1b784d3172c3f97709018f9261b4192..91392151bcb07e5892d6be38d86143a48fba0ac2 100644 (file)
@@ -144,9 +144,10 @@ void ConstructionPlugin_Point::execute()
   removeResults(1); // for case the point type was switched from multi-results type
   std::shared_ptr<ModelAPI_ResultConstruction> aConstr = document()->createConstruction(data());
   aConstr->setInfinite(true);
-  aConstr->setShape(aShape);  
+  aConstr->setShape(aShape);
+  /// set point color
   aConstr->setColor(ModelAPI_ResultConstruction::ModelApi_PointColor::DEFAULT_COLOR(),
-                    ModelAPI_ResultConstruction::ModelApi_PointColor::COLOR_CONFIG_NAME()); /// set point color
+                    ModelAPI_ResultConstruction::ModelApi_PointColor::COLOR_CONFIG_NAME());
   setResult(aConstr);
 }
 
index d17f3bfa8e7a1bc6afad585f5543d911878ab083..eee356406124576f5ba4a1dc588b5e34c803bfe6 100644 (file)
@@ -244,7 +244,8 @@ void ExchangeAPI_Import_Image::dump(ModelHighAPI_Dumper& theDumper) const
   FeaturePtr aBase = feature();
   std::string aPartName = theDumper.name(aBase->document());
 
-  std::string aFilePath = aBase->string(ExchangePlugin_Import_ImageFeature::FILE_PATH_ID())->value();
+  std::string aFilePath =
+      aBase->string(ExchangePlugin_Import_ImageFeature::FILE_PATH_ID())->value();
 
   theDumper << aBase << " = model.addImportImage(" << aPartName << ", \""
             << aFilePath << "\")" << std::endl;
index 6157782b1a739c7b8dfc6e51b3ceb5ad6ad7fbd6..a166c9431fc137185cd6d5e6edf1f21242063c59 100644 (file)
@@ -74,7 +74,7 @@ void ExchangePlugin_ImportBase::initAttributes()
 {
   data()->addAttribute(FILE_PATH_ID(), ModelAPI_AttributeString::typeId());
   data()->addAttribute(TARGET_PART_ID(), ModelAPI_AttributeInteger::typeId());
-  data()->addAttribute(TARGET_PARTS_LIST_ID(), ModelAPI_AttributeStringArray::typeId()); 
+  data()->addAttribute(TARGET_PARTS_LIST_ID(), ModelAPI_AttributeStringArray::typeId());
 }
 
 void ExchangePlugin_Import::initAttributes()
@@ -82,7 +82,7 @@ void ExchangePlugin_Import::initAttributes()
   ExchangePlugin_ImportBase::initAttributes();
 
   data()->addAttribute(STEP_FILE_PATH_ID(), ModelAPI_AttributeString::typeId());
-  data()->addAttribute(IMPORT_TYPE_ID(), ModelAPI_AttributeString::typeId()); 
+  data()->addAttribute(IMPORT_TYPE_ID(), ModelAPI_AttributeString::typeId());
   data()->addAttribute(STEP_TARGET_PART_ID(), ModelAPI_AttributeInteger::typeId());
   data()->addAttribute(STEP_TARGET_PARTS_LIST_ID(), ModelAPI_AttributeStringArray::typeId());
   data()->addAttribute(STEP_MATERIALS_ID(), ModelAPI_AttributeBoolean::typeId());
@@ -173,7 +173,8 @@ void ExchangePlugin_Import_Image::execute()
   if (aDoc.get()) {
     FeaturePtr aImportFeature = aDoc->addFeature(ExchangePlugin_Import_ImageFeature::ID());
     DataPtr aData = aImportFeature->data();
-    AttributeStringPtr aPathAttr = aData->string(ExchangePlugin_Import_ImageFeature::FILE_PATH_ID());
+    AttributeStringPtr aPathAttr =
+        aData->string(ExchangePlugin_Import_ImageFeature::FILE_PATH_ID());
     aPathAttr->setValue(aFilePathAttr->value());
     aImportFeature->execute();
   }
index 7bb2928947979096adba1cc7948db9dbcb751246..e018bedc257b48b7c77ac4cbad9fc6bfbdf3a4c1 100644 (file)
@@ -38,7 +38,7 @@
  */
 class ExchangePlugin_ImportBase : public ModelAPI_Feature
 {
- public:  
+ public:
   /// attribute name of file path
   inline static const std::string& FILE_PATH_ID()
   {
index dd87d800cfd9f01ee6ce5ca6e6ae929bbe712dd5..e6bd0d82f32fb57ec69d6fe5fdd3af933fb36fbc 100644 (file)
@@ -85,13 +85,13 @@ void ExchangePlugin_ImportFeatureBase::initAttributes()
 void ExchangePlugin_ImportFeature::initAttributes()
 {
   ExchangePlugin_ImportFeatureBase::initAttributes();
-   
+
   data()->addAttribute(STEP_FILE_PATH_ID(), ModelAPI_AttributeString::typeId());
   data()->addAttribute(IMPORT_TYPE_ID(), ModelAPI_AttributeString::typeId());
   data()->addAttribute(STEP_MATERIALS_ID(), ModelAPI_AttributeBoolean::typeId());
   data()->addAttribute(STEP_COLORS_ID(), ModelAPI_AttributeBoolean::typeId());
   data()->addAttribute(STEP_SCALE_INTER_UNITS_ID(), ModelAPI_AttributeBoolean::typeId());
+
   ModelAPI_Session::get()->validators()->registerNotObligatory(
       getKind(), ExchangePlugin_ImportFeature::STEP_COLORS_ID());
   ModelAPI_Session::get()->validators()->registerNotObligatory(
@@ -206,7 +206,6 @@ void ExchangePlugin_ImportFeature::importFile(const std::string& theFileName)
   }
 
   // Pass the results into the model
   loadNamingDS(aGeomShape, aResult);
 
   // create color group
index fa4ac0f7fcff915b1ad6dc57b73e0a1ff5923516..37376e1983248029d42732f24eb02bd79fca6c4c 100644 (file)
@@ -168,7 +168,7 @@ protected:
   /// Performs the import of XAO file
   EXCHANGEPLUGIN_EXPORT void importXAO(const std::string& theFileName);
 
-private:                   
+private:
   /// Set groups of color
   void setColorGroups(std::shared_ptr<ModelAPI_ResultBody> theResultBody);
 
index 6dce5b6c8d459c7101fe1f4b080ec1e42352f9f7..57effe32d5716926043444b378357bc5c6cd319b 100644 (file)
@@ -203,7 +203,8 @@ GeomTrsfPtr FeaturesPlugin_Symmetry::symmetryByPlane()
 void FeaturesPlugin_Symmetry::buildResult(
     const std::shared_ptr<GeomAlgoAPI_MakeShapeList>& theAlgo,
     const std::list<std::shared_ptr<GeomAPI_Shape> >& theOriginalShapes,
-    std::shared_ptr<GeomAPI_Shape> theTargetShape, int& theResultIndex, std::string & theTextureFile)
+    std::shared_ptr<GeomAPI_Shape> theTargetShape, int& theResultIndex,
+    std::string & theTextureFile)
 {
   // Store and name the result.
   ResultBodyPtr aResultBody = document()->createBody(data(), theResultIndex);
index 29654258c11327eebcfccb74c40bcb8164674246..e8a1af8c42f8b723ba600e2496ab4222059690cb 100644 (file)
@@ -259,7 +259,8 @@ bool FeaturesPlugin_Tools::getShape(const AttributeSelectionListPtr theSelection
 }
 
 //==================================================================================================
-bool FeaturesPlugin_Tools::shapesFromSelectionList(const std::shared_ptr<ModelAPI_AttributeSelectionList> theSelectionList,
+bool FeaturesPlugin_Tools::shapesFromSelectionList(
+    const std::shared_ptr<ModelAPI_AttributeSelectionList> theSelectionList,
     const bool theStoreFullHierarchy,
     GeomAPI_ShapeHierarchy& theHierarchy,
     std::list<ResultPtr>& theParts, std::string &theTextureFile)
@@ -270,7 +271,7 @@ bool FeaturesPlugin_Tools::shapesFromSelectionList(const std::shared_ptr<ModelAP
     auto anObjectAttr = theSelectionList->value(0);
     if(anObjectAttr.get())
     {
-      FeaturePtr aFeature = anObjectAttr->contextFeature();      
+      FeaturePtr aFeature = anObjectAttr->contextFeature();
       if(aFeature.get() &&  aFeature->results().size() == 1)
       {
         theTextureFile = aFeature->firstResult()->getTextureFile();
index a95bf2b418d59c2c28316a221169c1582175ea76..1f73aeef182a91096f0de92794b10244874069f1 100644 (file)
@@ -61,7 +61,8 @@ std::shared_ptr<GeomAPI_Shape> ImageImport(const std::string& theFileName,
     aTriVertexes[2] = BRepBuilderAPI_MakeVertex (aPnt3);
     aTriVertexes[3] = BRepBuilderAPI_MakeVertex (aPnt4);
 
-    aWire = BRepBuilderAPI_MakePolygon (aTriVertexes[0], aTriVertexes[1], aTriVertexes[2], aTriVertexes[3], Standard_True);
+    aWire = BRepBuilderAPI_MakePolygon (aTriVertexes[0], aTriVertexes[1], aTriVertexes[2],
+        aTriVertexes[3], Standard_True);
 
     BRepBuilderAPI_Sewing aSewingTool;
     aSewingTool.Init (1.0e-06, Standard_True);
@@ -93,7 +94,7 @@ std::shared_ptr<GeomAPI_Shape> ImageImport(const std::string& theFileName,
   }
 
   std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
-  aGeomShape->setImpl(new TopoDS_Shape(aResShape));  
+  aGeomShape->setImpl(new TopoDS_Shape(aResShape));
 
   return aGeomShape;
 }
index 4fad7e2518625abbc15f4bcadd75f391cf87e742..a6cbafc0223cd1ee005d89bfc21b620fbbb12b1d 100644 (file)
@@ -226,7 +226,8 @@ double GeomAlgoAPI_ShapeTools::minimalDistance(const GeomShapePtr& theShape1,
 }
 
 double GeomAlgoAPI_ShapeTools::minimalDistance(const GeomShapePtr& theShape1,
-                                               const GeomShapePtr& theShape2, std::array<double, 3> & fromShape1To2)
+                                               const GeomShapePtr& theShape2,
+                                               std::array<double, 3> & fromShape1To2)
 {
   BRepExtrema_DistShapeShape aDist = getExtemaDistShape(theShape1, theShape2);
   const auto & pt1 = aDist.PointOnShape1(1);
index 5ad2e78acd2b1846aa1c0619fd722c0da57260a9..94ee16de53e933c35339a9293816d0a1fd9f7c8c 100644 (file)
@@ -68,7 +68,8 @@ public:
   GEOMALGOAPI_EXPORT static double minimalDistance(const GeomShapePtr& theShape1,
                                                    const GeomShapePtr& theShape2);
   GEOMALGOAPI_EXPORT static double minimalDistance(const GeomShapePtr& theShape1,
-                                                   const GeomShapePtr& theShape2, std::array<double, 3> & fromShape1To2);
+                                                   const GeomShapePtr& theShape2,
+                                                   std::array<double, 3> & fromShape1To2);
 
   /// \brief Combines faces with common edges to shells, or solids to compsolids.
   /// \param[in] theCompound compound of shapes.
index a02d2589e08de96e083933c1593be234176e2c9a..90436988e58050bbab83df44a1cf544551a9238e 100644 (file)
@@ -504,7 +504,8 @@ QList<ModuleBase_ViewerPrsPtr> ModuleBase_WidgetValidated::getFilteredSelected()
 
     std::vector<ModuleBase_ViewerPrsPtr> aRemove;
 
-    if (myFeatureId == BuildPlugin_Face::ID() && shapeTypes.find(GeomAPI_Shape::FACE) != shapeTypes.end())
+    if (myFeatureId == BuildPlugin_Face::ID() && shapeTypes.find(GeomAPI_Shape::FACE)
+        != shapeTypes.end())
     {
       for(auto aSelection: aSelected){
         auto aType = aSelection->shape()->shapeType();
@@ -512,7 +513,8 @@ QList<ModuleBase_ViewerPrsPtr> ModuleBase_WidgetValidated::getFilteredSelected()
           aRemove.push_back(aSelection);
       }
     }
-    else if (myFeatureId == BuildPlugin_Wire::ID() && shapeTypes.find(GeomAPI_Shape::WIRE) != shapeTypes.end())
+    else if (myFeatureId == BuildPlugin_Wire::ID() && shapeTypes.find(GeomAPI_Shape::WIRE)
+             != shapeTypes.end())
     {
       for(auto aSelection: aSelected){
         auto aType = aSelection->shape()->shapeType();
index 5b8075e7a634fdb57a3e9af6a849e3116490ef91..5135f716126abfcfa198a3f1eac9c7e42334611b 100644 (file)
@@ -210,10 +210,11 @@ PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
                                    "Construction color",  Config_Prop::Color,
                                    ModelAPI_ResultConstruction::DEFAULT_COLOR());
 
-  Config_PropManager::registerProp("Visualization",
-                                   ModelAPI_ResultConstruction::ModelApi_PointColor::COLOR_CONFIG_NAME(),
-                                   "Construction point color", Config_Prop::Color,
-                                   ModelAPI_ResultConstruction::ModelApi_PointColor::DEFAULT_COLOR());
+  Config_PropManager::registerProp(
+        "Visualization",
+        ModelAPI_ResultConstruction::ModelApi_PointColor::COLOR_CONFIG_NAME(),
+        "Construction point color", Config_Prop::Color,
+        ModelAPI_ResultConstruction::ModelApi_PointColor::DEFAULT_COLOR());
 
 
   Config_PropManager::registerProp("Visualization", "result_part_color", "Part color",
index a619aefd25244cc9caba71544c5a28188df8d0bb..b143c1e64f4a59483562266bbc36fb2abf51c7b4 100644 (file)
 #include <ModelHighAPI_Tools.h>
 
 //==================================================================================================
-SketchAPI_MacroRectangle::SketchAPI_MacroRectangle(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+SketchAPI_MacroRectangle::SketchAPI_MacroRectangle(
+    const std::shared_ptr<ModelAPI_Feature>& theFeature)
   : SketchAPI_SketchEntity(theFeature)
 {
   initialize();
 }
 
 //==================================================================================================
-SketchAPI_MacroRectangle::SketchAPI_MacroRectangle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                                   double theStartX,
-                                                   double theStartY,
-                                                   double theSecondX,
-                                                   double theSecondY, bool isFirstPointCenter):
+SketchAPI_MacroRectangle::SketchAPI_MacroRectangle(
+    const std::shared_ptr<ModelAPI_Feature>& theFeature,
+    double theStartX,
+    double theStartY,
+    double theSecondX,
+    double theSecondY,
+    bool isFirstPointCenter):
   SketchAPI_SketchEntity(theFeature)
 {
   if(initialize()) {
@@ -51,9 +54,10 @@ SketchAPI_MacroRectangle::SketchAPI_MacroRectangle(const std::shared_ptr<ModelAP
 }
 
 //==================================================================================================
-SketchAPI_MacroRectangle::SketchAPI_MacroRectangle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                                   const std::shared_ptr<GeomAPI_Pnt2d>& theStartPoint,
-                                                   const std::shared_ptr<GeomAPI_Pnt2d>& theSecondPoint, bool isFirstPointCenter):
+SketchAPI_MacroRectangle::SketchAPI_MacroRectangle(
+    const std::shared_ptr<ModelAPI_Feature>& theFeature,
+    const std::shared_ptr<GeomAPI_Pnt2d>& theStartPoint,
+    const std::shared_ptr<GeomAPI_Pnt2d>& theSecondPoint, bool isFirstPointCenter):
   SketchAPI_SketchEntity(theFeature)
 {
   if(initialize()) {
@@ -80,8 +84,9 @@ void SketchAPI_MacroRectangle::setByStartAndEndPoints(double theStartX, double t
 }
 
 //==================================================================================================
-void SketchAPI_MacroRectangle::setByStartAndEndPoints(const std::shared_ptr<GeomAPI_Pnt2d>& theStartPoint,
-                                                      const std::shared_ptr<GeomAPI_Pnt2d>& theEndPoint)
+void SketchAPI_MacroRectangle::setByStartAndEndPoints(
+    const std::shared_ptr<GeomAPI_Pnt2d>& theStartPoint,
+    const std::shared_ptr<GeomAPI_Pnt2d>& theEndPoint)
 {
   fillAttribute(SketchPlugin_MacroRectangle::START_END_POINT_TYPE_ID(), rectangleType());
   fillAttribute(theStartPoint, startPoint1());
@@ -91,7 +96,8 @@ void SketchAPI_MacroRectangle::setByStartAndEndPoints(const std::shared_ptr<Geom
 }
 
 //==================================================================================================
-void SketchAPI_MacroRectangle::setByCenterAndEndPoints(double theCenterX, double theCenterY, double theEndX, double theEndY)
+void SketchAPI_MacroRectangle::setByCenterAndEndPoints(double theCenterX, double theCenterY,
+                                                       double theEndX, double theEndY)
 {
   fillAttribute(SketchPlugin_MacroRectangle::CENTER_END_POINT_TYPE_ID(), rectangleType());
   fillAttribute(endPoint2(), theEndX, theEndY);
@@ -100,7 +106,9 @@ void SketchAPI_MacroRectangle::setByCenterAndEndPoints(double theCenterX, double
 }
 
 //==================================================================================================
-void SketchAPI_MacroRectangle::setByCenterAndEndPoints(const std::shared_ptr<GeomAPI_Pnt2d>& theCenterPoint, const std::shared_ptr<GeomAPI_Pnt2d>& theEndPoint){
+void SketchAPI_MacroRectangle::setByCenterAndEndPoints(
+    const std::shared_ptr<GeomAPI_Pnt2d>& theCenterPoint,
+    const std::shared_ptr<GeomAPI_Pnt2d>& theEndPoint){
   fillAttribute(SketchPlugin_MacroRectangle::CENTER_END_POINT_TYPE_ID(), rectangleType());
   fillAttribute(theEndPoint, endPoint2());
   fillAttribute(theCenterPoint, centerPoint());
index c7d2c165e9057cc7944943ec8fe90536b9513884..dc271f3bcb6c904764c79d88c18eef8869347aea 100644 (file)
@@ -48,7 +48,8 @@ public:
   SKETCHAPI_EXPORT
   SketchAPI_MacroRectangle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
                         const std::shared_ptr<GeomAPI_Pnt2d>& theStartPoint,
-                        const std::shared_ptr<GeomAPI_Pnt2d>& theSecondPoint, bool isFirstPointCenter = false);
+                        const std::shared_ptr<GeomAPI_Pnt2d>& theSecondPoint,
+                           bool isFirstPointCenter = false);
 
 
   /// Destructor.
index e40b501d2d4478014b83950ba2f9a4aa0d70d980..af0b62a83eb24b39e40a65df39339abea0a19c27 100644 (file)
@@ -34,7 +34,8 @@ SketchAPI_Rectangle::SketchAPI_Rectangle(
 }
 
 SketchAPI_Rectangle::SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature,
-                                         double theX1, double theY1, double theX2, double theY2, bool isFirstPointCenter)
+                                         double theX1, double theY1, double theX2, double theY2,
+                                         bool isFirstPointCenter)
   : SketchAPI_SketchEntity(theFeature)
 {
   if (initialize()) {
@@ -44,7 +45,8 @@ SketchAPI_Rectangle::SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature>
 
 SketchAPI_Rectangle::SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature,
                                          const std::shared_ptr<GeomAPI_Pnt2d> & theFirstPoint,
-                                         const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint, bool isFirstPointCenter)
+                                         const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint,
+                                         bool isFirstPointCenter)
   : SketchAPI_SketchEntity(theFeature)
 {
   if (initialize()) {
@@ -59,7 +61,7 @@ SketchAPI_Rectangle::~SketchAPI_Rectangle()
 //--------------------------------------------------------------------------------------
 void SketchAPI_Rectangle::setByCoordinates(
     double theX1, double theY1, double theX2, double theY2, bool isFirstPointCenter)
-{  
+{
   if(isFirstPointCenter){
     fillAttribute(centerPoint(), theX1, theY1);
     double xStart = 2.0*theX1 - theX2;
@@ -74,7 +76,8 @@ void SketchAPI_Rectangle::setByCoordinates(
 }
 
 void SketchAPI_Rectangle::setByPoints(const std::shared_ptr<GeomAPI_Pnt2d> & theFirstPoint,
-                                      const std::shared_ptr<GeomAPI_Pnt2d> & theSecondPoint, bool isFirstPointCenter)
+                                      const std::shared_ptr<GeomAPI_Pnt2d> & theSecondPoint,
+                                      bool isFirstPointCenter)
 {  
   if(isFirstPointCenter){
     fillAttribute(theFirstPoint, centerPoint());
@@ -112,7 +115,8 @@ void SketchAPI_Rectangle::dump(ModelHighAPI_Dumper& theDumper) const
   /// do not dump sub-features eg: lines and lines constraints
   AttributeRefListPtr noToDumpList =  aBase->reflist(SketchPlugin_Rectangle::NOT_TO_DUMP_LIST_ID());
   for( int i = 0; i < noToDumpList->size(); i++){
-    theDumper.doNotDumpFeature(std::dynamic_pointer_cast<ModelAPI_Feature>(noToDumpList->object(i)));
+    theDumper.doNotDumpFeature(
+          std::dynamic_pointer_cast<ModelAPI_Feature>(noToDumpList->object(i)));
   }
 
   if (isCopy())
@@ -120,7 +124,8 @@ void SketchAPI_Rectangle::dump(ModelHighAPI_Dumper& theDumper) const
 
   const std::string& aSketchName = theDumper.parentName(aBase);
 
-  FeaturePtr aCenterPointFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aBase->refattr(SketchPlugin_Rectangle::CENTER_REF_ID())->object());
+  FeaturePtr aCenterPointFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(
+        aBase->refattr(SketchPlugin_Rectangle::CENTER_REF_ID())->object());
   if(aCenterPointFeature){
     // rectangle has center
     theDumper << aBase << " = " << aSketchName << ".addRectangle("
index b2fd70670ca23e477ccb321a8ea32596d0db384c..2ef409332b689088720c1da4b9d176c9ec8e39d4 100644 (file)
@@ -42,26 +42,33 @@ public:
   /// Constructor with values
   SKETCHAPI_EXPORT
   SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature,
-                      double theX1, double theY1, double theX2, double theY2, bool isFirstPointCenter = false);
+                      double theX1, double theY1, double theX2, double theY2,
+                      bool isFirstPointCenter = false);
   /// Constructor with values
   SKETCHAPI_EXPORT
   SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature,
                       const std::shared_ptr<GeomAPI_Pnt2d> & theFirstPoint,
-                      const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint, bool isFirstPointCenter = false);
+                      const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint,
+                      bool isFirstPointCenter = false);
   /// Destructor
   SKETCHAPI_EXPORT
   virtual ~SketchAPI_Rectangle();
 
   INTERFACE_4(SketchPlugin_Rectangle::ID(),
-              startPoint, SketchPlugin_Rectangle::START_ID(), GeomDataAPI_Point2D, /** Start point */,
-              endPoint, SketchPlugin_Rectangle::END_ID(), GeomDataAPI_Point2D, /** End point */,
-              centerPoint, SketchPlugin_Rectangle::CENTER_ID(), GeomDataAPI_Point2D, /** Center point */,
-              linesList, SketchPlugin_Rectangle::LINES_LIST_ID(), ModelAPI_AttributeRefList, /** Lines list */
+              startPoint, SketchPlugin_Rectangle::START_ID(), GeomDataAPI_Point2D,
+              /** Start point */,
+              endPoint, SketchPlugin_Rectangle::END_ID(), GeomDataAPI_Point2D,
+              /** End point */,
+              centerPoint, SketchPlugin_Rectangle::CENTER_ID(), GeomDataAPI_Point2D,
+              /** Center point */,
+              linesList, SketchPlugin_Rectangle::LINES_LIST_ID(), ModelAPI_AttributeRefList,
+              /** Lines list */
   )
 
   /// Set by coordinates
   SKETCHAPI_EXPORT
-  void setByCoordinates(double theX1, double theY1, double theX2, double theY2, bool isFirstPointCenter);
+  void setByCoordinates(double theX1, double theY1, double theX2, double theY2,
+                        bool isFirstPointCenter);
 
   /// Set by points
   SKETCHAPI_EXPORT
index cd9851de2390c562ee94e75e33d831751bed8bbd..de5799715a6ce748122dc6fca2215cee474b4be0 100644 (file)
@@ -430,7 +430,8 @@ std::shared_ptr<SketchAPI_Rectangle> SketchAPI_Sketch::addRectangle(
 {
   std::shared_ptr<ModelAPI_Feature> aFeature =
     compositeFeature()->addFeature(SketchAPI_Rectangle::ID());
-  return RectanglePtr(new SketchAPI_Rectangle(aFeature, theX1, theY1, theX2, theY2, isFirstPointCenter));
+  return RectanglePtr(new SketchAPI_Rectangle(aFeature, theX1, theY1,
+                                              theX2, theY2, isFirstPointCenter));
 }
 std::shared_ptr<SketchAPI_Rectangle> SketchAPI_Sketch::addRectangle(
     const std::shared_ptr<GeomAPI_Pnt2d> & theFirstPoint,
@@ -438,7 +439,8 @@ std::shared_ptr<SketchAPI_Rectangle> SketchAPI_Sketch::addRectangle(
 {
   std::shared_ptr<ModelAPI_Feature> aFeature =
     compositeFeature()->addFeature(SketchAPI_Rectangle::ID());
-  return RectanglePtr(new SketchAPI_Rectangle(aFeature, theFirstPoint, theEndPoint, isFirstPointCenter));
+  return RectanglePtr(new SketchAPI_Rectangle(aFeature, theFirstPoint, theEndPoint,
+                                              isFirstPointCenter));
 }
 
 std::shared_ptr<SketchAPI_Rectangle> SketchAPI_Sketch::addRectangleCentered(
index ff1c97321320d37b57f3afb311d3ce6c7249f30c..1541f84332cc2e06e55d000fbd3d6a71f65c6df4 100644 (file)
@@ -47,8 +47,7 @@ const double tolerance = 1e-7;
 
 SketchPlugin_MacroRectangle::SketchPlugin_MacroRectangle()
   : SketchPlugin_SketchEntity(), myHasCenterPoint(false)
-{  
-}
+{}
 
 void SketchPlugin_MacroRectangle::initAttributes()
 {
@@ -139,32 +138,41 @@ void SketchPlugin_MacroRectangle::execute()
 
   if(myHasCenterPoint){
     std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
-          myRectangleFeature->attribute(SketchPlugin_Rectangle::CENTER_ID()))->setValue(myCenterPoint->x(),
-                                                                                        myCenterPoint->y());
+          myRectangleFeature->attribute(
+            SketchPlugin_Rectangle::CENTER_ID()))->setValue(myCenterPoint->x(),
+                                                            myCenterPoint->y());
   }
 
   std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
-        myRectangleFeature->attribute(SketchPlugin_Rectangle::START_ID()))->setValue(myStartPoint->x(),
-                                                                                     myStartPoint->y());
+        myRectangleFeature->attribute(
+          SketchPlugin_Rectangle::START_ID()))->setValue(myStartPoint->x(),
+                                                         myStartPoint->y());
   std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
-        myRectangleFeature->attribute(SketchPlugin_Rectangle::END_ID()))->setValue(myEndPoint->x(),
-                                                                                   myEndPoint->y());
+        myRectangleFeature->attribute(
+          SketchPlugin_Rectangle::END_ID()))->setValue(myEndPoint->x(),
+                                                       myEndPoint->y());
 
   myRectangleFeature->boolean(SketchPlugin_Rectangle::AUXILIARY_ID())
       ->setValue(boolean(AUXILIARY_ID())->value());
   myRectangleFeature->execute();
 
   /// create coincidences with rectangle start/center and  end points
-  AttributeRefListPtr aLinesList = myRectangleFeature->reflist(SketchPlugin_Rectangle::LINES_LIST_ID());
-  FeaturePtr aRectangleStartLineFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aLinesList->object(0));
-  FeaturePtr aRectangleEndLineFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aLinesList->object(2));
+  AttributeRefListPtr aLinesList =
+      myRectangleFeature->reflist(SketchPlugin_Rectangle::LINES_LIST_ID());
+  FeaturePtr aRectangleStartLineFeature =
+      std::dynamic_pointer_cast<ModelAPI_Feature>(aLinesList->object(0));
+  FeaturePtr aRectangleEndLineFeature =
+      std::dynamic_pointer_cast<ModelAPI_Feature>(aLinesList->object(2));
   std::shared_ptr<GeomDataAPI_Point2D> aRectanglePointEndAttr =
-      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aRectangleEndLineFeature->attribute(SketchPlugin_Line::END_ID()));
+      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+        aRectangleEndLineFeature->attribute(SketchPlugin_Line::END_ID()));
   std::shared_ptr<GeomDataAPI_Point2D> aRectanglePointStartAttr =
-      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aRectangleStartLineFeature->attribute(SketchPlugin_Line::END_ID()));
+      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+        aRectangleStartLineFeature->attribute(SketchPlugin_Line::END_ID()));
 
   if(myHasCenterPoint){
-    FeaturePtr aCenterPointFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(myRectangleFeature->refattr(CENTER_REF_ID())->object());
+    FeaturePtr aCenterPointFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(
+          myRectangleFeature->refattr(CENTER_REF_ID())->object());
     SketchPlugin_Tools::createCoincidenceOrTangency(
           this, CENTER_REF_ID(), AttributePtr(), aCenterPointFeature, false);
     SketchPlugin_Tools::createCoincidenceOrTangency(
index 22feb52a80c016530894e896083f58501b85d53a..b598158b3f03dbfc685979033739353b7ba1a2d9 100644 (file)
@@ -102,9 +102,11 @@ void SketchPlugin_Rectangle::updateLines()
   {
     FeaturePtr aLine = std::dynamic_pointer_cast<ModelAPI_Feature>(aLinesList->object(i));
     std::shared_ptr<GeomDataAPI_Point2D> aLineStart =
-        std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aLine->attribute(SketchPlugin_Line::START_ID()));
+        std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+          aLine->attribute(SketchPlugin_Line::START_ID()));
     std::shared_ptr<GeomDataAPI_Point2D> aLineEnd =
-        std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aLine->attribute(SketchPlugin_Line::END_ID()));
+        std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+          aLine->attribute(SketchPlugin_Line::END_ID()));
     aLineStart->setValue(aX[(i+3)%4], aY[(i+3)%4]);
     aLineEnd->setValue(aX[i], aY[i]);
     aLine->data()->boolean(AUXILIARY_ID())->setValue(anAuxiliary);
@@ -112,8 +114,10 @@ void SketchPlugin_Rectangle::updateLines()
     if(aDiagonalList->size())
     {
       auto aDiagonalPoint = cornerToDiagonalLinePoints[i];
-      FeaturePtr aDiagonal = std::dynamic_pointer_cast<ModelAPI_Feature>(aDiagonalList->object(aDiagonalPoint.first));
-      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aDiagonal->attribute(aDiagonalPoint.second))->setValue(aX[(i+3)%4], aY[(i+3)%4]);
+      FeaturePtr aDiagonal = std::dynamic_pointer_cast<ModelAPI_Feature>(
+            aDiagonalList->object(aDiagonalPoint.first));
+      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+            aDiagonal->attribute(aDiagonalPoint.second))->setValue(aX[(i+3)%4], aY[(i+3)%4]);
     }
   }
 }
@@ -134,7 +138,8 @@ void SketchPlugin_Rectangle::updateStartPoint()
   {
     FeaturePtr aLine = std::dynamic_pointer_cast<ModelAPI_Feature>(aLinesList->object(i));
     std::shared_ptr<GeomDataAPI_Point2D> aLineStart =
-        std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aLine->attribute(SketchPlugin_Line::END_ID()));
+        std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+          aLine->attribute(SketchPlugin_Line::END_ID()));
     aLineStart->setValue(aXStart, aYStart);
   }
 }
@@ -194,9 +199,11 @@ void SketchPlugin_Rectangle::execute()
 
       for(int i = 0; i < 2; i++)
       {
-        FeaturePtr aDiagonal = std::dynamic_pointer_cast<ModelAPI_Feature>(aDiagonalList->object(i));
-        FeaturePtr aConstraint = SketchPlugin_Tools::createConstraintAttrObject(aSketch, SketchPlugin_ConstraintCoincidence::ID(),
-                                                                                aCoord, aDiagonal);
+        FeaturePtr aDiagonal = std::dynamic_pointer_cast<ModelAPI_Feature>(
+              aDiagonalList->object(i));
+        FeaturePtr aConstraint = SketchPlugin_Tools::createConstraintAttrObject(
+              aSketch, SketchPlugin_ConstraintCoincidence::ID(),
+              aCoord, aDiagonal);
         aNotToDumpList->append(aConstraint);
       }
     }
@@ -208,19 +215,22 @@ void SketchPlugin_Rectangle::execute()
       /// connect neighbor lines by coincidence
       unsigned iPrev = (i+3)%4;
       FeaturePtr aPrevLine = std::dynamic_pointer_cast<ModelAPI_Feature>(aLinesList->object(iPrev));
-      FeaturePtr aConstraint = SketchPlugin_Tools::createConstraintAttrAttr(aSketch, SketchPlugin_ConstraintCoincidence::ID(),
-                                                                            aPrevLine->attribute(SketchPlugin_Line::END_ID()),
-                                                                            aLine->attribute(SketchPlugin_Line::START_ID()));
+      FeaturePtr aConstraint = SketchPlugin_Tools::createConstraintAttrAttr(
+            aSketch, SketchPlugin_ConstraintCoincidence::ID(),
+            aPrevLine->attribute(SketchPlugin_Line::END_ID()),
+            aLine->attribute(SketchPlugin_Line::START_ID()));
       aNotToDumpList->append(aConstraint);
 
       /// case of  rectangle created from its center
       if(aDiagonalList->size())
       {
         auto aDiagonalPoint = cornerToDiagonalLinePoints[i];
-        FeaturePtr aDiagonal = std::dynamic_pointer_cast<ModelAPI_Feature>(aDiagonalList->object(aDiagonalPoint.first));
-        FeaturePtr aConstraint = SketchPlugin_Tools::createConstraintAttrAttr(aSketch, SketchPlugin_ConstraintCoincidence::ID(),
-                                                                              aDiagonal->attribute(aDiagonalPoint.second),
-                                                                              aLine->attribute(SketchPlugin_Line::START_ID()));
+        FeaturePtr aDiagonal = std::dynamic_pointer_cast<ModelAPI_Feature>(
+              aDiagonalList->object(aDiagonalPoint.first));
+        FeaturePtr aConstraint = SketchPlugin_Tools::createConstraintAttrAttr(
+              aSketch, SketchPlugin_ConstraintCoincidence::ID(),
+              aDiagonal->attribute(aDiagonalPoint.second),
+              aLine->attribute(SketchPlugin_Line::START_ID()));
         aNotToDumpList->append(aConstraint);
       }
     }
@@ -283,7 +293,8 @@ void SketchPlugin_Rectangle::execute()
     aSubs.push_back(aDiagonalResult->shape());
   }
 
-  FeaturePtr aCenterPointFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(refattr(CENTER_REF_ID())->object());
+  FeaturePtr aCenterPointFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(
+        refattr(CENTER_REF_ID())->object());
   if(aCenterPointFeature)
   {
     ResultPtr aCenterResult = aCenterPointFeature->lastResult();
index 72bef0d6a88c3bf16609b16585928032254185c2..a39621729af864565df8814253d19463f2f45e99 100644 (file)
@@ -116,8 +116,8 @@ protected:
 
 private:
   /// \brief updateLines crates lines from start and en points
-  void updateLines(); 
-  void updateStartPoint(); 
+  void updateLines();
+  void updateStartPoint();
 };