24 #include <tulip/GlComposite.h>
26 const float DEFAULT_GRAD_WIDTH = 6.;
28 const float MAGIG_FACTOR = (1.f / (1.3f));
46 enum AxisOrientation {HORIZONTAL_AXIS, VERTICAL_AXIS};
48 enum LabelPosition {LEFT_OR_BELOW, RIGHT_OR_ABOVE};
49 enum CaptionLabelPosition {LEFT, RIGHT, BELOW, ABOVE};
60 GlAxis(
const std::string &axisName,
const Coord &axisBaseCoord,
const float axisLength,
61 const AxisOrientation &axisOrientation,
const Color &axisColor);
90 return axisOrientation;
96 return axisGradsWidth;
102 return spaceBetweenAxisGrads;
115 return maxGraduationLabelWidth;
129 this->axisName = axisName;
135 this->axisLength = axisLength;
141 this->axisColor = axisColor;
147 this->axisGradsWidth = axisGradsWidth;
154 this->maxCaptionWidth = maxCaptionWidth;
164 virtual void updateAxis();
173 void setAxisGraduations(
const std::vector<std::string> &axisGradsLabels,
174 const LabelPosition &axisGradsLabelsPosition = LEFT_OR_BELOW);
177 void setAxisGraduationsMaxLabelWidth(
const float maxWidth) {
178 maxGraduationLabelWidth = maxWidth;
191 void addCaption(
const CaptionLabelPosition &captionPos,
const float captionHeight,
const bool captionFrame =
false,
192 const float maxCaptionWidth = 0,
const float captionOffset = 0,
const std::string caption =
"");
202 void setGradsLabelsHeight(
float height);
204 void translate(
const Coord &c);
206 float getCaptionHeight()
const;
208 void setCaptionHeight(
float height,
bool frame);
212 void buildAxisLine();
217 void computeBoundingBox();
218 virtual Coord computeCaptionCenter(
const bool captionFrame);
219 virtual void computeCaptionSize(
float height);
220 void addAxisCaption(
const Coord &captionLabelCenter,
const bool captionFrame);
222 std::string axisName;
225 AxisOrientation axisOrientation;
226 LabelPosition axisGradsPosition;
228 float axisGradsWidth;
229 float spaceBetweenAxisGrads;
232 float baseCaptionHeight;
234 std::string captionText;
235 GlLabel *captionLabel;
238 GlComposite *axisLinesComposite;
239 GlComposite *captionComposite;
240 GlComposite *gradsComposite;
241 std::vector<GlLabel*> gradsLabelsVector;
243 CaptionLabelPosition captionPosition;
244 float maxCaptionWidth;
245 float maxGraduationLabelWidth;