Tulip 6.1.0
Large graphs analysis and drawing
Loading...
Searching...
No Matches
tlp::GlGraphRenderer Class Referenceabstract

#include <GlGraphRenderer.h>

Public Member Functions

 GlGraphRenderer (const GlGraphInputData *inputData)
virtual ~GlGraphRenderer ()
virtual void draw (float lod, Camera *camera)=0
virtual void selectEntities (Camera *camera, RenderingEntitiesFlag type, int x, int y, int w, int h, std::vector< SelectedEntity > &selectedEntities)=0
void setGraphModified (bool graphModified)
virtual void visitGraph (GlSceneVisitor *visitor, bool visitHiddenEntities=false)

Protected Member Functions

void visitEdges (Graph *graph, GlSceneVisitor *visitor)
void visitNodes (Graph *graph, GlSceneVisitor *visitor)

Protected Attributes

bool graphModified
const GlGraphInputData * inputData
unsigned int * selectionCurrentId
bool selectionDrawActivate
tlp_hash_map< unsigned int, SelectedEntity > * selectionIdMap
RenderingEntitiesFlag selectionType

Detailed Description

Class used by GlGraphComposite to render the graph in OpenGL.

To create a graph renderer, you have to implement two functions : draw() and selectEntities()

See also
GlGraphComposite

Definition at line 41 of file GlGraphRenderer.h.

Constructor & Destructor Documentation

◆ GlGraphRenderer()

tlp::GlGraphRenderer::GlGraphRenderer ( const GlGraphInputData * inputData)

Constructor.

Parameters
inputData: GlGraphInputData used by renderer to display the graph (in input data you have pointers on properties used to render nodes/edges
parameters: GlGraphRenderingParameters used by renderer to display the graph

◆ ~GlGraphRenderer()

virtual tlp::GlGraphRenderer::~GlGraphRenderer ( )
inlinevirtual

Destructor.

Definition at line 55 of file GlGraphRenderer.h.

Member Function Documentation

◆ draw()

virtual void tlp::GlGraphRenderer::draw ( float lod,
Camera * camera )
pure virtual

This function is call by GlGraphComposite to draw the graph.

If you reimplement this function you have to render nodes/edges. It's the most important function of GlGraphRenderer

Parameters
lod: lod used to this Rendering
camera: camera used to this rendering

◆ selectEntities()

virtual void tlp::GlGraphRenderer::selectEntities ( Camera * camera,
RenderingEntitiesFlag type,
int x,
int y,
int w,
int h,
std::vector< SelectedEntity > & selectedEntities )
pure virtual

This function is call by GlGraphComposite to selected entities into the graph.

Parameters
type: type of selected entities
x: x of the selected zone
y: y of the selected zone
w: width of the selected zone
h: height of the selected zone
selectedEntities: you have to put selected entities into this vector

◆ setGraphModified()

void tlp::GlGraphRenderer::setGraphModified ( bool graphModified)
inline

This function set if the content of the graph is modified.

Definition at line 88 of file GlGraphRenderer.h.

◆ visitGraph()

virtual void tlp::GlGraphRenderer::visitGraph ( GlSceneVisitor * visitor,
bool visitHiddenEntities = false )
virtual

You can use this function if you want to inject a visitor on the graph.

Member Data Documentation

◆ graphModified

bool tlp::GlGraphRenderer::graphModified
protected

Definition at line 98 of file GlGraphRenderer.h.

◆ inputData

const GlGraphInputData* tlp::GlGraphRenderer::inputData
protected

Definition at line 96 of file GlGraphRenderer.h.

◆ selectionCurrentId

unsigned int* tlp::GlGraphRenderer::selectionCurrentId
protected

Definition at line 103 of file GlGraphRenderer.h.

◆ selectionDrawActivate

bool tlp::GlGraphRenderer::selectionDrawActivate
protected

Definition at line 100 of file GlGraphRenderer.h.

◆ selectionIdMap

tlp_hash_map<unsigned int, SelectedEntity>* tlp::GlGraphRenderer::selectionIdMap
protected

Definition at line 102 of file GlGraphRenderer.h.

◆ selectionType

RenderingEntitiesFlag tlp::GlGraphRenderer::selectionType
protected

Definition at line 101 of file GlGraphRenderer.h.