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);
106 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);
112 static GlLabel *label;
117 void drawEdge(
const Coord &srcNodePos,
const Coord &tgtNodePos,
118 const Coord &startPoint,
const Coord &endPoint,
const LineType::RealType &bends,
119 const Color &startColor,
const Color &endColor,
const Coord &lookDir,
bool colorInterpolate,
const Color &borderColor,
120 const Size &size,
int shape,
bool edge3D,
float lod,
const std::string &textureName,
const float outlineWidth);
125 BoundingBox eeGlyphBoundingBox(
const Coord& anchor,
const Coord& tgt,
float glyphNrm,
126 const Matrix<float, 4>& transformation,
const Matrix<float, 4>& size);
132 void getEdgeColor(
const GlGraphInputData *data,
const edge &e,
const node &source,
const node &target,
bool selected,Color &srcCol, Color &tgtCol);
140 float getEdgeWidthLod(
const Coord &edgeCoord,
const Size &edgeSize,Camera *camera);
145 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,
146 int tgtEdgeGlyph,
size_t numberOfBends,
const Coord &anchor,
const Coord &tgtCoord,
147 const Coord &srcAnchor,
const Coord &tgtAnchor,Coord &lineAnchor, EdgeExtremityGlyph* srcEdgeGlyph = NULL, Camera *camera = NULL);
153 #endif // DOXYGEN_NOTFOR_DEVEL
155 #endif // Tulip_GLEDGE_H