//=================================================================================================
void FeaturesPlugin_Intersection::initAttributes()
{
- data()->addAttribute(FeaturesPlugin_Intersection::OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
- data()->addAttribute(FeaturesPlugin_Intersection::TOOL_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
+ data()->addAttribute(FeaturesPlugin_Intersection::OBJECT_LIST_ID(),
+ ModelAPI_AttributeSelectionList::typeId());
+ data()->addAttribute(FeaturesPlugin_Intersection::TOOL_LIST_ID(),
+ ModelAPI_AttributeSelectionList::typeId());
}
//=================================================================================================
ListOfShape anObjects, aTools;
// Getting objects.
- AttributeSelectionListPtr anObjectsSelList = selectionList(FeaturesPlugin_Intersection::OBJECT_LIST_ID());
+ AttributeSelectionListPtr anObjectsSelList =
+ selectionList(FeaturesPlugin_Intersection::OBJECT_LIST_ID());
for (int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) {
- std::shared_ptr<ModelAPI_AttributeSelection> anObjectAttr = anObjectsSelList->value(anObjectsIndex);
+ std::shared_ptr<ModelAPI_AttributeSelection> anObjectAttr =
+ anObjectsSelList->value(anObjectsIndex);
std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
if (!anObject.get()) {
return;
}
// Getting tools.
- AttributeSelectionListPtr aToolsSelList = selectionList(FeaturesPlugin_Intersection::TOOL_LIST_ID());
+ AttributeSelectionListPtr aToolsSelList =
+ selectionList(FeaturesPlugin_Intersection::TOOL_LIST_ID());
for (int aToolsIndex = 0; aToolsIndex < aToolsSelList->size(); aToolsIndex++) {
std::shared_ptr<ModelAPI_AttributeSelection> aToolAttr = aToolsSelList->value(aToolsIndex);
std::shared_ptr<GeomAPI_Shape> aTool = aToolAttr->value();
int aResultIndex = 0;
// Create result for each object.
- for (ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end(); anObjectsIt++) {
+ for (ListOfShape::iterator
+ anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end(); anObjectsIt++) {
std::shared_ptr<GeomAPI_Shape> anObject = *anObjectsIt;
ListOfShape aListWithObject; aListWithObject.push_back(anObject);
GeomAlgoAPI_Intersection anIntersectionAlgo(aListWithObject, aTools);
std::shared_ptr<GeomAPI_Shape> aResultShape = theMakeShape.shape();
std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMapOfShapes = theMakeShape.mapOfSubShapes();
const int aDeletedTag = 1;
- const int aSubsolidsTag = 2; /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids
+ /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids
+ const int aSubsolidsTag = 2;
const int aModifyTag = 100000;
int aModifyToolsTag = 200000;
std::ostringstream aStream;
aStream.clear();
aStream << aModName << "_" << anIndex++;
theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, GeomAPI_Shape::VERTEX,
- aModifyToolsTag, aStream.str(), *aMapOfShapes.get(), true);
+ aModifyToolsTag, aStream.str(), *aMapOfShapes.get(), true);
theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, GeomAPI_Shape::EDGE,
- aModifyToolsTag, aStream.str(), *aMapOfShapes.get(), true);
+ aModifyToolsTag, aStream.str(), *aMapOfShapes.get(), true);
theResultBody->loadDeletedShapes(&theMakeShape, *anIter, GeomAPI_Shape::FACE, aDeletedTag);
aModifyToolsTag += 10000;
}