//==================================================================================================
FeaturesAPI_Partition::FeaturesAPI_Partition(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects)
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Double& theFuzzy)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
- setBase(theBaseObjects);
+ fillAttribute(theBaseObjects, mybaseObjects);
+ fillAttribute(theFuzzy, myfuzzyParam);
+ execute();
}
}
execute();
}
+//==================================================================================================
+void FeaturesAPI_Partition::setFuzzy(const ModelHighAPI_Double& theFuzzy)
+{
+ fillAttribute(theFuzzy, myfuzzyParam);
+
+ execute();
+}
+
//==================================================================================================
void FeaturesAPI_Partition::dump(ModelHighAPI_Dumper& theDumper) const
{
AttributeSelectionListPtr anAttrObjects =
aBase->selectionList(FeaturesPlugin_Partition::BASE_OBJECTS_ID());
+ double aFuzzy = aBase->real(FeaturesPlugin_Partition::FUZZY_PARAM_ID())->value();
theDumper << aBase << " = model.addPartition(" << aDocName << ", " << anAttrObjects;
+ theDumper << ", fuzzyParam = " << aFuzzy;
+
if (!aBase->data()->version().empty())
theDumper << ", keepSubResults = True";
//==================================================================================================
PartitionPtr addPartition(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Double& fuzzyParam,
const bool keepSubResults)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Partition::ID());
if (!keepSubResults)
aFeature->data()->setVersion("");
- return PartitionPtr(new FeaturesAPI_Partition(aFeature, theBaseObjects));
+ return PartitionPtr(new FeaturesAPI_Partition(aFeature, theBaseObjects, fuzzyParam));
}