99// / Macro used for testing only, to add attibutes to the TopologicalMesh
1010// / before subdivisition
1111// / \FIXME Must be removed once using Radium::IO with attribute loading.
12- // #define TEST_ATTRIBUTES_SUBDIV
12+ // #define TEST_ATTRIBUTES_SUBDIV
1313
1414struct args {
1515 bool valid;
1616 int iteration;
1717 std::string outputFilename;
1818 std::string inputFilename;
19- std::unique_ptr<
20- OpenMesh::Subdivider::Uniform:: SubdividerT<Ra::Core::Geometry::deprecated::TopologicalMesh, Scalar>>
19+ std::unique_ptr<OpenMesh::Subdivider::Uniform::
20+ SubdividerT<Ra::Core::Geometry::deprecated::TopologicalMesh, Scalar>>
2121 subdivider;
2222};
2323
@@ -41,42 +41,34 @@ void printHelp( char* argv[] ) {
4141
4242args processArgs ( int argc, char * argv[] ) {
4343 args ret;
44- bool outputFilenameSet{ false };
45- bool subdividerSet{ false };
44+ bool outputFilenameSet { false };
45+ bool subdividerSet { false };
4646 ret.iteration = 1 ;
4747
48- for ( int i = 1 ; i < argc; i += 2 )
49- {
50- if ( std::string ( argv[i] ) == std::string ( " -i" ) )
51- {
48+ for ( int i = 1 ; i < argc; i += 2 ) {
49+ if ( std::string ( argv[i] ) == std::string ( " -i" ) ) {
5250 if ( i + 1 < argc ) { ret.inputFilename = argv[i + 1 ]; }
5351 }
54- else if ( std::string ( argv[i] ) == std::string ( " -o" ) )
55- {
56- if ( i + 1 < argc )
57- {
52+ else if ( std::string ( argv[i] ) == std::string ( " -o" ) ) {
53+ if ( i + 1 < argc ) {
5854 ret.outputFilename = argv[i + 1 ];
5955 outputFilenameSet = true ;
6056 }
6157 }
62- else if ( std::string ( argv[i] ) == std::string ( " -s" ) )
63- {
64- if ( i + 1 < argc )
65- {
66- std::string a{argv[i + 1 ]};
58+ else if ( std::string ( argv[i] ) == std::string ( " -s" ) ) {
59+ if ( i + 1 < argc ) {
60+ std::string a { argv[i + 1 ] };
6761 subdividerSet = true ;
68- if ( a == std::string ( " catmull" ) )
69- {
62+ if ( a == std::string ( " catmull" ) ) {
7063 ret.subdivider = std::make_unique<Ra::Core::Geometry::CatmullClarkSubdivider>();
7164 }
72- else if ( a == std::string ( " loop" ) )
73- { ret.subdivider = std::make_unique<Ra::Core::Geometry::LoopSubdivider>(); }
74- else
75- { subdividerSet = false ; }
65+ else if ( a == std::string ( " loop" ) ) {
66+ ret.subdivider = std::make_unique<Ra::Core::Geometry::LoopSubdivider>();
67+ }
68+ else { subdividerSet = false ; }
7669 }
7770 }
78- else if ( std::string ( argv[i] ) == std::string ( " -n" ) )
79- {
71+ else if ( std::string ( argv[i] ) == std::string ( " -n" ) ) {
8072 if ( i + 1 < argc ) { ret.iteration = std::stoi ( std::string ( argv[i + 1 ] ) ); }
8173 }
8274 }
@@ -88,14 +80,13 @@ int main( int argc, char* argv[] ) {
8880 using namespace Ra ::Core::Utils; // log
8981 args a = processArgs ( argc, argv );
9082 if ( !a.valid ) { printHelp ( argv ); }
91- else
92- {
83+ else {
9384 Ra::Core::Geometry::TriangleMesh mesh;
9485 Ra::IO ::OBJFileManager obj;
9586
9687 // Load geometry as triangle
9788 if ( a.inputFilename .empty () ) { mesh = Ra::Core::Geometry::makeBox (); }
98- else { obj.load ( a.inputFilename , mesh ); }
89+ else { obj.load ( a.inputFilename , mesh ); }
9990
10091 // Create topological structure
10192 Ra::Core::Geometry::deprecated::TopologicalMesh topologicalMesh ( mesh );
0 commit comments