File: QualityRequest.h

package info (click to toggle)
psurface 2.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,092 kB
  • sloc: cpp: 12,339; makefile: 111; awk: 38
file content (53 lines) | stat: -rw-r--r-- 1,322 bytes parent folder | download | duplicates (3)
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
#ifndef QUALITY_REQUEST
#define QUALITY_REQUEST

namespace psurface {

/// A class encapsulating the exact definition of a 'good' point removal step
struct QualityRequest {

    /// Are surface intersections allowed?
    bool intersections;

    /// An edge length that mustn't be exceeded.  Negative values mean 'no restriction'.
    float maxEdgeLength;

    /// Should small dihedral angles be allowed?
    bool smallDihedralAngles;

    /// Minimum allowed dihedral angle.
    float dihedralAngleThreshold;

    /// Importance of the triangle aspect ratio in the new triangulation
    float aspectRatio;

    /// Importance of the Hausdorff distance in the new triangulation
    float hausdorffDistance;


    // //////////////////////
    // Member functions

    /** Default constructor.  Deactivates all restrictions except for paths and intents
     * equal rights for aspect ratio and Hausdorff distance.
     */
    QualityRequest() {
        intersections = false;
        maxEdgeLength = -1;
        smallDihedralAngles = false;
        dihedralAngleThreshold = 0;
        aspectRatio = 0.5;
        hausdorffDistance = 0.5;
    }

    void normalize() {
        float sum = aspectRatio + hausdorffDistance;
        aspectRatio       /= sum;
        hausdorffDistance /= sum;
    }

};

} // namespace

#endif