MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
TL2parameter.h
1 #ifndef _mgTL2parameter_HH_
2 #define _mgTL2parameter_HH_
3 
4 #include <vector>
5 #include "mg/MGCL.h"
6 #include "mg/drawParam.h"
7 #include "topo/Face.h"
8 
9 /****************************************************************/
10 /* Copyright (c) 2005 by DG Technologies, Inc. */
11 /* All rights reserved. */
12 /****************************************************************/
13 
14 class MGObject;
15 class MGFace;
16 class MGFSurface;
17 class MGSurface;
18 class MGDrawParam;
19 
25 #define EDGE_LENGTH_DENOM 8. //Default edge length parameter, which is the denominator of
26  //the face object box length.
27 
28 #define NEAR_PARAM 0.002
29 #define STRICT_ZERO_ANGLE 0.00025
30 #define LOOSE_ZERO_ANGLE 0.20
31 #define LOOSE_ZERO_ANGLE2 0.01
32 #define CONCAVEANGLE1 -0.7
33 #define CONCAVEANGLE2 -2.441
34 #define SHARPANGLE 2.441
35 #define RIGHT_ANGLE STRICT_ZERO_ANGLE
36 #define MAX_DEVIATION_FROM_MIDDLE 4.
37 #define DEVIDE_RATIO 8
40 
42 
47 
48 public:
49 
50 friend std::ostream& operator<< (std::ostream& out, const mgTL2parameter& para);
51 
53 mgTL2parameter():m_face(0),m_surface(0),m_Bpolylines(0){;};
54 
56  const MGFSurface& obj,
57  double crvTol,
59  double surfTol,
60  const std::vector<SHLL_COM_EDGES>* polylines=0,
67  double max_edge_len=-1.
68 );
69 
71  const MGFSurface& obj,
72  const MGDrawParam& param,
74  const std::vector<SHLL_COM_EDGES>* polylines=0
81 );
82 mgTL2parameter(const mgTL2parameter& param2);
83 
85 //~mgTL2parameter();
86 
87 const std::vector<SHLL_COM_EDGES>* Bpoly()const{return m_Bpolylines;};
88 int edgPerimLen()const;
89 const MGFace& get_face()const{return *m_face;};
90 const MGSurface& get_surface()const{return *m_surface;};
91 double get_max_edge_len()const{return m_max_edge_len;};
92 double get_max_edge_len_sqr()const{return m_max_edge_len_sqr;};
93 double get_tess_crvError()const {return m_tess_crvError;};
94 double get_tess_srfError()const {return m_tess_srfError;};
95 double get_UError()const {return m_puerror;};
96 double get_VError()const {return m_pverror;};
97 double get_UVError()const{return m_uverror;};
98 bool target_is_face()const{ return m_face!=0;};
99 
101 
104 
105 private:
106 
107  const MGFace* m_face;
108  const MGSurface* m_surface;
109  double m_puerror, m_pverror;
111  double m_uverror;
112  double m_tess_crvError;
113  double m_tess_srfError;
114  double m_max_edge_len;
115  double m_max_edge_len_sqr;
116  const std::vector<SHLL_COM_EDGES>* m_Bpolylines;
123 
124 void build_parameter(
125  const MGFSurface& srf,
126  double crvTol,
127  double surfTol,
128  double max_edge_len
129 );
130 
131 };
132 
135 double compute_max_edge_len(const MGObject& twoManifold);
136 
137 //Get the knotvector to guarantee the maximum line segment length square
138 //is less than maxElen2.
140  double maxElen2, //square of maximum edge length.
141  const MGLBRep& xyzpolyline,//Input original LBRep of (x,y,z) of order 2.
142  MGLBRep& xyzpolylineOut//Output LBRep of order 2 whose knot vector is:
144 );
145 
148  const mgTL2parameter& para,
149  const MGCurve& uvline,
150  MGLBRep& xyzpolylineOut
151 ); // end of UseTessellation group
154 #endif
double compute_max_edge_len(const MGObject &twoManifold)
MGCurve is an abstract class which represents a whole curve.
Definition: Curve.h:63
double get_max_edge_len_sqr() const
Definition: TL2parameter.h:92
double get_tess_srfError() const
Definition: TL2parameter.h:94
double get_VError() const
Definition: TL2parameter.h:96
mgTL2parameter()
Definition: TL2parameter.h:53
int edgPerimLen() const
mgTL2parameter & operator=(const mgTL2parameter &)
Assignment.
MGLBRep is a class for B-SPline representation.
Definition: LBRep.h:41
Is an abstract class which represents a whole geometry and a topology.
Definition: Object.h:42
void getUVline_ensuring_max_edge_length(const mgTL2parameter &para, const MGCurve &uvline, MGLBRep &xyzpolylineOut)
Construct polyline MGLBRep whose maximum edge length is para.get_max_edge_len_sqr().
const std::vector< SHLL_COM_EDGES > * Bpoly() const
Definition: TL2parameter.h:87
Defines parameters to draw MGObject, maily to approximate by lines and facets.
Definition: drawParam.h:53
MGFace is a trimmed surface.
Definition: Face.h:51
friend std::ostream & operator<<(std::ostream &out, const mgTL2parameter &para)
MGSurface is an abstract class of 3D surface.
Definition: Surface.h:54
double get_UVError() const
Definition: TL2parameter.h:97
Holds necessary parameter data for face tessellation.
Definition: TL2parameter.h:46
MGFSurface is an abstract class to provide the comman interfaces to MGFace and MGSurface.
Definition: FSurface.h:33
const MGSurface & get_surface() const
Definition: TL2parameter.h:90
double get_UError() const
Definition: TL2parameter.h:95
double get_tess_crvError() const
Definition: TL2parameter.h:93
double get_max_edge_len() const
Definition: TL2parameter.h:91
bool target_is_face() const
Definition: TL2parameter.h:98
void getXYZline_ensuring_max_edge_length(double maxElen2, const MGLBRep &xyzpolyline, MGLBRep &xyzpolylineOut)
const MGFace & get_face() const
Definition: TL2parameter.h:89