]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1834: Fix length of lines
authorvsv <vitaly.smetannikov@opencascade.com>
Wed, 2 Nov 2016 16:02:42 +0000 (19:02 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Wed, 2 Nov 2016 16:02:42 +0000 (19:02 +0300)
27 files changed:
src/SketchPlugin/SketchPlugin_Arc.cpp
src/SketchPlugin/SketchPlugin_Circle.cpp
src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp
src/SketchPlugin/SketchPlugin_ConstraintCoincidence.cpp
src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp
src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp
src/SketchPlugin/SketchPlugin_ConstraintFillet.h
src/SketchPlugin/SketchPlugin_ConstraintLength.cpp
src/SketchPlugin/SketchPlugin_ConstraintMirror.cpp
src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp
src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.cpp
src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp
src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp
src/SketchPlugin/SketchPlugin_ConstraintSplit.h
src/SketchPlugin/SketchPlugin_ExternalValidator.cpp
src/SketchPlugin/SketchPlugin_ExternalValidator.h
src/SketchPlugin/SketchPlugin_IntersectionPoint.cpp
src/SketchPlugin/SketchPlugin_MultiRotation.cpp
src/SketchPlugin/SketchPlugin_MultiTranslation.cpp
src/SketchPlugin/SketchPlugin_Plugin.cpp
src/SketchPlugin/SketchPlugin_Projection.cpp
src/SketchPlugin/SketchPlugin_Sketch.cpp
src/SketchPlugin/SketchPlugin_Sketch.h
src/SketchPlugin/SketchPlugin_SketchEntity.cpp
src/SketchPlugin/SketchPlugin_SketchEntity.h
src/SketchPlugin/SketchPlugin_Tools.cpp
src/SketchPlugin/SketchPlugin_Validators.cpp

index 4de5125106cb02038952369b76739524bc415c71..ef74d2d0496c34b910ccbcdc155e17a50e0046a1 100644 (file)
@@ -150,9 +150,11 @@ void SketchPlugin_Arc::execute()
 
     std::shared_ptr<GeomAPI_Shape> aCircleShape;
     if(!isInversed->value()) {
-      aCircleShape = GeomAlgoAPI_EdgeBuilder::lineCircleArc(aCenter, aStartPoint, aEndPoint, aNormal);
+      aCircleShape = 
+        GeomAlgoAPI_EdgeBuilder::lineCircleArc(aCenter, aStartPoint, aEndPoint, aNormal);
     } else {
-      aCircleShape = GeomAlgoAPI_EdgeBuilder::lineCircleArc(aCenter, aEndPoint, aStartPoint, aNormal);
+      aCircleShape = 
+        GeomAlgoAPI_EdgeBuilder::lineCircleArc(aCenter, aEndPoint, aStartPoint, aNormal);
     }
 
     if (aCircleShape) {
@@ -193,7 +195,8 @@ AISObjectPtr SketchPlugin_Arc::getAISObject(AISObjectPtr thePrevious)
           bool aHasPlane = aNDir && !(aNDir->x() == 0 && aNDir->y() == 0 && aNDir->z() == 0);
           if (aHasPlane) {
             std::shared_ptr<GeomAPI_Dir> aNormal = aNDir->dir();
-            std::shared_ptr<GeomAPI_Pnt> aStartPoint(aSketch->to3D(aStartAttr->x(), aStartAttr->y()));
+            std::shared_ptr<GeomAPI_Pnt> 
+              aStartPoint(aSketch->to3D(aStartAttr->x(), aStartAttr->y()));
             std::shared_ptr<GeomAPI_Pnt> aEndPoint = aStartPoint;
             if (aTypeAttr && aTypeAttr->isInitialized() &&
                 aTypeAttr->value() == ARC_TYPE_THREE_POINTS()) {
@@ -201,12 +204,15 @@ AISObjectPtr SketchPlugin_Arc::getAISObject(AISObjectPtr thePrevious)
                   aEndAttr->pnt()->distance(aStartAttr->pnt()) > tolerance) {
                 aEndPoint = aSketch->to3D(aEndAttr->x(), aEndAttr->y());
                 std::shared_ptr<GeomDataAPI_Point2D> aPassedAttr = 
-                  std::dynamic_pointer_cast<GeomDataAPI_Point2D>(data()->attribute(PASSED_POINT_ID()));
-                if (!aPassedAttr->isInitialized()) { // calculate the appropriate center for the presentation
+                  std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+                  data()->attribute(PASSED_POINT_ID()));
+                if (!aPassedAttr->isInitialized()) {
+                  // calculate the appropriate center for the presentation
                   // check that center is bad for the current start and end and must be recomputed
                   std::shared_ptr<GeomAPI_Circ2d> aCircleForArc(new GeomAPI_Circ2d(
                     aCenterAttr->pnt(), aStartAttr->pnt()));
-                  std::shared_ptr<GeomAPI_Pnt2d> aProjection = aCircleForArc->project(aEndAttr->pnt());
+                  std::shared_ptr<GeomAPI_Pnt2d> aProjection = 
+                    aCircleForArc->project(aEndAttr->pnt());
                   if (!aProjection.get() || aEndAttr->pnt()->distance(aProjection) > tolerance) {
                     std::shared_ptr<GeomAPI_XY> aDir = 
                       aEndAttr->pnt()->xy()->decreased(aStartAttr->pnt()->xy())->multiplied(0.5);
@@ -235,7 +241,8 @@ AISObjectPtr SketchPlugin_Arc::getAISObject(AISObjectPtr thePrevious)
           }
         }
         // make a visible point
-        std::shared_ptr<GeomAPI_Shape> aCenterPointShape = GeomAlgoAPI_PointBuilder::vertex(aCenter);
+        std::shared_ptr<GeomAPI_Shape> aCenterPointShape = 
+          GeomAlgoAPI_PointBuilder::vertex(aCenter);
         aShapes.push_back(aCenterPointShape);
       }
       if (!aShapes.empty()) {
@@ -312,9 +319,11 @@ bool SketchPlugin_Arc::isFeatureValid()
 
   bool isValid = false;
   if (anArcType == ARC_TYPE_THREE_POINTS())
-    isValid = aStartAttr->isInitialized() && anEndAttr->isInitialized() && aPassedAttr->isInitialized();
+    isValid = aStartAttr->isInitialized() && 
+      anEndAttr->isInitialized() && aPassedAttr->isInitialized();
   else
-    isValid = aCenterAttr->isInitialized() && aStartAttr->isInitialized() && anEndAttr->isInitialized();
+    isValid = aCenterAttr->isInitialized() && 
+      aStartAttr->isInitialized() && anEndAttr->isInitialized();
 
   return isValid;
 }
@@ -366,7 +375,8 @@ void SketchPlugin_Arc::attributeChanged(const std::string& theID)
       std::dynamic_pointer_cast<ModelAPI_AttributeString>(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() && (theID == TANGENT_POINT_ID() || theID == END_ID())) {
+  if (aTypeAttr->value() == ARC_TYPE_TANGENT() && 
+     (theID == TANGENT_POINT_ID() || theID == END_ID())) {
     SketchPlugin_Sketch* aSketch = sketch();
     AttributeRefAttrPtr aTangPtAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(
         data()->attribute(TANGENT_POINT_ID()));
@@ -402,7 +412,8 @@ void SketchPlugin_Arc::attributeChanged(const std::string& theID)
       std::shared_ptr<GeomAPI_Pnt2d> aMidPnt(
           new GeomAPI_Pnt2d(aEndPntCoord->added(aTangPnt2d->xy())->multiplied(0.5)));
 
-      // compute center of arc by calculating intersection of orthogonal line and middle perpendicular
+      // compute center of arc by calculating intersection of 
+      // orthogonal line and middle perpendicular
       std::shared_ptr<GeomAPI_Lin2d> anOrthoLine(new GeomAPI_Lin2d(aTangPnt2d, anOrthoDir));
       std::shared_ptr<GeomAPI_Lin2d> aMiddleLine(new GeomAPI_Lin2d(aMidPnt, aMidDir));
       std::shared_ptr<GeomAPI_Pnt2d> aCenter = anOrthoLine->intersect(aMiddleLine);
@@ -441,7 +452,8 @@ 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()) { // update passed point due to start, end and center
+    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
         std::shared_ptr<GeomDataAPI_Point2D> aPassedAttr =
@@ -484,7 +496,8 @@ void SketchPlugin_Arc::attributeChanged(const std::string& theID)
     aCircle->parameter(anEnd, paramTolerance, aEndParam);
     adjustPeriod(aStartParam);
     adjustPeriod(aEndParam);
-    if (aTypeAttr->value() == ARC_TYPE_THREE_POINTS()) { // use the passed point for the angle calculation
+    // use the passed point for the angle calculation
+    if (aTypeAttr->value() == ARC_TYPE_THREE_POINTS()) { 
       std::shared_ptr<GeomDataAPI_Point2D> aPassedAttr =
         std::dynamic_pointer_cast<GeomDataAPI_Point2D>(data()->attribute(PASSED_POINT_ID()));
       double aPassedParam;
@@ -545,7 +558,8 @@ void SketchPlugin_Arc::attributeChanged(const std::string& theID)
   }
 
   if (theID == RADIUS_ID()) {
-    if (!aStartAttr->isInitialized() || !anEndAttr->isInitialized() || !aCenterAttr->isInitialized())
+    if (!aStartAttr->isInitialized() || !anEndAttr->isInitialized() || 
+        !aCenterAttr->isInitialized())
       return;
     // move center and passed point
     std::shared_ptr<GeomAPI_Pnt2d> aStart = aStartAttr->pnt();
@@ -558,11 +572,15 @@ void SketchPlugin_Arc::attributeChanged(const std::string& theID)
     double aRadius = aRadiusAttr->value();
 
     data()->blockSendAttributeUpdated(true);
-    std::shared_ptr<GeomAPI_Dir2d> aStartDir(new GeomAPI_Dir2d(aStart->xy()->decreased(aCenter->xy())));
-    std::shared_ptr<GeomAPI_XY> aNewStart = aStartDir->xy()->multiplied(aRadius)->added(aCenter->xy());
+    std::shared_ptr<GeomAPI_Dir2d> 
+      aStartDir(new GeomAPI_Dir2d(aStart->xy()->decreased(aCenter->xy())));
+    std::shared_ptr<GeomAPI_XY> 
+      aNewStart = aStartDir->xy()->multiplied(aRadius)->added(aCenter->xy());
     aStartAttr->setValue(aNewStart->x(), aNewStart->y());
-    std::shared_ptr<GeomAPI_Dir2d> anEndDir(new GeomAPI_Dir2d(anEnd->xy()->decreased(aCenter->xy())));
-    std::shared_ptr<GeomAPI_XY> aNewEnd = anEndDir->xy()->multiplied(aRadius)->added(aCenter->xy());
+    std::shared_ptr<GeomAPI_Dir2d> 
+      anEndDir(new GeomAPI_Dir2d(anEnd->xy()->decreased(aCenter->xy())));
+    std::shared_ptr<GeomAPI_XY> 
+      aNewEnd = anEndDir->xy()->multiplied(aRadius)->added(aCenter->xy());
     anEndAttr->setValue(aNewEnd->x(), aNewEnd->y());
     data()->blockSendAttributeUpdated(false);
     return;
@@ -590,7 +608,8 @@ void SketchPlugin_Arc::attributeChanged(const std::string& theID)
 
 void SketchPlugin_Arc::setReversed(bool isReversed)
 {
-  std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(attribute(INVERSED_ID()))->setValue(isReversed);
+  std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(
+    attribute(INVERSED_ID()))->setValue(isReversed);
   myParamBefore = 0.0;
 }
 
index cc8a992bc21e96f554272838a27198b21f7413fe..3df29fe2daec83cef53f8c631d19d0c5f0f4e6b7 100644 (file)
@@ -123,7 +123,8 @@ AISObjectPtr SketchPlugin_Circle::getAISObject(AISObjectPtr thePrevious)
         if (aCircleShape && aRadius != 0) {
           std::list<std::shared_ptr<GeomAPI_Shape> > aShapes;
           // make a visible point
-          std::shared_ptr<GeomAPI_Shape> aCenterPointShape = GeomAlgoAPI_PointBuilder::vertex(aCenter);
+          std::shared_ptr<GeomAPI_Shape> aCenterPointShape = 
+            GeomAlgoAPI_PointBuilder::vertex(aCenter);
           aShapes.push_back(aCenterPointShape);
           aShapes.push_back(aCircleShape);
 
index 65ac80b153e411cd4d5bc41688e6db99bc5074fd..432b28eb43903dd9eee6eb5d804d8e5c1075b564 100644 (file)
@@ -42,11 +42,15 @@ 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(), ModelAPI_AttributeDouble::typeId());
-  data()->addAttribute(SketchPlugin_ConstraintAngle::TYPE_ID(), ModelAPI_AttributeInteger::typeId());
-
-  data()->addAttribute(SketchPlugin_ConstraintAngle::ANGLE_REVERSED_FIRST_LINE_ID(), ModelAPI_AttributeBoolean::typeId());
-  data()->addAttribute(SketchPlugin_ConstraintAngle::ANGLE_REVERSED_SECOND_LINE_ID(), ModelAPI_AttributeBoolean::typeId());
+  data()->addAttribute(SketchPlugin_ConstraintAngle::ANGLE_VALUE_ID(), 
+                       ModelAPI_AttributeDouble::typeId());
+  data()->addAttribute(SketchPlugin_ConstraintAngle::TYPE_ID(), 
+                       ModelAPI_AttributeInteger::typeId());
+
+  data()->addAttribute(SketchPlugin_ConstraintAngle::ANGLE_REVERSED_FIRST_LINE_ID(), 
+                       ModelAPI_AttributeBoolean::typeId());
+  data()->addAttribute(SketchPlugin_ConstraintAngle::ANGLE_REVERSED_SECOND_LINE_ID(), 
+                       ModelAPI_AttributeBoolean::typeId());
 }
 
 void SketchPlugin_ConstraintAngle::colorConfigInfo(std::string& theSection, std::string& theName,
@@ -61,8 +65,10 @@ void SketchPlugin_ConstraintAngle::execute()
 {
   std::shared_ptr<ModelAPI_Data> aData = data();
 
-  std::shared_ptr<ModelAPI_AttributeRefAttr> anAttrA = aData->refattr(SketchPlugin_Constraint::ENTITY_A());
-  std::shared_ptr<ModelAPI_AttributeRefAttr> anAttrB = aData->refattr(SketchPlugin_Constraint::ENTITY_B());
+  std::shared_ptr<ModelAPI_AttributeRefAttr> anAttrA = 
+    aData->refattr(SketchPlugin_Constraint::ENTITY_A());
+  std::shared_ptr<ModelAPI_AttributeRefAttr> anAttrB = 
+    aData->refattr(SketchPlugin_Constraint::ENTITY_B());
   if (!anAttrA->isInitialized() || !anAttrB->isInitialized())
     return;
 
@@ -74,7 +80,8 @@ void SketchPlugin_ConstraintAngle::execute()
     anAttrValue->setValue(anAngle);
     updateConstraintValueByAngleValue();
   }
-  // the value should to be computed here, not in the getAISObject in order to change the model value
+  // 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
   std::shared_ptr<GeomDataAPI_Point2D> aFlyOutAttr = std::dynamic_pointer_cast<
@@ -109,7 +116,8 @@ void SketchPlugin_ConstraintAngle::attributeChanged(const std::string& theID)
     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()) // initialize base value of constraint
+      if (aValueAttr->isInitialized() && !aConstrValueAttr->isInitialized()) 
+        // initialize base value of constraint
         updateConstraintValueByAngleValue();
       double anAngle = calculateAngle();
       aValueAttr->setValue(anAngle);
@@ -119,12 +127,15 @@ void SketchPlugin_ConstraintAngle::attributeChanged(const std::string& theID)
     // Recalculate flyout point in local coordinates
     // coordinates are calculated according to the center of shapes intersection
     std::shared_ptr<GeomDataAPI_Point2D> aFlyoutAttr =
-        std::dynamic_pointer_cast<GeomDataAPI_Point2D>(attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()));
+      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+      attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()));
 
     std::shared_ptr<ModelAPI_Data> aData = data();
     std::shared_ptr<GeomAPI_Ax3> aPlane = SketchPlugin_Sketch::plane(sketch());
-    FeaturePtr aLineA = SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_A());
-    FeaturePtr aLineB = SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_B());
+    FeaturePtr aLineA = 
+      SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_A());
+    FeaturePtr aLineB = 
+      SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_B());
 
     // Intersection of lines
     std::shared_ptr<GeomAPI_Pnt2d> anInter = intersect(aLineA, aLineB);
