MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
BSumSurf.h
1 /********************************************************************/
2 /* Copyright (c) 2015 DG Technologies Inc. and Yuzi Mizuno */
3 /* All rights reserved. */
4 /********************************************************************/
5 #ifndef _MGBSumSurf_HH_
6 #define _MGBSumSurf_HH_
7 
8 class MGIfstream;
9 class MGOfstream;
10 #include <iosfwd>
11 #include "mg/MGCL.h"
12 #include "mg/CSisect_list.h"
13 #include "mg/Surface.h"
14 
15 // MGBSumSurf.h
16 
21 
26 class MG_DLL_DECLR MGBSumSurf: public MGSurface{
27 
28 public:
29 
31 
33 MGBSumSurf():MGSurface(),m_g1(0), m_g2(0), m_g12(0){;};
34 
38  MGSurface* g1,
39  MGSurface* g2,
40  MGSurface* g12
41 );
42 
45  const MGSurface& g1,
46  const MGSurface& g2,
47  const MGSurface& g12
48 );
49 
51 MGBSumSurf(const MGBSumSurf& rhs);
52 
54 
55 ~MGBSumSurf();
56 
58 
62 MGBSumSurf& operator=(const MGGel& gel2);
63 MGBSumSurf& operator=(const MGBSumSurf& gel2);
64 
66 MGBSumSurf& operator+=(const MGVector& v);
67 MGBSumSurf& operator-=(const MGVector& v);
68 MGBSumSurf& operator*=(double scale);
69 MGBSumSurf& operator*=(const MGMatrix& mat);
70 MGBSumSurf& operator*=(const MGTransf& tr);
71 
73 bool operator==(const MGBSumSurf& gel2)const;
74 bool operator==(const MGGel& gel2)const;
75 bool operator<(const MGBSumSurf& gel2)const;
76 bool operator<(const MGGel& gel2)const;
77 bool operator!=(const MGGel& gel2)const{return !(gel2==(*this));};
78 bool operator!=(const MGBSumSurf& gel2)const{return !(gel2==(*this));};
79 
81 
82 int bdim_u() const;
83 int bdim_v() const;
84 
88  const MGBox& uvrange
89 )const;
90 
93  int sdim,
94  int start1=0,
95  int start2=0
96 );
97 
101  int is_u,
102  double t1,
103  double t2
104 );
105 
108 MGBSumSurf* clone() const;
109 
114  int sdim,
115  int start1=0,
116  int start2=0
117 )const;
118 
121 MGVector eval(
122  double u,
123  double v
124  , int ndu=0
125  , int ndv=0
126 ) const;
127 
130  const MGPosition& uv
131  , int ndu
132  , int ndv
133 ) const{return eval(uv[0],uv[1],ndu,ndv);}
134 
137 
139 long identify_type() const{return MGBSUMSURF_TID;};
140 
141 bool in_range(double u, double v) const;
142 
145 MGCSisect_list isect(const MGCurve& curve)const;
146 MGCSisect_list isect(const MGStraight& sl)const{return isectSl(sl);};
147 MGCSisect_list isect(const MGRLBRep& curve)const;
148 MGCSisect_list isect(const MGEllipse& curve)const;
149 MGCSisect_list isect(const MGLBRep& curve)const;
150 MGCSisect_list isect(const MGSurfCurve& curve)const;
151 MGCSisect_list isect(const MGBSumCurve& curve)const;
152 
159 MGSSisect_list isect(const MGSurface& srf2)const;
160 MGSSisect_list isect(const MGPlane& srf2)const;
161 MGSSisect_list isect(const MGSphere& srf2)const;
162 MGSSisect_list isect(const MGCylinder& srf2)const;
163 MGSSisect_list isect(const MGSBRep& srf2)const;
164 MGSSisect_list isect(const MGRSBRep& srf2)const;
165 MGSSisect_list isect(const MGBSumSurf& srf2)const;
166 
169 int isect_order() const;
170 
172 double knot_u(int i) const;
173 
175 double knot_v(int i) const;
176 
178 const MGKnotVector& knot_vector_u() const;
180 
182 const MGKnotVector& knot_vector_v() const;
184 
188  int i,
189  const MGPosition& uv1,
190  const MGPosition& uv2
191 )const{return m_g1->less_than(i,uv1,uv2);};
192 
194 void negate(
195  int is_u
196 );
198 
200 int order_u() const;
201 
203 int order_v() const;
204 
208 
211 std::ostream& out(std::ostream& ostrm) const;
212 
216  int is_u
217  , double x
218 )const;
220 
222 double param_e_u() const;
223 double param_e_v() const;
224 
227 MGBox param_range() const;
228 
230 double param_s_u() const;
231 double param_s_v() const;
232 
238  const MGBox& bx,
239  int multiple=0
240 )const;
242 
244 int perimeter_num() const{return 4;};
245 
247 int sdim()const{return m_g1->sdim();};
248 
255 void shrink_to_knot(
256  const MGBox& uvbx,
257  int multiple=0
258 );
260 
264 
266 void ReadMembers(MGIfstream& buf);
267 
269 void WriteMembers(MGOfstream& buf) const;
270 
271 std::string whoami()const{return "BSumSurf";};
272 
274 
275 private:
276 
277  MGSurface* m_g1;
278  MGSurface* m_g2;
279  MGSurface* m_g12;
280 
283 MGBox* compute_box() const;
284 
288 int intersect_dnum_u() const;
289 int intersect_dnum_v() const;
290 
294  const MGPosition& uv,
295  int kdt,
296  double du, double dv,
298  double& u,
299  double& v,
300  int incr=0
301 )const;
302 
307 MGSBRep* surf1D(const MGPlane& pl)const;
308 
309 };
310  // end of GEO group
312 #endif
virtual MGSBRep * surf1D(const MGPlane &pl) const =0
virtual MGVector eval(double u, double v, int ndu=0, int ndv=0) const =0
Evaluate surface data.
std::string whoami() const
Definition: BSumSurf.h:271
virtual MGSurface & operator=(const MGSurface &gel2)
Definition: Surface.h:74
virtual const MGKnotVector & knot_vector_v() const =0
Returns the v knot vector.
virtual void ReadMembers(MGIfstream &buf)
virtual const MGKnotVector & knot_vector_u() const =0
Returns the u knot vector.
virtual double param_s_v() const =0
MGSURFACE_TYPE type() const
Definition: BSumSurf.h:263
MGCurve is an abstract class which represents a whole curve.
Definition: Curve.h:63
virtual std::ostream & out(std::ostream &ostrm) const
Output virtual function.
MGPlane is infinite plane in 3D space.
Definition: Plane.h:38
MGTransf represents a transformation of a space dimension.
Definition: Transf.h:35
virtual bool operator<(const MGGel &gel2) const =0
MGCylinder is a Cylinder in 3D space.
Definition: Cylinder.h:37
bool operator!=(const MGGel &gel2) const
Definition: BSumSurf.h:77
virtual MGCurve * isect_incr_pline(const MGPosition &uv, int kdt, double du, double dv, double &u, double &v, int incr=0) const =0
virtual void WriteMembers(MGOfstream &buf) const
virtual bool in_range(double u, double v) const =0
Test if the parameter(u,v) is in this surface's parameter range.
virtual MGBox box_limitted(const MGBox &uvrange) const =0
Return minimum box that includes limitted surface by uvrange.
virtual MGSurface & exchange_uv()=0
Exchange parameter u and v.
virtual int intersect_dnum_u() const =0
MGCSisect_list isect(const MGStraight &sl) const
Definition: BSumSurf.h:146
MGIfstream is a class to read the serialized data generated by MGOfstream.
Definition: Ifstream.h:30
virtual double param_e_u() const =0
Return ending parameter value.
MGVector eval(const MGPosition &uv, int ndu, int ndv) const
Evaluate surface data.
Definition: BSumSurf.h:129
virtual int order_u() const
Returns the order of u.
Definition: Surface.h:825
MGLBRep is a class for B-SPline representation.
Definition: LBRep.h:41
virtual int bdim_u() const
Returns B-Rep Dimension of u.
Definition: Surface.h:132
virtual MGSurface & change_range(int is_u, double t1, double t2)=0
Change parameter range, able to change the direction by providing t1 greater than t2...
virtual MGSSisect_list isect(const MGSurface &srf2) const =0
Surface and Surface intersection.
Vector of a general n space dimension.
Definition: Vector.h:26
virtual double param_e_v() const =0
Defines a Box of any space dimendion.
Definition: Box.h:34
MGBSumSurf()
Default constructor.
Definition: BSumSurf.h:33
virtual double param_s_u() const =0
Return starting parameter value.
Define MGBSumCurve Class(Boolean sum curve of three curves).
Definition: BSumCurve.h:28
MGSurface & operator*=(double scale)=0
MGSurface & operator-=(const MGVector &v)=0
virtual MGSurface * clone() const =0
Construct new surface object by copying to newed area.
virtual MGSurface * copy_change_dimension(int sdim, int start1=0, int start2=0) const =0
Construct new surface object by changing the original object's space dimension.
MGGel is an abstract class which represents a group element.
Definition: Gel.h:53
MGStraight is a curve of any space dimension, represent a straight line.
Definition: Straight.h:49
virtual MGCSisect_list isectSl(const MGStraight &sl, const MGBox &uvbox=mgNULL_BOX) const
Intersection of Surface and a straight line.
virtual MGSurface * part(const MGBox &bx, int multiple=0) const =0
Compute part of the surface limitted by the parameter range bx.
virtual int isect_order() const =0
int perimeter_num() const
Return how many perimeters this surface has.
Definition: BSumSurf.h:244
Represent a positional data.
Definition: Position.h:28
MGSurface is an abstract class of 3D surface.
Definition: Surface.h:54
bool operator!=(const MGBSumSurf &gel2) const
Definition: BSumSurf.h:78
virtual int order_v() const
Returns the order of v.
Definition: Surface.h:828
MGSurface & operator+=(const MGVector &v)=0
Object transformation.
MGSSisect_list defines linked list of MGSSisect.
Definition: SSisect_list.h:26
MGCSisect_list defines linked list of MGCSisect.
Definition: CSisect_list.h:22
Defines Knot vector of B-Representation.
Definition: KnotVector.h:28
Defines Boolean sum surface.
Definition: BSumSurf.h:26
virtual int bdim_v() const
Returns B-Rep Dimension of v.
Definition: Surface.h:135
long identify_type() const
Return This object's typeID.
Definition: BSumSurf.h:139
int sdim() const
Get space dimension.
Definition: BSumSurf.h:247
MGSphere is a Sphere in 3D space.
Definition: Sphere.h:42
virtual void negate()
Negate direction of surface.
Definition: Surface.h:730
virtual int intersect_dnum_v() const =0
MGOfstream is a class to serialize all of the subclasses of MGGel.
Definition: Ofstream.h:31
Defines Rational Line B-Representation.
Definition: RLBRep.h:32
virtual bool operator==(const MGGel &gel2) const =0
comparison
virtual double knot_u(int i) const
Access to i-th element of u knot.
Definition: Surface.h:691
bool less_than(int i, const MGPosition &uv1, const MGPosition &uv2) const
Definition: BSumSurf.h:187
virtual MGSurface & change_dimension(int sdim, int start1=0, int start2=0)=0
Changing this object's space dimension.
Defines Surface B-Representation of rational form.
Definition: RSBRep.h:38
friend class MGBSumSurf
Definition: Surface.h:1310
virtual MGBox param_range() const
Return parameter range.
Defines Surface B-Representation, that is , B-Spline surface.
Definition: SBRep.h:48
Boolean sum surface.
Definition: MGCL.h:186
MGEllipse is a class to define an ellipse of 2D or 3D.
Definition: Ellipse.h:38
virtual void shrink_to_knot(const MGBox &uvbx, int multiple=0)
Shrink this surface to the part limitted by the parameter range of uvbx.
Definition: Surface.h:1083
MGSURFACE_TYPE
Surface type(曲面の種類).
Definition: MGCL.h:173
virtual double knot_v(int i) const
Access to i-th element of v knot.
Definition: Surface.h:694
virtual MGCurve * parameter_curve(int is_u, double x) const =0
Compute parameter curve.
MGSurfCurve is a curve on a surface.
Definition: SurfCurve.h:43
MGMatrix is a matix of m by m, where m is the space dimension.
Definition: Matrix.h:30