24 #include <tulip/GlComposite.h>
25 #include <tulip/Color.h>
27 const float DEFAULT_GRAD_WIDTH = 6.;
29 const float MAGIG_FACTOR = (1.f / (1.3f));
47 enum AxisOrientation {HORIZONTAL_AXIS, VERTICAL_AXIS};
49 enum LabelPosition {LEFT_OR_BELOW, RIGHT_OR_ABOVE};
50 enum CaptionLabelPosition {LEFT, RIGHT, BELOW, ABOVE};
61 GlAxis(
const std::string &axisName,
const Coord &axisBaseCoord,
const float axisLength,
62 const AxisOrientation &axisOrientation,
const Color &axisColor);
91 return axisOrientation;
97 return axisGradsWidth;
103 return spaceBetweenAxisGrads;
116 return maxGraduationLabelWidth;
130 this->axisName = axisName;
136 this->axisLength = axisLength;
142 this->axisColor = axisColor;
148 this->axisGradsWidth = axisGradsWidth;
155 this->maxCaptionWidth = maxCaptionWidth;
165 virtual void updateAxis();
174 void setAxisGraduations(
const std::vector<std::string> &axisGradsLabels,
175 const LabelPosition &axisGradsLabelsPosition = LEFT_OR_BELOW);
178 void setAxisGraduationsMaxLabelWidth(
const float maxWidth) {
179 maxGraduationLabelWidth = maxWidth;
192 void addCaption(
const CaptionLabelPosition &captionPos,
const float captionHeight,
const bool captionFrame =
false,
193 const float maxCaptionWidth = 0,
const float captionOffset = 0,
const std::string caption =
"");
203 void setGradsLabelsHeight(
float height);
205 void translate(
const Coord &c);
207 float getCaptionHeight()
const;
209 void setCaptionHeight(
float height,
bool frame);
213 void buildAxisLine();
218 void computeBoundingBox();
219 virtual Coord computeCaptionCenter(
const bool captionFrame);
220 virtual void computeCaptionSize(
float height);
221 void addAxisCaption(
const Coord &captionLabelCenter,
const bool captionFrame);
223 std::string axisName;
226 AxisOrientation axisOrientation;
227 LabelPosition axisGradsPosition;
229 float axisGradsWidth;
230 float spaceBetweenAxisGrads;
233 float baseCaptionHeight;
235 std::string captionText;
236 GlLabel *captionLabel;
239 GlComposite *axisLinesComposite;
240 GlComposite *captionComposite;
241 GlComposite *gradsComposite;
242 std::vector<GlLabel*> gradsLabelsVector;
244 CaptionLabelPosition captionPosition;
245 float maxCaptionWidth;
246 float maxGraduationLabelWidth;