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/dim4/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_dim4_Simple_Viewer_hxx
00035 #define esve_viewers_dim4_Simple_Viewer_hxx
00036 
00037 #include <esve/viewers/dim4/Minimal_Viewer.hxx>
00038 #include <esve/viewers/dim4/Auto_Widgets.hxx>
00039 #include <esve/viewers/dimn/Simple_Viewer.hxx>
00040 #include <esve/engine/dim4/Make_Geom.hxx>
00041 #include <string>
00042 #include <memory>
00043 
00044 namespace esve { namespace viewers { namespace dim4 {
00045 
00050 
00051 class Simple_Viewer
00052     : virtual protected Auto_Widgets,
00053       virtual protected viewers::dimn::Simple_Viewer,
00054       virtual protected viewers::dim4::Minimal_Viewer
00055 {
00056 public:
00058     Simple_Viewer( int argc,
00059                    char** argv,
00060                    const std::string & label = "simple4d" ) ;
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 add_geom( engine::dim4::Geom & ) ;
00080     void remove_geom( engine::dim3::Geom & ) ;
00081     void remove_geom( engine::dim4::Geom & ) ;
00082 
00084     // Simple_UI
00086 
00087     void create_label( const std::string & label ) ;
00088 
00089     // (doxygen bug workaround)
00091     Valuator &
00092     create_valuator( real initial_value,
00093                      const std::string & label = "" ) ;
00094 
00095     Complex_Valuator &
00096     create_valuator( const complex & initial_value,
00097                      const std::string & label = "" ) ;
00098 
00099     Pure_Valuator &
00100     create_valuator( const pure & initial_value,
00101                      const std::string & label = "" ) ;
00102 
00103     Quat_Valuator &
00104     create_valuator( const quat & initial_value,
00105                      const std::string & label = "" ) ;
00106 
00107     Toggle &
00108     create_toggle( bool initial_value,
00109                    const std::string & label ) ;
00110 
00111     File_Selector &
00112     create_file_selector( const std::string & initial_value = "",
00113                           const std::string & label = "file",
00114                           const std::string & selector_label = "select a file",
00115                           const std::string & initial_directory = ".",
00116                           const std::string & filter = "*" ) ;
00117 
00118     void create_help( const std::string & text,
00119                       const std::string & label = "help" ) ;
00120 
00122     // Auto_Widgets
00124 
00125     Valuator &
00126     create_scaling_valuator( const std::string & label = "scale" ) ;
00127 
00128     Valuator &
00129     create_inversion_valuator( const std::string & label = "inversion" ) ;
00130 
00132     // handlers
00134 
00137     void add_handler( kernel::Handler & ) ;
00138     void remove_handler( kernel::Handler & ) ;
00139     void add_handler( components::dimn::Motion_Handler & ) ;
00140     void remove_handler( components::dimn::Motion_Handler & ) ;
00142 
00143     Catch_Function catch_function() const ;
00144     void catch_function( Catch_Function ) ;
00145 
00146 private:
00147     Simple_Viewer( const Simple_Viewer & ) ;
00148     Simple_Viewer & operator=( const Simple_Viewer & ) ;
00149 
00150     class Private ;
00151     const std::auto_ptr<Private> m ;
00152 } ;
00153 
00154 }}} // namespace esve::viewers::dim4
00155 
00156 #endif
00157 

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