Shows the basic usage of the mesh analyzer toolCan be used with graphviz neato to render an image of the generated adjacency graph:
./001_shape2dot | neato -T png > 001_shape2dot.png
Copyright 2008-2014 Matus Chochlik. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <cassert>
#include <iostream>
#include <GL/glew.h>
int main(void)
{
try
{
using namespace oglplus;
std::cout << "graph Shape {" << std::endl;
std::cout << "\tsplines=true;" << std::endl;
std::cout << "\tnode [shape=box];" << std::endl;
auto tm =
{
Vec4d v0 = face.Vert(0).MainAttrib();
Vec4d v1 = face.Vert(1).MainAttrib();
Vec4d v2 = face.Vert(2).MainAttrib();
std::cout
<< "\tf" << f
<< " [label=\"" << f << "\""
<<
", pos=\"" << v.x() <<
"," << v.
y() <<
"\""
<< "];" << std::endl;
}
std::cout
<< "\tnode ["
<< "shape=circle,"
<< "style=filled,"
<< "fillcolor=\"#00FF00\""
<< "];" << std::endl;
{
for(GLuint e=0; e!=face.Arity(); ++e)
{
std::cout
<< "\tf" << f
<< "e" << e
<< " [label=\"" << e
<< "\"];" << std::endl;
std::cout
<< "\tf" << f
<< " -- "
<< "f" << f
<< "e" << e
<< ";" << std::endl;
}
}
{
for(GLuint e=0; e!=face.Arity(); ++e)
{
auto edge = face.
Edge(e);
if(edge.HasAdjacentEdge())
{
GLuint ae = adje.
Index();
GLuint af = adje.Face().Index();
if(f < af)
{
std::cout
<< "\tf" << f
<< "e" << e
<< " -- f" << af
<< "e" << ae;
if(edge.IsStripEdge())
{
std::cout << " [style=bold]";
}
else
{
std::cout << " [style=dotted]";
}
std::cout << std::endl;
}
}
}
}
std::cout << "\toverlap=false;" << std::endl;
std::cout << "}" << std::endl;
return 0;
}
{
std::cerr
<< "Error (in "
<< "'): "
<< err.what()
<< " ["
<< ":"
<< "] "
<< std::endl;
}
return 1;
}