Tulip 6.1.0
Large graphs analysis and drawing
Loading...
Searching...
No Matches
tlp::GlComposite Class Reference

#include <GlComposite.h>

Inheritance diagram for tlp::GlComposite:
Collaboration diagram for tlp::GlComposite:

Public Member Functions

 GlComposite (bool deleteComponentsInDestructor=true)
 ~GlComposite () override
void addGlEntity (GlSimpleEntity *entity, const std::string &key)
void deleteGlEntity (const std::string &key, bool informTheEntity=true)
void deleteGlEntity (GlSimpleEntity *entity, bool informTheEntity=true)
GlSimpleEntity * findGlEntity (const std::string &key)
std::string findKey (GlSimpleEntity *entity)
const std::map< std::string, GlSimpleEntity * > & getGlEntities () const
void getXML (std::string &outString) override
void reset (bool deleteElems)
void setDeleteComponentsInDestructor (bool deleteComponentsInDestructor)
void setStencil (int stencil) override
void setWithXML (const std::string &inString, unsigned int &currentPosition) override
void translate (const Coord &mouvement) override
Public Member Functions inherited from tlp::GlSimpleEntity
 GlSimpleEntity ()
 ~GlSimpleEntity () override
virtual void draw (float lod, Camera *camera)=0
virtual BoundingBox getBoundingBox ()
int getStencil ()
bool isVisible () const
virtual void setVisible (bool visible)

Protected Attributes

std::list< GlSimpleEntity * > _sortedElements
bool deleteComponentsInDestructor
std::map< std::string, GlSimpleEntity * > elements
std::vector< GlLayer * > layerParents
Protected Attributes inherited from tlp::GlSimpleEntity
BoundingBox boundingBox
std::vector< GlComposite * > parents
int stencil
bool visible

Detailed Description

GlSimpleEntity used to aggregate other GlEntity.

This class provide basic container to manage other GlEntity

See also
GlSimpleEntity

Definition at line 39 of file GlComposite.h.

Constructor & Destructor Documentation

◆ GlComposite()

tlp::GlComposite::GlComposite ( bool deleteComponentsInDestructor = true)

Constructor.

Parameters
deleteComponentsInDestructorif true : call delete on components when the GlComposite is delete
Here is the caller graph for this function:

◆ ~GlComposite()

tlp::GlComposite::~GlComposite ( )
override

Destructor.

Member Function Documentation

◆ addGlEntity()

void tlp::GlComposite::addGlEntity ( GlSimpleEntity * entity,
const std::string & key )

Add new entity with name : key.

The composite does not takes the entity's ownership, i.e. it is not its responsibility to delete it.

Here is the call graph for this function:

◆ deleteGlEntity() [1/2]

void tlp::GlComposite::deleteGlEntity ( const std::string & key,
bool informTheEntity = true )

Remove entity with name : key.

The entity is not deleted

◆ deleteGlEntity() [2/2]

void tlp::GlComposite::deleteGlEntity ( GlSimpleEntity * entity,
bool informTheEntity = true )

Remove given entity.

The entity is not deleted

Here is the call graph for this function:

◆ findGlEntity()

GlSimpleEntity * tlp::GlComposite::findGlEntity ( const std::string & key)

Find entity with name : key.

Here is the call graph for this function:

◆ findKey()

std::string tlp::GlComposite::findKey ( GlSimpleEntity * entity)

Find name of given entity.

Here is the call graph for this function:

◆ getGlEntities()

const std::map< std::string, GlSimpleEntity * > & tlp::GlComposite::getGlEntities ( ) const
inline

Return map of entities in composite.

Definition at line 90 of file GlComposite.h.

◆ getXML()

void tlp::GlComposite::getXML ( std::string & outString)
overridevirtual

Function to export data in outString (in XML format).

Implements tlp::GlSimpleEntity.

Reimplemented in tlp::GlGraphComposite.

◆ reset()

void tlp::GlComposite::reset ( bool deleteElems)

Clear the composite.

If deleteElems is true, composite's entities are delete

◆ setDeleteComponentsInDestructor()

void tlp::GlComposite::setDeleteComponentsInDestructor ( bool deleteComponentsInDestructor)
inline

Set if at the destruction of composite, components well be deleted.

Definition at line 112 of file GlComposite.h.

◆ setStencil()

void tlp::GlComposite::setStencil ( int stencil)
inlineoverridevirtual

Set stencil number for all composite's children.

For more information on stencil :

See also
GlSimpleEntity

Reimplemented from tlp::GlSimpleEntity.

Definition at line 100 of file GlComposite.h.

◆ setWithXML()

void tlp::GlComposite::setWithXML ( const std::string & inString,
unsigned int & currentPosition )
overridevirtual

Function to set data with inString (in XML format).

Implements tlp::GlSimpleEntity.

Reimplemented in tlp::GlGraphComposite.

Here is the call graph for this function:

◆ translate()

void tlp::GlComposite::translate ( const Coord & mouvement)
override

translate the composite with children

Member Data Documentation

◆ _sortedElements

std::list<GlSimpleEntity *> tlp::GlComposite::_sortedElements
protected

Definition at line 186 of file GlComposite.h.

◆ deleteComponentsInDestructor

bool tlp::GlComposite::deleteComponentsInDestructor
protected

Definition at line 188 of file GlComposite.h.

◆ elements

std::map<std::string, GlSimpleEntity *> tlp::GlComposite::elements
protected

Definition at line 184 of file GlComposite.h.

◆ layerParents

std::vector<GlLayer *> tlp::GlComposite::layerParents
protected

Definition at line 187 of file GlComposite.h.