1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
Description: CPP for executable
Author: Christophe Trophime <christrophime@googlemail.com>
Last-Update: 2014-02-10
Index: tetgen/tetgen_main.cxx
===================================================================
--- /dev/null
+++ tetgen/tetgen_main.cxx
@@ -0,0 +1,62 @@
+///////////////////////////////////////////////////////////////////////////////
+// //
+// TetGen //
+// //
+// A Quality Tetrahedral Mesh Generator and A 3D Delaunay Triangulator //
+// //
+// Version 1.5 //
+// November 4, 2013 //
+// //
+// TetGen is freely available through the website: http://www.tetgen.org. //
+// It may be copied, modified, and redistributed for non-commercial use. //
+// Please consult the file LICENSE for the detailed copyright notices. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "tetgen.h"
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// main() The command line interface of TetGen. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+int main(int argc, char *argv[])
+{
+ tetgenbehavior b;
+
+ tetgenio in, addin, bgmin;
+
+ if (!b.parse_commandline(argc, argv)) {
+ terminatetetgen(NULL, 10);
+ }
+
+ // Read input files.
+ if (b.refine) { // -r
+ if (!in.load_tetmesh(b.infilename, (int) b.object)) {
+ terminatetetgen(NULL, 10);
+ }
+ } else { // -p
+ if (!in.load_plc(b.infilename, (int) b.object)) {
+ terminatetetgen(NULL, 10);
+ }
+ }
+ if (b.insertaddpoints) { // -i
+ // Try to read a .a.node file.
+ addin.load_node(b.addinfilename);
+ }
+ if (b.metric) { // -m
+ // Try to read a background mesh in files .b.node, .b.ele.
+ bgmin.load_tetmesh(b.bgmeshfilename, (int) b.object);
+ }
+
+ tetrahedralize(&b, &in, NULL, &addin, &bgmin);
+
+ return 0;
+}
+
+//// ////
+//// ////
+//// main_cxx /////////////////////////////////////////////////////////////////
+
|