Geom Software - C++ Programming and Geometry Libraries
Fade3D Documentation pages v0.99
/home/geom/repo/dev/geomDev/dt3/dt3Library/Tet3.h
1 // Copyright (C) Geom Software e.U, Bernhard Kornberger, Graz/Austria
2 //
3 // This file is part of the Fade3D library. The student license is free
4 // of charge and covers personal non-commercial research. Licensees
5 // holding a commercial license may use this file in accordance with
6 // the Commercial License Agreement.
7 //
8 // This software is provided AS IS with NO WARRANTY OF ANY KIND,
9 // INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
10 // FOR A PARTICULAR PURPOSE.
11 //
12 // Please contact the author if any conditions of this licensing are
13 // not clear to you.
14 //
15 // Author: Bernhard Kornberger, bkorn (at) geom.at
16 // https://www.geom.at
17 
18 
19 #pragma once
20 #include <stdlib.h>
21 #include <stdio.h>
22 #include <string.h>
23 #include "Ball3.h"
24 #include "Point3.h"
25 #include "Edge3.h"
26 #include "Facet3.h"
27 #include "definitions.h"
28 #include "textTools.h"
29 
30 namespace FADE3D {
31 
46 class CLASS_DECLSPEC Tet3
47 {
48 public:
49  Tet3();
50  ~Tet3();
51 
52  // GET
59  Point3 getCircumcenter();
65  void getCorners(Point3*& p0,Point3*& p1,Point3*& p2,Point3*& p3) const;
71  Point3* getCorner(const int ith) const;
77  bool hasVertex(const Point3* p) const;
78 
85  bool hasVertex(const Point3& p) const;
91  int getIntraTetIndex(const Point3* p) const;
99  int getIntraTetIndex(const Tet3* pNeigTet) const;
106  Tet3* getOppTet(const int ith) const;
113  Tet3* getOppTet(const Point3* pOppVtx) const;
119  Point3* getOppVtxInOppTet(const int ith,bool bNullAllowed) const;
120 
133  static std::pair<int,int> getEdgeIndices(int opp3,int opp2);
134  // The slower version, which is only called from registerTets
136  int getIntraTetIndexInOppTetForReg(const Tet3* c,int opp3) const;
137  // The efficient version which assumes an intact Tet
139  int getIntraTetIndexInOppTet(int ownIndex) const;
141  void getFacetIndices(int opp3,int& iciA,int& iciB,int& iciC) const;
143  static bool haveCommonFacet(Tet3* pC0,int opp0ICI,Tet3* pC1,int opp1ICI);
151  Edge3 getEdge(const int opp3,const int opp2);
157  Facet3 getFacet(const int opp3);
158 
159  // SET
161  void setOppTet(const int ith, Tet3* pC);
163  void setProperties(Point3* pI,Point3* pJ,Point3* pK,Point3* pL);
165  void setCorner(const int ith,Point3* pp);
167  void setCustomIndex(int customIndex);
169  int getCustomIndex();
170 
171 
172  // DEBUG
174  int debug_getTetIndex() const;
175  CLASS_DECLSPEC
176  friend std::ostream& operator<<(std::ostream &stream, const Tet3& pC);
178  int debug_getOppTetIndex(const int ith) const;
180  bool hasBeenVisited;
182  int label;
184  static int runningLabel;
185 private:
186  Tet3(const Tet3 &c);
187  Point3* aVertexPointer[4];
188  Tet3* aOppTets[4];
190  int customIndex;
191 };
192 
193 
194 
195 
196 
197 } // NAMESPACE FADE3D
198 
199 
200 
201 
202 
203 
204 
Definition: Ball3.h:16
Vertex.
Definition: Point3.h:32
Tetrahedron.
Definition: Tet3.h:46
Side of a tetrahedron.
Definition: Facet3.h:34
Edge of a tetrahedron.
Definition: Edge3.h:43