//==================================================================================================
FeaturesAPI_BooleanCommon::FeaturesAPI_BooleanCommon(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theMainObjects,
- const int theVersion)
+ const std::list<ModelHighAPI_Selection>& theMainObjects)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
fillAttribute(FeaturesPlugin_BooleanCommon::CREATION_METHOD_SIMPLE(), mycreationMethod);
- fillAttribute(theVersion, theFeature->integer(FeaturesPlugin_Boolean::VERSION_ID()));
fillAttribute(theMainObjects, mymainObjects);
execute(false);
FeaturesAPI_BooleanCommon::FeaturesAPI_BooleanCommon(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects,
- const int theVersion)
+ const std::list<ModelHighAPI_Selection>& theToolObjects)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
fillAttribute(FeaturesPlugin_BooleanCommon::CREATION_METHOD_ADVANCED(), mycreationMethod);
- fillAttribute(theVersion, theFeature->integer(FeaturesPlugin_Boolean::VERSION_ID()));
fillAttribute(theMainObjects, mymainObjects);
fillAttribute(theToolObjects, mytoolObjects);
aBase->selectionList(FeaturesPlugin_BooleanCommon::OBJECT_LIST_ID());
AttributeSelectionListPtr aTools =
aBase->selectionList(FeaturesPlugin_BooleanCommon::TOOL_LIST_ID());
- AttributeIntegerPtr aVersion =
- aBase->integer(FeaturesPlugin_BooleanCommon::VERSION_ID());
theDumper << "(" << aDocName << ", " << anObjects;
theDumper << ", " << aTools;
}
- if (aVersion && aVersion->isInitialized() &&
- aVersion->value() == FeaturesPlugin_VersionedBoolean::THE_VERSION_1) {
+ if (!aBase->data()->version().empty())
theDumper << ", keepSubResults = True";
- }
theDumper << ")" << std::endl;
}
-//==================================================================================================
-static BooleanCommonPtr addCommon(const std::shared_ptr<ModelAPI_Document>& thePart,
- const std::list<ModelHighAPI_Selection>& theMainObjects,
- const int theVersion)
-{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanCommon::ID());
- return BooleanCommonPtr(new FeaturesAPI_BooleanCommon(aFeature, theMainObjects, theVersion));
-}
-
-//==================================================================================================
-static BooleanCommonPtr addCommon(const std::shared_ptr<ModelAPI_Document>& thePart,
- const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects,
- const int theVersion)
-{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanCommon::ID());
- return BooleanCommonPtr(new FeaturesAPI_BooleanCommon(aFeature,
- theMainObjects,
- theToolObjects,
- theVersion));
-}
-
//==================================================================================================
BooleanCommonPtr addCommon(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects,
const bool keepSubResults)
{
- int aVersion = keepSubResults ? FeaturesPlugin_VersionedBoolean::THE_VERSION_1
- : FeaturesPlugin_VersionedBoolean::THE_VERSION_0;
- return theToolObjects.empty() ? addCommon(thePart, theMainObjects, aVersion)
- : addCommon(thePart, theMainObjects, theToolObjects, aVersion);
+ std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanCommon::ID());
+ if (!keepSubResults)
+ aFeature->data()->setVersion("");
+ BooleanCommonPtr aCommon;
+ if (theToolObjects.empty())
+ aCommon.reset(new FeaturesAPI_BooleanCommon(aFeature, theMainObjects));
+ else
+ aCommon.reset(new FeaturesAPI_BooleanCommon(aFeature, theMainObjects, theToolObjects));
+ return aCommon;
}
/// Constructor with values.
FEATURESAPI_EXPORT
FeaturesAPI_BooleanCommon(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theMainObjects,
- const int theVersion = 0);
+ const std::list<ModelHighAPI_Selection>& theMainObjects);
/// Constructor with values.
FEATURESAPI_EXPORT
FeaturesAPI_BooleanCommon(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects,
- const int theVersion = 0);
+ const std::list<ModelHighAPI_Selection>& theToolObjects);
/// Destructor.
FEATURESAPI_EXPORT
FeaturesAPI_BooleanCut::FeaturesAPI_BooleanCut(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects,
- const int theVersion)
+ const std::list<ModelHighAPI_Selection>& theToolObjects)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
- fillAttribute(theVersion, theFeature->integer(FeaturesPlugin_Boolean::VERSION_ID()));
fillAttribute(theMainObjects, mymainObjects);
fillAttribute(theToolObjects, mytoolObjects);
aBase->selectionList(FeaturesPlugin_BooleanCut::OBJECT_LIST_ID());
AttributeSelectionListPtr aTools =
aBase->selectionList(FeaturesPlugin_BooleanCut::TOOL_LIST_ID());
- AttributeIntegerPtr aVersion =
- aBase->integer(FeaturesPlugin_BooleanCut::VERSION_ID());
theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools;
- if (aVersion && aVersion->isInitialized() &&
- aVersion->value() == FeaturesPlugin_VersionedBoolean::THE_VERSION_1)
+ if (!aBase->data()->version().empty())
theDumper << ", keepSubResults = True";
theDumper << ")" << std::endl;
const bool keepSubResults)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanCut::ID());
- int aVersion = keepSubResults ? FeaturesPlugin_VersionedBoolean::THE_VERSION_1
- : FeaturesPlugin_VersionedBoolean::THE_VERSION_0;
+ if (!keepSubResults)
+ aFeature->data()->setVersion("");
return BooleanCutPtr(new FeaturesAPI_BooleanCut(aFeature,
theMainObjects,
- theToolObjects,
- aVersion));
+ theToolObjects));
}
FEATURESAPI_EXPORT
FeaturesAPI_BooleanCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects,
- const int theVersion = 0);
+ const std::list<ModelHighAPI_Selection>& theToolObjects);
/// Destructor.
FEATURESAPI_EXPORT
FeaturesAPI_BooleanFill::FeaturesAPI_BooleanFill(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects,
- const int theVersion)
+ const std::list<ModelHighAPI_Selection>& theToolObjects)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
- fillAttribute(theVersion, theFeature->integer(FeaturesPlugin_Boolean::VERSION_ID()));
fillAttribute(theMainObjects, mymainObjects);
fillAttribute(theToolObjects, mytoolObjects);
aBase->selectionList(FeaturesPlugin_BooleanFill::OBJECT_LIST_ID());
AttributeSelectionListPtr aTools =
aBase->selectionList(FeaturesPlugin_BooleanFill::TOOL_LIST_ID());
- AttributeIntegerPtr aVersion =
- aBase->integer(FeaturesPlugin_BooleanFill::VERSION_ID());
theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools;
- if (aVersion && aVersion->isInitialized() &&
- aVersion->value() == FeaturesPlugin_VersionedBoolean::THE_VERSION_1)
+ if (!aBase->data()->version().empty())
theDumper << ", keepSubResults = True";
theDumper << ")" << std::endl;
const bool keepSubResults)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanFill::ID());
- int aVersion = keepSubResults ? FeaturesPlugin_VersionedBoolean::THE_VERSION_1
- : FeaturesPlugin_VersionedBoolean::THE_VERSION_0;
- return BooleanFillPtr(new FeaturesAPI_BooleanFill(aFeature,
- theMainObjects,
- theToolObjects,
- aVersion));
+ if (!keepSubResults)
+ aFeature->data()->setVersion("");
+ return BooleanFillPtr(new FeaturesAPI_BooleanFill(aFeature, theMainObjects, theToolObjects));
}
FEATURESAPI_EXPORT
FeaturesAPI_BooleanFill(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects,
- const int theVersion = 0);
+ const std::list<ModelHighAPI_Selection>& theToolObjects);
/// Destructor.
FEATURESAPI_EXPORT
FeaturesAPI_BooleanFuse::FeaturesAPI_BooleanFuse(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const bool theRemoveEdges,
- const int theVersion)
+ const bool theRemoveEdges)
: ModelHighAPI_Interface(theFeature)
{
if (initialize()) {
fillAttribute(FeaturesPlugin_BooleanFuse::CREATION_METHOD_SIMPLE(), mycreationMethod);
- fillAttribute(theVersion, theFeature->integer(FeaturesPlugin_Boolean::VERSION_ID()));
fillAttribute(theMainObjects, mymainObjects);
fillAttribute(theRemoveEdges, myremoveEdges);
const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects,
- const bool theRemoveEdges,
- const int theVersion)
+ const bool theRemoveEdges)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
fillAttribute(FeaturesPlugin_BooleanFuse::CREATION_METHOD_ADVANCED(), mycreationMethod);
- fillAttribute(theVersion, theFeature->integer(FeaturesPlugin_Boolean::VERSION_ID()));
fillAttribute(theMainObjects, mymainObjects);
fillAttribute(theToolObjects, mytoolObjects);
fillAttribute(theRemoveEdges, myremoveEdges);
aBase->selectionList(FeaturesPlugin_BooleanFuse::TOOL_LIST_ID());
AttributeBooleanPtr aRemoveEdges =
aBase->boolean(FeaturesPlugin_BooleanFuse::REMOVE_INTERSECTION_EDGES_ID());
- AttributeIntegerPtr aVersion =
- aBase->integer(FeaturesPlugin_BooleanFuse::VERSION_ID());
theDumper << "(" << aDocName << ", " << anObjects;
theDumper << ", removeEdges = True";
}
- if (aVersion && aVersion->isInitialized() &&
- aVersion->value() == FeaturesPlugin_VersionedBoolean::THE_VERSION_1) {
+ if (!aBase->data()->version().empty())
theDumper << ", keepSubResults = True";
- }
theDumper << ")" << std::endl;
}
-//==================================================================================================
-static BooleanFusePtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
- const std::list<ModelHighAPI_Selection>& theObjects,
- const bool theRemoveEdges,
- const int theVersion)
-{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanFuse::ID());
- return BooleanFusePtr(new FeaturesAPI_BooleanFuse(aFeature,
- theObjects,
- theRemoveEdges,
- theVersion));
-}
-
-//==================================================================================================
-static BooleanFusePtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
- const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects,
- const bool theRemoveEdges,
- const int theVersion)
-{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanFuse::ID());
- return BooleanFusePtr(new FeaturesAPI_BooleanFuse(aFeature,
- theMainObjects,
- theToolObjects,
- theRemoveEdges,
- theVersion));
-}
-
//==================================================================================================
BooleanFusePtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const bool theRemoveEdges,
const bool keepSubResults)
{
- int aVersion = keepSubResults ? FeaturesPlugin_VersionedBoolean::THE_VERSION_1
- : FeaturesPlugin_VersionedBoolean::THE_VERSION_0;
+ std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanFuse::ID());
+ if (!keepSubResults)
+ aFeature->data()->setVersion("");
+
bool aRemoveEdges = theRemoveEdges;
if (theToolObjects.first.empty())
aRemoveEdges = aRemoveEdges || theToolObjects.second;
- return theToolObjects.first.empty() ?
- addFuse(thePart, theMainObjects, aRemoveEdges, aVersion) :
- addFuse(thePart, theMainObjects, theToolObjects.first, aRemoveEdges, aVersion);
+
+ BooleanFusePtr aFuse;
+ if (theToolObjects.first.empty())
+ aFuse.reset(new FeaturesAPI_BooleanFuse(aFeature, theMainObjects, aRemoveEdges));
+ else {
+ aFuse.reset(new FeaturesAPI_BooleanFuse(aFeature, theMainObjects, theToolObjects.first,
+ aRemoveEdges));
+ }
+ return aFuse;
}
FEATURESAPI_EXPORT
FeaturesAPI_BooleanFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const bool theRemoveEdges = false,
- const int theVersion = 0);
+ 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 int theVersion = 0);
+ const bool theRemoveEdges = false);
/// Destructor.
FEATURESAPI_EXPORT
FeaturesAPI_BooleanSmash::FeaturesAPI_BooleanSmash(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects,
- const int theVersion)
+ const std::list<ModelHighAPI_Selection>& theToolObjects)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
- fillAttribute(theVersion, theFeature->integer(FeaturesPlugin_Boolean::VERSION_ID()));
fillAttribute(theMainObjects, mymainObjects);
fillAttribute(theToolObjects, mytoolObjects);
aBase->selectionList(FeaturesPlugin_BooleanSmash::OBJECT_LIST_ID());
AttributeSelectionListPtr aTools =
aBase->selectionList(FeaturesPlugin_BooleanSmash::TOOL_LIST_ID());
- AttributeIntegerPtr aVersion =
- aBase->integer(FeaturesPlugin_BooleanSmash::VERSION_ID());
theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools;
- if (aVersion && aVersion->isInitialized() &&
- aVersion->value() == FeaturesPlugin_VersionedBoolean::THE_VERSION_1)
+ if (!aBase->data()->version().empty())
theDumper << ", keepSubResults = True";
theDumper << ")" << std::endl;
const bool keepSubResults)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanSmash::ID());
- int aVersion = keepSubResults ? FeaturesPlugin_VersionedBoolean::THE_VERSION_1
- : FeaturesPlugin_VersionedBoolean::THE_VERSION_0;
- return BooleanSmashPtr(new FeaturesAPI_BooleanSmash(aFeature,
- theMainObjects,
- theToolObjects,
- aVersion));
+ if (!keepSubResults)
+ aFeature->data()->setVersion("");
+ return BooleanSmashPtr(new FeaturesAPI_BooleanSmash(aFeature, theMainObjects, theToolObjects));
}
FEATURESAPI_EXPORT
FeaturesAPI_BooleanSmash(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects,
- const int theVersion = 0);
+ const std::list<ModelHighAPI_Selection>& theToolObjects);
/// Destructor.
FEATURESAPI_EXPORT
//==================================================================================================
FeaturesAPI_Partition::FeaturesAPI_Partition(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const int theVersion)
+ const std::list<ModelHighAPI_Selection>& theBaseObjects)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
- fillAttribute(theVersion, theFeature->integer(FeaturesPlugin_Partition::VERSION_ID()));
setBase(theBaseObjects);
}
}
AttributeSelectionListPtr anAttrObjects =
aBase->selectionList(FeaturesPlugin_Partition::BASE_OBJECTS_ID());
- AttributeIntegerPtr aVersion =
- aBase->integer(FeaturesPlugin_Partition::VERSION_ID());
theDumper << aBase << " = model.addPartition(" << aDocName << ", " << anAttrObjects;
- if (aVersion && aVersion->isInitialized() &&
- aVersion->value() == FeaturesPlugin_VersionedBoolean::THE_VERSION_1)
+ if (!aBase->data()->version().empty())
theDumper << ", keepSubResults = True";
theDumper << ")" << std::endl;
const std::list<ModelHighAPI_Selection>& theBaseObjects,
const bool keepSubResults)
{
- int aVersion = keepSubResults ? FeaturesPlugin_VersionedBoolean::THE_VERSION_1
- : FeaturesPlugin_VersionedBoolean::THE_VERSION_0;
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Partition::ID());
- return PartitionPtr(new FeaturesAPI_Partition(aFeature, theBaseObjects, aVersion));
+ if (!keepSubResults)
+ aFeature->data()->setVersion("");
+ return PartitionPtr(new FeaturesAPI_Partition(aFeature, theBaseObjects));
}
/// Constructor with values.
FEATURESAPI_EXPORT
explicit FeaturesAPI_Partition(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const int theVersion = 0);
+ const std::list<ModelHighAPI_Selection>& theBaseObjects);
/// Destructor.
FEATURESAPI_EXPORT
//================================================================================================
FeaturesAPI_Union::FeaturesAPI_Union(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const int theVersion)
+ const std::list<ModelHighAPI_Selection>& theBaseObjects)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
- fillAttribute(theVersion, theFeature->integer(FeaturesPlugin_VersionedBoolean::VERSION_ID()));
setBase(theBaseObjects);
}
}
AttributeSelectionListPtr anAttrObjects =
aBase->selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID());
- AttributeIntegerPtr aVersion =
- aBase->integer(FeaturesPlugin_Union::VERSION_ID());
theDumper << aBase << " = model.addUnion(" << aDocName << ", " << anAttrObjects;
- if (aVersion && aVersion->isInitialized() &&
- aVersion->value() == FeaturesPlugin_VersionedBoolean::THE_VERSION_1)
+ if (!aBase->data()->version().empty())
theDumper << ", keepSubResults = True";
theDumper << ")" << std::endl;
const std::list<ModelHighAPI_Selection>& theBaseObjects,
const bool keepSubResults)
{
- int aVersion = keepSubResults ? FeaturesPlugin_VersionedBoolean::THE_VERSION_1
- : FeaturesPlugin_VersionedBoolean::THE_VERSION_0;
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Union::ID());
- return UnionPtr(new FeaturesAPI_Union(aFeature, theBaseObjects, aVersion));
+ if (!keepSubResults)
+ aFeature->data()->setVersion("");
+ return UnionPtr(new FeaturesAPI_Union(aFeature, theBaseObjects));
}
/// Constructor with values.
FEATURESAPI_EXPORT
explicit FeaturesAPI_Union(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const int theVersion = 0);
+ const std::list<ModelHighAPI_Selection>& theBaseObjects);
/// Destructor.
FEATURESAPI_EXPORT
TestDefeaturing_OnCompound.py
Test3137_1.py
Test3137_2.py
+ Test3139.py
)
data()->addAttribute(OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
data()->addAttribute(TOOL_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
- initVersion(THE_VERSION_1, selectionList(OBJECT_LIST_ID()), selectionList(TOOL_LIST_ID()));
+ initVersion(BOP_VERSION_9_4(), selectionList(OBJECT_LIST_ID()), selectionList(TOOL_LIST_ID()));
}
//==================================================================================================
}
// version of COMMON feature
- int aCommonVersion = version();
+ const std::string aCommonVersion = data()->version();
int aResultIndex = 0;
GeomShapePtr aResultCompound;
aMakeShapeList->appendAlgo(aCommonAlgo);
}
- if (aCommonVersion == THE_VERSION_1) {
+ if (aCommonVersion == BOP_VERSION_9_4()) {
// merge hierarchies of compounds containing objects and tools
// and append the result of the FUSE operation
aShape = keepUnusedSubsOfCompound(aShape, anObjects, aTools, aMakeShapeList);
aResultShapesList.push_back(aShape);
}
} else {
- if (aCommonVersion == THE_VERSION_1) {
+ if (aCommonVersion == BOP_VERSION_9_4()) {
// merge hierarchies of compounds containing objects and tools
aResultCompound =
keepUnusedSubsOfCompound(GeomShapePtr(), anObjects, aTools, aMakeShapeList);
void FeaturesPlugin_BooleanCut::initAttributes()
{
FeaturesPlugin_Boolean::initAttributes();
- initVersion(THE_VERSION_1, selectionList(OBJECT_LIST_ID()), selectionList(TOOL_LIST_ID()));
+ initVersion(BOP_VERSION_9_4(), selectionList(OBJECT_LIST_ID()), selectionList(TOOL_LIST_ID()));
}
//==================================================================================================
return;
}
- // version of CUT feature
- int aCutVersion = version();
-
std::vector<FeaturesPlugin_Tools::ResultBaseAlgo> aResultBaseAlgoList;
ListOfShape aResultShapesList;
std::string anError;
std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
GeomShapePtr aResultCompound;
- if (aCutVersion == THE_VERSION_1) {
+ if (data()->version() == BOP_VERSION_9_4()) {
// merge hierarchies of compounds containing objects and tools
aResultCompound =
keepUnusedSubsOfCompound(GeomShapePtr(), anObjects, aTools, aMakeShapeList);
void FeaturesPlugin_BooleanFill::initAttributes()
{
FeaturesPlugin_Boolean::initAttributes();
- initVersion(THE_VERSION_1, selectionList(OBJECT_LIST_ID()), selectionList(TOOL_LIST_ID()));
+ initVersion(BOP_VERSION_9_4(), selectionList(OBJECT_LIST_ID()), selectionList(TOOL_LIST_ID()));
}
//=================================================================================================
return;
}
- // version of Split feature
- int aSplitVersion = version();
-
std::vector<FeaturesPlugin_Tools::ResultBaseAlgo> aResultBaseAlgoList;
ListOfShape aResultShapesList;
std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
GeomShapePtr aResultCompound;
- if (aSplitVersion == THE_VERSION_1) {
+ if (data()->version() == BOP_VERSION_9_4()) {
// merge hierarchies of compounds containing objects and tools
aResultCompound =
keepUnusedSubsOfCompound(GeomShapePtr(), anObjects, aTools, aMakeShapeList);
ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), OBJECT_LIST_ID());
ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), TOOL_LIST_ID());
- initVersion(THE_VERSION_1, selectionList(OBJECT_LIST_ID()), selectionList(TOOL_LIST_ID()));
+ initVersion(BOP_VERSION_9_4(), selectionList(OBJECT_LIST_ID()), selectionList(TOOL_LIST_ID()));
}
//==================================================================================================
}
// version of FUSE feature
- int aFuseVersion = version();
+ const std::string aFuseVersion = data()->version();
// Collecting all solids which will be fused.
ListOfShape aSolidsToFuse;
// Collecting solids from compsolids which will not be modified
// in boolean operation and will be added to result.
- bool isProcessCompsolid = !isSimpleCreation || aFuseVersion >= THE_VERSION_1;
+ bool isProcessCompsolid = !isSimpleCreation || !aFuseVersion.empty();
ListOfShape aShapesToAdd;
for (ObjectHierarchy::Iterator anObjectsIt = anObjectsHierarchy.Begin();
isProcessCompsolid && anObjectsIt != anObjectsHierarchy.End();
aMakeShapeList->appendAlgo(aUnifyAlgo);
}
- if (aFuseVersion == THE_VERSION_1) {
+ if (aFuseVersion == BOP_VERSION_9_4()) {
// merge hierarchies of compounds containing objects and tools
// and append the result of the FUSE operation
aShape = keepUnusedSubsOfCompound(aShape, anObjectsHierarchy, aToolsHierarchy, aMakeShapeList);
data()->addAttribute(OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
data()->addAttribute(TOOL_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
- initVersion(THE_VERSION_1, selectionList(OBJECT_LIST_ID()), selectionList(TOOL_LIST_ID()));
+ initVersion(BOP_VERSION_9_4(), selectionList(OBJECT_LIST_ID()), selectionList(TOOL_LIST_ID()));
}
//==================================================================================================
}
// take into account a version of SMASH feature
- int aSmashVersion = version();
- if (aSmashVersion == THE_VERSION_1) {
+ if (data()->version() == BOP_VERSION_9_4()) {
// merge hierarchies of compounds containing objects and tools
// and append the result of the FUSE operation
aShape = keepUnusedSubsOfCompound(aShape, anObjectsHistory, aToolsHistory, aMakeShapeList);
void FeaturesPlugin_Partition::initAttributes()
{
data()->addAttribute(BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList::typeId());
- initVersion(THE_VERSION_1, selectionList(BASE_OBJECTS_ID()));
+ initVersion(BOP_VERSION_9_4(), selectionList(BASE_OBJECTS_ID()));
}
//=================================================================================================
int aResultIndex = 0;
- int aPartitionVersion = version();
- if (aPartitionVersion < THE_VERSION_1) {
+ if (data()->version().empty()) {
// default behaviors of Partition
if(aResultShape->shapeType() == GeomAPI_Shape::COMPOUND) {
for(GeomAPI_ShapeIterator anIt(aResultShape); anIt.more(); anIt.next()) {
void FeaturesPlugin_Union::initAttributes()
{
data()->addAttribute(BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList::typeId());
- initVersion(THE_VERSION_1, selectionList(BASE_OBJECTS_ID()));
+ initVersion(BOP_VERSION_9_4(), selectionList(BASE_OBJECTS_ID()));
}
//=================================================================================================
std::vector<FeaturesPlugin_Tools::ResultBaseAlgo> aResultBaseAlgoList;
ListOfShape aResultShapesList;
- int aUnionVersion = version();
GeomShapePtr aResultCompound = GeomAlgoAPI_CompoundBuilder::compound(ListOfShape());
// Fuse objects.
GeomShapePtr aShape;
GeomAPI_ShapeIterator aCIt(aResultCompound);
- if (aUnionVersion < THE_VERSION_1) {
+ if (data()->version().empty()) {
// if the compound consists of a single sub-shape, take it,
// otherwise, take the full compound
aShape = aCIt.current();
}
//=================================================================================================
-void FeaturesPlugin_VersionedBoolean::initVersion(const int theVersion,
+void FeaturesPlugin_VersionedBoolean::initVersion(const std::string& theVersion,
const AttributePtr theObjectsAttr,
const AttributePtr theToolsAttr)
{
- AttributePtr aVerAttr = data()->addAttribute(VERSION_ID(), ModelAPI_AttributeInteger::typeId());
- aVerAttr->setIsArgument(false);
- ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), VERSION_ID());
- if (!integer(VERSION_ID())->isInitialized() &&
- (!theObjectsAttr || !theObjectsAttr->isInitialized()) &&
- (!theToolsAttr || !theToolsAttr->isInitialized())) {
+ AttributeIntegerPtr anOldVersionAttr = integer("version");
+ if (anOldVersionAttr && anOldVersionAttr->isInitialized() && data()->version().empty()) {
+ // move value to the common version interface in ModelAPI_Data
+ data()->setVersion(BOP_VERSION_9_4());
+ }
+ else if ((!theObjectsAttr || !theObjectsAttr->isInitialized()) &&
+ (!theToolsAttr || !theToolsAttr->isInitialized())) {
// this is a newly created feature (not read from file),
// so, initialize the latest version
- integer(VERSION_ID())->setValue(theVersion);
+ data()->setVersion(theVersion);
}
}
}
}
-//=================================================================================================
-int FeaturesPlugin_VersionedBoolean::version()
-{
- AttributeIntegerPtr aVersionAttr = integer(VERSION_ID());
- int aVersion = 0;
- if (aVersionAttr && aVersionAttr->isInitialized())
- aVersion = aVersionAttr->value();
- return aVersion;
-}
-
//=================================================================================================
void FeaturesPlugin_VersionedBoolean::ObjectHierarchy::AddObject(const GeomShapePtr& theObject)
/// \brief Feature controls a version of Boolean operations.
class FeaturesPlugin_VersionedBoolean : public ModelAPI_Feature
{
-public:
- static const int THE_VERSION_0 = 0;
- static const int THE_VERSION_1 = 20190506;
-
- /// Attribute name of the version of Boolean feature
- inline static const std::string& VERSION_ID()
+protected:
+ static const std::string& BOP_VERSION_9_4()
{
- static const std::string MY_VERSION_ID("version");
- return MY_VERSION_ID;
+ static const std::string VERSION("v9.4");
+ return VERSION;
}
-protected:
-
/// Use plugin manager for features creation.
FeaturesPlugin_VersionedBoolean() {}
/// Initialize version field of the Boolean feature.
/// The version is initialized for newly created features,
/// not read from previously stored document.
- void initVersion(const int theVersion,
+ void initVersion(const std::string& theVersion,
const std::shared_ptr<ModelAPI_Attribute> theObjectsAttr
= std::shared_ptr<ModelAPI_Attribute>(),
const std::shared_ptr<ModelAPI_Attribute> theToolsAttr
const ObjectHierarchy& theToolsHierarchy,
std::shared_ptr<GeomAlgoAPI_MakeShapeList> theMakeShapeList);
- /// Return version of the feature
- int version();
-
private:
void parentForShape(const GeomShapePtr& theShape,
const std::shared_ptr<ModelAPI_Result>& theContext,
--- /dev/null
+# Copyright (C) 2020 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(52.9121725731895, 8.799859429739596, 7.781201848998454, 8.799859429739596)
+SketchLine_2 = Sketch_1.addLine(7.781201848998454, 8.799859429739596, 7.781201848998454, 36.33111129445148)
+SketchLine_3 = Sketch_1.addLine(7.781201848998454, 36.33111129445148, 52.9121725731895, 36.33111129445148)
+SketchLine_4 = Sketch_1.addLine(52.9121725731895, 36.33111129445148, 52.9121725731895, 8.799859429739596)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+SketchLine_5 = Sketch_1.addLine(29.87981510015411, 36.33111129445148, 29.87981510015411, 8.799859429739596)
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchLine_5.startPoint(), SketchLine_3.result())
+SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchLine_5.endPoint(), SketchLine_1.result())
+SketchConstraintVertical_3 = Sketch_1.setVertical(SketchLine_5.result())
+SketchCircle_1 = Sketch_1.addCircle(88.70570107858241, 30.96918335901386, 15.95582825781952)
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 20, 0)
+Compound_1 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2")])
+Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
+SketchLine_6 = Sketch_2.addLine(91.78842679005474, 52.44197384283513, 18.42664179347724, 52.44197384283513)
+SketchLine_7 = Sketch_2.addLine(18.42664179347724, 52.44197384283513, 18.42664179347724, 23.73518840939176)
+SketchLine_8 = Sketch_2.addLine(18.42664179347724, 23.73518840939176, 91.78842679005474, 23.73518840939176)
+SketchLine_9 = Sketch_2.addLine(91.78842679005474, 23.73518840939176, 91.78842679005474, 52.44197384283513)
+SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_9.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+SketchConstraintCoincidence_10 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_9.startPoint())
+SketchConstraintHorizontal_3 = Sketch_2.setHorizontal(SketchLine_6.result())
+SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_7.result())
+SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_8.result())
+SketchConstraintVertical_5 = Sketch_2.setVertical(SketchLine_9.result())
+model.do()
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_6r-SketchLine_7f-SketchLine_8f-SketchLine_9f")], model.selection(), 10, 0)
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Compound_1_1_1_1")], [model.selection("SOLID", "Extrusion_2_1")])
+model.do()
+
+Part_2 = model.addPart(partSet)
+Part_2_doc = Part_2.document()
+Sketch_3 = model.addSketch(Part_2_doc, model.defaultPlane("XOY"))
+SketchLine_10 = Sketch_3.addLine(52.9121725731895, 8.799859429739596, 7.781201848998454, 8.799859429739596)
+SketchLine_11 = Sketch_3.addLine(7.781201848998454, 8.799859429739596, 7.781201848998454, 36.33111129445148)
+SketchLine_12 = Sketch_3.addLine(7.781201848998454, 36.33111129445148, 52.9121725731895, 36.33111129445148)
+SketchLine_13 = Sketch_3.addLine(52.9121725731895, 36.33111129445148, 52.9121725731895, 8.799859429739596)
+SketchConstraintCoincidence_11 = Sketch_3.setCoincident(SketchLine_13.endPoint(), SketchLine_10.startPoint())
+SketchConstraintCoincidence_12 = Sketch_3.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint())
+SketchConstraintCoincidence_13 = Sketch_3.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
+SketchConstraintCoincidence_14 = Sketch_3.setCoincident(SketchLine_12.endPoint(), SketchLine_13.startPoint())
+SketchConstraintHorizontal_5 = Sketch_3.setHorizontal(SketchLine_10.result())
+SketchConstraintVertical_6 = Sketch_3.setVertical(SketchLine_11.result())
+SketchConstraintHorizontal_6 = Sketch_3.setHorizontal(SketchLine_12.result())
+SketchConstraintVertical_7 = Sketch_3.setVertical(SketchLine_13.result())
+SketchLine_14 = Sketch_3.addLine(29.87981510015411, 36.33111129445148, 29.87981510015411, 8.799859429739596)
+SketchConstraintCoincidence_15 = Sketch_3.setCoincident(SketchLine_14.startPoint(), SketchLine_12.result())
+SketchConstraintCoincidence_16 = Sketch_3.setCoincident(SketchLine_14.endPoint(), SketchLine_10.result())
+SketchConstraintVertical_8 = Sketch_3.setVertical(SketchLine_14.result())
+SketchCircle_2 = Sketch_3.addCircle(88.70570107858241, 30.96918335901386, 15.95582825781952)
+model.do()
+Extrusion_3 = model.addExtrusion(Part_2_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 20, 0)
+Compound_2 = model.addCompound(Part_2_doc, [model.selection("COMPSOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2")])
+Sketch_4 = model.addSketch(Part_2_doc, model.standardPlane("XOY"))
+SketchLine_15 = Sketch_4.addLine(91.78842679005474, 52.44197384283513, 18.42664179347724, 52.44197384283513)
+SketchLine_16 = Sketch_4.addLine(18.42664179347724, 52.44197384283513, 18.42664179347724, 23.73518840939176)
+SketchLine_17 = Sketch_4.addLine(18.42664179347724, 23.73518840939176, 91.78842679005474, 23.73518840939176)
+SketchLine_18 = Sketch_4.addLine(91.78842679005474, 23.73518840939176, 91.78842679005474, 52.44197384283513)
+SketchConstraintCoincidence_17 = Sketch_4.setCoincident(SketchLine_18.endPoint(), SketchLine_15.startPoint())
+SketchConstraintCoincidence_18 = Sketch_4.setCoincident(SketchLine_15.endPoint(), SketchLine_16.startPoint())
+SketchConstraintCoincidence_19 = Sketch_4.setCoincident(SketchLine_16.endPoint(), SketchLine_17.startPoint())
+SketchConstraintCoincidence_20 = Sketch_4.setCoincident(SketchLine_17.endPoint(), SketchLine_18.startPoint())
+SketchConstraintHorizontal_7 = Sketch_4.setHorizontal(SketchLine_15.result())
+SketchConstraintVertical_9 = Sketch_4.setVertical(SketchLine_16.result())
+SketchConstraintHorizontal_8 = Sketch_4.setHorizontal(SketchLine_17.result())
+SketchConstraintVertical_10 = Sketch_4.setVertical(SketchLine_18.result())
+model.do()
+Extrusion_4 = model.addExtrusion(Part_2_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_6r-SketchLine_7f-SketchLine_8f-SketchLine_9f")], model.selection(), 10, 0)
+Cut_2 = model.addCut(Part_2_doc, [model.selection("SOLID", "Compound_1_1_1_1")], [model.selection("SOLID", "Extrusion_2_1")], keepSubResults = True)
+model.do()
+
+model.end()
+
+from GeomAPI import *
+
+model.testNbResults(Part_1, 1)
+model.testNbSubResults(Part_1, [0])
+model.testNbSubShapes(Part_1, GeomAPI_Shape.SOLID, [2])
+model.testNbSubShapes(Part_1, GeomAPI_Shape.FACE, [16])
+model.testNbSubShapes(Part_1, GeomAPI_Shape.EDGE, [74])
+model.testNbSubShapes(Part_1, GeomAPI_Shape.VERTEX, [148])
+model.testResultsVolumes(Part_1, [23407.60956])
+
+model.testNbResults(Part_2, 1)
+model.testNbSubResults(Part_2, [0])
+model.testNbSubShapes(Part_2, GeomAPI_Shape.SOLID, [3])
+model.testNbSubShapes(Part_2, GeomAPI_Shape.FACE, [19])
+model.testNbSubShapes(Part_2, GeomAPI_Shape.EDGE, [80])
+model.testNbSubShapes(Part_2, GeomAPI_Shape.VERTEX, [160])
+model.testResultsVolumes(Part_2, [39403.873983562])
static const int kFlagDeleted = 2;
// TDataStd_Integer - 0 if the name of the object is generated automatically,
// otherwise the name is defined by user
-Standard_GUID kUSER_DEFINED_NAME("9c694d18-a83c-4a56-bc9b-8020628a8244");
+static const Standard_GUID kUSER_DEFINED_NAME("9c694d18-a83c-4a56-bc9b-8020628a8244");
// invalid data
const static std::shared_ptr<ModelAPI_Data> kInvalid(new Model_Data());
static const Standard_GUID kGroupAttributeGroupID("df64ea4c-fc42-4bf8-ad7e-08f7a54bf1b8");
static const Standard_GUID kGroupAttributeID("ebdcb22a-e045-455b-9a7f-cfd38d68e185");
+// id of attribute to store the version of the feature
+static const Standard_GUID kVERSION_ID("61cdb78a-1ba7-4942-976f-63bea7f4a2b1");
+
Model_Data::Model_Data() : mySendAttributeUpdated(true), myWasChangedButBlocked(false)
{
return shapeLab().IsAttribute(kUSER_DEFINED_NAME);
}
+std::string Model_Data::version()
+{
+ Handle(TDataStd_Name) aVersionAttr;
+ std::string aVersion;
+ if (shapeLab().FindAttribute(kVERSION_ID, aVersionAttr))
+ aVersion = TCollection_AsciiString(aVersionAttr->Get()).ToCString();
+ return aVersion;
+}
+
+void Model_Data::setVersion(const std::string& theVersion)
+{
+ Handle(TDataStd_Name) aVersionAttr;
+ std::string aVersion;
+ if (!shapeLab().FindAttribute(kVERSION_ID, aVersionAttr))
+ aVersionAttr = TDataStd_Name::Set(shapeLab(), kVERSION_ID, TCollection_ExtendedString());
+ aVersionAttr->Set(theVersion.c_str());
+}
+
AttributePtr Model_Data::addAttribute(
const std::string& theID, const std::string theAttrType, const int theIndex)
{
MODEL_EXPORT virtual void setName(const std::string& theName);
/// Return \c true if the object has been renamed by the user
MODEL_EXPORT virtual bool hasUserDefinedName() const;
+ /// Returns version of the feature (empty string if not applicable)
+ MODEL_EXPORT virtual std::string version();
+ /// Initialize the version of the feature
+ MODEL_EXPORT virtual void setVersion(const std::string& theVersion);
/// Returns the attribute that references to another document
MODEL_EXPORT virtual std::shared_ptr<ModelAPI_AttributeDocRef> document(const std::string& theID);
/// Returns the attribute that contains real value with double precision
/// Return \c true if the object has been renamed by the user
virtual bool hasUserDefinedName() const = 0;
+ /// Returns version of the feature (empty string if not applicable)
+ virtual std::string version() = 0;
+ /// Initialize the version of the feature
+ virtual void setVersion(const std::string& theVersion) = 0;
+
/// Returns the attribute that references to another document
virtual std::shared_ptr<ModelAPI_AttributeDocRef> document(const std::string& theID) = 0;
/// Returns the attribute that contains real value with double precision
--- /dev/null
+# Copyright (C) 2020 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+if __name__ == "__main__":
+ aPartFeature = locals()["Part_1"]
+ model.testNbResults(aPartFeature, 1)
+ model.testNbSubResults(aPartFeature, [0])
+ model.testNbSubShapes(aPartFeature, GeomAPI_Shape.SOLID, [2])
+ model.testNbSubShapes(aPartFeature, GeomAPI_Shape.FACE, [16])
+ model.testNbSubShapes(aPartFeature, GeomAPI_Shape.EDGE, [74])
+ model.testNbSubShapes(aPartFeature, GeomAPI_Shape.VERTEX, [148])
+ model.testResultsVolumes(aPartFeature, [23407.60956])
+
+ aPartFeature = locals()["Part_2"]
+ model.testNbResults(aPartFeature, 1)
+ model.testNbSubResults(aPartFeature, [0])
+ model.testNbSubShapes(aPartFeature, GeomAPI_Shape.SOLID, [3])
+ model.testNbSubShapes(aPartFeature, GeomAPI_Shape.FACE, [19])
+ model.testNbSubShapes(aPartFeature, GeomAPI_Shape.EDGE, [80])
+ model.testNbSubShapes(aPartFeature, GeomAPI_Shape.VERTEX, [160])
+ model.testResultsVolumes(aPartFeature, [39403.873983562])