MCPcopy Create free account
hub / github.com/cutdigital/mcut / main

Function main

tutorials/BasicCmdLineApp/BasicCmdLineApp.cpp:74–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72 const void* userParam);
73
74int main(int argc, char* argv[])
75{
76 bool help = false;
77
78 for (int i = 0; help == false && i < argc; ++i) {
79 if (!strcmp("--help", argv[i]) || !strcmp("-h", argv[i])) {
80 help = true;
81 }
82 }
83
84 if (help || argc < 3) {
85 fprintf(stdout, "<exe> <path/to/source-mesh> <path/to/cut-mesh>\n\nSupported file types: obj\n");
86 return 1;
87 }
88
89 const char* srcMeshFilePath = argv[1];
90 const char* cutMeshFilePath = argv[2];
91
92 MioMesh srcMesh = {
93 nullptr, // pVertices
94 nullptr, // pNormals
95 nullptr, // pTexCoords
96 nullptr, // pFaceSizes
97 nullptr, // pFaceVertexIndices
98 nullptr, // pFaceVertexTexCoordIndices
99 nullptr, // pFaceVertexNormalIndices
100 0, // numVertices
101 0, // numNormals
102 0, // numTexCoords
103 0, // numFaces
104 };
105
106 MioMesh cutMesh = srcMesh;
107
108 //
109 // read-in the source-mesh from file
110 //
111 mioReadOBJ(srcMeshFilePath,
112 &srcMesh.pVertices,
113 &srcMesh.pNormals,
114 &srcMesh.pTexCoords,
115 &srcMesh.pFaceSizes,
116 &srcMesh.pFaceVertexIndices,
117 &srcMesh.pFaceVertexTexCoordIndices,
118 &srcMesh.pFaceVertexNormalIndices,
119 &srcMesh.numVertices,
120 &srcMesh.numNormals,
121 &srcMesh.numTexCoords,
122 &srcMesh.numFaces);
123
124 //
125 // read-in the cut-mesh from file
126 //
127
128 mioReadOBJ(cutMeshFilePath,
129 &cutMesh.pVertices,
130 &cutMesh.pNormals,
131 &cutMesh.pTexCoords,

Callers

nothing calls this directly

Calls 9

mcCreateContextFunction · 0.85
mcGetInfoFunction · 0.85
mcDebugMessageCallbackFunction · 0.85
mcDebugMessageControlFunction · 0.85
mcDispatchFunction · 0.85
mcGetConnectedComponentsFunction · 0.85
mcReleaseContextFunction · 0.85

Tested by

no test coverage detected