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();
118 void FloatingSubtreeNode::boundingBox(
Vec3d &_bbMin,
Vec3d &_bbMax) {
119 if (enable_modelview_override_) {
121 BoundingBoxAction action;
135 Vec3d minVS = modelview_override_.transform_point(action.bbMin());
136 Vec3d maxVS = modelview_override_.transform_point(action.bbMax());
vector_type & maximize(const vector_type &_rhs)
maximize values: same as *this = max(*this, _rhs), but faster
Draw this node, but hide children.
Namespace providing different geometric functions concerning angles.
Draw node in second pass.
GLMatrixT< double > GLMatrixd
typedef
VectorT< double, 3 > Vec3d
ChildIter childrenBegin()
Returns: begin-iterator of children.
StatusMode status() const
Get node's status.
PickTarget
What target to use for picking.
vector_type & minimize(const vector_type &_rhs)
minimize values: same as *this = min(*this, _rhs), but faster
void traverse(BaseNode *_node, Action &_action)
ChildIter childrenEnd()
Returns: end-iterator of children.
std::vector< BaseNode * >::iterator ChildIter
allows to iterate over children