OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
TransformManipulator.h
Go to the documentation of this file.
1#pragma once
2
3#include "HandlerBase.h"
4#include "ManipulatorBase.h"
5
6class Viewer;
7class SceneNodeBase;
8class HandleArrow;
9class HandleWheel;
10
11#include <osg/Vec3d>
12
13#include "rapidjson/document.h"
14
16{
17public:
19 TransformManipulator(Viewer *viewer, std::list<SceneNodeBase *> objects);
20
21 virtual ~TransformManipulator();
22
23 virtual void handlerInteraction(HandlerBase *handler) override;
24
25 virtual void cancelOperation(void) override;
26 virtual void performOperation(void) override;
27
28 virtual bool propertyGridValueChanged(const ot::Property* _property) override;
29
30private:
31 void getBoundingSphere(osg::Vec3d &center, double &radius, std::list<SceneNodeBase *> objects);
32 void updateHandlerPositions(void);
33 void storeTransformations(void);
34 void applyObjectTransformations(void);
35 void setPropertyGrid(void);
36 void updatePropertyGrid(void);
37 void addSetting(rapidjson::Document &jsonDoc, const std::string &group, const std::string &name, double value);
38 void updateSetting(const std::string& _groupName, const std::string& _itemName, double value);
39
40 osg::Vec3d sphereCenter;
41 osg::Vec3d initialSphereCenter;
42 double sphereRadius;
43 HandleArrow *arrowHandlers[6];
44 HandleWheel *wheelHandlers[3];
45 osg::Vec3d handlerPosition[6];
46 Viewer *viewer3D;
47 std::list<SceneNodeBase *> transformedObjects;
48 std::map<SceneNodeBase *, osg::Matrix> initialObjectTransform;
49 osg::Vec3d lastPropertyOffset;
50 osg::Vec3d lastPropertyAxis;
51 double lastPropertyAngle;
52 double rotationDegX;
53 double rotationDegY;
54 double rotationDegZ;
55 osg::Matrix totalRotation;
56 osg::Matrix workingPlaneRotation;
57};
58
bsoncxx::types::value value
Definition DocumentManager.h:16
Definition HandleArrow.h:8
Definition HandleWheel.h:8
Definition HandlerBase.h:29
Definition HandlerBase.h:20
Definition ManipulatorBase.h:11
Definition SceneNodeBase.h:14
Definition TransformManipulator.h:16
virtual void cancelOperation(void) override
Definition TransformManipulator.cpp:133
virtual bool propertyGridValueChanged(const ot::Property *_property) override
Definition TransformManipulator.cpp:482
virtual void handlerInteraction(HandlerBase *handler) override
Definition TransformManipulator.cpp:244
virtual ~TransformManipulator()
Definition TransformManipulator.cpp:113
TransformManipulator()=delete
virtual void performOperation(void) override
Definition TransformManipulator.cpp:154
Simple 3D viewer.
Definition Viewer.h:41
The Property class is used as a base class for all Properties that can be displayed and modified in t...
Definition Property.h:21