MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
TL2Face.h
1 #ifndef _mgTL2Face_HH_
2 #define _mgTL2Face_HH_
3 
4 #include <vector>
5 #include <map>
6 #include "mg/Pvector.h"
7 #include "Tl2/TL2parameter.h"
8 #include "Tl2/TL2Triangles.h"
9 
10 /****************************************************************/
11 /* Copyright (c) 2005 by DG Technologies, Inc. */
12 /* All rights reserved. */
13 /****************************************************************/
14 
15 class MGCurve;
16 class MGFSurface;
17 class MGEdge;
18 class MGFace;
19 class MGLBRep;
20 class mgTL2Polyline;
21 class mgTL2LPline;
28 class mgTL2Face{
30 
31 public:
32 
33 friend std::ostream& operator<< (std::ostream& out, const mgTL2Face& face);
34 
36 MG_DLL_DECLR mgTL2Face(
37  const MGDrawParam& param,
38  const MGSurface& face
39 );
40 MG_DLL_DECLR mgTL2Face(
41  const MGDrawParam& param,
42  const MGFSurface& face,
43  const std::vector<SHLL_COM_EDGES>* polylines=0
51 );
52 MG_DLL_DECLR mgTL2Face(
53  const MGFSurface& face,
54  double crvTol,
56  double surfTol,
57  double max_edge_len=-1.,
58  const std::vector<SHLL_COM_EDGES>* polylines=0
65 );
66 
67 mgTL2Face(const mgTL2Face& face);
68 
70 
73 const MGFace* face_pointer()const;
74 
76 const MGSurface& surface()const{return m_param.get_surface();};
77 
78 mgTL2parameter& TL2param(){return m_param;};
79 const mgTL2parameter& TL2param()const{return m_param;};
80 const std::vector<SHLL_COM_EDGES>* Bpoly()const{return m_param.Bpoly();};
81 
82 //Do perform the tessellation.
88 void MG_DLL_DECLR tessellate(
89  mgTL2Triangles& triangles //Tessellated triangles will be output.
90 );
91 
92 private:
93 
94  mgTL2parameter m_param;
95  std::auto_ptr<MGFace> m_polygon;
96 
98 
99 mgTL2Face& operator= (const mgTL2Face& face){;};
100 
105 void polygonizeBoundaries();
106 
112 void polygonizeSurfaceBoundaries();
113 
114 
115 };
116 
118 
123 
124 friend std::ostream& operator<< (std::ostream& out, const mgTL2PlBridge& bridge);
125 
126 public:
128  mgTL2Polyline* line,//newed object, whose ownership is transfered to this.
129  const MGLEPoint& le_start,//line's start point's MGLEPoint.
130  const MGLEPoint& le_end//line's end point's MGLEPoint.
131  );
132  MGEdge* copy_edge();//Make a cop of m_polyLine and make MGEdge.
133  //Function's return value is newed MGEdge pointer.
134  MGEdge* release_edge();//Release m_polyLine object and make MGEdge.
135  //Function's return value is newed MGEdge pointer.
136  //After release_edge, m_polyLine is null.
137  MGLEPoint& le_start(){return m_le_start;};
138  MGLEPoint& le_end(){return m_le_end;};
139 
140 private:
141  std::auto_ptr<mgTL2Polyline> m_polyLine;//mgTL2Polyline whose start point is
142  //m_le_start and whose end point is m_le_end;
143  MGLEPoint m_le_start;//m_polyLine's start point's MGLEPoint.
144  MGLEPoint m_le_end;//m_polyLine's end point's MGLEPoint.
145 
146 };
147 
153  const mgTL2parameter& tlpara,
154  const MGEdge& edgeuv,
155  short id[3], //pointer to uniform LBRep of m_param.Bpoly(), must not be null.
156  //On return, id of the starting point will be return.
157  mgTL2Polyline*& poly //generated mgTL2Polyline* for the edge will be returned.
158 );
159 
160 //split face at the parameter t.
161 //Function's return value is true: if split was executed.
162 //false: if not.
163 bool splitTl(
164  const MGFace& face,//Target face to split.
165  const mgTL2parameter& tlparam,
166  bool is_u, //indicates if t is u or v of the surface parameter (u,v).
167  MGPvector<MGFace>& faces//All of the splitted faces will be output.
168 );
169 
170 //Split the face giving bridges over loops. Splitting is done by finding the smallest
171 //closed areas out of networks.
172 void split_by_bridges(
173  const MGFace& face,
174  MGPvector<mgTL2PlBridge>& networks,
175  MGPvector<MGFace>& faces//Result trimmed face(s) will be appended.
176 );
177 
178 //Find concave vertex of the outer loop lp.
179 //Function's return value is the vertex id if concave vertex is found.
180 //If concave not found, -1 will be returned.
182  const MGLoop& lp,//Target face to split.
183  MGVector& Vpre,//the vector of the edge that ends at the concave vertex will be set.
184  MGVector& Vaft,//the vector of the edge that starts at the concave vertex will be set.
185  MGPosition& uv_vertex,//uv of the concave vertex will be returned.
186  MGLEPoint& le_vertex//MGLEPoint of the concave vertex will be returned, which is always
187  //the starting vertex of an edge.
188 );
189  // end of UseTessellation group
191 
192 #endif
mgTL2LPline is limitted subinterval of mgTL2Polyline.
Definition: TL2LPline.h:23
MGCurve is an abstract class which represents a whole curve.
Definition: Curve.h:63
MGEdge * release_edge()
mgTL2Polyline holds a parameter line(polyline) of a surface.
Definition: TL2Polyline.h:25
A vector of mgTL2Triangle's.
Definition: TL2Triangles.h:25
MG_DLL_DECLR mgTL2Face(const MGDrawParam &param, const MGSurface &face)
MGEdge * copy_edge()
void MG_DLL_DECLR tessellate(mgTL2Triangles &triangles)
MGLEPoint & le_start()
Definition: TL2Face.h:137
MGEdge * make_Edge(const mgTL2parameter &tlpara, const MGEdge &edgeuv, short id[3], mgTL2Polyline *&poly)
mgTL2PlBridge(mgTL2Polyline *line, const MGLEPoint &le_start, const MGLEPoint &le_end)
MGLEPoint & le_end()
Definition: TL2Face.h:138
MGLBRep is a class for B-SPline representation.
Definition: LBRep.h:41
friend std::ostream & operator<<(std::ostream &out, const mgTL2PlBridge &bridge)
Vector of a general n space dimension.
Definition: Vector.h:26
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
MGEdge is an instance of MGCellNB, represents a boundary element of 2D manifold.
Definition: Edge.h:33
Express a splitting line for a face for tessellation.
Definition: TL2Face.h:122
const std::vector< SHLL_COM_EDGES > * Bpoly() const
Definition: TL2Face.h:80
const MGSurface & surface() const
Obtain the surface& of the tessellation target.
Definition: TL2Face.h:76
Represent a positional data.
Definition: Position.h:28
bool splitTl(const MGFace &face, const mgTL2parameter &tlparam, bool is_u, MGPvector< MGFace > &faces)
MGSurface is an abstract class of 3D surface.
Definition: Surface.h:54
Is to represent a Loop's point.
Definition: LEPoint.h:28
int find_concave_at_vertex(const MGLoop &lp, MGVector &Vpre, MGVector &Vaft, MGPosition &uv_vertex, MGLEPoint &le_vertex)
mgTL2Face is a proprietry class for Face tessellation.
Definition: TL2Face.h:29
MGLoop is a boundary of a face, a boundary of 2D manifold cell.
Definition: Loop.h:44
Holds necessary parameter data for face tessellation.
Definition: TL2parameter.h:46
const mgTL2parameter & TL2param() const
Definition: TL2Face.h:79
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
const MGFace * face_pointer() const
Copy constructor.
mgTL2parameter & TL2param()
Definition: TL2Face.h:78
Defines Vector of newed object pointers.
Definition: Pvector.h:27
friend std::ostream & operator<<(std::ostream &out, const mgTL2Face &face)
void split_by_bridges(const MGFace &face, MGPvector< mgTL2PlBridge > &networks, MGPvector< MGFace > &faces)