1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModelAPI_ResultBody.cpp
4 // Created: 07 Jul 2014
5 // Author: Mikhail PONIKAROV
7 #include "ModelAPI_ResultBody.h"
8 #include <ModelAPI_BodyBuilder.h>
9 #include <Events_Loop.h>
10 #include <ModelAPI_Events.h>
12 ModelAPI_ResultBody::ModelAPI_ResultBody()
17 ModelAPI_ResultBody::~ModelAPI_ResultBody()
23 std::string ModelAPI_ResultBody::groupName()
28 void ModelAPI_ResultBody::store(const std::shared_ptr<GeomAPI_Shape>& theShape,
29 const bool theIsStoreSameShapes)
31 myBuilder->store(theShape, theIsStoreSameShapes);
33 static Events_Loop* aLoop = Events_Loop::loop();
34 static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
35 static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
36 aECreator->sendUpdated(data()->owner(), aRedispEvent);
39 void ModelAPI_ResultBody::storeGenerated(const std::shared_ptr<GeomAPI_Shape>& theFromShape,
40 const std::shared_ptr<GeomAPI_Shape>& theToShape)
42 myBuilder->storeGenerated(theFromShape, theToShape);
44 static Events_Loop* aLoop = Events_Loop::loop();
45 static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
46 static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
47 aECreator->sendUpdated(data()->owner(), aRedispEvent);
50 void ModelAPI_ResultBody::storeModified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
51 const std::shared_ptr<GeomAPI_Shape>& theNewShape,
52 const int theDecomposeSolidsTag)
54 myBuilder->storeModified(theOldShape, theNewShape, theDecomposeSolidsTag);
56 static Events_Loop* aLoop = Events_Loop::loop();
57 static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
58 static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
59 aECreator->sendUpdated(data()->owner(), aRedispEvent);
62 void ModelAPI_ResultBody::storeWithoutNaming(const std::shared_ptr<GeomAPI_Shape>& theShape)
64 myBuilder->storeWithoutNaming(theShape);
66 static Events_Loop* aLoop = Events_Loop::loop();
67 static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
68 static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
69 aECreator->sendUpdated(data()->owner(), aRedispEvent);
72 std::shared_ptr<GeomAPI_Shape> ModelAPI_ResultBody::shape()
74 return myBuilder->shape();
77 void ModelAPI_ResultBody::generated(const std::shared_ptr<GeomAPI_Shape>& theNewShape,
78 const std::string& theName, const int theTag)
80 myBuilder->generated(theNewShape, theName, theTag);
83 void ModelAPI_ResultBody::generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
84 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName,
87 myBuilder->generated(theOldShape, theNewShape, theName, theTag);
90 void ModelAPI_ResultBody::modified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
91 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName,
94 myBuilder->modified(theOldShape, theNewShape, theName, theTag);
98 void ModelAPI_ResultBody::deleted(
99 const std::shared_ptr<GeomAPI_Shape>& theOldShape, const int theTag)
101 myBuilder->deleted(theOldShape, theTag);
104 void ModelAPI_ResultBody::loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS,
105 std::shared_ptr<GeomAPI_Shape> theShapeIn,
106 const int theKindOfShape,
109 myBuilder->loadDeletedShapes(theMS, theShapeIn, theKindOfShape, theTag);
112 void ModelAPI_ResultBody::loadAndOrientModifiedShapes (GeomAlgoAPI_MakeShape* theMS,
113 std::shared_ptr<GeomAPI_Shape> theShapeIn, const int theKindOfShape, const int theTag,
114 const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes, const bool theIsStoreSeparate)
116 myBuilder->loadAndOrientModifiedShapes(
117 theMS, theShapeIn, theKindOfShape, theTag, theName, theSubShapes, theIsStoreSeparate);
120 void ModelAPI_ResultBody::loadAndOrientGeneratedShapes (GeomAlgoAPI_MakeShape* theMS,
121 std::shared_ptr<GeomAPI_Shape> theShapeIn, const int theKindOfShape,
122 const int theTag, const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes)
124 myBuilder->loadAndOrientGeneratedShapes(
125 theMS, theShapeIn, theKindOfShape, theTag, theName, theSubShapes);
128 void ModelAPI_ResultBody::loadFirstLevel(std::shared_ptr<GeomAPI_Shape> theShape,
129 const std::string& theName, int& theTag)
131 myBuilder->loadFirstLevel(theShape, theName, theTag);
134 void ModelAPI_ResultBody::loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape,
135 const std::string& theName, int& theTag)
137 myBuilder->loadDisconnectedEdges(theShape, theName, theTag);
140 void ModelAPI_ResultBody::loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape,
141 const std::string& theName,int& theTag)
143 myBuilder->loadDisconnectedVertexes(theShape, theName, theTag);