]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2027 Sketcher Trim Feature: split shapes by highlighted point is moved from...
authornds <nds@opencascade.com>
Thu, 9 Mar 2017 14:35:24 +0000 (17:35 +0300)
committernds <nds@opencascade.com>
Thu, 9 Mar 2017 14:35:24 +0000 (17:35 +0300)
Correction for Jenkins(row contains 100 characters long).

src/PartSet/PartSet_Module.cpp
src/SketchPlugin/SketchPlugin_Trim.cpp
src/SketchPlugin/SketchPlugin_Validators.cpp

index d441445ca2e2fb5c6bc213897ba5a1dc72376314..18679ad143981f6b29d81489fcf69eaefe82499c 100755 (executable)
@@ -747,7 +747,7 @@ ModuleBase_ModelWidget* PartSet_Module::createWidgetByType(const std::string& th
   }
   else if (theType == "sketch_feature_point_selector") {
     PartSet_WidgetFeaturePointSelector* aPointSelectorWgt =
-                          new PartSet_WidgetFeaturePointSelector(theParent, aWorkshop, theWidgetApi);
+            new PartSet_WidgetFeaturePointSelector(theParent, aWorkshop, theWidgetApi);
     aPointSelectorWgt->setSketcher(mySketchMgr->activeSketch());
     aWgt = aPointSelectorWgt;
   }
index ac0630cfd2d0cb4289340ed521df752cba5d8390..6c778e514a200b77a8c7364714ed84c1067058cd 100644 (file)
@@ -295,7 +295,8 @@ AISObjectPtr SketchPlugin_Trim::getAISObject(AISObjectPtr thePrevious)
   AttributePoint2DPtr aPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
                                            data()->attribute(ENTITY_POINT()));
   std::shared_ptr<GeomAPI_Pnt2d> anAttributePnt2d = aPoint->pnt();
-  std::shared_ptr<GeomAPI_Pnt> anAttributePnt = sketch()->to3D(anAttributePnt2d->x(), anAttributePnt2d->y());
+  std::shared_ptr<GeomAPI_Pnt> anAttributePnt = sketch()->to3D(anAttributePnt2d->x(),
+                                                               anAttributePnt2d->y());
 
   if (myCashedShapes.find(aBaseObject) == myCashedShapes.end())
     fillObjectShapes(aBaseObject);
@@ -404,7 +405,8 @@ void SketchPlugin_Trim::getConstraints(std::set<FeaturePtr>& theFeaturesToDelete
                                                         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(SketchPlugin_Trim::BASE_OBJECT());
+            AttributeRefAttrPtr aRefAttr = aCoincidenceFeature->refattr(
+                                                        SketchPlugin_Trim::BASE_OBJECT());
             if (!aRefAttr || aRefAttr->isObject())
               continue;
             AttributePoint2DPtr aPoint =
@@ -418,10 +420,7 @@ void SketchPlugin_Trim::getConstraints(std::set<FeaturePtr>& theFeaturesToDelete
           }
         }
         if (aTangentPoint.get()) {
-          //FeaturePtr aFeature1 = ModelAPI_Feature::feature(aResult1);
-          //std::string anAttributeToBeModified = aFeature1 == aBaseFeature
-          //             ? SketchPlugin_Constraint::ENTITY_A() : SketchPlugin_Constraint::ENTITY_B();
-          //theTangentFeatures[aRefFeature] = std::make_pair(anAttributeToBeModified, aTangentPoint);
+          // collect tangent feaures
         }
         else /// there is not coincident point between tangent constraint
           theFeaturesToDelete.insert(aRefFeature);
@@ -789,7 +788,8 @@ void SketchPlugin_Trim::fillPointAttribute(const AttributePtr& theModifiedAttrib
     aModifiedAttribute->setValue(thePoint);
 
 #ifdef DEBUG_TRIM
-    std::cout << "<fillPointAttribute> => Pnt2d - [" << thePoint->x() << ", " << thePoint->y() << "]" << std::endl;
+    std::cout << "<fillPointAttribute> => Pnt2d - [" << thePoint->x() << ", "
+              << thePoint->y() << "]" << std::endl;
 #endif
   }
 }
@@ -819,7 +819,7 @@ void SketchPlugin_Trim::fillAttribute(const AttributePtr& theModifiedAttribute,
   }
   else if (anAttributeType == ModelAPI_AttributeRefAttr::typeId()) {
     AttributeRefAttrPtr aRefAttributeToFill = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(
-                                                                               theModifiedAttribute);
+                                                                             theModifiedAttribute);
     AttributeRefAttrPtr aSourceRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(
                                          theSourceAttribute);
     if (!aSourceRefAttr.get())
@@ -1056,7 +1056,8 @@ void SketchPlugin_Trim::attributeChanged(const std::string& theID)
       AttributePoint2DPtr aPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
                                                data()->attribute(ENTITY_POINT()));
       std::shared_ptr<GeomAPI_Pnt2d> anAttributePnt2d = aPoint->pnt();
-      std::shared_ptr<GeomAPI_Pnt> anAttributePnt = sketch()->to3D(anAttributePnt2d->x(), anAttributePnt2d->y());
+      std::shared_ptr<GeomAPI_Pnt> anAttributePnt = sketch()->to3D(anAttributePnt2d->x(),
+                                                                   anAttributePnt2d->y());
 
       if (myCashedShapes.find(aBaseObject) == myCashedShapes.end())
         fillObjectShapes(aBaseObject);
index 8e85e516b552294decf451b9aec16d576a008977..641aaa0fda9f2c372b18bb69bed61367986ec743 100755 (executable)
@@ -63,7 +63,8 @@ bool SketchPlugin_DistanceAttrValidator::isValid(const AttributePtr& theAttribut
   SessionPtr aMgr = ModelAPI_Session::get();
   ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
 
-  AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
+  AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>
+                                                                      (theAttribute);
   bool isObject = aRefAttr->isObject();
   if (!isObject) {
     // an attribute is a point. A point value is valid always for the distance
@@ -884,15 +885,9 @@ bool SketchPlugin_SplitValidator::isValid(const AttributePtr& theAttribute,
                                std::list<std::shared_ptr<ModelAPI_Object> > > > PointToRefsMap;
     PointToRefsMap aPointsInfo;
 
-    //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<GeomAPI_Pnt>,
-    //                       std::list< std::shared_ptr<GeomDataAPI_Point2D> > > aPointToAttributes;
     ModelGeomAlgo_Point2D::getPointsInsideShape(anAttrShape, aRefAttributes, aC->pnt(),
-                                                aX->dir(), aDirY, aPointsInfo);//aPoints, aPointToAttributes);
-
-    int aCoincidentToFeature = (int)aPointsInfo.size();//aPoints.size();
+                                                aX->dir(), aDirY, aPointsInfo);
+    int aCoincidentToFeature = (int)aPointsInfo.size();
     if (aKind == SketchPlugin_Circle::ID())
       aValid = aCoincidentToFeature >= 2;
     else