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> 30 #include <tulip/GlLabel.h> 31 #include <tulip/GlSceneVisitor.h> 36 class EdgeExtremityGlyph;
41 class TLP_GL_SCOPE GlEdge final :
public GlComplexeEntity {
48 GlEdge(
unsigned int eId = UINT_MAX,
unsigned int ePos = UINT_MAX,
bool sel =
false)
49 : id(eId), pos(ePos), selectionDraw(sel) {
51 label =
new GlLabel();
57 void acceptVisitor(GlSceneVisitor *visitor)
override {
64 BoundingBox getBoundingBox(
const GlGraphInputData *data)
override;
69 BoundingBox getBoundingBox(
const GlGraphInputData *data,
const edge e,
const node src,
70 const node tgt,
const Coord &srcCoord,
const Coord &tgtCoord,
71 const Size &srcSize,
const Size &tgtSize,
72 const LineType::RealType &bends);
77 void draw(
float lod,
const GlGraphInputData *data, Camera *camera)
override;
83 void drawLabel(
bool drawSelect, OcclusionTest *test,
const GlGraphInputData *data,
float lod);
88 void drawLabel(OcclusionTest *test,
const GlGraphInputData *data)
override;
94 void drawLabel(OcclusionTest *test,
const GlGraphInputData *data,
float lod,
95 Camera *camera =
nullptr);
100 size_t getVertices(
const GlGraphInputData *data,
const edge e,
const node src,
const node tgt,
101 Coord &srcCoord, Coord &tgtCoord, Size &srcSize, Size &tgtSize,
102 std::vector<Coord> &vertices);
107 void getColors(
const GlGraphInputData *data,
const node src,
const node tgt,
const Color &eColor,
108 Color &srcCol, Color &tgtCol,
const Coord *vertices,
unsigned int numberOfVertices,
109 std::vector<Color> &colors);
114 void getEdgeSize(
const GlGraphInputData *data, edge e,
const Size &srcSize,
const Size &tgtSize,
115 const float maxSrcSize,
const float maxTgtSize, Size &edgeSize);
120 void getEdgeAnchor(
const GlGraphInputData *data,
const node src,
const node tgt,
121 const LineType::RealType &bends,
const Coord &srcCoord,
const Coord &tgtCoord,
122 const Size &srcSize,
const Size &tgtSize, Coord &srcAnchor, Coord &tgtAnchor);
124 void setSelectionDraw(
bool selectDraw) {
125 selectionDraw = selectDraw;
129 unsigned int id, pos;
133 static GlLabel *label;
138 void drawEdge(
const Coord &srcNodePos,
const Coord &tgtNodePos,
const Coord &startPoint,
139 const Coord &endPoint,
const LineType::RealType &bends,
const Color &startColor,
140 const Color &endColor,
const Coord &lookDir,
bool colorInterpolate,
141 const Color &borderColor,
const Size &size,
int shape,
bool edge3D,
float lod,
142 const std::string &textureName,
const float outlineWidth);
147 BoundingBox eeGlyphBoundingBox(
const Coord &anchor,
const Coord &tgt,
float glyphNrm,
148 const Matrix<float, 4> &transformation,
149 const Matrix<float, 4> &size);
155 void getEdgeColor(
const GlGraphInputData *data,
const edge e,
const node src,
const node tgt,
156 bool selected, Color &srcCol, Color &tgtCol);
162 float getEdgeWidthLod(
const Coord &edgeCoord,
const Size &edgeSize, Camera *camera);
167 void displayArrowAndAdjustAnchor(
const GlGraphInputData *data,
const edge e,
const node src,
168 const Size &sizeRatio,
float edgeSize,
const Color &color,
169 float maxSize,
bool selected,
float selectionOutlineSize,
170 int tgtEdgeGlyph,
bool hasBends,
const Coord &anchor,
171 const Coord &tgtCoord,
const Coord &srcAnchor,
172 const Coord &tgtAnchor, Coord &lineAnchor,
173 EdgeExtremityGlyph *srcEdgeGlyph =
nullptr,
174 Camera *camera =
nullptr);
178 #endif // DOXYGEN_NOTFOR_DEVEL 180 #endif // Tulip_GLEDGE_H