Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members

Report_Min_Z.hxx

00001 
00002 // 
00003 // Copyright (C) 2006 James M. Lawrence.  All rights reserved.
00004 // 
00005 // software: esve-1.0.3
00006 // file: esve/components/dim4/Report_Min_Z.hxx
00007 // 
00008 // Redistribution and use in source and binary forms, with or without
00009 // modification, are permitted provided that the following conditions
00010 // are met:
00011 // 
00012 // 1. Redistributions of source code must retain the above copyright
00013 //    notice, this list of conditions and the following disclaimer.
00014 // 
00015 // 2. The origin of this software must not be misrepresented; you must
00016 //    not claim that you wrote the original software.  If you use this
00017 //    software in a product, an acknowledgment in the product 
00018 //    documentation would be appreciated but is not required.
00019 // 
00020 // 3. Altered source versions must be plainly marked as such, and must
00021 //    not be misrepresented as being the original software.
00022 // 
00023 // 4. The name of the author may not be used to endorse or promote
00024 //    products derived from this software without specific prior written
00025 //    permission.
00026 // 
00027 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY,
00028 // AND WITH NO CLAIM AS TO ITS SUITABILITY FOR ANY PURPOSE.  IN NO EVENT
00029 // SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM WHATSOEVER MADE IN CONNECTION
00030 // TO THIS SOFTWARE.
00031 // 
00033 
00034 #ifndef esve_components_dim4_Report_Min_Z_hxx
00035 #define esve_components_dim4_Report_Min_Z_hxx
00036 
00037 #include <esve/components/dim3/Min_Z.hxx>
00038 #include <esve/engine/dim4/Make_Frame.hxx>
00039 #include <esve/types/quat.hxx>
00040 
00041 namespace esve { namespace components { namespace dim4 {
00042 
00047 
00048 template< typename T_Frame >
00049 class Report_Min_Z
00050     : virtual public components::dim3::Min_Z,
00051       public T_Frame
00052 {
00053 private:
00054 #if !defined(NDEBUG)
00055     template< class U > static void m_unused( const U & ) { }
00056 
00057     void m_requirements_1()
00058     {
00059         typedef typename T_Frame::Make_Frame_Parameter_Target Target ;
00060         typedef typename T_Frame::Make_Frame_Parameter_Frame Frame ;
00061 
00062         engine::dim4::Make_Frame<Target, Frame>* r =
00063             dynamic_cast<T_Frame*>(this) ;
00064         m_unused(r) ;
00065     }
00066 
00067     struct m_Requirements
00068     {
00069         m_Requirements()
00070         {
00071             typedef void (Report_Min_Z::*R)() ;
00072             R r = &Report_Min_Z::m_requirements_1 ;
00073             m_unused(r) ;
00074         }
00075     } m_requirements ;
00076 #endif // !defined(NDEBUG)
00077     
00078     struct m_Find_Min
00079     {
00080         types::real min_z ;
00081 
00082         m_Find_Min( types::real min_z_ )
00083             : min_z(min_z_) { }
00084 
00085         void operator()( const types::quat & a )
00086         {
00087             if( a.z() < min_z )
00088             {
00089                 min_z = a.z() ;
00090             }
00091         }
00092     } ;
00093 
00094     struct Private
00095     {
00096         types::real initial_min_z ;
00097         types::real min_z ;
00098 
00099         Private() ;
00100     } ;
00101 
00102     Report_Min_Z( const Report_Min_Z & ) ;
00103     Report_Min_Z & operator=( const Report_Min_Z & ) ;
00104 
00105     Private m ;
00106 
00107 public:
00109     Report_Min_Z() ;
00110 
00112     template< typename T_Arg >
00113     Report_Min_Z( T_Arg & ) ;
00114 
00116     template< typename T_Arg >
00117     Report_Min_Z( const T_Arg & ) ;
00118 
00119     types::real min_z() const
00120     {
00121         return m.min_z ;
00122     }
00123 
00129     types::real initial_min_z() const
00130     {
00131         return m.initial_min_z ;
00132     }
00133 
00134     void initial_min_z( types::real a )
00135     {
00136         m.initial_min_z = a ;
00137     }
00139 
00140     ~Report_Min_Z() ;
00141 
00142 protected:
00144     void apply_transform() ;
00145 } ;
00146 
00147 }}} // namespace esve::components::dim4
00148 
00149 #include <esve/components/dim4/Report_Min_Z.template.cxx>
00150 
00151 #endif
00152 

Generated on Tue May 30 11:40:53 2006 for esve by doxygen 1.3.4