21 #ifndef Tulip_GLEDGE_H
22 #define Tulip_GLEDGE_H
24 #ifndef DOXYGEN_NOTFOR_DEVEL
25 #include <tulip/OpenGlConfigManager.h>
27 #include <tulip/PropertyTypes.h>
29 #include <tulip/GlComplexeEntity.h>
30 #include <tulip/EdgeExtremityGlyph.h>
41 class TLP_GL_SCOPE GlEdge :
public GlComplexeEntity {
49 GlEdge(
unsigned int id);
54 virtual void acceptVisitor(GlSceneVisitor *visitor);
59 virtual BoundingBox getBoundingBox(
const GlGraphInputData* data);
64 virtual void draw(
float lod,
const GlGraphInputData *data,Camera* camera);
70 void drawLabel(
bool drawSelect,OcclusionTest* test,
const GlGraphInputData* data,
float lod);
76 void drawLabel(OcclusionTest* test,
const GlGraphInputData* data);
82 void drawLabel(OcclusionTest* test,
const GlGraphInputData* data,
float lod, Camera *camera=NULL);
87 void getVertices(
const GlGraphInputData *data,std::vector<Coord> &linesCoordsArray);
92 void getColors(
const GlGraphInputData *data,
const Coord *vertices,
unsigned int numberOfVertices,std::vector<Color> &linesColorsArray);
96 void getColors(
const GlGraphInputData *data,
const std::vector<Coord> &vertices,std::vector<Color> &linesColorsArray);
101 void getEdgeSize(
const GlGraphInputData *data,edge e,
const Size &srcSize,
const Size &tgtSize,
const float maxSrcSize,
const float maxTgtSize,Size &edgeSize);
107 static void clearEdgeWidthLodSystem() {
108 haveToComputeEdgeWidthBaseLod=
true;
115 static GlLabel *label;
116 static bool haveToComputeEdgeWidthBaseLod;
117 static bool orthoProjection;
118 static float edgeWidthBaseLod;
123 void drawEdge(
const Coord &srcNodePos,
const Coord &tgtNodePos,
124 const Coord &startPoint,
const Coord &endPoint,
const LineType::RealType &bends,
125 const Color &startColor,
const Color &endColor,
const Coord &lookDir,
bool colorInterpolate,
const Color &borderColor,
126 const Size &size,
int shape,
bool edge3D,
float lod,
const std::string &textureName,
const float outlineWidth);
131 BoundingBox eeGlyphBoundingBox(
const Coord& anchor,
const Coord& tgt,
float glyphNrm,
132 const Matrix<float, 4>& transformation,
const Matrix<float, 4>& size);
138 void getEdgeColor(
const GlGraphInputData *data,
const edge &e,
const node &source,
const node &target,
bool selected,Color &srcCol, Color &tgtCol);
146 float getEdgeWidthLod(
const Coord &edgeCoord,
const Size &edgeSize,Camera *camera);
151 void getEdgeAnchor(
const GlGraphInputData *data,
const node &source,
const node &target,
const LineType::RealType &bends,
const Coord &srcCoord,
const Coord &tgtCoord,
const Size &srcSize,
const Size &tgtSize, Coord &srcAnchor, Coord &tgtAnchor);
156 void displayArrow(
const GlGraphInputData *data,
const edge &e,
const node &source,
const Size &sizeRatio,
float edgeSize,
const Color &color,
float maxSize,
bool selected,
float selectionOutlineSize,
157 int srcEdgeGlyph,
int tgtEdgeGlyph,
size_t numberOfBends,
const Coord &anchor,
const Coord &tgtCoord,
158 const Coord &srcAnchor,
const Coord &tgtAnchor,Coord &lineAnchor);
164 #endif // DOXYGEN_NOTFOR_DEVEL
166 #endif // Tulip_GLEDGE_H