MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
SSisect_list.h
1 /********************************************************************/
2 /* Copyright (c) 2015 DG Technologies Inc. and Yuzi Mizuno */
3 /* All rights reserved. */
4 /********************************************************************/
5 #ifndef _MGSSisect_list_HH_
6 #define _MGSSisect_list_HH_
7 
12 #include <list>
13 #include "mg/SSisect.h"
14 
15 //Forward class declaration.
16 class MGFSurface;
17 
19 
26 class MG_DLL_DECLR MGSSisect_list{
27 
28 public:
29 
30 typedef std::list<MGSSisect> container_type;
31 
32 typedef container_type::iterator SSiterator;
33 typedef container_type::const_iterator const_SSiterator;
34 
35 typedef container_type::iterator iterator;
36 typedef container_type::const_iterator const_iterator;
37 
39 MG_DLL_DECLR friend std::ostream & operator << (std::ostream&, const MGSSisect_list& );
40 
42 explicit MGSSisect_list(const MGFSurface *s1=NULL, const MGFSurface *s2=NULL)
43 : m_surface1(s1), m_surface2(s2){;};
44 
47 
50 
52 
55 
57 
60 void append(const MGSSisect& isect);
61 void push_back(const MGSSisect& isect){m_SSilist.push_back(isect);};
62 void append(const MGSSisect_list& isectlist);
63 
68 void append(
69  MGCurve* iline,
70  MGCurve* param1,
71  MGCurve* param2,
72  const MGSSRELATION r1=MGSSREL_UNKNOWN);
73 
77 void append(
78  const MGCurve& iline,
79  const MGCurve& param1,
80  const MGCurve& param2,
81  const MGSSRELATION r1=MGSSREL_UNKNOWN);
82 
84 SSiterator begin(){return m_SSilist.begin();}
85 const_SSiterator begin() const{return m_SSilist.begin();}
86 
88 void clear(){m_SSilist.clear();}
89 
91 SSiterator end(){return m_SSilist.end();}
92 const_SSiterator end() const{return m_SSilist.end();}
93 
99 SSiterator find_common(const MGSSisect& ssi2);
100 
102 const MGFSurface* surface1() const {return m_surface1;}
103 
105 const MGFSurface* surface2() const {return m_surface2;}
106 
108 int entries() const{return int(m_SSilist.size());};
109 int size() const{return int(m_SSilist.size());};
110 
113 SSiterator erase(SSiterator i){return m_SSilist.erase(i);}
114 
117 const MGSSisect& first() const{return m_SSilist.front();};
118 const MGSSisect& front() const{return m_SSilist.front();};
119 MGSSisect& front(){return m_SSilist.front();};
120 
124 void insertAt(SSiterator i, const MGSSisect& isect)
125 {m_SSilist.insert(i, isect);};
126 
129 bool isEmpty() const{return m_SSilist.empty();};
130 bool empty() const{return m_SSilist.empty();};
131 
134 const MGSSisect& last() const{return m_SSilist.back();};
135 const MGSSisect& back() const{return m_SSilist.back();};
136 MGSSisect& back(){return m_SSilist.back();};
137 
139 void pop_back(){m_SSilist.pop_back();}
140 
142 void pop_front(){m_SSilist.pop_front();}
143 
146 void prepend(const MGSSisect& isect){push_front(isect);};
147 void push_front(const MGSSisect& isect){m_SSilist.push_front(isect);};
148 
151 MGSSisect removeAt(SSiterator i);
152 
155 MGSSisect removeFirst();
156 
159 MGSSisect removeLast();
160 
162 MGSSisect_list& replace12() ;
163 
164 private:
165  const MGFSurface *m_surface1;
166  const MGFSurface *m_surface2;
167  container_type m_SSilist;
168 
169 };
170  // end of IsectContainer group
172 #endif
void prepend(const MGSSisect &isect)
Definition: SSisect_list.h:146
void pop_back()
Erase the last element of m_SSilist if not null.
Definition: SSisect_list.h:139
MGCurve is an abstract class which represents a whole curve.
Definition: Curve.h:63
int size() const
Definition: SSisect_list.h:109
SSiterator erase(SSiterator i)
Definition: SSisect_list.h:113
SSiterator end()
Get the pointer of the next of the last element of the m_SSilist.
Definition: SSisect_list.h:91
const MGFSurface * surface1() const
Return the pointer to surface1.
Definition: SSisect_list.h:102
container_type::iterator iterator
Definition: SSisect_list.h:35
~MGSSisect_list()
Definition: SSisect_list.h:49
const_SSiterator begin() const
Definition: SSisect_list.h:85
Definition: MGCL.h:211
void clear()
Clear all the elements in m_SSilist.
Definition: SSisect_list.h:88
std::ostream & operator<<(std::ostream &ostrm, const MGisect &is)
Debug Function.
Definition: isect.h:95
int entries() const
Return the number of items that are in the list.
Definition: SSisect_list.h:108
const MGFSurface * surface2() const
Return the pointer to surface2.
Definition: SSisect_list.h:105
SSiterator begin()
Get the pointer of the first element of the m_SSilist.
Definition: SSisect_list.h:84
container_type::const_iterator const_SSiterator
Definition: SSisect_list.h:33
bool isEmpty() const
Definition: SSisect_list.h:129
std::list< MGSSisect > container_type
Definition: SSisect_list.h:30
void push_back(const MGSSisect &isect)
Definition: SSisect_list.h:61
MGSSisect represents one intersection line of two surfaces.
Definition: SSisect.h:29
const MGSSisect & front() const
Definition: SSisect_list.h:118
void push_front(const MGSSisect &isect)
Definition: SSisect_list.h:147
MGSSisect_list defines linked list of MGSSisect.
Definition: SSisect_list.h:26
container_type::iterator SSiterator
Definition: SSisect_list.h:32
const MGSSisect & first() const
Definition: SSisect_list.h:117
MGFSurface is an abstract class to provide the comman interfaces to MGFace and MGSurface.
Definition: FSurface.h:33
void pop_front()
Erase the first element of m_SSilist if not null.
Definition: SSisect_list.h:142
const_SSiterator end() const
Definition: SSisect_list.h:92
container_type::const_iterator const_iterator
Definition: SSisect_list.h:36
bool empty() const
Definition: SSisect_list.h:130
void insertAt(SSiterator i, const MGSSisect &isect)
Definition: SSisect_list.h:124
const MGSSisect & back() const
Definition: SSisect_list.h:135
MGSSisect_list(const MGFSurface *s1=NULL, const MGFSurface *s2=NULL)
Definition: SSisect_list.h:42
MGSSRELATION
Relation of Surface and Surface(SurfaceとSurfaceの交線の関係).
Definition: MGCL.h:210
MGSSisect & back()
Definition: SSisect_list.h:136
MGSSisect & front()
Definition: SSisect_list.h:119
const MGSSisect & last() const
Definition: SSisect_list.h:134