@@ -174,7 +185,8 @@ double SketchPlugin_ConstraintAngle::calculateAngle()
     bool isReversed1 = boolean(ANGLE_REVERSED_FIRST_LINE_ID())->value();
     std::shared_ptr<GeomAPI_Lin2d> aLine2(new GeomAPI_Lin2d(aStartB->pnt(), aEndB->pnt()));
     bool isReversed2 = boolean(ANGLE_REVERSED_SECOND_LINE_ID())->value();
-    anAng = std::shared_ptr<GeomAPI_Angle2d>(new GeomAPI_Angle2d(aLine1, isReversed1, aLine2, isReversed2));
+    anAng = std::shared_ptr<GeomAPI_Angle2d>(
+      new GeomAPI_Angle2d(aLine1, isReversed1, aLine2, isReversed2));
   }
   double anAngle = anAng->angleDegree();
   std::shared_ptr<ModelAPI_AttributeDouble> aValueAttr = std::dynamic_pointer_cast<
index 5f79a167e3160fa3afe02095e7c2c93c2556c0ed..8d2ab687e1ba5b2804787b0b610777e158369c55 100644 (file)
@@ -89,10 +89,10 @@ AttributePoint2DPtr SketchPlugin_ConstraintCoincidence::getPoint(const FeaturePt
 {
   AttributePoint2DPtr aPoint = ModelGeomAlgo_Point2D::getPointOfRefAttr(theFeature.get(),
                                                          SketchPlugin_Constraint::ENTITY_A(),
-                                                         SketchPlugin_Point::ID(), SketchPlugin_Point::COORD_ID());
+                                 SketchPlugin_Point::ID(), SketchPlugin_Point::COORD_ID());
   if (!aPoint.get())
     aPoint = ModelGeomAlgo_Point2D::getPointOfRefAttr(theFeature.get(),
                                                       SketchPlugin_Constraint::ENTITY_B(),
-                                                      SketchPlugin_Point::ID(), SketchPlugin_Point::COORD_ID());
+                                 SketchPlugin_Point::ID(), SketchPlugin_Point::COORD_ID());
   return aPoint;
 }
index 35104dc38fc72efff13967c0b5eac81c7d7b986c..02931bcc29d08b662006c0df232b596a5584af3f 100644 (file)
@@ -71,7 +71,8 @@ AISObjectPtr SketchPlugin_ConstraintDistance::getAISObject(AISObjectPtr thePrevi
   if (!sketch())
     return thePrevious;
 
-  AISObjectPtr anAIS = SketcherPrs_Factory::lengthDimensionConstraint(this, sketch()->coordinatePlane(),
+  AISObjectPtr anAIS = SketcherPrs_Factory::lengthDimensionConstraint(this, 
+                                                                      sketch()->coordinatePlane(),
                                                                       thePrevious);
   return anAIS;
 }
@@ -170,7 +171,8 @@ void SketchPlugin_ConstraintDistance::attributeChanged(const std::string& theID)
   {
     std::shared_ptr<ModelAPI_AttributeDouble> aValueAttr = std::dynamic_pointer_cast<
         ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_Constraint::VALUE()));
-    if (!aValueAttr->isInitialized()) { // only if it is not initialized, try to compute the current value
+    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
         aValueAttr->setValue(aDistance);
@@ -179,7 +181,8 @@ 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 line binding two distanced points
+    // 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
     std::shared_ptr<GeomDataAPI_Point2D> aFlyoutAttr =
index 0481c4a14a0f48e193f4ac149edd4563b978d87f..c2ad12f9924c30ad89a0f989a751ff00539fd8ba 100644 (file)
@@ -69,7 +69,8 @@ SketchPlugin_ConstraintFillet::SketchPlugin_ConstraintFillet()
 void SketchPlugin_ConstraintFillet::initAttributes()
 {
   data()->addAttribute(SketchPlugin_Constraint::VALUE(), ModelAPI_AttributeDouble::typeId());
-  data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttrList::typeId());
+  data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), 
+                       ModelAPI_AttributeRefAttrList::typeId());
 }
 
 void SketchPlugin_ConstraintFillet::execute()
@@ -98,7 +99,8 @@ void SketchPlugin_ConstraintFillet::execute()
       aPointsIter != myNewPoints.end();
       ++aPointsIter) {
     AttributePtr aPointAttr = *aPointsIter;
-    std::shared_ptr<GeomDataAPI_Point2D> aFilletPoint2d = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aPointAttr);
+    std::shared_ptr<GeomDataAPI_Point2D> aFilletPoint2d = 
+      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aPointAttr);
     if(!aFilletPoint2d.get()) {
       setError("Error: One of the selected points is empty.");
       return;
@@ -108,7 +110,8 @@ void SketchPlugin_ConstraintFillet::execute()
     // Obtain base lines for fillet.
     bool anIsNeedNewObjects = true;
     FilletFeatures aFilletFeatures;
-    std::map<AttributePtr, FilletFeatures>::iterator aPrevPointsIter = myPointFeaturesMap.find(aPointAttr);
+    std::map<AttributePtr, FilletFeatures>::iterator aPrevPointsIter = 
+      myPointFeaturesMap.find(aPointAttr);
     if(aPrevPointsIter != myPointFeaturesMap.end()) {
       anIsNeedNewObjects = false;
       aFilletFeatures = aPrevPointsIter->second;
@@ -121,7 +124,8 @@ void SketchPlugin_ConstraintFillet::execute()
       // Obtain constraint coincidence for the fillet point.
       FeaturePtr aConstraintCoincidence;
       const std::set<AttributePtr>& aRefsList = aFilletPoint2d->owner()->data()->refsToMe();
-      for(std::set<AttributePtr>::const_iterator anIt = aRefsList.cbegin(); anIt != aRefsList.cend(); ++anIt) {
+      for(std::set<AttributePtr>::const_iterator 
+          anIt = aRefsList.cbegin(); anIt != aRefsList.cend(); ++anIt) {
         std::shared_ptr<ModelAPI_Attribute> anAttr = (*anIt);
         FeaturePtr aConstrFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(anAttr->owner());
         if(aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) {
@@ -162,8 +166,12 @@ void SketchPlugin_ConstraintFillet::execute()
       aBaseEdgeA = *aLinesIt++;
       aBaseEdgeB = *aLinesIt;
 
-      std::pair<FeaturePtr, bool> aBasePairA = std::make_pair(aBaseEdgeA, aBaseEdgeA->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value());
-      std::pair<FeaturePtr, bool> aBasePairB = std::make_pair(aBaseEdgeB, aBaseEdgeB->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value());
+      std::pair<FeaturePtr, bool> aBasePairA = 
+        std::make_pair(aBaseEdgeA, 
+                       aBaseEdgeA->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value());
+      std::pair<FeaturePtr, bool> aBasePairB = 
+        std::make_pair(aBaseEdgeB, 
+                       aBaseEdgeB->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value());
       aFilletFeatures.baseEdgesState.push_back(aBasePairA);
       aFilletFeatures.baseEdgesState.push_back(aBasePairB);
     }
@@ -198,9 +206,11 @@ void SketchPlugin_ConstraintFillet::execute()
     static const int aNbFeatures = 2;
     FeaturePtr aBaseFeatures[aNbFeatures] = {aBaseEdgeA, aBaseEdgeB};
     FeaturePtr aResultFeatures[aNbFeatures] = {aResultEdgeA, aResultEdgeB};
-    std::shared_ptr<GeomAPI_Dir2d> aTangentDir[aNbFeatures]; // tangent directions of the features in coincident point
+    // tangent directions of the features in coincident point
+    std::shared_ptr<GeomAPI_Dir2d> aTangentDir[aNbFeatures]; 
     bool isStart[aNbFeatures]; // indicates which point the features share
-    std::shared_ptr<GeomAPI_Pnt2d> aStartEndPnt[aNbFeatures * 2]; // first pair of points relate to first feature, second pair -  to second
+    // first pair of points relate to first feature, second pair -  to second
+    std::shared_ptr<GeomAPI_Pnt2d> aStartEndPnt[aNbFeatures * 2]; 
     std::string aFeatAttributes[aNbFeatures * 2]; // attributes of features
     for (int i = 0; i < aNbFeatures; i++) {
       std::string aStartAttr, aEndAttr;
@@ -236,7 +246,8 @@ void SketchPlugin_ConstraintFillet::execute()
         if (!isStart[i])
           aDir = aDir->multiplied(-1.0);
       } else if (aResultFeatures[i]->getKind() == SketchPlugin_Arc::ID()) {
-        std::shared_ptr<GeomAPI_Pnt2d> aCenterPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+        std::shared_ptr<GeomAPI_Pnt2d> aCenterPoint = 
+          std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
           aResultFeatures[i]->attribute(SketchPlugin_Arc::CENTER_ID()))->pnt();
         aDir = isStart[i] ? aStartEndPnt[2*i]->xy() : aStartEndPnt[2*i+1]->xy();
         aDir = aDir->decreased(aCenterPoint->xy());
@@ -245,7 +256,8 @@ void SketchPlugin_ConstraintFillet::execute()
         double y = aDir->y();
         aDir->setX(-y);
         aDir->setY(x);
-        if (isStart[i] == std::dynamic_pointer_cast<SketchPlugin_Arc>(aBaseFeatures[i])->isReversed())
+        if (isStart[i] == 
+            std::dynamic_pointer_cast<SketchPlugin_Arc>(aBaseFeatures[i])->isReversed())
           aDir = aDir->multiplied(-1.0);
       }
       aTangentDir[i] = std::shared_ptr<GeomAPI_Dir2d>(new GeomAPI_Dir2d(aDir));
@@ -254,24 +266,29 @@ 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), where A and B - angles between corresponding tanget direction and the X axis
+    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<GeomAPI_XY> aCenter, aTangentPntA, aTangentPntB;
-    calculateFilletCenter(aBaseEdgeA, aBaseEdgeB, aFilletRadius, isStart, aCenter, aTangentPntA, aTangentPntB);
+    calculateFilletCenter(aBaseEdgeA, aBaseEdgeB, aFilletRadius, 
+                          isStart, aCenter, aTangentPntA, aTangentPntB);
     if(!aCenter.get() || !aTangentPntA.get() || !aTangentPntB.get()) {
       setError("Can not create fillet with the specified parameters.");
       return;
     }
     // update features
     std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
-      aResultEdgeA->attribute(aFeatAttributes[isStart[0] ? 0 : 1]))->setValue(aTangentPntA->x(), aTangentPntA->y());
+      aResultEdgeA->attribute(aFeatAttributes[isStart[0] ? 0 : 1]))->
+      setValue(aTangentPntA->x(), aTangentPntA->y());
     aResultEdgeA->execute();
     std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
-      aResultEdgeB->attribute(aFeatAttributes[2 + (isStart[1] ? 0 : 1)]))->setValue(aTangentPntB->x(), aTangentPntB->y());
+      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 process the "attribute updated"
+    // 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);
     std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
@@ -281,7 +298,8 @@ void SketchPlugin_ConstraintFillet::execute()
       aTangentPntA = aTangentPntB;
       aTangentPntB = aTmp;
     }
-    std::shared_ptr<GeomDataAPI_Point2D> aStartPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+    std::shared_ptr<GeomDataAPI_Point2D> aStartPoint = 
+      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
       aResultArc->attribute(SketchPlugin_Arc::START_ID()));
     std::shared_ptr<GeomDataAPI_Point2D> aEndPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
       aResultArc->attribute(SketchPlugin_Arc::END_ID()));
@@ -308,7 +326,8 @@ 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(), aResultFeatures[aFeatInd], aFeatAttributes[anAttrInd]);
+      recalculateAttributes(aResultArc, SketchPlugin_Arc::START_ID(), 
+                            aResultFeatures[aFeatInd], aFeatAttributes[anAttrInd]);
       aConstraint->execute();
       aFilletFeatures.resultConstraints.push_back(aConstraint);
       ModelAPI_EventCreator::get()->sendUpdated(aConstraint, anUpdateEvent);
