tlp::GlGraph Class Reference#include <GlGraph.h>
List of all members.
Detailed Description
This widget enables an incremental 3D drawing of a Tulip Graph. It also includes 3D navigation capabilities and selection methods. All the displaying is done with OpenGl. Public Member Functions
- GlGraph ()
- ~GlGraph ()
- const
GlGraphRenderingParameters & getRenderingParameters ()
- void setRenderingParameters (const GlGraphRenderingParameters ¶meter)
- void centerScene ()
- void draw ()
- bool activateTexture (const std::string &filename)
- void desactivateTexture ()
- void translateCamera (const int x, const int y, const int z)
- void rotateScene (const int rotx, const int roty, const int rotz)
- void zoom (const int step)
- void zoomXY (const int step, const int x, const int y)
- zoom to screen coordinates a translation is performed while zooming. The farther the point (x,y) is from the center of the screen, the higher the translation is. The direction of the translation is reversed when switching from zoom in to zoom out.
- void doSelect (const int x, const int y, const int width, const int height, std::vector< node > &sNode, std::vector< edge > &sEdge)
- select nodes and edges in a region of the screen
- bool doSelect (const int x, const int y, tlp::ElementType &type, node &, edge &)
- select a node or edge at a point select either a node or edge at point (x,y)
- bool doNodeSelect (const int x, const int y, const int width, const int height, std::vector< node > &selected, const bool ordered=true)
- select nodes in a region of the screen
- bool doEdgeSelect (const int x, const int y, const int width, const int height, std::vector< edge > &selected, const bool ordered=true)
- void initDoSelect (const GLint x, const GLint y, GLint w, GLint h, const unsigned int nbPickableElements)
- void endSelect ()
- bool outputEPS (int size, int doSort, const char *filename)
- bool outputSVG (int size, const char *filename)
- Coord screenTo3DWorld (const Coord &)
- Coord worldTo2DScreen (const Coord &)
- unsigned char * getImage ()
- tlp::Graph * getGraph () const
Static Public Member Functions
Public Attributes
Static Public Attributes
Protected Attributes
Constructor & Destructor Documentation
tlp::GlGraph::GlGraph |
( |
|
) |
|
tlp::GlGraph::~GlGraph |
( |
|
) |
|
Member Function Documentation
Return the rendering parameters used for rendering
Set the rendering parameters used for rendering
void tlp::GlGraph::centerScene |
( |
|
) |
|
Initialize the camera in order to see the entire graph on the screen
void tlp::GlGraph::draw |
( |
|
) |
|
Draw the entire graph. Warning : the open gl context must setup before to call that function.
bool tlp::GlGraph::activateTexture |
( |
const std::string & |
filename |
) |
|
activate Texture with name filename. - Parameters:
-
| filename | the image to be textured |
- Returns:
- true on success, false otherwise (format not supported, file not found, not enough memory, ...)
void tlp::GlGraph::desactivateTexture |
( |
|
) |
|
void tlp::GlGraph::translateCamera |
( |
const int |
x, |
|
|
const int |
y, |
|
|
const int |
z | |
|
) |
| | |
set translation to apply to the scene - See also:
- getSceneTranslation, setSceneTranslation
void tlp::GlGraph::rotateScene |
( |
const int |
rotx, |
|
|
const int |
roty, |
|
|
const int |
rotz | |
|
) |
| | |
set rotation to apply to the scene - See also:
- getSceneRotation, setSceneRotation
void tlp::GlGraph::zoom |
( |
const int |
step |
) |
|
zoom on the center of the screen - Parameters:
-
| step | positive: zoom in, negative: zoom out |
void tlp::GlGraph::zoomXY |
( |
const int |
step, |
|
|
const int |
x, |
|
|
const int |
y | |
|
) |
| | |
zoom to screen coordinates a translation is performed while zooming. The farther the point (x,y) is from the center of the screen, the higher the translation is. The direction of the translation is reversed when switching from zoom in to zoom out.
- See also:
- zoom
void tlp::GlGraph::doSelect |
( |
const int |
x, |
|
|
const int |
y, |
|
|
const int |
width, |
|
|
const int |
height, |
|
|
std::vector< node > & |
sNode, |
|
|
std::vector< edge > & |
sEdge | |
|
) |
| | |
select nodes and edges in a region of the screen
select all nodes and edges lying in the area of the screen of given width and height, and with its upper-left corner at (x,y) - Parameters:
-
| sNode | filled by the method with the nodes found in the region |
| sEdge | filled by the method with the edges found in the region |
bool tlp::GlGraph::doSelect |
( |
const int |
x, |
|
|
const int |
y, |
|
|
tlp::ElementType & |
type, |
|
|
node & |
, |
|
|
edge & |
| |
|
) |
| | |
select a node or edge at a point select either a node or edge at point (x,y)
- Parameters:
-
| type | tells what has been found: NODE, EDGE |
- Returns:
- true if something has been found, false otherwise
bool tlp::GlGraph::doNodeSelect |
( |
const int |
x, |
|
|
const int |
y, |
|
|
const int |
width, |
|
|
const int |
height, |
|
|
std::vector< node > & |
selected, |
|
|
const bool |
ordered = true | |
|
) |
| | |
select nodes in a region of the screen
- Parameters:
-
- Returns:
- true if at least one node has been found
bool tlp::GlGraph::doEdgeSelect |
( |
const int |
x, |
|
|
const int |
y, |
|
|
const int |
width, |
|
|
const int |
height, |
|
|
std::vector< edge > & |
selected, |
|
|
const bool |
ordered = true | |
|
) |
| | |
select edges at a given point, ordered from the closest to the farthest - Parameters:
-
- Returns:
- true if at least one edge has been found
void tlp::GlGraph::initDoSelect |
( |
const GLint |
x, |
|
|
const GLint |
y, |
|
|
GLint |
w, |
|
|
GLint |
h, |
|
|
const unsigned int |
nbPickableElements | |
|
) |
| | |
void tlp::GlGraph::endSelect |
( |
|
) |
|
bool tlp::GlGraph::outputEPS |
( |
int |
size, |
|
|
int |
doSort, |
|
|
const char * |
filename | |
|
) |
| | |
bool tlp::GlGraph::outputSVG |
( |
int |
size, |
|
|
const char * |
filename | |
|
) |
| | |
Coord tlp::GlGraph::screenTo3DWorld |
( |
const Coord & |
|
) |
|
Compute coordinate from the 2D screen space to the 3D space.
Coord tlp::GlGraph::worldTo2DScreen |
( |
const Coord & |
|
) |
|
Compute coordinate from the 3D space to the 2D screen space.
unsigned char* tlp::GlGraph::getImage |
( |
|
) |
|
Take a snapshot of the Open GL windows - Returns:
- an array of dimension width*height*3 char (8bits per color RGB). The pointer has to be freed after (with free, not delete)
tlp::Graph* tlp::GlGraph::getGraph |
( |
|
) |
const |
static std::string tlp::GlGraph::glyphName |
( |
int |
id |
) |
[static] |
static int tlp::GlGraph::glyphId |
( |
std::string |
name |
) |
[static] |
static void tlp::GlGraph::loadPlugins |
( |
PluginLoader * |
plug = 0 |
) |
[static] |
static std::string tlp::GlGraph::edgeShapeName |
( |
int |
id |
) |
[static] |
static int tlp::GlGraph::edgeShapeId |
( |
std::string |
name |
) |
[static] |
static std::string tlp::GlGraph::labelPositionName |
( |
int |
id |
) |
[static] |
static int tlp::GlGraph::labelPositionId |
( |
std::string |
name |
) |
[static] |
Member Data Documentation
|