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"
92 std::auto_ptr<MGSBRep> approximate_as_SBRep(
93 int parameter_normalization=2,
108 double average_chord_length(
110 const double para[3],
125 arrow(uv[0],uv[1],data);
140 virtual MGBox box_limitted(
145 MGBox box_param()
const;
198 return closest_on_perimeter(sl);
212 void compute_sample_point(
242 double u,
double v,
double value[4],
MGUnit_vector& N)
const;
255 )
const{
drawWireFS(vbo,span_length,line_density);};
268 virtual int divide_multi_knot(
295 )
const{
return eval(uv.
ref(0),uv.
ref(1),ndu,ndv);}
310 virtual void eval_all(
324 virtual void eval_all(
403 void get_approximate_plane(
421 int getPerimeterCommon(
423 std::vector<double> pspan[2],
443 void get_new_surface_knots(
444 int parameter_normalization,
452 double* Oldparameter=0
470 bool on_a_perimeter2(
490 std::vector<mgTL2Triangles>& trisVec
501 bool test_and_get_approximate_plane(
518 virtual bool in_range(
double u,
double v)
const=0;
536 bool is_flat_and_small(
610 virtual int isect_order()
const=0;
691 virtual double knot_u(
int i)
const{
return 0.0;}
694 virtual double knot_v(
int i)
const{
return 0.0;}
708 virtual bool less_than(
790 virtual std::auto_ptr<MGSurface> offset_c1(
810 virtual bool on_the_perimeter(
819 virtual bool on_perimeter(
831 virtual std::ostream&
out(std::ostream& ostrm)
const;
834 std::ostream&
outFS(std::ostream& ostrm)
const{
return out(ostrm);};
866 double param_of_pcurve(
870 const double* guess=0
887 virtual MGCurve* parameter_curve(
928 virtual double param_span()
const;
946 virtual MGCurve* perimeter_curve(
int i)
const;
949 virtual int perimeter_num()
const=0;
952 virtual MGPosition perimeter_uv(
int i,
double t)
const;
1059 virtual void remove_knot();
1074 virtual int sdim()
const=0;
1115 virtual std::string
whoami()
const{
return "Surface";};
1156 virtual int intersect_dnum_u()
const=0;
1157 virtual int intersect_dnum_v()
const=0;
1255 int perp_guess_general(
1261 double t0,
double t1,
1269 void offset_calc_knot_vec(
1278 int offset_check_curva(
1284 int offset_check_curva_one(
1290 virtual int offset_div_num()
const;
1295 int offset_div_num_one(
1296 const MGBox& param_range)
const;
1300 void nearest_non_degenerated(
double& u,
double& v)
const;
1350 bool direction_adjustment=
true
1354 const std::vector<const MGCurve*>& curves,
1355 bool direction_adjustment=
true
1363 bool direction_adjustment=
true
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
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 ¶m) 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.
MGSphere is a Sphere in 3D space.
Definition: Sphere.h:42
virtual void triangulate(const MGDrawParam ¶, 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 ¶, 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