|
Graphite Version 3
An experimental 3D geometry processing program
|
Implementation of Skin application using ImGui. More...
#include <OGF/skin_imgui/types/application.h>
Public Member Functions | |
| Application (Interpreter *interpreter) | |
| Application constructor. | |
| ~Application () override | |
| Application destructor. | |
| Application (const Application &rhs)=delete | |
| Forbid copy. | |
| Application & | operator= (const Application &rhs)=delete |
| Forbid copy. | |
| IconRepository * | icon_repository () |
| Gets the icon repository. | |
| const IconRepository * | icon_repository () const |
| Gets the icon repository. | |
| void | start () override |
| void | stop () override |
| Stops the application. | |
| void | set_style (const std::string &value) override |
| Sets the style to be used for widgets. | |
| void | set_font_size (index_t value) override |
| Sets the size of fonts in the application. | |
| void | lock_updates () override |
| Lock updates. | |
| void | unlock_updates () override |
| Unlock updates. | |
| void | draw () override |
| Redraws the main window. | |
| void | update () override |
| Indicates that the main window should be redrawn. | |
| void | save_preferences () override |
| Saves the preferences to home directory / graphite.ini. | |
| void | load_preferences (const std::string &filename) override |
| Loads preference variables from a file. | |
| void | flush_command_queue () |
| Executes all commands in command queue. | |
| void * | impl_window () const |
| Gets a pointer to the underlying window. | |
| const std::string & | get_style () const |
| Gets the style. | |
| Camera * | camera () |
| Gets the Camera. | |
| index_t | resolve_icon (const std::string &name, bool mipmap=false) const |
| Finds an icon by name. | |
| void | exec_command (const std::string &command, bool add_to_history=true) |
| Executes a command. | |
| void | exec_command_now (const std::string &command, bool add_to_history=false) |
| Executes a command immediatly. | |
| double | scaling () const |
| Gets the global scaling to be applied to all GUI elements. | |
| double | margin () const |
| double | status_bar_height () const |
| bool | draw_console (bool visible) |
| Draws the console. | |
| bool | status_bar_is_active () const |
| Tests if the status bar should be displayed. | |
| void | draw_status_bar () |
| Draw the status bar. | |
| void | set_full_screen_mode (index_t w=0, index_t h=0, index_t hz=0, index_t monitor=0) |
| Sets full-screen mode. | |
| void | set_windowed_mode (index_t w=0, index_t h=0) |
| Sets windowed mode. | |
| void | list_video_modes () |
| Lists the video modes that can be used for set_full_screen_mode() | |
| void | iconify () |
| Iconifies this application. | |
| void | restore () |
| Restores this application. | |
| void | reset_latest_error () |
| Resets the latest error to the empty string. | |
| void | notify_error (const std::string &message) |
| Notifies than an error occured. | |
| void | set_gui_state (std::string x) |
| Sets the gui state. | |
| std::string | get_gui_state () const |
| Gets the gui state. | |
| void | set_full_screen (bool x) |
| Sets full-screen mode. | |
| bool | get_full_screen () const |
| Tests whether this application is in full-screen mode. | |
| index_t | get_width () const |
| Gets the width of the window. | |
| index_t | get_height () const |
| Gets the height of the window. | |
| index_t | get_frame_buffer_width () const |
| Gets the width of the window. | |
| index_t | get_frame_buffer_height () const |
| Gets the height of the window. | |
| void | set_accept_drops (bool value) |
| Sets whether drag and drop events should be taken into account. | |
| bool | get_accept_drops () const |
| Tests whether drag and drop events are taken into account. | |
| void | set_picked_grob (Grob *value) |
| Used by the arrow tool, memorizes the picked grob. | |
| Grob * | get_picked_grob () const |
| Used by the arrow tool, gets the memorized picked grob. | |
| const std::string & | get_latest_error () const |
| Gets the latest error message. | |
| void | error_occured (const std::string &error) |
| This signal is triggered when the console displays an error message. | |
Public Member Functions inherited from OGF::ApplicationBase | |
| ApplicationBase (Interpreter *interpreter=nullptr) | |
| ApplicationBase constructor. | |
| ~ApplicationBase () override | |
| ApplicationBase destructor. | |
| Interpreter * | interpreter () |
| Gets the main Interpreter. | |
| for (size_t index=tooltip_.find("\\n");index !=std::string::npos;index=tooltip_.find("\\n", index+2)) | |
| const std::string & | get_tooltip () const |
| Gets the tooltip to be displayed near the cursor in the rendering area, or an empty string if there is no tooltip. | |
| void | declare_preference_variable (const std::string &name, const std::string &value, const std::string &help="") |
| Declares a preference variable. | |
| virtual bool | preferences_loaded () |
| Tests whether preferences were loaded. | |
| virtual void | cancel_current_job () |
| Cancels the current job. | |
| virtual void | begin () |
| ProgressClient overload, callback called by ProgressTask. | |
| virtual void | progress (index_t step, index_t percent) |
| ProgressClient overload, callback called by ProgressTask. | |
| virtual void | end (bool canceled) |
| ProgressClient overload, callback called by ProgressTask. | |
| std::string | find_file (const std::string &filename) const |
| Finds a file in the OGF_PATH. | |
| virtual void | save_state () |
| Saves state before applying command or tool, for undo()/redo(). | |
| virtual void | undo () |
| Restores last saved state if available. | |
| virtual void | redo () |
| Restores next saved state if available. | |
| virtual void | progress_cancel () |
| Cancels current progress tastk. | |
| virtual void | post_draw () |
| Called after each frame. | |
| bool | get_can_redo () const |
| Tests whether redo() can be called. | |
| void | div (const std::string &value) |
| A signal that is triggered when a 'separation div' should be displayed in the logger. | |
| void | out (const std::string &value) |
| A signal that is triggered when the logger displays a message. | |
| void | warn (const std::string &value) |
| A signal that is triggered when the logger displays a warning message. | |
| void | err (const std::string &value) |
| A signal that is triggered when the logger displays an error message. | |
| void | status (const std::string &value) |
| A signal that is triggered when the message in the status bar should be updated. | |
| void | notify_progress_begin (const std::string &value) |
| A signal that is triggered when a ProgressTask starts. | |
| void | notify_progress (index_t value) |
| A signal that is triggered when a ProgressTask is updated. | |
| void | notify_progress_end () |
| A signal that is triggered when a ProgressTask finishes. | |
Public Member Functions inherited from OGF::Object | |
| Object (bool transient=false) | |
| Object constructor. | |
| ~Object () override | |
| Object destructor. | |
| virtual MetaClass * | meta_class () const |
| Gets the meta class. | |
| virtual void | set_meta_class (MetaClass *mclass) |
| Sets the meta class. | |
| unsigned int | id () const |
| Gets the identifier of this object. | |
| std::string | string_id () const |
| Gets the unique string identifier. | |
| bool | has_method (const std::string &method_name) const |
| Tests whether a method is defined. | |
| virtual bool | invoke_method (const std::string &method_name, const ArgList &args, Any &ret_val) |
| Invokes a method by method name and argument list, and gets the return value. | |
| bool | invoke_method (const std::string &method_name, const ArgList &args) |
| Invokes a method by method name and argument list. | |
| bool | invoke_method (const std::string &method_name) |
| Invokes a method by method name. | |
| bool | has_property (const std::string &prop_name) const |
| Tests whether a property is defined. | |
| virtual bool | get_property (const std::string &prop_name, std::string &prop_value) const |
| Gets a property. | |
| virtual Connection * | connect_signal_to_slot (const std::string &signal_name, Object *to, const std::string &slot_name) |
| Connects a signal with a slot of another object. | |
| virtual void | add_connection (Connection *connection) |
| Adds a connection to this object. | |
| virtual void | remove_connection (Connection *connection) |
| Removes a connection to this object. | |
| virtual void | get_element (index_t i, Any &value) const |
| Gets an element by index. | |
| virtual void | set_element (index_t i, const Any &value) |
| Sets an element by index. | |
| void | get_element (index_t item, index_t component, Any &value) const |
| Gets an element by item and component. | |
| void | set_element (index_t item, index_t component, const Any &value) |
| Sets an element by item and component. | |
| virtual void | search (const std::string &needle, const std::string &path="") |
| Displays the names of all objects that contain a substring. | |
| virtual index_t | get_dimension () const |
| Gets the number of elements per item. | |
| bool | get_signals_enabled () const |
| Tests wheter signals are enabled. | |
| void | set_signals_enabled (bool value) |
| Enables or disables signals. | |
| bool | get_slots_enabled () const |
| Tests wheter slots are enabled. | |
| void | set_slots_enabled (bool value) |
| Enables or disables slots. | |
| MetaClass * | get_meta_class () const |
| Gets the meta class. | |
| std::string | get_string_id () const |
| Gets the unique string identifier. | |
| virtual std::string | get_doc () const |
| Gets the documentation. | |
| virtual Sign | compare (const Object *other) const |
| Compares this object with another one. | |
| virtual bool | is_a (const MetaType *type) const |
| Tests whether this object inherits a given type. | |
| void | disconnect () |
| Removes all connections from signals of this objects. | |
| void | enable_signals () |
| Enables signals. | |
| void | disable_signals () |
| Disables signals. | |
| void | enable_slots () |
| Enables slots. | |
| void | disable_slots () |
| Disables slots. | |
| void | set_properties (const ArgList &args) |
| Sets several properties in a single call. | |
| virtual bool | set_property (const std::string &name, const std::string &value) |
| Sets an individual property. | |
| void | help () const |
| Displays some help about this object. | |
| virtual bool | set_property (const std::string &name, const Any &value) |
| Sets an individual property. | |
| virtual bool | get_property (const std::string &prop_name, Any &prop_value) const |
| Gets a property. | |
Public Member Functions inherited from GEO::Counted | |
| void | ref () const |
| Increments the reference count. | |
| void | unref () const |
| Decrements the reference count. | |
| bool | is_shared () const |
| Check if the object is shared. | |
| int | nb_refs () const |
| Gets the number of references that point to this object. | |
Static Public Member Functions | |
| static Application * | instance () |
| Gets the instance. | |
Static Public Member Functions inherited from OGF::ApplicationBase | |
| static ApplicationBase * | instance () |
| static bool | is_stopping () |
| Tests whether the application is stopping. | |
Static Public Member Functions inherited from OGF::Object | |
| static Object * | id_to_object (unsigned int id) |
| Gets an object from a unique object id. | |
Static Public Member Functions inherited from GEO::Counted | |
| static void | ref (const Counted *counted) |
| Increments the reference count. | |
| static void | unref (const Counted *counted) |
| Decrements the reference count. | |
Public Attributes | |
| : void draw_dock_space() | |
| : RenderArea* get_render_area() const { return render_area_ | |
| gom_signals | : void redraw_request() |
Public Attributes inherited from OGF::ApplicationBase | |
| : void set_tooltip(const std::string& x) { tooltip_ = x | |
| : virtual void start() | |
| : bool get_can_undo() const | |
| gom_signals | : void started() |
Public Attributes inherited from OGF::Object | |
| : virtual index_t get_nb_elements() const | |
| : bool equals(const Object* other) const | |
Additional Inherited Members | |
Protected Member Functions inherited from OGF::ApplicationBase | |
| virtual void | save_state_to_file (const std::string &filename) |
| Saves Graphite state to a file. | |
| virtual void | load_state_from_file (const std::string &filename) |
| Saves Graphite state to a file. | |
| std::string | state_buffer_filename (index_t i) const |
| Gets the file name to be used to store a state buffer. | |
Protected Member Functions inherited from OGF::Object | |
| virtual bool | emit_signal (const std::string &signal_name, const ArgList &args, bool called_from_slot=false) |
| Emits a signal and calls the slots it is connected to. | |
Protected Member Functions inherited from GEO::Counted | |
| Counted () | |
| Creates a reference counted object. | |
| virtual | ~Counted () |
| Destroys a reference counted object. | |
Static Protected Member Functions inherited from OGF::ApplicationBase | |
| static void | set_stopping_flag () |
| Indicates that the application is stopping, i.e. processes the last events from the event queue. | |
Protected Attributes inherited from OGF::ApplicationBase | |
| Interpreter * | interpreter_ |
| LoggerClient_var | logger_client_ |
| ProgressClient_var | progress_client_ |
| std::string | tooltip_ |
| index_t | state_buffer_begin_ |
| index_t | state_buffer_end_ |
| index_t | state_buffer_size_ |
| index_t | state_buffer_current_ |
| bool | undo_redo_called_ |
| bool | started_callback_called_ |
Static Protected Attributes inherited from OGF::ApplicationBase | |
| static ApplicationBase * | instance_ |
| static bool | stopping_ |
Implementation of Skin application using ImGui.
Definition at line 56 of file application.h.
|
inline |
|
overridevirtual |
Redraws the main window.
This function is called by commands that animate objects during computation, by the progress bar and by console output.
Reimplemented from OGF::ApplicationBase.
| bool OGF::Application::draw_console | ( | bool | visible | ) |
Draws the console.
| [in] | visible | true if the console is visible, false otherwise. |
| true | if the console is still visible. |
| false | otherwise, e.g., when the user clicks on the close button of the console. |
| void OGF::Application::draw_status_bar | ( | ) |
Draw the status bar.
Ignored if the status bar is not active.
| void OGF::Application::error_occured | ( | const std::string & | error | ) |
This signal is triggered when the console displays an error message.
| [in] | error | the error message to be displayed. |
| void OGF::Application::exec_command | ( | const std::string & | command, |
| bool | add_to_history = true |
||
| ) |
Executes a command.
The command is queued so that it is executed right after the current frame (and not nested in the current frame). This allows updating the progress bar.
| [in] | command | a string with the LUA command to be executed. |
| [in] | add_to_history | true if the command should be recorded in the history. |
| void OGF::Application::exec_command_now | ( | const std::string & | command, |
| bool | add_to_history = false |
||
| ) |
Executes a command immediatly.
Unlike in exec_command(), the command is not queued and is immediatly executed.
| [in] | command | a string with the LUA command to be executed. |
| [in] | add_to_history | true if the command should be recorded in the history. |
| bool OGF::Application::get_accept_drops | ( | ) | const |
Tests whether drag and drop events are taken into account.
| true | if drag and drop events are taken into account |
| false | otherwise |
| index_t OGF::Application::get_frame_buffer_height | ( | ) | const |
Gets the height of the window.
| index_t OGF::Application::get_frame_buffer_width | ( | ) | const |
Gets the width of the window.
| bool OGF::Application::get_full_screen | ( | ) | const |
Tests whether this application is in full-screen mode.
| true | if full-screen mode is used. |
| false | if windowed mode is used. |
| std::string OGF::Application::get_gui_state | ( | ) | const |
Gets the gui state.
| index_t OGF::Application::get_height | ( | ) | const |
Gets the height of the window.
|
inline |
Gets the latest error message.
Definition at line 416 of file application.h.
|
inline |
Used by the arrow tool, gets the memorized picked grob.
Definition at line 408 of file application.h.
| const std::string & OGF::Application::get_style | ( | ) | const |
Gets the style.
| index_t OGF::Application::get_width | ( | ) | const |
Gets the width of the window.
|
inline |
Gets the icon repository.
Definition at line 91 of file application.h.
|
inline |
Gets the icon repository.
Definition at line 99 of file application.h.
| void * OGF::Application::impl_window | ( | ) | const |
Gets a pointer to the underlying window.
Some callbacks in RenderArea need it to query modifiers state.
|
inlinestatic |
Gets the instance.
Definition at line 83 of file application.h.
| void OGF::Application::list_video_modes | ( | ) |
Lists the video modes that can be used for set_full_screen_mode()
The video modes are listed in the terminal.
|
overridevirtual |
Loads preference variables from a file.
| [in] | filename | the full path to the file. |
Reimplemented from OGF::ApplicationBase.
|
overridevirtual |
Lock updates.
If this function is called, updates are ignored. It is useful when a RenderingContext operation is occuring, to prevent the Console for triggering a drawing operation.
Reimplemented from OGF::ApplicationBase.
|
inline |
Definition at line 232 of file application.h.
|
inline |
Notifies than an error occured.
| [in] | message | the error message. |
Definition at line 311 of file application.h.
|
inline |
Resets the latest error to the empty string.
Definition at line 303 of file application.h.
| index_t OGF::Application::resolve_icon | ( | const std::string & | name, |
| bool | mipmap = false |
||
| ) | const |
Finds an icon by name.
| [in] | name | the name of the icon, without file extension |
| [in] | mipmap | if true, use mipmapping (filtering) |
Icons are loaded from XPM files in lib/icons/
|
overridevirtual |
Saves the preferences to home directory / graphite.ini.
Reimplemented from OGF::ApplicationBase.
| double OGF::Application::scaling | ( | ) | const |
Gets the global scaling to be applied to all GUI elements.
| void OGF::Application::set_accept_drops | ( | bool | value | ) |
Sets whether drag and drop events should be taken into account.
| [in] | value | true if drag and drop events should be taken into account, false otherwise |
|
overridevirtual |
Sets the size of fonts in the application.
Default implementation does nothing but storing the font size in the preferences. Can be overloaded in implementations.
| [in] | value | the size of fonts |
Reimplemented from OGF::ApplicationBase.
| void OGF::Application::set_full_screen | ( | bool | x | ) |
Sets full-screen mode.
| [in] | x | true if full-screen mode should be used, false if windowed-mode should be used. |
| void OGF::Application::set_full_screen_mode | ( | index_t | w = 0, |
| index_t | h = 0, |
||
| index_t | hz = 0, |
||
| index_t | monitor = 0 |
||
| ) |
Sets full-screen mode.
All arguments to zero sets default mode.
| [in] | w,h | width and height in pixels |
| [in] | hz | refresh rate in Hz |
| [in] | monitor | the id of the monitor |
| void OGF::Application::set_gui_state | ( | std::string | x | ) |
Sets the gui state.
| [in] | x | a string that encores the positions of all windows, previously obtained through get_gui_state() |
|
inline |
Used by the arrow tool, memorizes the picked grob.
| [in] | value | the picked grob to memorized |
Definition at line 400 of file application.h.
|
overridevirtual |
Sets the style to be used for widgets.
Some toolkits can have different styles. Default implementation does nothing but storing the style in the preferences. Can be overloaded in implementations.
| [in] | value | the name of the widgets style |
Reimplemented from OGF::ApplicationBase.
Sets windowed mode.
| [in] | w,h | width and height in pixels. If zero, use current dimensions. |
|
override |
|
inline |
Definition at line 236 of file application.h.
| bool OGF::Application::status_bar_is_active | ( | ) | const |
Tests if the status bar should be displayed.
| true | if the status bar should be displayed, i.e. when there is an active ProgressLogger. |
| false | otherwise. |
|
overridevirtual |
Stops the application.
In derived classes, it exits the main event loop of the widgets toolkit.
Reimplemented from OGF::ApplicationBase.
|
overridevirtual |
|
overridevirtual |
Indicates that the main window should be redrawn.
Reimplemented from OGF::ApplicationBase.
| OGF::Application::__pad0__ |
Definition at line 168 of file application.h.
| OGF::Application::__pad1__ |
Definition at line 311 of file application.h.
| gom_signals OGF::Application::__pad2__ |
Definition at line 420 of file application.h.