00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
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
00070
00071 const std::string & help_text() const ;
00072 void initialize() ;
00073
00075
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
00086
00087 void create_label( const std::string & label ) ;
00088
00089
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
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
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 }}}
00155
00156 #endif
00157