00001 #ifndef OPENTISSUE_UTILITY_VOLUME_RENDERING_VOLUME_RENDERING_TEXTURE_3D_TILE_H 00002 #define OPENTISSUE_UTILITY_VOLUME_RENDERING_VOLUME_RENDERING_TEXTURE_3D_TILE_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/gpu/texture/texture_texture3D.h> 00013 #include <OpenTissue/core/geometry/geometry_aabb.h> 00014 #include <cassert> 00015 00016 namespace OpenTissue 00017 { 00018 namespace volume_rendering 00019 { 00020 00024 template<typename math_types> 00025 class Texture3DTile 00026 { 00027 public: 00028 00029 typedef Texture3DTile<math_types> tile_type; 00030 typedef typename math_types::real_type real_type; 00031 typedef typename math_types::vector3_type vector3_type; 00032 typedef geometry::AABB<math_types> aabb_type; 00033 00034 public: 00035 00036 real_type m_aabb_min_x; 00037 real_type m_aabb_min_y; 00038 real_type m_aabb_min_z; 00039 real_type m_aabb_width; 00040 real_type m_aabb_height; 00041 real_type m_aabb_depth; 00042 aabb_type m_aabb; 00043 00044 real_type m_tile_min_x; 00045 real_type m_tile_min_y; 00046 real_type m_tile_min_z; 00047 real_type m_tile_width; 00048 real_type m_tile_height; 00049 real_type m_tile_depth; 00050 00051 int m_image_skip_i; 00052 int m_image_skip_j; 00053 int m_image_skip_k; 00054 00055 int m_image_size_i; 00056 int m_image_size_j; 00057 int m_image_size_k; 00058 00059 int m_texture_size_i; 00060 int m_texture_size_j; 00061 int m_texture_size_k; 00062 00063 int m_texture_fill_i; 00064 int m_texture_fill_j; 00065 int m_texture_fill_k; 00066 00067 vector3_type m_vertices[8]; 00068 vector3_type m_eye_vertices[8]; 00069 OpenTissue::texture::texture3D_pointer m_volume_texture; 00070 real_type m_min_depth; 00071 real_type m_max_depth; 00072 real_type m_z_depth; 00073 00074 public: 00075 00076 bool operator<(tile_type const & tile)const{ return (m_z_depth<tile.m_z_depth)?true:false; } //--- for depth sorting 00077 bool operator>(tile_type const & tile)const{ return (m_z_depth>tile.m_z_depth)?true:false; } //--- for depth sorting 00078 00079 }; 00080 00081 } // namespace volume_rendering 00082 } // namespace OpenTissue 00083 00084 // OPENTISSUE_UTILITY_VOLUME_RENDERING_VOLUME_RENDERING_TEXTURE_3D_TILE_H 00085 #endif