15#include <ThirdPartyWarningsDisable.h>
17#include <Inventor/nodes/SoShape.h>
18#include <Inventor/fields/SoSFBool.h>
19#include <Inventor/fields/SoSFVec3f.h>
20#include <Inventor/fields/SoSFFloat.h>
21#include <Inventor/fields/SoSFDouble.h>
22#include <Inventor/fields/SoSFColor.h>
23#include <Inventor/fields/SoSFEnum.h>
24#include <Inventor/fields/SoSFNode.h>
29#include <ThirdPartyWarningsRestore.h>
37 inline float sign(
float number)
39 return (number < 0) ? -1.f : 1.f;
136 const auto margin = 3.0f;
148 const auto awidth = abs(ax0 - ax1);
149 const auto aheight = abs(ay0 - ay1);
151 const auto bwidth = abs(bx0 - bx1);
152 const auto bheight = abs(by0 - by1);
154 return (abs((ax0 + awidth / 2) - (bx0 + bwidth / 2)) * 2 < (awidth + bwidth)) &&
155 (abs((ay0 + aheight / 2) - (by0 + bheight / 2)) * 2 < (aheight + bheight));
239 std::vector<CoordinateAxis> axes;
242 void initializeAxes();
243 void applyUserTransform();
246 void computeAndSetTickDirections();
247 SbVec2f computeTextShiftFactorVector(
int axisIndex);
248 float computeTextShiftFactor(
float angle0,
float angle1);
249 void computeAndSetLabelVisibility(std::vector<Label>& labels);
251 float getTickScale();
252 int getEndTickModifier(
int numTicks,
float length);
255 double getAutoStride(
float maxRange);
256 double getUserStride(
float maxRange);
257 float getMaxAxisRange();
259 bool anyLabelOverlap(
const std::vector<Label>& labels);
260 void generatePrimitives(SoAction *)
override {}
262 void GLRender(SoGLRenderAction *action)
override;
263 void glRenderTicks();
264 void glRenderAxisLines();
265 void glRenderOrigin();
267 void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er)
override;
270 void updateAxes(SoField*);
272 void updateFromInputInventorScene();
273 void updateFromInputImage();
275 SbVec3f getImageExtent();
276 SbMatrix getImageVoxelToWorldMatrix();
279 void message(
const std::string& messageText)
const
281 std::cout << messageText << std::endl;
SoSFBool useVoxelAlignedBoundingBox
SoSFTypedEnum< EndTickMode > endTickMode
SoSFColor numbersFontColor
SoSFFloat lettersFontAlpha
SoSFTypedEnum< UserTransformMode > userTransformMode
SoSFFloat arrowLengthFactor
SoSFFloat numbersFontAlpha
SoSFTypedEnum< StrideMode > strideMode
@ APPLY_USER_TRANSFORM_TO_INPUT
@ USER_TRANSFORM_INSTEAD_OF_INPUT
SoSFColor textShadowColor
SoSFFloat letterOffsetFactor
~SoCoordinateSystem() override
SoSFColor lettersFontColor
SoSFFloat lettersFontSizeOffset
The SoSFMLImage field is the interface used by Inventor Nodes to access image data (in the current im...
bool isMaxPointingToScreenZ
void setWorldPositions(const SbVec3f &start, const SbVec3f &end)
void setScreenPositions(const SbVec3f &start, const SbVec3f &end)
CoordinateAxis(const SbVec3f &worldStart, const SbVec3f &worldEnd, const std::string &label, int logicalDirection)
float renderLengthForArrowPlacement
SbVec2f textShiftFactorScreen
void initializeScreenBoundingBox()
bool overlaps(const Label &otherLabel) const
SbVec2f screenBoundingBox[2]