Tulip
4.7.0
Better Visualization Through Research
|
#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) |
GlSimpleEntity * | findGlEntity (const std::string &key) |
Camera & | getCamera () |
GlComposite * | getComposite () |
const std::map< std::string, GlSimpleEntity * > & | getGlEntities () const |
std::string | getName () |
GlScene * | getScene () |
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 ¤tPosition) |
bool | useSharedCamera () |
Protected Member Functions | |
void | setScene (GlScene *scene) |
Friends | |
class | GlScene |
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
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
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.
name | layer name |
workingLayer | a 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.
name | layer name |
camera | camera to use in this layer |
workingLayer | a working layer is not displayed on overview |
tlp::GlLayer::~GlLayer | ( | ) |
Destructor.
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.
|
inline |
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.
|
inline |
|
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.
const std::map<std::string, GlSimpleEntity*>& tlp::GlLayer::getGlEntities | ( | ) | const |
Return the map of layer's entities.
|
inline |
|
inline |
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.
|
inline |
|
inline |
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.
|
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)