MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
BSumCurve.h
1 /********************************************************************/
2 /* Copyright (c) 2015 DG Technologies Inc. and Yuzi Mizuno */
3 /* All rights reserved. */
4 /********************************************************************/
5 #ifndef _MGBSumCurve_HH_
6 #define _MGBSumCurve_HH_
7 
8 #include "mg/MGCL.h"
9 #include "mg/Curve.h"
10 
11 class MGStraight;
12 class MGRLBRep;
13 class MGEllipse;
14 class MGLBRep;
15 class MGSurfCurve;
16 class MGBSumCurve;
17 
23 
28 class MG_DLL_DECLR MGBSumCurve:public MGCurve{
29 
30 MG_DLL_DECLR friend MGBSumCurve operator+ (const MGVector& v, const MGBSumCurve& lb);
31 MG_DLL_DECLR friend MGBSumCurve operator* (double scale, const MGBSumCurve&);
32 
33 public:
35 
37 MGBSumCurve();
38 
40 MGBSumCurve(const MGBSumCurve& curve);
41 
44 MGBSumCurve(MGCurve* g1, MGCurve* g2, MGCurve* g12);
45 
47 MGBSumCurve(const MGCurve& g1, const MGCurve& g2, const MGCurve& g12);
48 
50 ~MGBSumCurve();
51 
53 
57 MGBSumCurve& operator=(const MGGel& gel2);
58 MGBSumCurve& operator=(const MGBSumCurve& el2);
59 
63 MGBSumCurve& operator*=(double scale);
64 MGBSumCurve& operator*=(const MGMatrix& mat);
65 MGBSumCurve& operator*=(const MGTransf& tr);
66 
68 MGBSumCurve operator+ (const MGVector& v) const;
69 MGBSumCurve operator- (const MGVector& v) const;
70 MGBSumCurve operator* (double scale) const;
71 MGBSumCurve operator* (const MGMatrix& mat) const;
72 MGBSumCurve operator* (const MGTransf& tr) const;
73 
75 bool operator==(const MGBSumCurve& gel2)const;
76 bool operator==(const MGGel& gel2)const;
77 bool operator<(const MGBSumCurve& gel2)const;
78 bool operator<(const MGGel& gel2)const;
79 
81 
83 int bdim() const;
84 
88  const MGInterval& rang
89 )const;
90 
93  int sdim,
94  int start1=0,
95  int start2=0
96 );
97 
100 void change_range(
101  double t1,
102  double t2
103 );
104 
107 MGBSumCurve& coordinate_exchange(int i, int j);
108 
111 MGBSumCurve* clone() const;
112 
117 MGCurve* copy_as_nurbs() const;
118 
123  int sdim,
124  int start1=0,
125  int start2=0
126 )const;
127 
129 MGVector eval(
130  double t,
131  int nderiv=0,
132  int left=0
133 )const;
135 
138 void extend(
139  double length,
140  bool start=false
141 );
143 
145 long identify_type()const{return MGBSUMCRV_TID;};
146 
149 MGCCisect_list isect(const MGCurve&) const;
150 MGCCisect_list isect(const MGStraight& curve2)const;
151 MGCCisect_list isect(const MGSurfCurve& curve2)const;
152 
154 MGCSisect_list isect(const MGSurface& surf) const;
155 MGCSisect_list isect(const MGPlane& surf) const;
156 MGCSisect_list isect(const MGSphere& surf)const;
157 MGCSisect_list isect(const MGCylinder& surf)const;
158 MGCSisect_list isect(const MGSBRep& surf)const;
159 MGCSisect_list isect(const MGRSBRep& surf)const;
160 MGCSisect_list isect(const MGBSumSurf& surf)const;
161 
163 double knot(int i) const;
164 
166 const MGKnotVector& knot_vector() const;
167 
170 MGBSumCurve& limit(const MGInterval& rng);
171 
173 void negate();
174 
176 double negate_param(double t)const;
177 
179 int order() const;
180 
182 double param_e() const{return m_g1->param_e();};
183 
186 double param_normalize(double t) const;
187 
189 double param_s() const{return m_g1->param_s();};
190 
195  double t1,
196  double t2,
197  int multiple=0
198 )const;
200 
208 MGPosition_list perps(const MGCurve& crv2)const;
209 MGPosition_list perps(const MGStraight& crv2)const;
210 
212 int sdim() const{return m_g1->sdim();};
213 
220  const MGUnit_vector& uvec,
221  double start_dist,
222  double end_dist
223 )const;
224 
226 MGCURVE_TYPE type() const{return MGCURVE_BSUM;};
227 
229 MGCurve& unlimit();
230 
234 
238 
241 int out_to_IGES(
242  MGIgesOfstream& igesfile,
243  int SubordinateEntitySwitch=0
244 )const;
245 
247 std::ostream& out(std::ostream& ostrm) const;
248 
249 protected:
250 
252 void ReadMembers(MGIfstream& buf);
253 
255 void WriteMembers(MGOfstream& buf)const;
256 
258 int intersect_dnum()const;
259 
260 std::string whoami()const{return "BSumCurve";};
261 
262 protected:
263 
268 std::auto_ptr<MGCurve> oneD(
269  const double g[4]
270 )const;
271 
272 private:
273 
274  MGCurve* m_g1;
275  MGCurve* m_g2;
276  MGCurve* m_g12;
277 
280 MGBox* compute_box() const;
281 
282 };
283  // end of GEO group
285 #endif
virtual MGCurve & operator=(const MGCurve &gel2)
Assignment.
Definition: Curve.h:84
virtual MGCurve & unlimit_start()=0
Unlimit parameter range of the curve to the start point direction.
virtual MGCurve & unlimit()=0
Unlimit parameter range of the curve(limitをはずす).
MGCurve is an abstract class which represents a whole curve.
Definition: Curve.h:63
MGPlane is infinite plane in 3D space.
Definition: Plane.h:38
MGTransf represents a transformation of a space dimension.
Definition: Transf.h:35
virtual MGCurve * copy_change_dimension(int sdim, int start1=0, int start2=0) const =0
Construct new curve object by changing the original object's space dimension.
MGCylinder is a Cylinder in 3D space.
Definition: Cylinder.h:37
virtual int order() const =0
Returns the order.
virtual int out_to_IGES(MGIgesOfstream &igesfile, int SubordinateEntitySwitch=0) const
Definition: Gel.h:93
virtual MGCParam_list perps(const MGPosition &P) const
Compute all foot points of the perpendicular line from point to the curve.
virtual void negate()=0
Negate the curve direction(曲線の方向を反転する).
virtual double negate_param(double t) const =0
Obtain the parameter value to t when this curve is negated by "negate()".
virtual MGCurve & operator+=(const MGVector &v)=0
Object transformation.
virtual MGCurve * clone() const =0
Construct new geometry object by copying to newed area.
long identify_type() const
Return This object's typeID.
Definition: BSumCurve.h:145
int sdim() const
Return space dimension.
Definition: BSumCurve.h:212
virtual MGCurve & coordinate_exchange(int i, int j)=0
Exchange ordering of the coordinates.
MGIfstream is a class to read the serialized data generated by MGOfstream.
Definition: Ifstream.h:30
MGLBRep is a class for B-SPline representation.
Definition: LBRep.h:41
friend class MGBSumCurve
Definition: Curve.h:1256
Vector of a general n space dimension.
Definition: Vector.h:26
virtual int bdim() const =0
Returns B-Rep Dimension.
Defines a Box of any space dimendion.
Definition: Box.h:34
std::string whoami() const
Definition: BSumCurve.h:260
Define MGBSumCurve Class(Boolean sum curve of three curves).
Definition: BSumCurve.h:28
virtual void change_range(double t1, double t2)=0
Change parameter range.
virtual MGCurve & limit(const MGInterval &rng)=0
Update this by limiting the parameter range of the curve.
MGGel is an abstract class which represents a group element.
Definition: Gel.h:53
virtual void ReadMembers(MGIfstream &buf)
メンバデータを読み出す関数.
virtual MGVector eval(double, int nderiv=0, int left=0) const =0
Evaluate n'th derivative data.
MGStraight is a curve of any space dimension, represent a straight line.
Definition: Straight.h:49
virtual MGCurve * part(double t1, double t2, int multiple=0) const =0
Compute part of this curve from parameter t1 to t2.
virtual double knot(int i) const =0
Access to i-th element of knot.
Interval of 1 dimension, i.e. MGInterval is a real line.
Definition: Interval.h:22
virtual double param_normalize(double t) const =0
Normalize parameter value t to the nearest knot if their distance is within tolerance.
MG_DLL_DECLR MGVector operator*(const MGVector &v, const MGMatrix &m)
MGSurface is an abstract class of 3D surface.
Definition: Surface.h:54
MGCSisect_list defines linked list of MGCSisect.
Definition: CSisect_list.h:22
Defines Knot vector of B-Representation.
Definition: KnotVector.h:28
virtual MGCurve & unlimit_end()=0
Unlimit parameter range of the curve to the end point direction.
Defines Boolean sum surface.
Definition: BSumSurf.h:26
virtual MGSurface * sweep(const MGUnit_vector &uvec, double start_dist, double end_dist) const =0
Return sweep surface from crv.
virtual MGCurve & operator-=(const MGVector &v)=0
Boolean sum curve.
Definition: MGCL.h:154
MGSphere is a Sphere in 3D space.
Definition: Sphere.h:42
virtual void WriteMembers(MGOfstream &buf) const
メンバデータを書き込む関数.
Defines a list of MGCCisect(curve to curve intersection).
Definition: CCisect_list.h:20
virtual std::ostream & out(std::ostream &) const
Output virtual function.
virtual const MGKnotVector & knot_vector() const =0
Returns the knot vector of the curve.
virtual void extend(double length, bool start=false)=0
Extrapolate this curve by an (approximate) chord length.
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 MGCurve & change_dimension(int sdim, int start1=0, int start2=0)=0
Changing this object's space dimension.
MGCURVE_TYPE
Curve type(曲線の種類).
Definition: MGCL.h:143
MGPosition_list provides a list of Positions.
Definition: Position_list.h:27
virtual MGCurve & operator*=(double scale)=0
MGCURVE_TYPE type() const
Return curve type(曲線のタイプを返す)
Definition: BSumCurve.h:226
MGOgesIfstream write out to *.iges file, transforming MGCL objects to IGES objects.
Definition: IgesOfstream.h:26
double param_s() const
Return starting parameter value.
Definition: BSumCurve.h:189
Defines Surface B-Representation of rational form.
Definition: RSBRep.h:38
virtual bool operator==(const MGCompositeCurve &crv) const
Comparison.
Defines Surface B-Representation, that is , B-Spline surface.
Definition: SBRep.h:48
virtual std::auto_ptr< MGCurve > oneD(const double g[4]) const =0
Obtain transformed 1D curve expression of this curve.
virtual MGCurve * copy_as_nurbs() const =0
copy as a newed curve.
MGEllipse is a class to define an ellipse of 2D or 3D.
Definition: Ellipse.h:38
virtual bool operator<(const MGGel &gel2) const =0
virtual MGBox box_limitted(const MGInterval &) const =0
Return minimum box that includes the curve of parameter interval.
double param_e() const
Return ending parameter value.
Definition: BSumCurve.h:182
virtual MGCCisect_list isect(const MGCurve &curve2) const =0
Intersection of Curve and other geometry.
virtual int intersect_dnum() const =0
Provide divide number of curve span for function intersect.
Define a unit vector, is a MGVector.
Definition: Unit_vector.h:17
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