1 #ifndef GeoPolyhedron_h 2 #define GeoPolyhedron_h 155 #include "GeoModelKernel/GeoDefinitions.h" 158 #ifndef DEFAULT_NUMBER_OF_STEPS 159 #define DEFAULT_NUMBER_OF_STEPS 24 165 friend std::ostream & operator<< (std::ostream &,
const GeoFacet & facet);
175 GeoFacet (
int v1 = 0,
int f1 = 0,
int v2 = 0,
int f2 = 0,
176 int v3 = 0,
int f3 = 0,
int v4 = 0,
int f4 = 0)
191 friend std::ostream & operator<< (std::ostream &,
const GeoPolyhedron & ph);
194 static int s_fNumberOfRotationSteps;
197 int m_nvert, m_nface;
198 GeoTrf::Vector3D *m_pV;
202 void AllocateMemory (
int Nvert,
int Nface);
205 int FindNeighbour (
int iFace,
int iNode,
int iOrder)
const;
208 GeoTrf::Vector3D FindNodeNormal (
int iFace,
int iNode)
const;
214 void RotateEdge (
int k1,
int k2,
double r1,
double r2,
215 int v1,
int v2,
int vEdge,
216 bool ifWholeCircle,
int ns,
int &kface);
219 void SetSideFacets (
int ii[4],
int vv[4],
220 int *kk,
double *r,
double dphi,
int ns,
int &kface);
223 void RotateAroundZ (
int nstep,
double phi,
double dphi,
225 const double *z,
double *r,
int nodeVis,
int edgeVis);
228 void SetReferences ();
231 void InvertFacets ();
235 GeoPolyhedron (
int Nvert = 0,
int Nface = 0):m_nvert (Nvert), m_nface (Nface),
236 m_pV (Nvert ?
new GeoTrf::Vector3D[Nvert + 1] : 0),
237 m_pF (Nface ?
new GeoFacet[Nface + 1] : 0)
255 int GetNoVertices ()
const 261 int GetNoFacets ()
const 267 GeoPolyhedron & Transform (
const GeoTrf::RotationMatrix3D & rot,
268 const GeoTrf::Vector3D & trans);
271 bool GetNextVertexIndex (
int &index,
int &edgeFlag)
const;
274 GeoTrf::Vector3D GetVertex (
int index)
const;
277 bool GetNextVertex (GeoTrf::Vector3D & vertex,
int &edgeFlag)
const;
280 bool GetNextVertex (GeoTrf::Vector3D & vertex,
int &edgeFlag,
281 GeoTrf::Vector3D & normal)
const;
284 bool GetNextEdgeIndeces (
int &i1,
int &i2,
int &edgeFlag,
285 int &iface1,
int &iface2)
const;
288 bool GetNextEdgeIndeces (
int &i1,
int &i2,
int &edgeFlag)
const;
291 bool GetNextEdge (GeoTrf::Vector3D & p1, GeoTrf::Vector3D & p2,
int &edgeFlag)
const;
294 bool GetNextEdge (GeoTrf::Vector3D & p1, GeoTrf::Vector3D & p2,
int &edgeFlag,
295 int &iface1,
int &iface2)
const;
298 void GetFacet (
int iFace,
int &n,
int *iNodes,
299 int *edgeFlags = 0,
int *iFaces = 0)
const;
302 void GetFacet (
int iFace,
int &n, GeoTrf::Vector3D * nodes,
303 int *edgeFlags = 0, GeoTrf::Vector3D * normals = 0)
const;
306 bool GetNextFacet (
int &n, GeoTrf::Vector3D * nodes,
307 int *edgeFlags = 0, GeoTrf::Vector3D * normals = 0)
const;
310 GeoTrf::Vector3D GetNormal (
int iFace)
const;
313 GeoTrf::Vector3D GetUnitNormal (
int iFace)
const;
316 bool GetNextNormal (GeoTrf::Vector3D & normal)
const;
319 bool GetNextUnitNormal (GeoTrf::Vector3D & normal)
const;
327 double GetSurfaceArea ()
const;
330 double GetVolume ()
const;
333 static int GetNumberOfRotationSteps ()
335 return s_fNumberOfRotationSteps;
339 static void SetNumberOfRotationSteps (
int n);
342 static void ResetNumberOfRotationSteps ()
344 s_fNumberOfRotationSteps = DEFAULT_NUMBER_OF_STEPS;
355 double Dy1,
double Dy2,
double Dz);
359 return GeoPolyhedron::operator = (from);
370 return GeoPolyhedron::operator = (from);
381 return GeoPolyhedron::operator = (from);
390 double Dx1,
double Dx2,
double Alp1,
391 double Dy2,
double Dx3,
double Dx4,
double Alp2);
395 return GeoPolyhedron::operator = (from);
403 double Alpha,
double Theta,
double Phi);
407 return GeoPolyhedron::operator = (from);
415 double Rmn2,
double Rmx2,
double Dz,
416 double Phi1,
double Dphi);
420 return GeoPolyhedron::operator = (from);
428 double Rmn2,
double Rmx2,
double Dz);
432 return GeoPolyhedron::operator = (from);
440 double Phi1,
double Dphi);
444 return GeoPolyhedron::operator = (from);
455 return GeoPolyhedron::operator = (from);
463 const double *z,
const double *rmin,
const double *rmax);
467 return GeoPolyhedron::operator = (from);
475 const double *z,
const double *rmin,
const double *rmax);
479 return GeoPolyhedron::operator = (from);
487 double phi,
double dphi,
double the,
double dthe);
491 return GeoPolyhedron::operator = (from);
499 double phi,
double dphi);
503 return GeoPolyhedron::operator = (from);
Base class for GeoModel Facets Two implementations exist: