27 #include <tulip/GlSimpleEntity.h>
28 #include <tulip/tulipconf.h>
101 this->stencil = stencil;
103 for (std::list<GlSimpleEntity *>::iterator it = _sortedElements.begin();
104 it != _sortedElements.end(); ++it) {
105 (*it)->setStencil(stencil);
113 this->deleteComponentsInDestructor = deleteComponentsInDestructor;
124 void getXML(std::string &outString)
override;
129 void setWithXML(
const std::string &inString,
unsigned int ¤tPosition)
override;
136 void acceptVisitor(GlSceneVisitor *visitor)
override {
138 for (
auto entity : _sortedElements) {
139 if (entity->isVisible()) {
144 if (!composite && !entity->getBoundingBox().isValid()) {
145 for (
auto &itE : elements) {
146 if (itE.second == entity) {
147 tlp::warning() <<
"Invalid bounding box for entity: " << itE.first << std::endl;
155 entity->acceptVisitor(visitor);
163 virtual void addLayerParent(GlLayer *layer);
168 virtual void removeLayerParent(GlLayer *layer);
173 void notifyModified(GlSimpleEntity *entity);
179 void draw(
float, Camera *)
override {}
184 std::map<std::string, GlSimpleEntity *> elements;
185 std::list<GlSimpleEntity *>
187 std::vector<GlLayer *> layerParents;
188 bool deleteComponentsInDestructor;
GlSimpleEntity used to aggregate other GlEntity.
void deleteGlEntity(const std::string &key, bool informTheEntity=true)
Remove entity with name : key.
~GlComposite() override
Destructor.
std::string findKey(GlSimpleEntity *entity)
Find name of given entity.
void getXML(std::string &outString) override
Function to export data in outString (in XML format)
GlSimpleEntity * findGlEntity(const std::string &key)
Find entity with name : key.
void reset(bool deleteElems)
Clear the composite.
const std::map< std::string, GlSimpleEntity * > & getGlEntities() const
Return map of entities in composite.
void setDeleteComponentsInDestructor(bool deleteComponentsInDestructor)
Set if at the destruction of composite, components well be deleted.
void deleteGlEntity(GlSimpleEntity *entity, bool informTheEntity=true)
Remove given entity.
void setWithXML(const std::string &inString, unsigned int ¤tPosition) override
Function to set data with inString (in XML format)
void translate(const Coord &mouvement) override
translate the composite with children
GlComposite(bool deleteComponentsInDestructor=true)
Constructor.
void addGlEntity(GlSimpleEntity *entity, const std::string &key)
Add new entity with name : key.
void setStencil(int stencil) override
Set stencil number for all composite's children.
Base class for all Tulip OpenGL entities.