@@ -322,7 +341,8 @@ 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(), aResultFeatures[aFeatInd], aFeatAttributes[anAttrInd]);
+      recalculateAttributes(aResultArc, SketchPlugin_Arc::END_ID(), 
+                            aResultFeatures[aFeatInd], aFeatAttributes[anAttrInd]);
       aConstraint->execute();
       aFilletFeatures.resultConstraints.push_back(aConstraint);
       ModelAPI_EventCreator::get()->sendUpdated(aConstraint, anUpdateEvent);
@@ -348,7 +368,8 @@ void SketchPlugin_ConstraintFillet::execute()
         aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(
             aConstraint->attribute(SketchPlugin_Constraint::ENTITY_B()));
         bool isArc = aResultFeatures[i]->getKind() == SketchPlugin_Arc::ID();
-        aRefAttr->setObject(isArc ? aResultFeatures[i]->lastResult() : aResultFeatures[i]->firstResult());
+        aRefAttr->setObject(isArc ? aResultFeatures[i]->lastResult() : 
+                                    aResultFeatures[i]->firstResult());
         aConstraint->execute();
         aFilletFeatures.resultConstraints.push_back(aConstraint);
         ModelAPI_EventCreator::get()->sendUpdated(aConstraint, anUpdateEvent);
@@ -446,7 +467,8 @@ void SketchPlugin_ConstraintFillet::attributeChanged(const std::string& theID)
     myNewPoints.clear();
 
     // Get list of points for fillets and current radius.
