star-meshtool

Mesh transformation
git clone git://git.meso-star.fr/star-meshtool.git
Log | Files | Refs | README | LICENSE

mtool_args.h (2497B)


      1 /* Copyright (C) 2025 |Méso|Star> (contact@meso-star.com)
      2  *
      3  * This program is free software: you can redistribute it and/or modify
      4  * it under the terms of the GNU General Public License as published by
      5  * the Free Software Foundation, either version 3 of the License, or
      6  * (at your option) any later version.
      7  *
      8  * This program is distributed in the hope that it will be useful,
      9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     11  * GNU General Public License for more details.
     12  *
     13  * You should have received a copy of the GNU General Public License
     14  * along with this program. If not, see <http://www.gnu.org/licenses/>. */
     15 
     16 #ifndef MTOOL_ARGS_H
     17 #define MTOOL_ARGS_H
     18 
     19 #include <star/sstl.h> /* enum sstl_type */
     20 
     21 struct mtool_args {
     22   /* Transformation matrix storing the list of transformations, applied in the
     23    * order in which they are submitted on the command line */
     24   double transform[12]; /* 3x4 column major */
     25 
     26   const char* input;  /* Input filename. NULL <=> stdin */
     27   const char* output; /* Output filename. NULL <=> stdout */
     28 
     29   /* Input/output StL type */
     30   enum sstl_type type;
     31 
     32   int reverse_normals;
     33   int print_desc;
     34   int verbose;
     35   int quit;
     36 };
     37 #define MTOOL_ARGS_DEFAULT__ {                                                 \
     38   {1,0,0, 0,1,0, 0,0,1, 0,0,0}, /* Transform */                                \
     39                                                                                \
     40   NULL, /* Input */                                                            \
     41   NULL, /* Output */                                                           \
     42                                                                                \
     43   SSTL_ASCII, /* Input/output StL type */                                      \
     44                                                                                \
     45   0, /* Reverse normals */                                                     \
     46   0, /* Print descriptor */                                                    \
     47   0, /* Verbosity */                                                           \
     48   0  /* Quit */                                                                \
     49 }
     50 static const struct mtool_args MTOOL_ARGS_DEFAULT = MTOOL_ARGS_DEFAULT__;
     51 
     52 extern LOCAL_SYM res_T
     53 mtool_args_init
     54   (struct mtool_args* args,
     55    int argc,
     56    char** argv);
     57 
     58 extern LOCAL_SYM void
     59 mtool_args_release
     60   (struct mtool_args* args);
     61 
     62 #endif /* MTOOL_ARGS_H */