Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)

geometry/topology3D.hh
Go to the documentation of this file.
00001 /* Topology.
00002  * how to subdivide, now in 3D
00003  */
00004 
00005 #ifndef topology3D_hh
00006 #define topology3D_hh
00007 
00008 #include <memory>
00009 #include "basics/typedefs.hh"
00010 #include "basics/Zm.hh"
00011 #include "connector.hh"
00012 #include "topology.hh"
00013 #include "hexsubdiv.hh"
00014 
00015 namespace concepts {
00016 
00017   // *********************************************************** Tetrahedron **
00018 
00033   class Tetrahedron : public Connector3 {
00034   public:
00051     Tetrahedron(Triangle& tri0, Triangle& tri1, Triangle& tri2, 
00052     Triangle& tri3, Attribute attrib = Attribute());
00053     virtual ~Tetrahedron();
00054 
00067     virtual Tetrahedron* child(uint i, bool mode = 0);
00068     virtual const Tetrahedron* child(uint i) const;
00069 
00070     Edge* edge(uint i) const;
00071     Triangle* face(uint i) const { return i < 4 ? tri_[i] : 0; }
00072     Vertex* vertex(uint i) const;
00073 
00077     int rho(int i) const { return rho_[i]; }
00078 
00083     int tau(int i) const { return tau_[i]; }
00084   protected:
00085     virtual std::ostream& info(std::ostream& os) const;
00086   private:
00090     Tetrahedron* chld_;
00091 
00093     Tetrahedron* lnk_;
00094 
00096     Triangle*    tri_[4];
00097 
00103     Z3               tau_[4];
00104 
00111     Z2               rho_[4];
00112   };
00113 
00114   // ************************************************************ Hexahedron **
00115 
00132   class Hexahedron : public Connector3 {
00133     friend class HexSubdiv8;
00134     friend class HexSubdiv2x; 
00135     friend class HexSubdiv2y;
00136     friend class HexSubdiv2z;
00137     friend class HexSubdiv4x;
00138     friend class HexSubdiv4y;
00139     friend class HexSubdiv4z;
00140  public:
00160     Hexahedron(Quad& quad0, Quad& quad1, Quad& quad2, 
00161          Quad& quad3, Quad& quad4, Quad& quad5, 
00162          const Attribute attrib = Attribute());
00163     virtual ~Hexahedron();
00164 
00176     virtual Hexahedron* child(uint i, bool mode = 0);
00177     virtual const Hexahedron* child(uint i) const;
00178 
00179     Edge* edge(uint i) const;
00180     Quad* face(uint i) const { return i < 6 ? quad_[i] : 0; }
00181     Vertex* vertex(uint i) const;
00182 
00186     Z2 rho(int i) const { return rho_[i]; }
00187 
00191     Z4 tau(int i) const { return tau_[i]; }
00192 
00204     void setStrategy(const HexSubdivision* strategy = 0)
00205       throw(StrategyChange);
00206 
00212     const HexSubdivision* getStrategy() const { return subdivStrategy_; }
00213   protected:
00214     virtual std::ostream& info(std::ostream& os) const;
00215   private:
00219     Hexahedron* chld_;
00220 
00222     Hexahedron* lnk_;
00223 
00225     Quad* quad_[6];
00226 
00235     Z4 tau_[6];
00236 
00245     Z2 rho_[6];
00246 
00248     const HexSubdivision* subdivStrategy_;
00249   };
00250 
00251 } // namespace concepts
00252 
00253 #endif // topology3D_hh

Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)