9 #include "mg/Default.h"
10 #include "mg/drawParam.h"
11 #include "mg/BPointSeq.h"
12 #include "mg/Unit_vector.h"
13 #include "mg/Position.h"
15 #include "mg/Surface.h"
16 #include "mg/FSurface.h"
17 #include "mg/Pvector.h"
19 #include "topo/Cell.h"
20 #include "topo/LEPoint.h"
21 #include "topo/FOuterCurve.h"
68 MGFace(
const MGFace& face,
bool copy_boundary,
bool no_binder=
false);
77 std::vector<MGBoundary*>& boundaries,
83 :
MGCell(surf),m_box_param(surf.param_range())
93 :
MGCell(surf),m_box_param(surf->param_range())
101 const std::vector<MGBoundary*>& boundaries);
103 const std::vector<MGBoundary*>& boundaries);
135 MGFace operator/ (
double s)
const{
return (*
this)*(1./s);};
144 int SubordinateEntitySwitch=0
148 std::ostream&
out(std::ostream& ostrm)
const;
151 std::ostream&
outFS(std::ostream& ostrm)
const{
return out(ostrm);};
158 void add_boundary(
MGLoop* nloop);
168 arrow(uv[0],uv[1],data);
181 MGFace* binder_face()
const;
190 const MGBox& box_param()
const;
200 std::auto_ptr<MGLoop> build_loop(
239 )
const{
drawWireFS(vbo,span_length,line_density);};
257 std::vector<mgTL2Triangles>& trisVec
266 bool equal_direction(
296 void extract_loops(std::vector<const MGLoop*>& loops)
const;
301 void extract_sub_face(
304 std::auto_ptr<MGFace>& face
316 std::vector<const MGLoop*> get_inner_boundary_loops(
const MGBox& uvbox)
const;
343 bool hasInactiveLoop()
const;
348 bool hasOuterBoundaryLoop()
const;
352 bool hasPerimeterBoundaryLoop()
const;
372 bool in_range(
double u,
double v)
const;
409 double knot_u(
int i)
const{
return surface()->knot_u(i);};
412 double knot_v(
int i)
const{
return surface()->knot_v(i);};
425 const MGLoop* loop(
int i)
const;
426 const MGLoop* loop(const_iterator i)
const;
440 void make_outer_boundary();
446 const MGFace* member_partner_face(
int i)
const;
454 {
return surface()->normal(uv.
ref(0), uv.
ref(1));};
458 {
return surface()->normal(u, v);};
464 bool no_outer_boundaries()
const;
476 int number_of_loops()
const;
479 int number_of_perimeter_boundaries()
const;
489 MGFace offset(
double distance,
int& error)
const;
559 const MGShell* parent_shell()
const;
621 std::auto_ptr<MGFace> rebuild(
630 int parameter_normalization=2,
650 void remove_inactive_loops();
654 void rotateBoundary(
const MGMatrix& mat);
680 void shrink_base_surface_to_knot(
730 const MGVector& direction=mgNULL_VEC
781 {
return surface()->unit_normal(uv.
ref(0), uv.
ref(1));};
785 {
return surface()->unit_normal(u, v);};
787 std::string
whoami()
const{
return "Face";};
799 mutable MGBox m_box_param;
814 int coef_sdim()
const{
return surface()->coef_sdim();};
821 void compute_box_param()
const;
824 void copy_binder(
const MGFace& faceOriginal);
842 int inside_inner_boundary(
const MGPosition& uv,
int&
id)
const;
856 int inside_outer_boundary(
908 double du,
double dv,
986 std::vector<double> isect1D_with_boundaries(
1004 void make_extent()
const;
1008 std::vector<MGFOuterCurve> outer_curve()
const;
1013 std::vector<MGInterval> perimeter_param_range(
int i)
const;
1027 std::vector<SHLL_COM_EDGES>* polylines,
1034 void sl_edge_append(
1045 double uerror,
double verror,
1059 union MG_DLL_DECLR mgEdgeP{
const MGEdge* pointer;
double doubleV;};
std::string whoami() const
Definition: Face.h:787
std::vector< const MGLBRep * > SHLL_COM_EDGES
Definition: Face.h:42
CellNB is a cell without boundaries(No Boundaries).
Definition: CellNB.h:38
virtual long identify_type() const =0
Return Object's type ID (TID)
virtual void compute_box() const
compute box of the cell in m_box.
Is an abstract class and the super class of MGPVertex and MGCellNB.
Definition: CellBase.h:38
virtual MGCell & operator=(const MGCell &gel2)
virtual void draw3DVertex(mgVBO &vbo) const =0
MGFace * make_face()
Definition: Face.h:437
int number_of_boundaries() const
Return number of boundaries.
Definition: Cell.h:183
MGCurve is an abstract class which represents a whole curve.
Definition: Curve.h:63
MGTransf represents a transformation of a space dimension.
Definition: Transf.h:35
virtual void arrow(double u, double v, MGPosition data[10]) const =0
bool is_less_than(const MGCellNB &cell2) const
Cell comparison.
virtual MGPosition_list perps(const MGPosition &P) const =0
virtual void set_box_as_null() const
set box as null(to set the box as initial)
Definition: Cell.h:218
virtual int out_to_IGES(MGIgesOfstream &igesfile, int SubordinateEntitySwitch=0) const
Definition: Gel.h:93
const MGObject * object_pointer() const
Get the object point of this MGFSurface.
Definition: Face.h:483
bool has_commonFS(const MGObject &obj2) const
Definition: Face.h:335
virtual void sort_boundaries()
MGFace * get_face_pointer()
Judge if the display list for vmode is made or not.
Definition: Face.h:322
MGFSurface * fsurface()
Definition: Face.h:313
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
double knot_v(int i) const
Access to i-th element of v knot.
Definition: Face.h:412
int get_number_of_boundaries() const
Get number of inner boundaries as the output of the function.
Definition: Face.h:331
MGVector normal(const MGPosition &uv) const
Compute normal vector(not unit) at uv.
Definition: Face.h:453
virtual MGCell * clone_without_boundaries() const =0
virtual double param_s_u() const =0
Return starting parameter value of the base surface.
MGFace * face()
Return MGFace pointer if this MGGel is an MGFace, else return null.
Definition: Face.h:308
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.
MGFace * clone_as_face() const
Definition: Face.h:215
virtual int isect_area_length() const =0
MGIfstream is a class to read the serialized data generated by MGOfstream.
Definition: Ifstream.h:30
virtual void negate()
Negate the direction of the cell.
virtual int isect_boundary(const MGFSurface &face2, MGPosition_list &uvuvs, int id1=0) const =0
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
MGLBRep is a class for B-SPline representation.
Definition: LBRep.h:41
Is an abstract class which represents a whole geometry and a topology.
Definition: Object.h:42
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 int isect_incurves(const MGFSurface &face2, int iid, MGPosition_list &uvuv_list, int id1) const =0
virtual int number_of_inner_boundaries() const
Get number of inner boundaries as the output of the function.
Definition: FSurface.h:365
Vector of a general n space dimension.
Definition: Vector.h:26
void arrow(const MGPosition &uv, MGPosition data[10]) const
Definition: Face.h:167
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
bool operator<(const MGFace &gel2) const
Comparison of two curves.
Definition: Face.h:138
std::ostream & outFS(std::ostream &ostrm) const
Output virtual function.
Definition: Face.h:151
Defines a Box of any space dimendion.
Definition: Box.h:34
const MGFSurface * fsurface() const
Get the MGFSurface pointer if this is MGSurface or MGFace.
Definition: Face.h:312
MGCell is a general cell that has bound.
Definition: Cell.h:35
virtual void ReadMembers(MGIfstream &buf)
Read Object's member data.
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
MGBox param_range() const
Definition: Face.h:547
MGGel is an abstract class which represents a group element.
Definition: Gel.h:53
virtual MGPvector< MGCurve > outer_boundary_param() const =0
MGEdge is an instance of MGCellNB, represents a boundary element of 2D manifold.
Definition: Edge.h:33
MGStraight is a curve of any space dimension, represent a straight line.
Definition: Straight.h:49
double knot_u(int i) const
Access to i-th element of u knot.
Definition: Face.h:409
MGVector normal(double u, double v) const
Compute normal vector(not unit) at (u,v).
Definition: Face.h:457
MG_DLL_DECLR MGVector operator*(const MGVector &v, const MGMatrix &m)
MGSurface * get_surface_pointer()
Definition: Face.h:327
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
Represent a positional data.
Definition: Position.h:28
MGSurface is an abstract class of 3D surface.
Definition: Surface.h:54
MGFace(const MGSurface &surf)
Face of whole surface of no boundary.
Definition: Face.h:82
MGUnit_vector unit_normal(const MGPosition &uv) const
Compute unit normal vector at uv.
Definition: Face.h:780
Is to represent a Loop's point.
Definition: LEPoint.h:28
virtual int perp_point(const MGPosition &p, MGPosition &uv, const MGPosition *uvguess=0) const =0
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
MGLoop is a boundary of a face, a boundary of 2D manifold cell.
Definition: Loop.h:44
const MGFace * get_face_pointer() const
Definition: Face.h:323
friend class MGFace
Definition: FSurface.h:35
void negateFS()
Negate the FSurface.
Definition: Face.h:450
virtual MGCellNB * make_binder() const =0
MGObject * object_pointer()
Return MGObject pointer if this MGGel is an MGObject, else return null.
Definition: Face.h:482
MGBoundary is a boundary of more than 1 manifold dimension.
Definition: Boundary.h:35
const MGKnotVector & knot_vector_u() const
Returns the u knot vector.
Definition: Face.h:415
virtual MGisects intersection(const MGObject &obj2) const
MGFace()
Null face.
Definition: Face.h:62
const MGKnotVector & knot_vector_v() const
Returns the v knot vector.
Definition: Face.h:419
const MGBox box_param2() const
Definition: Face.h:194
MGFace(MGSurface *surf)
Definition: Face.h:92
MGFSurface is an abstract class to provide the comman interfaces to MGFace and MGSurface.
Definition: FSurface.h:33
virtual MGPosition closest_on_boundary(const MGStraight &sl) const =0
virtual int append_boundary(MGBoundary *bound)
MGOfstream is a class to serialize all of the subclasses of MGGel.
Definition: Ofstream.h:31
MGUnit_vector unit_normal(double u, double v) const
Compute unit normal vector at (u,v).
Definition: Face.h:784
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 void WriteMembers(MGOfstream &buf) const
Write Object's Member Data.
MGOgesIfstream write out to *.iges file, transforming MGCL objects to IGES objects.
Definition: IgesOfstream.h:26
void triangulate(const MGLoop &polygon, mgTL2Triangles &triangles)
void drawWire(mgVBO &vbo, double span_length, int line_density=1) const
Definition: Face.h:235
virtual void shade(mgVBO &vbo, const MGDrawParam ¶, mgVBO::ELEMENT_TARGET target=mgVBO::SHADING) const
Shade the object in world coordinates.
Definition: Object.h:101
int manifold_dimension() const
Get manifold dimension.
Definition: Face.h:443
void drawWireFS(mgVBO &vbo, double span_length, int line_density=1) const
const MGFace * face() const
Definition: Face.h:309
virtual bool operator<(const MGCell &gel2) const
comparison
virtual MGCell * clone() const =0
MG_DLL_DECLR MGPosition MGClosest_to_curves(const MGPosition &uv, const MGPvector< MGCurve > &curves)
int number_of_inner_boundaries() const
Get number of inner boundaries as the output of the function.
Definition: Face.h:467
double ref(int i) const
Definition: Position.h:304
virtual MGPosition range(const MGPosition &uv) const =0
virtual std::ostream & out(std::ostream &) const
Output virtual function.
MGisects defines a vector of MGisect.
Definition: isects.h:44
MGKnotVector & knot_vector_u()
Definition: Face.h:416
virtual bool on(const MGPosition &P, MGPosition &uv) const =0
virtual MGHHisect_vector isect(const MGShell &shell2) const =0
Intersection.
const MGSurface * get_surface_pointer() const
Definition: Face.h:328
mgSysGL is a class to provide a facility to draw temporal pictures.
Definition: sysGL.h:26
virtual int coef_sdim() const =0
OpenGL 4 用描画のためのクラス, in other words, display list.
Definition: VBO.h:76
virtual MGPvector< MGCurve > inner_boundary_param(int i) const =0
virtual MGPvector< MGCurve > outer_boundary() const =0
virtual void display_control_polygon(mgSysGL &sgl) const
Definition: Gel.h:194
MGKnotVector & knot_vector_v()
Definition: Face.h:420
virtual bool perp_guess(const MGPosition &P, const MGPosition &uvguess, MGPosition &uv) const =0
virtual MGPosition closest(const MGPosition &point) const =0
MGFSurface * clone_fsurface() const
Get the clone of this MGFSurface.
Definition: Face.h:211
virtual double param_s_v() const =0
virtual MGCell * clone_binder(const MGCellBase &c) const =0
virtual bool hasLoop(const MGBox &uvbox) const
Definition: FSurface.h:177
Define a unit vector, is a MGVector.
Definition: Unit_vector.h:17
void trim(const std::vector< const MGCurve * > &trimmers, const MGVector &dir, const MGPosition &uv, MGPvector< MGFace > &faces) const
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