21 #ifndef Tulip_GLEDGE_H
22 #define Tulip_GLEDGE_H
24 #ifndef DOXYGEN_NOTFOR_DEVEL
26 #include <tulip/PropertyTypes.h>
27 #include <tulip/Size.h>
28 #include <tulip/GlComplexeEntity.h>
29 #include <tulip/Matrix.h>
36 class EdgeExtremityGlyph;
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 float edgeWidthBaseLod;
122 void drawEdge(
const Coord &srcNodePos,
const Coord &tgtNodePos,
123 const Coord &startPoint,
const Coord &endPoint,
const LineType::RealType &bends,
124 const Color &startColor,
const Color &endColor,
const Coord &lookDir,
bool colorInterpolate,
const Color &borderColor,
125 const Size &size,
int shape,
bool edge3D,
float lod,
const std::string &textureName,
const float outlineWidth);
130 BoundingBox eeGlyphBoundingBox(
const Coord& anchor,
const Coord& tgt,
float glyphNrm,
131 const Matrix<float, 4>& transformation,
const Matrix<float, 4>& size);
137 void getEdgeColor(
const GlGraphInputData *data,
const edge &e,
const node &source,
const node &target,
bool selected,Color &srcCol, Color &tgtCol);
145 float getEdgeWidthLod(
const Coord &edgeCoord,
const Size &edgeSize,Camera *camera);
150 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);
155 void displayArrowAndAdjustAnchor(
const GlGraphInputData *data,
const edge &e,
const node &source,
const Size &sizeRatio,
float edgeSize,
const Color &color,
float maxSize,
bool selected,
float selectionOutlineSize,
156 int tgtEdgeGlyph,
size_t numberOfBends,
const Coord &anchor,
const Coord &tgtCoord,
157 const Coord &srcAnchor,
const Coord &tgtAnchor,Coord &lineAnchor, EdgeExtremityGlyph* srcEdgeGlyph = NULL, Camera *camera = NULL);
163 #endif // DOXYGEN_NOTFOR_DEVEL
165 #endif // Tulip_GLEDGE_H