23 #include <tulip/GlComposite.h> 24 #include <tulip/Color.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 };
62 GlAxis(
const std::string &axisName,
const Coord &axisBaseCoord,
const float axisLength,
63 const AxisOrientation &axisOrientation,
const Color &axisColor);
92 return axisOrientation;
98 return axisGradsWidth;
104 return spaceBetweenAxisGrads;
117 return maxGraduationLabelWidth;
131 this->axisName = axisName;
137 this->axisLength = axisLength;
143 this->axisColor = axisColor;
149 this->axisGradsWidth = axisGradsWidth;
156 this->maxCaptionWidth = maxCaptionWidth;
166 virtual void updateAxis();
178 void setAxisGraduations(
const std::vector<std::string> &axisGradsLabels,
179 const LabelPosition &axisGradsLabelsPosition = LEFT_OR_BELOW);
181 void setAxisGraduationsMaxLabelWidth(
const float maxWidth) {
182 maxGraduationLabelWidth = maxWidth;
200 void addCaption(
const CaptionLabelPosition &captionPos,
const float captionHeight,
201 const bool captionFrame =
false,
const float maxCaptionWidth = 0,
202 const float captionOffset = 0,
const std::string caption =
"");
212 void setGradsLabelsHeight(
float height);
214 void translate(
const Coord &c)
override;
216 float getCaptionHeight()
const;
218 void setCaptionHeight(
float height,
bool frame);
221 void buildAxisLine();
224 void computeBoundingBox();
225 virtual Coord computeCaptionCenter(
const bool captionFrame);
226 virtual void computeCaptionSize(
float height);
227 void addAxisCaption(
const Coord &captionLabelCenter,
const bool captionFrame);
229 std::string axisName;
232 AxisOrientation axisOrientation;
233 LabelPosition axisGradsPosition;
235 float axisGradsWidth;
236 float spaceBetweenAxisGrads;
239 float baseCaptionHeight;
241 std::string captionText;
248 std::vector<GlLabel *> gradsLabelsVector;
250 CaptionLabelPosition captionPosition;
251 float maxCaptionWidth;
252 float maxGraduationLabelWidth;
void setAxisName(const std::string &axisName)
Method to set the axis name.
float getSpaceBetweenAxisGrads() const
Method which returns the distance between the axis graduations.
float getLabelHeight() const
Method which returns the axis graduations labels height.
const std::string & getAxisName() const
Method which returns the name of the axis.
void setAxisLength(const float axisLength)
Method to set the axis length.
void setAxisGradsWidth(const float axisGradsWidth)
Methods to set the axis graduations Width.
const Coord & getAxisBaseCoord() const
Method which returns the base coordinates of the axis.
Create a label into Tulip 3D engine.
float getMaxLabelWidth() const
Method which returns the max axis graduations labels width.
float getAxisGradsWidth() const
Method which returns the width of the axis graduations.
AxisOrientation getAxisOrientation() const
Method which returns the orientation of the axis.
Color getAxisColor() const
Method which returns the color of the axis.
A base class to draw an axis with graduations.
void setMaxCaptionWidth(const float maxCaptionWidth)
Methods to set the max caption width.
float getAxisLength() const
Method which returns the length of the axis.
GlSimpleEntity used to aggregate other GlEntity.
void setAxisColor(const Color &axisColor)
Method to set the axis color.