MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / main

Function main

Tools/MeshSkinning/main.cpp:124–273  ·  view source on GitHub ↗

main

Source from the content-addressed store, hash-verified

122
123// main
124int main( int argc, char **argv )
125{
126 REPORT_MEMORY_LEAKS;
127
128 Utilities::logger.addSink(shared_ptr<Utilities::ConsoleSink>(new Utilities::ConsoleSink(Utilities::LogLevel::INFO)));
129 exePath = FileSystem::getProgramPath();
130
131 try
132 {
133 cxxopts::Options options(argv[0], "MeshSkinning");
134
135 options.add_options()
136 ("i,input", "Input file ", cxxopts::value<std::string>())
137 ("o,output", "Output file", cxxopts::value<std::string>())
138 ("m,mesh", "Mesh file ", cxxopts::value<std::string>())
139 ("scene", "Scene file (all settings are imported from the scene file)", cxxopts::value<std::string>())
140 ("partioPath", "Path of the partio files (when using a scene file). If not set, it is assumed that the files are in the standard output path.", cxxopts::value<std::string>())
141 ("scale", "Scaling of input geometry (e.g. --scale 2,1,2)", cxxopts::value<std::vector<Real>>()->default_value("1,1,1"))
142 ("t,translation", "Translation of input geometry (e.g. --translation 2,1,2)", cxxopts::value<std::vector<Real>>()->default_value("0,0,0"))
143 ("axis", "Rotation axis of input geometry (e.g. --axis 1,0,0)", cxxopts::value<std::vector<Real>>()->default_value("1,0,0"))
144 ("angle", "Angle of input geometry (e.g. --angle 1)", cxxopts::value<Real>()->default_value("0.0"))
145 ("s,startframe", "Start frame", cxxopts::value<unsigned int>()->default_value("1"))
146 ("e,endframe", "End frame", cxxopts::value<unsigned int>())
147 ("r,radius", "Particle radius", cxxopts::value<Real>()->default_value("0.025"))
148 ("supportRadiusFactor", "The support radius is defined as factor*particleRadius", cxxopts::value<Real>()->default_value("6.0"))
149 ("maxNeighbors", "The maximum number of neighbors that are used for the interpolation.", cxxopts::value<unsigned int>()->default_value("60"))
150 ("splitting", "Read a scene which used the object splitting export option.")
151 ("overwrite", "Overwrite existing files.")
152 ("h,help", "Print help")
153 ;
154
155 auto result = options.parse(argc, argv);
156
157 if (result.count("help"))
158 {
159 std::cout << options.help({ "", "Group" }) << std::endl;
160 exit(0);
161 }
162
163 if (result.count("input"))
164 {
165 input = result["input"].as<std::string>();
166 LOG_INFO << "Input = " << input;
167 }
168 if (result.count("output"))
169 {
170 output = result["output"].as<std::string>();
171 LOG_INFO << "Output = " << output;
172 output_format = 0;
173 if (Utilities::StringTools::to_upper(FileSystem::getFileExt(output)) == "VTK")
174 output_format = 1;
175 else if (Utilities::StringTools::to_upper(FileSystem::getFileExt(output)) == "PLY")
176 output_format = 2;
177 }
178 if (result.count("mesh"))
179 {
180 meshFile = result["mesh"].as<std::string>();
181 LOG_INFO << "mesh = " << meshFile;

Callers

nothing calls this directly

Calls 10

performMeshSkinningFunction · 0.85
addSinkMethod · 0.80
add_optionsMethod · 0.80
default_valueMethod · 0.80
helpMethod · 0.80
parseMethod · 0.45
countMethod · 0.45
dataMethod · 0.45
normalizeMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected