X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_ResultBody.cpp;h=e5f023f11c46af0cfd20166a1094dd9af6060b62;hb=423f6b0a08a86d5e47115b87603cddeae4468b49;hp=bcdc0bcb59442dbc1114e7b02d77184e8b160c52;hpb=34afe547352180006fee9600173c4dc93dc1f6c3;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_ResultBody.cpp b/src/ModelAPI/ModelAPI_ResultBody.cpp index bcdc0bcb5..e5f023f11 100644 --- a/src/ModelAPI/ModelAPI_ResultBody.cpp +++ b/src/ModelAPI/ModelAPI_ResultBody.cpp @@ -12,6 +12,7 @@ ModelAPI_ResultBody::ModelAPI_ResultBody() : myBuilder(0) { + myConnect = ConnectionNotComputed; } ModelAPI_ResultBody::~ModelAPI_ResultBody() @@ -25,9 +26,11 @@ std::string ModelAPI_ResultBody::groupName() return group(); } -void ModelAPI_ResultBody::store(const std::shared_ptr& theShape) +void ModelAPI_ResultBody::store(const std::shared_ptr& theShape, + const bool theIsStoreSameShapes) { - myBuilder->store(theShape); + myBuilder->store(theShape, theIsStoreSameShapes); + myConnect = ConnectionNotComputed; static Events_Loop* aLoop = Events_Loop::loop(); static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY); @@ -39,6 +42,7 @@ void ModelAPI_ResultBody::storeGenerated(const std::shared_ptr& t const std::shared_ptr& theToShape) { myBuilder->storeGenerated(theFromShape, theToShape); + myConnect = ConnectionNotComputed; static Events_Loop* aLoop = Events_Loop::loop(); static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY); @@ -51,6 +55,7 @@ void ModelAPI_ResultBody::storeModified(const std::shared_ptr& th const int theDecomposeSolidsTag) { myBuilder->storeModified(theOldShape, theNewShape, theDecomposeSolidsTag); + myConnect = ConnectionNotComputed; static Events_Loop* aLoop = Events_Loop::loop(); static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY); @@ -61,6 +66,7 @@ void ModelAPI_ResultBody::storeModified(const std::shared_ptr& th void ModelAPI_ResultBody::storeWithoutNaming(const std::shared_ptr& theShape) { myBuilder->storeWithoutNaming(theShape); + myConnect = ConnectionNotComputed; static Events_Loop* aLoop = Events_Loop::loop(); static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY); @@ -80,7 +86,7 @@ void ModelAPI_ResultBody::generated(const std::shared_ptr& theNew } void ModelAPI_ResultBody::generated(const std::shared_ptr& theOldShape, - const std::shared_ptr& theNewShape, const std::string& theName, + const std::shared_ptr& theNewShape, const std::string& theName, const int theTag) { myBuilder->generated(theOldShape, theNewShape, theName, theTag); @@ -99,7 +105,7 @@ void ModelAPI_ResultBody::deleted( { myBuilder->deleted(theOldShape, theTag); } - + void ModelAPI_ResultBody::loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS, std::shared_ptr theShapeIn, const int theKindOfShape, @@ -110,7 +116,8 @@ void ModelAPI_ResultBody::loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS, void ModelAPI_ResultBody::loadAndOrientModifiedShapes (GeomAlgoAPI_MakeShape* theMS, std::shared_ptr theShapeIn, const int theKindOfShape, const int theTag, - const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes, const bool theIsStoreSeparate) + const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes, + const bool theIsStoreSeparate) { myBuilder->loadAndOrientModifiedShapes( theMS, theShapeIn, theKindOfShape, theTag, theName, theSubShapes, theIsStoreSeparate); @@ -124,7 +131,7 @@ void ModelAPI_ResultBody::loadAndOrientGeneratedShapes (GeomAlgoAPI_MakeShape* t theMS, theShapeIn, theKindOfShape, theTag, theName, theSubShapes); } -void ModelAPI_ResultBody::loadFirstLevel(std::shared_ptr theShape, +void ModelAPI_ResultBody::loadFirstLevel(std::shared_ptr theShape, const std::string& theName, int& theTag) { myBuilder->loadFirstLevel(theShape, theName, theTag); @@ -141,3 +148,11 @@ void ModelAPI_ResultBody::loadDisconnectedVertexes(std::shared_ptrloadDisconnectedVertexes(theShape, theName, theTag); } + +bool ModelAPI_ResultBody::isConnectedTopology() +{ + if (myConnect == ConnectionNotComputed) { + myConnect = shape()->isConnectedTopology() ? IsConnected : IsNotConnected; + } + return myConnect == IsConnected; +}