This file is indexed.

/usr/share/netgen/libsrc/occ/occgeom.hpp is in netgen-headers 4.9.13.dfsg-8build2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
#ifndef FILE_OCCGEOM
#define FILE_OCCGEOM

/* *************************************************************************/
/* File:   occgeom.hpp                                                     */
/* Author: Robert Gaisbauer                                                */
/* Date:   26. May  03                                                     */
/* *************************************************************************/

#ifdef OCCGEOMETRY

#include <meshing.hpp>

#include "BRep_Tool.hxx"
#include "Geom_Curve.hxx"
#include "Geom2d_Curve.hxx"
#include "Geom_Surface.hxx"
#include "GeomAPI_ProjectPointOnSurf.hxx"
#include "GeomAPI_ProjectPointOnCurve.hxx"
#include "BRepTools.hxx"
#include "TopExp.hxx"
#include "BRepBuilderAPI_MakeVertex.hxx"
#include "BRepBuilderAPI_MakeShell.hxx"
#include "BRepBuilderAPI_MakeSolid.hxx"
#include "BRepOffsetAPI_Sewing.hxx"
#include "BRepLProp_SLProps.hxx"
#include "BRepAdaptor_Surface.hxx"
#include "Poly_Triangulation.hxx"
#include "Poly_Array1OfTriangle.hxx"
#include "TColgp_Array1OfPnt2d.hxx"
#include "Poly_Triangle.hxx"
#include "GProp_GProps.hxx"
#include "BRepGProp.hxx"
#include "Geom_Surface.hxx"
#include "TopExp.hxx"
#include "gp_Pnt.hxx"
#include "TopoDS.hxx"
#include "TopoDS_Solid.hxx"
#include "TopExp_Explorer.hxx"
#include "TopTools_ListIteratorOfListOfShape.hxx"
#include "BRep_Tool.hxx"
#include "Geom_Curve.hxx"
#include "Geom2d_Curve.hxx"
#include "Geom_Surface.hxx"
#include "GeomAPI_ProjectPointOnSurf.hxx"
#include "GeomAPI_ProjectPointOnCurve.hxx"
#include "TopoDS_Wire.hxx"
#include "BRepTools_WireExplorer.hxx"
#include "BRepTools.hxx"
#include "TopTools_IndexedMapOfShape.hxx"
#include "TopExp.hxx"
#include "BRepBuilderAPI_MakeVertex.hxx"
#include "BRepBuilderAPI_MakeShell.hxx"
#include "BRepBuilderAPI_MakeSolid.hxx"
#include "BRepOffsetAPI_Sewing.hxx"
#include "BRepLProp_CLProps.hxx"
#include "BRepLProp_SLProps.hxx"
#include "BRepAdaptor_Surface.hxx"
#include "BRepAdaptor_Curve.hxx"
#include "Poly_Triangulation.hxx"
#include "Poly_Array1OfTriangle.hxx"
#include "TColgp_Array1OfPnt2d.hxx"
#include "Poly_Triangle.hxx"
#include "GProp_GProps.hxx"
#include "BRepGProp.hxx"
#include "TopoDS_Shape.hxx"
#include "TopoDS_Face.hxx"
#include "IGESToBRep_Reader.hxx"
#include "Interface_Static.hxx"
#include "GeomAPI_ExtremaCurveCurve.hxx"
#include "Standard_ErrorHandler.hxx"
#include "Standard_Failure.hxx"
#include "ShapeUpgrade_ShellSewing.hxx"
#include "ShapeFix_Shape.hxx"
#include "ShapeFix_Wireframe.hxx"
#include "BRepMesh.hxx"
#include "BRepMesh_IncrementalMesh.hxx"
#include "BRepBndLib.hxx"
#include "Bnd_Box.hxx"
#include "ShapeAnalysis.hxx"
#include "ShapeBuild_ReShape.hxx"


// Philippose - 29/01/2009
// OpenCascade XDE Support
// Include support for OpenCascade XDE Features
#include "TDocStd_Document.hxx"
#include "Quantity_Color.hxx"
#include "XCAFApp_Application.hxx"
#include "XCAFDoc_ShapeTool.hxx"
#include "XCAFDoc_Color.hxx"
#include "XCAFDoc_ColorTool.hxx"
#include "XCAFDoc_ColorType.hxx"
#include "XCAFDoc_LayerTool.hxx"
#include "XCAFDoc_DimTolTool.hxx"
#include "XCAFDoc_MaterialTool.hxx"
#include "XCAFDoc_DocumentTool.hxx"
#include "TDF_Label.hxx"
#include "TDF_LabelSequence.hxx"
#include "STEPCAFControl_Reader.hxx"
#include "STEPCAFControl_Writer.hxx"
#include "IGESCAFControl_Reader.hxx"
#include "IGESCAFControl_Writer.hxx"

