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/GlEntity.h> 29 #include <tulip/Matrix.h> 30 #include <tulip/GlLabel.h> 31 #include <tulip/GlSceneVisitor.h> 36 class EdgeExtremityGlyph;
38 class GlGraphInputData;
44 class TLP_GL_SCOPE GlEdge final :
public GlEntity {
51 GlEdge(
unsigned int eId = UINT_MAX,
unsigned int ePos = UINT_MAX,
bool sel =
false)
52 : id(eId), pos(ePos), selectionDraw(sel) {}
57 void acceptVisitor(GlSceneVisitor *visitor)
override {
64 BoundingBox getBoundingBox(
const GlGraphInputData *data);
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);
83 void drawLabel(GlLabel &label, OcclusionTest *test,
const GlGraphInputData *data,
float lod,
84 Camera *camera =
nullptr);
89 size_t getVertices(
const GlGraphInputData *data,
const edge e,
const node src,
const node tgt,
90 Coord &srcCoord, Coord &tgtCoord, Size &srcSize, Size &tgtSize,
91 std::vector<Coord> &vertices);
96 void getColors(
const GlGraphInputData *data,
const node src,
const node tgt,
const Color &eColor,
97 Color &srcCol, Color &tgtCol,
const Coord *vertices,
unsigned int numberOfVertices,
98 std::vector<Color> &colors);
103 void getEdgeSize(
const GlGraphInputData *data, edge e,
const Size &srcSize,
const Size &tgtSize,
104 const float maxSrcSize,
const float maxTgtSize, Size &edgeSize);
109 void getEdgeAnchor(
const GlGraphInputData *data,
const node src,
const node tgt,
110 const LineType::RealType &bends,
const Coord &srcCoord,
const Coord &tgtCoord,
111 const Size &srcSize,
const Size &tgtSize, Coord &srcAnchor, Coord &tgtAnchor);
113 void setSelectionDraw(
bool selectDraw) {
114 selectionDraw = selectDraw;
118 unsigned int id, pos;
126 void drawEdge(
const Coord &srcNodePos,
const Coord &tgtNodePos,
const Coord &startPoint,
127 const Coord &endPoint,
const LineType::RealType &bends,
const Color &startColor,
128 const Color &endColor,
const Coord &lookDir,
bool colorInterpolate,
129 const Color &borderColor,
const Size &size,
int shape,
bool edge3D,
float lod,
130 const std::string &textureName,
const float outlineWidth);
135 BoundingBox eeGlyphBoundingBox(
const Coord &anchor,
const Coord &tgt,
float glyphNrm,
136 const Matrix<float, 4> &transformation,
137 const Matrix<float, 4> &size);
143 void getEdgeColor(
const GlGraphInputData *data,
const edge e,
const node src,
const node tgt,
144 bool selected, Color &srcCol, Color &tgtCol);
150 float getEdgeWidthLod(
const Coord &edgeCoord,
const Size &edgeSize, Camera *camera);
155 void displayArrowAndAdjustAnchor(
const GlGraphInputData *data,
const edge e,
const node src,
156 const Size &sizeRatio,
float edgeSize,
const Color &color,
157 float maxSize,
bool selected,
float selectionOutlineSize,
158 int tgtEdgeGlyph,
bool hasBends,
const Coord &anchor,
159 const Coord &tgtCoord,
const Coord &srcAnchor,
160 const Coord &tgtAnchor, Coord &lineAnchor,
161 EdgeExtremityGlyph *srcEdgeGlyph =
nullptr,
162 Camera *camera =
nullptr);
166 #endif // DOXYGEN_NOTFOR_DEVEL 168 #endif // Tulip_GLEDGE_H