Added flag to Model_BodyBuilder::loadAndOrientModifiedShapes to store modified shapes as generated. It is used to avoid problem when one shapes produce several shapes and they can be distinguished by neighborhoods.
const int theTag,
const std::string& theName,
GeomAPI_DataMapOfShapeShape& theSubShapes,
- const bool theIsStoreSeparate)
+ const bool theIsStoreSeparate,
+ const bool theIsStoreAsGenerated)
{
int anIndex = 1;
int aTag = theTag;
GeomShapePtr aGeomNewShape(new GeomAPI_Shape());
aGeomNewShape->setImpl(new TopoDS_Shape(aNewShape));
if(!aRoot.IsSame(aNewShape) && aResultShape->isSubShape(aGeomNewShape)) {
- builder(aTag)->Modify(aRoot,aNewShape);
+ if(theIsStoreAsGenerated) {
+ // Here we store shapes as generated, to avoid problem when one parent shape produce
+ // several child shapes. In this case naming could not determine which shape to select.
+ builder(aTag)->Generated(aRoot,aNewShape);
+ } else {
+ builder(aTag)->Modify(aRoot,aNewShape);
+ }
if(isBuilt) {
if(theIsStoreSeparate) {
aStream.str(std::string());
const int theTag,
const std::string& theName,
GeomAPI_DataMapOfShapeShape& theSubShapes,
- const bool theIsStoreSeparate = false);
+ const bool theIsStoreSeparate = false,
+ const bool theIsStoreAsGenerated = false);
/// load and orient generated shapes
MODEL_EXPORT virtual void loadAndOrientGeneratedShapes (
GeomAlgoAPI_MakeShape* theMS,
const int theTag,
const std::string& theName,
GeomAPI_DataMapOfShapeShape& theSubShapes,
- const bool theIsStoreSeparate = false) = 0;
+ const bool theIsStoreSeparate = false,
+ const bool theIsStoreAsGenerated = false) = 0;
/// load and orient generated shapes
virtual void loadAndOrientGeneratedShapes (
GeomAlgoAPI_MakeShape* theMS,
void ModelAPI_ResultBody::loadAndOrientModifiedShapes (GeomAlgoAPI_MakeShape* theMS,
std::shared_ptr<GeomAPI_Shape> theShapeIn, const int theKindOfShape, const int theTag,
const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes,
- const bool theIsStoreSeparate)
+ const bool theIsStoreSeparate,
+ const bool theIsStoreAsGenerated)
{
myBuilder->loadAndOrientModifiedShapes(
- theMS, theShapeIn, theKindOfShape, theTag, theName, theSubShapes, theIsStoreSeparate);
+ theMS, theShapeIn, theKindOfShape, theTag, theName, theSubShapes, theIsStoreSeparate,
+ theIsStoreAsGenerated);
}
void ModelAPI_ResultBody::loadAndOrientGeneratedShapes (GeomAlgoAPI_MakeShape* theMS,
MODELAPI_EXPORT virtual void loadAndOrientModifiedShapes (GeomAlgoAPI_MakeShape* theMS,
std::shared_ptr<GeomAPI_Shape> theShapeIn, const int theKindOfShape, const int theTag,
const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes,
- const bool theIsStoreSeparate = false);
+ const bool theIsStoreSeparate = false,
+ const bool theIsStoreAsGenerated = false);
/// load and orient generated shapes
MODELAPI_EXPORT virtual void loadAndOrientGeneratedShapes (GeomAlgoAPI_MakeShape* theMS,
std::shared_ptr<GeomAPI_Shape> theShapeIn, const int theKindOfShape,