/usr/share/netgen/libsrc/csg/csgeom.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 | #ifndef FILE_CSGEOM
#define FILE_CSGEOM
/**************************************************************************/
/* File: csgeom.hh */
/* Author: Joachim Schoeberl */
/* Date: 27. Nov. 97 */
/**************************************************************************/
namespace netgen
{
/**
Constructive Solid Geometry
*/
class TriangleApproximation;
class TATriangle;
/**
A top level object is an entity to be meshed.
I can be either a solid, or one surface patch of a solid.
*/
class TopLevelObject
{
Solid * solid;
Surface * surface;
double red, blue, green;
bool visible, transp;
double maxh;
string material;
int layer;
int bc; // for surface patches, only
string bcname;
public:
TopLevelObject (Solid * asolid,
Surface * asurface = NULL);
const Solid * GetSolid() const { return solid; }
Solid * GetSolid() { return solid; }
const Surface * GetSurface () const { return surface; }
Surface * GetSurface () { return surface; }
void GetData (ostream & ost);
void SetData (istream & ist);
void SetMaxH (double amaxh) { maxh = amaxh; }
double GetMaxH () const { return maxh; }
void SetRGB (double ared, double agreen, double ablue)
{
red = ared;
green = agreen;
blue = ablue;
}
double GetRed () const { return red; }
double GetGreen () const { return green; }
double GetBlue () const { return blue; }
void SetTransparent (bool atransp)
{ transp = atransp; }
bool GetTransparent () const { return transp; }
void SetVisible (bool avisible)
{ visible = avisible; }
bool GetVisible () const { return visible; }
const string GetMaterial () const { return material; }
void SetMaterial (const string & mat) { material = mat; }
int GetLayer () const { return layer; }
void SetLayer (int alayer) { layer = alayer; }
void SetBCProp (int abc) { bc = abc; }
int GetBCProp () const { return bc; }
void SetBCName (string abc) { bcname = abc; }
const string GetBCName () const { return bcname; }
};
/**
CSGeometry has the whole geometric information
*/
class CSGeometry : public NetgenGeometry
{
private:
/// all surfaces
SYMBOLTABLE<Surface*> surfaces;
public:
/// primitive of surface
Array<const Primitive*> surf2prim;
private:
Array<Surface*> delete_them;
/// all named solids
SYMBOLTABLE<Solid*> solids;
/// all 2d splinecurves
SYMBOLTABLE< SplineGeometry<2>* > splinecurves2d;
/// all 3d splinecurves
SYMBOLTABLE< SplineGeometry<3>* > splinecurves3d;
/// all top level objects: solids and surfaces
Array<TopLevelObject*> toplevelobjects;
/// additional points specified by user
Array<Point<3> > userpoints;
Array<double> userpoints_ref_factor;
mutable Array<Point<3> > identpoints;
/// triangular approximation of top level objects
Array<TriangleApproximation*> triapprox;
/// increment, if geometry is changed
static int changeval;
/// bounding box of geometry
Box<3> boundingbox;
/// bounding box, if not set by input file
static Box<3> default_boundingbox;
/// identic surfaces are stored by pair of indizes, val = inverse
INDEX_2_HASHTABLE<int> identicsurfaces;
Array<int> isidenticto;
/// identification of boundaries (periodic, thin domains, ...)
double ideps;
/// filename of inputfile
string filename;
public:
CSGeometry ();
CSGeometry (const string & afilename);
virtual ~CSGeometry ();
void Clean ();
void Save (ostream & ost);
void Load (istream & ist);
void SaveSurfaces (ostream & out);
void LoadSurfaces (istream & in);
int GetChangeVal() { return changeval; }
void Change() { changeval++; }
void AddSurface (Surface * surf);
void AddSurface (char * name, Surface * surf);
void AddSurfaces (Primitive * prim);
int GetNSurf () const { return surfaces.Size(); }
const Surface * GetSurface (const char * name) const;
const Surface * GetSurface (int i) const
{ return surfaces[i]; }
void SetSolid (const char * name, Solid * sol);
const Solid * GetSolid (const char * name) const;
const Solid * GetSolid (const string & name) const;
int GetNSolids () const { return solids.Size(); }
const Solid * GetSolid (int i) const { return solids[i]; }
const SYMBOLTABLE<Solid*> & GetSolids () const { return solids; }
void SetSplineCurve (const char * name, SplineGeometry<2> * spl);
void SetSplineCurve (const char * name, SplineGeometry<3> * spl);
const SplineGeometry<2> * GetSplineCurve2d (const string & name) const;
const SplineGeometry<3> * GetSplineCurve3d (const string & name) const;
void SetFlags (const char * solidname, const Flags & flags);
int GetNTopLevelObjects () const
{ return toplevelobjects.Size(); }
int SetTopLevelObject (Solid * sol, Surface * surf = NULL);
void GetTopLevelObject (int nr, Solid *& sol, Surface *& surf)
{
sol = toplevelobjects[nr]->GetSolid();
surf = toplevelobjects[nr]->GetSurface();
}
void GetTopLevelObject (int nr, const Solid *& sol, const Surface *& surf) const
{
sol = toplevelobjects[nr]->GetSolid();
surf = toplevelobjects[nr]->GetSurface();
}
TopLevelObject * GetTopLevelObject (const Solid * sol, const Surface * surf = NULL);
TopLevelObject * GetTopLevelObject (int nr)
{ return toplevelobjects[nr]; }
const TopLevelObject * GetTopLevelObject (int nr) const
{ return toplevelobjects[nr]; }
void RemoveTopLevelObject (Solid * sol, Surface * surf = NULL);
void AddUserPoint (const Point<3> & p, double ref_factor = 0)
{ userpoints.Append (p); userpoints_ref_factor.Append (ref_factor); }
int GetNUserPoints () const
{ return userpoints.Size(); }
const Point<3> & GetUserPoint (int nr) const
{ return userpoints[nr]; }
double GetUserPointRefFactor (int nr) const
{ return userpoints_ref_factor[nr]; }
void AddIdentPoint (const Point<3> & p) const
{ identpoints.Append(p);}
int GetNIdentPoints (void) const
{ return identpoints.Size();}
const Point<3> & GetIdentPoint(int nr) const
{ return identpoints[nr]; }
void DeleteIdentPoints(void) const
{ identpoints.DeleteAll();}
// quick implementations:
Array<SingularFace*> singfaces;
Array<SingularEdge*> singedges;
Array<SingularPoint*> singpoints;
Array<Identification*> identifications;
int GetNIdentifications (void) const { return identifications.Size(); }
void AddIdentification (Identification * ident);
///
void CalcTriangleApproximation(const Box<3> & boundingbox,
double detail, double facets);
///
void FindIdenticSurfaces (double eps);
///
void GetSurfaceIndices (const Solid * sol,
const BoxSphere<3> & box,
Array<int> & locsurf) const;
///
void GetIndependentSurfaceIndices (const Solid * sol,
const BoxSphere<3> & box,
Array<int> & locsurf) const;
///
void GetIndependentSurfaceIndices (const Solid * sol,
const Point<3> & p, Vec<3> & v,
Array<int> & locsurf) const;
///
void GetIndependentSurfaceIndices (Array<int> & locsurf) const;
///
int GetSurfaceClassRepresentant (int si) const
{ return isidenticto[si]; }
///
const TriangleApproximation * GetTriApprox (int msnr)
{
if (msnr < triapprox.Size())
return triapprox[msnr];
return 0;
}
void IterateAllSolids (SolidIterator & it, bool only_once = false);
void RefineTriangleApprox (Solid * locsol,
int surfind,
const BoxSphere<3> & box,
double detail,
const TATriangle & tria,
TriangleApproximation & tams,
IndexSet & iset,
int level);
const Box<3> & BoundingBox () const { return boundingbox; }
void SetBoundingBox (const Box<3> & abox)
{
boundingbox = abox;
}
static void SetDefaultBoundingBox (const Box<3> & abox)
{
default_boundingbox = abox;
}
double MaxSize () const;
void SetIdEps(double eps){ideps = eps;}
double GetIdEps(void) const {return ideps;}
class BCModification {
public:
int si;
int tlonr;
int bcnr;
string * bcname;
};
Array<BCModification> bcmodifications;
virtual int GenerateMesh (Mesh*& mesh,
int perfstepsstart, int perfstepsend, char* optstring);
virtual const Refinement & GetRefinement () const;
};
}
#endif
|