/usr/include/tulip/GlScene.h is in libtulip-ogl-dev 3.1.2-2.3ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | //-*-c++-*-
/**
Authors: David Auber, Patrick Mary, Morgan Mathiaut
from the LaBRI Visualization Team
Email : auber@tulip-software.org
Last modification : 13/03/2009
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
*/
#ifndef Tulip_GLSCENE_H
#define Tulip_GLSCENE_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <tulip/tulipconf.h>
#include "tulip/GlSceneObserver.h"
#include "tulip/GlLayer.h"
#include "tulip/GlGraphComposite.h"
#include "tulip/GlSelectSceneVisitor.h"
#include "tulip/GlDisplayListManager.h"
#include "tulip/GlyphManager.h"
#include "tulip/GlTextureManager.h"
namespace tlp {
/** /brief Storage class for Z ordering
*
*/
struct EntityWithDistance {
EntityWithDistance(const double &dist,LODResultSimpleEntity *entity)
:distance(dist),isComplexEntity(false){
simpleEntity=entity;
}
EntityWithDistance(const double &dist,LODResultComplexEntity *entity,bool isNode)
:distance(dist),isComplexEntity(true),isNode(isNode){
complexEntity=entity;
}
double distance;
LODResultSimpleEntity *simpleEntity;
LODResultComplexEntity *complexEntity;
bool isComplexEntity;
bool isNode;
};
/** /brief Tulip scene class
*
* Tulip scene class
*/
class TLP_GL_SCOPE GlScene : public GlObservableScene {
public:
GlScene(GlLODCalculator *calculator=NULL);
/**
* Init scene's OpenGL parameters
*/
void initGlParameters();
/**
* Draw the scene
*/
void draw();
/**
* Center scene
*/
void centerScene();
/**
* Zoom to x,y
*/
void zoomXY(int step, const int x, const int y);
/**
* Zoom
*/
void zoom(float factor,const Coord& dest);
/**
* Zoom
*/
void zoom(int step);
/**
* Translate camera by (x,y,z)
*/
void translateCamera(const int x, const int y, const int z);
/**
* Rotate camera by (x,y,z)
*/
void rotateScene(const int x, const int y, const int z);
/**
* Select entities with selection flag : type (SelectSimpleEntities,SelectNodes,SelectEdges)
* Select at position x,y with heigh : h and width : w
* Select in GlLayer : layer
* And store result in selectedEntities vector
*/
bool selectEntities(SelectionFlag type, int x, int y, int h, int w,GlLayer *layer,std::vector<unsigned long>& selectedEntities);
/**
* Output the scene in SVG
*/
void outputSVG(unsigned int size,const std::string& filename);
/**
* Output the scene in SVG
*/
void outputEPS(unsigned int size,const std::string& filename);
/**
* Return the RGB image of OpenGL view
*/
unsigned char * getImage();
/**
* Set the viewport of the scene with a vector
*/
void setViewport(Vector<int, 4> newViewport) {viewport=newViewport;}
/**
* Set the viewport of the scene with 4 int
*/
void setViewport(int x, int y, int width, int height) {viewport[0]=x;viewport[1]=y;viewport[2]=width;viewport[3]=height;}
/**
* Get the viewport of the scene
*/
Vector<int, 4> getViewport() {return viewport;}
/**
* Set the background color of the scene
*/
void setBackgroundColor(const Color& color) {backgroundColor=color;}
/**
* Get the background color of the scene
*/
Color getBackgroundColor() {return backgroundColor;}
/**
* Set if scene is render in orthogonal mode
*/
void setViewOrtho(bool viewOrtho){this->viewOrtho=viewOrtho;}
/**
* Scene is render in orthogonal mode ?
*/
bool isViewOrtho() {return viewOrtho;}
/**
* Render the nodes/edges label
*/
void setViewLabel(bool viewLabel){this->viewLabel=viewLabel;}
/**
* Add a layer in the scene
*/
void addLayer(GlLayer *layer);
/**
* Return the layer with name : name
*/
GlLayer* getLayer(const std::string& name);
/**
* Return the layer list
*/
std::vector<std::pair<std::string, GlLayer*> >* getLayersList() {return &layersList;}
/**
* Get XML description of the scene and children and store it in out string
*/
void getXML(std::string &out);
/**
* Set scene's data and children with a XML
*/
void setWithXML(std::string &in,Graph *graph);
//************************************************************
/* To Remove */
void addGlGraphCompositeInfo(GlLayer* layer,GlGraphComposite *glGraphComposite) {this->graphLayer=layer;this->glGraphComposite=glGraphComposite;}
GlGraphComposite* getGlGraphComposite() {return glGraphComposite;}
GlLayer* getGraphLayer() {return graphLayer;}
GlLayer* getSelectionLayer() {return selectionLayer;}
Camera* getCamera() {return getLayer("Main")->getCamera();}
void setCamera(Camera* camera) {getLayer("Main")->setCamera(*camera);}
private:
std::vector<std::pair<std::string,GlLayer *> > layersList;
GlLayer* selectionLayer;
GlLODCalculator *lodCalculator;
Vector<int, 4> viewport;
Color backgroundColor;
bool viewLabel;
bool viewOrtho;
GlGraphComposite *glGraphComposite;
GlLayer *graphLayer;
};
}
#endif // Tulip_GLSCENE_H
|