-    AttributeRefAttrListPtr aRefListOfFilletPoints = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttrList>(
+    AttributeRefAttrListPtr aRefListOfFilletPoints = 
+      std::dynamic_pointer_cast<ModelAPI_AttributeRefAttrList>(
       data()->attribute(SketchPlugin_Constraint::ENTITY_A()));
     AttributeDoublePtr aRadiusAttribute = real(VALUE());
     int aListSize = aRefListOfFilletPoints->size();
@@ -460,7 +482,8 @@ 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::pair<ObjectPtr, AttributePtr>> aSelectedPointsList = aRefListOfFilletPoints->list();
+    std::list<std::pair<ObjectPtr, AttributePtr>> 
+      aSelectedPointsList = aRefListOfFilletPoints->list();
     std::list<std::pair<ObjectPtr, AttributePtr>>::iterator anIter = aSelectedPointsList.begin();
     std::set<AttributePtr> aPointsToSkeep;
     for(int anIndex = 0; anIndex < aListSize; anIndex++, anIter++) {
@@ -484,7 +507,8 @@ void SketchPlugin_ConstraintFillet::attributeChanged(const std::string& theID)
       // Obtain constraint coincidence for the fillet point.
       FeaturePtr aConstraintCoincidence;
       const std::set<AttributePtr>& aRefsList = aFilletPointAttr->owner()->data()->refsToMe();
-      for(std::set<AttributePtr>::const_iterator anIt = aRefsList.cbegin(); anIt != aRefsList.cend(); ++anIt) {
+      for(std::set<AttributePtr>::const_iterator 
+          anIt = aRefsList.cbegin(); anIt != aRefsList.cend(); ++anIt) {
         std::shared_ptr<ModelAPI_Attribute> anAttr = (*anIt);
         FeaturePtr aConstrFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(anAttr->owner());
         if(aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) {
@@ -526,10 +550,12 @@ void SketchPlugin_ConstraintFillet::attributeChanged(const std::string& theID)
                                            SketchPlugin_ConstraintCoincidence::ENTITY_B(),
                                            aCoincides);
 
-      // Remove points from set of coincides. Also get all attributes which is equal to this point to exclude it.
+      // Remove points from set of coincides. 
+      // Also get all attributes which is equal to this point to exclude it.
       std::shared_ptr<GeomAPI_Pnt2d> aFilletPnt2d = aFilletPoint2D->pnt();
       std::set<FeaturePtr> aNewSetOfCoincides;
-      for(std::set<FeaturePtr>::iterator anIt = aCoincides.begin(); anIt != aCoincides.end(); ++anIt) {
+      for(std::set<FeaturePtr>::iterator 
+          anIt = aCoincides.begin(); anIt != aCoincides.end(); ++anIt) {
         std::string aFeatureKind = (*anIt)->getKind();
         if(aFeatureKind == SketchPlugin_Point::ID()) {
           AttributePtr anAttr = (*anIt)->attribute(SketchPlugin_Point::COORD_ID());
@@ -580,7 +606,8 @@ 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<FeaturePtr>::iterator anIt = aCoincides.begin(); anIt != aCoincides.end(); ++anIt) {
+        for(std::set<FeaturePtr>::iterator 
+            anIt = aCoincides.begin(); anIt != aCoincides.end(); ++anIt) {
           if(!(*anIt)->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value()) {
             aNewSetOfCoincides.insert(*anIt);
           }
@@ -616,7 +643,8 @@ 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 : aRadius < aMinimumRadius ? aRadius : aMinimumRadius;
+        aMinimumRadius = aMinimumRadius == 0 ? aRadius : 
+          aRadius < aMinimumRadius ? aRadius : aMinimumRadius;
       }
     }
 
@@ -662,7 +690,8 @@ void SketchPlugin_ConstraintFillet::clearResults()
     for(aFeatureIt = aFilletFeatures.baseEdgesState.cbegin();
         aFeatureIt != aFilletFeatures.baseEdgesState.cend();
         ++aFeatureIt) {
-      aFeatureIt->first->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->setValue(aFeatureIt->second);
+      aFeatureIt->first->boolean(
+        SketchPlugin_SketchEntity::AUXILIARY_ID())->setValue(aFeatureIt->second);
     }
     ++aPointsIter;
   }
@@ -788,11 +817,15 @@ void possibleFilletCenterArcArc(
       double aMedDist = (aRadA * aRadA - aRadB * aRadB + aCenterDist2) / (2.0 * aCenterDist);
       double aHeight = sqrt(aRadA * aRadA - aMedDist * aMedDist);
 
-      double x1 = theCenterA->x() + (aMedDist * aCenterDir->x() + aCenterDir->y() * aHeight) / aCenterDist;
-      double y1 = theCenterA->y() + (aMedDist * aCenterDir->y() - aCenterDir->x() * aHeight) / aCenterDist;
+      double x1 = theCenterA->x() + 
+        (aMedDist * aCenterDir->x() + aCenterDir->y() * aHeight) / aCenterDist;
+      double y1 = theCenterA->y() + 
+        (aMedDist * aCenterDir->y() - aCenterDir->x() * aHeight) / aCenterDist;
 
-      double x2 = theCenterA->x() + (aMedDist * aCenterDir->x() - aCenterDir->y() * aHeight) / aCenterDist;
-      double y2 = theCenterA->y() + (aMedDist * aCenterDir->y() + aCenterDir->x() * aHeight) / aCenterDist;
+      double x2 = theCenterA->x() + 
+        (aMedDist * aCenterDir->x() - aCenterDir->y() * aHeight) / aCenterDist;
+      double y2 = theCenterA->y() + 
+        (aMedDist * aCenterDir->y() + aCenterDir->x() * aHeight) / aCenterDist;
 
       std::shared_ptr<GeomAPI_XY> aPoint1(new GeomAPI_XY(x1, y1));
       theCenters.push_back(aPoint1);
@@ -847,7 +880,8 @@ void calculateFilletCenter(FeaturePtr theFeatureA, FeaturePtr theFeatureB,
 
     // get and filter possible centers
     std::list< std::shared_ptr<GeomAPI_XY> > aSuspectCenters;
-    possibleFilletCenterLineLine(aStart[0], aDir[0], aStart[1], aDir[1], theRadius, aSuspectCenters);
+    possibleFilletCenterLineLine(aStart[0], aDir[0], aStart[1], aDir[1], 
+                                 theRadius, aSuspectCenters);
     double aDot = 0.0;
     std::list< std::shared_ptr<GeomAPI_XY> >::iterator anIt = aSuspectCenters.begin();
     for (; anIt != aSuspectCenters.end(); anIt++) {
@@ -882,7 +916,8 @@ void calculateFilletCenter(FeaturePtr theFeatureA, FeaturePtr theFeatureB,
 
     // get possible centers and filter them
     std::list< std::shared_ptr<GeomAPI_XY> > aSuspectCenters;
-    possibleFilletCenterLineArc(aStart[aLineInd], aDirLine, aCenter[1-aLineInd], anArcRadius, theRadius, aSuspectCenters);
+    possibleFilletCenterLineArc(aStart[aLineInd], aDirLine, aCenter[1-aLineInd], 
+                                anArcRadius, theRadius, aSuspectCenters);
     double aDot = 0.0;
     // the line is forward into the arc
     double innerArc = aCenter[1-aLineInd]->decreased(aStart[aLineInd])->dot(aDirLine->xy());
@@ -938,7 +973,8 @@ void calculateFilletCenter(FeaturePtr theFeatureA, FeaturePtr theFeatureB,
 
     // get and filter possible centers
     std::list< std::shared_ptr<GeomAPI_XY> > aSuspectCenters;
-    possibleFilletCenterArcArc(aCenter[0], anArcRadius[0], aCenter[1], anArcRadius[1], theRadius, aSuspectCenters);
+    possibleFilletCenterArcArc(aCenter[0], anArcRadius[0], aCenter[1], 
+                               anArcRadius[1], theRadius, aSuspectCenters);
     double aDot = 0.0;
     std::shared_ptr<GeomAPI_XY> aLineTgPoint, anArcTgPoint;
     std::list< std::shared_ptr<GeomAPI_XY> >::iterator anIt = aSuspectCenters.begin();
@@ -979,7 +1015,9 @@ void getPointOnEdge(const FeaturePtr theFeature,
       aPntEnd = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
         theFeature->attribute(SketchPlugin_Line::START_ID()))->pnt();
     }
-    thePoint.reset( new GeomAPI_Pnt2d(aPntStart->xy()->added( aPntEnd->xy()->decreased( aPntStart->xy() )->multiplied(1.0 / 3.0) ) ) );
+    thePoint.reset( 
+      new GeomAPI_Pnt2d(aPntStart->xy()->added( 
+      aPntEnd->xy()->decreased( aPntStart->xy() )->multiplied(1.0 / 3.0) ) ) );
   } else {
     std::shared_ptr<GeomAPI_Pnt2d> aPntTemp;
     std::shared_ptr<GeomAPI_Pnt2d> aPntStart = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
@@ -1038,7 +1076,8 @@ std::set<FeaturePtr> getCoincides(const FeaturePtr& theConstraintCoincidence)
 {
   std::set<FeaturePtr> aCoincides;
 
-  std::shared_ptr<GeomAPI_Pnt2d> aFilletPnt = SketchPlugin_Tools::getCoincidencePoint(theConstraintCoincidence);
+  std::shared_ptr<GeomAPI_Pnt2d> aFilletPnt = 
+    SketchPlugin_Tools::getCoincidencePoint(theConstraintCoincidence);
 
   SketchPlugin_Tools::findCoincidences(theConstraintCoincidence,
                                        SketchPlugin_ConstraintCoincidence::ENTITY_A(),
@@ -1067,7 +1106,8 @@ std::set<FeaturePtr> 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<FeaturePtr>::iterator anIt = aCoincides.begin(); anIt != aCoincides.end(); ++anIt) {
+    for(std::set<FeaturePtr>::iterator 
+        anIt = aCoincides.begin(); anIt != aCoincides.end(); ++anIt) {
       if(!(*anIt)->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value()) {
         aNewSetOfCoincides.insert(*anIt);
       }
index 0f665a32f80f84f6aebe706e933f31871f9c5ef0..d965eaff5a3d7d8849ef30b51f9f6f95a8127b8f 100644 (file)
 
 /** \class SketchPlugin_ConstraintFillet
  *  \ingroup Plugins
- *  \brief Feature for creation of a new constraint filleting two objects which have coincident point
+ *  \brief Feature for creation of a new constraint filleting two objects which have 
+ *  coincident point
  *
  *  This constraint has three attributes:
- *  SketchPlugin_Constraint::ENTITY_A() and SketchPlugin_Constraint::ENTITY_B() for the filleting objects;
+ *  SketchPlugin_Constraint::ENTITY_A() and SketchPlugin_Constraint::ENTITY_B() 
+ *  for the filleting objects;
  *  SketchPlugin_Constraint::VALUE() contains radius of filleting circular arc
  *
  *  Also the constraint has attribute SketchPlugin_Constraint::ENTITY_C()
@@ -27,9 +29,10 @@ class SketchPlugin_ConstraintFillet : public SketchPlugin_ConstraintBase
  public:
    /// \struct Struct to store base edges with states, result edges and constraints.
    struct FilletFeatures {
-    std::list<std::pair<FeaturePtr, bool>> baseEdgesState; ///< list of objects the fillet is based and its states
-    std::list<FeaturePtr> resultEdges; ///< list of result edges
-    std::list<FeaturePtr> resultConstraints; ///< list of constraints provided by the fillet
+     /// list of objects the fillet is based and its states
+     std::list<std::pair<FeaturePtr, bool>> baseEdgesState; 
+     std::list<FeaturePtr> resultEdges; ///< list of result edges
+     std::list<FeaturePtr> resultConstraints; ///< list of constraints provided by the fillet
    };
 
   /// Fillet constraint kind
@@ -76,7 +79,9 @@ private:
 
 private:
   std::set<AttributePtr> myNewPoints; ///< set of new points
-  std::map<AttributePtr, FilletFeatures> myPointFeaturesMap; ///< map of point and features for fillet
+
+  /// map of point and features for fillet
+  std::map<AttributePtr, FilletFeatures> 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
index 9a87f7f26c77d526ae4f33c9ad7a3663523476fb..6b291b643c716b091dde66958d92d1bc0cadf8a4 100644 (file)
@@ -68,10 +68,12 @@ void SketchPlugin_ConstraintLength::execute()
     //  aValueAttr->setValue(aLenght);
     //}
 
-    // the value should to be computed here, not in the getAISObject in order to change the model value
+    // 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 = data()->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT());
+    AttributePtr aFlyOutAttribute = 
+      data()->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT());
     if (!aFlyOutAttribute->isInitialized()) {
       compute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT());
     }
@@ -145,8 +147,8 @@ AISObjectPtr SketchPlugin_ConstraintLength::getAISObject(AISObjectPtr thePreviou
   if (!sketch())
     return thePrevious;
 
-  AISObjectPtr anAIS = SketcherPrs_Factory::lengthDimensionConstraint(this, sketch()->coordinatePlane(),
-                                                                      thePrevious);
+  AISObjectPtr anAIS = SketcherPrs_Factory::lengthDimensionConstraint(this, 
+    sketch()->coordinatePlane(), thePrevious);
   return anAIS;
 }
 
@@ -186,7 +188,8 @@ void SketchPlugin_ConstraintLength::attributeChanged(const std::string& theID) {
   {
     std::shared_ptr<ModelAPI_AttributeDouble> aValueAttr = std::dynamic_pointer_cast<
       ModelAPI_AttributeDouble>(attribute(SketchPlugin_Constraint::VALUE()));
-    if (!aValueAttr->isInitialized()) { // only if it is not initialized, try to compute the current value
+    if (!aValueAttr->isInitialized()) {
+      // only if it is not initialized, try to compute the current value
       double aLength;
       if (computeLenghtValue(aLength))
         aValueAttr->setValue(aLength);
index 42ed4d5b48911f67d7396b26352780bfe8502dc5..797d293e33fdaa597204721252577e5fe07a0d41 100755 (executable)
@@ -31,9 +31,12 @@ 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(), ModelAPI_AttributeRefList::typeId());
-  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), SketchPlugin_Constraint::ENTITY_B());
-  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), SketchPlugin_Constraint::ENTITY_C());
+  data()->addAttribute(SketchPlugin_ConstraintMirror::MIRROR_LIST_ID(), 
+                       ModelAPI_AttributeRefList::typeId());
+  ModelAPI_Session::get()->validators()->
+    registerNotObligatory(getKind(), SketchPlugin_Constraint::ENTITY_B());
+  ModelAPI_Session::get()->validators()->
+    registerNotObligatory(getKind(), SketchPlugin_Constraint::ENTITY_C());
 }
 
 void SketchPlugin_ConstraintMirror::execute()
@@ -133,7 +136,8 @@ void SketchPlugin_ConstraintMirror::execute()
       if (aMirrorIter != aMirroredList.end())
         break; // the lists are inconsistent
       // There is no mirrored object yet, create it
-      FeaturePtr aNewFeature = SketchPlugin_Sketch::addUniqueNamedCopiedFeature(aFeatureIn, sketch(), true);
+      FeaturePtr aNewFeature = 
+        SketchPlugin_Sketch::addUniqueNamedCopiedFeature(aFeatureIn, sketch(), true);
       aNewFeature->execute();
       ModelAPI_EventCreator::get()->sendUpdated(aNewFeature, aRedisplayEvent);
 
@@ -207,13 +211,15 @@ void SketchPlugin_ConstraintMirror::erase()
     static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
 
     std::list<ObjectPtr> aTargetList = aRefListOfMirrored->list();
-    for(std::list<ObjectPtr>::const_iterator aTargetIt = aTargetList.cbegin(); aTargetIt != aTargetList.cend(); aTargetIt++) {
+    for(std::list<ObjectPtr>::const_iterator aTargetIt = 
+        aTargetList.cbegin(); aTargetIt != aTargetList.cend(); aTargetIt++) {
       if((*aTargetIt).get()) {
         ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(*aTargetIt);
         if(aRes.get()) {
           FeaturePtr aFeature = aRes->document()->feature(aRes);
           if(aFeature.get()) {
-            AttributeBooleanPtr aBooleanAttr = aFeature->boolean(SketchPlugin_SketchEntity::COPY_ID());
+            AttributeBooleanPtr aBooleanAttr = 
+              aFeature->boolean(SketchPlugin_SketchEntity::COPY_ID());
             if(aBooleanAttr.get()) {
               if (ModelAPI_Session::get()->isOperation()) // if this is not undo or redo
                 aBooleanAttr->setValue(false);
index 7a6f71af5650be85384f0ec15cb6d5111553cd37..7d34a8412cf05a493c55953da42f8e5d35c58b9d 100644 (file)
@@ -31,7 +31,6 @@ void SketchPlugin_ConstraintParallel::initAttributes()
 {
   data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
   data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId());
-  //data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId());
 }
 
 void SketchPlugin_ConstraintParallel::execute()
index c7e327fa13d481d1da4baf6cbb702f0b683601e4..30817fdc9a9141aac4f4a9b2b2dd75f3e90a345d 100644 (file)
@@ -41,8 +41,8 @@ AISObjectPtr SketchPlugin_ConstraintPerpendicular::getAISObject(AISObjectPtr the
   if (!sketch())
     return thePrevious;
 
-  AISObjectPtr anAIS = SketcherPrs_Factory::perpendicularConstraint(this, sketch()->coordinatePlane(),
-                                                                    thePrevious);
+  AISObjectPtr anAIS = SketcherPrs_Factory::perpendicularConstraint(this, 
+    sketch()->coordinatePlane(), thePrevious);
   return anAIS;
 }
 
index f4bf1708fc2273349078a8a8a88c8d0c637068ee..339fe9af3f754738031057ce02ff8cf641e73f34 100644 (file)
@@ -75,7 +75,8 @@ void SketchPlugin_ConstraintRadius::execute()
     //  aValueAttr->setValue(aRadius);
     //}
 
-    // the value should to be computed here, not in the getAISObject in order to change the model value
+    // 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
     std::shared_ptr<GeomDataAPI_Point2D> aFlyoutAttr = std::dynamic_pointer_cast<
@@ -100,7 +101,8 @@ 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<GeomDataAPI_Point2D> aCenterAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+    std::shared_ptr<GeomDataAPI_Point2D> aCenterAttr = 
+      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
         aCyrcFeature->data()->attribute(SketchPlugin_Circle::CENTER_ID()));
     double aShift = aRadius * 1.1;
     std::shared_ptr<GeomAPI_Pnt2d> aPnt = aCenterAttr->pnt();
@@ -174,7 +176,8 @@ void SketchPlugin_ConstraintRadius::attributeChanged(const std::string& theID) {
   if (theID == SketchPlugin_Constraint::ENTITY_A()) {
     std::shared_ptr<ModelAPI_AttributeDouble> aValueAttr = std::dynamic_pointer_cast<
         ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_Constraint::VALUE()));
-    if (!aValueAttr->isInitialized()) { // only if it is not initialized, try to compute the current value
+    if (!aValueAttr->isInitialized()) { 
+      // only if it is not initialized, try to compute the current value
       std::shared_ptr<ModelAPI_Feature> aCyrcFeature;
       double aRadius = circleRadius(aCyrcFeature);
       if (aRadius > 0) { // set as value the radius of updated reference to another circle
index 6a0cb2efd07dc8fec53df494d40a993c0f816b1d..156dc33fa77c26aecca9e8bbc00b0263727cdcb3 100755 (executable)
@@ -72,8 +72,10 @@ void SketchPlugin_ConstraintSplit::execute()
     setError("Error: Base object is not initialized.");
     return;
   }
-  AttributePoint2DPtr aFirstPointAttrOfSplit = getPointOfRefAttr(aData->attribute(SketchPlugin_Constraint::ENTITY_A()));
-  AttributePoint2DPtr aSecondPointAttrOfSplit = getPointOfRefAttr(aData->attribute(SketchPlugin_Constraint::ENTITY_B()));
+  AttributePoint2DPtr aFirstPointAttrOfSplit = 
+    getPointOfRefAttr(aData->attribute(SketchPlugin_Constraint::ENTITY_A()));
+  AttributePoint2DPtr aSecondPointAttrOfSplit = 
+    getPointOfRefAttr(aData->attribute(SketchPlugin_Constraint::ENTITY_B()));
   if (!aFirstPointAttrOfSplit.get() || !aFirstPointAttrOfSplit->isInitialized() ||
       !aSecondPointAttrOfSplit.get() || !aSecondPointAttrOfSplit->isInitialized()) {
     setError("Error: Sub-shape is not initialized.");
@@ -118,7 +120,8 @@ void SketchPlugin_ConstraintSplit::execute()
   std::cout << std::endl;
 
   if (!aCoincidenceToFeature.empty()) {
-    std::cout << "Coincidences to base feature[" << aCoincidenceToFeature.size() << "]: " << std::endl;
+    std::cout << "Coincidences to base feature[" << 
+      aCoincidenceToFeature.size() << "]: " << std::endl;
     std::map<FeaturePtr, IdToPointPair>::const_iterator anIt = aCoincidenceToFeature.begin(),
                                                         aLast = aCoincidenceToFeature.end();
     for (int i = 1; anIt != aLast; anIt++, i++) {
@@ -128,7 +131,8 @@ void SketchPlugin_ConstraintSplit::execute()
 
       std::cout << i << "-" << getFeatureInfo(aFeature) << std::endl;
       std::cout <<     " -Attribute to correct:" << anAttributeId << std::endl;
-      std::cout <<     " -Point attribute:" << ModelGeomAlgo_Point2D::getPointAttributeInfo(aPointAttr) << std::endl;
+      std::cout <<     " -Point attribute:" << 
+        ModelGeomAlgo_Point2D::getPointAttributeInfo(aPointAttr) << std::endl;
     }
   }
 
@@ -144,13 +148,15 @@ void SketchPlugin_ConstraintSplit::execute()
 
       std::cout << i << "-" << getFeatureInfo(aFeature) << std::endl;
       std::cout <<     " -Attribute to correct:" << anAttributeId << std::endl;
-      std::cout <<     " -Point attribute:" << ModelGeomAlgo_Point2D::getPointAttributeInfo(aPointAttr) << std::endl;
+      std::cout <<     " -Point attribute:" << 
+        ModelGeomAlgo_Point2D::getPointAttributeInfo(aPointAttr) << std::endl;
     }
   }
 
-  std::map<AttributePtr, std::list<AttributePtr> >::const_iterator aRefIt = aBaseRefAttributes.begin(),
-                                                                   aRefLast = aBaseRefAttributes.end();
-  std::cout << std::endl << "References to attributes of base feature [" << aBaseRefAttributes.size() << "]" << std::endl;
+  std::map<AttributePtr, std::list<AttributePtr> >::const_iterator 
+    aRefIt = aBaseRefAttributes.begin(), aRefLast = aBaseRefAttributes.end();
+  std::cout << std::endl << "References to attributes of base feature [" << 
+    aBaseRefAttributes.size() << "]" << std::endl;
   for (; aRefIt != aRefLast; aRefIt++) {
     AttributePtr aBaseAttr = aRefIt->first;
     std::list<AttributePtr> aRefAttributes = aRefIt->second;
@@ -165,11 +171,14 @@ void SketchPlugin_ConstraintSplit::execute()
       FeaturePtr aRFeature = ModelAPI_Feature::feature(aRAttr->owner());
       aRefsInfo.append("(" + aRFeature->name() + ") ");
     }
-    std::shared_ptr<GeomDataAPI_Point2D> aPointAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aBaseAttr);
-    std::cout << aPointAttr->id().c_str() << ": " << "[" << aRefAttributes.size() << "] " << aRefsInfo << std::endl;
+    std::shared_ptr<GeomDataAPI_Point2D> aPointAttr = 
+      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aBaseAttr);
+    std::cout << aPointAttr->id().c_str() << 
+      ": " << "[" << aRefAttributes.size() << "] " << aRefsInfo << std::endl;
   }
   std::cout << std::endl;
-  std::cout << std::endl << "References to base feature [" << aRefsToFeature.size() << "]" << std::endl;
+  std::cout << std::endl << "References to base feature [" << 
+    aRefsToFeature.size() << "]" << std::endl;
   std::list<AttributePtr>::const_iterator aRefAttrIt = aRefsToFeature.begin(),
                                           aRefAttrLast = aRefsToFeature.end();
   std::string aRefsInfo;
@@ -202,13 +211,14 @@ void SketchPlugin_ConstraintSplit::execute()
              aModifiedAttributes);
   if (aFeatureKind == SketchPlugin_Circle::ID()) {
     FeaturePtr aCircleFeature = aBaseFeature;
-    splitCircle(aSplitFeature, aBaseFeature, anAfterFeature, aFurtherCoincidences, aCreatedFeatures,
-                aModifiedAttributes);
+    splitCircle(aSplitFeature, aBaseFeature, anAfterFeature, aFurtherCoincidences, 
+      aCreatedFeatures, aModifiedAttributes);
 
     updateRefFeatureConstraints(getFeatureResult(aBaseFeature), aRefsToFeature);
 
     aFeaturesToDelete.insert(aCircleFeature);
-    aBaseObjectAttr->setObject(ResultPtr()); // as circle is removed, temporary fill this attribute*/
+    // as circle is removed, temporary fill this attribute*/
+    aBaseObjectAttr->setObject(ResultPtr());
   }
 
 #ifdef DEBUG_SPLIT
@@ -237,8 +247,8 @@ void SketchPlugin_ConstraintSplit::execute()
   }
 
   std::cout << "Modifed attributes (constraints to attributes are moved here):" << std::endl;
-  std::set<std::pair<AttributePtr, AttributePtr> >::const_iterator aPIt = aModifiedAttributes.begin(),
-                                                                   aPLast = aModifiedAttributes.end();
+  std::set<std::pair<AttributePtr, AttributePtr> >::const_iterator 
+    aPIt = aModifiedAttributes.begin(), aPLast = aModifiedAttributes.end();
   std::string aResInfo;
   for (; aPIt != aPLast; aPIt++) {
     if (!aResInfo.empty())
@@ -339,13 +349,15 @@ AISObjectPtr SketchPlugin_ConstraintSplit::getAISObject(AISObjectPtr thePrevious
     aPoints.push_back(aStartPoint);
 
     std::shared_ptr<GeomAPI_Pnt2d> aSecondPnt2d = aSecondPointAttrOfSplit->pnt();
-    std::shared_ptr<GeomAPI_Pnt> aSecondPoint = sketch()->to3D(aSecondPnt2d->x(), aSecondPnt2d->y());
+    std::shared_ptr<GeomAPI_Pnt> aSecondPoint = 
+      sketch()->to3D(aSecondPnt2d->x(), aSecondPnt2d->y());
     aPoints.push_back(aSecondPoint);
 
     std::set<std::shared_ptr<GeomAPI_Shape> > aSplitShapes;
 
     GeomAlgoAPI_ShapeTools::splitShape(aBaseShape, aPoints, aSplitShapes);
-    std::shared_ptr<GeomAPI_Shape> aShape = GeomAlgoAPI_ShapeTools::findShape(aPoints, aSplitShapes);
+    std::shared_ptr<GeomAPI_Shape> aShape = 
+      GeomAlgoAPI_ShapeTools::findShape(aPoints, aSplitShapes);
 
     AISObjectPtr anAIS = thePrevious;
     if (aShape) {
@@ -364,12 +376,13 @@ AISObjectPtr SketchPlugin_ConstraintSplit::getAISObject(AISObjectPtr thePrevious
 }
 
 std::shared_ptr<GeomDataAPI_Point2D> SketchPlugin_ConstraintSplit::getPointOfRefAttr(
-                                                                  const AttributePtr& theAttribute)
+                                                      const AttributePtr& theAttribute)
 {
   AttributePoint2DPtr aPointAttribute;
 
   if (theAttribute->attributeType() == ModelAPI_AttributeRefAttr::typeId()) {
-    AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
+    AttributeRefAttrPtr aRefAttr = 
+      std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
     if (aRefAttr.get() && aRefAttr->isInitialized()) {
       AttributePtr anAttribute = aRefAttr->attr();
       if (anAttribute.get() && anAttribute->attributeType() == GeomDataAPI_Point2D::typeId())
@@ -400,9 +413,9 @@ void SketchPlugin_ConstraintSplit::getFeaturePoints(AttributePoint2DPtr& theStar
   }
   if (!aStartAttributeName.empty() && !anEndAttributeName.empty()) {
     theStartPointAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
-                                                         aBaseFeature->attribute(aStartAttributeName));
+                                         aBaseFeature->attribute(aStartAttributeName));
     theEndPointAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
-                                                         aBaseFeature->attribute(anEndAttributeName));
+                                         aBaseFeature->attribute(anEndAttributeName));
   }
 }
 
@@ -436,16 +449,18 @@ void SketchPlugin_ConstraintSplit::getConstraints(std::set<FeaturePtr>& theFeatu
       theFeaturesToUpdate.insert(aRefFeature);
     else if (aRefFeatureKind == SketchPlugin_ConstraintTangent::ID()) {
       if (aBaseFeature->getKind() == SketchPlugin_Circle::ID()) /// TEMPORARY limitaion
-        theFeaturesToDelete.insert(aRefFeature); /// until tangency between arc and line is implemented
+        /// until tangency between arc and line is implemented
+        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 = SketchPlugin_ConstraintCoincidence::findCoincidenceFeature
-                                                                    (ModelAPI_Feature::feature(aResult1),
-                                                                     ModelAPI_Feature::feature(aResult2));
+          FeaturePtr aCoincidenceFeature = 
+            SketchPlugin_ConstraintCoincidence::findCoincidenceFeature
+                                                       (ModelAPI_Feature::feature(aResult1),
+                                                        ModelAPI_Feature::feature(aResult2));
           // get the point not lying on the splitting feature
           for (int i = 0; i < CONSTRAINT_ATTR_SIZE; ++i) {
             AttributeRefAttrPtr aRefAttr = aCoincidenceFeature->refattr(ATTRIBUTE(i));
@@ -467,8 +482,8 @@ void SketchPlugin_ConstraintSplit::getConstraints(std::set<FeaturePtr>& theFeatu
                        ? SketchPlugin_Constraint::ENTITY_A() : SketchPlugin_Constraint::ENTITY_B();
           theTangentFeatures[aRefFeature] = std::make_pair(anAttributeToBeModified, aTangentPoint);
         }
-        else
-          theFeaturesToDelete.insert(aRefFeature); /// there is not coincident point between tangent constraint
+        else /// there is not coincident point between tangent constraint
+          theFeaturesToDelete.insert(aRefFeature); 
       }
     }
     else if (aRefFeatureKind == SketchPlugin_ConstraintCoincidence::ID()) {
@@ -529,15 +544,17 @@ void SketchPlugin_ConstraintSplit::getConstraints(std::set<FeaturePtr>& theFeatu
 }
 
 void SketchPlugin_ConstraintSplit::getRefAttributes(const FeaturePtr& theFeature,
-                                                    std::map<AttributePtr, std::list<AttributePtr> >& theRefs,
-                                                    std::list<AttributePtr>& theRefsToFeature)
+                                    std::map<AttributePtr, std::list<AttributePtr> >& theRefs,
+                                    std::list<AttributePtr>& theRefsToFeature)
 {
   theRefs.clear();
 
-  std::list<AttributePtr> aPointAttributes = theFeature->data()->attributes(GeomDataAPI_Point2D::typeId());
+  std::list<AttributePtr> aPointAttributes = 
+    theFeature->data()->attributes(GeomDataAPI_Point2D::typeId());
   std::set<AttributePtr> aPointAttributesSet;
 
-  std::list<AttributePtr>::const_iterator aPIt = aPointAttributes.begin(), aPLast = aPointAttributes.end();
+  std::list<AttributePtr>::const_iterator aPIt = 
+    aPointAttributes.begin(), aPLast = aPointAttributes.end();
   for (; aPIt != aPLast; aPIt++)
     aPointAttributesSet.insert(*aPIt);
 
@@ -554,7 +571,8 @@ void SketchPlugin_ConstraintSplit::getRefAttributes(const FeaturePtr& theFeature
       AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(anAttr);
       if (!aRefAttr->isObject()) { /// find attributes referenced to feature point attributes
         AttributePtr anAttrInRef = aRefAttr->attr();
-        if (anAttrInRef.get() && aPointAttributesSet.find(anAttrInRef) != aPointAttributesSet.end()) {
+        if (anAttrInRef.get() && 
+            aPointAttributesSet.find(anAttrInRef) != aPointAttributesSet.end()) {
           if (theRefs.find(anAttrInRef) != theRefs.end())
             theRefs[anAttrInRef].push_back(aRefAttr);
           else {
@@ -653,7 +671,8 @@ void SketchPlugin_ConstraintSplit::updateTangentConstraintsToFeature(
         aFeaturePointAttribute = aFCAttribute;
     }
     if (aFeaturePointAttribute.get()) {
-      FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aFeaturePointAttribute->owner());
+      FeaturePtr aFeature = 
+        std::dynamic_pointer_cast<ModelAPI_Feature>(aFeaturePointAttribute->owner());
       aTangentFeature->refattr(anAttributeId)->setObject(getFeatureResult(aFeature));
     }
 #ifdef DEBUG_SPLIT
@@ -662,8 +681,9 @@ void SketchPlugin_ConstraintSplit::updateTangentConstraintsToFeature(
   }
 }
 
-void SketchPlugin_ConstraintSplit::updateRefFeatureConstraints(const ResultPtr& theFeatureBaseResult,
-                                                               const std::list<AttributePtr>& theRefsToFeature)
+void SketchPlugin_ConstraintSplit::updateRefFeatureConstraints(
+                                                  const ResultPtr& theFeatureBaseResult,
+                                                  const std::list<AttributePtr>& theRefsToFeature)
 {
   std::list<AttributePtr>::const_iterator anIt = theRefsToFeature.begin(),
                                           aLast = theRefsToFeature.end();
@@ -675,19 +695,20 @@ void SketchPlugin_ConstraintSplit::updateRefFeatureConstraints(const ResultPtr&
 }
 
 void SketchPlugin_ConstraintSplit::updateRefAttConstraints(
-                      const std::map<AttributePtr, std::list<AttributePtr> >& theBaseRefAttributes,
-                      const std::set<std::pair<AttributePtr, AttributePtr> >& theModifiedAttributes)
+                    const std::map<AttributePtr, std::list<AttributePtr> >& theBaseRefAttributes,
+                    const std::set<std::pair<AttributePtr, AttributePtr> >& theModifiedAttributes)
 {
 #ifdef DEBUG_SPLIT
   std::cout << "SketchPlugin_ConstraintSplit::updateRefAttConstraints" << std::endl;
 #endif
 
-  std::set<std::pair<AttributePtr, AttributePtr> >::const_iterator anIt = theModifiedAttributes.begin(),
-                                                                   aLast = theModifiedAttributes.end();
+  std::set<std::pair<AttributePtr, AttributePtr> >::const_iterator 
+    anIt = theModifiedAttributes.begin(),  aLast = theModifiedAttributes.end();
   for (; anIt != aLast; anIt++) {
     AttributePtr anAttribute = anIt->first;
 
-    if (theBaseRefAttributes.find(anAttribute) == theBaseRefAttributes.end()) /// not found in references
+    /// not found in references
+    if (theBaseRefAttributes.find(anAttribute) == theBaseRefAttributes.end()) 
       continue;
     std::list<AttributePtr> aRefAttributes = theBaseRefAttributes.at(anAttribute);
     std::list<AttributePtr>::const_iterator aRefIt = aRefAttributes.begin(),
@@ -729,8 +750,10 @@ void SketchPlugin_ConstraintSplit::splitLine(FeaturePtr& theSplitFeature,
   if (aFeatureKind != SketchPlugin_Line::ID())
     return;
 
-  AttributePoint2DPtr aFirstPointAttrOfSplit = getPointOfRefAttr(data()->attribute(SketchPlugin_Constraint::ENTITY_A()));
-  AttributePoint2DPtr aSecondPointAttrOfSplit = getPointOfRefAttr(data()->attribute(SketchPlugin_Constraint::ENTITY_B()));
+  AttributePoint2DPtr aFirstPointAttrOfSplit = 
+    getPointOfRefAttr(data()->attribute(SketchPlugin_Constraint::ENTITY_A()));
+  AttributePoint2DPtr aSecondPointAttrOfSplit = 
+    getPointOfRefAttr(data()->attribute(SketchPlugin_Constraint::ENTITY_B()));
   AttributePoint2DPtr aStartPointAttrOfBase, anEndPointAttrOfBase;
   getFeaturePoints(aStartPointAttrOfBase, anEndPointAttrOfBase);
   if (!aStartPointAttrOfBase.get() && !anEndPointAttrOfBase.get()) {
@@ -738,24 +761,30 @@ void SketchPlugin_ConstraintSplit::splitLine(FeaturePtr& theSplitFeature,
     return;
   }
 
-  arrangePointsOnLine(aStartPointAttrOfBase, anEndPointAttrOfBase, aFirstPointAttrOfSplit, aSecondPointAttrOfSplit);
+  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: " << ModelGeomAlgo_Point2D::getPointAttributeInfo(aStartPointAttrOfBase) << std::endl;
-  std::cout << "1st point:   " << ModelGeomAlgo_Point2D::getPointAttributeInfo(aFirstPointAttrOfSplit) << std::endl;
-  std::cout << "2nd point:   " << ModelGeomAlgo_Point2D::getPointAttributeInfo(aSecondPointAttrOfSplit) << std::endl;
-  std::cout << "End point:   " << ModelGeomAlgo_Point2D::getPointAttributeInfo(anEndPointAttrOfBase) << std::endl;
+  std::cout << "Start point: " << 
+    ModelGeomAlgo_Point2D::getPointAttributeInfo(aStartPointAttrOfBase) << std::endl;
+  std::cout << "1st point:   " << 
+    ModelGeomAlgo_Point2D::getPointAttributeInfo(aFirstPointAttrOfSplit) << std::endl;
+  std::cout << "2nd point:   " << 
+    ModelGeomAlgo_Point2D::getPointAttributeInfo(aSecondPointAttrOfSplit) << std::endl;
+  std::cout << "End point:   " << 
+    ModelGeomAlgo_Point2D::getPointAttributeInfo(anEndPointAttrOfBase) << std::endl;
 #endif
 
   /// create a split feature
-  theSplitFeature = createLineFeature(aBaseFeature, aFirstPointAttrOfSplit, aSecondPointAttrOfSplit);
+  theSplitFeature = 
+    createLineFeature(aBaseFeature, aFirstPointAttrOfSplit, aSecondPointAttrOfSplit);
   theCreatedFeatures.insert(theSplitFeature);
 
   // before split feature
   if (aStartPointAttrOfBase->pnt()->isEqual(aFirstPointAttrOfSplit->pnt())) {
     theModifiedAttributes.insert(std::make_pair(aStartPointAttrOfBase,
-                                                theSplitFeature->attribute(SketchPlugin_Line::START_ID())));
+                                        theSplitFeature->attribute(SketchPlugin_Line::START_ID())));
   }
   else {
     theBaseFeatureModified = aBaseFeature; ///< use base feature to store all constraints here
@@ -774,7 +803,7 @@ void SketchPlugin_ConstraintSplit::splitLine(FeaturePtr& theSplitFeature,
       aFeature = createLineFeature(aBaseFeature, aSecondPointAttrOfSplit, anEndPointAttrOfBase);
       theCreatedFeatures.insert(aFeature);
       theModifiedAttributes.insert(std::make_pair(anEndPointAttrOfBase,
-                                                  aFeature->attribute(SketchPlugin_Line::END_ID())));
+                                             aFeature->attribute(SketchPlugin_Line::END_ID())));
     }
     aConstraintFeature = createConstraint(SketchPlugin_ConstraintCoincidence::ID(),
                      theSplitFeature->attribute(SketchPlugin_Line::END_ID()),
@@ -795,14 +824,15 @@ void SketchPlugin_ConstraintSplit::splitLine(FeaturePtr& theSplitFeature,
     thePoints.insert(std::dynamic_pointer_cast<GeomDataAPI_Point2D>
                                   (theSplitFeature->attribute(SketchPlugin_Line::END_ID())));
     theModifiedAttributes.insert(std::make_pair(anEndPointAttrOfBase,
-                                                theSplitFeature->attribute(SketchPlugin_Line::END_ID())));
+                                   theSplitFeature->attribute(SketchPlugin_Line::END_ID())));
   }
   // base split, that is defined before split feature should be changed at end
   // (after the after feature creation). Otherwise modified value will be used in after feature
   // before split feature
   if (!aStartPointAttrOfBase->pnt()->isEqual(aFirstPointAttrOfSplit->pnt())) {
     /// move end arc point to start of split
-    fillAttribute(theBaseFeatureModified->attribute(SketchPlugin_Line::END_ID()), aFirstPointAttrOfSplit);
+    fillAttribute(theBaseFeatureModified->attribute(SketchPlugin_Line::END_ID()), 
+                                                    aFirstPointAttrOfSplit);
     theBaseFeatureModified->execute(); // to update result
     aConstraintFeature = createConstraint(SketchPlugin_ConstraintCoincidence::ID(),
                      theBaseFeatureModified->attribute(SketchPlugin_Line::END_ID()),
@@ -853,8 +883,10 @@ void SketchPlugin_ConstraintSplit::splitArc(FeaturePtr& theSplitFeature,
   if (aFeatureKind != SketchPlugin_Arc::ID())
     return;
 
-  AttributePoint2DPtr aFirstPointAttrOfSplit = getPointOfRefAttr(data()->attribute(SketchPlugin_Constraint::ENTITY_A()));
-  AttributePoint2DPtr aSecondPointAttrOfSplit = getPointOfRefAttr(data()->attribute(SketchPlugin_Constraint::ENTITY_B()));
+  AttributePoint2DPtr aFirstPointAttrOfSplit = 
+    getPointOfRefAttr(data()->attribute(SketchPlugin_Constraint::ENTITY_A()));
+  AttributePoint2DPtr aSecondPointAttrOfSplit = 
+    getPointOfRefAttr(data()->attribute(SketchPlugin_Constraint::ENTITY_B()));
   AttributePoint2DPtr aStartPointAttrOfBase, anEndPointAttrOfBase;
   getFeaturePoints(aStartPointAttrOfBase, anEndPointAttrOfBase);
   if (!aStartPointAttrOfBase.get() && !anEndPointAttrOfBase.get()) {
@@ -870,10 +902,14 @@ 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: " << ModelGeomAlgo_Point2D::getPointAttributeInfo(aStartPointAttrOfBase) << std::endl;
-  std::cout << "1st point:   " << ModelGeomAlgo_Point2D::getPointAttributeInfo(aFirstPointAttrOfSplit) << std::endl;
-  std::cout << "2nd point:   " << ModelGeomAlgo_Point2D::getPointAttributeInfo(aSecondPointAttrOfSplit) << std::endl;
-  std::cout << "End point:   " << ModelGeomAlgo_Point2D::getPointAttributeInfo(anEndPointAttrOfBase) << std::endl;
+  std::cout << "Start point: " << 
+    ModelGeomAlgo_Point2D::getPointAttributeInfo(aStartPointAttrOfBase) << std::endl;
+  std::cout << "1st point:   " << 
+    ModelGeomAlgo_Point2D::getPointAttributeInfo(aFirstPointAttrOfSplit) << std::endl;
+  std::cout << "2nd point:   " << 
+    ModelGeomAlgo_Point2D::getPointAttributeInfo(aSecondPointAttrOfSplit) << std::endl;
+  std::cout << "End point:   " << 
+    ModelGeomAlgo_Point2D::getPointAttributeInfo(anEndPointAttrOfBase) << std::endl;
 #endif
 
   /// split feature
@@ -883,7 +919,7 @@ void SketchPlugin_ConstraintSplit::splitArc(FeaturePtr& theSplitFeature,
   // before split feature
   if (aStartPointAttrOfBase->pnt()->isEqual(aFirstPointAttrOfSplit->pnt())) {
     theModifiedAttributes.insert(std::make_pair(aStartPointAttrOfBase,
-                                                theSplitFeature->attribute(SketchPlugin_Arc::START_ID())));
+                                  theSplitFeature->attribute(SketchPlugin_Arc::START_ID())));
   }
   else {
     theBaseFeatureModified = aBaseFeature; ///< use base feature to store all constraints here
@@ -930,7 +966,8 @@ void SketchPlugin_ConstraintSplit::splitArc(FeaturePtr& theSplitFeature,
   // before split feature
   if (!aStartPointAttrOfBase->pnt()->isEqual(aFirstPointAttrOfSplit->pnt())) {
     /// move end arc point to start of split
-    fillAttribute(theBaseFeatureModified->attribute(SketchPlugin_Arc::END_ID()), aFirstPointAttrOfSplit);
+    fillAttribute(theBaseFeatureModified->attribute(SketchPlugin_Arc::END_ID()),
+                                                    aFirstPointAttrOfSplit);
     theBaseFeatureModified->execute(); // to update result
     aConstraintFeature = createConstraint(SketchPlugin_ConstraintCoincidence::ID(),
                      theBaseFeatureModified->attribute(SketchPlugin_Arc::END_ID()),
@@ -989,21 +1026,27 @@ void SketchPlugin_ConstraintSplit::splitCircle(FeaturePtr& theSplitFeature,
   if (aFeatureKind != SketchPlugin_Circle::ID())
     return;
 
-  AttributePoint2DPtr aFirstPointAttrOfSplit = getPointOfRefAttr(data()->attribute(SketchPlugin_Constraint::ENTITY_A()));
-  AttributePoint2DPtr aSecondPointAttrOfSplit = getPointOfRefAttr(data()->attribute(SketchPlugin_Constraint::ENTITY_B()));
+  AttributePoint2DPtr aFirstPointAttrOfSplit = 
+    getPointOfRefAttr(data()->attribute(SketchPlugin_Constraint::ENTITY_A()));
+  AttributePoint2DPtr aSecondPointAttrOfSplit = 
+    getPointOfRefAttr(data()->attribute(SketchPlugin_Constraint::ENTITY_B()));
 
   /// split feature
-  theSplitFeature = createArcFeature(aBaseFeature, aFirstPointAttrOfSplit, aSecondPointAttrOfSplit);
+  theSplitFeature = 
+    createArcFeature(aBaseFeature, aFirstPointAttrOfSplit, aSecondPointAttrOfSplit);
   bool aSplitReversed = std::dynamic_pointer_cast<SketchPlugin_Arc>(theSplitFeature)->isReversed();
   theCreatedFeatures.insert(theSplitFeature);
 
   /// base feature is a left part of the circle
-  theBaseFeatureModified = createArcFeature(aBaseFeature, aFirstPointAttrOfSplit, aSecondPointAttrOfSplit);
-  std::dynamic_pointer_cast<SketchPlugin_Arc>(theBaseFeatureModified)->setReversed(!aSplitReversed);
+  theBaseFeatureModified = createArcFeature(aBaseFeature, 
+    aFirstPointAttrOfSplit, aSecondPointAttrOfSplit);
+  std::dynamic_pointer_cast<SketchPlugin_Arc>(
+    theBaseFeatureModified)->setReversed(!aSplitReversed);
   theBaseFeatureModified->execute();
 
-  theModifiedAttributes.insert(std::make_pair(aBaseFeature->attribute(SketchPlugin_Circle::CENTER_ID()),
-                                              theBaseFeatureModified->attribute(SketchPlugin_Arc::CENTER_ID())));
+  theModifiedAttributes.insert(
+    std::make_pair(aBaseFeature->attribute(SketchPlugin_Circle::CENTER_ID()),
+                  theBaseFeatureModified->attribute(SketchPlugin_Arc::CENTER_ID())));
 
   theCreatedFeatures.insert(theBaseFeatureModified);
 
@@ -1129,7 +1172,8 @@ 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 the "attribute updated"
+  // 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);
 
@@ -1168,7 +1212,8 @@ FeaturePtr SketchPlugin_ConstraintSplit::createConstraint(const std::string& the
   return aConstraint;
 }
 
-FeaturePtr SketchPlugin_ConstraintSplit::createConstraintForObjects(const std::string& theConstraintId,
+FeaturePtr SketchPlugin_ConstraintSplit::createConstraintForObjects(
+                                                    const std::string& theConstraintId,
                                                     const ObjectPtr& theFirstObject,
                                                     const ObjectPtr& theSecondObject)
 {
@@ -1258,14 +1303,15 @@ std::string SketchPlugin_ConstraintSplit::getFeatureInfo(
   if (isUseAttributesInfo) {
     std::string aPointsInfo = ModelGeomAlgo_Point2D::getPontAttributesInfo(theFeature,
                                                              getEdgeAttributes(theFeature));
-    if (!aPointsInfo.empty()) { /// processing of feature with point 2d attributes, like line, arc, circle
+    /// processing of feature with point 2d attributes, like line, arc, circle
+    if (!aPointsInfo.empty()) { 
       anInfo += ": ";
       anInfo += "\n";
       anInfo += aPointsInfo;
     }
     else { /// process constraint coincidence, find points in ref attr attributes
       std::list<AttributePtr> anAttrs = theFeature->data()->attributes(
-                                                                ModelAPI_AttributeRefAttr::typeId());
+                                                       ModelAPI_AttributeRefAttr::typeId());
       std::list<AttributePtr>::const_iterator anIt = anAttrs.begin(), aLast = anAttrs.end();
       std::string anAttributesInfo;
       for(; anIt != aLast; anIt++) {
@@ -1278,7 +1324,7 @@ std::string SketchPlugin_ConstraintSplit::getFeatureInfo(
         std::string aType = anAttr->attributeType();
         if (aType == ModelAPI_AttributeRefAttr::typeId()) {
           std::shared_ptr<ModelAPI_AttributeRefAttr> aRefAttr =
-                                        std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(anAttr);
+                             std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(anAttr);
           if (aRefAttr.get()) {
             if (aRefAttr->isObject()) {
               FeaturePtr aFeature = ModelAPI_Feature::feature(aRefAttr->object());
index 78df542720fb460fee09b10cf9c95f380c33367e..1af0db8f7e3d5811be5c0eb78f5d00e2333aa14b 100755 (executable)
@@ -115,8 +115,9 @@ private:
               std::map<std::shared_ptr<ModelAPI_Feature>, IdToPointPair>& theCoincidenceToPoint*/);
 
   /// Obtains references to feature point attributes and to feature,
-  /// e.g. for feature line: 1st container is <1st line point, list<entity_a in distance, entity_b in parallel> >
-  ///                                         <2nd line point, list<> >
+  /// e.g. for feature line: 1st container is 
+  ///             <1st line point, list<entity_a in distance, entity_b in parallel> >
+  ///             <2nd line point, list<> >
   ///      for feature circle 2nd container is <entity_a in Radius, entity_b in equal, ...>
   /// \param theFeature an investigated feature
   /// \param theRefs a container of list of referenced attributes
@@ -129,9 +130,9 @@ private:
   /// \param theFurtherCoincidences a list of points where coincidences will be build
   /// \paramv theFeatureResults created results after split where constaint might be connected
   void updateCoincidenceConstraintsToFeature(
-              const std::map<std::shared_ptr<ModelAPI_Feature>, IdToPointPair>& theCoincidenceToFeature,
-              const std::set<std::shared_ptr<GeomDataAPI_Point2D> >& theFurtherCoincidences,
-              const std::set<ResultPtr>& theFeatureResults);
+      const std::map<std::shared_ptr<ModelAPI_Feature>, IdToPointPair>& theCoincidenceToFeature,
+      const std::set<std::shared_ptr<GeomDataAPI_Point2D> >& theFurtherCoincidences,
+      const std::set<ResultPtr>& theFeatureResults);
 
   /// Move tangency constraint to the nearest split feature that has a coincidence to the tangent
   /// \param theTangentFeatures tangencies to feature to be connected to nearest feature
@@ -152,8 +153,8 @@ private:
   /// \param theModifiedAttributes container of attributes placed instead of base attributes
   /// at the same place
   void updateRefAttConstraints(
-                      const std::map<AttributePtr, std::list<AttributePtr> >& theBaseRefAttributes,
-                      const std::set<std::pair<AttributePtr, AttributePtr> >& theModifiedAttributes);
+               const std::map<AttributePtr, std::list<AttributePtr> >& theBaseRefAttributes,
+               const std::set<std::pair<AttributePtr, AttributePtr> >& theModifiedAttributes);
 
   /// Make the base object is splitted by the point attributes
   /// \param theSplitFeature a result split feature
@@ -161,7 +162,8 @@ 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 feature to attribute on new feature
+  /// \param theModifiedAttributes a container of attribute on base 
+  /// feature to attribute on new feature
   void splitLine(std::shared_ptr<ModelAPI_Feature>& theSplitFeature,
                  std::shared_ptr<ModelAPI_Feature>& theBeforeFeature,
                  std::shared_ptr<ModelAPI_Feature>& theAfterFeature,
index 9c9fc3345d4ecdcb345a66742990301d860d4d81..a9d232da6a45dba4a93195657ab6a207b62b54cc 100644 (file)
@@ -40,13 +40,14 @@ bool SketchPlugin_ExternalValidator::isValid(const AttributePtr& theAttribute,
 bool SketchPlugin_ExternalValidator::isExternalAttribute(const AttributePtr& theAttribute) const
 {
   bool isExternal = false;
-  AttributeRefAttrPtr anAttribute = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
+  AttributeRefAttrPtr anAttribute = 
+    std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
 
   if (anAttribute.get() != NULL) {
     FeaturePtr anArgumentFeature = ModelAPI_Feature::feature(anAttribute->object());
     if (anArgumentFeature.get() != NULL) {
       std::shared_ptr<SketchPlugin_Feature> aSketchFeature =
-                                    std::dynamic_pointer_cast<SketchPlugin_Feature>(anArgumentFeature);
+                        std::dynamic_pointer_cast<SketchPlugin_Feature>(anArgumentFeature);
       if (aSketchFeature.get() != NULL) {
         isExternal = aSketchFeature->isExternal();
       }
index 303e626506105ed3253cd3a0fb103f4f7c274300..4d4eaf07327c06c2c64a9af753218a074cfdeecb 100644 (file)
@@ -19,7 +19,8 @@
 class SketchPlugin_ExternalValidator : public ModelAPI_AttributeValidator
 {
 public:
-  /// returns true if the feature of attribute do not contain external features in the given attribute and
+  /// 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
   /// \param theArguments a filter parameters
index 3f7c94a89c027f7612cbc34d6210d4a55f25a09c..d32b9a4c6cf648632622e61b4a323361fd6b4aa6 100644 (file)
@@ -58,7 +58,8 @@ void SketchPlugin_IntersectionPoint::computePoint()
   std::shared_ptr<GeomAPI_Edge> anEdge;
   if(aLineAttr && aLineAttr->value() && aLineAttr->value()->isEdge()) {
     anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aLineAttr->value()));
-  } else if(aLineAttr->context() && aLineAttr->context()->shape() && aLineAttr->context()->shape()->isEdge()) {
+  } else if(aLineAttr->context() && aLineAttr->context()->shape() && 
+            aLineAttr->context()->shape()->isEdge()) {
     anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aLineAttr->context()->shape()));
   }
   if(!anEdge.get())
index 6ae033dec67086f271731da7795cd6f4f3d1f044..f208204bb04af41bf8193d54890b2753fc12c98e 100755 (executable)
@@ -45,8 +45,10 @@ void SketchPlugin_MultiRotation::initAttributes()
   data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefList::typeId());
   data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefList::typeId());
   data()->addAttribute(ROTATION_LIST_ID(), ModelAPI_AttributeRefList::typeId());
-  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), SketchPlugin_Constraint::ENTITY_A());
-  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), SketchPlugin_Constraint::ENTITY_B());
+  ModelAPI_Session::get()->validators()->
+    registerNotObligatory(getKind(), SketchPlugin_Constraint::ENTITY_A());
+  ModelAPI_Session::get()->validators()->
+    registerNotObligatory(getKind(), SketchPlugin_Constraint::ENTITY_B());
 }
 
 void SketchPlugin_MultiRotation::execute()
@@ -112,7 +114,8 @@ void SketchPlugin_MultiRotation::execute()
     if (!(*aUsedIter)) {
       aRefListOfShapes->remove(*anInitIter);
       aRefListOfRotated->remove(*aTargetIter++);
-      for (int i = 0; i < aCurrentNbCopies && aTargetIter != aTargetList.end(); i++, aTargetIter++) {
+      for (int i = 0; i < aCurrentNbCopies && aTargetIter != aTargetList.end(); 
+           i++, aTargetIter++) {
         aRefListOfRotated->remove(*aTargetIter);
         // remove the corresponding feature from the sketch
         ResultConstructionPtr aRC =
@@ -195,7 +198,7 @@ void SketchPlugin_MultiRotation::execute()
 ////    while (aTargetIter != aTargetList.end()) {
 ////      ObjectPtr anInitialObject = *aTargetIter++;
 ////      for (int i = 0; i < aNbCopies && aTargetIter != aTargetList.end(); i++, aTargetIter++)
-////        rotateFeature(anInitialObject, *aTargetIter, aCenter->x(), aCenter->y(), anAngle * (i + 1));
+//// rotateFeature(anInitialObject, *aTargetIter, aCenter->x(), aCenter->y(), anAngle * (i + 1));
 ////    }
 ////  }
 
@@ -237,7 +240,8 @@ void SketchPlugin_MultiRotation::erase()
         if(aRes.get()) {
           FeaturePtr aFeature = aRes->document()->feature(aRes);
           if(aFeature.get()) {
-            AttributeBooleanPtr aBooleanAttr = aFeature->boolean(SketchPlugin_SketchEntity::COPY_ID());
+            AttributeBooleanPtr aBooleanAttr = 
+              aFeature->boolean(SketchPlugin_SketchEntity::COPY_ID());
             if(aBooleanAttr.get()) {
               if (ModelAPI_Session::get()->isOperation()) // if this is not undo or redo
                 aBooleanAttr->setValue(false);
@@ -260,7 +264,8 @@ ObjectPtr SketchPlugin_MultiRotation::copyFeature(ObjectPtr theObject)
   if (!aFeature || !aResult)
     return ObjectPtr();
 
-  FeaturePtr aNewFeature = SketchPlugin_Sketch::addUniqueNamedCopiedFeature(aFeature, sketch(), true);
+  FeaturePtr aNewFeature = 
+    SketchPlugin_Sketch::addUniqueNamedCopiedFeature(aFeature, sketch(), true);
   aNewFeature->execute();
 
   static Events_ID aRedisplayEvent = Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY);
index 34e26377b424630c042a9c2233f207dfeced6d2b..b085454355650b662fdb8fa1cbbecd318c28d902 100755 (executable)
@@ -39,8 +39,10 @@ void SketchPlugin_MultiTranslation::initAttributes()
   data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefList::typeId());
   data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefList::typeId());
   data()->addAttribute(TRANSLATION_LIST_ID(), ModelAPI_AttributeRefList::typeId());
-  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), SketchPlugin_Constraint::ENTITY_A());
-  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), SketchPlugin_Constraint::ENTITY_B());
+  ModelAPI_Session::get()->validators()->
+    registerNotObligatory(getKind(), SketchPlugin_Constraint::ENTITY_A());
+  ModelAPI_Session::get()->validators()->
+    registerNotObligatory(getKind(), SketchPlugin_Constraint::ENTITY_B());
 }
 
 void SketchPlugin_MultiTranslation::execute()
@@ -69,7 +71,8 @@ void SketchPlugin_MultiTranslation::execute()
   if (!aStart || !aEnd)
     return;
 
-  std::shared_ptr<GeomAPI_XY> aShiftVec(new GeomAPI_XY(aEnd->x() - aStart->x(), aEnd->y() - aStart->y()));
+  std::shared_ptr<GeomAPI_XY> 
+    aShiftVec(new GeomAPI_XY(aEnd->x() - aStart->x(), aEnd->y() - aStart->y()));
 
   // Wait all objects being created, then send update events
   static Events_ID anUpdateEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
@@ -110,7 +113,8 @@ void SketchPlugin_MultiTranslation::execute()
     if (!(*aUsedIter)) {
       aRefListOfShapes->remove(*anInitIter);
       aRefListOfTranslated->remove(*aTargetIter++);
-      for (int i = 0; i < aCurrentNbCopies && aTargetIter != aTargetList.end(); i++, aTargetIter++) {
+      for (int i = 0; i < aCurrentNbCopies && aTargetIter != aTargetList.end(); 
+           i++, aTargetIter++) {
         aRefListOfTranslated->remove(*aTargetIter);
         // remove the corresponding feature from the sketch
         ResultConstructionPtr aRC =
@@ -222,7 +226,8 @@ void SketchPlugin_MultiTranslation::erase()
         if(aRes.get()) {
           FeaturePtr aFeature = aRes->document()->feature(aRes);
           if(aFeature.get()) {
-            AttributeBooleanPtr aBooleanAttr = aFeature->boolean(SketchPlugin_SketchEntity::COPY_ID());
+            AttributeBooleanPtr aBooleanAttr = 
+              aFeature->boolean(SketchPlugin_SketchEntity::COPY_ID());
             if(aBooleanAttr.get()) {
               if (ModelAPI_Session::get()->isOperation()) // if this is not undo or redo
                 aBooleanAttr->setValue(false);
@@ -245,7 +250,8 @@ ObjectPtr SketchPlugin_MultiTranslation::copyFeature(ObjectPtr theObject)
   if (!aFeature || !aResult)
     return ObjectPtr();
 
-  FeaturePtr aNewFeature = SketchPlugin_Sketch::addUniqueNamedCopiedFeature(aFeature, sketch(), true);
+  FeaturePtr aNewFeature = 
+    SketchPlugin_Sketch::addUniqueNamedCopiedFeature(aFeature, sketch(), true);
 
   aNewFeature->execute();
   static Events_ID aRedisplayEvent = Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY);
index ebead598fd24845451913a8d99b8e364a0684f63..f446375fa87deef4df5c4da2f272b8542c02f6e9 100644 (file)
@@ -91,16 +91,20 @@ SketchPlugin_Plugin::SketchPlugin_Plugin()
   // register this plugin
   ModelAPI_Session::get()->registerPlugin(this);
   
-  Config_PropManager::registerProp("Visualization", "sketch_entity_color", "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", "Sketch external entity 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", "Sketch auxiliary entity 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", "Sketch dimension color",
+  Config_PropManager::registerProp("Visualization", "sketch_dimension_color", 
+                                   "Sketch dimension color",
                                    Config_Prop::Color, SKETCH_DIMENSION_COLOR);
 
   Config_PropManager::registerProp("Visualization", "sketch_overconstraint_color",
@@ -202,7 +206,8 @@ std::shared_ptr<ModelAPI_FeatureStateMessage> SketchPlugin_Plugin
     std::shared_ptr<ModelAPI_Data> aData = aSketchFeature->data();
     if (aData) {
       std::shared_ptr<GeomDataAPI_Dir> aNormal =
-        std::dynamic_pointer_cast<GeomDataAPI_Dir>(aData->attribute(SketchPlugin_Sketch::NORM_ID()));
+        std::dynamic_pointer_cast<GeomDataAPI_Dir>(
+        aData->attribute(SketchPlugin_Sketch::NORM_ID()));
       // it is important to check whether the normal attribute is initialized
       // because it is possible that normal values are filled when the plane is checked on validity
       aHasSketchPlane = aNormal && aNormal->isInitialized() &&
index ac8b5679743382f6c05902e76c437ee3fe34e6e0..795cfe4fb896f90ae14c111daf27b04de152648a 100644 (file)
@@ -94,7 +94,8 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID)
   std::shared_ptr<GeomAPI_Edge> anEdge;
   if (aExtFeature && aExtFeature->value() && aExtFeature->value()->isEdge()) {
     anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aExtFeature->value()));
-  } else if (aExtFeature->context() && aExtFeature->context()->shape() && aExtFeature->context()->shape()->isEdge()) {
+  } else if (aExtFeature->context() && aExtFeature->context()->shape() && 
+             aExtFeature->context()->shape()->isEdge()) {
     anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aExtFeature->context()->shape()));
   }
   if (!anEdge.get())
@@ -161,7 +162,8 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID)
       aProjection = sketch()->addFeature(SketchPlugin_Circle::ID());
 
     // update attributes of projection
-    std::shared_ptr<GeomDataAPI_Point2D> aCenterPnt = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+    std::shared_ptr<GeomDataAPI_Point2D> aCenterPnt = 
+      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
         aProjection->attribute(SketchPlugin_Circle::CENTER_ID()));
     aCenterPnt->setValue(aCenterInSketch);
     aProjection->real(SketchPlugin_Circle::RADIUS_ID())->setValue(aRadius);
@@ -180,11 +182,14 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID)
       aProjection = sketch()->addFeature(SketchPlugin_Arc::ID());
 
     // update attributes of projection
-    std::shared_ptr<GeomDataAPI_Point2D> aCenterPnt = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+    std::shared_ptr<GeomDataAPI_Point2D> aCenterPnt = 
+      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
         aProjection->attribute(SketchPlugin_Arc::CENTER_ID()));
-    std::shared_ptr<GeomDataAPI_Point2D> aStartPnt = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+    std::shared_ptr<GeomDataAPI_Point2D> aStartPnt = 
+      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
         aProjection->attribute(SketchPlugin_Arc::START_ID()));
-    std::shared_ptr<GeomDataAPI_Point2D> aEndPnt = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+    std::shared_ptr<GeomDataAPI_Point2D> aEndPnt = 
+      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
         aProjection->attribute(SketchPlugin_Arc::END_ID()));
     aStartPnt->setValue(aFirstInSketch);
     aEndPnt->setValue(aLastInSketch);
index 3ce9adaa5fe63857959529cd8cfe7c9f2183b2bd..83f974248a3e14bacde8d043a0461dd4bb428c97 100755 (executable)
@@ -52,7 +52,8 @@ 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(), ModelAPI_AttributeSelection::typeId());
+  data()->addAttribute(SketchPlugin_SketchEntity::EXTERNAL_ID(), 
+    ModelAPI_AttributeSelection::typeId());
   ModelAPI_Session::get()->validators()->registerNotObligatory(
     getKind(), SketchPlugin_SketchEntity::EXTERNAL_ID());
   data()->addAttribute(SketchPlugin_Sketch::SOLVER_ERROR(), ModelAPI_AttributeString::typeId());
@@ -148,7 +149,8 @@ void SketchPlugin_Sketch::removeFeature(std::shared_ptr<ModelAPI_Feature> 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 (needed to skip empty transaction on edit of sketch feature)
+  // 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);
   } else {
@@ -229,7 +231,8 @@ void SketchPlugin_Sketch::attributeChanged(const std::string& theID) {
         aCoords = aCoords->multiplied(-aD * aCoords->distance(aZero));
         std::shared_ptr<GeomAPI_Pnt> anOrigPnt(new GeomAPI_Pnt(aCoords));
         // X axis is preferable to be dirX on the sketch
-        static const double tol = 0.1; // here can not be very small value to avoid very close to X normal axis (issue 595)
+        // here can not be very small value to avoid very close to X normal axis (issue 595)
+        static const double tol = 0.1; 
         bool isX = fabs(anA) - 1.0 < tol && fabs(aB) < tol && fabs(aC) < tol;
         std::shared_ptr<GeomAPI_Dir> aTempDir(
           isX ? new GeomAPI_Dir(0, 1, 0) : new GeomAPI_Dir(1, 0, 0));
index a67069fe87a743026ed4f0af0b1c7173d48dd670..1c4e9b5d22a5191742d9cab150de45f14b4bb4af 100644 (file)
@@ -28,7 +28,7 @@
  * \ingroup Plugins
  * \brief Feature for creation of the new part in PartSet.
  */
-class SketchPlugin_Sketch : public ModelAPI_CompositeFeature, public GeomAPI_ICustomPrs//, public GeomAPI_IPresentable
+class SketchPlugin_Sketch : public ModelAPI_CompositeFeature, public GeomAPI_ICustomPrs
 {
  public:
   /// Sketch feature kind
index 6b5beb942c7493884fbf9beb0863cafc382296ac..1a37de2cf30c3afc5a1ac79a81f9dbbf02940320 100644 (file)
@@ -16,7 +16,9 @@ void SketchPlugin_SketchEntity::initAttributes()
 
   initDerivedClassAttributes();
 
-  AttributePtr anAttr = data()->addAttribute(SketchPlugin_SketchEntity::COPY_ID(), ModelAPI_AttributeBoolean::typeId());
+  AttributePtr anAttr = data()->addAttribute(SketchPlugin_SketchEntity::COPY_ID(), 
+                                             ModelAPI_AttributeBoolean::typeId());
   anAttr->setIsArgument(false);
-  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), SketchPlugin_SketchEntity::COPY_ID());
+  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), 
+    SketchPlugin_SketchEntity::COPY_ID());
 }
index a29b09695f9772966e508297f519b57fed08d151..6888eef83c1b0ab23af23fd6abf46f3ff1afb80e 100644 (file)
@@ -27,7 +27,8 @@
 
 /**\class SketchPlugin_SketchEntity
  * \ingroup Plugins
- * \brief Sketch Entity for creation of the new feature in PartSet. This is an abstract class to give
+ * \brief Sketch Entity for creation of the new feature in PartSet. 
+ * This is an abstract class to give
  * an interface to create the entity features such as line, circle, arc and point.
  */
 class SketchPlugin_SketchEntity : public SketchPlugin_Feature, public GeomAPI_ICustomPrs
@@ -121,7 +122,8 @@ 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 arc feature uses the compound for presentable AIS
+    // 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;
 
index 82c5a3f93986c9c07d3857e797771ec59f7cdc52..9b332fc96f9438105c34b847994fecc4628d4ecd 100644 (file)
@@ -64,7 +64,7 @@ void clearExpressions(FeaturePtr theFeature)
 std::shared_ptr<GeomAPI_Pnt2d> getCoincidencePoint(const FeaturePtr theStartCoin)
 {
   std::shared_ptr<GeomAPI_Pnt2d> aPnt = SketcherPrs_Tools::getPoint(theStartCoin.get(), 
-                                                                    SketchPlugin_Constraint::ENTITY_A());
+                                                          SketchPlugin_Constraint::ENTITY_A());
   if (aPnt.get() == NULL)
     aPnt = SketcherPrs_Tools::getPoint(theStartCoin.get(), SketchPlugin_Constraint::ENTITY_B());
   return aPnt;
index 729424d96c72ea9d2d66c9f98df966a727dd7950..dc46d01c4c69ce83eab95cc4b5acd885373ea311 100755 (executable)
@@ -73,7 +73,8 @@ bool SketchPlugin_DistanceAttrValidator::isValid(const AttributePtr& theAttribut
     ObjectPtr anObject = aRefAttr->object();
 
     const ModelAPI_AttributeValidator* aShapeValidator = 
-      dynamic_cast<const ModelAPI_AttributeValidator*>(aFactory->validator("GeomValidators_ShapeType"));
+      dynamic_cast<const ModelAPI_AttributeValidator*>(
+      aFactory->validator("GeomValidators_ShapeType"));
     std::list<std::string> anArguments;
     anArguments.push_back("circle");
     Events_InfoMessage aCircleError;
@@ -173,8 +174,10 @@ bool SketchPlugin_TangentAttrValidator::isValid(const AttributePtr& theAttribute
   SessionPtr aMgr = ModelAPI_Session::get();
   ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
 
-  FeaturePtr anAttributeFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
-  AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
+  FeaturePtr anAttributeFeature = 
+    std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
+  AttributeRefAttrPtr aRefAttr = 
+    std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
 
   bool isObject = aRefAttr->isObject();
   ObjectPtr anObject = aRefAttr->object();
@@ -390,7 +393,8 @@ bool SketchPlugin_CoincidenceAttrValidator::isValid(const AttributePtr& theAttri
     return false;
   }
 
-  AttributeRefAttrPtr aRefAttrB = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
+  AttributeRefAttrPtr aRefAttrB = 
+    std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
 
   // first attribute is a point, it may coincide with any object
   if (!aRefAttrA->isObject())
@@ -473,9 +477,10 @@ bool SketchPlugin_CopyValidator::isValid(const AttributePtr& theAttribute,
   return true;
 }
 
-bool SketchPlugin_SolverErrorValidator::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                                const std::list<std::string>& theArguments,
-                                                Events_InfoMessage& theError) const
+bool SketchPlugin_SolverErrorValidator::isValid(
+  const std::shared_ptr<ModelAPI_Feature>& theFeature,
+  const std::list<std::string>& theArguments,
+  Events_InfoMessage& theError) const
 {
   AttributeStringPtr aAttributeString = theFeature->string(SketchPlugin_Sketch::SOLVER_ERROR());
 
@@ -487,14 +492,17 @@ bool SketchPlugin_SolverErrorValidator::isValid(const std::shared_ptr<ModelAPI_F
   return true;
 }
 
-bool SketchPlugin_SolverErrorValidator::isNotObligatory(std::string theFeature, std::string theAttribute)
+bool SketchPlugin_SolverErrorValidator::isNotObligatory(std::string theFeature, 
+                                                        std::string theAttribute)
 {
   return true;
 }
 
-static bool hasSameTangentFeature(const std::set<AttributePtr>& theRefsList, const FeaturePtr theFeature)
+static bool hasSameTangentFeature(const std::set<AttributePtr>& theRefsList, 
+                                  const FeaturePtr theFeature)
 {
-  for(std::set<AttributePtr>::const_iterator anIt = theRefsList.cbegin(); anIt != theRefsList.cend(); ++anIt) {
+  for(std::set<AttributePtr>::const_iterator 
+      anIt = theRefsList.cbegin(); anIt != theRefsList.cend(); ++anIt) {
     std::shared_ptr<ModelAPI_Attribute> aAttr = (*anIt);
     FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aAttr->owner());
     if (aFeature->getKind() == SketchPlugin_ConstraintTangent::ID()) {
@@ -535,16 +543,20 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut
                                                  const std::list<std::string>& theArguments,
                                                  Events_InfoMessage& theError) const
 {
-  std::shared_ptr<SketchPlugin_ConstraintFillet> aFilletFeature = std::dynamic_pointer_cast<SketchPlugin_ConstraintFillet>(theAttribute->owner());
-  AttributeRefAttrListPtr aPointsRefList = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttrList>(theAttribute);
+  std::shared_ptr<SketchPlugin_ConstraintFillet> aFilletFeature = 
+    std::dynamic_pointer_cast<SketchPlugin_ConstraintFillet>(theAttribute->owner());
+  AttributeRefAttrListPtr aPointsRefList = 
+    std::dynamic_pointer_cast<ModelAPI_AttributeRefAttrList>(theAttribute);
   if(aPointsRefList->size() == 0) {
     theError = "Error: List of points is empty.";
     return false;
   }
 
-  std::map<AttributePtr, SketchPlugin_ConstraintFillet::FilletFeatures> aPointsFeaturesMap = aFilletFeature->pointsFeaturesMap();
+  std::map<AttributePtr, SketchPlugin_ConstraintFillet::FilletFeatures> aPointsFeaturesMap = 
+    aFilletFeature->pointsFeaturesMap();
   std::set<AttributePtr> aSetOfPointsOnResultEdges;
-  for(std::map<AttributePtr, SketchPlugin_ConstraintFillet::FilletFeatures>::iterator aPointsIter = aPointsFeaturesMap.begin();
+  for(std::map<AttributePtr, SketchPlugin_ConstraintFillet::FilletFeatures>::iterator 
+      aPointsIter = aPointsFeaturesMap.begin();
       aPointsIter != aPointsFeaturesMap.end();
       ++aPointsIter) {
     const SketchPlugin_ConstraintFillet::FilletFeatures& aFeatures = aPointsIter->second;
@@ -564,12 +576,14 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut
   }
 
   std::list<std::pair<ObjectPtr, AttributePtr>> aPointsList = aPointsRefList->list();
-  for(std::list<std::pair<ObjectPtr, AttributePtr>>::const_iterator aPointsIt = aPointsList.cbegin(); aPointsIt != aPointsList.cend(); aPointsIt++) {
+  for(std::list<std::pair<ObjectPtr, AttributePtr>>::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<GeomAPI_Pnt2d> aSelectedPnt = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aPointAttribute)->pnt();
+    std::shared_ptr<GeomAPI_Pnt2d> aSelectedPnt = 
+      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aPointAttribute)->pnt();
 
     // If we alredy have some result then:
     // - if it is the same point all ok, just skip it
@@ -588,7 +602,8 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut
     // Obtain constraint coincidence for the fillet point.
     const std::set<AttributePtr>& aRefsList = aPointAttribute->owner()->data()->refsToMe();
     FeaturePtr aConstraintCoincidence;
-    for(std::set<AttributePtr>::const_iterator anIt = aRefsList.cbegin(); anIt != aRefsList.cend(); ++anIt) {
+    for(std::set<AttributePtr>::const_iterator anIt = aRefsList.cbegin(); 
+        anIt != aRefsList.cend(); ++anIt) {
       std::shared_ptr<ModelAPI_Attribute> aAttr = (*anIt);
       FeaturePtr aConstrFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aAttr->owner());
       if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) {
@@ -629,14 +644,16 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut
 
     // Remove points from set of coincides.
     std::set<FeaturePtr> aNewSetOfCoincides;
-    for(std::set<FeaturePtr>::iterator anIt = aCoinsides.begin(); anIt != aCoinsides.end(); ++anIt) {
+    for(std::set<FeaturePtr>::iterator anIt = aCoinsides.begin(); 
+        anIt != aCoinsides.end(); ++anIt) {
       if((*anIt)->getKind() != SketchPlugin_Line::ID() &&
          (*anIt)->getKind() != SketchPlugin_Arc::ID()) {
            continue;
       }
       if((*anIt)->getKind() == SketchPlugin_Arc::ID()) {
         AttributePtr anArcCenter = (*anIt)->attribute(SketchPlugin_Arc::CENTER_ID());
-        std::shared_ptr<GeomAPI_Pnt2d> anArcCenterPnt = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(anArcCenter)->pnt();
+        std::shared_ptr<GeomAPI_Pnt2d> anArcCenterPnt = 
+          std::dynamic_pointer_cast<GeomDataAPI_Point2D>(anArcCenter)->pnt();
         double aDistSelectedArcCenter = aSelectedPnt->distance(anArcCenterPnt);
         if(aDistSelectedArcCenter < tolerance) {
           continue;
@@ -649,7 +666,8 @@ 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<FeaturePtr>::iterator anIt = aCoinsides.begin(); anIt != aCoinsides.end(); ++anIt) {
+      for(std::set<FeaturePtr>::iterator anIt = aCoinsides.begin(); 
+          anIt != aCoinsides.end(); ++anIt) {
         if(!(*anIt)->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value()) {
           aNewSetOfCoincides.insert(*anIt);
         }
@@ -673,7 +691,8 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut
     }
 
     std::list<ResultPtr> aFirstResults = aFirstFeature->results();
-    for(std::list<ResultPtr>::iterator aResIt = aFirstResults.begin(); aResIt != aFirstResults.end(); ++aResIt) {
+    for(std::list<ResultPtr>::iterator aResIt = aFirstResults.begin(); 
+        aResIt != aFirstResults.end(); ++aResIt) {
       ResultPtr aRes = *aResIt;
       const std::set<AttributePtr>& aResRefsList = aRes->data()->refsToMe();
       if(hasSameTangentFeature(aResRefsList, aSecondFeature)) {
@@ -683,17 +702,29 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut
     }
 
     // Check that lines not collinear
-    if(aFirstFeature->getKind() == SketchPlugin_Line::ID() && aSecondFeature->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<GeomAPI_Pnt2d> aFirstStartPnt, aFirstEndPnt, aSecondStartPnt, aSecondEndPnt;
-      aFirstStartPnt = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aFirstFeature->attribute(aStartAttr))->pnt();
-      aFirstEndPnt = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aFirstFeature->attribute(anEndAttr))->pnt();
-      aSecondStartPnt = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aSecondFeature->attribute(aStartAttr))->pnt();
-      aSecondEndPnt = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aSecondFeature->attribute(anEndAttr))->pnt();
-      double aCheck1 = fabs((aFirstEndPnt->x() - aFirstStartPnt->x()) * (aSecondStartPnt->y() - aFirstStartPnt->y()) -
+      aFirstStartPnt = 
+        std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+        aFirstFeature->attribute(aStartAttr))->pnt();
+      aFirstEndPnt = 
+        std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aFirstFeature->attribute(anEndAttr))->pnt();
+      aSecondStartPnt =
+        std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+        aSecondFeature->attribute(aStartAttr))->pnt();
+      aSecondEndPnt = 
+        std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+        aSecondFeature->attribute(anEndAttr))->pnt();
+      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()) * (aSecondEndPnt->y() - aFirstStartPnt->y()) -
+      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) {
         return false;
@@ -719,7 +750,8 @@ bool SketchPlugin_MiddlePointAttrValidator::isValid(const AttributePtr& theAttri
   SessionPtr aMgr = ModelAPI_Session::get();
   ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
 
-  FeaturePtr anAttributeFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
+  FeaturePtr anAttributeFeature = 
+    std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
   AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
   AttributeRefAttrPtr anOtherAttr = anAttributeFeature->data()->refattr(aParamA);
 
@@ -820,11 +852,12 @@ bool SketchPlugin_IntersectionValidator::isValid(const AttributePtr& theAttribut
     return false;
   }
   AttributeSelectionPtr aLineAttr =
-                              std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
+                       std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
   std::shared_ptr<GeomAPI_Edge> anEdge;
   if(aLineAttr && aLineAttr->value() && aLineAttr->value()->isEdge()) {
     anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aLineAttr->value()));
-  } else if(aLineAttr->context() && aLineAttr->context()->shape() && aLineAttr->context()->shape()->isEdge()) {
+  } else if(aLineAttr->context() && 
+            aLineAttr->context()->shape() && aLineAttr->context()->shape()->isEdge()) {
     anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aLineAttr->context()->shape()));
   }
 
@@ -889,8 +922,9 @@ bool SketchPlugin_SplitValidator::isValid(const AttributePtr& theAttribute,
 
     // coincidences to the feature
     std::set<std::shared_ptr<GeomDataAPI_Point2D> > aRefAttributes;
-    ModelGeomAlgo_Point2D::getPointsOfReference(anAttrFeature, SketchPlugin_ConstraintCoincidence::ID(),
-                         aRefAttributes, SketchPlugin_Point::ID(), SketchPlugin_Point::COORD_ID());
+    ModelGeomAlgo_Point2D::getPointsOfReference(anAttrFeature, 
+                        SketchPlugin_ConstraintCoincidence::ID(),
+                        aRefAttributes, SketchPlugin_Point::ID(), SketchPlugin_Point::COORD_ID());
 
     GeomShapePtr anAttrShape = *anEdgeShapes.begin();
     std::shared_ptr<SketchPlugin_Feature> aSFeature =
@@ -907,7 +941,8 @@ bool SketchPlugin_SplitValidator::isValid(const AttributePtr& theAttribute,
     std::shared_ptr<GeomAPI_Dir> aDirY(new GeomAPI_Dir(aNorm->dir()->cross(aX->dir())));
     
     std::list<std::shared_ptr<GeomAPI_Pnt> > aPoints;
-    std::map<std::shared_ptr<GeomDataAPI_Point2D>, std::shared_ptr<GeomAPI_Pnt> > aPointToAttributes;
+    std::map<std::shared_ptr<GeomDataAPI_Point2D>, std::shared_ptr<GeomAPI_Pnt> > 
+      aPointToAttributes;
     ModelGeomAlgo_Point2D::getPointsInsideShape(anAttrShape, aRefAttributes, aC->pnt(),
                                                 aX->dir(), aDirY, aPoints, aPointToAttributes);