Tulip  4.7.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
tlp::GlLayer Class Reference

#include <GlLayer.h>

Public Member Functions

 GlLayer (const std::string &name, bool workingLayer=false)
 
 GlLayer (const std::string &name, Camera *camera, bool workingLayer=false)
 
 ~GlLayer ()
 
void addGlEntity (GlSimpleEntity *entity, const std::string &name)
 
void addGraph (tlp::Graph *graph, const std::string &name)
 
void clear ()
 
void deleteGlEntity (const std::string &key)
 
void deleteGlEntity (GlSimpleEntity *entity)
 
GlSimpleEntityfindGlEntity (const std::string &key)
 
CameragetCamera ()
 
GlCompositegetComposite ()
 
const std::map< std::string,
GlSimpleEntity * > & 
getGlEntities () const
 
std::string getName ()
 
GlScenegetScene ()
 
void getXML (std::string &outString)
 
void getXMLOnlyForCameras (std::string &outString)
 
bool isAWorkingLayer ()
 
bool isVisible ()
 
void set2DMode ()
 
void setCamera (Camera *camera)
 
void setSharedCamera (Camera *camera)
 
void setVisible (bool visible)
 
void setWithXML (const std::string &inString, unsigned int &currentPosition)
 
bool useSharedCamera ()
 

Protected Member Functions

void setScene (GlScene *scene)
 

Friends

class GlScene
 

Detailed Description

A GlLayer is like an 2D drawing software layer system.

A layer is an entity with a Camera and a GlComposite to store GlEntity Layers are used with GlScene : you can add a layer to a scene and a scene can have many layers

See Also
Camera
GlComposite
GlSimpleEntity
GlScene

You have two constructor for GlLayer : one with a camera pointer and one without The constructor without camera pointer create a layer with a new camera and delete this camera at the destruction The constructor with camera pointer create a layer and use the camera pointer but you have the responsibility of camera destruction

After you have created a layer, you can populate the layer with GlEntity and addGlEntity() functions

Examples:
graph_display/graph_display.cpp.

Definition at line 51 of file GlLayer.h.

Constructor & Destructor Documentation

tlp::GlLayer::GlLayer ( const std::string &  name,
bool  workingLayer = false 
)

Layer constructor : construct a layer with his name A new camera is created for this layer and this camera will be deleted in the GlLayer destructor.

Parameters
namelayer name
workingLayera working layer is not displayed on overview
tlp::GlLayer::GlLayer ( const std::string &  name,
Camera camera,
bool  workingLayer = false 
)

Layer constructor : construct a layer with his name and use the camera : camera You have the responsibility of camera destruction.

Parameters
namelayer name
cameracamera to use in this layer
workingLayera working layer is not displayed on overview
tlp::GlLayer::~GlLayer ( )

Destructor.

Member Function Documentation

void tlp::GlLayer::addGlEntity ( GlSimpleEntity entity,
const std::string &  name 
)

Add an entity to GlComposite of the layer.

void tlp::GlLayer::addGraph ( tlp::Graph graph,
const std::string &  name 
)

A Convienience function that adds a graph to the layer.

This method will automatically create a GlGraphComposite entity and add it to the layer.

Examples:
graph_display/graph_display.cpp.
void tlp::GlLayer::clear ( )
inline

Remove all entities of the layer Entities are not deleted so before call this function you have to get the entities list and you have the responsibility of entities destruction.

Definition at line 173 of file GlLayer.h.

void tlp::GlLayer::deleteGlEntity ( const std::string &  key)

Remove entity with name : key This entity is not deleted.

void tlp::GlLayer::deleteGlEntity ( GlSimpleEntity entity)

Remove entity This entity is not deleted.

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

Return entity with name : key.

Camera& tlp::GlLayer::getCamera ( )
inline

Return the layer's camera.

Definition at line 111 of file GlLayer.h.

GlComposite* tlp::GlLayer::getComposite ( )
inline

Return the GlComposite used by the layer A GlLayer is only a container of a camera and a composite, so to manipulate GlEntity on this layer you can get the GlComposite and add/remove entities on this composite.

Definition at line 165 of file GlLayer.h.

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

Return the map of layer's entities.

std::string tlp::GlLayer::getName ( )
inline

Return the layer's name.

Definition at line 87 of file GlLayer.h.

GlScene* tlp::GlLayer::getScene ( )
inline

Return the scene where the layer is.

Definition at line 80 of file GlLayer.h.

void tlp::GlLayer::getXML ( std::string &  outString)

Get XML description of the layer and children and store it in out string

void tlp::GlLayer::getXMLOnlyForCameras ( std::string &  outString)

Get XML description of cameras of the layer and store it in out string.

bool tlp::GlLayer::isAWorkingLayer ( )
inline

Return if this layer is a working layer A working layer is not displayed on overview.

Definition at line 181 of file GlLayer.h.

bool tlp::GlLayer::isVisible ( )
inline

Return if the layer is visible.

Definition at line 123 of file GlLayer.h.

void tlp::GlLayer::set2DMode ( )

Replace the layer's camera with a new 2D one.

void tlp::GlLayer::setCamera ( Camera camera)

Set the layer's camera GlLayer now use a copy of the camera parameters.

void tlp::GlLayer::setScene ( GlScene scene)
protected

Set the scene where the layer is

void tlp::GlLayer::setSharedCamera ( Camera camera)

Set the layer's camera GlLayer now use camera parameters and you have the resposibility of camera destruction

void tlp::GlLayer::setVisible ( bool  visible)

Set if the layer is visible.

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

Function to set data with inString (in XML format)

bool tlp::GlLayer::useSharedCamera ( )
inline

Return if this layer use a shared camera A shared camera is a camera used by more than one Layer, so if this layer use a shared camera we don't have to delete it when the layer is destroyed.

Definition at line 189 of file GlLayer.h.