5 #ifndef _mgCPointsVec_HH_
6 #define _mgCPointsVec_HH_
13 #include "mg/Pvector.h"
14 #include "topo/LEPoint.h"
15 #include "topo/Loop.h"
16 #include "topo/Face.h"
25 class MG_DLL_DECLR mgCONNECT_POINT{
27 enum OUTIN{coming_in, going_out};
36 mgCONNECT_POINT():m_trim_loop(0){;};
38 :m_trim_loop(loop), m_outin(outin){;}
40 bool operator< (
const mgCONNECT_POINT& linf2)
const;
41 bool operator== (
const mgCONNECT_POINT& linf2)
const;
42 bool operator!= (
const mgCONNECT_POINT& linf2)
const{
return !operator==(linf2);};
44 bool is_null()
const{
return m_trim_loop->
is_null();};
45 bool is_going_out(){
return m_outin==going_out;};
46 bool is_coming_in(){
return m_outin==coming_in;};
48 if(m_outin==coming_in)
53 std::auto_ptr<MGLoop> loop_clone(){
54 return std::auto_ptr<MGLoop>(
new MGLoop(*(m_trim_loop->
loop())));
56 OUTIN outin()
const{
return m_outin;};
58 const MGTrimLoop* trim_loop()
const{
return m_trim_loop;};
63 mgCONNECT_POINT next_point(
64 mgCPointsVec& cpointsVec
70 mgCONNECT_POINT prev_point(
71 mgCPointsVec& cpointsVec
75 MG_DLL_DECLR
friend std::ostream&
operator<< (std::ostream& out,
const mgCONNECT_POINT& cpoint);
79 class MG_DLL_DECLR mgCPoints{
81 std::vector<mgCONNECT_POINT> m_cpoints;
83 mgCONNECT_POINT& operator[](
int i){
return m_cpoints[i];};
85 int size()
const{
return (
int)m_cpoints.size();}
86 void sort(){std::sort(m_cpoints.begin(), m_cpoints.end());}
87 void push_back(
const mgCONNECT_POINT& cpoint){m_cpoints.push_back(cpoint);};
89 int next_id(
int j)
const{
return (j+1)%m_cpoints.size();};
90 int prev_id(
int j)
const{
91 int n=(int)m_cpoints.size();
94 mgCONNECT_POINT next_point(
int j){
95 return m_cpoints[next_id(j)];
97 mgCONNECT_POINT prev_point(
int j){
98 return m_cpoints[prev_id(j)];
102 int find_trim_loop(
const MGTrimLoop* tloop, mgCONNECT_POINT::OUTIN out_in)
const;
105 MG_DLL_DECLR
friend std::ostream&
operator<< (std::ostream& out,
const mgCPoints& cpoints);
108 class MG_DLL_DECLR mgCPointsVec{
113 std::vector<mgCPoints> m_cpoints_vec;
117 explicit mgCPointsVec(
120 ):m_face(face), m_uv(uv), m_cpoints_vec(face.get_number_of_boundaries()){;};
123 void build_CPointsVec(
141 int extract_trim_loop_info(
158 int extract_uv_boundary(
159 std::auto_ptr<MGLoop>& loop,
161 std::deque<MGTrimLoop*>& used_tloops
169 mgCONNECT_POINT& first_point,
170 std::auto_ptr<MGLoop>& loop,
171 std::deque<MGTrimLoop*>& tloops
174 mgCPoints& operator[](
int i){
return m_cpoints_vec[i];};
175 void push_at(
int i,
const mgCONNECT_POINT& cpoint){m_cpoints_vec[i].push_back(cpoint);};
176 int size()
const{
return (
int)m_cpoints_vec.size();};
177 bool no_uv()
const{
return m_uv.
is_null();};
179 MG_DLL_DECLR
friend std::ostream&
operator<< (std::ostream& out,
const mgCPointsVec& cpvec);
bool is_null() const
Test if this is null.
Definition: Position.h:238
MGLEPoint start_lep() const
Definition: TrimLoop.h:41
bool is_null() const
Definition: TrimLoop.h:36
MGLoop * loop()
Definition: TrimLoop.h:37
std::ostream & operator<<(std::ostream &ostrm, const MGisect &is)
Debug Function.
Definition: isect.h:95
Vector of a general n space dimension.
Definition: Vector.h:26
MGTrimLoop is a private and utility class to implement trimming of MGFSurface.
Definition: TrimLoop.h:21
MGFace is a trimmed surface.
Definition: Face.h:51
MGLEPoint end_lep() const
Definition: TrimLoop.h:47
Express a splitting line for a face for tessellation.
Definition: TL2Face.h:122
Represent a positional data.
Definition: Position.h:28
Is to represent a Loop's point.
Definition: LEPoint.h:28
MGLoop is a boundary of a face, a boundary of 2D manifold cell.
Definition: Loop.h:44
Defines Vector of newed object pointers.
Definition: Pvector.h:27