60 #ifndef ACG_STATUS_NODES_HH 61 #define ACG_STATUS_NODES_HH 69 #include "MaterialNode.hh" 70 #include "DrawModes.hh" 72 #include <ACG/GL/VertexDeclaration.hh> 73 #include <ACG/GL/IRenderer.hh> 74 #include <ACG/GL/DrawMesh.hh> 98 template<
class Mesh,
class Mod>
108 bool is_vertex_selected(
110 return Mod::is_vertex_selected(mesh, vh);
113 bool is_halfedge_selected(
114 const Mesh &mesh,
typename Mesh::HalfedgeHandle heh) {
115 return Mod::is_halfedge_selected(mesh, heh);
118 bool is_edge_selected(
const Mesh &mesh,
typename Mesh::EdgeHandle eh) {
119 return Mod::is_edge_selected(mesh, eh);
122 bool is_face_selected(
const Mesh &mesh,
typename Mesh::FaceHandle fh) {
123 return Mod::is_face_selected(mesh, fh);
127 template<
class Mesh,
class Mod>
150 bool is_vertex_selected(
153 return modInstance->is_vertex_selected(mesh, vh);
156 bool is_halfedge_selected(
157 const Mesh &mesh,
typename Mesh::HalfedgeHandle heh) {
159 return modInstance->is_halfedge_selected(mesh, heh);
162 bool is_edge_selected(
const Mesh &mesh,
typename Mesh::EdgeHandle eh) {
164 return modInstance->is_edge_selected(mesh, eh);
167 bool is_face_selected(
const Mesh &mesh,
typename Mesh::FaceHandle fh) {
169 return modInstance->is_face_selected(mesh, fh);
182 template <
class Mesh,
class Mod>
184 public StatusNodeBaseT<Mesh, Mod, ::StatusNodes_ModTraits<Mod>::StaticUsage>
193 const std::string& _name =
"<StatusNode>" );
198 ACG_CLASSNAME(StatusNode);
203 void updateGeometry();
207 void updateTopology();
211 void updateSelection();
232 void boundingBox(
Vec3d& _bbMin,
Vec3d& _bbMax);
248 typedef typename Mesh::FaceHandle FaceHandle;
249 typedef typename Mesh::HalfedgeHandle HalfedgeHandle;
256 void draw_halfedges();
257 void draw_faces(
bool _per_vertex);
259 Point halfedge_point(
const HalfedgeHandle _heh);
267 std::vector<unsigned int> v_cache_, e_cache_, f_cache_, poly_cache_;
268 std::vector<FaceHandle> fh_cache_;
270 std::vector<Point> he_points_;
271 std::vector<Normal> he_normals_;
280 bool vertexIndexInvalid_;
281 bool halfedgeCacheInvalid_;
282 bool edgeIndexInvalid_;
283 bool faceIndexInvalid_;
296 template <
class Mesh,
unsigned int Bit>
299 static bool is_vertex_selected(
const Mesh& _mesh,
302 return _mesh.status(_vh).is_bit_set(Bit);
305 static bool is_edge_selected(
const Mesh& _mesh,
306 typename Mesh::EdgeHandle _eh)
308 return _mesh.status(_eh).is_bit_set(Bit);
311 static bool is_halfedge_selected(
const Mesh& _mesh,
312 typename Mesh::HalfedgeHandle _heh)
314 return _mesh.status(_heh).is_bit_set(Bit);
317 static bool is_face_selected(
const Mesh& _mesh,
318 typename Mesh::FaceHandle _fh)
320 return _mesh.status(_fh).is_bit_set(Bit);
329 template <
class Mesh>
331 :
public StatusModT<Mesh, OpenMesh::Attributes::SELECTED>
341 template <
class Mesh>
343 :
virtual public StatusNodeT<Mesh, SelectionModT<Mesh> >
354 const std::string& _name =
"<SelectionNode>" )
363 template <
class Mesh>
365 :
public StatusModT<Mesh, OpenMesh::Attributes::LOCKED>
369 template <
class Mesh>
376 const std::string& _name =
"<LockNode>" )
386 #if defined(INCLUDE_TEMPLATES) && !defined(ACG_STATUS_NODES_C) 387 #define ACG_STATUS_NODES_TEMPLATES 388 #include "StatusNodesT.cc" 391 #endif // ACG_STATUS_NODES_HH defined
SelectionNodeT(const Mesh &_mesh, BaseNode *_parent=0, const std::string &_name="<SelectionNode>")
Constructor.
Add normals to mesh item (vertices/faces)
Kernel::Edge Edge
Edge type.
bool invalidGeometry_
State variables.
Class to define the vertex input layout.
ACG::SceneGraph::MaterialNode MaterialNode
Materialnode.
PickTarget
What target to use for picking.
Kernel::Normal Normal
Normal type.
Kernel::Halfedge Halfedge
Halfedge type.
Kernel::Vertex Vertex
Vertex type.
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
Namespace providing different geometric functions concerning angles.
Kernel::Face Face
Face type.
void provideModInstance(Mod *mod)
Kernel::Point Point
Coordinate type.
virtual ~StatusNodeT()
destructor