OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
RubberbandOsgWrapper.h
Go to the documentation of this file.
1/*
2 * File: RubberbandOsgWrapper.h
3 * Package: rbeWrapper
4 *
5 * Created on: September 17, 2021
6 * Author: Alexander Kuester
7 * Copyright (c) 2021 Alexander Kuester
8 * This file is part of the RubberbandEngine package.
9 * This file is subject to the terms and conditions defined in
10 * file 'LICENSE', which is part of this source code package.
11 */
12
13#pragma once
14
15// RBE header
18
19#include <osg/Array>
20#include <list>
21
22namespace osg {
23 class Geode;
24 class Switch;
25}
26
27namespace rbeWrapper {
28
30 public:
31
32 RubberbandOsgWrapper(osg::Switch *_parentGroup, coordinate_t _originU, coordinate_t _originV, coordinate_t _originW);
33 virtual ~RubberbandOsgWrapper();
34
35 // ############################################################################################
36
37 // Base class functions
38
39 virtual void addPoint(rbeCore::Point * _point) override;
40
41 virtual void replaceOrigin(coordinate_t _originU, coordinate_t _originV, coordinate_t _originW) override;
42
43 virtual void updateCurrent(coordinate_t _currentU, coordinate_t _currentV, coordinate_t _currentW) override;
44
45 virtual void setupFromJson(const char * _json) override;
46
47 virtual void clear(void) override;
48
51 virtual void activateStepOne(void) override;
52
55 virtual void activateNextStep(void) override;
56
57 virtual void applyCurrentStep(void) override;
58
59 // ############################################################################################
60
61 // Getter
62
63 osg::Geode * osgNode(void) { return m_node; }
64
65 float lineColorR(void) const { return m_r; }
66 float lineColorG(void) const { return m_g; }
67 float lineColorB(void) const { return m_b; }
68
69 bool isDepthTestActive(void) const { return m_depthTest; }
70
71 // ############################################################################################
72
73 // Setter
74
75 void setLineColor(float _r, float _g, float _b) { m_r = _r; m_g = _g; m_b = _b; }
76
77 void setDepthTestActive(bool _isActive) { m_depthTest = _isActive; }
78
79 protected:
80 void calculateEdges(std::list<osg::Vec3>& _list);
81
82 private:
83
84 void cleanupOsgData(void);
85
86 void buildNode(void);
87
88 void buildOriginNode(void);
89
90 void updateNode(void);
91
92 void updateOriginNode(void);
93
94 osg::Switch *m_parentGroup;
95 osg::Geode *m_node;
96
97 bool m_pickOriginEnabled;
98 float m_r;
99 float m_g;
100 float m_b;
101 bool m_depthTest;
102 int m_circleSegments;
103 };
104
105}
106
Definition Point.h:24
Definition RubberbandEngine.h:30
Definition RubberbandOsgWrapper.h:29
void setDepthTestActive(bool _isActive)
Definition RubberbandOsgWrapper.h:77
float lineColorG(void) const
Definition RubberbandOsgWrapper.h:66
float lineColorR(void) const
Definition RubberbandOsgWrapper.h:65
float lineColorB(void) const
Definition RubberbandOsgWrapper.h:67
osg::Geode * osgNode(void)
Definition RubberbandOsgWrapper.h:63
bool isDepthTestActive(void) const
Definition RubberbandOsgWrapper.h:69
void setLineColor(float _r, float _g, float _b)
Definition RubberbandOsgWrapper.h:75
float coordinate_t
Definition dataTypes.h:26
Definition RubberbandOsgWrapper.h:22
Definition RubberbandOsgWrapper.h:27
#define RBE_OSG_API_EXPORT
Definition rbeOsgWrapperDatatypes.h:18