49 #ifndef STATUSVIEWNODE_C 50 #define STATUSVIEWNODE_C 54 #include "StatusViewNodeT.hh" 55 #include <ACG/Scenegraph/DrawModes.hh> 66 StatusViewNodeT<MeshT>::StatusViewNodeT(
68 const std::string& _name,
74 statusNode_(_statusNode),
76 handleNode_(_handleNode),
77 featureNode_(_featureNode),
78 statusNodeVis_(false),
80 handleNodeVis_(false),
81 featureNodeVis_(false)
87 template <
class MeshT>
88 void StatusViewNodeT<MeshT>::draw( GLState& _state,
const DrawModes::DrawMode& _drawMode )
92 DrawModes::DrawMode singleLayers[4];
95 for (
int i = 0; i < 4; ++i)
96 singleLayers[i].removeLayer(0u);
98 for (
unsigned int i = 0; i < _drawMode.getNumLayers(); ++i)
100 const DrawModes::DrawModeProperties* props = _drawMode.getLayer(i);
102 switch (props->primitive())
104 case DrawModes::PRIMITIVE_POLYGON: singleLayers[0].setDrawModeProperties(props);
break;
105 case DrawModes::PRIMITIVE_EDGE: singleLayers[1].setDrawModeProperties(props);
break;
106 case DrawModes::PRIMITIVE_HALFEDGE: singleLayers[2].setDrawModeProperties(props);
break;
107 case DrawModes::PRIMITIVE_POINT: singleLayers[3].setDrawModeProperties(props);
break;
114 for (
int i = 0; i < 4; ++i)
117 if (singleLayers[i].getNumLayers() == 0)
119 DrawModes::DrawModeProperties defaultProps;
123 case 0: defaultProps.primitive(DrawModes::PRIMITIVE_POLYGON);
break;
124 case 1: defaultProps.primitive(DrawModes::PRIMITIVE_EDGE);
break;
125 case 2: defaultProps.primitive(DrawModes::PRIMITIVE_HALFEDGE);
break;
126 case 3: defaultProps.primitive(DrawModes::PRIMITIVE_POINT);
break;
130 singleLayers[i].addLayer(&defaultProps);
137 areaNode_->enter(_state, singleLayers[i]);
138 areaNode_->draw(_state, singleLayers[i]);
139 areaNode_->leave(_state, singleLayers[i]);
144 handleNode_->enter(_state, singleLayers[i]);
145 handleNode_->draw(_state, singleLayers[i]);
146 handleNode_->leave(_state, singleLayers[i]);
151 featureNode_->enter(_state, singleLayers[i]);
152 featureNode_->draw(_state, singleLayers[i]);
153 featureNode_->leave(_state, singleLayers[i]);
158 statusNode_->enter(_state, singleLayers[i]);
159 statusNode_->draw(_state, singleLayers[i]);
160 statusNode_->leave(_state, singleLayers[i]);
168 template <
class MeshT>
169 void StatusViewNodeT<MeshT>::getRenderObjects(IRenderer* _renderer, GLState& _state ,
const DrawModes::DrawMode& _drawMode ,
const Material* _mat)
176 DrawModes::DrawMode singleLayers[4];
179 for (
int i = 0; i < 4; ++i)
180 singleLayers[i].removeLayer(0u);
182 for (
unsigned int i = 0; i < _drawMode.getNumLayers(); ++i)
184 const DrawModes::DrawModeProperties* props = _drawMode.getLayer(i);
186 switch (props->primitive())
188 case DrawModes::PRIMITIVE_POLYGON: singleLayers[0].setDrawModeProperties(props);
break;
189 case DrawModes::PRIMITIVE_EDGE: singleLayers[1].setDrawModeProperties(props);
break;
190 case DrawModes::PRIMITIVE_HALFEDGE: singleLayers[2].setDrawModeProperties(props);
break;
191 case DrawModes::PRIMITIVE_POINT: singleLayers[3].setDrawModeProperties(props);
break;
199 for (
int i = 0; i < 4; ++i)
202 if (singleLayers[i].getNumLayers() == 0)
204 DrawModes::DrawModeProperties defaultProps;
208 case 0: defaultProps.primitive(DrawModes::PRIMITIVE_POLYGON);
break;
209 case 1: defaultProps.primitive(DrawModes::PRIMITIVE_EDGE);
break;
210 case 2: defaultProps.primitive(DrawModes::PRIMITIVE_HALFEDGE);
break;
211 case 3: defaultProps.primitive(DrawModes::PRIMITIVE_POINT);
break;
215 singleLayers[i].addLayer(&defaultProps);
235 template <
class MeshT>
236 void StatusViewNodeT<MeshT>::enter( GLState& _state,
const DrawModes::DrawMode& _drawmode )
238 statusNodeVis_ = statusNode_ && statusNode_->visible();
239 areaNodeVis_ = areaNode_ && areaNode_->visible();
240 handleNodeVis_ = handleNode_ && handleNode_->visible();
241 featureNodeVis_ = featureNode_ && featureNode_->visible();
253 featureNode_->hide();
258 template <
class MeshT>
259 void StatusViewNodeT<MeshT>::leave( GLState& _state,
const DrawModes::DrawMode& _drawmode )
268 featureNode_->show();
275 #endif // STATUSVIEWNODE_C Namespace providing different geometric functions concerning angles.
void getRenderObjects(IRenderer *_renderer, GLState &_state, const DrawModes::DrawMode &_drawMode, const class Material *_mat)
support for shader-pipeline