#include "IGESControl_Reader.hxx"
#include "STEPControl_Reader.hxx"
#include "IGESControl_Writer.hxx"
#include "STEPControl_Writer.hxx"

#include "StlAPI_Writer.hxx"
#include "STEPControl_StepModelType.hxx"

namespace netgen
{
#include "occmeshsurf.hpp"

#define PROJECTION_TOLERANCE 1e-10

#define ENTITYISVISIBLE 1
#define ENTITYISHIGHLIGHTED 2
#define ENTITYISDRAWABLE 4

#define OCCGEOMETRYVISUALIZATIONNOCHANGE   0
#define OCCGEOMETRYVISUALIZATIONFULLCHANGE 1  // Compute transformation matrices and redraw
#define OCCGEOMETRYVISUALIZATIONHALFCHANGE 2  // Redraw



   class EntityVisualizationCode
   {
      int code;

   public:

      EntityVisualizationCode()
      {  code = ENTITYISVISIBLE + !ENTITYISHIGHLIGHTED + ENTITYISDRAWABLE;}

      int IsVisible ()
      {  return code & ENTITYISVISIBLE;}

      int IsHighlighted ()
      {  return code & ENTITYISHIGHLIGHTED;}

      int IsDrawable ()
      {  return code & ENTITYISDRAWABLE;}

      void Show ()
      {  code |= ENTITYISVISIBLE;}

      void Hide ()
      {  code &= ~ENTITYISVISIBLE;}

      void Highlight ()
      {  code |= ENTITYISHIGHLIGHTED;}

      void Lowlight ()
      {  code &= ~ENTITYISHIGHLIGHTED;}

      void SetDrawable ()
      {  code |= ENTITYISDRAWABLE;}

      void SetNotDrawable ()
      {  code &= ~ENTITYISDRAWABLE;}
   };



   class Line
   {
   public:
      Point<3> p0, p1;

      double Dist (Line l);

      double Length ();
   };



   inline double Det3 (double a00, double a01, double a02,
      double a10, double a11, double a12,
      double a20, double a21, double a22)
   {
      return a00*a11*a22 + a01*a12*a20 + a10*a21*a02 - a20*a11*a02 - a10*a01*a22 - a21*a12*a00;
   }




   class OCCGeometry : public NetgenGeometry
   {
      Point<3> center;

   public:
      TopoDS_Shape shape;
      TopTools_IndexedMapOfShape fmap, emap, vmap, somap, shmap, wmap;
      Array<bool> fsingular, esingular, vsingular;
      Box<3> boundingbox;

      // Philippose - 29/01/2009
      // OpenCascade XDE Support
      // XCAF Handle to make the face colours available to the rest of
      // the system
      Handle_XCAFDoc_ColorTool face_colours;

      int changed;
      Array<int> facemeshstatus;

      // Philippose - 15/01/2009
      // Maximum mesh size for a given face
      // (Used to explicitly define mesh size limits on individual faces)
      Array<double> face_maxh;
      
      // Philippose - 14/01/2010
      // Boolean array to detect whether a face has been explicitly modified 
      // by the user or not
      Array<bool> face_maxh_modified;

      // Philippose - 15/01/2009
      // Indicates which faces have been selected by the user in geometry mode
      // (Currently handles only selection of one face at a time, but an array would
      //  help to extend this to multiple faces)
      Array<bool> face_sel_status;

      Array<EntityVisualizationCode> fvispar, evispar, vvispar;

      double tolerance;
      bool fixsmalledges;
      bool fixspotstripfaces;
      bool sewfaces;
      bool makesolids;
      bool splitpartitions;

      OCCGeometry()
      {
         somap.Clear();
         shmap.Clear();
         fmap.Clear();
         wmap.Clear();
         emap.Clear();
         vmap.Clear();
      }

      void BuildFMap();

      Box<3> GetBoundingBox()
      {  return boundingbox;}

      int NrSolids()
      {  return somap.Extent();}

      // Philippose - 17/01/2009
      // Total number of faces in the geometry
      int NrFaces()
      {  return fmap.Extent();}

      void SetCenter()
      {  center = boundingbox.Center();}

      Point<3> Center()
      {  return center;}

      void Project (int surfi, Point<3> & p) const;
      bool FastProject (int surfi, Point<3> & ap, double& u, double& v) const;

