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

Basic_Viewer.hxx

00001 
00002 // 
00003 // Copyright (C) 2006 James M. Lawrence.  All rights reserved.
00004 // 
00005 // software: esve-1.0.3
00006 // file: esve/viewers/dim3/Basic_Viewer.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_viewers_dim3_Basic_Viewer_hxx
00035 #define esve_viewers_dim3_Basic_Viewer_hxx
00036 
00037 #include <esve/viewers/dim3/Camera.hxx>
00038 #include <esve/viewers/dim3/Minimal_Viewer.hxx>
00039 #include <esve/kernel/Simple_Kernel_Stowed.hxx>
00040 #include <esve/message/Compute_Sender_Stowed.hxx>
00041 #include <esve/message/Draw_Sender_Stowed.hxx>
00042 #include <string>
00043 #include <memory>
00044 
00045 namespace esve { namespace engine { namespace dim3 {
00046 
00047 class Frame ;
00048 class Geom ;
00049 
00050 }}} // namespace esve::engine::dim3
00051 
00052 namespace esve { namespace components { namespace dimn  {
00053 
00054 class Motion_Handler ;
00055 
00056 }}} // namespace esve::engine::dimn
00057 
00058 namespace esve { namespace viewers { namespace dim3 {
00059 
00060 class Light ;
00061 
00084 
00085 class Basic_Viewer
00086     : virtual protected kernel::Simple_Kernel_Stowed,
00087       virtual protected message::Draw_Sender_Stowed,
00088       virtual protected message::Compute_Sender_Stowed,
00089       virtual public Minimal_Viewer
00090 {
00091 public:
00092     Basic_Viewer() ;
00093 
00095     virtual int takeover() ;
00096 
00103     virtual
00104     Camera &
00105     create_camera( const std::string & = default_camera_label,
00106                    const Camera::Rectangle & = default_camera_rectangle ) ;
00107 
00114     virtual Light & create_light() ;
00115 
00122     virtual void add_geom( engine::dim3::Geom & ) ;
00123 
00130     virtual void remove_geom( engine::dim3::Geom & ) ;
00132 
00139     virtual void add_handler( components::dimn::Motion_Handler & ) ;
00140 
00146     virtual void remove_handler( components::dimn::Motion_Handler & ) ;
00148 
00151     virtual void add_handler( kernel::Handler & ) ;
00152     virtual void remove_handler( kernel::Handler & ) ;
00154 
00156 
00162     virtual void add_frame( engine::dim3::Frame & ) ;
00163 
00170     virtual void remove_frame( engine::dim3::Frame & ) ;
00171 
00173 
00174     ~Basic_Viewer() ;
00175 
00176     static const std::string default_camera_label ;
00177     static const Camera::Rectangle default_camera_rectangle ;
00178 
00179 protected:
00180     void remove_all_handlers() ;
00181 
00183     message::Draw_Sender & peek_draw_sender() ;
00184 
00186     message::Draw_Sender & peek_unlit_draw_sender() ;
00187 
00189     message::Draw_Sender & peek_draw_initializer() ;
00190 
00192     message::Compute_Sender & peek_compute_sender() ;
00193 
00194     kernel::Simple_Kernel & peek_kernel() ;
00195 
00196     //
00197     // This is the base camera which will sit inside the delegate
00198     // returned by create_camera().
00199     //
00200     // Override to adjust methods like send_draw() which do not
00201     // propagate to delegates.
00202     //
00203     virtual
00204     std::auto_ptr<Camera>
00205     new_camera( const std::string & label,
00206                 const Camera::Rectangle & ) ;
00207 
00208     //
00209     // This is the base light which will sit inside the delegate
00210     // returned by create_light().
00211     //
00212     // Override to adjust methods like send_draw() which do not
00213     // propagate to delegates.
00214     //
00215     virtual std::auto_ptr<Light> new_light() ;
00216 
00217 private:
00218     Basic_Viewer( const Basic_Viewer & ) ;
00219     Basic_Viewer & operator=( const Basic_Viewer & ) ;
00220 
00221     class Private ;
00222     const std::auto_ptr<Private> m ;
00223 } ;
00224 
00225 }}} // namespace esve::viewers::dim3
00226 
00227 #endif

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