Branch data Line data Source code
1 : : /*
2 : : * QslimOptions.hpp
3 : : *
4 : : */
5 : :
6 : : #ifndef QSLIMOPTIONS_H_
7 : : #define QSLIMOPTIONS_H_
8 : :
9 : : #define PLACE_ENDPOINTS 0
10 : : #define PLACE_ENDORMID 1
11 : : #define PLACE_LINE 2
12 : : #define PLACE_OPTIMAL 3
13 : :
14 : : #define OUTPUT_NONE 0x00
15 : : #define OUTPUT_CONTRACTIONS 0x01
16 : : #define OUTPUT_QUADRICS 0x02
17 : : #define OUTPUT_COST 0x04
18 : : #define OUTPUT_VERT_NOTES 0x08
19 : : #define OUTPUT_FACE_NOTES 0x10
20 : : #define OUTPUT_MODEL_DEFN 0x20
21 : : #define OUTPUT_ALL 0xFFFFFFFF
22 : :
23 : : #include <fstream>
24 : :
25 : : //===========================================================================//
26 : : /*!
27 : : * \class QslimOptions
28 : : * \brief Place holder for decimation options
29 : :
30 : : * Options for decimation can be passed with the test driver.
31 : : *
32 : : * - -o \<file\> Output final model to given file, using moab output conventions
33 : : * - -s \<count\> Set the target number of faces.
34 : : * - -i \<timings\> Intervals for timing reports.
35 : : * - -e \<thresh\> Set the maximum error tolerance.
36 : : * - -t \<t\> Set pair selection tolerance.
37 : : * - -Q[pv] Select what constraint quadrics to use [default=p].
38 : : * - -On Optimal placement policy.
39 : : * 0=endpoints, 1=endormid, 2=line, 3=optimal [default]
40 : : * - -B \<weight\> Use boundary preservation planes with given weight.
41 : : * - -b preserve boundary (do not use with -B option)
42 : : * - -m Preserve mesh quality.
43 : : * - -a Enable area weighting.
44 : : * - -p Height fields positivity. Used for height fields, assume
45 : : * - -k maintain Euler characteristic of the model (topology unchanged)
46 : : * triangles are originally positively oriented.
47 : : * - -d Use delayed deletion, as opposed to merging
48 : : * - -c keep costs in a (sparse!!!!) tag
49 : : * - -l log file
50 : : * - -L output level in the log file
51 : :
52 : : */
53 : 4 : class QslimOptions {
54 : : public:
55 : : QslimOptions();
56 : : virtual ~QslimOptions();
57 : : //! decimation stops when number of triangle is less than face_target; default 0
58 : : int face_target;
59 : :
60 : : //! decimation can stop if the error is bigger than the given tolerance; default: HUGE (very large, so it is not stopping because of this)
61 : : double error_tolerance;
62 : :
63 : : //! will use plane constraint; default 1 (true)
64 : : int will_use_plane_constraint;
65 : :
66 : : //! will use vertex constraint; default : 0 (false)
67 : : int will_use_vertex_constraint;
68 : :
69 : : //! to preserve boundary edges; default 0 (false)
70 : : int will_preserve_boundaries;
71 : :
72 : : //! cost of creating inverted elements is artificially increased, so it should not happen; default: false
73 : : int will_preserve_mesh_quality;
74 : :
75 : : //! triggered by -B option; it will add an additional cost when boundary edges are collapsed used in conjunction with the boundary constraint weight: default false
76 : : int will_constrain_boundaries;
77 : :
78 : : //! see the will_constrain_boundaries option
79 : : double boundary_constraint_weight;
80 : :
81 : : //! used if areas are planar ; default 0 (no)
82 : : int will_weight_by_area;
83 : :
84 : : //! for terrain-type data, do not allow reverse of the normal in z direction; default 0 (no check); triggered by -p option
85 : : int height_fields;
86 : :
87 : : //! performance decimation intervals; default 10 intervals
88 : : int timingIntervals;
89 : :
90 : : //! create a tag with the error cost at each vertex in the final mesh (default 0, no)
91 : : int plotCost;
92 : :
93 : : //! default true. If used, it will delay deletion of edges and triangles until the end of decimation
94 : : int useDelayedDeletion;
95 : :
96 : : //! default 3, optimal placement policy, for the vertex when an edge is collapsed; other options are 0=end points, 1=end points or middle point, 2 = on the line
97 : : int placement_policy;
98 : :
99 : : //! create the pairs based on this minimum distance (if the nodes are not connected); by default, the pairs are created only between connected vertices
100 : : double pair_selection_tolerance;
101 : :
102 : : //! output a debug file
103 : : std::ostream * logfile;
104 : :
105 : : //! debug level in output
106 : : int selected_output;
107 : :
108 : : //! create the range, with contiguous handles, and delete the initial set; default false
109 : : int create_range;
110 : :
111 : : //! keep the topology unchanged; Euler characteristic would remain the same
112 : : // triggered by -k option (default 0)
113 : : int topology;
114 : : };
115 : :
116 : : #endif /* QSLIMOPTIONS_H_ */
|