]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SketchAPI/SketchAPI_Offset.cpp
Salome HOME
Task #3231: Sketcher Offset of a curve
[modules/shaper.git] / src / SketchAPI / SketchAPI_Offset.cpp
index 6d4f24e4e3c1da41f159a479131a78cd9b9c1fa2..392d07fe0d1b653b6cde1212f6b4896fb4061159 100644 (file)
@@ -34,15 +34,13 @@ SketchAPI_Offset::SketchAPI_Offset (const std::shared_ptr<ModelAPI_Feature> & th
 SketchAPI_Offset::SketchAPI_Offset (const std::shared_ptr<ModelAPI_Feature> & theFeature,
                                     const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
                                     const ModelHighAPI_Double & theOffsetValue,
-                                    bool theIsReversed,
-                                    bool theIsAuxiliary)
+                                    bool theIsReversed)
   : ModelHighAPI_Interface(theFeature)
 {
   if (initialize()) {
     fillAttribute(theObjects, edgesList());
     fillAttribute(theOffsetValue, value());
     fillAttribute(theIsReversed, reversed());
-    fillAttribute(theIsAuxiliary, auxiliary());
 
     execute();
   }
@@ -54,7 +52,7 @@ SketchAPI_Offset::~SketchAPI_Offset()
 
 std::list<std::shared_ptr<SketchAPI_SketchEntity> > SketchAPI_Offset::offset() const
 {
-  std::list<ObjectPtr> aList = createdList()->list();
+  std::list<ObjectPtr> aList = feature()->reflist(SketchPlugin_Constraint::ENTITY_B())->list();
   std::list<FeaturePtr> anIntermediate;
   std::list<ObjectPtr>::const_iterator anIt = aList.begin();
   for (; anIt != aList.end(); ++anIt) {
@@ -74,7 +72,6 @@ void SketchAPI_Offset::dump (ModelHighAPI_Dumper& theDumper) const
   AttributeRefListPtr aOffsetObjects = edgesList();
   AttributeDoublePtr aValue = value();
   AttributeBooleanPtr aReversed = reversed();
-  AttributeBooleanPtr anAux = auxiliary();
 
   // Check all attributes are already dumped. If not, store the feature as postponed.
   if (!theDumper.isDumped(aOffsetObjects)) {
@@ -83,7 +80,7 @@ void SketchAPI_Offset::dump (ModelHighAPI_Dumper& theDumper) const
   }
 
   theDumper << aBase << " = " << aSketchName << ".addOffset(" << aOffsetObjects << ", "
-            << aValue << ", " << aReversed << ", " << anAux << ")" << std::endl;
+            << aValue << ", " << aReversed << ")" << std::endl;
 
   // Dump variables for a list of created features
   theDumper << "[";
@@ -96,13 +93,13 @@ void SketchAPI_Offset::dump (ModelHighAPI_Dumper& theDumper) const
   }
   theDumper << "] = " << theDumper.name(aBase) << ".offset()" << std::endl;
 
-  // Set necessary "auxiliary" flag for created features
-  // (flag is set if it differs to anAux)
-  for (anIt = aList.begin(); anIt != aList.end(); ++anIt) {
-    FeaturePtr aFeature = (*anIt)->feature();
-    bool aFeatAux = aFeature->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value();
-    if (aFeatAux != anAux->value())
-      theDumper << theDumper.name((*anIt)->feature(), false)
-                << ".setAuxiliary(" << aFeatAux << ")" <<std::endl;
-  }
+////  // Set necessary "auxiliary" flag for created features
+////  // (flag is set if it differs to anAux)
+////  for (anIt = aList.begin(); anIt != aList.end(); ++anIt) {
+////    FeaturePtr aFeature = (*anIt)->feature();
+////    bool aFeatAux = aFeature->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value();
+////    if (aFeatAux != anAux->value())
+////      theDumper << theDumper.name((*anIt)->feature(), false)
+////                << ".setAuxiliary(" << aFeatAux << ")" <<std::endl;
+////  }
 }