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

Simple_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/Simple_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_Simple_Viewer_hxx
00035 #define esve_viewers_dim3_Simple_Viewer_hxx
00036 
00037 #include <esve/viewers/dim3/Minimal_Viewer.hxx>
00038 #include <esve/viewers/dim3/Auto_Widgets.hxx>
00039 #include <esve/viewers/dimn/Simple_Viewer.hxx>
00040 #include <esve/engine/dim3/Make_Geom.hxx>
00041 #include <string>
00042 #include <memory>
00043 
00044 namespace esve { namespace viewers { namespace dim3 {
00045 
00050 
00051 class Simple_Viewer
00052     : virtual protected Auto_Widgets,
00053       virtual protected viewers::dimn::Simple_Viewer,
00054       virtual protected viewers::dim3::Minimal_Viewer
00055 {
00056 public:
00058     Simple_Viewer( int argc,
00059                    char** argv,
00060                    const std::string & label = "simple3d" ) ;
00061 
00062     int takeover() ;
00063 
00064     ~Simple_Viewer() ;
00065 
00066 protected:
00068     // Simple_Viewer
00070 
00071     const std::string & help_text() const ;
00072     void initialize() ;
00073 
00075     // Minimal_Viewer
00077 
00078     void add_geom( engine::dim3::Geom & ) ;
00079     void remove_geom( engine::dim3::Geom & ) ;
00080 
00082     // Simple_UI
00084 
00085     void create_label( const std::string & label ) ;
00086 
00087     // (doxygen bug workaround)
00089     Valuator &
00090     create_valuator( real initial_value,
00091                      const std::string & label = "" ) ;
00092 
00093     Complex_Valuator &
00094     create_valuator( const complex & initial_value,
00095                      const std::string & label = "" ) ;
00096 
00097     Pure_Valuator &
00098     create_valuator( const pure & initial_value,
00099                      const std::string & label = "" ) ;
00100 
00101     Quat_Valuator &
00102     create_valuator( const quat & initial_value,
00103                      const std::string & label = "" ) ;
00104 
00105     Toggle &
00106     create_toggle( bool initial_value,
00107                    const std::string & label ) ;
00108 
00109     File_Selector &
00110     create_file_selector( const std::string & initial_value = "",
00111                           const std::string & label = "file",
00112                           const std::string & selector_label = "select a file",
00113                           const std::string & initial_directory = ".",
00114                           const std::string & filter = "*" ) ;
00115 
00116     void create_help( const std::string & text,
00117                       const std::string & label = "help" ) ;
00118 
00120     // Auto_Widgets
00122 
00123     Valuator &
00124     create_scaling_valuator( const std::string & label = "scale" ) ;
00125 
00127     // handlers
00129 
00132     void add_handler( kernel::Handler & ) ;
00133     void remove_handler( kernel::Handler & ) ;
00134     void add_handler( components::dimn::Motion_Handler & ) ;
00135     void remove_handler( components::dimn::Motion_Handler & ) ;
00137 
00138     Catch_Function catch_function() const ;
00139     void catch_function( Catch_Function ) ;
00140 
00141 private:
00142     Simple_Viewer( const Simple_Viewer & ) ;
00143     Simple_Viewer & operator=( const Simple_Viewer & ) ;
00144 
00145     class Private ;
00146     const std::auto_ptr<Private> m ;
00147 } ;
00148 
00149 }}} // namespace esve::viewers::dim3
00150 
00151 #endif
00152 

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