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

graphics/spaceTraits.hh
Go to the documentation of this file.
00001 /* Traits for different spaces
00002  */
00003 
00004 #ifndef spaceTraits_hh
00005 #define spaceTraits_hh
00006 
00007 #include "basics/typedefs.hh"
00008 
00009 namespace hp2D {
00010   class Space;
00011 }
00012 
00013 namespace hp3D {
00014   class Space;
00015 }
00016 
00017 namespace linearFEM {
00018   class Linear2d;
00019   class Linear3d;
00020 }
00021 
00022 namespace vectorial {
00023   template<typename F>
00024   class Space;
00025 }
00026 
00027 namespace graphics {
00028 
00029   // ********************************************************** Space traits **
00030 
00048   template<typename space>
00049   struct spaceTraits {};
00050 
00052   template<>
00053   struct spaceTraits<hp2D::Space> {
00054     static inline uint dim() { return 2; }
00055     static inline bool positionConnection() { return false; }
00056     static inline bool boundaryElements() { return false; }
00057   };
00058 
00060   template<>
00061   struct spaceTraits<hp3D::Space> {
00062     static inline uint dim() { return 3; }
00063     static inline bool positionConnection() { return false; }
00064     static inline bool boundaryElements() { return false; }
00065   };
00066 
00068   template<>
00069   struct spaceTraits<linearFEM::Linear2d> {
00070     static inline uint dim() { return 2; }
00071     static inline bool positionConnection() { return false; }
00072     static inline bool boundaryElements() { return false; }
00073   };
00074 
00076   template<>
00077   struct spaceTraits<linearFEM::Linear3d> {
00078     static inline uint dim() { return 3; }
00079     static inline bool positionConnection() { return false; }
00080     static inline bool boundaryElements() { return false; }
00081   };
00082 
00084   template<>
00085   struct spaceTraits<vectorial::Space<concepts::Real> > {
00086     static inline uint dim() { return dim_; }
00087     static inline bool positionConnection() { return posCon_; }
00088     static inline bool boundaryElements() { return bem_; }
00089     static uint dim_;
00090     static bool posCon_;
00091     static bool bem_;
00092     static inline void setDim(uint dim) { dim_ = dim; }
00093     static inline void setposCon(bool posCon) { posCon_ = posCon; }
00094     static inline void setBEM(bool bem) { bem_ = bem; }
00095   };
00096 
00097 } // namespace graphics
00098 
00099 #endif // spaceTraits_hh

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