MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
Surface.h
1 /********************************************************************/
2 /* Copyright (c) 2015 DG Technologies Inc. and Yuzi Mizuno */
3 /* All rights reserved. */
4 /********************************************************************/
5 #ifndef _MGSurface_HH_
6 #define _MGSurface_HH_
7 #include <memory>
8 #include <vector>
9 #include "mg/Default.h"
10 #include "mg/Geometry.h"
11 #include "mg/Position_list.h"
12 #include "mg/SSisect_list.h"
13 #include "mg/FSurface.h"
14 #include "mg/Pvector.h"
15 
16 // MGSurface.h
17 
18 class MGDrawParam;
19 class MGBPointSeq;
20 class MGPosition;
21 class MGVector;
22 class MGTransf;
23 class MGUnit_vector;
24 class MGCurve;
25 class MGEllipse;
26 class MGStraight;
27 class MGCompositeCurve;
28 class MGSurfCurve;
29 class MGLBRep;
30 class MGSPointSeq;
31 class MGCSisect_list;
32 class MGPlane;
33 class MGSBRep;
34 class MGSSisect;
35 class MGSSisect_list;
36 class MGPosition_list;
37 class MGIfstream;
38 class MGOfstream;
39 class MGRLBRep;
40 class MGCParam_list;
41 class MGNDDArray;
42 class MGFace;
43 class MGShell;
44 class MGHHisect_vector;
45 class mgTL2Triangles;
46 
51 
54 class MG_DLL_DECLR MGSurface: public MGGeometry, public MGFSurface{
55 
56 public:
57 
59 
61 MGSurface(void);
62 
64 MGSurface(const MGSurface& srf):MGGeometry(srf){;};
65 
67 virtual ~MGSurface();
68 
70 
74 virtual MGSurface& operator=(const MGSurface& gel2){MGGeometry::operator=(gel2);return *this;};
75 
77 MGSurface& operator+=(const MGVector& v)=0;
78 MGSurface& operator-=(const MGVector& v)=0;
79 MGSurface& operator*=(double scale)=0;
80 MGSurface& operator*=(const MGMatrix& mat)=0;
81 MGSurface& operator*=(const MGTransf& tr)=0;
82 
84 virtual bool operator==(const MGGel& gel2)const=0;
85 virtual bool operator<(const MGGel& gel2)const=0;
86 
88 
90 
92 std::auto_ptr<MGSBRep> approximate_as_SBRep(
93  int parameter_normalization=2,
99  double tol=-1.,
100  int* order=0
102 )const;
105 
108 double average_chord_length(
109  int is_u,
110  const double para[3],
111  const MGNDDArray& tau
113 )const;
115 
117 
123 void arrow(double u,double v, MGPosition data[10])const;
124 void arrow(const MGPosition& uv, MGPosition data[10])const{
125  arrow(uv[0],uv[1],data);
126 }
127 
129 void arrow(const MGBox& box, double u,double v, MGPosition data[10])const;
130 
132 virtual int bdim_u() const {return 1;}
133 
135 virtual int bdim_v() const {return 1;}
136 
138 
140 virtual MGBox box_limitted(
141  const MGBox& uvrange
142 ) const=0;
143 
145 MGBox box_param() const;
146 
148 const MGBox box_param2() const{return box_param();};
149 
151 virtual MGPosition center() const;
152 
154 virtual MGPosition center_param() const;
155 
157 virtual MGSurface& change_dimension(
158  int sdim,
159  int start1=0,
160  int start2=0
161 )=0;
162 
164 virtual MGSurface& change_range(
165  int is_u,
166  double t1,
167  double t2
168 )=0;
169 
170 
172 
174 virtual int coef_sdim() const{return sdim();};
175 
177 virtual MGFSurface* clone_fsurface()const{return copy_surface();};
178 
180 
182 MGFace* clone_as_face()const;
183 
185 virtual MGPosition closest(const MGPosition& point) const;
186 
187 
189 
191 virtual MGPosition closest_on_perimeter(const MGPosition& point)const;
192 virtual MGPosition closest_on_perimeter(const MGStraight& sl)const;
193 
195 
197 virtual MGPosition closest_on_boundary(const MGStraight& sl) const{
198  return closest_on_perimeter(sl);
199 }
200 
201 
203 
205 virtual MGSurface* clone() const=0;
206 
207 
209 
212 void compute_sample_point(
213  double u0,
214  double u1,
215  double v0,
216  double v1,
217  MGPosition Pn[9],
218  MGPosition& center,
220  MGVector* Nn_in=0
221 )const;
222 
223 
225 
228  int sdim,
229  int start1=0,
230  int start2=0
231 )const=0;
232 
233 
235 
239 void curvatures(
240  const MGPosition& uv, double value[4], MGUnit_vector& N) const;
241 void curvatures(
242  double u, double v, double value[4], MGUnit_vector& N) const;
243 
245 MGUnit_vector direction(const MGPosition& param) const;
246 
247 
249 
251 virtual void drawWire(
252  mgVBO& vbo,
253  double span_length,
254  int line_density=1
255 )const{drawWireFS(vbo,span_length,line_density);};
256 
257 
259 
261 virtual MGSurface* copy_surface() const {return clone();}
262 
264 virtual void display_arrows(mgSysGL& sgl)const;
265 
268 virtual int divide_multi_knot(
269  MGPvector<MGSurface>& srfl
270 )const;
271 
272 
274 
278 int equal_direction(
279  const MGCurve& param_curve,
280  const MGCurve& world_curve
281 )const;
282 
284 virtual MGVector eval(
285  double u,
286  double v
287  , int ndu=0
288  , int ndv=0
289 ) const=0;
290 
292  const MGPosition& uv,
293  int ndu=0
294  , int ndv=0
295 )const{return eval(uv.ref(0),uv.ref(1),ndu,ndv);}
296 
297 
299 
301 virtual void MGSurface::eval_spoint(
302  const MGNDDArray& utau,
303  const MGNDDArray& vtau,
304  MGSPointSeq& spoint
305 )const;
306 
308 
310 virtual void eval_all(
311  double u,
312  double v,
313  MGPosition& f,
314  MGVector& fu,
315  MGVector& fv,
316  MGVector& fuv,
317  MGVector& fuu,
318  MGVector& fvv
319 )const;
320 
322 
324 virtual void eval_all(
325  const MGPosition& uv,
326  MGPosition& f,
327  MGVector& fu,
328  MGVector& fv,
329  MGVector& fuv,
330  MGVector& fuu,
331  MGVector& fvv
332  )const;
333 
335 double eval_gap(
336  const MGCurve& curve,
337  int iperi,
338  MGPosition& uv
339 )const;
340 
342 
345 double eval_gap(
346  const MGCurve* curve[4],
347  MGPosition& uv
348 )const;
349 
352 const MGPosition& t,
353 const int* nderiv
354 )const;
356 
358 virtual MGSurface& exchange_uv()=0;
359 
361 
365 virtual MGSurface& extend(
366  int perimeter,
367  double param,
369  double length,
370  double dk=0.
371 ){return *this;};
377 
379 const MGFSurface* fsurface()const{return this;};
380 MGFSurface* fsurface(){return this;};
381 
383 
387 void fundamentals(
388  const MGPosition&uv,
389  double Q[6],
390  MGUnit_vector& UN
391 )const;
392 void fundamentals(
393  double u,
394  double v,
395  double Q[6],
396  MGUnit_vector& N
397 )const;
398 
400 
403 void get_approximate_plane(
404  double u0
405  ,double u1,
406  double v0,
407  double v1,
408  MGPlane& plane,
409  double* width=0,
410  double* height=0
411 )const;
412 
415 const MGFace* get_face_pointer()const{return (const MGFace*)0;};
416 
418 
421 int getPerimeterCommon(
422  const MGCurve& crv,
423  std::vector<double> pspan[2],
424  int peri_num[2]
425 )const;
427 
429 
432 const MGSurface* get_surface_pointer()const{return this;};
433 
435 virtual int get_number_of_boundaries()const{return 0;};
436 
438 
440 MGCurve* get_parameterCurve(const MGCurve& wcrv)const;
441 
443 void get_new_surface_knots(
444  int parameter_normalization,
445  //Indicates how the parameter normalization be done:
446  //=0: no surface parameter normalization.
447  //=1: normalize to u_range=(0., 1.), and v_range=(0.,1.);
448  //=2: normalize to make the average length of the 1st derivative along u and v
449  // of the base surface is as equal to 1. as possible.
450  MGKnotVector& uknots,//normalized MGKnotVector will be returned.
451  MGKnotVector& vknots,
452  double* Oldparameter=0//Old parameterization will be returned. [.]=(us, ue, vs,ve).
453 )const;
454 
455 
457 
459 virtual bool on_a_perimeter(
460  double& u,
461  double& v,
462  int& perim_num
463 )const;
465 
467 
470 bool on_a_perimeter2(
471  int is_u,
472  double& x,
473  int& perim_num
474 )const;
475 
477 virtual bool has_commonFS(const MGObject& obj2) const{return has_common(obj2);};
478 
480 virtual void shade(
481  mgVBO& vbo,
482  const MGDrawParam& para,
484 )const;
485 
487 virtual void triangulate(
488  const MGDrawParam& para,
489  MGCL::TL_DATA_KIND dkind,
490  std::vector<mgTL2Triangles>& trisVec
491 )const;
492 
494 
501 bool test_and_get_approximate_plane(
502  double u0,
503  double u1,
504  double v0,
505  double v1,
506  double surface_tol,
507  double angle,
508  MGPlane& plane,
510  double& width,
511  double& height
512 )const;
513 
515 virtual long identify_type()const=0;
516 
518 virtual bool in_range(double u, double v)const=0;
519 bool in_range(const MGPosition& uv)const{return in_range(uv[0], uv[1]);};
520 
522 
530 int in_range_with_on(const MGPosition& uv)const;
531 
533 
536 bool is_flat_and_small(
537  const MGBox& bx,//Paramete range of the surface.
538  double surftol, //Input the maximum deviation allowed from a plane.
539  double melen2, //square of maximum edge length allowed of the surface edge.
540  bool& direction//true: u-direction is more non flat or longer.
541  // false: v-direction is more non flat or longer.
542 )const;
543 
545 
550 virtual MGPvector<MGCurve> inner_boundary(int i)const;
551 
553 
559 virtual MGPvector<MGCurve> inner_boundary_param(int i)const;
560 
562 
567 MGCSisect_list intersect(const MGCurve& curve) const;
568 
570 MGCSisect_list intersect(const MGEllipse& el) const;
571 
573 
582 MGisects intersection(const MGObject& obj2)const;
583 MGisects intersection(const MGCurve& obj2)const;
584 MGisects intersection(const MGFSurface& obj2)const;
585 MGisects intersection(const MGSurface& obj2)const;
586 MGisects intersection(const MGFace& obj2)const;
587 MGisects intersection(const MGShell& obj2)const;
588 
590 
592 virtual MGSSisect_list isect(const MGSurface& srf2)const=0;
593 virtual MGSSisect_list isect(const MGPlane& srf2)const=0;
594 virtual MGSSisect_list isect(const MGSphere& srf2)const=0;
595 virtual MGSSisect_list isect(const MGCylinder& srf2)const=0;
596 virtual MGSSisect_list isect(const MGSBRep& srf2)const=0;
597 virtual MGSSisect_list isect(const MGRSBRep& srf2)const=0;
598 virtual MGSSisect_list isect(const MGBSumSurf& srf2)const=0;
599 MGSSisect_list isect(const MGFace& f) const;
600 MGSSisect_list isect(const MGFSurface& fsurf) const;
601 MGHHisect_vector isect(const MGShell& shl) const;
602 
604 
606 virtual MGCSisect_list isect(const MGCurve& curve) const=0;
607 
610 virtual int isect_order() const=0;
611 
626 int isect_startH(
627  const MGPosition& uvuv_startIn,
628  MGPosition_list& uvuv_list,
629  const MGSurface& sf2,
633  MGSSisect& ssi,
640 )const;
641 
649 virtual int isect_boundary(
650  const MGFSurface& face2,
651  MGPosition_list& uvuvs,
657  int id1=0
658 )const{return isect_outcurves(face2,uvuvs,id1);};
659 
664 virtual int isect_incurves(
665  const MGFSurface& face2,
666  int iid,
667  MGPosition_list& uvuv_list,
668  int id1
671 )const{return 0;};
674 
679 int isect_outcurves(
680  const MGFSurface& face2,
681  MGPosition_list& uvuv_list,
682  int id1
685 )const;
689 
691 virtual double knot_u(int i) const{return 0.0;}
692 
694 virtual double knot_v(int i) const{return 0.0;}
695 
697 virtual const MGKnotVector& knot_vector_u() const=0;
698 virtual MGKnotVector& knot_vector_u()=0;
699 
701 virtual const MGKnotVector& knot_vector_v() const=0;
702 virtual MGKnotVector& knot_vector_v()=0;
703 
704 
706 
708 virtual bool less_than(
709  int i,
710  const MGPosition& uv1,
711  const MGPosition& uv2
712 )const;
713 
719 MGFace* make_face();
721 
723 int manifold_dimension() const{return 2;};
724 
725 
727 
730 virtual void negate(){ exchange_uv();};
731 virtual void negateFS(){negate();};
732 
734 virtual void negate(
735  int is_u
736 )=0;
738 
740 
745 void negate_transform(MGGeometry& boundary)const;
746 
748 virtual MGVector normal(double u, double v) const;
749 
751 virtual MGVector normal(const MGPosition& uv) const;
752 
754 virtual const MGObject* object_pointer()const{return object();};
755 virtual MGObject* object_pointer(){return object();};
756 
757 
759 
766 virtual MGPvector<MGSurface> offset(
767  double ofs_value,
768  int& error
769 )const;
770 
771 
773 
777 int offset_fs(
778  double distance,
779  MGPvector<MGFSurface>& vecOfsFSurface
780 )const;
781 
783 
790 virtual std::auto_ptr<MGSurface> offset_c1(
791  double ofs_value,
792  int& error
793 )const;
795 
797 
801 virtual bool on(
802  const MGPosition& P,
803  MGPosition&
804 )const;
805 
806 
808 
810 virtual bool on_the_perimeter(
811  int perim_num,
812  double u,
813  double v
814 )const;
815 
817 
819 virtual bool on_perimeter(
820  const MGCurve& uvcurve,
821  int& perim_num
822 )const;
823 
825 virtual int order_u() const{return 1;}
826 
828 virtual int order_v() const{return 1;}
829 
831 virtual std::ostream& out(std::ostream& ostrm) const;
832 
834 std::ostream& outFS(std::ostream& ostrm) const{return out(ostrm);};
835 
837 
842 virtual MGPvector<MGCurve> outer_boundary()const;
843 
845 
849 
851 
855 virtual MGPosition param(
856  const MGPosition &
857 )const;
858 
860 
866 double param_of_pcurve(
867  double tw,
868  const MGCurve& wcurve,
869  const MGCurve& pcurve,
870  const double* guess=0
871 )const;
873 
874 
876 
880 MGPosition parameter(
881  const MGPosition& P
882 )const;
883 
885 
887 virtual MGCurve* parameter_curve(
888  int is_u
889  , double x
890 )const=0;
892 
894 
898  int is_u,
899  double x
900 )const;
901 
903 virtual double param_error() const;
904 virtual double param_error_u() const;
905 virtual double param_error_v() const;
906 
908 virtual double param_e_u() const=0;
909 virtual double param_e_v() const=0;
910 
912 
916 
918 virtual MGBox param_range() const;
919 
921 MGBox parameter_range() const;
922 
924 virtual double param_s_u() const=0;
925 virtual double param_s_v() const=0;
926 
928 virtual double param_span() const;
929 
931 
935 virtual MGSurface* part(
936  const MGBox& bx,
937  int multiple=0
938 )const=0;
940 
942 
946 virtual MGCurve* perimeter_curve(int i) const;
947 
949 virtual int perimeter_num() const=0;
950 
952 virtual MGPosition perimeter_uv(int i,double t) const;
953 
955 
958 virtual int perp_guess(
959 const MGPosition& uv0,
960 const MGPosition& uv1,
961 const MGPosition& P,
964 const MGPosition& uvguess,
965 MGPosition& uv
966 )const;
967 
969 
972 bool perp_guess(
973  const MGPosition& P,
974  const MGPosition& uvguess,
975  MGPosition& uv
976 )const;
977 
979 
984 virtual int perp_guess(
985 const MGPosition& uv0,
986 const MGPosition& uv1,
987 const MGCurve& curve,
990 double t0,
991 double t1,
992 const MGPosition& tuvg,
994 MGPosition& tuv
995 )const;
997 
999 virtual int perp_guess(
1000 const MGPosition& uv0,
1001 const MGPosition& uv1,
1002 const MGCompositeCurve& crv,
1004 double t0,
1005 double t1,
1006 const MGPosition& tuvg,
1007 MGPosition& tuv
1008 )const;
1010 
1012 
1018 virtual bool perp_guess(
1019  const MGCurve& curve,
1020  const MGPosition& uvguess,
1021  double tguess,
1022  MGPosition& uv,
1023  double& t
1024 )const;
1025 
1027 
1031 virtual int perp_point(
1032  const MGPosition &P,
1033  MGPosition& uv,
1034  const MGPosition* uvguess=0
1036 )const;
1037 
1039 virtual MGPosition_list perps(
1040  const MGPosition& P
1041 )const;
1042 
1044 
1047 MGPosition pick_closest(const MGStraight& sl)const;
1048 
1050 
1053 virtual MGPosition range(const MGPosition&) const;
1054 
1056 
1059 virtual void remove_knot();
1060 
1062 
1067 virtual MGSurface& rotate_self(
1068  const MGVector& vec,
1069  double angle,
1070  const MGPosition& origin=mgORIGIN
1071 );
1072 
1074 virtual int sdim() const=0;
1075 
1077 
1083 virtual void shrink_to_knot(
1084  const MGBox& uvbx,
1085  int multiple=0
1086 ){;};
1088 
1090 virtual void split(
1091  double param,
1092  bool is_u,
1094  MGPvector<MGFSurface>& surfaces
1095 )const;
1096 
1098 
1101 const MGSurface* surf()const{return this;};
1102 MGSurface* surf(){return this;};
1103 
1105 
1107 virtual MGSURFACE_TYPE type() const=0;
1108 
1110 MGUnit_vector unit_normal(const MGPosition& uv) const;
1111 
1113 MGUnit_vector unit_normal(double u,double v) const;
1114 
1115 virtual std::string whoami()const{return "Surface";};
1116 
1117 protected:
1118 
1127 virtual bool flat(
1128  const MGBox& uvbox,
1129  double tol,
1130  int& direction,
1132  MGPosition& P,
1134  MGUnit_vector& N
1135 )const;
1136 
1139 MGSSisect_list intersect(const MGSurface& srf2) const;
1140 
1142 MGSSisect_list intersectPl(const MGPlane& srf2) const;
1143 
1149 MGPosition_list intersectInner(
1150  const MGSurface& sf2
1151 )const;
1152 
1156 virtual int intersect_dnum_u() const=0;
1157 virtual int intersect_dnum_v() const=0;
1158 
1161 virtual int isect_area_length() const{return (bdim_u()+bdim_v())*2;};
1162 
1168 virtual int isect_direction(
1169  const MGFSurface& sf2,
1170  int m1,
1171  MGPosition& uvuvS,
1173  double& du,
1174  double& dv,
1175  double acuRatio=1.
1176 )const{return MGFSurface::isect_direction(sf2,m1,uvuvS,du,dv,acuRatio);};
1177 
1181 int isect_div_id_max()const;
1182 
1185 virtual MGCurve* isect_incr_pline(
1186  const MGPosition& uv,
1187  int kdt,
1188  double du,
1190  double dv,
1191  double& u,
1192  double& v,
1193  int incr=0
1194 )const=0;
1195 
1199 virtual void isect_inner_dt(
1200  int n,
1201  const MGPosition& uvnow,
1202  double& du,
1203  double& dv,
1205  int& kdt,
1206  double acuRatio=1.
1209 )const{MGFSurface::isect_inner_dt(n,uvnow,du,dv,kdt,acuRatio);};
1210 
1212 virtual MGCSisect_list isect_withC1LB(const MGLBRep& lb)const;
1213 
1215 virtual MGCSisect_list isect_with_noCompoSC(const MGSurfCurve& scrv)const;
1216 
1218 virtual MGCSisect_list isectSl(
1219  const MGStraight& sl,
1220  const MGBox& uvbox=mgNULL_BOX
1221 )const;
1223 
1228 virtual MGSBRep* surf1D(const MGPlane& pl)const=0;
1229 
1233 virtual void ReadMembers(MGIfstream& buf);
1234 
1238 virtual void WriteMembers(MGOfstream& buf) const;
1239 
1240 private:
1241 
1244 virtual MGBox* compute_box() const=0;
1245 
1248 int get_proj_divnum(const MGCurve& crv)const;
1249 
1255 int perp_guess_general(
1256  const MGPosition& uv0,
1257  const MGPosition& uv1,
1258  const MGCurve& curve,
1261  double t0, double t1,
1262  const MGPosition& tuvg,
1264  MGPosition& tuv
1265 ) const;
1267 
1269 void offset_calc_knot_vec(
1270  MGKnotVector& knot_vec_u,
1271  MGKnotVector& knot_vec_v,
1272  MGNDDArray& data_point_u,
1273  MGNDDArray& data_point_v
1274 ) const;
1275 
1278 int offset_check_curva(
1279  double ofs_value
1280 )const;
1281 
1284 int offset_check_curva_one(
1285  double ofs_value
1286 )const;
1287 
1290 virtual int offset_div_num() const;
1291 
1295 int offset_div_num_one(
1296  const MGBox& param_range) const;
1297 
1298 //Get nearest (u,v) that is not degenerated point.
1299 //That is, nearest point |fu*fv|>MGTolerance::mach_zero().
1300 void nearest_non_degenerated(double& u,double& v) const;
1301 
1302 friend class MGStraight;
1303 friend class MGLBRep;
1304 friend class MGSurfCurve;
1305 friend class MGSBRep;
1306 friend class MGPlane;
1307 friend class MGCylinder;
1308 friend class MGFSurface;
1309 friend class MGFace;
1310 friend class MGBSumSurf;
1311 
1316 MG_DLL_DECLR friend int isect_start_tan(
1317  const MGFSurface& sf1,
1318  const MGFSurface& sf2,
1319  const MGLBRep& lineb,
1320  MGVector* Tse[2]
1321 );
1323 
1325 MG_DLL_DECLR friend void isect_start_adjustSE(
1326  int ngtan,
1327  MGNDDArray& tau,
1329  MGBPointSeq& point,
1330  MGLBRep& lineb,
1331  MGVector* tan[2]
1333 );
1334 
1335 };
1336 
1337 namespace MGCL{
1338 
1348 MG_DLL_DECLR std::auto_ptr<MGSurface> createSurfaceFromRibs(
1349  const MGPvector<MGCurve>& curves,
1350  bool direction_adjustment=true
1351 );
1353 MG_DLL_DECLR std::auto_ptr<MGSurface> createSurfaceFromRibs(
1354  const std::vector<const MGCurve*>& curves,
1355  bool direction_adjustment=true
1356 );
1358 
1360 MG_DLL_DECLR std::auto_ptr<MGSurface> create_ruled_surface(
1361  const MGCurve& cross1,
1362  const MGCurve& cross2,
1363  bool direction_adjustment=true
1364 );
1366 
1367 
1369 
1373 MG_DLL_DECLR std::auto_ptr<MGRSBRep> create_revolved_surface(
1374  const MGCurve& curve,
1375  const MGStraight& axis,
1376  double angle = mgDBLPAI
1377 );
1378 
1379 
1381 
1387  const MGCurve& pline,
1388  const MGCurve& world_curve
1389 );
1390 
1392 
1395 double get_length(
1396  MGPosition Pn[9], //9 sample points.
1397  //Pn[.]={(umin, vmin), (umid, vmin), (umax,vmin),
1398  // (umin, vmid), (umid, vmid), (umax,vmid),
1399  // (umin, vmax), (umid, vmax), (umax,vmax),
1400  bool& direction //which direction was longer is returned.
1401  //True: when u direction is longer than v direction.
1402 );
1403 
1404 }
1405  // end of GEO group
1407 #endif
virtual MGGeometry & operator=(const MGGeometry &gel2)
Definition: Geometry.h:56
MG_DLL_DECLR const MGBox mgNULL_BOX
virtual MGSurface & operator=(const MGSurface &gel2)
Definition: Surface.h:74
virtual void negate()
Negate direction of this geometry.
Definition: Geometry.h:120
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 MGObject * object_pointer()
Definition: Surface.h:755
virtual void arrow(double u, double v, MGPosition data[10]) const =0
virtual MGUnit_vector unit_normal(const MGPosition &uv) const =0
Compute unit normal vector at uv.
MGCylinder is a Cylinder in 3D space.
Definition: Cylinder.h:37
virtual MGPosition_list perps(const MGPosition &P) const =0
virtual std::ostream & out(std::ostream &) const
Output virtual function.
const double mgDBLPAI
2.0 * π 値の設定
Definition: MGCL.h:101
double param_error_u() const
virtual int sdim() const =0
Return space dimension.
virtual MGisects intersection(const MGObject &obj2) const =0
virtual long identify_type() const =0
Return This object's typeID.
A vector of mgTL2Triangle's.
Definition: TL2Triangles.h:25
TL_DATA_KIND
Triangles' data kind.
Definition: MGCL.h:280
bool has_common(const MGObject &obj2) const
virtual int offset_fs(double distance, MGPvector< MGFSurface > &vecOfsFSurface) const =0
MGCompositeCurve is a composite of other leaf curves.
Definition: CompositeCurve.h:39
virtual double param_s_u() const =0
Return starting parameter value of the base surface.
MG_DLL_DECLR std::auto_ptr< MGSurface > create_ruled_surface(const MGCurve &cross1, const MGCurve &cross2, bool direction_adjustment=true)
Creates a ruled surface.
MGPosition param_mid() const
Return parameter value of the middle point of the surface.
Definition: Surface.h:915
virtual double param_e_v() const =0
virtual bool in_range(double u, double v) const =0
Test if parameter value (u,v) is in the range of the FSurface parameter.
virtual MGGeometry * copy_change_dimension(int sdim, int start1=0, int start2=0) const =0
virtual MGBox * compute_box() const =0
virtual void drawWire(mgVBO &vbo, double span_length, int line_density=1) const
Draw 3D curve in world coordinates.
Definition: Surface.h:251
MGIfstream is a class to read the serialized data generated by MGOfstream.
Definition: Ifstream.h:30
virtual int isect_boundary(const MGFSurface &face2, MGPosition_list &uvuvs, int id1=0) const =0
friend class MGSurface
Definition: FSurface.h:36
virtual MGPosition closest_on_boundary(const MGStraight &sl) const
Compute closest point from a line to the boundary of the MGFSurface.
Definition: Surface.h:197
MG_DLL_DECLR friend int isect_start_tan(const MGFSurface &sf1, const MGFSurface &sf2, const MGLBRep &lineb, MGVector *Tse[2])
MG_DLL_DECLR std::auto_ptr< MGRSBRep > create_revolved_surface(const MGCurve &curve, const MGStraight &axis, double angle=mgDBLPAI)
Creates a surface of revolution.
virtual double param_e_u() const =0
Return ending parameter value.
virtual MGPvector< MGCurve > parameter_curves(int is_u, double x) const =0
virtual int get_proj_divnum(const MGCurve &crv) const =0
virtual int order_u() const
Returns the order of u.
Definition: Surface.h:825
virtual void negate_transform(MGGeometry &boundary) const =0
virtual MGPosition center() const =0
Obtain ceter coordinate of the geometry.
MGLBRep is a class for B-SPline representation.
Definition: LBRep.h:41
virtual std::string whoami() const
Definition: Surface.h:1115
virtual int coef_sdim() const
Obtain coefficient's space dimension.
Definition: Surface.h:174
Definition: VBO.h:86
virtual int bdim_u() const
Returns B-Rep Dimension of u.
Definition: Surface.h:132
Is an abstract class which represents a whole geometry and a topology.
Definition: Object.h:42
virtual MGUnit_vector direction(const MGPosition &param) const
Compute direction unit vector of the geometry.
MG_DLL_DECLR MGVector & operator*=(MGVector &v, const MGMatrix &m)
MGShell is a composition of MGFace's(trimmed surface).
Definition: Shell.h:32
int in_range_with_on(double u, double v) const
Definition: FSurface.h:205
virtual void eval_spoint(const MGNDDArray &utau, const MGNDDArray &vtau, MGSPointSeq &spoint) const
Evaluate all the points (ui, vj) into spoint(i,j,.).
virtual int isect_incurves(const MGFSurface &face2, int iid, MGPosition_list &uvuv_list, int id1) const =0
Vector of a general n space dimension.
Definition: Vector.h:26
virtual bool on_a_perimeter(double &u, double &v, int &perim_num) const =0
virtual MGPvector< MGCurve > inner_boundary(int i) const =0
MGGeometry is an abstract class which represents a whole geometry.
Definition: Geometry.h:36
virtual MGVector normal(const MGPosition &uv) const =0
Compute normal vector(not unit) at uv.
MGVector eval(const MGPosition &uv, int ndu=0, int ndv=0) const
Definition: Surface.h:291
virtual MGSurface & extend(int perimeter, double param, double length, double dk=0.)
Modify the original Surface by extrapolating the specified perimeter.
Definition: Surface.h:365
Defines a Box of any space dimendion.
Definition: Box.h:34
virtual void ReadMembers(MGIfstream &buf)
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
virtual int isect_outcurves(const MGFSurface &face2, MGPosition_list &uvuv_list, int id1) const =0
virtual MGPosition pick_closest(const MGStraight &sl) const
Definition: Object.h:146
virtual MGPoint * point()
Return point pointer if this MGGel is an MGPoint, else return null.
Definition: Gel.h:135
virtual void WriteMembers(MGOfstream &buf) const
MGGel is an abstract class which represents a group element.
Definition: Gel.h:53
virtual MGPvector< MGCurve > outer_boundary_param() const =0
double param_error_v() const
MGStraight is a curve of any space dimension, represent a straight line.
Definition: Straight.h:49
const MGSurface * surf() const
Return MGSurface pointer.
Definition: Surface.h:1101
MGFace * get_face_pointer()
get face pointer if this is MGFace, else null will be returned.
Definition: Surface.h:414
MGSSisect represents one intersection line of two surfaces.
Definition: SSisect.h:29
virtual int isect_direction(const MGFSurface &sf2, int m1, MGPosition &uvuvS, double &du, double &dv, double acuRatio=1.) const
Definition: Surface.h:1168
virtual void isect_inner_dt(int n, const MGPosition &uvnow, double &du, double &dv, int &kdt, double acuRatio=1.) const
Definition: Surface.h:1199
virtual void split(double param, bool is_u, MGPvector< MGFSurface > &surfaces) const =0
split this fsurface at the parameter param.
virtual MGCurve * isect_incr_pline(const MGPosition &uv, int kdt, double du, double dv, double &u, double &v, int incr=0) const =0
virtual bool has_commonFS(const MGObject &obj2) const
Test if this and 2nd object has common area about their box(),taking error into account.
Definition: Surface.h:477
Represent a positional data.
Definition: Position.h:28
const MGFace * get_face_pointer() const
Definition: Surface.h:415
int manifold_dimension() const
Get manifold dimension.
Definition: Surface.h:723
const MGBox box_param2() const
Return box of the parameter space of the FSurface after trimmed one.
Definition: Surface.h:148
MGSurface is an abstract class of 3D surface.
Definition: Surface.h:54
const MGFSurface * fsurface() const
Get the MGFSurface pointer if this is MGSurface or MGFace.
Definition: Surface.h:379
virtual int order_v() const
Returns the order of v.
Definition: Surface.h:828
virtual int perp_point(const MGPosition &p, MGPosition &uv, const MGPosition *uvguess=0) const =0
std::ostream & outFS(std::ostream &ostrm) const
Output virtual function.
Definition: Surface.h:834
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
virtual MGPosition param(const MGPosition &P) const =0
Obtain parameter value of the FSurface whose world coordinates are P.
ELEMENT_TARGET
Definition: VBO.h:84
void arrow(const MGPosition &uv, MGPosition data[10]) const
Definition: Surface.h:124
Defines Boolean sum surface.
Definition: BSumSurf.h:26
virtual MGObject & operator-=(const MGVector &v)=0
virtual MGGeometry & change_dimension(int sdim, int start1=0, int start2=0)=0
Changing this object's space dimension.
virtual MGFace * make_face()=0
virtual int bdim_v() const
Returns B-Rep Dimension of v.
Definition: Surface.h:135
virtual MGBox param_range() const =0
Defines BPoint seq of a space dimension and of a capacity.
Definition: BPointSeq.h:38
MGParam_Vector provides a list to store parameters of a curve.
Definition: CParam_list.h:18
virtual const MGKnotVector & knot_vector_v() const =0
Returns the v knot vector.
Definition: Curve.h:1282
MGSphere is a Sphere in 3D space.
Definition: Sphere.h:42
virtual void triangulate(const MGDrawParam &para, MGCL::TL_DATA_KIND dkind, std::vector< mgTL2Triangles > &trisVec) const =0
Triangulate this object(MGShell, MGFace, or MGSurface is the target).
virtual void negate()
Negate direction of surface.
Definition: Surface.h:730
virtual MGFace * clone_as_face() const =0
double angle(const MGVector &V1, const MGVector &V2, const MGVector &N)
Compute the angel around the normal N in radian range[0., 2*pia).
Definition: Position.h:371
virtual const MGObject * object_pointer() const
Get the object point of this MGFSurface.
Definition: Surface.h:754
double get_length(MGPosition Pn[9], bool &direction)
Evaluate which direction is longer, u or v, from the 9 sample points.
MGFSurface is an abstract class to provide the comman interfaces to MGFace and MGSurface.
Definition: FSurface.h:33
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
int isect_div_id_max() const
MGPosition_list provides a list of Positions.
Definition: Position_list.h:27
MGHHisect_vector defines a vector of MGHHisect.
Definition: HHisect_vector.h:28
virtual double knot_u(int i) const
Access to i-th element of u knot.
Definition: Surface.h:691
bool operator<(const MGFSurface &f2) const
Comparison operator.
virtual MGSurface * copy_surface() const
Construct new curve object by copying to newed area.
Definition: Surface.h:261
int SurfCurve_equal_direction(const MGCurve &pline, const MGCurve &world_curve)
Test if pline has the same direction to world_curve.
virtual MGBox parameter_range() const =0
MGSurface(const MGSurface &srf)
Copy Constructor.
Definition: Surface.h:64
container_type::iterator iterator
Definition: Position_list.h:33
virtual void shade(mgVBO &vbo, const MGDrawParam &para, mgVBO::ELEMENT_TARGET target=mgVBO::SHADING) const
Shade the object in world coordinates.
Definition: Object.h:101
virtual MGVector evaluate(const MGPosition &t, const int *nderiv=0) const =0
Evaluate n'th derivative data. n=0 means positional data evaluation.
virtual void negateFS()
Negate the FSurface.
Definition: Surface.h:731
Defines Surface B-Representation of rational form.
Definition: RSBRep.h:38
bool in_range(const MGPosition &uv) const
Definition: Surface.h:519
virtual MGVector eval(double u, double v, int ndu=0, int ndv=0) const =0
MG_DLL_DECLR friend void isect_start_adjustSE(int ngtan, MGNDDArray &tau, MGBPointSeq &point, MGLBRep &lineb, MGVector *tan[2])
Update lineb so as to have the tangent tan for start or end according to ngtan.
virtual MGGeometry * clone() const =0
void drawWireFS(mgVBO &vbo, double span_length, int line_density=1) const
Defines non-decreasing double data array.
Definition: NDDArray.h:27
Defines Surface B-Representation, that is , B-Spline surface.
Definition: SBRep.h:48
MGEllipse is a class to define an ellipse of 2D or 3D.
Definition: Ellipse.h:38
MGSurface * surf()
Return MGSurface pointer if this MGGel is an MGSurface, else return null.
Definition: Surface.h:1102
double ref(int i) const
Definition: Position.h:304
virtual MGFSurface * clone_fsurface() const
Get the clone of this MGFSurface.
Definition: Surface.h:177
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
const MGSurface * get_surface_pointer() const
Definition: Surface.h:432
virtual MGPosition range(const MGPosition &uv) const =0
MGSURFACE_TYPE
Surface type(曲面の種類).
Definition: MGCL.h:173
MGisects defines a vector of MGisect.
Definition: isects.h:44
virtual bool on(const MGPosition &P, MGPosition &uv) const =0
virtual int isect_area_length() const
Definition: Surface.h:1161
virtual MGObject & operator+=(const MGVector &v)=0
Object transformation.
virtual bool operator==(const MGGel &gel2) const
Comparison.
Definition: Gel.h:80
virtual MGHHisect_vector isect(const MGShell &shell2) const =0
Intersection.
Defines Spoint seq of a space dimension and of a size.
Definition: SPointSeq.h:36
virtual MGPosition center_param() const =0
Obtain ceter parameter value of the geometry.
mgSysGL is a class to provide a facility to draw temporal pictures.
Definition: sysGL.h:26
OpenGL 4 用描画のためのクラス, in other words, display list.
Definition: VBO.h:76
virtual MGPvector< MGCurve > inner_boundary_param(int i) const =0
Defines Vector of newed object pointers.
Definition: Pvector.h:27
virtual MGPvector< MGCurve > outer_boundary() const =0
MG_DLL_DECLR std::auto_ptr< MGSurface > createSurfaceFromRibs(const MGPvector< MGCurve > &curves, bool direction_adjustment=true)
virtual int isect_direction(const MGFSurface &sf2, int m1, MGPosition &uvuvS, double &du, double &dv, double acuRatio=1.) const
virtual bool perp_guess(const MGPosition &P, const MGPosition &uvguess, MGPosition &uv) const =0
virtual MGPosition closest(const MGPosition &point) const =0
virtual int get_number_of_boundaries() const
Get number of inner boundaries as the output of the function.
Definition: Surface.h:435
virtual double param_s_v() const =0
double param_error() const
Obtain parameter space error.
MGSurface * get_surface_pointer()
get surface pointer. Null will never be returned if this is valid MGFSurface.
Definition: Surface.h:431
virtual const MGKnotVector & knot_vector_u() const =0
Returns the u knot vector.
Define a unit vector, is a MGVector.
Definition: Unit_vector.h:17
virtual void isect_inner_dt(int n, const MGPosition &uvnow, double &du, double &dv, int &kdt, double acuRatio=1.) const
virtual double knot_v(int i) const
Access to i-th element of v knot.
Definition: Surface.h:694
MGFSurface * fsurface()
Definition: Surface.h:380
MGSurfCurve is a curve on a surface.
Definition: SurfCurve.h:43
virtual void display_arrows(mgSysGL &sgl) const
Definition: Gel.h:192
virtual MGObject * object()
Return MGObject pointer if this MGGel is an MGObject, else return null.
Definition: Object.h:154
MGMatrix is a matix of m by m, where m is the space dimension.
Definition: Matrix.h:30