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)
30 myBuilder->store(theShape);
32 static Events_Loop* aLoop = Events_Loop::loop();
33 static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
34 static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
35 aECreator->sendUpdated(data()->owner(), aRedispEvent);
38 void ModelAPI_ResultBody::storeGenerated(const std::shared_ptr<GeomAPI_Shape>& theFromShape,
39 const std::shared_ptr<GeomAPI_Shape>& theToShape)
41 myBuilder->storeGenerated(theFromShape, theToShape);
43 static Events_Loop* aLoop = Events_Loop::loop();
44 static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
45 static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
46 aECreator->sendUpdated(data()->owner(), aRedispEvent);
49 void ModelAPI_ResultBody::storeModified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
50 const std::shared_ptr<GeomAPI_Shape>& theNewShape,
51 const int theDecomposeSolidsTag)
53 myBuilder->storeModified(theOldShape, theNewShape, theDecomposeSolidsTag);
55 static Events_Loop* aLoop = Events_Loop::loop();
56 static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
57 static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
58 aECreator->sendUpdated(data()->owner(), aRedispEvent);
61 void ModelAPI_ResultBody::storeWithoutNaming(const std::shared_ptr<GeomAPI_Shape>& theShape)
63 myBuilder->storeWithoutNaming(theShape);
65 static Events_Loop* aLoop = Events_Loop::loop();
66 static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
67 static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
68 aECreator->sendUpdated(data()->owner(), aRedispEvent);
71 std::shared_ptr<GeomAPI_Shape> ModelAPI_ResultBody::shape()
73 return myBuilder->shape();
76 void ModelAPI_ResultBody::generated(const std::shared_ptr<GeomAPI_Shape>& theNewShape,
77 const std::string& theName, const int theTag)
79 myBuilder->generated(theNewShape, theName, theTag);
82 void ModelAPI_ResultBody::generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
83 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName,
86 myBuilder->generated(theOldShape, theNewShape, theName, theTag);
89 void ModelAPI_ResultBody::modified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
90 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName,
93 myBuilder->modified(theOldShape, theNewShape, theName, theTag);
97 void ModelAPI_ResultBody::deleted(
98 const std::shared_ptr<GeomAPI_Shape>& theOldShape, const int theTag)
100 myBuilder->deleted(theOldShape, theTag);
103 void ModelAPI_ResultBody::loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS,
104 std::shared_ptr<GeomAPI_Shape> theShapeIn,
105 const int theKindOfShape,
108 myBuilder->loadDeletedShapes(theMS, theShapeIn, theKindOfShape, theTag);
111 void ModelAPI_ResultBody::loadAndOrientModifiedShapes (GeomAlgoAPI_MakeShape* theMS,
112 std::shared_ptr<GeomAPI_Shape> theShapeIn, const int theKindOfShape, const int theTag,
113 const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes)
115 myBuilder->loadAndOrientModifiedShapes(
116 theMS, theShapeIn, theKindOfShape, theTag, theName, theSubShapes);
119 void ModelAPI_ResultBody::loadAndOrientGeneratedShapes (GeomAlgoAPI_MakeShape* theMS,
120 std::shared_ptr<GeomAPI_Shape> theShapeIn, const int theKindOfShape,
121 const int theTag, const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes)
123 myBuilder->loadAndOrientGeneratedShapes(
124 theMS, theShapeIn, theKindOfShape, theTag, theName, theSubShapes);
127 void ModelAPI_ResultBody::loadFirstLevel(std::shared_ptr<GeomAPI_Shape> theShape,
128 const std::string& theName, int& theTag)
130 myBuilder->loadFirstLevel(theShape, theName, theTag);
133 void ModelAPI_ResultBody::loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape,
134 const std::string& theName, int& theTag)
136 myBuilder->loadDisconnectedEdges(theShape, theName, theTag);
139 void ModelAPI_ResultBody::loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape,
140 const std::string& theName,int& theTag)
142 myBuilder->loadDisconnectedVertexes(theShape, theName, theTag);