      OCCSurface GetSurface (int surfi)
      {
         cout << "OCCGeometry::GetSurface using PLANESPACE" << endl;
         return OCCSurface (TopoDS::Face(fmap(surfi)), PLANESPACE);
      }

      void CalcBoundingBox ();
      void BuildVisualizationMesh (double deflection);

      void RecursiveTopologyTree (const TopoDS_Shape & sh,
         stringstream & str,
         TopAbs_ShapeEnum l,
         bool free,
         const char * lname);

      void GetTopologyTree (stringstream & str);

      void PrintNrShapes ();

      void CheckIrregularEntities (stringstream & str);

      void SewFaces();

      void MakeSolid();

      void HealGeometry();

      // Philippose - 15/01/2009
      // Sets the maximum mesh size for a given face
      // (Note: Local mesh size limited by the global max mesh size)
      void SetFaceMaxH(int facenr, double faceh)
      {
         if((facenr> 0) && (facenr <= fmap.Extent()))
         {
            face_maxh[facenr-1] = min(mparam.maxh,faceh);
            
            // Philippose - 14/01/2010
            // If the face maxh is greater than or equal to the 
            // current global maximum, then identify the face as 
            // not explicitly controlled by the user any more
            if(faceh >= mparam.maxh)
            {
               face_maxh_modified[facenr-1] = 0;
            }
            else
            {
               face_maxh_modified[facenr-1] = 1;
            }
         }
      }

      // Philippose - 15/01/2009
      // Returns the local mesh size of a given face
      double GetFaceMaxH(int facenr)
      {
         if((facenr> 0) && (facenr <= fmap.Extent()))
         {
            return face_maxh[facenr-1];
         }
         else
         {
            return 0.0;
         }
      }
      
      // Philippose - 14/01/2010
      // Returns the flag whether the given face 
      // has a mesh size controlled by the user or not
      bool GetFaceMaxhModified(int facenr)
      {
         return face_maxh_modified[facenr-1];
      }
      
      // Philippose - 17/01/2009
      // Returns the index of the currently selected face
      int SelectedFace()
      {
         int i;

         for(i = 1; i <= fmap.Extent(); i++)
         {
            if(face_sel_status[i-1])
            {
               return i;
            }
         }

         return 0;
      }

      // Philippose - 17/01/2009
      // Sets the currently selected face
      void SetSelectedFace(int facenr)
      {
         face_sel_status = 0;

         if((facenr >= 1) && (facenr <= fmap.Extent()))
         {
            face_sel_status[facenr-1] = 1;
         }
      }

      void LowLightAll()
      {
         for (int i = 1; i <= fmap.Extent(); i++)
            fvispar[i-1].Lowlight();
         for (int i = 1; i <= emap.Extent(); i++)
            evispar[i-1].Lowlight();
         for (int i = 1; i <= vmap.Extent(); i++)
            vvispar[i-1].Lowlight();
      }

      void GetUnmeshedFaceInfo (stringstream & str);
      void GetNotDrawableFaces (stringstream & str);
      bool ErrorInSurfaceMeshing ();

      void WriteOCC_STL(char * filename);

      virtual int GenerateMesh (Mesh*& mesh,
         int perfstepsstart, int perfstepsend, char* optstring);

      virtual const Refinement & GetRefinement () const;
   };



   class OCCParameters
   {
   public:

      /// Factor for meshing close edges 
      double resthcloseedgefac;


      /// Enable / Disable detection of close edges
      int resthcloseedgeenable;



      /*!
         Default Constructor for the OpenCascade
         Mesh generation parameter set
      */
      OCCParameters();


      /*!
         Dump all the OpenCascade specific meshing parameters 
         to console
      */
      void Print (ostream & ost) const;
   };
   

   void PrintContents (OCCGeometry * geom);

   OCCGeometry * LoadOCC_IGES (const char * filename);
   OCCGeometry * LoadOCC_STEP (const char * filename);
   OCCGeometry * LoadOCC_BREP (const char * filename);

   extern OCCParameters occparam;


   // Philippose - 31.09.2009
   // External access to the mesh generation functions within the OCC
   // subsystem (Not sure if this is the best way to implement this....!!)
   extern int OCCGenerateMesh (OCCGeometry & occgeometry, Mesh*& mesh,
	                            int perfstepsstart, int perfstepsend, 
                               char* optstring);

   extern void OCCSetLocalMeshSize(OCCGeometry & geom, Mesh & mesh);

   extern void OCCMeshSurface (OCCGeometry & geom, Mesh & mesh, int perfstepsend);

   extern void OCCFindEdges (OCCGeometry & geom, Mesh & mesh);
}

#endif

#endif