45 #if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) 47 #include "../../ACG/Scenegraph/FloatingSubtreeNode.hh" 49 #include <ACG/GL/IRenderer.hh> 54 FloatingSubtreeNode::FloatingSubtreeNode(
56 BaseNode *_parent,
const std::string &_name)
59 modelview_override_(
std::move(modelview_override)),
60 enable_modelview_override_(true),
61 enable_overlay_(true) {
63 modelview_override_inv_ = modelview_override_;
64 modelview_override_inv_.invert();
67 FloatingSubtreeNode::~FloatingSubtreeNode() {
71 void FloatingSubtreeNode::enter(GLState &_state,
72 const DrawModes::DrawMode &_drawMode) {
73 if (enable_modelview_override_) {
74 _state.push_modelview_matrix();
75 _state.set_modelview(modelview_override_, modelview_override_inv_);
79 void FloatingSubtreeNode::enter(IRenderer* _renderer, GLState& _state,
80 const DrawModes::DrawMode& _drawMode) {
81 FloatingSubtreeNode::enter(_state, _drawMode);
84 void FloatingSubtreeNode::leave(GLState &_state,
85 const DrawModes::DrawMode &_drawMode) {
86 if (enable_modelview_override_) {
87 _state.pop_modelview_matrix();
91 void FloatingSubtreeNode::leave(IRenderer* _renderer, GLState& _state,
92 const DrawModes::DrawMode& _drawMode) {
93 FloatingSubtreeNode::leave(_state, _drawMode);
94 if (enable_overlay_) {
95 for (
auto &obj_it : _renderer->getCollectedSubtreeObjects()) {
96 obj_it.overlay =
true;
102 void FloatingSubtreeNode::enterPick(GLState &_state,
PickTarget _target,
103 const DrawModes::DrawMode &_drawMode) {
104 FloatingSubtreeNode::enter(_state, _drawMode);
107 void FloatingSubtreeNode::leavePick(GLState &_state,
PickTarget _target,
108 const DrawModes::DrawMode &_drawMode) {
109 FloatingSubtreeNode::leave(_state, _drawMode);
112 void FloatingSubtreeNode::setModelViewOverride(
GLMatrixd modelview_override) {
113 modelview_override_ = std::move(modelview_override);
114 modelview_override_inv_ = modelview_override_;
115 modelview_override_inv_.invert();
PickTarget
What target to use for picking.
GLMatrixT< double > GLMatrixd
typedef
Namespace providing different geometric functions concerning angles.