OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
HandleWheel.h
Go to the documentation of this file.
1#pragma once
2
3#include "HandlerBase.h"
4
5#include <osg/Geode>
6
7class HandleWheel : public HandlerBase
8{
9public:
10 HandleWheel() = delete;
11 HandleWheel(osg::Vec3d point, osg::Vec3d normal, double radius, double tubeRadius, double color[4]);
12 virtual ~HandleWheel();
13
14 virtual osg::Node *getNode(void) override;
15
16 virtual void mouseOver(bool flag) override;
17 virtual void setInteraction(int intersectionIndex, double intersectionRatio) override;
18 virtual void setInteractionReference(int intersectionIndex, double intersectionRatio) override;
19
20 void setPosition(osg::Vec3d pos);
21 osg::Vec3d getPosition(void) { return wheelPosition; }
22
23 double getRotationAngleDeg(void) { return rotationAngleDeg; }
24
25private:
26 void createWheel(osg::Geode * _geode, double color[4], double wheelRadius, double tubeRadius, int numberSegments);
27 void updateTransform(void);
28 double calculateAngle(int intersectionIndex, double intersectionRatio);
29
30 osg::ref_ptr<osg::MatrixTransform> osgNode;
31 osg::ref_ptr<osg::Switch> osgSwitchNode;
32 osg::ref_ptr<osg::Geode> wheelNode;
33 osg::ref_ptr<osg::Geode> wheelNodeSelected;
34
35 osg::Vec3d wheelPosition;
36 osg::Vec3d wheelNormal;
37 double wheelRadius;
38
39 double segmentLength;
40 int numberSegments;
41 double referenceAngleDeg;
42 double rotationAngleDeg;
43 double wheelRotationAngleDeg;
44};
45
@ point
Definition MonitorSettings.h:19
Definition HandleWheel.h:8
HandleWheel()=delete
virtual osg::Node * getNode(void) override
Definition HandleWheel.cpp:64
virtual void mouseOver(bool flag) override
Definition HandleWheel.cpp:235
virtual void setInteractionReference(int intersectionIndex, double intersectionRatio) override
Definition HandleWheel.cpp:241
virtual void setInteraction(int intersectionIndex, double intersectionRatio) override
Definition HandleWheel.cpp:248
osg::Vec3d getPosition(void)
Definition HandleWheel.h:21
void setPosition(osg::Vec3d pos)
Definition HandleWheel.cpp:229
virtual ~HandleWheel()
Definition HandleWheel.cpp:59
double getRotationAngleDeg(void)
Definition HandleWheel.h:23
Definition HandlerBase.h:29