specify max. normal deviation via command line parameter
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@293 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
@@ -202,7 +202,7 @@ void usage_and_exit(int xcode)
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
cout << endl
|
cout << endl
|
||||||
<< "Usage: mkbalancedpm [-n <decimation-steps>] [-o <output>] "
|
<< "Usage: mkbalancedpm [-n <decimation-steps>] [-o <output>] [-N <max. normal deviation>]"
|
||||||
<< "<input.ext>\n"
|
<< "<input.ext>\n"
|
||||||
<< endl
|
<< endl
|
||||||
<< " Create a balanced progressive mesh from an input file.\n"
|
<< " Create a balanced progressive mesh from an input file.\n"
|
||||||
@@ -219,7 +219,7 @@ void usage_and_exit(int xcode)
|
|||||||
<< " -o <output>\n"
|
<< " -o <output>\n"
|
||||||
<< "\tWrite resulting progressive mesh to the file named <output>\n"
|
<< "\tWrite resulting progressive mesh to the file named <output>\n"
|
||||||
<< endl
|
<< endl
|
||||||
<< " -N\n"
|
<< " -N <max. normal Deviation>\n"
|
||||||
<< "\tEnable Normal Flipping\n"
|
<< "\tEnable Normal Flipping\n"
|
||||||
<< endl
|
<< endl
|
||||||
<< " -I\n"
|
<< " -I\n"
|
||||||
@@ -237,16 +237,18 @@ int main(int argc, char **argv)
|
|||||||
int c;
|
int c;
|
||||||
std::string ifname, ofname;
|
std::string ifname, ofname;
|
||||||
size_t decstep=0;
|
size_t decstep=0;
|
||||||
|
float normalDev=90.0;
|
||||||
bool enable_modNF = false;
|
bool enable_modNF = false;
|
||||||
bool enable_modIS = false;
|
bool enable_modIS = false;
|
||||||
|
|
||||||
while ((c=getopt(argc, argv, "n:o:NIh"))!=-1)
|
while ((c=getopt(argc, argv, "n:o:N:Ih"))!=-1)
|
||||||
{
|
{
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case 'o': ofname = optarg; break;
|
case 'o': ofname = optarg; break;
|
||||||
case 'n': { std::stringstream str; str << optarg; str >> decstep; } break;
|
case 'n': { std::stringstream str; str << optarg; str >> decstep; } break;
|
||||||
case 'N': enable_modNF = true; break;
|
case 'N': { enable_modNF = true;
|
||||||
|
std::stringstream str; str << optarg; str >> normalDev; } break;
|
||||||
case 'I': enable_modIS = true; break;
|
case 'I': enable_modIS = true; break;
|
||||||
case 'h':
|
case 'h':
|
||||||
usage_and_exit(0);
|
usage_and_exit(0);
|
||||||
@@ -283,9 +285,12 @@ int main(int argc, char **argv)
|
|||||||
std::cout << "w/ balancer module\n";
|
std::cout << "w/ balancer module\n";
|
||||||
|
|
||||||
if ( enable_modNF )
|
if ( enable_modNF )
|
||||||
|
{
|
||||||
decimater.add(modNF);
|
decimater.add(modNF);
|
||||||
|
decimater.module(modNF).set_max_normal_deviation(normalDev);
|
||||||
|
}
|
||||||
std::cout << "w/" << (modNF.is_valid() ? ' ' : 'o')
|
std::cout << "w/" << (modNF.is_valid() ? ' ' : 'o')
|
||||||
<< " normal flipping module\n";
|
<< " normal flipping module (max. normal deviation: " << normalDev << ")\n";
|
||||||
|
|
||||||
if ( enable_modIS )
|
if ( enable_modIS )
|
||||||
decimater.add(modIS);
|
decimater.add(modIS);
|
||||||
|
|||||||
Reference in New Issue
Block a user