zjf
2023-03-10 abac8765bf6a1f400c2377b9999ce7495ba34a3f
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/////////////////////////////////////////////////////////////////////////////// 
// Copyright (C) 2002-2016, Open Design Alliance (the "Alliance"). 
// All rights reserved. 
// 
// This software and its documentation and related materials are owned by 
// the Alliance. The software may only be incorporated into application 
// programs owned by members of the Alliance, subject to a signed 
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable  
// trade secrets of the Alliance and its suppliers. The software is also 
// protected by copyright law and international treaty provisions. Application  
// programs incorporating this software must include the following statement 
// with their copyright notices:
//   
//   This application incorporates Teigha(R) software pursuant to a license 
//   agreement with Open Design Alliance.
//   Teigha(R) Copyright (C) 2002-2016 by Open Design Alliance. 
//   All rights reserved.
//
// By use of this software, its documentation or related materials, you 
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////
 
#ifndef _SPAPARAMETERS_H_
#define _SPAPARAMETERS_H_
 
#include "TD_PackPush.h"
 
#include "OdHeap.h"
 
/** \details
    This container class holds ACIS triangulation (rendering) parameters. 
    <group Other_Classes>
*/
class SPAParameters
{
public:
  
  enum SPA_ADJUST
  {
    SPA_ADJUST_NONE,
    SPA_ADJUST_NON_GRID,
    SPA_ADJUST_ALL
  } adjust_mode;
 
  enum SPA_GRID
  {
    SPA_GRID_NONE,        // No grids at all.
    SPA_GRID_INTERIOR,    // Grids in interior.
    SPA_GRID_TO_EDGES,    // Allow grid to divide model edges.
    SPA_GRID_ONE_DIR        // Grid only in one direction, u or v
  } grid_mode;
 
  enum SPA_TRIANG_MODE {
    SPA_TRIANG_NONE,
    SPA_TRIANG_ALL,
    SPA_TRIANG_FRINGE_1,
    SPA_TRIANG_FRINGE_2,
    SPA_TRIANG_FRINGE_3,
    SPA_TRIANG_FRINGE_4
  } triang_mode;
 
  double surface_tol;
  double normal_tol;
  double max_edge_length;
  double grid_aspect_ratio;
  int max_grid_lines;
  int min_u_grid_lines;
  int min_v_grid_lines;
  bool bUseFacetRES;
 
 
  SPAParameters()
    : adjust_mode(SPA_ADJUST_NONE)
  , surface_tol(-1)     // use bounding box diagonal
  , normal_tol(15.0)
  , max_edge_length(0.) // ignored
  , grid_aspect_ratio(0.) // ignored
  , grid_mode(SPA_GRID_INTERIOR)
  , triang_mode(SPA_TRIANG_ALL)
  , max_grid_lines(512)
  , min_u_grid_lines(0)
  , min_v_grid_lines(0)
  , bUseFacetRES(false)
  {
  }
 
  /** \note
    bUseFacetRES is NOT part of the comparison.
  */
  bool operator ==(const SPAParameters other) const 
  {
    return other.adjust_mode == adjust_mode &&
      other.surface_tol == surface_tol &&
      other.normal_tol == normal_tol &&
      other.max_edge_length == max_edge_length &&
      other.grid_aspect_ratio == grid_aspect_ratio &&
      other.grid_mode == grid_mode &&
      other.triang_mode == triang_mode &&
      other.max_grid_lines == max_grid_lines &&
      other.min_u_grid_lines == min_u_grid_lines &&
      other.min_v_grid_lines == min_v_grid_lines;
    // bUseFacetRES skipped
  }
};
 
#include "TD_PackPop.h"
 
#endif // _SPAPARAMETERS_H_