initialize();
}
+//==================================================================================================
+FeaturesAPI_BooleanFuse::FeaturesAPI_BooleanFuse(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theMainObjects,
+ const bool theRemoveEdges)
+ : ModelHighAPI_Interface(theFeature)
+{
+ if (initialize()) {
+ fillAttribute(FeaturesPlugin_BooleanFuse::CREATION_METHOD_SIMPLE(), mycreationMethod);
+ fillAttribute(theMainObjects, mymainObjects);
+ fillAttribute(theRemoveEdges, myremoveEdges);
+
+ execute(false);
+ }
+}
+
//==================================================================================================
FeaturesAPI_BooleanFuse::FeaturesAPI_BooleanFuse(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
- if (theToolObjects.empty()) {
- fillAttribute(FeaturesPlugin_BooleanFuse::CREATION_METHOD_SIMPLE(), mycreationMethod);
- } else {
- fillAttribute(FeaturesPlugin_BooleanFuse::CREATION_METHOD_ADVANCED(), mycreationMethod);
- }
-
+ fillAttribute(FeaturesPlugin_BooleanFuse::CREATION_METHOD_ADVANCED(), mycreationMethod);
fillAttribute(theMainObjects, mymainObjects);
fillAttribute(theToolObjects, mytoolObjects);
fillAttribute(theRemoveEdges, myremoveEdges);
{
fillAttribute(theToolObjects, mytoolObjects);
- if (theToolObjects.empty()) {
- fillAttribute(FeaturesPlugin_BooleanFuse::CREATION_METHOD_SIMPLE(), mycreationMethod);
- } else {
- fillAttribute(FeaturesPlugin_BooleanFuse::CREATION_METHOD_ADVANCED(), mycreationMethod);
- }
-
execute();
}
execute();
}
+//==================================================================================================
+void FeaturesAPI_BooleanFuse::setAdvancedMode(const bool theMode)
+{
+ if (theMode) {
+ fillAttribute(FeaturesPlugin_BooleanFuse::CREATION_METHOD_ADVANCED(), mycreationMethod);
+ } else {
+ fillAttribute(FeaturesPlugin_BooleanFuse::CREATION_METHOD_SIMPLE(), mycreationMethod);
+ }
+}
+
//==================================================================================================
void FeaturesAPI_BooleanFuse::dump(ModelHighAPI_Dumper& theDumper) const
{
theDumper << aBase << " = model.addFuse";
const std::string& aDocName = theDumper.name(aBase->document());
+ AttributeStringPtr aMode = aBase->string(FeaturesPlugin_BooleanFuse::CREATION_METHOD());
AttributeSelectionListPtr anObjects =
aBase->selectionList(FeaturesPlugin_BooleanFuse::OBJECT_LIST_ID());
AttributeSelectionListPtr aTools =
theDumper << "(" << aDocName << ", " << anObjects;
- if (aTools->size() > 0) {
+ if (aMode->value() == FeaturesPlugin_BooleanFuse::CREATION_METHOD_ADVANCED()) {
theDumper << ", " << aTools;
}
const bool theRemoveEdges)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanFuse::ID());
- std::list<ModelHighAPI_Selection> aToolObjects;
return BooleanFusePtr(new FeaturesAPI_BooleanFuse(aFeature,
theObjects,
- aToolObjects,
theRemoveEdges));
}
FEATURESAPI_EXPORT
explicit FeaturesAPI_BooleanFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+ /// Constructor with values.
+ FEATURESAPI_EXPORT
+ FeaturesAPI_BooleanFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theMainObjects,
+ const bool theRemoveEdges = false);
+
/// Constructor with values.
FEATURESAPI_EXPORT
FeaturesAPI_BooleanFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects,
- const bool theRemoveEdges = false);
+ const std::list<ModelHighAPI_Selection>& theMainObjects,
+ const std::list<ModelHighAPI_Selection>& theToolObjects,
+ const bool theRemoveEdges = false);
/// Destructor.
FEATURESAPI_EXPORT
FEATURESAPI_EXPORT
void setRemoveEdges(const bool theRemoveEdges);
+ /// Set mode.
+ FEATURESAPI_EXPORT
+ void setAdvancedMode(const bool theMode);
+
/// Dump wrapped feature
FEATURESAPI_EXPORT
virtual void dump(ModelHighAPI_Dumper& theDumper) const;