First checkin for OpenMesh 2.0
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@2 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
14
Doc/Examples/draw_normals.cc
Normal file
14
Doc/Examples/draw_normals.cc
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <OpenMesh/Core/Utils/GenProg.hh>
|
||||
|
||||
// draw a face normal if we have one
|
||||
void drawFaceNormal(const MyMesh::Face& _f) {
|
||||
drawFaceNormal(_f, GenProg::Bool2Type<OM_Check_Attrib(MyMesh::Face, Normal)>());
|
||||
}
|
||||
|
||||
// normal exists -> use it
|
||||
void drawFaceNormal(const MyMesh::Face& _f, GenProg::Bool2Type<true>) {
|
||||
glNormal3fv(_f.normal());
|
||||
}
|
||||
|
||||
// empty dummy (no normals)
|
||||
void drawFaceNormal(const MyMesh::Face& _f, GenProg::Bool2Type<false>){}
|
||||
Reference in New Issue
Block a user