1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
26 #include <Handle_Geom_Surface.hxx>
\r
27 #include <Handle_Geom2d_Curve.hxx>
\r
28 #include <Handle_Geom_Curve.hxx>
\r
29 #include <Handle_AIS_InteractiveObject.hxx>
\r
30 #include <TopoDS_Edge.hxx>
\r
31 #include <TopoDS_Face.hxx>
\r
33 #include <blshare.h>
\r
36 class BL_CURVE_SIZER;
\r
37 class BL_SURFACE_SIZER;
\r
38 class BL_POINT_SIZER;
\r
43 Handle(Geom2d_Curve) parametric_geometry;
\r
44 Handle(Geom_Curve) space_geometry;
\r
45 TopoDS_Edge topology;
\r
47 BL_CURVE_SIZER *sizer;
\r
48 bool splitted_closed;
\r
50 vector<double> P1,P2,MP;
\r
55 double parametric_min,parametric_max;
\r
56 double space_min,space_max;
\r
58 BL_EDGE(TopoDS_Edge&,BL_SURFACE*,Handle(Geom2d_Curve),double,double);
\r
61 bool verification();
\r
63 void method_curv0(const double&, double*);
\r
64 void method_curv1(const double&, double*);
\r
65 void method_curv2(const double&, double*);
\r
70 BL_POINT_SIZER *sizer;
\r
74 BL_POINT() { u=v=0.; boss=NULL; sizer=NULL; }
\r
75 BL_POINT(BL_SURFACE *b, double du, double dv) { u=du; v=dv; boss=b; sizer=NULL; }
\r
76 BL_POINT(double du, double dv) { u=du; v=dv; boss=NULL; sizer=NULL; }
\r
79 BL_POINT& operator=(BL_POINT p) { u=p.u; v=p.v; return(*this); }
\r
80 bool operator==(BL_POINT p) { return((u==p.u)&&(v==p.v)); }
\r
85 Handle(Geom_Surface) geometry;
\r
86 TopoDS_Face topology;
\r
89 BL_SURFACE_SIZER *sizer;
\r
90 vector<BL_EDGE*> edges;
\r
91 vector<BL_POINT*> points;
\r
93 BL_SURFACE(TopoDS_Face&);
\r
97 bool verification();
\r
99 void method_surf0(double const*, double*);
\r
100 void method_surf1(double const*, double*, double*);
\r
101 void method_surf2(double const*, double*, double*, double*);
\r
103 bool add(TopoDS_Edge&);
\r
104 void add(double u, double v);
\r
111 // void build_blsurf_data_file();
\r
112 void init_tsmo(blw_ *blw);
\r
113 int bls_main(blw_ *blw);
\r
115 // void set_reference_points();
\r
116 void build_surfaces(TopoDS_Shape&);
\r
117 // void build_from_occ_references(TopoDS_Shape&);
\r
119 void analyse_identical_faces();
\r
122 static BL_SURF *active_blsurf;
\r
123 TopoDS_Shape the_object;
\r
125 vector<BL_EDGE*> all_edges;
\r
126 vector<BL_SURFACE*> surfaces;
\r
128 vector<BL_POINT> internal_points;
\r
129 vector<TopoDS_Face> internal_face_points;
\r
131 vector<TopoDS_Edge> internal_edges;
\r
132 vector<TopoDS_Face> internal_faces;
\r
134 vector<TopoDS_Face> conforming_source_face;
\r
135 vector<TopoDS_Face> conforming_dest_face;
\r
137 vector< vector<TopoDS_Face>* > faces_to_merge;
\r
138 vector< vector<int>* > vertices_tags;
\r
139 vector< vector<int>* > edges_tags;
\r
141 // string blsurf_fname;
\r
142 // bool mesh_2D, auto_merge, use_occ_refs;
\r
144 // enum WHAT_MESH { SURFACE_MESH=0, VOLUME_MESH=1 };
\r
145 // enum MESH_ORDER { LINEAR=0, QUADRATIC=1 };
\r
148 // int auto_connectivity;
\r
151 // int hinterpol_flag,hmean_flag;
\r
152 // int eps_glue_flag,eps_ends_flag,eps_collapse_flag;
\r
153 // double eps_glue,eps_ends,eps_collapse,shockmax;
\r
154 // double angle_mesh,angle_smo;
\r
155 // WHAT_MESH WhatMesh;
\r
156 // MESH_ORDER MeshOrder;
\r
157 // int ComponentToMesh;
\r
159 // double Pmin,Pmax;
\r
160 // double Gmin,Gmax;
\r
161 // vector<int> Poptions; // Goptions
\r
163 // vector<TopoDS_Shape> remaining_faces;
\r
168 // hinterpol_flag=0;
\r
170 // auto_connectivity=1; // PL valait 0
\r
171 // use_occ_refs=false;
\r
172 // Poptions.resize(1); Poptions[0]=0;
\r
173 // WhatMesh=SURFACE_MESH;
\r
174 // MeshOrder=LINEAR;
\r
176 // eps_glue=eps_ends=eps_collapse=1e-8;
\r
177 // eps_glue_flag=eps_ends_flag=eps_collapse_flag=0;
\r
178 // shockmax=1.e100;
\r
179 // blsurf_fname="";
\r
180 // auto_merge=false;
\r
181 // ComponentToMesh=0;
\r
182 // angle_mesh=8.; angle_smo=1.;
\r
186 bool init(const TopoDS_Shape&);
\r
187 // int vertices(double*&);
\r
188 void get_blw(blw_*&);
\r
189 // int number_of_patches();
\r
190 // bool all_triangles();
\r
191 // void face_mesh(int is, int*& F, int*& FRef, int*& iglops, int& nF, int& ndom, int& surforient);
\r
194 bool run(TopoDS_Shape&);
\r
201 // PL Gmin, Gmax, hgeo_flag, Goptions ont deja ete elimines
\r
202 // PL hphy_flag, Poptions, ... sont a eliminer aussi
\r
205 // bls.hgeo_flag=1;
\r
206 // bls.Goptions[0]=1;
\r