PointShape.hpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. // Include modules
  3. #include "TrackSystemSettingsStructs.hpp"
  4. #include "enums.hpp"
  5. // Include dependencies
  6. #include <osg/Vec3>
  7. #include <osg/Group>
  8. #include <osg/MatrixTransform>
  9. #include <osg/ShapeDrawable>
  10. #include <osg/Switch>
  11. #include <osg/Geode>
  12. #include "lib3mf_implicit.hpp"
  13. class PointShape {
  14. public:
  15. static void loadSteamvrThread();
  16. PointShape(const osg::ref_ptr<osg::Group> renderRoot, const ActiveTrackingSystem activeTrackingSystem, osg::Vec3f point, osg::Vec3f normal, osg::Vec3f normalModifier, float normalRotation);
  17. ~PointShape();
  18. void moveTo(osg::Vec3f position);
  19. void setNormalModifier(osg::Vec3f normalModifier);
  20. void rotateToNormalVector(osg::Vec3f normal, float normalRotation);
  21. void setVisibility(bool mode);
  22. void setColor(osg::Vec4 color);
  23. void setupOptiTrack(OptiTrackSettings optiTrackSettings);
  24. void setupEMFTrack(EMFTrackSettings emfTrackSettings);
  25. void setupSteamVRTrack(SteamVRTrackSettings steamVrTrackSettings);
  26. void setupActionPoints();
  27. osg::ref_ptr<osg::Geode> getMesh();
  28. private:
  29. osg::Matrix emfYFix(osg::Vec3 normal);
  30. osg::ref_ptr<osg::Switch> _selectionSwitch;
  31. osg::ref_ptr<osg::MatrixTransform> _selectionTranslateGroup;
  32. osg::ref_ptr<osg::MatrixTransform> _selectionRotateGroup;
  33. osg::ref_ptr<osg::MatrixTransform> _selectionMoveToEndGroup;
  34. osg::ref_ptr<osg::MatrixTransform> _screwMove;
  35. osg::ref_ptr<osg::Group> _renderRoot;
  36. osg::ref_ptr<osg::ShapeDrawable> _shape;
  37. osg::ref_ptr<osg::ShapeDrawable> _optiConnector;
  38. osg::ref_ptr<osg::Geode> _thread;
  39. osg::ref_ptr<osg::Geode> _geode;
  40. osg::Vec3f _normalModifier;
  41. double _optiTrackSteamVRLength;
  42. ActiveTrackingSystem _activeTrackingSystem;
  43. };