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
5 void Plane :: GetPrimitiveData (char *& classname,
6 ARRAY<double> & coeffs) const
9 + classname = (char*)"plane";
11 coeffs.Elem(1) = p(0);
12 coeffs.Elem(2) = p(1);
15 void Sphere :: GetPrimitiveData (char *& classname, ARRAY<double> & coeffs) const
17 - classname = "sphere";
18 + classname = (char*)"sphere";
20 coeffs.Elem(1) = c(0);
21 coeffs.Elem(2) = c(1);
24 void Cylinder :: GetPrimitiveData (char *& classname, ARRAY<double> & coeffs) const
26 - classname = "cylinder";
27 + classname = (char*)"cylinder";
29 coeffs.Elem(1) = a(0);
30 coeffs.Elem(2) = a(1);
33 void Cone :: GetPrimitiveData (char *& classname, ARRAY<double> & coeffs) const
36 + classname = (char*)"cone";
38 coeffs.Elem(1) = a(0);
39 coeffs.Elem(2) = a(1);
42 void Torus :: GetPrimitiveData (char *& classname, ARRAY<double> & coeffs) const
44 - classname = "torus";
45 + classname = (char*)"torus";
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
54 GetPrimitiveData (char *& classname, ARRAY<double> & coeffs) const
56 - classname = "brick";
57 + classname = (char*)"brick";
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
68 -void MeshOptimize2dSurfaces :: ProjectPoint (INDEX surfind, Point3d & p) const
69 +bool MeshOptimize2dSurfaces :: ProjectPoint (INDEX surfind, Point3d & p) const
72 geometry.GetSurface(surfind)->Project (hp);
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
82 MeshOptimize2dSurfaces (const CSGeometry & ageometry);
85 - virtual void ProjectPoint (INDEX surfind, Point3d & p) const;
86 + virtual bool ProjectPoint (INDEX surfind, Point3d & p) const;
88 virtual void ProjectPoint2 (INDEX surfind, INDEX surfind2, Point3d & p) const;
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
94 void Polyhedra :: GetPrimitiveData (char *& classname,
95 ARRAY<double> & coeffs) const
97 - classname = "Polyhedra";
98 + classname = (char*)"Polyhedra";
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
106 void Primitive :: GetPrimitiveData (char *& classname,
107 ARRAY<double> & coeffs) const
109 - classname = "undef";
110 + classname = (char*)"undef";
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
119 StopTimer (total_timer);
121 - ofstream prof ("netgen.prof");
124 + if ((env = getenv("NETGEN_PROF")) && !strcmp(env, "1")) {
125 + ofstream prof ("netgen.prof");
128 + else if ((env = getenv("NETGEN_PROF")) && !strcmp(env, "0")) {
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 @@
139 int hsteps = mp.optsteps2d;
141 - mp.optimize2d = "smcm";
142 + mp.optimize2d = (char*)"smcm";
143 mp.optsteps2d = hsteps/2;
144 Optimize2d (*mesh, mp);
146 - mp.optimize2d = "Smcm";
147 + mp.optimize2d = (char*)"Smcm";
148 mp.optsteps2d = (hsteps+1)/2;
149 Optimize2d (*mesh, mp);
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
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
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
181 +#include <cstring>
\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
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
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
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
213 void RegisterUserFormats (ARRAY<const char*> & names)
216 + const char *types[] =
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
228 +void CalcAtA (const DenseMatrix & a, DenseMatrix & m2);
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
236 LIBSRC_DIR=$(CPP_DIR)/libsrc
237 LIB_DIR=$(CPP_DIR)/lib/$(MACHINE)
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
247 +OCCINC_DIR=$(OCC_DIR)/inc
248 +OCCLIB_DIR=$(OCC_DIR)/Linux/lib
250 include $(LIBSRC_DIR)/makefile.mach.$(MACHINE)
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
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
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
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
277 -#include <visual.hpp>
278 +//#include <visual.hpp>
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
287 virtual void SelectSurfaceOfPoint (const Point3d & p,
288 const PointGeomInfo & gi);
290 - virtual void ProjectPoint (INDEX /* surfind */, Point3d & /* p */) const { };
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); }
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;};
306 - virtual int CalcPointGeomInfo(int /* surfind */, PointGeomInfo& gi, const Point3d& p3) const
307 - { return CalcPointGeomInfo (gi, p3); }
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
315 #include <mystdlib.h>
318 #include "meshing.hpp"
323 double det = trans.Det();
325 + if (det <= DBL_MIN)
328 err += frob * frob / det;
329 @@ -2222,9 +2223,9 @@
331 MeshingParameters :: MeshingParameters ()
333 - optimize3d = "cmdmstm";
334 + optimize3d = (char*)"cmdmstm";
336 - optimize2d = "smsmsmSmSmSm";
337 + optimize2d = (char*)"smsmsmSmSmSm";
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
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
357 double Opti2SurfaceMinFunction ::
358 FuncGrad (const Vector & x, Vector & grad) const
364 double badness, hbadness;
369 - meshthis -> GetNormalVector (surfi, sp1, gi1, n);
372 pp1.Add2 (x.Get(1), t1, x.Get(2), t2);
375 double Opti2SurfaceMinFunction ::
376 FuncDeriv (const Vector & x, const Vector & dir, double & deriv) const
382 double badness, hbadness;
387 - meshthis -> GetNormalVector (surfi, sp1, gi1, n);
390 pp1.Add2 (x.Get(1), t1, x.Get(2), t2);
400 double badness, hbadness, hbad, hderiv;
405 - meshthis -> GetNormalVector (surfi, sp1, gi1, n);
408 pp1.Add2 (x.Get(1), t1, x.Get(2), t2);
418 double badness, hbadness, hbad, hderiv;
423 - meshthis -> GetNormalVector (surfi, sp1, gi1, n);
426 pp1.Add2 (x.Get(1), t1, x.Get(2), t2);
428 @@ -859,19 +851,21 @@
429 locelements.SetSize(0);
434 for (j = 0; j < elementsonpoint[pi].Size(); j++)
436 sei = elementsonpoint[pi][j];
437 const Element2d & bel = mesh[sei];
438 surfi = mesh.GetFaceDescriptor(bel.GetIndex()).SurfNr();
441 locelements.Append (sei);
443 for (k = 1; k <= bel.GetNP(); k++)
444 if (bel.PNum(k) == pi)
447 + ngi = bel.GeomInfoPi(k);
454 //optimizer loop (if not whole distance is not possible, move only a bit!!!!)
455 - while (loci <= 5 && !moveisok)
456 + while (loci <= 5 && !moveisok)
459 mesh[pi].X() = origp.X() + (x.Get(1) * t1.X() + x.Get(2) * t2.X())*fact;
464 - ProjectPoint (surfi, mesh[pi]);
465 + moveisok = ProjectPoint (surfi, mesh[pi], ngi);
467 - moveisok = CalcPointGeomInfo(surfi, ngi, mesh[pi]);
468 - // point lies on same chart in stlsurface
470 + // point lies on same chart in stlsurface
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
480 //using namespace std;
481 -#include "Partition_Inter2d.ixx"
483 #include "utilities.h"
485 +#include "Partition_Inter2d.ixx"
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
496 //using namespace std;
498 +#include "utilities.h"
500 #include "Partition_Inter2d.hxx"
501 #include "Partition_Inter3d.ixx"
502 -#include "utilities.h"
504 #include <BRepAlgo_AsDes.hxx>
505 #include <BRepAlgo_Image.hxx>
506 #include <BRepLib.hxx>
507 +//using namespace std;
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
518 //using namespace std;
521 -#include "Partition_Loop.ixx"
523 #include "utilities.h"
527 +#include "Partition_Loop.ixx"
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
538 //using namespace std;
539 -#include "Partition_Loop2d.ixx"
542 #include "utilities.h"
544 +#include "Partition_Loop2d.ixx"
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
554 //using namespace std;
558 +#include "utilities.h"
560 #include "Partition_Loop3d.ixx"
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
569 //using namespace std;
571 +#include "utilities.h"
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"
579 -#include "utilities.h"
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
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>
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
602 return Point<3> (p.X(), p.Y(), p.Z());
605 - void DivideEdge (TopoDS_Edge & edge,
606 + static void DivideEdge (TopoDS_Edge & edge,
607 ARRAY<MeshPoint> & ps,
608 ARRAY<double> & params,
614 - double olddist = 0;
617 - for (int i = 1; i <= DIVIDEEDGESECTIONS; i++)
619 + for (i = 1; i <= DIVIDEEDGESECTIONS; i++)
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);
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;
635 - dist = pnt.Distance(oldpnt);
638 // nsubedges = int(ceil(hvalue[DIVIDEEDGESECTIONS]));
640 ps.SetSize(nsubedges-1);
641 params.SetSize(nsubedges+1);
648 if (hvalue[i1]/hvalue[DIVIDEEDGESECTIONS]*nsubedges >= i)
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()));
660 static void FindEdges (OCCGeometry & geom, Mesh & mesh)
662 - char * savetask = multithread.task;
663 + const char * savetask = multithread.task;
664 multithread.task = "Edge meshing";
666 (*testout) << "edge meshing" << endl;
668 (*testout) << "nedges = " << nedges << endl;
670 double eps = 1e-6 * geom.GetBoundingBox().Diam();
671 + double eps2 = eps * eps;
673 for (int i = 1; i <= nvertices; i++)
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)
686 TopoDS_Face face = TopoDS::Face(exp1.Current());
687 int facenr = geom.fmap.FindIndex(face);
688 + if ( facenr < 1 ) continue;
690 if (face2solid[0][facenr-1] == 0)
691 face2solid[0][facenr-1] = solidnr;
696 + // EAP, IMP [SALOME platform 0013410].
697 + // take into account nb of already meshed edges
698 + edgenr = mesh.GetNSeg();
700 (*testout) << "faces = " << geom.fmap.Extent() << endl;
706 + // EAP, IMP [SALOME platform 0013410].
707 + // Do not divide already meshed edges
708 + if ( geom.emap.FindIndex(edge) < 1 )
711 if (geom.vmap.FindIndex(TopExp::FirstVertex (edge)) ==
712 geom.vmap.FindIndex(TopExp::LastVertex (edge)))
716 for (PointIndex pi = 1; pi < first_ep; pi++)
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;
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)
738 - char * savetask = multithread.task;
739 + const char * savetask = multithread.task;
740 multithread.task = "Surface meshing";
742 geom.facemeshstatus = 0;
744 multithread.task = savetask;
747 - double ComputeH (double kappa)
748 + static double ComputeH (double kappa)
751 kappa *= mparam.curvaturesafety;
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);
759 if (lambda >= 0 && lambda <= 1)
761 @@ -799,55 +807,55 @@
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)
771 + BRepLProp_SLProps prop(surf, 2, 1e-5);
775 parmid.SetX(0.3*(par0.X()+par1.X()+par2.X()));
776 parmid.SetY(0.3*(par0.Y()+par1.Y()+par2.Y()));
781 double curvature = 0;
783 - prop->SetParameters (parmid.X(), parmid.Y());
784 - if (!prop->IsCurvatureDefined())
785 + prop.SetParameters (parmid.X(), parmid.Y());
786 + if (!prop.IsCurvatureDefined())
788 (*testout) << "curvature not defined!" << endl;
791 - curvature = max(fabs(prop->MinCurvature()),
792 - fabs(prop->MaxCurvature()));
793 + curvature = max(fabs(prop.MinCurvature()),
794 + fabs(prop.MaxCurvature()));
796 - prop->SetParameters (par0.X(), par0.Y());
797 - if (!prop->IsCurvatureDefined())
798 + prop.SetParameters (par0.X(), par0.Y());
799 + if (!prop.IsCurvatureDefined())
801 (*testout) << "curvature not defined!" << endl;
804 - curvature = max(curvature,max(fabs(prop->MinCurvature()),
805 - fabs(prop->MaxCurvature())));
806 + curvature = max(curvature,max(fabs(prop.MinCurvature()),
807 + fabs(prop.MaxCurvature())));
809 - prop->SetParameters (par1.X(), par1.Y());
810 - if (!prop->IsCurvatureDefined())
811 + prop.SetParameters (par1.X(), par1.Y());
812 + if (!prop.IsCurvatureDefined())
814 (*testout) << "curvature not defined!" << endl;
817 - curvature = max(curvature,max(fabs(prop->MinCurvature()),
818 - fabs(prop->MaxCurvature())));
819 + curvature = max(curvature,max(fabs(prop.MinCurvature()),
820 + fabs(prop.MaxCurvature())));
822 - prop->SetParameters (par2.X(), par2.Y());
823 - if (!prop->IsCurvatureDefined())
824 + prop.SetParameters (par2.X(), par2.Y());
825 + if (!prop.IsCurvatureDefined())
827 (*testout) << "curvature not defined!" << endl;
830 - curvature = max(curvature,max(fabs(prop->MinCurvature()),
831 - fabs(prop->MaxCurvature())));
832 + curvature = max(curvature,max(fabs(prop.MinCurvature()),
833 + fabs(prop.MaxCurvature())));
835 //(*testout) << "curvature " << curvature << endl;
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()));
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);
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);
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);
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);
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);
880 - (*testout) << "p = " << p3d << ", h = " << h << ", maxside = " << maxside << endl;
881 + //(*testout) << "p = " << p3d << ", h = " << h << ", maxside = " << maxside << endl;
883 (*testout) << pnt.X() << " " << pnt.Y() << " " << pnt.Z() << endl;
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;
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;
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;
905 if (mparam.uselocalh)
908 - char * savetask = multithread.task;
909 + const char * savetask = multithread.task;
910 multithread.percent = 0;
912 mesh->SetLocalH (bb.PMin(), bb.PMax(), mparam.grading);
913 @@ -1075,7 +1079,6 @@
914 if (triangulation.IsNull()) continue;
916 BRepAdaptor_Surface sf(face, Standard_True);
917 - BRepLProp_SLProps prop(sf, 2, 1e-5);
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;
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;
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
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"
943 #include "Partition_Spliter.hxx"
944 //#include "VrmlAPI.hxx"
945 //#include "StlAPI.hxx"
946 +#include <TopAbs_State.hxx>
952 + OCCGeometry::~OCCGeometry()
954 + NCollection_DataMap<int,BRepTopAdaptor_FClass2d*>::Iterator it(fclsmap);
955 + for (; it.More(); it.Next())
959 void OCCGeometry :: PrintNrShapes ()
962 @@ -947,13 +957,13 @@
964 void OCCGeometry :: BuildVisualizationMesh ()
967 - cout << "Preparing visualization (deflection = " << vispar.occdeflection << ") ... " << flush;
968 + double vispar_occdeflection = 0.01;
969 + cout << "Preparing visualization (deflection = " << vispar_occdeflection << ") ... " << flush;
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;
983 + void OCCGeometry::GetFaceTools(int surfi, Handle(ShapeAnalysis_Surface)& proj,
984 + BRepTopAdaptor_FClass2d*& cls) const
986 + //MSV: organize caching projector in the map
987 + if (fprjmap.IsBound(surfi))
989 + proj = fprjmap.Find(surfi);
990 + cls = fclsmap.Find(surfi);
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);
1003 - void OCCGeometry :: Project (int surfi, Point<3> & p) const
1004 + bool OCCGeometry :: Project (int surfi, Point<3> & p, double& u, double& v) const
1007 if (++cnt % 1000 == 0) cout << "Project cnt = " << cnt << endl;
1008 @@ -983,18 +1012,22 @@
1010 //(*testout) << "before " << pnt.X() << " "<< pnt.Y() << " "<< pnt.Z() << " " << endl;
1012 - GeomAPI_ProjectPointOnSurf proj(pnt, BRep_Tool::Surface(TopoDS::Face(fmap(surfi))));
1013 - if (proj.NbPoints() == 0)
1015 - cout << "Projection fails" << endl;
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);
1025 - p = Point<3> (pnt.X(), pnt.Y(), pnt.Z());
1027 + gp_Pnt2d p2d = proj->ValueOfUV(pnt, Precision::Confusion());
1028 + if (cls->Perform(p2d) == TopAbs_OUT)
1030 + //cout << "Projection fails" << endl;
1033 + pnt = proj->Value(p2d);
1035 + //(*testout) << "after " << pnt.X() << " "<< pnt.Y() << " "<< pnt.Z() << " " << endl;
1037 + p = Point<3> (pnt.X(), pnt.Y(), pnt.Z());
1042 @@ -1002,54 +1035,20 @@
1044 gp_Pnt p(ap(0), ap(1), ap(2));
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);
1051 - gp_Pnt x = surface->Value (u,v);
1053 - if (p.SquareDistance(x) <= sqr(PROJECTION_TOLERANCE)) return true;
1057 - surface->D1(u,v,x,du,dv);
1063 - double det, lambda, mu;
1070 - det = Det3 (n.X(), du.X(), dv.X(),
1071 - n.Y(), du.Y(), dv.Y(),
1072 - n.Z(), du.Z(), dv.Z());
1074 - if (det < 1e-15) return false;
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;
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;
1088 - surface->D1(u,v,x,du,dv);
1090 - } while (xold.SquareDistance(x) > sqr(PROJECTION_TOLERANCE) && count < 50);
1092 - // (*testout) << "FastProject count: " << count << endl;
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)
1098 + //cout << "Projection fails" << endl;
1102 - ap = Point<3> (x.X(), x.Y(), x.Z());
1103 + p = proj->Value(p2d);
1105 + ap = Point<3> (p.X(), p.Y(), p.Z());
1109 @@ -1190,16 +1189,16 @@
1113 - char * shapesname[] =
1114 + const char * shapesname[] =
1115 {" ", "CompSolids", "Solids", "Shells",
1117 "Faces", "Wires", "Edges", "Vertices"};
1119 - char * shapename[] =
1120 + const char * shapename[] =
1121 {" ", "CompSolid", "Solid", "Shell",
1122 "Face", "Wire", "Edge", "Vertex"};
1124 - char * orientationstring[] =
1125 + const char * orientationstring[] =
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
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"
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"
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"
1160 #include "STEPControl_Writer.hxx"
1161 #include "StlAPI_Writer.hxx"
1162 #include "STEPControl_StepModelType.hxx"
1163 +#include <NCollection_DataMap.hxx>
1165 +class Handle_ShapeAnalysis_Surface;
1166 +class BRepTopAdaptor_FClass2d;
1171 -#include "../visualization/vispar.hpp"
1172 + //#include "../visualization/vispar.hpp"
1173 // class VisualizationParameters;
1174 // extern VisualizationParameters vispar;
1180 + mutable NCollection_DataMap<int,Handle_ShapeAnalysis_Surface> fprjmap;
1181 + mutable NCollection_DataMap<int,BRepTopAdaptor_FClass2d*> fclsmap;
1193 @@ -204,10 +207,12 @@
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;
1202 + void GetFaceTools(int surfi, Handle(ShapeAnalysis_Surface)& proj,
1203 + BRepTopAdaptor_FClass2d*& cls) const;
1205 OCCSurface GetSurface (int surfi)
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
1212 #include <occgeom.hpp>
1213 #include <meshing.hpp>
1214 #include <GeomLProp_SLProps.hxx>
1215 +#include <GeomAPI_ProjectPointOnSurf.hxx>
1216 +#include <GeomAPI_ProjectPointOnCurve.hxx>
1220 @@ -411,11 +413,16 @@
1224 - void MeshOptimize2dOCCSurfaces :: ProjectPoint (INDEX surfind, Point3d & p) const
1225 + bool MeshOptimize2dOCCSurfaces :: ProjectPoint (INDEX surfind, Point3d & p, PointGeomInfo& gi) const
1228 - geometry.Project (surfind, hp);
1230 + if (gi.trignum > 0)
1231 + ok = geometry.FastProject (surfind, hp, gi.u, gi.v);
1233 + ok = geometry.Project (surfind, hp, gi.u, gi.v);
1238 void MeshOptimize2dOCCSurfaces :: ProjectPoint2 (INDEX surfind, INDEX surfind2,
1239 @@ -506,38 +513,6 @@
1243 - int MeshOptimize2dOCCSurfaces ::
1244 - CalcPointGeomInfo(int surfind, PointGeomInfo& gi, const Point3d& p) const
1246 - Standard_Real u,v;
1248 - gp_Pnt pnt(p.X(), p.Y(), p.Z());
1250 - Handle(Geom_Surface) occface;
1251 - occface = BRep_Tool::Surface(TopoDS::Face(geometry.fmap(surfind)));
1253 - GeomAPI_ProjectPointOnSurf proj(pnt, occface);
1255 - if (proj.NbPoints() < 1)
1257 - cout << "ERROR: OCCSurface :: GetNormalVector: GeomAPI_ProjectPointOnSurf failed!"
1259 - cout << p << endl;
1263 - proj.LowerDistanceParameters (u, v);
1275 OCCRefinementSurfaces :: OCCRefinementSurfaces (const OCCGeometry & ageometry)
1276 : Refinement(), geometry(ageometry)
1278 @@ -627,10 +602,11 @@
1279 if (!geometry.FastProject (surfi, hnewp, u, v))
1281 cout << "Fast projection to surface fails! Using OCC projection" << endl;
1282 - geometry.Project (surfi, hnewp);
1284 + geometry.Project (surfi, hnewp, u, v);
1287 - newgi.trignum = 1;
1288 + newgi.trignum = surfi;
1292 @@ -653,14 +629,17 @@
1293 hnewp = Point<3> (pnt.X(), pnt.Y(), pnt.Z());
1300 void OCCRefinementSurfaces :: ProjectToSurface (Point<3> & p, int surfi)
1303 - geometry.Project (surfi, p);
1307 + geometry.Project (surfi, p, u, v);
1311 void OCCRefinementSurfaces :: ProjectToSurface (Point<3> & p, int surfi, PointGeomInfo & gi)
1313 @@ -668,9 +647,10 @@
1314 if (!geometry.FastProject (surfi, p, gi.u, gi.v))
1316 cout << "Fast projection to surface fails! Using OCC projection" << endl;
1317 - geometry.Project (surfi, p);
1319 + geometry.Project (surfi, p, u, v);
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
1330 MeshOptimize2dOCCSurfaces (const OCCGeometry & ageometry);
1333 - virtual void ProjectPoint (INDEX surfind, Point3d & p) const;
1334 + virtual bool ProjectPoint (INDEX surfind, Point3d & p, PointGeomInfo& gi) const;
1336 virtual void ProjectPoint2 (INDEX surfind, INDEX surfind2, Point3d & p) const;
1340 virtual void GetNormalVector(INDEX surfind, const Point3d & p, PointGeomInfo & gi, Vec3d & n) const;
1343 - virtual int CalcPointGeomInfo(int surfind, PointGeomInfo& gi, const Point3d& p3) const;
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
1357 // #include "SALOME_Log.hxx"
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 @@
1366 -void MeshOptimizeSTLSurface :: ProjectPoint (INDEX surfind, Point3d & p) const
1367 +bool MeshOptimizeSTLSurface :: ProjectPoint (INDEX surfind, Point3d & p, PointGeomInfo& gi) const
1370 - if (!geom.Project (hp))
1371 + if (gi.trignum > 0)
1372 + ((STLGeometry&)geom).SelectChartOfTriangle (gi.trignum);
1373 + if (!(gi.trignum = geom.Project (hp)))
1375 PrintMessage(7,"project failed");
1377 - if (!geom.ProjectOnWholeSurface(hp))
1378 + if (!(gi.trignum = geom.ProjectOnWholeSurface(hp)))
1380 PrintMessage(7, "project on whole surface failed");
1384 // geometry.GetSurface(surfind)->Project (p);
1385 + return gi.trignum > 0;
1388 void MeshOptimizeSTLSurface :: ProjectPoint2 (INDEX surfind, INDEX surfind2, Point3d & p) const
1389 @@ -970,20 +973,6 @@
1393 -int MeshOptimizeSTLSurface :: CalcPointGeomInfo(PointGeomInfo& gi, const Point3d& p3) const
1396 - gi.trignum = geom.Project (hp);
1407 void MeshOptimizeSTLSurface :: GetNormalVector(INDEX surfind, const Point3d & p, Vec3d & n) const
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
1414 virtual void SelectSurfaceOfPoint (const Point3d & p,
1415 const PointGeomInfo & gi);
1417 - virtual void ProjectPoint (INDEX surfind, Point3d & p) const;
1418 + virtual bool ProjectPoint (INDEX surfind, Point3d & p, PointGeomInfo& gi) const;
1420 virtual void ProjectPoint2 (INDEX surfind, INDEX surfind2, Point3d & p) const;
1422 - virtual int CalcPointGeomInfo(PointGeomInfo& gi, const Point3d& p3) const;
1424 virtual void GetNormalVector(INDEX surfind, const Point3d & p, Vec3d & n) const;
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 @@
1432 if (!optstring || strlen(optstring) == 0)
1434 - mparam.optimize2d = "smcm";
1435 + mparam.optimize2d = (char*)"smcm";
1439 @@ -1453,7 +1453,7 @@
1441 mesh -> LoadLocalMeshSize (mparam.meshsizefilename);
1442 mesh -> CalcLocalHFromSurfaceCurvature (stlparam.resthsurfmeshcurvfac);
1443 - mparam.optimize2d = "cmsmSm";
1444 + mparam.optimize2d = (char*)"cmsmSm";
1445 STLSurfaceOptimization (*stlgeometry, *mesh, mparam);
1447 (*statout) << GetTime() << " & ";
1448 @@ -1559,7 +1559,7 @@
1450 if (!optstring || strlen(optstring) == 0)
1452 - mparam.optimize3d = "cmdmstm";
1453 + mparam.optimize3d = (char*)"cmdmstm";
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
1462 +cp ngtcltk/ngnewdelete.* libsrc/interface/
1464 +if test `uname -m` = "x86_64" ; then
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
1481 +if [ ! -d install ] ; then
1487 +if [ ! -d install/include ] ; then
1488 + mkdir install/include
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 \