Salome HOME
Merge from V6_main_20120808 08Aug12
[plugins/netgenplugin.git] / src / NETGEN / netgen45ForSalome.patch
1 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/csg/algprim.cpp netgen-4.5_new/libsrc/csg/algprim.cpp
2 --- netgen-4.5_orig/libsrc/csg/algprim.cpp      2006-01-25 16:30:28.000000000 +0300
3 +++ netgen-4.5_new/libsrc/csg/algprim.cpp       2010-11-25 10:11:30.000000000 +0300
4 @@ -108,7 +108,7 @@
5  void Plane :: GetPrimitiveData (char *& classname, 
6                                 ARRAY<double> & coeffs) const
7  {
8 -  classname = "plane";
9 +  classname = (char*)"plane";
10    coeffs.SetSize (6);
11    coeffs.Elem(1) = p(0);
12    coeffs.Elem(2) = p(1);
13 @@ -355,7 +355,7 @@
14  
15  void Sphere :: GetPrimitiveData (char *& classname, ARRAY<double> & coeffs) const
16  {
17 -  classname = "sphere";
18 +  classname = (char*)"sphere";
19    coeffs.SetSize (4);
20    coeffs.Elem(1) = c(0);
21    coeffs.Elem(2) = c(1);
22 @@ -760,7 +760,7 @@
23  
24  void Cylinder :: GetPrimitiveData (char *& classname, ARRAY<double> & coeffs) const
25  {
26 -  classname = "cylinder";
27 +  classname = (char*)"cylinder";
28    coeffs.SetSize (7);
29    coeffs.Elem(1) = a(0);
30    coeffs.Elem(2) = a(1);
31 @@ -1243,7 +1243,7 @@
32  
33  void Cone :: GetPrimitiveData (char *& classname, ARRAY<double> & coeffs) const
34  {
35 -  classname = "cone";
36 +  classname = (char*)"cone";
37    coeffs.SetSize (8);
38    coeffs.Elem(1) = a(0);
39    coeffs.Elem(2) = a(1);
40 @@ -1446,7 +1446,7 @@
41  
42  void Torus :: GetPrimitiveData (char *& classname, ARRAY<double> & coeffs) const
43  {
44 -  classname = "torus";
45 +  classname = (char*)"torus";
46    coeffs.SetSize (8);
47    coeffs.Elem(1) = c(0);
48    coeffs.Elem(2) = c(1);
49 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/csg/brick.cpp netgen-4.5_new/libsrc/csg/brick.cpp
50 --- netgen-4.5_orig/libsrc/csg/brick.cpp        2006-02-08 15:23:15.000000000 +0300
51 +++ netgen-4.5_new/libsrc/csg/brick.cpp 2010-11-25 10:11:30.000000000 +0300
52 @@ -345,7 +345,7 @@
53  void Brick :: 
54  GetPrimitiveData (char *& classname, ARRAY<double> & coeffs) const
55  {
56 -  classname = "brick";
57 +  classname = (char*)"brick";
58    coeffs.SetSize(12);
59    coeffs.Elem(1) = p1(0);
60    coeffs.Elem(2) = p1(1);
61 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/csg/meshsurf.cpp netgen-4.5_new/libsrc/csg/meshsurf.cpp
62 --- netgen-4.5_orig/libsrc/csg/meshsurf.cpp     2006-02-14 11:54:35.000000000 +0300
63 +++ netgen-4.5_new/libsrc/csg/meshsurf.cpp      2010-11-25 10:11:30.000000000 +0300
64 @@ -77,11 +77,12 @@
65  }
66  
67  
68 -void MeshOptimize2dSurfaces :: ProjectPoint (INDEX surfind, Point3d & p) const
69 +bool MeshOptimize2dSurfaces :: ProjectPoint (INDEX surfind, Point3d & p) const
70  {
71    Point<3> hp = p;
72    geometry.GetSurface(surfind)->Project (hp);
73    p = hp;
74 +  return true;
75  }
76  
77  void MeshOptimize2dSurfaces :: ProjectPoint2 (INDEX surfind, INDEX surfind2, 
78 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/csg/meshsurf.hpp netgen-4.5_new/libsrc/csg/meshsurf.hpp
79 --- netgen-4.5_orig/libsrc/csg/meshsurf.hpp     2004-01-20 14:49:44.000000000 +0300
80 +++ netgen-4.5_new/libsrc/csg/meshsurf.hpp      2010-11-25 10:11:30.000000000 +0300
81 @@ -45,7 +45,7 @@
82      MeshOptimize2dSurfaces (const CSGeometry & ageometry); 
83     
84      ///
85 -    virtual void ProjectPoint (INDEX surfind, Point3d & p) const;
86 +    virtual bool ProjectPoint (INDEX surfind, Point3d & p) const;
87      ///
88      virtual void ProjectPoint2 (INDEX surfind, INDEX surfind2, Point3d & p) const;
89      ///
90 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/csg/polyhedra.cpp netgen-4.5_new/libsrc/csg/polyhedra.cpp
91 --- netgen-4.5_orig/libsrc/csg/polyhedra.cpp    2006-02-09 13:33:11.000000000 +0300
92 +++ netgen-4.5_new/libsrc/csg/polyhedra.cpp     2010-11-25 10:11:30.000000000 +0300
93 @@ -287,7 +287,7 @@
94  void Polyhedra :: GetPrimitiveData (char *& classname, 
95                                     ARRAY<double> & coeffs) const
96  {
97 -  classname = "Polyhedra";
98 +  classname = (char*)"Polyhedra";
99    coeffs.SetSize(0);
100    coeffs.Append (points.Size());
101    coeffs.Append (faces.Size());
102 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/csg/surface.cpp netgen-4.5_new/libsrc/csg/surface.cpp
103 --- netgen-4.5_orig/libsrc/csg/surface.cpp      2006-02-08 15:23:16.000000000 +0300
104 +++ netgen-4.5_new/libsrc/csg/surface.cpp       2010-11-25 10:11:30.000000000 +0300
105 @@ -215,7 +215,7 @@
106  void Primitive :: GetPrimitiveData (char *& classname, 
107                                     ARRAY<double> & coeffs) const
108  {
109 -  classname = "undef";
110 +  classname = (char*)"undef";
111    coeffs.SetSize (0);
112  }
113  
114 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/general/profiler.cpp netgen-4.5_new/libsrc/general/profiler.cpp
115 --- netgen-4.5_orig/libsrc/general/profiler.cpp 2006-01-11 13:05:59.000000000 +0300
116 +++ netgen-4.5_new/libsrc/general/profiler.cpp  2010-11-25 10:11:30.000000000 +0300
117 @@ -34,8 +34,14 @@
118    {
119      StopTimer (total_timer);
120  
121 -    ofstream prof ("netgen.prof");
122 -    Print (prof);
123 +    char* env;
124 +    if ((env = getenv("NETGEN_PROF")) && !strcmp(env, "1")) {
125 +      ofstream prof ("netgen.prof");
126 +      Print (prof);
127 +    }
128 +    else if ((env = getenv("NETGEN_PROF")) && !strcmp(env, "0")) {
129 +      Print (std::cout);
130 +    }
131    }
132  
133  
134 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/geom2d/genmesh2d.cpp netgen-4.5_new/libsrc/geom2d/genmesh2d.cpp
135 --- netgen-4.5_orig/libsrc/geom2d/genmesh2d.cpp 2006-02-16 19:17:47.000000000 +0300
136 +++ netgen-4.5_new/libsrc/geom2d/genmesh2d.cpp  2010-11-25 10:11:30.000000000 +0300
137 @@ -121,11 +121,11 @@
138  
139      int hsteps = mp.optsteps2d;
140  
141 -    mp.optimize2d = "smcm"; 
142 +    mp.optimize2d = (char*)"smcm"; 
143      mp.optsteps2d = hsteps/2;
144      Optimize2d (*mesh, mp);
145  
146 -    mp.optimize2d = "Smcm"; 
147 +    mp.optimize2d = (char*)"Smcm"; 
148      mp.optsteps2d = (hsteps+1)/2;
149      Optimize2d (*mesh, mp);
150  
151 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/gprim/geom2d.hpp netgen-4.5_new/libsrc/gprim/geom2d.hpp
152 --- netgen-4.5_orig/libsrc/gprim/geom2d.hpp     2004-01-20 14:49:44.000000000 +0300
153 +++ netgen-4.5_new/libsrc/gprim/geom2d.hpp      2010-11-25 10:11:30.000000000 +0300
154 @@ -53,7 +53,7 @@
155  int IsOnLongLine (const Line2d & l, const Point2d & p);
156  int Hit (const Line2d & l1, const Line2d & l2, double heps = EPSGEOM);
157  ostream & operator<<(ostream  & s, const Line2d & l);
158 -Point2d CrossPoint (const PLine2d & l1, const PLine2d & l2);
159 +Point2d CrossPoint (const Line2d & l1, const Line2d & l2);
160  int Parallel (const PLine2d & l1, const PLine2d & l2, double peps = EPSGEOM);
161  int IsOnLine (const PLine2d & l, const Point2d & p, double heps = EPSGEOM);
162  int IsOnLongLine (const PLine2d & l, const Point2d & p);
163 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/gprim/geom3d.hpp netgen-4.5_new/libsrc/gprim/geom3d.hpp
164 --- netgen-4.5_orig/libsrc/gprim/geom3d.hpp     2004-08-30 16:04:04.000000000 +0400
165 +++ netgen-4.5_new/libsrc/gprim/geom3d.hpp      2010-11-25 10:11:30.000000000 +0300
166 @@ -25,6 +25,7 @@
167  inline Point3d Center (const Point3d & p1, const Point3d & p2, const Point3d & p3);
168  inline Point3d Center (const Point3d & p1, const Point3d & p2, 
169                                 const Point3d & p3, const Point3d & p4);
170 +inline double Dist2 (const Point3d & p1, const Point3d & p2);
171  ostream & operator<<(ostream  & s, const Point3d & p);
172  inline Vec3d operator- (const Vec3d & p1, const Vec3d & v);
173  inline Vec3d operator+ (const Vec3d & p1, const Vec3d & v);
174 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/include/mystdlib.h netgen-4.5_new/libsrc/include/mystdlib.h
175 --- netgen-4.5_orig/libsrc/include/mystdlib.h   2006-01-16 17:16:56.000000000 +0300
176 +++ netgen-4.5_new/libsrc/include/mystdlib.h    2010-11-25 10:11:30.000000000 +0300
177 @@ -25,6 +25,7 @@
178  #include <cmath>\r
179  #include <cctype>\r
180  #include <ctime>\r
181 +#include <cstring>\r
182  #endif\r
183  \r
184  \r
185 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/interface/Makefile netgen-4.5_new/libsrc/interface/Makefile
186 --- netgen-4.5_orig/libsrc/interface/Makefile   2005-08-09 18:14:59.000000000 +0400
187 +++ netgen-4.5_new/libsrc/interface/Makefile    2010-11-25 10:11:30.000000000 +0300
188 @@ -1,4 +1,5 @@
189 -src = nginterface.cpp writeuser.cpp writediffpack.cpp writeabaqus.cpp writefluent.cpp writepermas.cpp writetochnog.cpp writetecplot.cpp wuchemnitz.cpp writetochnog.cpp writefeap.cpp writeelmer.cpp  writegmsh.cpp writejcm.cpp readuser.cpp importsolution.cpp 
190 +#src = nginterface.cpp writeuser.cpp writediffpack.cpp writeabaqus.cpp writefluent.cpp writepermas.cpp writetochnog.cpp writetecplot.cpp wuchemnitz.cpp writetochnog.cpp writefeap.cpp writeelmer.cpp  writegmsh.cpp writejcm.cpp readuser.cpp importsolution.cpp
191 +src = writeuser.cpp writediffpack.cpp writeabaqus.cpp writefluent.cpp writepermas.cpp writetochnog.cpp writetecplot.cpp wuchemnitz.cpp writetochnog.cpp writefeap.cpp writeelmer.cpp  writegmsh.cpp writejcm.cpp readuser.cpp nglib.cpp ngnewdelete.cpp
192  #
193  lib = nginterface
194  libpath = libsrc/interface
195 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/interface/nglib.cpp netgen-4.5_new/libsrc/interface/nglib.cpp
196 --- netgen-4.5_orig/libsrc/interface/nglib.cpp  2005-10-18 17:53:18.000000000 +0400
197 +++ netgen-4.5_new/libsrc/interface/nglib.cpp   2010-11-25 10:11:30.000000000 +0300
198 @@ -56,7 +56,8 @@
199  
200  void Ng_Exit ()
201  {
202 -  ;
203 +  delete testout;
204 +  testout = NULL;
205  }
206    
207  
208 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/interface/writeuser.cpp netgen-4.5_new/libsrc/interface/writeuser.cpp
209 --- netgen-4.5_orig/libsrc/interface/writeuser.cpp      2005-08-09 18:14:59.000000000 +0400
210 +++ netgen-4.5_new/libsrc/interface/writeuser.cpp       2010-11-25 10:11:30.000000000 +0300
211 @@ -17,7 +17,7 @@
212  
213  void RegisterUserFormats (ARRAY<const char*> & names)
214  {
215 -  char *types[] =
216 +  const char *types[] =
217      {
218        "Neutral Format",
219        "Surface Mesh Format" ,
220 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/linalg/densemat.hpp netgen-4.5_new/libsrc/linalg/densemat.hpp
221 --- netgen-4.5_orig/libsrc/linalg/densemat.hpp  2005-12-09 15:26:19.000000000 +0300
222 +++ netgen-4.5_new/libsrc/linalg/densemat.hpp   2010-11-25 10:11:30.000000000 +0300
223 @@ -14,6 +14,8 @@
224  
225  #include <assert.h>
226  
227 +class DenseMatrix;
228 +void CalcAtA (const DenseMatrix & a, DenseMatrix & m2);
229  
230  class DenseMatrix
231  {
232 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/makefile.inc netgen-4.5_new/libsrc/makefile.inc
233 --- netgen-4.5_orig/libsrc/makefile.inc 2005-09-02 17:17:51.000000000 +0400
234 +++ netgen-4.5_new/libsrc/makefile.inc  2010-11-25 10:11:30.000000000 +0300
235 @@ -8,17 +8,14 @@
236  LIBSRC_DIR=$(CPP_DIR)/libsrc
237  LIB_DIR=$(CPP_DIR)/lib/$(MACHINE)
238  
239 -#OCC_DIR=../../occ
240 -#OCCINC_DIR=$(OCC_DIR)/inc
241 -#OCCLIB_DIR=$(OCC_DIR)/lib
242 -# OCC_DIR=/opt/OpenCASCADE5.2/ros
243 -# OCC_DIR=/home/joachim/download/occ/Linux
244 -# OCCINC_DIR=$(OCC_DIR)/inc  -I$(OCC_DIR)/ros/inc
245 -# OCCLIB_DIR=$(OCC_DIR)/Linux/lib
246 +OCC_DIR=$(CASROOT)
247 +OCCINC_DIR=$(OCC_DIR)/inc
248 +OCCLIB_DIR=$(OCC_DIR)/Linux/lib
249  #
250  include $(LIBSRC_DIR)/makefile.mach.$(MACHINE)
251  #
252 -CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) 
253 +CPLUSPLUSFLAGS1 = -c -fPIC -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) \
254 +       -DOCCGEOMETRY -DOCC52 -DHAVE_IOSTREAM -DHAVE_LIMITS_H
255  #
256  ARFLAGS = r
257  #
258 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/makefile.mach.LINUX netgen-4.5_new/libsrc/makefile.mach.LINUX
259 --- netgen-4.5_orig/libsrc/makefile.mach.LINUX  2004-10-11 23:49:26.000000000 +0400
260 +++ netgen-4.5_new/libsrc/makefile.mach.LINUX   2010-11-25 10:11:30.000000000 +0300
261 @@ -16,7 +16,7 @@
262  #
263  CFLAGS2 =
264  
265 -CPLUSPLUSFLAGS2 = -O2 -I/usr/include/GL3.5 -DLINUX -DOPENGL \
266 +CPLUSPLUSFLAGS2 = -O2 -I/usr/include/GL3.5 -DLINUX \
267         -ftemplate-depth-99 -finline-limit=10000 \
268         -Wdisabled-optimization  -funroll-loops  -DnoNGSOLVE
269  
270 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/meshing/improve2.cpp netgen-4.5_new/libsrc/meshing/improve2.cpp
271 --- netgen-4.5_orig/libsrc/meshing/improve2.cpp 2006-01-11 19:08:19.000000000 +0300
272 +++ netgen-4.5_new/libsrc/meshing/improve2.cpp  2010-11-25 10:11:30.000000000 +0300
273 @@ -4,7 +4,7 @@
274  #include <opti.hpp>
275  
276  #ifndef SMALLLIB
277 -#include <visual.hpp>
278 +//#include <visual.hpp>
279  #endif
280  
281  namespace netgen
282 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/meshing/improve2.hpp netgen-4.5_new/libsrc/meshing/improve2.hpp
283 --- netgen-4.5_orig/libsrc/meshing/improve2.hpp 2004-10-12 23:22:55.000000000 +0400
284 +++ netgen-4.5_new/libsrc/meshing/improve2.hpp  2010-11-25 10:11:30.000000000 +0300
285 @@ -32,17 +32,16 @@
286    ///
287    virtual void SelectSurfaceOfPoint (const Point3d & p,
288                                      const PointGeomInfo & gi);
289 -  ///
290 -  virtual void ProjectPoint (INDEX /* surfind */, Point3d & /* p */) const { };
291 +
292 +  /// project point on surface, returns true if success
293 +  virtual bool ProjectPoint (INDEX /* surfind */, Point3d & /* p */) const { return false; }
294 +  /// fast project point on surface using point geom info of a neighboring point
295 +  /// if gi.trignum != 0,
296 +  /// returns true if success, gi is updated
297 +  virtual bool ProjectPoint (INDEX surfind, Point3d & p, PointGeomInfo& gi) const
298 +  { gi.trignum = 1; return ProjectPoint (surfind, p); }
299    ///
300    virtual void ProjectPoint2 (INDEX /* surfind */, INDEX /* surfind2 */, Point3d & /* p */) const { };
301 -  /// liefert zu einem 3d-Punkt die geominfo (Dreieck) und liefert 1, wenn erfolgreich, 
302 -  /// 0, wenn nicht (Punkt ausserhalb von chart)
303 -  virtual int CalcPointGeomInfo(PointGeomInfo& gi, const Point3d& /*p3*/) const
304 -    { gi.trignum = 1; return 1;};
305 -
306 -  virtual int CalcPointGeomInfo(int /* surfind */, PointGeomInfo& gi, const Point3d& p3) const
307 -    { return CalcPointGeomInfo (gi, p3); }
308  
309    ///
310    virtual void GetNormalVector(INDEX surfind, const Point3d & p, PointGeomInfo & gi, Vec3d & n) const;
311 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/meshing/meshtype.cpp netgen-4.5_new/libsrc/meshing/meshtype.cpp
312 --- netgen-4.5_orig/libsrc/meshing/meshtype.cpp 2006-02-10 13:11:08.000000000 +0300
313 +++ netgen-4.5_new/libsrc/meshing/meshtype.cpp  2010-11-25 10:11:30.000000000 +0300
314 @@ -1,4 +1,5 @@
315  #include <mystdlib.h>
316 +#include <float.h>
317  
318  #include "meshing.hpp"  
319  
320 @@ -774,7 +775,7 @@
321        frob /= 2;
322  
323        double det = trans.Det();
324 -      if (det <= 0)
325 +      if (det <= DBL_MIN)
326         err += 1e12;
327        else
328         err += frob * frob / det;
329 @@ -2222,9 +2223,9 @@
330  
331  MeshingParameters :: MeshingParameters ()
332  {
333 -  optimize3d = "cmdmstm";
334 +  optimize3d = (char*)"cmdmstm";
335    optsteps3d = 3;
336 -  optimize2d = "smsmsmSmSmSm";
337 +  optimize2d = (char*)"smsmsmSmSmSm";
338    optsteps2d = 3;
339    opterrpow = 2;
340    blockfill = 1;
341 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/meshing/meshtype.hpp netgen-4.5_new/libsrc/meshing/meshtype.hpp
342 --- netgen-4.5_orig/libsrc/meshing/meshtype.hpp 2006-02-10 13:11:08.000000000 +0300
343 +++ netgen-4.5_new/libsrc/meshing/meshtype.hpp  2010-11-25 10:11:30.000000000 +0300
344 @@ -13,7 +13,7 @@
345      Classes for NETGEN
346  */
347  
348 -
349 +class Mesh;
350  enum ELEMENT_TYPE { 
351    SEGMENT = 1, SEGMENT3 = 2,
352    TRIG = 10, QUAD=11, TRIG6 = 12, QUAD6 = 13, QUAD8 = 14,
353 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/meshing/smoothing2.cpp netgen-4.5_new/libsrc/meshing/smoothing2.cpp
354 --- netgen-4.5_orig/libsrc/meshing/smoothing2.cpp       2006-01-11 19:08:20.000000000 +0300
355 +++ netgen-4.5_new/libsrc/meshing/smoothing2.cpp        2010-11-25 10:11:30.000000000 +0300
356 @@ -300,7 +300,7 @@
357    double Opti2SurfaceMinFunction :: 
358    FuncGrad (const Vector & x, Vector & grad) const
359    {
360 -    Vec3d n, vgrad;
361 +    Vec3d vgrad;
362      Point3d pp1;
363      double g1x, g1y;
364      double badness, hbadness;
365 @@ -308,8 +308,6 @@
366      vgrad = 0;
367      badness = 0;
368  
369 -    meshthis -> GetNormalVector (surfi, sp1, gi1, n);
370 -
371      pp1 = sp1;
372      pp1.Add2 (x.Get(1), t1, x.Get(2), t2);
373  
374 @@ -360,7 +358,7 @@
375    double Opti2SurfaceMinFunction :: 
376    FuncDeriv (const Vector & x, const Vector & dir, double & deriv) const
377    {
378 -    Vec3d n, vgrad;
379 +    Vec3d vgrad;
380      Point3d pp1;
381      double g1x, g1y;
382      double badness, hbadness;
383 @@ -368,8 +366,6 @@
384      vgrad = 0;
385      badness = 0;
386  
387 -    meshthis -> GetNormalVector (surfi, sp1, gi1, n);
388 -
389      pp1 = sp1;
390      pp1.Add2 (x.Get(1), t1, x.Get(2), t2);
391  
392 @@ -520,7 +516,7 @@
393      // from 2d:
394  
395      int j, k, lpi, gpi;
396 -    Vec3d n, vgrad;
397 +    Vec3d vgrad;
398      Point3d pp1;
399      Vec2d g1, vdir;
400      double badness, hbadness, hbad, hderiv;
401 @@ -528,8 +524,6 @@
402      vgrad = 0;
403      badness = 0;
404  
405 -    meshthis -> GetNormalVector (surfi, sp1, gi1, n);
406 -
407      pp1 = sp1;
408      pp1.Add2 (x.Get(1), t1, x.Get(2), t2);
409  
410 @@ -593,7 +587,7 @@
411      // from 2d:
412  
413      int j, k, lpi, gpi;
414 -    Vec3d n, vgrad;
415 +    Vec3d vgrad;
416      Point3d pp1;
417      Vec2d g1, vdir;
418      double badness, hbadness, hbad, hderiv;
419 @@ -601,8 +595,6 @@
420      vgrad = 0;
421      badness = 0;
422  
423 -    meshthis -> GetNormalVector (surfi, sp1, gi1, n);
424 -
425      pp1 = sp1;
426      pp1.Add2 (x.Get(1), t1, x.Get(2), t2);
427  
428 @@ -859,19 +851,21 @@
429           locelements.SetSize(0);
430           locrots.SetSize (0);
431           lochs.SetSize (0);
432 +          ngi.trignum = 0;
433         
434           for (j = 0; j < elementsonpoint[pi].Size(); j++)
435             {
436               sei = elementsonpoint[pi][j];
437               const Element2d & bel = mesh[sei];
438               surfi = mesh.GetFaceDescriptor(bel.GetIndex()).SurfNr();
439 -           
440 +
441               locelements.Append (sei);
442             
443               for (k = 1; k <= bel.GetNP(); k++)
444                 if (bel.PNum(k) == pi)
445                   {
446                     locrots.Append (k);
447 +                    ngi = bel.GeomInfoPi(k);
448                     break;
449                   }
450               
451 @@ -942,7 +936,7 @@
452             }
453           
454           //optimizer loop (if not whole distance is not possible, move only a bit!!!!)
455 -         while (loci <= 5 && !moveisok)
456 +          while (loci <= 5 && !moveisok)
457             {
458               loci ++;
459               mesh[pi].X() = origp.X() + (x.Get(1) * t1.X() + x.Get(2) * t2.X())*fact;
460 @@ -951,11 +945,9 @@
461               fact = fact/2.;
462  
463  
464 -             ProjectPoint (surfi, mesh[pi]);
465 +             moveisok = ProjectPoint (surfi, mesh[pi], ngi);
466  
467 -             moveisok = CalcPointGeomInfo(surfi, ngi, mesh[pi]); 
468 -             // point lies on same chart in stlsurface
469 -           
470 +              // point lies on same chart in stlsurface
471               if (moveisok)
472                 {
473                   for (j = 0; j < locelements.Size(); j++)
474 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/occ/Partition_Inter2d.cxx netgen-4.5_new/libsrc/occ/Partition_Inter2d.cxx
475 --- netgen-4.5_orig/libsrc/occ/Partition_Inter2d.cxx    2005-06-09 18:51:10.000000000 +0400
476 +++ netgen-4.5_new/libsrc/occ/Partition_Inter2d.cxx     2010-11-25 10:11:31.000000000 +0300
477 @@ -29,10 +29,10 @@
478  //  $Header$
479  
480  //using namespace std;
481 -#include "Partition_Inter2d.ixx"
482 -
483  #include "utilities.h"
484  
485 +#include "Partition_Inter2d.ixx"
486 +
487  #include <BRepAdaptor_Curve.hxx>
488  #include <BRepAlgo_AsDes.hxx>
489  #include <BRepLib_MakeVertex.hxx>
490 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/occ/Partition_Inter3d.cxx netgen-4.5_new/libsrc/occ/Partition_Inter3d.cxx
491 --- netgen-4.5_orig/libsrc/occ/Partition_Inter3d.cxx    2005-06-09 18:51:10.000000000 +0400
492 +++ netgen-4.5_new/libsrc/occ/Partition_Inter3d.cxx     2010-11-25 10:11:31.000000000 +0300
493 @@ -29,13 +29,17 @@
494  //  $Header$
495  
496  //using namespace std;
497 +
498 +#include "utilities.h"
499 +
500  #include "Partition_Inter2d.hxx"
501  #include "Partition_Inter3d.ixx"
502 -#include "utilities.h"
503  
504  #include <BRepAlgo_AsDes.hxx>
505  #include <BRepAlgo_Image.hxx>
506  #include <BRepLib.hxx>
507 +//using namespace std;
508 +
509  #include <BRepOffset_Tool.hxx>
510  #include <BRep_Builder.hxx>
511  #include <BRep_Tool.hxx>
512 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/occ/Partition_Loop.cxx netgen-4.5_new/libsrc/occ/Partition_Loop.cxx
513 --- netgen-4.5_orig/libsrc/occ/Partition_Loop.cxx       2005-06-09 18:51:10.000000000 +0400
514 +++ netgen-4.5_new/libsrc/occ/Partition_Loop.cxx        2010-11-25 10:11:31.000000000 +0300
515 @@ -29,12 +29,14 @@
516  //  $Header$
517  
518  //using namespace std;
519 -#include <stdio.h>
520  
521 -#include "Partition_Loop.ixx"
522  
523  #include "utilities.h"
524  
525 +#include <stdio.h>
526 +
527 +#include "Partition_Loop.ixx"
528 +
529  #include <BRep_Builder.hxx>
530  #include <BRepAlgo_FaceRestrictor.hxx>
531  #include <BRep_Tool.hxx>
532 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/occ/Partition_Loop2d.cxx netgen-4.5_new/libsrc/occ/Partition_Loop2d.cxx
533 --- netgen-4.5_orig/libsrc/occ/Partition_Loop2d.cxx     2005-06-09 18:51:10.000000000 +0400
534 +++ netgen-4.5_new/libsrc/occ/Partition_Loop2d.cxx      2010-11-25 10:11:31.000000000 +0300
535 @@ -12,9 +12,11 @@
536  //  $Header$
537  
538  //using namespace std;
539 -#include "Partition_Loop2d.ixx"
540 +
541  
542  #include "utilities.h"
543 +
544 +#include "Partition_Loop2d.ixx"
545  #include <stdio.h>
546  
547  #include <BRepAdaptor_Curve2d.hxx>
548 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/occ/Partition_Loop3d.cxx netgen-4.5_new/libsrc/occ/Partition_Loop3d.cxx
549 --- netgen-4.5_orig/libsrc/occ/Partition_Loop3d.cxx     2005-06-09 18:51:10.000000000 +0400
550 +++ netgen-4.5_new/libsrc/occ/Partition_Loop3d.cxx      2010-11-25 10:11:31.000000000 +0300
551 @@ -10,6 +10,11 @@
552  //  Module : GEOM
553  
554  //using namespace std;
555 +
556 +
557 +
558 +#include "utilities.h"
559 +
560  #include "Partition_Loop3d.ixx"
561  
562  #include <TopExp_Explorer.hxx>
563 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/occ/Partition_Spliter.cxx netgen-4.5_new/libsrc/occ/Partition_Spliter.cxx
564 --- netgen-4.5_orig/libsrc/occ/Partition_Spliter.cxx    2005-07-11 10:33:27.000000000 +0400
565 +++ netgen-4.5_new/libsrc/occ/Partition_Spliter.cxx     2010-11-25 10:11:31.000000000 +0300
566 @@ -29,14 +29,15 @@
567  //  $Header$
568  
569  //using namespace std;
570 +
571 +#include "utilities.h"
572 +
573  #include "Partition_Inter2d.hxx"
574  #include "Partition_Inter3d.hxx"
575  #include "Partition_Loop2d.hxx"
576  #include "Partition_Loop3d.hxx"
577  #include "Partition_Spliter.ixx"
578  
579 -#include "utilities.h"
580 -
581  #include <Precision.hxx>
582  #include <TopAbs_Orientation.hxx>
583  #include <TopExp.hxx>
584 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/occ/occconstruction.cpp netgen-4.5_new/libsrc/occ/occconstruction.cpp
585 --- netgen-4.5_orig/libsrc/occ/occconstruction.cpp      2005-12-06 18:15:53.000000000 +0300
586 +++ netgen-4.5_new/libsrc/occ/occconstruction.cpp       2010-11-25 10:11:30.000000000 +0300
587 @@ -28,8 +28,8 @@
588  #include <BRepAlgoAPI_Common.hxx>
589  #include <BRepAlgoAPI_Fuse.hxx>
590  #include <BRepAlgoAPI_Section.hxx>
591 -#include <BRepOffsetAPI_Sewing.hxx>
592 -#include <BRepAlgo_Sewing.hxx>
593 +//#include <BRepOffsetAPI_Sewing.hxx>
594 +//#include <BRepAlgo_Sewing.hxx>
595  #include <BRepOffsetAPI_MakeOffsetShape.hxx>
596  #include <ShapeFix_Shape.hxx>
597  namespace netgen
598 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/occ/occgenmesh.cpp netgen-4.5_new/libsrc/occ/occgenmesh.cpp
599 --- netgen-4.5_orig/libsrc/occ/occgenmesh.cpp   2006-02-07 13:12:48.000000000 +0300
600 +++ netgen-4.5_new/libsrc/occ/occgenmesh.cpp    2010-11-25 10:11:30.000000000 +0300
601 @@ -28,7 +28,7 @@
602      return  Point<3> (p.X(), p.Y(), p.Z());
603    }
604   
605 -  void DivideEdge (TopoDS_Edge & edge,
606 +  static void DivideEdge (TopoDS_Edge & edge,
607                    ARRAY<MeshPoint> & ps,
608                    ARRAY<double> & params,
609                    Mesh & mesh)
610 @@ -49,23 +49,18 @@
611      hvalue[0] = 0;
612      pnt = c->Value(s0);
613  
614 -    double olddist = 0;
615 -    double dist = 0;
616 -
617 -    for (int i = 1; i <= DIVIDEEDGESECTIONS; i++)
618 +    int i;
619 +    for (i = 1; i <= DIVIDEEDGESECTIONS; i++)
620        {
621         oldpnt = pnt;
622         pnt = c->Value(s0+(i/double(DIVIDEEDGESECTIONS))*(s1-s0));
623 -       hvalue[i] = hvalue[i-1] +
624 -         1.0/mesh.GetH(Point3d(pnt.X(), pnt.Y(), pnt.Z()))*
625 -         pnt.Distance(oldpnt);
626 +       double dist = pnt.Distance(oldpnt);
627 +       hvalue[i] = hvalue[i-1] + min( 1.0,
628 +                                       1.0/mesh.GetH(Point3d(pnt.X(), pnt.Y(), pnt.Z()))*dist);
629  
630         //(*testout) << "mesh.GetH(Point3d(pnt.X(), pnt.Y(), pnt.Z())) " << mesh.GetH(Point3d(pnt.X(), pnt.Y(), pnt.Z())) 
631         //         <<  " pnt.Distance(oldpnt) " << pnt.Distance(oldpnt) << endl;
632  
633 -
634 -       olddist = dist;
635 -       dist = pnt.Distance(oldpnt);
636        }
637  
638      //  nsubedges = int(ceil(hvalue[DIVIDEEDGESECTIONS]));
639 @@ -74,13 +69,16 @@
640      ps.SetSize(nsubedges-1);
641      params.SetSize(nsubedges+1);
642  
643 -    int i = 1;
644 +    i = 1;
645      int i1 = 0;
646      do
647        {
648         if (hvalue[i1]/hvalue[DIVIDEEDGESECTIONS]*nsubedges >= i)
649           {
650 -           params[i] = s0+(i1/double(DIVIDEEDGESECTIONS))*(s1-s0);
651 +            // EAP. For nsubedges comparable to DIVIDEEDGESECTIONS (issue 0021073)
652 +            double d1 = i1 - (hvalue[i1] - i*hvalue[DIVIDEEDGESECTIONS]/nsubedges)/(hvalue[i1]-hvalue[i1-1]);
653 +            params[i] = s0+(d1/double(DIVIDEEDGESECTIONS))*(s1-s0);
654 +           //params[i] = s0+(i1/double(DIVIDEEDGESECTIONS))*(s1-s0);
655             pnt = c->Value(params[i]);
656             ps[i-1] = MeshPoint (Point3d(pnt.X(), pnt.Y(), pnt.Z()));
657             i++;
658 @@ -112,7 +110,7 @@
659  
660    static void FindEdges (OCCGeometry & geom, Mesh & mesh)
661    {
662 -    char * savetask = multithread.task;
663 +    const char * savetask = multithread.task;
664      multithread.task = "Edge meshing";
665  
666      (*testout) << "edge meshing" << endl;
667 @@ -124,6 +122,7 @@
668      (*testout) << "nedges = " << nedges << endl;
669  
670      double eps = 1e-6 * geom.GetBoundingBox().Diam();
671 +    double eps2 = eps * eps;
672  
673      for (int i = 1; i <= nvertices; i++)
674        {
675 @@ -133,7 +132,7 @@
676         bool exists = 0;
677         if (merge_solids)
678           for (PointIndex pi = 1; pi <= mesh.GetNP(); pi++)
679 -           if ( Dist2 (mesh[pi], Point<3>(mp)) < eps*eps)
680 +           if ( Dist2 (mesh[pi], Point<3>(mp)) < eps2)
681               {
682                 exists = 1;
683                 break;
684 @@ -163,6 +162,7 @@
685           {
686             TopoDS_Face face = TopoDS::Face(exp1.Current());
687             int facenr = geom.fmap.FindIndex(face);
688 +            if ( facenr < 1 ) continue;
689  
690             if (face2solid[0][facenr-1] == 0)
691               face2solid[0][facenr-1] = solidnr;
692 @@ -184,6 +184,9 @@
693      int facenr = 0;
694      int edgenr = 0;
695      
696 +    // EAP, IMP [SALOME platform 0013410].
697 +    // take into account nb of already meshed edges
698 +    edgenr = mesh.GetNSeg();
699  
700      (*testout) << "faces = " << geom.fmap.Extent() << endl;
701      int curr = 0;
702 @@ -232,6 +235,11 @@
703                     continue;
704                   }
705  
706 +                // EAP, IMP [SALOME platform 0013410].
707 +                // Do not divide already meshed edges
708 +                if ( geom.emap.FindIndex(edge) < 1 )
709 +                  continue;
710 +
711                 if (geom.vmap.FindIndex(TopExp::FirstVertex (edge)) == 
712                     geom.vmap.FindIndex(TopExp::LastVertex (edge)))
713                   {
714 @@ -276,8 +284,8 @@
715                     pnums.Last() = -1;
716                     for (PointIndex pi = 1; pi < first_ep; pi++)
717                       {
718 -                       if (Dist2 (mesh[pi], fp) < eps*eps) pnums[0] = pi;
719 -                       if (Dist2 (mesh[pi], lp) < eps*eps) pnums.Last() = pi;
720 +                       if (Dist2 (mesh[pi], fp) < eps2) pnums[0] = pi;
721 +                       if (Dist2 (mesh[pi], lp) < eps2) pnums.Last() = pi;
722                       }
723                   }
724                 
725 @@ -287,7 +295,7 @@
726                     bool exists = 0;
727                     int j;
728                     for (j = first_ep; j <= mesh.GetNP(); j++)
729 -                     if ((mesh.Point(j)-Point<3>(mp[i-1])).Length() < eps) 
730 +                     if (Dist2(mesh.Point(j), Point<3>(mp[i-1])) < eps2)
731                         {
732                           exists = 1;
733                           break;
734 @@ -394,7 +402,7 @@
735      int i, j, k;
736      int changed;
737  
738 -    char * savetask = multithread.task;
739 +    const char * savetask = multithread.task;
740      multithread.task = "Surface meshing";
741    
742      geom.facemeshstatus = 0;
743 @@ -751,7 +759,7 @@
744      multithread.task = savetask;
745    }
746  
747 -  double ComputeH (double kappa)
748 +  static double ComputeH (double kappa)
749    {
750      double hret;
751      kappa *= mparam.curvaturesafety;
752 @@ -779,7 +787,7 @@
753        double nq = n*q;
754      
755        Point<3> p = p0 + 0.5*n;
756 -      double lambda = (p-l.p0)*n / nq;
757 +      double lambda = (fabs(nq) > 1e-10 ? (p-l.p0)*n / nq : -1);
758  
759        if (lambda >= 0 && lambda <= 1)
760         {
761 @@ -799,55 +807,55 @@
762  
763  
764  
765 -  void RestrictHTriangle (gp_Pnt2d & par0, gp_Pnt2d & par1, gp_Pnt2d & par2,
766 -                         BRepLProp_SLProps * prop, Mesh & mesh, const double maxside, int depth, double h = 0)
767 +  static void RestrictHTriangle (gp_Pnt2d & par0, gp_Pnt2d & par1, gp_Pnt2d & par2,
768 +                         BRepAdaptor_Surface& surf, Mesh & mesh, const double maxside, int depth, double h = 0)
769    {
770 -
771 +    BRepLProp_SLProps prop(surf, 2, 1e-5);
772  
773      gp_Pnt2d parmid;
774  
775      parmid.SetX(0.3*(par0.X()+par1.X()+par2.X()));
776      parmid.SetY(0.3*(par0.Y()+par1.Y()+par2.Y()));
777      
778 -    if (depth == 0)
779 +    //if (depth == 0)
780        {
781         double curvature = 0;
782  
783 -       prop->SetParameters (parmid.X(), parmid.Y());
784 -       if (!prop->IsCurvatureDefined())
785 +       prop.SetParameters (parmid.X(), parmid.Y());
786 +       if (!prop.IsCurvatureDefined())
787           {
788             (*testout) << "curvature not defined!" << endl;
789             return;
790           }
791 -       curvature = max(fabs(prop->MinCurvature()),
792 -                       fabs(prop->MaxCurvature()));
793 +       curvature = max(fabs(prop.MinCurvature()),
794 +                       fabs(prop.MaxCurvature()));
795  
796 -       prop->SetParameters (par0.X(), par0.Y());
797 -       if (!prop->IsCurvatureDefined())
798 +       prop.SetParameters (par0.X(), par0.Y());
799 +       if (!prop.IsCurvatureDefined())
800           {
801             (*testout) << "curvature not defined!" << endl;
802             return;
803           }
804 -       curvature = max(curvature,max(fabs(prop->MinCurvature()),
805 -                                     fabs(prop->MaxCurvature())));
806 +       curvature = max(curvature,max(fabs(prop.MinCurvature()),
807 +                                     fabs(prop.MaxCurvature())));
808  
809 -       prop->SetParameters (par1.X(), par1.Y());
810 -       if (!prop->IsCurvatureDefined())
811 +       prop.SetParameters (par1.X(), par1.Y());
812 +       if (!prop.IsCurvatureDefined())
813           {
814             (*testout) << "curvature not defined!" << endl;
815             return;
816           }
817 -       curvature = max(curvature,max(fabs(prop->MinCurvature()),
818 -                                     fabs(prop->MaxCurvature())));
819 +       curvature = max(curvature,max(fabs(prop.MinCurvature()),
820 +                                     fabs(prop.MaxCurvature())));
821  
822 -       prop->SetParameters (par2.X(), par2.Y());
823 -       if (!prop->IsCurvatureDefined())
824 +       prop.SetParameters (par2.X(), par2.Y());
825 +       if (!prop.IsCurvatureDefined())
826           {
827             (*testout) << "curvature not defined!" << endl;
828             return;
829           }
830 -       curvature = max(curvature,max(fabs(prop->MinCurvature()),
831 -                                     fabs(prop->MaxCurvature())));
832 +       curvature = max(curvature,max(fabs(prop.MinCurvature()),
833 +                                     fabs(prop.MaxCurvature())));
834  
835         //(*testout) << "curvature " << curvature << endl;
836  
837 @@ -886,51 +894,47 @@
838         pm1.SetX(0.5*(par0.X()+par2.X())); pm1.SetY(0.5*(par0.Y()+par2.Y()));
839         pm2.SetX(0.5*(par1.X()+par0.X())); pm2.SetY(0.5*(par1.Y()+par0.Y()));
840  
841 -       RestrictHTriangle (pm0, pm1, pm2, prop, mesh, 0.5*maxside, depth+1, h);
842 -       RestrictHTriangle (par0, pm1, pm2, prop, mesh, 0.5*maxside, depth+1, h);
843 -       RestrictHTriangle (par1, pm0, pm2, prop, mesh, 0.5*maxside, depth+1, h);
844 -       RestrictHTriangle (par2, pm1, pm0, prop, mesh, 0.5*maxside, depth+1, h);
845 +       RestrictHTriangle (pm0, pm1, pm2, surf, mesh, 0.5*maxside, depth+1, h);
846 +       RestrictHTriangle (par0, pm1, pm2, surf, mesh, 0.5*maxside, depth+1, h);
847 +       RestrictHTriangle (par1, pm0, pm2, surf, mesh, 0.5*maxside, depth+1, h);
848 +       RestrictHTriangle (par2, pm1, pm0, surf, mesh, 0.5*maxside, depth+1, h);
849        }
850      else
851        {
852         gp_Pnt pnt;
853         Point3d p3d;
854  
855 -       prop->SetParameters (parmid.X(), parmid.Y());
856 -       pnt = prop->Value();
857 +       surf.D0(parmid.X(), parmid.Y(), pnt);
858         p3d = Point3d(pnt.X(), pnt.Y(), pnt.Z());
859         mesh.RestrictLocalH (p3d, h);
860  
861         
862 -       prop->SetParameters (par0.X(), par0.Y());
863 -       pnt = prop->Value();
864 +       surf.D0(par0.X(), par0.Y(), pnt);
865         p3d = Point3d(pnt.X(), pnt.Y(), pnt.Z());
866         mesh.RestrictLocalH (p3d, h);
867  
868 -       prop->SetParameters (par1.X(), par1.Y());
869 -       pnt = prop->Value();
870 +       surf.D0(par1.X(), par1.Y(), pnt);
871         p3d = Point3d(pnt.X(), pnt.Y(), pnt.Z());
872         mesh.RestrictLocalH (p3d, h);
873  
874 -       prop->SetParameters (par2.X(), par2.Y());
875 -       pnt = prop->Value();
876 +       surf.D0(par2.X(), par2.Y(), pnt);
877         p3d = Point3d(pnt.X(), pnt.Y(), pnt.Z());
878         mesh.RestrictLocalH (p3d, h);
879  
880 -       (*testout) << "p = " << p3d << ", h = " << h << ", maxside = " << maxside << endl;
881 +       //(*testout) << "p = " << p3d << ", h = " << h << ", maxside = " << maxside << endl;
882         /*
883           (*testout) << pnt.X() << " " << pnt.Y() << " " << pnt.Z() << endl;
884  
885 -         prop->SetParameters (par0.X(), par0.Y());
886 -         pnt = prop->Value();
887 +         prop.SetParameters (par0.X(), par0.Y());
888 +         pnt = prop.Value();
889           (*testout) << pnt.X() << " " << pnt.Y() << " " << pnt.Z() << endl;
890  
891 -         prop->SetParameters (par1.X(), par1.Y());
892 -         pnt = prop->Value();
893 +         prop.SetParameters (par1.X(), par1.Y());
894 +         pnt = prop.Value();
895           (*testout) << pnt.X() << " " << pnt.Y() << " " << pnt.Z() << endl;
896  
897 -         prop->SetParameters (par2.X(), par2.Y());
898 -         pnt = prop->Value();
899 +         prop.SetParameters (par2.X(), par2.Y());
900 +         pnt = prop.Value();
901           (*testout) << pnt.X() << " " << pnt.Y() << " " << pnt.Z() << endl;
902         */
903        }
904 @@ -970,7 +974,7 @@
905         if (mparam.uselocalh)
906           {
907  
908 -           char * savetask = multithread.task;
909 +           const char * savetask = multithread.task;
910             multithread.percent = 0;
911  
912             mesh->SetLocalH (bb.PMin(), bb.PMax(), mparam.grading);
913 @@ -1075,7 +1079,6 @@
914                 if (triangulation.IsNull()) continue;
915               
916                 BRepAdaptor_Surface sf(face, Standard_True);
917 -               BRepLProp_SLProps prop(sf, 2, 1e-5);
918                 
919                 int ntriangles = triangulation -> NbTriangles();
920                 for (int j = 1; j <= ntriangles; j++)
921 @@ -1096,7 +1099,7 @@
922                     maxside = max (maxside, p[1].Distance(p[2]));
923                     //cout << "\rFace " << i << " pos11 ntriangles " << ntriangles << " maxside " << maxside << flush;
924  
925 -                   RestrictHTriangle (par[0], par[1], par[2], &prop, *mesh, maxside, 0);
926 +                   RestrictHTriangle (par[0], par[1], par[2], sf, *mesh, maxside, 0);
927                     //cout << "\rFace " << i << " pos12 ntriangles " << ntriangles << flush;
928                   }
929               }
930 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/occ/occgeom.cpp netgen-4.5_new/libsrc/occ/occgeom.cpp
931 --- netgen-4.5_orig/libsrc/occ/occgeom.cpp      2006-01-25 16:35:50.000000000 +0300
932 +++ netgen-4.5_new/libsrc/occ/occgeom.cpp       2010-11-25 10:11:31.000000000 +0300
933 @@ -7,6 +7,8 @@
934  #include "ShapeAnalysis_ShapeContents.hxx"
935  #include "ShapeAnalysis_CheckSmallFace.hxx"
936  #include "ShapeAnalysis_DataMapOfShapeListOfReal.hxx"
937 +#include <ShapeAnalysis_Surface.hxx>
938 +#include <BRepTopAdaptor_FClass2d.hxx>
939  #include "BRepAlgoAPI_Fuse.hxx"
940  #include "BRepCheck_Analyzer.hxx"
941  #include "BRepLib.hxx"
942 @@ -16,11 +18,19 @@
943  #include "Partition_Spliter.hxx"
944  //#include "VrmlAPI.hxx"
945  //#include "StlAPI.hxx"
946 +#include <TopAbs_State.hxx>
947  
948  
949  namespace netgen
950  {
951  
952 +  OCCGeometry::~OCCGeometry()
953 +  {
954 +    NCollection_DataMap<int,BRepTopAdaptor_FClass2d*>::Iterator it(fclsmap);
955 +    for (; it.More(); it.Next())
956 +      delete it.Value();
957 +  }
958 +
959    void OCCGeometry :: PrintNrShapes ()
960    {
961      TopExp_Explorer e;
962 @@ -947,13 +957,13 @@
963  
964    void OCCGeometry :: BuildVisualizationMesh ()
965    {
966 -
967 -    cout << "Preparing visualization (deflection = " << vispar.occdeflection << ") ... " << flush;
968 +    double vispar_occdeflection = 0.01;
969 +    cout << "Preparing visualization (deflection = " << vispar_occdeflection << ") ... " << flush;
970  
971  
972      BRepTools::Clean (shape);
973      //WriteOCC_STL("test.stl");
974 -    BRepMesh_IncrementalMesh::BRepMesh_IncrementalMesh (shape, vispar.occdeflection, true);
975 +    BRepMesh_IncrementalMesh (shape, vispar_occdeflection, true);
976      cout << "done" << endl;
977  
978  
979 @@ -973,8 +983,27 @@
980    
981    }
982  
983 +  void OCCGeometry::GetFaceTools(int surfi, Handle(ShapeAnalysis_Surface)& proj,
984 +                                 BRepTopAdaptor_FClass2d*& cls) const
985 +  {
986 +    //MSV: organize caching projector in the map
987 +    if (fprjmap.IsBound(surfi))
988 +    {
989 +      proj = fprjmap.Find(surfi);
990 +      cls = fclsmap.Find(surfi);
991 +    }
992 +    else
993 +    {
994 +      const TopoDS_Face& aFace = TopoDS::Face(fmap(surfi));
995 +      Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aFace);
996 +      proj = new ShapeAnalysis_Surface(aSurf);
997 +      fprjmap.Bind(surfi, proj);
998 +      cls = new BRepTopAdaptor_FClass2d(aFace,Precision::Confusion());
999 +      fclsmap.Bind(surfi, cls);
1000 +    }
1001 +  }
1002  
1003 -  void OCCGeometry :: Project (int surfi, Point<3> & p) const
1004 +  bool OCCGeometry :: Project (int surfi, Point<3> & p, double& u, double& v) const
1005    {
1006      static int cnt = 0;
1007      if (++cnt % 1000 == 0) cout << "Project cnt = " << cnt << endl;
1008 @@ -983,18 +1012,22 @@
1009  
1010      //(*testout) << "before " << pnt.X() << " "<< pnt.Y() << " "<< pnt.Z() << " " << endl;
1011  
1012 -    GeomAPI_ProjectPointOnSurf proj(pnt, BRep_Tool::Surface(TopoDS::Face(fmap(surfi))));
1013 -    if (proj.NbPoints() == 0)
1014 -      {
1015 -       cout << "Projection fails" << endl;
1016 -      }
1017 -    else
1018 -      {
1019 -       pnt = proj.NearestPoint();
1020 -       //(*testout) << "after " << pnt.X() << " "<< pnt.Y() << " "<< pnt.Z() << " " << endl;
1021 +    Handle(ShapeAnalysis_Surface) proj;
1022 +    BRepTopAdaptor_FClass2d *cls;
1023 +    GetFaceTools(surfi, proj, cls);
1024  
1025 -       p = Point<3> (pnt.X(), pnt.Y(), pnt.Z());
1026 -      }
1027 +    gp_Pnt2d p2d = proj->ValueOfUV(pnt, Precision::Confusion());
1028 +    if (cls->Perform(p2d) == TopAbs_OUT)
1029 +    {
1030 +      //cout << "Projection fails" << endl;
1031 +      return false;
1032 +    }
1033 +    pnt = proj->Value(p2d);
1034 +    p2d.Coord(u, v);
1035 +    //(*testout) << "after " << pnt.X() << " "<< pnt.Y() << " "<< pnt.Z() << " " << endl;
1036 +
1037 +    p = Point<3> (pnt.X(), pnt.Y(), pnt.Z());
1038 +    return true;
1039    }
1040  
1041  
1042 @@ -1002,54 +1035,20 @@
1043    {
1044      gp_Pnt p(ap(0), ap(1), ap(2));
1045    
1046 -    Handle(Geom_Surface) surface = BRep_Tool::Surface(TopoDS::Face(fmap(surfi)));
1047 +    Handle(ShapeAnalysis_Surface) proj;
1048 +    BRepTopAdaptor_FClass2d *cls;
1049 +    GetFaceTools(surfi, proj, cls);
1050    
1051 -    gp_Pnt x = surface->Value (u,v);
1052 -  
1053 -    if (p.SquareDistance(x) <= sqr(PROJECTION_TOLERANCE)) return true;
1054 -  
1055 -    gp_Vec du, dv;
1056 -  
1057 -    surface->D1(u,v,x,du,dv);
1058 -  
1059 -    int count = 0;
1060 -  
1061 -    gp_Pnt xold;
1062 -    gp_Vec n;
1063 -    double det, lambda, mu;
1064 -  
1065 -    do {
1066 -      count++;
1067 -  
1068 -      n = du^dv;
1069 -  
1070 -      det = Det3 (n.X(), du.X(), dv.X(),
1071 -                 n.Y(), du.Y(), dv.Y(),
1072 -                 n.Z(), du.Z(), dv.Z());
1073 -  
1074 -      if (det < 1e-15) return false; 
1075 -  
1076 -      lambda = Det3 (n.X(), p.X()-x.X(), dv.X(),
1077 -                    n.Y(), p.Y()-x.Y(), dv.Y(),
1078 -                    n.Z(), p.Z()-x.Z(), dv.Z())/det;
1079 -  
1080 -      mu     = Det3 (n.X(), du.X(), p.X()-x.X(),
1081 -                    n.Y(), du.Y(), p.Y()-x.Y(),
1082 -                    n.Z(), du.Z(), p.Z()-x.Z())/det;
1083 -    
1084 -      u += lambda;
1085 -      v += mu;
1086 -  
1087 -      xold = x;
1088 -      surface->D1(u,v,x,du,dv);
1089 -  
1090 -    } while (xold.SquareDistance(x) > sqr(PROJECTION_TOLERANCE) && count < 50);
1091 -
1092 -    //    (*testout) << "FastProject count: " << count << endl;
1093 -  
1094 -    if (count == 50) return false;
1095 +    gp_Pnt2d p2d = proj->NextValueOfUV(gp_Pnt2d(u,v), p, Precision::Confusion());
1096 +    if (cls->Perform(p2d) == TopAbs_OUT)
1097 +    {
1098 +      //cout << "Projection fails" << endl;
1099 +      return false;
1100 +    }
1101    
1102 -    ap = Point<3> (x.X(), x.Y(), x.Z());
1103 +    p = proj->Value(p2d);
1104 +    p2d.Coord(u, v);
1105 +    ap = Point<3> (p.X(), p.Y(), p.Z());
1106    
1107      return true;
1108    }
1109 @@ -1190,16 +1189,16 @@
1110      return occgeo;
1111    } 
1112  
1113 -  char * shapesname[] =
1114 +  const char * shapesname[] =
1115      {" ", "CompSolids", "Solids", "Shells",
1116  
1117       "Faces", "Wires", "Edges", "Vertices"};
1118  
1119 -  char * shapename[] =
1120 +  const char * shapename[] =
1121      {" ", "CompSolid", "Solid", "Shell",
1122       "Face", "Wire", "Edge", "Vertex"};
1123  
1124 -  char * orientationstring[] =
1125 +  const char * orientationstring[] =
1126      {"+", "-"};
1127  
1128    void OCCGeometry :: RecursiveTopologyTree (const TopoDS_Shape & sh,
1129 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/occ/occgeom.hpp netgen-4.5_new/libsrc/occ/occgeom.hpp
1130 --- netgen-4.5_orig/libsrc/occ/occgeom.hpp      2006-01-25 16:35:50.000000000 +0300
1131 +++ netgen-4.5_new/libsrc/occ/occgeom.hpp       2010-11-25 10:11:31.000000000 +0300
1132 @@ -15,8 +15,6 @@
1133  #include "Geom_Curve.hxx"
1134  #include "Geom2d_Curve.hxx"
1135  #include "Geom_Surface.hxx"
1136 -#include "GeomAPI_ProjectPointOnSurf.hxx"
1137 -#include "GeomAPI_ProjectPointOnCurve.hxx"
1138  #include "BRepTools.hxx"
1139  #include "TopExp.hxx"
1140  #include "BRepBuilderAPI_MakeVertex.hxx"
1141 @@ -41,8 +39,6 @@
1142  #include "Geom_Curve.hxx"
1143  #include "Geom2d_Curve.hxx"
1144  #include "Geom_Surface.hxx"
1145 -#include "GeomAPI_ProjectPointOnSurf.hxx"
1146 -#include "GeomAPI_ProjectPointOnCurve.hxx"
1147  #include "TopoDS_Wire.hxx"
1148  #include "BRepTools_WireExplorer.hxx"
1149  #include "BRepTools.hxx"
1150 @@ -69,7 +65,7 @@
1151  #include "IGESToBRep_Reader.hxx"
1152  #include "Interface_Static.hxx"
1153  #include "GeomAPI_ExtremaCurveCurve.hxx"
1154 -#include "Standard_ErrorHandler.hxx"
1155 +//#include "Standard_ErrorHandler.hxx"
1156  #include "Standard_Failure.hxx"
1157  #include "ShapeUpgrade_ShellSewing.hxx"
1158  #include "ShapeFix_Shape.hxx"
1159 @@ -84,11 +80,15 @@
1160  #include "STEPControl_Writer.hxx"
1161  #include "StlAPI_Writer.hxx"
1162  #include "STEPControl_StepModelType.hxx"
1163 +#include <NCollection_DataMap.hxx>
1164 +
1165 +class Handle_ShapeAnalysis_Surface;
1166 +class BRepTopAdaptor_FClass2d;
1167  
1168  namespace netgen
1169  {
1170  
1171 -#include "../visualization/vispar.hpp"
1172 +  //#include "../visualization/vispar.hpp"
1173    //  class VisualizationParameters;
1174    //  extern VisualizationParameters vispar;
1175  
1176 @@ -159,6 +159,8 @@
1177  class OCCGeometry
1178  {
1179    Point<3> center;
1180 +  mutable NCollection_DataMap<int,Handle_ShapeAnalysis_Surface> fprjmap;
1181 +  mutable NCollection_DataMap<int,BRepTopAdaptor_FClass2d*> fclsmap;
1182  
1183  public:
1184    TopoDS_Shape shape;
1185 @@ -189,6 +191,7 @@
1186      vmap.Clear();
1187    }
1188  
1189 +  ~OCCGeometry();
1190  
1191    void BuildFMap();
1192  
1193 @@ -204,10 +207,12 @@
1194    Point<3> Center()
1195    { return center; }
1196  
1197 -  void Project (int surfi, Point<3> & p) const;
1198 +  bool Project (int surfi, Point<3> & p, double& u, double& v) const;
1199    bool FastProject (int surfi, Point<3> & ap, double& u, double& v) const;
1200  
1201
1202 +  void GetFaceTools(int surfi, Handle(ShapeAnalysis_Surface)& proj,
1203 +                    BRepTopAdaptor_FClass2d*& cls) const;
1204 +
1205    OCCSurface GetSurface (int surfi)
1206    {
1207      cout << "OCCGeometry::GetSurface using PLANESPACE" << endl;
1208 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/occ/occmeshsurf.cpp netgen-4.5_new/libsrc/occ/occmeshsurf.cpp
1209 --- netgen-4.5_orig/libsrc/occ/occmeshsurf.cpp  2006-01-25 16:36:26.000000000 +0300
1210 +++ netgen-4.5_new/libsrc/occ/occmeshsurf.cpp   2010-11-25 10:11:31.000000000 +0300
1211 @@ -5,6 +5,8 @@
1212  #include <occgeom.hpp>
1213  #include <meshing.hpp>
1214  #include <GeomLProp_SLProps.hxx>
1215 +#include <GeomAPI_ProjectPointOnSurf.hxx>
1216 +#include <GeomAPI_ProjectPointOnCurve.hxx>
1217  
1218  
1219  namespace netgen
1220 @@ -411,11 +413,16 @@
1221    }
1222  
1223  
1224 -  void MeshOptimize2dOCCSurfaces :: ProjectPoint (INDEX surfind, Point3d & p) const
1225 +  bool MeshOptimize2dOCCSurfaces :: ProjectPoint (INDEX surfind, Point3d & p, PointGeomInfo& gi) const
1226    {
1227      Point<3> hp = p;
1228 -    geometry.Project (surfind, hp);
1229 +    bool ok;
1230 +    if (gi.trignum > 0)
1231 +      ok = geometry.FastProject (surfind, hp, gi.u, gi.v);
1232 +    else
1233 +      ok = geometry.Project (surfind, hp, gi.u, gi.v);
1234      p = hp;
1235 +    return ok;
1236    }
1237  
1238    void MeshOptimize2dOCCSurfaces :: ProjectPoint2 (INDEX surfind, INDEX surfind2, 
1239 @@ -506,38 +513,6 @@
1240    }
1241  
1242  
1243 -  int MeshOptimize2dOCCSurfaces :: 
1244 -  CalcPointGeomInfo(int surfind, PointGeomInfo& gi, const Point3d& p) const
1245 -  {
1246 -    Standard_Real u,v;
1247 -
1248 -    gp_Pnt pnt(p.X(), p.Y(), p.Z());
1249 -
1250 -    Handle(Geom_Surface) occface;
1251 -    occface = BRep_Tool::Surface(TopoDS::Face(geometry.fmap(surfind)));
1252 -
1253 -    GeomAPI_ProjectPointOnSurf proj(pnt, occface);
1254 -
1255 -    if (proj.NbPoints() < 1)
1256 -      {
1257 -       cout << "ERROR: OCCSurface :: GetNormalVector: GeomAPI_ProjectPointOnSurf failed!"
1258 -            << endl;
1259 -       cout << p << endl;
1260 -       return 0;
1261 -      }
1262
1263 -    proj.LowerDistanceParameters (u, v);  
1264 -
1265 -    gi.u = u;
1266 -    gi.v = v;
1267 -    return 1;
1268 -  }
1269 -
1270 -
1271 -
1272 -
1273 -
1274 -
1275    OCCRefinementSurfaces :: OCCRefinementSurfaces (const OCCGeometry & ageometry)
1276      : Refinement(), geometry(ageometry)
1277    {
1278 @@ -627,10 +602,11 @@
1279         if (!geometry.FastProject (surfi, hnewp, u, v))
1280           {
1281             cout << "Fast projection to surface fails! Using OCC projection" << endl;
1282 -           geometry.Project (surfi, hnewp);
1283 +            double u, v;
1284 +           geometry.Project (surfi, hnewp, u, v);
1285           }
1286  
1287 -       newgi.trignum = 1;
1288 +       newgi.trignum = surfi;
1289        }
1290    
1291      newp = hnewp;
1292 @@ -653,14 +629,17 @@
1293      hnewp = Point<3> (pnt.X(), pnt.Y(), pnt.Z());
1294      newp = hnewp;
1295      newgi = ap1;
1296 -  };
1297 +  }
1298  
1299  
1300    void OCCRefinementSurfaces :: ProjectToSurface (Point<3> & p, int surfi)
1301    {
1302      if (surfi > 0)
1303 -      geometry.Project (surfi, p);
1304 -  };
1305 +    {
1306 +      double u, v;
1307 +      geometry.Project (surfi, p, u, v);
1308 +    }
1309 +  }
1310  
1311    void OCCRefinementSurfaces :: ProjectToSurface (Point<3> & p, int surfi, PointGeomInfo & gi)
1312    {
1313 @@ -668,9 +647,10 @@
1314        if (!geometry.FastProject (surfi, p, gi.u, gi.v))
1315         {
1316           cout << "Fast projection to surface fails! Using OCC projection" << endl;
1317 -         geometry.Project (surfi, p);
1318 +          double u, v;
1319 +         geometry.Project (surfi, p, u, v);
1320         }
1321 -  };
1322 +  }
1323  
1324  
1325  
1326 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/occ/occmeshsurf.hpp netgen-4.5_new/libsrc/occ/occmeshsurf.hpp
1327 --- netgen-4.5_orig/libsrc/occ/occmeshsurf.hpp  2005-06-09 18:51:10.000000000 +0400
1328 +++ netgen-4.5_new/libsrc/occ/occmeshsurf.hpp   2010-11-25 10:11:31.000000000 +0300
1329 @@ -151,7 +151,7 @@
1330      MeshOptimize2dOCCSurfaces (const OCCGeometry & ageometry); 
1331     
1332      ///
1333 -    virtual void ProjectPoint (INDEX surfind, Point3d & p) const;
1334 +    virtual bool ProjectPoint (INDEX surfind, Point3d & p, PointGeomInfo& gi) const;
1335      ///
1336      virtual void ProjectPoint2 (INDEX surfind, INDEX surfind2, Point3d & p) const;
1337      ///
1338 @@ -159,9 +159,6 @@
1339      ///
1340      virtual void GetNormalVector(INDEX surfind, const Point3d & p, PointGeomInfo & gi, Vec3d & n) const;
1341  
1342 -    
1343 -  virtual int CalcPointGeomInfo(int surfind, PointGeomInfo& gi, const Point3d& p3) const;
1344 -
1345  };
1346  
1347  
1348 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/occ/utilities.h netgen-4.5_new/libsrc/occ/utilities.h
1349 --- netgen-4.5_orig/libsrc/occ/utilities.h      2005-02-11 14:35:43.000000000 +0300
1350 +++ netgen-4.5_new/libsrc/occ/utilities.h       2010-11-25 10:11:31.000000000 +0300
1351 @@ -33,6 +33,7 @@
1352  
1353  #include <string>
1354  #include <iostream>
1355 +#include <iomanip>
1356  #include <cstdlib>
1357  // #include "SALOME_Log.hxx"
1358  
1359 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/stlgeom/meshstlsurface.cpp netgen-4.5_new/libsrc/stlgeom/meshstlsurface.cpp
1360 --- netgen-4.5_orig/libsrc/stlgeom/meshstlsurface.cpp   2006-01-11 19:08:20.000000000 +0300
1361 +++ netgen-4.5_new/libsrc/stlgeom/meshstlsurface.cpp    2010-11-25 10:11:31.000000000 +0300
1362 @@ -946,20 +946,23 @@
1363  }
1364  
1365  
1366 -void MeshOptimizeSTLSurface :: ProjectPoint (INDEX surfind, Point3d & p) const
1367 +bool MeshOptimizeSTLSurface :: ProjectPoint (INDEX surfind, Point3d & p, PointGeomInfo& gi) const
1368  {
1369    Point<3> hp = p;
1370 -  if (!geom.Project (hp))
1371 +  if (gi.trignum > 0)
1372 +    ((STLGeometry&)geom).SelectChartOfTriangle (gi.trignum);
1373 +  if (!(gi.trignum = geom.Project (hp)))
1374      {
1375        PrintMessage(7,"project failed");
1376        
1377 -      if (!geom.ProjectOnWholeSurface(hp)) 
1378 +      if (!(gi.trignum = geom.ProjectOnWholeSurface(hp))) 
1379         {
1380           PrintMessage(7, "project on whole surface failed");
1381         }
1382      }
1383    p = hp;
1384    //  geometry.GetSurface(surfind)->Project (p);
1385 +  return gi.trignum > 0;
1386  }
1387  
1388  void MeshOptimizeSTLSurface :: ProjectPoint2 (INDEX surfind, INDEX surfind2, Point3d & p) const
1389 @@ -970,20 +973,6 @@
1390    */
1391  }
1392  
1393 -int  MeshOptimizeSTLSurface :: CalcPointGeomInfo(PointGeomInfo& gi, const Point3d& p3) const
1394 -{
1395 -  Point<3> hp = p3;
1396 -  gi.trignum = geom.Project (hp);
1397 -
1398 -  if (gi.trignum)
1399 -    {
1400 -      return 1;
1401 -    }
1402 -
1403 -  return 0;
1404 -  
1405 -}
1406 -
1407  void MeshOptimizeSTLSurface :: GetNormalVector(INDEX surfind, const Point3d & p, Vec3d & n) const
1408  {
1409    n = geom.GetChartNormalVector();
1410 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/stlgeom/meshstlsurface.hpp netgen-4.5_new/libsrc/stlgeom/meshstlsurface.hpp
1411 --- netgen-4.5_orig/libsrc/stlgeom/meshstlsurface.hpp   2004-09-30 17:13:56.000000000 +0400
1412 +++ netgen-4.5_new/libsrc/stlgeom/meshstlsurface.hpp    2010-11-25 10:11:31.000000000 +0300
1413 @@ -79,12 +79,10 @@
1414      virtual void SelectSurfaceOfPoint (const Point3d & p,
1415                                        const PointGeomInfo & gi);
1416      ///
1417 -    virtual void ProjectPoint (INDEX surfind, Point3d & p) const;
1418 +    virtual bool ProjectPoint (INDEX surfind, Point3d & p, PointGeomInfo& gi) const;
1419      ///
1420      virtual void ProjectPoint2 (INDEX surfind, INDEX surfind2, Point3d & p) const;
1421      ///
1422 -    virtual int CalcPointGeomInfo(PointGeomInfo& gi, const Point3d& p3) const;
1423 -    ///
1424      virtual void GetNormalVector(INDEX surfind, const Point3d & p, Vec3d & n) const;
1425  };
1426  
1427 diff -Naur --exclude=CVS netgen-4.5_orig/libsrc/stlgeom/stlgeommesh.cpp netgen-4.5_new/libsrc/stlgeom/stlgeommesh.cpp
1428 --- netgen-4.5_orig/libsrc/stlgeom/stlgeommesh.cpp      2004-08-10 03:39:45.000000000 +0400
1429 +++ netgen-4.5_new/libsrc/stlgeom/stlgeommesh.cpp       2010-11-25 10:11:31.000000000 +0300
1430 @@ -1437,7 +1437,7 @@
1431  
1432           if (!optstring || strlen(optstring) == 0)
1433             {
1434 -             mparam.optimize2d = "smcm";
1435 +             mparam.optimize2d = (char*)"smcm";
1436             }
1437           else
1438             {
1439 @@ -1453,7 +1453,7 @@
1440                                  mparam.grading);
1441               mesh -> LoadLocalMeshSize (mparam.meshsizefilename);            
1442               mesh -> CalcLocalHFromSurfaceCurvature (stlparam.resthsurfmeshcurvfac);
1443 -             mparam.optimize2d = "cmsmSm";
1444 +             mparam.optimize2d = (char*)"cmsmSm";
1445               STLSurfaceOptimization (*stlgeometry, *mesh, mparam);
1446  #ifdef STAT_STREAM
1447               (*statout) << GetTime() << " & ";
1448 @@ -1559,7 +1559,7 @@
1449  
1450           if (!optstring || strlen(optstring) == 0)
1451             {
1452 -             mparam.optimize3d = "cmdmstm";
1453 +             mparam.optimize3d = (char*)"cmdmstm";
1454             }
1455           else
1456             {
1457 diff -Naur --exclude=CVS netgen-4.5_orig/makeForSalome.sh netgen-4.5_new/makeForSalome.sh
1458 --- netgen-4.5_orig/makeForSalome.sh    1970-01-01 03:00:00.000000000 +0300
1459 +++ netgen-4.5_new/makeForSalome.sh     2010-11-25 10:11:31.000000000 +0300
1460 @@ -0,0 +1,35 @@
1461 +#! /bin/sh
1462 +cp ngtcltk/ngnewdelete.* libsrc/interface/
1463 +
1464 +if test `uname -m` = "x86_64" ; then
1465 + MACHINE=LINUX64
1466 +else
1467 + MACHINE=LINUX
1468 +fi
1469 +export MACHINE
1470 +make -C libsrc/csg
1471 +make -C libsrc/general
1472 +make -C libsrc/geom2d
1473 +make -C libsrc/gprim
1474 +make -C libsrc/interface
1475 +make -C libsrc/linalg
1476 +make -C libsrc/meshing
1477 +make -C libsrc/opti
1478 +make -C libsrc/stlgeom
1479 +make -C libsrc/occ
1480 +
1481 +if [ ! -d install ] ; then
1482 +       mkdir install
1483 +fi
1484 +
1485 +cp -r lib install/
1486 +
1487 +if [ ! -d install/include ] ; then
1488 +       mkdir install/include
1489 +fi
1490 +
1491 +cp libsrc/interface/nglib.h libsrc/general/*.hpp libsrc/csg/*.hpp libsrc/geom2d/*.hpp \
1492 +   libsrc/gprim/*.hpp libsrc/linalg/*.hpp libsrc/meshing/*.hpp \
1493 +   libsrc/occ/*.hpp libsrc/opti/*.hpp libsrc/include/mydefs.hpp \
1494 +   libsrc/stlgeom/*.hpp libsrc/include/mystdlib.h \
1495 +   install/include