00001 #ifndef OPENTISSUE_DYNAMICS_EDM_EDM_TYPES_H 00002 #define OPENTISSUE_DYNAMICS_EDM_EDM_TYPES_H 00003 // 00004 // OpenTissue Template Library 00005 // - A generic toolbox for physics-based modeling and simulation. 00006 // Copyright (C) 2008 Department of Computer Science, University of Copenhagen. 00007 // 00008 // OTTL is licensed under zlib: http://opensource.org/licenses/zlib-license.php 00009 // 00010 #include <OpenTissue/configuration.h> 00011 00012 #include <OpenTissue/core/math/math_basic_types.h> 00013 #include <OpenTissue/dynamics/edm/edm_force.h> 00014 #include <OpenTissue/dynamics/edm/edm_object.h> 00015 #include <OpenTissue/dynamics/edm/edm_system.h> 00016 #include <OpenTissue/dynamics/edm/edm_model.h> 00017 00018 #include <OpenTissue/utility/utility_empty_traits.h> 00019 00020 namespace OpenTissue 00021 { 00022 00023 namespace edm 00024 { 00025 00030 template < 00031 typename math_types_ 00032 , typename model_traits_ = OpenTissue::utility::EmptyTraits 00033 , typename object_traits_ = OpenTissue::utility::EmptyTraits 00034 > 00035 class Types 00036 { 00037 public: 00038 00039 typedef math_types_ math_types; 00040 typedef typename math_types::value_traits value_traits; 00041 typedef typename math_types::real_type real_type; 00042 typedef typename math_types::vector3_type vector3_type; 00043 typedef model_traits_ model_traits; 00044 typedef object_traits_ object_traits; 00045 00046 struct tensor1_type 00047 { 00048 tensor1_type(){t0[0]=value_traits::zero();} 00049 real_type t0[1]; 00050 }; 00051 00052 struct tensor2_type 00053 { 00054 tensor2_type(){t0[0]=t0[1]=t1[0]=t1[1]=value_traits::zero();} 00055 real_type t0[2]; 00056 real_type t1[2]; 00057 }; 00058 00059 struct tensor3_type 00060 { 00061 tensor3_type(){t0[0]=t0[1]=t0[2]=t1[0]=t1[1]=t1[2]=t2[0]=t2[1]=t2[2]=value_traits::zero();} 00062 real_type t0[3]; 00063 real_type t1[3]; 00064 real_type t2[3]; 00065 }; 00066 00067 struct texUV 00068 { 00069 real_type u,v; 00070 }; 00071 00072 00076 struct Particle 00077 { 00078 Particle() 00079 : m(value_traits::one()) 00080 , g(value_traits::zero()) 00081 , f(false) 00082 {} 00083 virtual ~Particle() {} 00084 00085 vector3_type r; 00086 vector3_type o; 00087 vector3_type F; 00088 vector3_type E; 00089 vector3_type n; 00090 vector3_type v; 00091 texUV t; 00092 real_type m; 00093 real_type g; 00094 bool f; 00095 }; 00096 00100 typedef enum {EDM_Surface, EDM_Solid} model_id_type; 00101 00102 typedef Force<Types> force_type; 00103 typedef Object<Types> object_type; 00104 typedef System<Types> system_type; 00105 typedef Model<Types> model_type; 00106 00107 }; 00108 00109 } // namespace edm 00110 00111 } // namespace OpenTissue 00112 00113 00114 // OPENTISSUE_DYNAMICS_EDM_EDM_TYPES_H 00115 #endif