00001 #ifndef OPENTISSUE_DYNAMICS_PSYS_PSYS_H 00002 #define OPENTISSUE_DYNAMICS_PSYS_PSYS_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/geometry/geometry_aabb.h> 00013 #include <OpenTissue/core/geometry/geometry_sphere.h> 00014 #include <OpenTissue/core/geometry/geometry_plane.h> 00015 #include <OpenTissue/core/containers/grid/grid.h> 00016 #include <OpenTissue/core/containers/mesh/mesh.h> 00017 #include <OpenTissue/collision/sdf/sdf.h> 00018 #include <OpenTissue/collision/aabb_tree/aabb_tree.h> 00019 00020 #include <OpenTissue/dynamics/psys/psys_particle.h> 00021 #include <OpenTissue/dynamics/psys/psys_system.h> 00022 #include <OpenTissue/dynamics/psys/psys_constraint.h> 00023 #include <OpenTissue/dynamics/psys/psys_contact_point.h> 00024 #include <OpenTissue/dynamics/psys/psys_force.h> 00025 #include <OpenTissue/dynamics/psys/psys_geometry_holder.h> 00026 #include <OpenTissue/dynamics/psys/psys_connector_facade.h> 00027 #include <OpenTissue/dynamics/psys/util/psys_direct_mesh_coupling.h> 00028 #include <OpenTissue/dynamics/psys/forces/psys_gravity.h> 00029 #include <OpenTissue/dynamics/psys/forces/psys_viscosity.h> 00030 #include <OpenTissue/dynamics/psys/forces/psys_grid_force_field.h> 00031 #include <OpenTissue/dynamics/psys/forces/psys_spring.h> 00032 #include <OpenTissue/dynamics/psys/forces/psys_pressure_softbody.h> 00033 #include <OpenTissue/dynamics/psys/forces/util/psys_compute_random_force_field.h> 00034 #include <OpenTissue/dynamics/psys/forces/util/psys_compute_perlin_noise_force_field.h> 00035 #include <OpenTissue/dynamics/psys/constraints/psys_pin.h> 00036 #include <OpenTissue/dynamics/psys/constraints/psys_stick.h> 00037 #include <OpenTissue/dynamics/psys/constraints/psys_box.h> 00038 #include <OpenTissue/dynamics/psys/integrators/psys_verlet_integrator.h> 00039 #include <OpenTissue/dynamics/psys/integrators/psys_euler_integrator.h> 00040 #include <OpenTissue/dynamics/psys/mass_spring_system/psys_mass_spring_system.h> 00041 #include <OpenTissue/dynamics/psys/mass_spring_system/psys_surface_mesh.h> 00042 #include <OpenTissue/dynamics/psys/mass_spring_system/psys_cloth.h> 00043 #include <OpenTissue/dynamics/psys/collision/collision_psys_plane.h> 00044 #include <OpenTissue/dynamics/psys/collision/collision_psys_sphere.h> 00045 #include <OpenTissue/dynamics/psys/collision/collision_psys_sdf.h> 00046 00047 namespace OpenTissue 00048 { 00049 00050 namespace psys 00051 { 00052 00053 00054 // TODO: It might be better to use a pimpl design principle for particle system integrators. 00055 // currently there is one problem with changing this. The integrators are implemented 00056 // using a template member method. Because they can be applied to different types of 00057 // particle systems... How do we change this into a traditional abstract base class 00058 // implementation? 00059 template< 00060 typename math_types_ 00061 , typename integrator_policy = VerletIntegrator 00062 > 00063 class Types 00064 { 00065 public: 00066 00067 typedef Types<math_types_,integrator_policy> types; 00068 typedef math_types_ math_types; 00069 00070 typedef VerletIntegrator verlet_integrator; 00071 typedef EulerIntegrator euler_integrator; 00072 00073 typedef Particle<types> particle_type; 00074 typedef System<types> system_type; 00075 00076 typedef ContactPoint<types> contact_point_type; 00077 typedef ConnectorFacade< types > connector_type; 00078 00079 typedef Gravity<types> gravity_type; 00080 typedef GridForceField<types> grid_force_field_type; 00081 typedef PressureSoftBody<types> pressure_soft_body_type; 00082 typedef Spring<types> spring_type; 00083 typedef Viscosity<types> viscosity_type; 00084 typedef Force< types > force_type; 00085 00086 typedef GeometryHolder< types > geometry_holder_type; 00087 00088 typedef DirectMeshCoupling<types> coupling_type; 00089 00090 // TODO: grid_type is really bad naming it conflicts with grid_type of GridForceField, maybe it should be called phi_type? 00091 typedef OpenTissue::grid::Grid<float,math_types> grid_type; 00092 00093 typedef polymesh::PolyMesh<> mesh_type; 00094 00095 // TODO: Maybe ``system'' is redundant in these type names? 00096 typedef Cloth<types,integrator_policy> cloth_system_type; 00097 typedef SurfaceMesh<types,integrator_policy> surface_system_type; 00098 typedef MassSpringSystem<types,integrator_policy> mass_spring_system_type; 00099 00100 typedef Constraint<types> constraint_type; 00101 typedef Box<types> box_constraint_type; 00102 typedef Stick<types> stick_constraint_type; 00103 typedef Pin<types> pin_constraint_type; 00104 00105 // TODO: It is not strictly necessary for the typebinder to include the geometry types 00106 // one just need to add set-methods and dispatch entries to the geometry 00107 // holder class. 00108 typedef geometry::Sphere<math_types> sphere_type; 00109 typedef geometry::Plane<math_types> plane_type; 00110 typedef geometry::AABB<math_types> aabb_type; 00111 typedef OpenTissue::sdf::Geometry<mesh_type,grid_type> sdf_geometry_type; 00112 00113 typedef OpenTissue::aabb_tree::Geometry<typename math_types::real_type,particle_type> aabb_tree_type; 00114 }; 00115 00116 }//namespace psys 00117 }//namespace OpenTissue 00118 00119 // OPENTISSUE_DYNAMICS_PSYS_PSYS_H 00120 #endif