57 #ifndef STATUSVIEWNODE_C
58 #define STATUSVIEWNODE_C
62 #include "StatusViewNodeT.hh"
63 #include <ACG/Scenegraph/DrawModes.hh>
74 StatusViewNodeT<MeshT>::StatusViewNodeT(
76 const std::string& _name,
82 statusNode_(_statusNode),
84 handleNode_(_handleNode),
85 featureNode_(_featureNode),
86 statusNodeVis_(false),
88 handleNodeVis_(false),
89 featureNodeVis_(false)
95 template <
class MeshT>
96 void StatusViewNodeT<MeshT>::draw( GLState& _state,
const DrawModes::DrawMode& _drawMode )
100 DrawModes::DrawMode singleLayers[4];
103 for (
int i = 0; i < 4; ++i)
104 singleLayers[i].removeLayer(0u);
106 for (
unsigned int i = 0; i < _drawMode.getNumLayers(); ++i)
108 const DrawModes::DrawModeProperties* props = _drawMode.getLayer(i);
110 switch (props->primitive())
112 case DrawModes::PRIMITIVE_POLYGON: singleLayers[0].setDrawModeProperties(props);
break;
113 case DrawModes::PRIMITIVE_EDGE: singleLayers[1].setDrawModeProperties(props);
break;
114 case DrawModes::PRIMITIVE_HALFEDGE: singleLayers[2].setDrawModeProperties(props);
break;
115 case DrawModes::PRIMITIVE_POINT: singleLayers[3].setDrawModeProperties(props);
break;
122 for (
int i = 0; i < 4; ++i)
125 if (singleLayers[i].getNumLayers() == 0)
127 DrawModes::DrawModeProperties defaultProps;
131 case 0: defaultProps.primitive(DrawModes::PRIMITIVE_POLYGON);
break;
132 case 1: defaultProps.primitive(DrawModes::PRIMITIVE_EDGE);
break;
133 case 2: defaultProps.primitive(DrawModes::PRIMITIVE_HALFEDGE);
break;
134 case 3: defaultProps.primitive(DrawModes::PRIMITIVE_POINT);
break;
138 singleLayers[i].addLayer(&defaultProps);
145 areaNode_->
enter(_state, singleLayers[i]);
146 areaNode_->draw(_state, singleLayers[i]);
147 areaNode_->leave(_state, singleLayers[i]);
152 handleNode_->enter(_state, singleLayers[i]);
153 handleNode_->draw(_state, singleLayers[i]);
154 handleNode_->leave(_state, singleLayers[i]);
159 featureNode_->enter(_state, singleLayers[i]);
160 featureNode_->draw(_state, singleLayers[i]);
161 featureNode_->leave(_state, singleLayers[i]);
166 statusNode_->enter(_state, singleLayers[i]);
167 statusNode_->draw(_state, singleLayers[i]);
168 statusNode_->leave(_state, singleLayers[i]);
176 template <
class MeshT>
177 void StatusViewNodeT<MeshT>::getRenderObjects(IRenderer* _renderer, GLState& _state ,
const DrawModes::DrawMode& _drawMode ,
const Material* _mat)
184 DrawModes::DrawMode singleLayers[4];
187 for (
int i = 0; i < 4; ++i)
188 singleLayers[i].removeLayer(0u);
190 for (
unsigned int i = 0; i < _drawMode.getNumLayers(); ++i)
192 const DrawModes::DrawModeProperties* props = _drawMode.getLayer(i);
194 switch (props->primitive())
196 case DrawModes::PRIMITIVE_POLYGON: singleLayers[0].setDrawModeProperties(props);
break;
197 case DrawModes::PRIMITIVE_EDGE: singleLayers[1].setDrawModeProperties(props);
break;
198 case DrawModes::PRIMITIVE_HALFEDGE: singleLayers[2].setDrawModeProperties(props);
break;
199 case DrawModes::PRIMITIVE_POINT: singleLayers[3].setDrawModeProperties(props);
break;
207 for (
int i = 0; i < 4; ++i)
210 if (singleLayers[i].getNumLayers() == 0)
212 DrawModes::DrawModeProperties defaultProps;
216 case 0: defaultProps.primitive(DrawModes::PRIMITIVE_POLYGON);
break;
217 case 1: defaultProps.primitive(DrawModes::PRIMITIVE_EDGE);
break;
218 case 2: defaultProps.primitive(DrawModes::PRIMITIVE_HALFEDGE);
break;
219 case 3: defaultProps.primitive(DrawModes::PRIMITIVE_POINT);
break;
223 singleLayers[i].addLayer(&defaultProps);
227 statusNode_->getRenderObjects(_renderer, _state, singleLayers[i], _mat);
230 areaNode_->getRenderObjects(_renderer, _state, singleLayers[i], _mat);
233 handleNode_->getRenderObjects(_renderer, _state, singleLayers[i], _mat);
236 featureNode_->getRenderObjects(_renderer, _state, singleLayers[i], _mat);
243 template <
class MeshT>
244 void StatusViewNodeT<MeshT>::enter( GLState& _state,
const DrawModes::DrawMode& _drawmode )
246 statusNodeVis_ = statusNode_ && statusNode_->visible();
247 areaNodeVis_ = areaNode_ && areaNode_->visible();
248 handleNodeVis_ = handleNode_ && handleNode_->visible();
249 featureNodeVis_ = featureNode_ && featureNode_->visible();
261 featureNode_->hide();
266 template <
class MeshT>
267 void StatusViewNodeT<MeshT>::leave( GLState& _state,
const DrawModes::DrawMode& _drawmode )
276 featureNode_->show();
283 #endif // STATUSVIEWNODE_C
Namespace providing different geometric functions concerning angles.
virtual void enter(GLState &, const DrawModes::DrawMode &)