Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
GuiNodal Class Reference

Gui Nodal definition, manages nodes and links. More...

Inheritance diagram for GuiNodal:
GuiGlWidget GuiWidget EventObject CoreCustomData CoreBaseObject CoreBaseType

Classes

struct  GraphTextInfo
 
struct  TextureCache
 

Public Types

enum  GraphState {
  GRAPH_STATE_IDLE,
  GRAPH_STATE_LINK_CREATION,
  GRAPH_STATE_LINK_DESTRUCTION,
  GRAPH_STATE_LINK_WAITING,
  GRAPH_STATE_LINK_CANCEL,
  GRAPH_STATE_NODE_MOVE,
  GRAPH_STATE_NODE_DRAGGING,
  GRAPH_STATE_GRAPH_PAN,
  GRAPH_STATE_MULTISELECTION_SQUARE,
  GRAPH_STATE_KNIFE,
  GRAPH_STATE_NODE_RESIZE,
  GRAPH_STATE_MINIMAP_DRAG,
  GRAPH_STATE_COUNT
}
 
enum  RegisteredImage {
  REGISTERED_IMAGE_EXPANDED,
  REGISTERED_IMAGE_CONNECTED,
  REGISTERED_IMAGE_COLLAPSED,
  REGISTERED_IMAGE_LOCK,
  REGISTERED_IMAGE_COUNT
}
 
enum  DisplayNodeLabel {
  DISPLAY_NODE_LABEL_OFF,
  DISPLAY_NODE_LABEL_ON,
  DISPLAY_NODE_LABEL_SMART
}
 
- Public Types inherited from GuiGlWidget
enum  TextEllipsis {
  TEXT_ELLIPSIS_LEFT,
  TEXT_ELLIPSIS_RIGHT,
  TEXT_ELLIPSIS_BOTH = TEXT_ELLIPSIS_LEFT | TEXT_ELLIPSIS_RIGHT,
  TEXT_ELLIPSIS_COUNT
}
 
- Public Types inherited from GuiWidget
enum  Roundness {
  ROUNDNESS_NONE = 0,
  ROUNDNESS_TOP_LEFT = 1,
  ROUNDNESS_TOP_RIGHT = 2,
  ROUNDNESS_BOTTOM_LEFT = 4,
  ROUNDNESS_BOTTOM_RIGHT = 8,
  ROUNDNESS_LEFT = ROUNDNESS_TOP_LEFT | ROUNDNESS_BOTTOM_LEFT,
  ROUNDNESS_RIGHT = ROUNDNESS_TOP_RIGHT | ROUNDNESS_BOTTOM_RIGHT,
  ROUNDNESS_TOP = ROUNDNESS_TOP_LEFT | ROUNDNESS_TOP_RIGHT,
  ROUNDNESS_BOTTOM = ROUNDNESS_BOTTOM_LEFT | ROUNDNESS_BOTTOM_RIGHT,
  ROUNDNESS_ALL = ROUNDNESS_TOP | ROUNDNESS_BOTTOM
}
 
enum  Constraint {
  CONSTRAINT_LEFT,
  CONSTRAINT_RIGHT,
  CONSTRAINT_TOP,
  CONSTRAINT_BOTTOM,
  CONSTRAINT_COUNT
}
 
enum  Justify {
  JUSTIFY_LEFT,
  JUSTIFY_RIGHT,
  JUSTIFY_CENTER,
  JUSTIFY_COUNT
}
 
enum  IconPosition {
  ICON_POSITION_LEFT,
  ICON_POSITION_RIGHT,
  ICON_POSITION_COUNT
}
 
- Public Types inherited from EventObject
typedef void(* EventInfoFunction )(EventObject &, const EventInfo &, void *)
 event callback signature for free functions / static methods.
 
typedef void(EventObject::* EventInfoMethod )(EventObject &, const EventInfo &, void *)
 event callback signature for methods.
 
typedef void(* EventFunction )(EventObject &, const CoreString &, void *)
 
typedef void(EventObject::* EventMethod )(EventObject &, const CoreString &, void *)
 

Public Member Functions

 GuiNodal (GuiWidget &parent, const int &x, const int &y, const int &w, const int &h, bool smartZoom=true, bool enable_drop=false)
 
virtual void clear (bool clear_bookmarks=true)
 
virtual void load_settings (const ParserGroup &settings) override
 
virtual void save_settings (ParserGroup &settings) override
 
virtual int get_graph_zone_width () const
 
virtual int get_graph_zone_height () const
 
virtual void resize (const int &x, const int &y, const int &w, const int &h) override
 
virtual void update_content (GuiDc &dc)
 
virtual int process_event (const CoreString &evt) override
 This method is called whenever an event happens on this widget. Override this to catch and process them.
 
virtual void add_node (GuiNodalNode *node)
 
virtual void add_link (GuiNodalLink *link)
 
virtual void remove_node (GuiNodalNodeBase &node)
 
void remove_link (GuiNodalLink *link)
 
virtual bool on_link_remove (GuiNodalLink &link, const CoreString &batch_name)
 
virtual bool on_links_remove (const CoreSet< GuiNodalLink * > &link, const CoreString &batch_name)
 
virtual GuiNodalLinkcreate_link (GuiNodalNodeBase *node_from, GuiNodalNodeBase *node_to)
 
virtual void add_backdrop (GuiNodalBackdrop &back, GuiNodalNode *parent=nullptr)
 
virtual void remove_backdrop (GuiNodalBackdrop &back, bool from_ui)
 
virtual void add_note (GuiNodalNote &note, GuiNodalNode *parent=nullptr)
 
virtual void remove_note (GuiNodalNote &note, bool from_ui)
 
virtual void add_subnet (GuiNodalSubnet &snet, GuiNodalNode *parent=nullptr)
 
virtual void remove_subnet (GuiNodalSubnet &snet, bool from_ui)
 
virtual void add_dot (GuiNodalDot &dot, GuiNodalNode *parent=nullptr)
 
virtual void remove_dot (GuiNodalDot &dot, bool from_ui)
 
const CoreSet< GuiNodalNode * > & get_nodes () const
 
const CoreSet< GuiNodalLink * > & get_links () const
 
const CoreSet
< GuiNodalBackdrop * > & 
get_backdrops () const
 
const CoreSet< GuiNodalNote * > & get_notes () const
 
const CoreSet< GuiNodalSubnet * > & get_subnets () const
 
void get_nodes_and_backdrops (CoreSet< GuiNodalNodeBase * > &items) const
 
void get_nodes_outside_backdrops (CoreSet< GuiNodalNode * > &items) const
 
void get_layoutable_nodes (CoreSet< GuiNodalNodeBase * > &items, bool selected_only) const
 
const int & get_zoom_factor () const
 
float get_zoom_ratio () const
 
float get_zoom_ratio_r () const
 
void convert_color (const GuiColorScheme::Role &role, GMathVec3f &color3f)
 
const float & get_max_zoom_ratio () const
 
const float & get_min_zoom_ratio () const
 
const float & get_zoom_simplification_ratio () const
 
void world_to_screen (const GMathVec2i &npos, GMathVec2i &spos) const
 
void screen_to_world (const GMathVec2i &spos, GMathVec2i &npos) const
 
virtual void selection_changed ()
 
void add_clickable_node (GuiNodalItem &object, GMathVec3uc &picking_color)
 register a node to be selectable and generate a unique color for it.
 
void remove_clickable_node (const GMathVec3uc &picking_color)
 
void set_state (const GraphState &state)
 
const GraphState & get_state () const
 
virtual void init_node_location (GuiNodalNodeBase &node)
 Initializes node location in the nodal view area.
 
void cache_textures ()
 generate lists for the registered texture, then clean registrations.
 
void remove_textures ()
 iterate the vector of registered-to-be-removed texture and remove them
 
void register_texture (const GuiImage *img, const int &width, const int &height, float tile_x=1, float tile_y=1)
 add a texture to the registration vector, waiting to be rendered in a list
 
void remove_texture (const GuiImage *img, const int &width, const int &height, float tile_x=1, float tile_y=1)
 ask for a texture to be removed
 
void draw_texture (const GuiImage *img, const int &width=16, const int &height=16, float tile_x=1, float tile_y=1)
 
void cache_draw_texture (const GuiImage *img, const int &width=16, const int &height=16, float tile_x=1, float tile_y=1)
 Renders a texture display list.
 
void cache_remove_texture (const TextureCache &cache_tex)
 Releases a cached texture.
 
virtual const GuiImageget_registered_image (unsigned int id, ImageIcon::ImageIconSize size) const
 
void delete_lists (const unsigned int &list, const unsigned int &range)
 
void compute_graph_bounding ()
 Computes 2d bounding box of the whole graph.
 
void compute_selection_bounding ()
 Computes 2d bounding box of the selected nodes.
 
int get_node_highlight_delay ()
 
const bool & get_allow_node_zoom () const
 
void set_allow_node_zoom (const bool &value)
 
bool can_zoom_node (const GuiNodalNode &node) const
 
bool can_autoexpand_node () const
 
bool can_autohighlight_node () const
 tells whether graph is connecting upstream in omnidirectional layout. If so, node will expose its self plugs as soon as mouse is around it
 
bool is_link_highlight () const
 
unsigned int get_link_highlight_thickness () const
 
unsigned int get_selection_highlight_thickness () const
 
const DisplayNodeLabel & get_display_node_label () const
 
bool is_omnidirectional_layout () const
 
void set_omnidirectional_layout (bool omni)
 
virtual bool is_omnidirectional_layout_supported () const
 
virtual bool is_legacy_layout_supported () const
 
bool is_simplified_layout () const
 
void set_simplified_layout (bool simplified)
 
void set_max_node_width (unsigned int width)
 
unsigned int get_max_node_width () const
 
void set_node_cropping (bool crop)
 
bool is_node_cropping () const
 
void use_font (const GraphTextInfo &text_info)
 
void reset_default_font ()
 
const GMathVec2i & get_graph_mouse_pos () const
 
void update_mouse_location ()
 
void request_fit (bool fit=true)
 
void get_bg_color (GMathVec3uc &color)
 
bool is_node_visible (const GuiNodalNodeBase &node)
 Returns true if the incoming node is visible on screen, false otherwise.
 
void ensure_visibility (GuiNodalNodeBase &node)
 Pan view to make item visible.
 
void get_view_settings (GMathVec3i &pos_and_zoom) const
 
const GMathVec4i & get_view_area () const
 
double get_minimap_scale () const
 see GuiNodal::draw_minimap
 
unsigned int get_depth_range () const
 
- Public Member Functions inherited from GuiGlWidget
 GuiGlWidget (GuiWidget &parent, const int &x, const int &y, const int &w, const int &h)
 Constructor.
 
virtual void show () override
 
virtual void hide () override
 
virtual const GMathVec2i & get_size () const override
 
virtual const GMathVec2i & get_position () const override
 
int get_view_x () const
 
int get_view_y () const
 
void make_current ()
 
void swap_buffers ()
 
const bool & is_drawing () const
 
int get_text_width (const CoreString &text)
 
int get_text_width (const char *text, const int &i_size)
 
int get_text_height () const
 
void draw_text (const int &x, const int &y, const int &r, const int &g, const int &b, const Justify &hj, const Justify &vj, const CoreString *text)
 
void draw_framed_text (const int &x, const int &y, const int &r, const int &g, const int &b, const int &bg_r, const int &bg_g, const int &bg_b, const Justify &hj, const Justify &vj, const CoreString *text)
 
const bool & is_overlay_visible () const
 
void show_overlay (const bool &state)
 
- Public Member Functions inherited from GuiWidget
 GuiWidget (GuiWidget &parent, const int &x, const int &y, const int &w, const int &h)
 
 GuiWidget (GuiApp &app, const int &x, const int &y, const int &w, const int &h)
 
void destroy ()
 
virtual bool is_shown () const
 
bool is_hidden () const
 
bool is_recursive_destroyed () const
 
const bool & is_destroyed () const
 
virtual GuiWidgetget_parent () const
 
const GuiWindowget_root_window () const
 
virtual void set_parent (GuiWidget *parent)
 
GuiWindowget_window () const
 
const int & get_width () const
 
const int & get_height () const
 
const int & get_x () const
 
const int & get_y () const
 
void set_width (int width)
 
void set_height (int height)
 
void set_size (int x, int y, int w, int h)
 
void set_position (const int &x, const int &y, bool origin=true)
 sets position , leave size unchanged.
 
void set_mouse_cursor (const Gui::MouseCursorId &cursor)
 
const Gui::MouseCursorId & get_mouse_cursor () const
 
void set_font (const GuiFont &font)
 
GuiFontget_font () const
 
const CoreStringget_tooltip () const
 
virtual void set_tooltip (const CoreString &tooltip)
 
void force_tooltip ()
 
virtual bool is_enabled () const
 
virtual void enable ()
 Activate the widget.
 
virtual void disable ()
 Deativate the widget.
 
bool is_active () const
 Get the active state of the widget, without taking the parents into account.
 
void set_enable (bool enable)
 Set the active state of this widget.
 
virtual GuiColorSchemeget_color_scheme () const
 
void set_color (const GuiColorScheme::Group &group, const GuiColorScheme::Role &role, const unsigned char &r, const unsigned char &g, const unsigned char &b)
 
void set_color (const GuiColorScheme::Group &group, const GuiColorScheme::Role &role, const GMathVec3uc &color)
 
void get_color (const GuiColorScheme::Group &group, const GuiColorScheme::Role &role, unsigned char &r, unsigned char &g, unsigned char &b) const
 
const GMathVec3uc & get_color (const GuiColorScheme::Group &group, const GuiColorScheme::Role &role) const
 
GMathVec3uc get_highlighted_color (const GMathVec3uc &, const float &factor=1.2f, const bool &keep_max_gap=true) const
 
bool is_entered () const
 
virtual void set_focus ()
 
bool children_has_focus (GuiWidget *widget) const
 
bool has_focus () const
 
void lose_focus ()
 
bool is_focus_receiver () const
 
void set_focus_receiver (const bool &receiver)
 
bool is_key_receiver () const
 
void set_key_receiver (const bool &receiver)
 
virtual void redraw ()
 This will ask the widget to be drawn again.
 
virtual CtxDrawget_draw_ctx () const
 Return the drawing context needed by ModuleTool to draw in the widget.
 
virtual void widget_update ()
 This method is called just before draw() if set_is_dirty() has been called before.
 
void set_is_dirty (const bool &value=true)
 
bool get_is_dirty ()
 returns if widget is dirty or not.
 
void compute_children_bbox (GMathVec2i &lo, GMathVec2i &hi) const
 
const CoreVector< GuiWidget * > & get_children () const
 
GuiAppget_application () const
 
GuiActionregister_action (const CoreString &name, GuiAction::Function function, const CoreString &shortcut, const CoreString &tooltip="", void *data=0, const GuiImage *icon=0)
 
const CoreVector< GuiAction * > & get_actions () const
 
GuiActionget_action (const CoreString &name) const
 
void get_actions_recursively (CoreVector< GuiAction * > &actions) const
 
void remove_action (GuiAction *action, bool delete_it)
 
void remove_all_actions ()
 
void register_hotkey (const CoreString &shortcut, const CoreString &tooltip)
 
const CoreVector< Hotkey > & get_hotkeys () const
 
void get_hotkeys_recursively (CoreVector< Hotkey > &hotkeys) const
 
const int & get_top_offset () const
 
const int & get_bottom_offset () const
 
const int & get_left_offset () const
 
const int & get_right_offset () const
 
const Constraint & get_top_constraint () const
 
const Constraint & get_bottom_constraint () const
 
const Constraint & get_left_constraint () const
 
const Constraint & get_right_constraint () const
 
virtual void set_constraints (const Constraint &left, const Constraint &top, const Constraint &right, const Constraint &bottom)
 
void set_active_constraints (const bool &active)
 
virtual const bool & is_active_constraints () const
 
void set_recursive_constraints (const bool &recursive)
 
virtual const bool & is_recursive_constraints () const
 
void disable_clipping ()
 
void enable_clipping ()
 
void get_clip_region (int &x, int &y, int &w, int &h) const
 
virtual void set_clip_region (const int &x, const int &y, const int &w, const int &h)
 
const bool & is_clipping_enabled () const
 
void bring_to_front ()
 
void enable_tab_navigation (const bool &enable)
 
const bool & is_tab_navigation_enabled () const
 
virtual bool is_visible () const
 
virtual void update_color_scheme (const GuiColorScheme &scheme)
 
virtual void paste (const CoreString &clipboard)
 
bool initiate_dnd_event (const CoreVector< CoreBaseObject * > &data)
 Initiate Drag'n drop event.
 
bool initiate_dnd_event (CoreVector< OfHandle > &data)
 
bool initiate_dnd_event (CoreBaseObject *data)
 See initiate_dnd_event.
 
bool initiate_dnd_event (OfHandle data)
 
virtual GuiWidgetget_next_focus_widget () const
 
virtual GuiWidgetget_previous_focus_widget () const
 
void give_focus_to_next_widget ()
 
void give_focus_to_previous_widget ()
 
void get_parent_effective_clip_region (int &x, int &y, int &w, int &h) const
 
const bool & is_widget_visible (GuiWidget &child) const
 
const bool & is_show_children () const
 
void set_show_children (const bool &show_children)
 
template<class WidgetType >
WidgetType * get_parent_widget () const
 Return the first occurence of WidgetType* in the widget parent hierarchy, or 0 if not found.
 
virtual size_t get_memory_size () const override
 
- Public Member Functions inherited from EventObject
 EventObject ()
 Constructor.
 
 EventObject (const EventObject &src)
 Copy Constructor.
 
virtual ~EventObject () override
 Destructor.
 
void connect (EventObject &sender, const CoreString &event_id, EventInfoMethod event_cb, void *data=0)
 Connects this to an object to listen to a specific event.
 
void connect (EventObject &sender, EventInfoMethod event_cb, void *data=0)
 Connects this to an object to listen any of its events.
 
bool disconnect (EventObject &sender, const CoreString &event_id, EventInfoMethod event_cb, void *data=0)
 
bool disconnect_all (EventObject &sender)
 Disconnects from all objects sender was listening on.
 
void disconnect_all ()
 Disconnects from all objects we were listening on.
 
void remove_all_connection ()
 Disconnects object from other objects it is listening to, and also disconnects all objects listening to it.
 
void raise_event (const CoreString &event_id) const
 sends an event
 
void raise_event (const EventInfo &event_info) const
 sends an event
 
bool is_connected (EventObject &sender, const CoreString &event_id, void *data)
 
void set_mute (const bool &mute)
 Asks for object muting. This will increase or decrease the muting counter. Unmuting may not be immediat since it will happen only when counter reaches 0.
 
bool is_mute () const
 Returns if object is muted.
 
CoreArray< EventObject * > get_senders () const
 
unsigned int get_sender_count () const
 
unsigned int get_receiver_count () const
 
void connect (EventObject &sender, const CoreString &event_id, EventMethod event_cb, void *data=0)
 Connects this to an object to listen to a specific event.
 
void connect (EventObject &sender, EventMethod event_cb, void *data=0)
 Connects this to an object to listen any of its events.
 
bool disconnect (EventObject &sender, const CoreString &event_id, EventMethod event_cb, void *data=0)
 Disconnects this from an object for a specific event.
 
- Public Member Functions inherited from CoreCustomData
 CoreCustomData (const CoreCustomData &src)
 
void add_custom_data (void *key, const bool &data)
 
void add_custom_data (void *key, const int &data)
 
void add_custom_data (void *key, const unsigned int &data)
 
void add_custom_data (void *key, const char *data)
 
void add_custom_data (void *key, const CoreString &data)
 
void add_custom_data (void *key, const double &data)
 
void add_custom_data (void *key, void *data)
 
void remove_custom_data (void *key)
 
void remove_all_custom_data ()
 
void set_custom_data (void *key, const bool &data)
 
void set_custom_data (void *key, const int &data)
 
void set_custom_data (void *key, const unsigned int &data)
 
void set_custom_data (void *key, const double &data)
 
void set_custom_data (void *key, const char *data)
 
void set_custom_data (void *key, const CoreString &data)
 
void set_custom_data (void *key, void *data)
 
void get_custom_data (void *key, bool &data) const
 
void get_custom_data (void *key, int &data) const
 
void get_custom_data (void *key, unsigned int &data) const
 
void get_custom_data (void *key, double &data) const
 
void get_custom_data (void *key, CoreString &data) const
 
void get_custom_data (void *key, void *&data) const
 
- Public Member Functions inherited from CoreBaseObject
bool is_kindof (const CoreBaseObject &object) const
 
CoreString get_class_info_name () const
 
const unsigned long & get_class_info_id () const
 
virtual bool is_kindof (const CoreClassInfo &cinfo) const
 
virtual const CoreClassInfoget_class_info () const
 
template<class T >
T * cast ()
 
template<class T >
const T * cast () const
 
- Public Member Functions inherited from CoreBaseType
bool is_kindof (const CoreClassInfo &cinfo) const
 

Static Public Member Functions

static bool is_inside (int x, int y, int l, int r, int t, int b)
 
static int round (const float &r)
 
static CoreString get_graph_state_name (const GraphState &state)
 
static bool get_is_move_issuer ()
 
static void set_is_move_issuer (const bool &value)
 
- Static Public Member Functions inherited from GuiGlWidget
static CoreString get_text_ellipsis_name ()
 
static unsigned int & get_gl_list_count ()
 
static void inc_gl_list_count (const unsigned int &count)
 
static void dec_gl_list_count (const unsigned int &count)
 
static int get_opengl_major_version_number ()
 Get OpenGL major version number.
 
static int get_opengl_minor_version_number ()
 Get OpenGL minor version number.
 
static float get_opengl_version_as_float ()
 Get current OpenGL version as a float: major_number.minor_number.
 
static CoreString get_opengl_version_as_string ()
 Get current OpenGL version as a string: major_number.minor_number.
 
static float get_opengl_minimum_required_version_as_float ()
 Get OpenGL minimum required version as a float: minimum_major_number.minimum_minor_number.
 
static bool is_current_opengl_version_supported ()
 Returns true if current OpenGL version is greater or equal to the minimum required version.
 
- Static Public Member Functions inherited from GuiWidget
static CoreString open_file (GuiApp &app, const CoreString &directory="", const CoreString &title="Open file", const CoreString &filter="")
 
static CoreArray< CoreStringopen_files (GuiApp &app, const CoreString &directory="", const CoreString &title="Open files", const CoreString &filter="")
 
static CoreString open_folder (GuiApp &app, const CoreString &directory="", const CoreString &title="Choose folder")
 
static CoreString save_file (GuiApp &app, const CoreString &directory="", const CoreString &title="Save file", const CoreString &filter="", int *filter_selected=0)
 
static CoreVector< OfItemHandlepick_objects (GuiApp &app, const CoreVector< OfItemHandle > &current_selection, const CoreVector< OfClass * > &filter_classes, OfContext *context=0, const CoreVector< OfItem * > &hidden_items=CoreVector< OfItem * >(), const bool &enable_multi_selection=false)
 
static CoreVector< OfItemHandlepick_objects (GuiApp &app, const CoreVector< OfClass * > &filter_classes, OfContext *context=0, const bool &enable_multi_selection=false)
 
static const char * get_roundness_name (const Roundness &roundness)
 
static const char * get_constraint_name (const Constraint &constraint)
 
static const char * get_justify_name (const Justify &justification)
 
static const char * get_icon_position_name (const IconPosition &position)
 
static GuiWidgetget_focused_widget ()
 
static GuiWidgetget_last_focused_widget ()
 
static GuiWidgetget_last_event_widget ()
 
static void intersect_box (const int &x1, const int &y1, const int &w1, const int &h1, const int &x2, const int &y2, const int &w2, const int &h2, int &x, int &y, int &w, int &h)
 
static bool intersect_box (const int &x1, const int &y1, const int &w1, const int &h1, const int &x2, const int &y2, const int &w2, const int &h2)
 
static void on_dnd_timeout (void *data)
 
static const CoreVector
< CoreBaseObject * > & 
get_dnd_event_data ()
 Return the data associated with the current Drag'n drop. The data is only valid if a widget is currently calling initiate_dnd_event, otherwise it is empty.
 
static GuiWidgetget_dnd_widget ()
 Return the GuiWidget that initiated the Drag'n drop. Null otherwise.
 
static GuiWidgetget_dnd_accepting_widget ()
 Return the GuiWidget that accepts the Drag'n drop. Null otherwise.
 
- Static Public Member Functions inherited from EventObject
static void connect (EventObject &sender, const CoreString &event_id, EventObject &receiver, EventInfoMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, EventObject &receiver, EventInfoMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, const CoreString &event_id, EventInfoFunction event_cb, void *data=0)
 Connects to an object to listen to a specific event.
 
static void connect (EventObject &sender, EventInfoFunction event_cb, void *data=0)
 Connects to an object to listen any of its events.
 
static bool disconnect (EventObject &sender, const CoreString &event_id, EventInfoFunction event_cb, void *data=0)
 
static void raise_event (EventObject &sender, const CoreString &event_id)
 Sends an event.
 
static void raise_event (EventObject &sender, const EventInfo &event_info)
 Sends an event.
 
static void connect (EventObject &sender, const CoreString &event_id, EventFunction event_cb, void *data=0)
 Connects to an object to listen to a specific event.
 
static void connect (EventObject &sender, EventFunction event_cb, void *data=0)
 Connects to an object to listen any of its events.
 
static void connect (EventObject &sender, const CoreString &event_id, EventObject &receiver, EventMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, EventObject &receiver, EventMethod event_cb, void *data=0)
 Static version of the above function.
 
static bool disconnect (EventObject &sender, const CoreString &event_id, EventFunction event_cb, void *data=0)
 Disconnects this from an object for a specific event.
 
- Static Public Member Functions inherited from CoreCustomData
static void * get_custom_data_key (const CoreString &key)
 
- Static Public Member Functions inherited from CoreBaseObject
static const CoreClassInfoclass_info ()
 
template<class T >
static T * cast (CoreBaseObject *object)
 
template<class T >
static const T * cast (const CoreBaseObject *object)
 
- Static Public Member Functions inherited from CoreBaseType
static const CoreClassInfoclass_info ()
 Get the type descriptor of this instance.
 

Public Attributes

bool SmartZoomEnabled
 
CoreVector< TextureCachem_textures_to_cache
 
CoreVector< TextureCachem_textures_to_remove
 

Protected Types

enum  LinkHighlightMode {
  LINK_HIGHLIGHT_MODE_IN =1,
  LINK_HIGHLIGHT_MODE_OUT =2,
  LINK_HIGHLIGHT_MODE_IN_OUT =LINK_HIGHLIGHT_MODE_IN|LINK_HIGHLIGHT_MODE_OUT
}
 
enum  NodalItemType {
  NODAL_ITEM_NODE = 1,
  NODAL_ITEM_SNET = 2,
  NODAL_ITEM_NOTE = 4,
  NODAL_ITEM_BACK = 8,
  NODAL_ITEM_ALL = NODAL_ITEM_NODE|NODAL_ITEM_SNET|NODAL_ITEM_NOTE|NODAL_ITEM_BACK
}
 
- Protected Types inherited from GuiGlWidget
enum  HudSettingOvrId {
  HUD_SETTING_OVRID_INFO_SHOW =0,
  HUD_SETTING_OVRID_OVERLAY_SHOW,
  HUD_SETTING_OVRID_OVERLAY_TYPE,
  HUD_SETTING_OVRID_OVERLAY_XFLIP,
  HUD_SETTING_OVRID_OVERLAY_YFLIP,
  HUD_SETTING_OVRID_SAFE_FRAME_SHOW,
  HUD_SETTING_OVRID_SAFE_FRAME_CAPTION,
  HUD_SETTING_OVRID_LIVE_AREA_FRAME,
  HUD_SETTING_OVRID_ACTION_FRAME,
  HUD_SETTING_OVRID_ACTION_FRAME_XYVALUE,
  HUD_SETTING_OVRID_TITLE_FRAME,
  HUD_SETTING_OVRID_TITLE_FRAME_XYVALUE,
  HUD_SETTING_OVRID_USER_FRAME,
  HUD_SETTING_OVRID_USER_FRAME_XYVALUE,
  HUD_SETTING_OVRID_COUNT
}
 
- Protected Types inherited from GuiWidget
typedef void(* CreateWidget )(void *inst)
 

Protected Member Functions

virtual void init_layout ()
 
virtual void draw (GuiDc &dc) override
 This is the main drawing method of the widget.
 
void draw_links (GuiDc &dc)
 
void draw_links_on_top (GuiDc &dc)
 
virtual void draw_first (GuiDc &dc)
 
virtual void draw_last (GuiDc &dc)
 
virtual void reset_gl_lists ()
 
void set_bg_color (const GMathVec3f &color)
 
const GMathVec3f & get_bg_color () const
 
void set_view_settings (const GMathVec3i &pos_and_zoom)
 
GuiNodalBookmarkDataget_bookmark_data (GuiNodalBookmark &mark) const
 Returns bookmark shared data held by given bookmark ui.
 
virtual void bookmark_viewpoint (GuiNodalBookmarkData &mark) const
 Feed GuiNodalBookmarkData with current viewpoint Intended to be overridden by upper class to feed blind data.
 
virtual void apply_bookmark (GuiNodalBookmarkData &mark)
 Use GuiNodalBookmarkData to set current viewpoint Intended to be overridden by upper class to use blind data.
 
bool is_snapper_active () const
 
bool is_magnet_active () const
 
bool is_link_culling () const
 
void set_link_highlight (bool highlight)
 
LinkHighlightMode get_link_highlight_mode () const
 
void set_link_highlight_mode (LinkHighlightMode mode)
 
bool is_node_autoinsert_allowed () const
 
void set_node_autoinsert_allowed (bool enable)
 
void add_autoinsert_plug_candidate (GuiNodalNodeZoneAnchor *plug, bool preferred=false)
 
GuiNodalNodeZoneAnchorget_autoinsert_plug_chosen ()
 
void set_display_node_label (DisplayNodeLabel value)
 
void set_animated_fit (bool ok)
 
void set_centered_icons (bool centered)
 
bool get_centered_icons () const
 
short get_default_display_mode () const
 
void set_default_display_mode (short m)
 
virtual void end_move_selection (const CoreSet< GuiNodalNodeBase * > &nodes, bool need_completion=false)
 
virtual void apply_nodes_positions (const CoreSet< GuiNodalNodeBase * > &nodes)
 
virtual void end_resize_selection (GuiNodalNodeBase &node)
 
virtual void apply_nodes_property (const CoreSet< GuiNodalNode * > &nodes)
 
virtual bool can_move_selection () const
 
bool manage_link_validation (GuiNodalNodeBase *from, GuiNodalNodeBase *to)
 
bool process_link_event (const CoreString &event_id, bool dnd_case=false, bool multiconnect=false)
 
virtual bool validate_link_creation (GuiNodalNodeBase *from, GuiNodalNodeBase *to)
 
virtual bool validate_link_reconnection (GuiNodalNodeBase &from, GuiNodalNodeBase &to, GuiNodalLink &link_to_replace)
 
virtual bool check_link_creation (GuiNodalNodeBase *from, GuiNodalNodeBase *to)
 
virtual void update_creation_links (GuiNodalNodeZoneAnchor *dst_anchor)
 
virtual void build_creation_links (const CoreSet< GuiNodalNode * > &selection)
 
virtual void update_multitarget_creation_links (const CoreSet< GuiNodalNode * > &selection, GuiNodalNodeZoneAnchor *dst_anchor)
 
virtual void build_multitarget_creation_links (const CoreSet< GuiNodalNode * > &selection, GuiNodalNodeZoneAnchor *src_anchor)
 
virtual bool complete_multitarget_creation_links (const CoreSet< GuiNodalNode * > &selection, GuiNodalNodeZoneAnchor *dst_anchor)
 
CoreVector< GuiNodalLink * > & get_creation_links ()
 
GuiNodalLinkget_destruction_link () const
 
GuiNodalLinkget_creation_link () const
 
GuiNodalNodeBaseget_dangling_node () const
 
virtual void unref_link (GuiNodalLink *link, bool delete_link)
 
virtual bool is_reconnecting_on_same_plug (GuiNodalLink *link, GuiNodalNodeZoneAnchor *new_plug)
 
virtual void begin_link_creation (const GuiNodalLink &link)
 
virtual void end_link_creation ()
 
const CoreSet
< GuiNodalNodeBase * > & 
get_selection () const
 
void get_selected_nodes (CoreSet< GuiNodalNode * > &selected_nodes, bool skip_backdrops=false) const
 Gets selected nodes, optionally ignore those belonging to backdrops.
 
void get_selected_nodes (CoreSet< GuiNodalNodeBase * > &selected_nodes, short filter=NODAL_ITEM_ALL) const
 Gets selected nodes.
 
void set_selection (const CoreSet< GuiNodalNodeBase * > &nodes)
 Sets the selected nodes.
 
void set_selection (GuiNodalNodeBase &node)
 Set selection with incoming node.
 
bool add_to_selection (GuiNodalNodeBase &node)
 Adds node to selection.
 
virtual void clear_selection ()
 Clears selection.
 
bool is_selection_in_single_container (GuiNodalNode *&common_parent, const CoreSet< GuiNodalNodeBase * > &selected_nodes, const CoreString &user_warning)
 
virtual bool try_initiate_dnd (const CoreSet< GuiNodalNodeBase * > &dnd_nodes)
 
virtual bool try_initiate_dnd_link (GuiNodalNodeBase &node)
 
virtual GuiNodalDndDatafeed_dnd_link_data (GuiNodalNodeBase &node)
 
virtual int on_dnd_enter ()
 
virtual int on_dnd_drag ()
 
virtual int on_dnd_release ()
 
virtual int on_dnd_leave ()
 
virtual bool has_local_dnd_position (const GuiNodalNodeZoneAnchor *dnd_plug, GMathVec2i &local_pos)
 
bool is_connecting_mode () const
 
void set_connecting_mode (bool m)
 
void resume_connecting (GuiNodalNodeZoneAnchor &plug)
 
void set_is_dirty ()
 
const GMathVec2i & get_mouse_pos () const
 
void set_mouse_pos (const int &x, const int &y)
 
GMathVec2i compute_graph_coords (const int &screen_x, const int &screen_y) const
 
const GMathVec2i & get_hotspot () const
 
virtual GMathVec2i get_hotspot_increment () const
 
GMathVec2i get_usable_hotspot ()
 
void set_hotspot (const GMathVec2i &hs)
 
const GMathVec4i & get_graph_bounding ()
 
const GMathVec4i & get_selection_bounding ()
 
void get_bbox (const CoreSet< GuiNodalNodeBase * > &nodes, GMathVec4i &bounding) const
 
void fit_on_area (const GMathVec4i &area)
 Fits the view on the given zone rectangle.
 
void manage_fit (bool selected_only=false)
 Fits view on selected items if required, otherwise fits on all items.
 
void manage_pan (const GMathVec4i &box)
 
virtual void get_fittable_nodes (CoreSet< GuiNodalNodeBase * > &fit) const
 
virtual bool has_fittable_nodes () const
 
void set_visible_node (GuiNodalNodeBase &node)
 
void draw_text (GuiGlWidgetDc &dc, const GraphTextInfo &txt, const unsigned int &width=0, GuiGlWidget::TextEllipsis ellipsis=GuiGlWidget::TEXT_ELLIPSIS_RIGHT, const GuiWidget::Justify &just=GuiWidget::JUSTIFY_LEFT, const int &zone_w=0, const float &scale=1.f)
 draw a texture on screen (it must have been registered and cached before)
 
void draw_text (GuiGlWidgetDc &dc, const CoreString &txt, const unsigned int &width=0, GuiGlWidget::TextEllipsis ellipsis=GuiGlWidget::TEXT_ELLIPSIS_RIGHT, const GuiWidget::Justify &just=GuiWidget::JUSTIFY_LEFT, const int &zone_w=0, const float &scale=1.f)
 draw text
 
virtual void on_gl_context_destroyed () override
 
int get_drop_alpha () const
 
void enable_minimap (bool ok)
 
GuiNodalItemget_object_under_mouse () const
 
const bool get_mouse_is_over () const
 
virtual bool manage_double_left_click (bool modifier_shift, bool modifier_ctrl)
 returns true if double-click has been handled.
 
virtual bool manage_shake (int value)
 
virtual bool is_explorable (GuiNodalNodeBase &node) const
 
virtual void references_button_activated (GuiNodalNode &node)
 
virtual void dependencies_button_activated (GuiNodalNode &node)
 
virtual GuiNodalBackdropinstantiate_backdrop (const CoreString &label, int x, int y, const CoreSet< GuiNodalNodeBase * > &content_nodes, GuiNodalNode *parent=nullptr)
 
virtual GuiNodalNoteinstantiate_note (const CoreString &label, int x, int y, GuiNodalNode *parent=nullptr)
 
virtual GuiNodalSubnetinstantiate_subnet (const CoreString &label, int x, int y, GuiNodalNode *parent=nullptr)
 
virtual GuiNodalDotinstantiate_dot (int x, int y, GuiNodalNode *parent=nullptr)
 
virtual void insert_dot (GuiNodalDot &dot, GuiNodalLink &link)
 
virtual GuiNodalDotinsert_dot (GuiNodalLink &link)
 
void update_backdrops ()
 Update backdrops contents on move completion.
 
void update_all_backdrops ()
 Update backdrops contents on startup or when new backdrops have been added.
 
void request_backdrop_update (GuiNodalNodeBase *node=0)
 
void complete_backdrop_update_request ()
 
void on_need_backdrop_update (GuiApp &sender, const EventInfo &evt, void *data)
 
virtual void apply_layout (CoreVector< GuiNodalNodeBase * > &nodes, bool silent)
 
virtual void fill_popup_menu (GuiOfItemMenu &menu)
 
virtual void add_to_popup_menu (GuiOfItemMenu &menu)
 
virtual void register_layout_actions ()
 
virtual void update_link_aspect (GuiNodalLink &link)
 
void set_preselected_item (GuiNodalItem *node)
 
GuiNodalItemget_preselected_item () const
 
void unzoom_focused_node ()
 
- Protected Member Functions inherited from GuiGlWidget
virtual ~GuiGlWidget () override
 Destructor.
 
virtual GuiDcget_dc () override
 
virtual void destroy ()
 
bool is_valid () const
 
bool is_context_valid () const
 
void reset_context ()
 
virtual void widget_redraw () override
 
virtual Fl_Widget * get_widget () const override
 
virtual Fl_Group * get_group () const override
 
CoreString get_ellipsed_text (const CoreString &txt, const int &w, const TextEllipsis &ellipsis)
 
void set_active_font (GuiFont &font)
 
void use_active_font ()
 
const GuiFont::FontDescget_active_font_desc () const
 
FontGlDataget_active_font_data () const
 
void enable_stencil ()
 
void set_widget_border_size (unsigned int border_size)
 
const unsigned int & get_widget_border_size () const
 
void set_gl_widget_viewport ()
 set the gl viewport for the widget with a border
 
void on_hud_pref_change (GuiApp &app, const EventInfo &event, void *data)
 
void overlay_draw_safe_frame (GuiDc &dc, int width, int height)
 draw composition frame according to current HUD_SETTING_OVRID_LIVE_AREA_FRAME, and if activated, HUD_SETTING_OVRID_ACTION/TITLE/USER_FRAME
 
void overlay_draw_composition_guide (GuiDc &dc, int width, int height, bool yup)
 draw composition guide according to current HUD_SETTING_OVRID_OVERLAY, HUD_SETTING_OVRID_OVERLAY_XFLIP and HUD_SETTING_OVRID_OVERLAY_YFLIP
 
virtual void overlay_transform2d (double &x, double &y) const
 
- Protected Member Functions inherited from GuiWidget
 GuiWidget (CreateWidget create_widget, GuiWidget &parent, const int &x, const int &y, const int &w, const int &h)
 
 GuiWidget (CreateWidget create_widget, GuiApp &app, const int &x, const int &y, const int &w, const int &h)
 
void clear_all_children ()
 
void damage (const unsigned char &mask)
 
const bool is_damaged (const unsigned char &mask) const
 
const unsigned char get_damage () const
 
void create_delayed_parenting (Fl_Group *group) const
 
void recompute_constraints ()
 
virtual void push_clip (const int &x, const int &y, const int &w, const int &h)
 
virtual void pop_clip ()
 
void get_text_size (const CoreString &text, int &w, int &h) const
 
void get_text_size (const char *text, int &w, int &h) const
 
virtual void on_add_child (GuiWidget *child)
 
virtual void on_remove_child (GuiWidget *child)
 
virtual void apply_constraints (const int &px, const int &py, const int &pw, const int &ph)
 
void apply_children_constraints (const int &px, const int &py, const int &pw, const int &ph) const
 
void apply_constraints (GuiWidget &child, const int &px, const int &py, const int &pw, const int &ph) const
 
virtual void apply_clipping ()
 
void apply_children_clipping ()
 
void capture_events (const bool &value)
 
virtual bool process_actions ()
 

Static Protected Member Functions

static void on_move_mode (GuiWidget &widget, const GuiAction &action, void *data)
 Action callback to switch move mode : stiff/stretch.
 
static void on_grid (GuiWidget &widget, const GuiAction &action, void *data)
 Action callback to enable/disable grid.
 
static void on_magnet (GuiWidget &widget, const GuiAction &action, void *data)
 Action callback to enable/disable magnet.
 
static void on_grid_settings (GuiWidget &widget, const GuiAction &action, void *data)
 Action callback to open grid settings dialog.
 
static void on_cull_links (GuiWidget &widget, const GuiAction &action, void *data)
 Action callback to toggle link display mode : draw culled links or not.
 
static void on_tangent_links (GuiWidget &widget, const GuiAction &action, void *data)
 Action callback to switch link tangent mode : symmetric or not.
 
static void on_highlight_links (GuiWidget &widget, const GuiAction &action, void *data)
 Action callback to toggle link highlight.
 
static void on_change_max_node_width (GuiWidget &widget, const GuiAction &action, void *data)
 Action callback to set maximum node width.
 
static void on_allow_node_autoinsert (GuiWidget &widget, const GuiAction &action, void *data)
 Action callback to toggle ability to insert node in a link.
 
static void on_display_node_label (GuiWidget &widget, const GuiAction &action, void *data)
 Action callback to toggle node title display.
 
static void on_animated_fit (GuiWidget &widget, const GuiAction &action, void *data)
 Action callback to toggle smooth transitions.
 
static void on_center_node_icon (GuiWidget &widget, const GuiAction &action, void *data)
 
static void on_omnidirectional_layout (GuiWidget &widget, const GuiAction &action, void *data)
 
static void compute_node_neighbours_recursively (GuiNodalNodeBase &node, CoreSet< GuiNodalNodeBase * > &neighbours, const bool &nodes_from, const bool &nodes_to)
 Computes node neighbours recursively, building a list of all the nodes connected to incoming node.
 
- Static Protected Member Functions inherited from GuiGlWidget
static GlUtilsGlCtx & get_gl_context ()
 Return the shared gl context for shared gl list/texture deletion...
 
static void generate_gl_fonts ()
 Compute opengl fonts. Must be called before a font can be drawn in opengl.
 
static void add_overlay_options (GuiGlHudSettings &hud_settings)
 

Protected Attributes

CoreString m_bookmark_id
 
- Protected Attributes inherited from GuiGlWidget
GuiGlHudSettings m_overlay_settings
 
- Protected Attributes inherited from GuiWidget
Fl_Widget * m_widget
 
Fl_Window * m_window
 
Fl_Group * m_group
 
GuiAppm_application
 
int m_child_index
 
Constraint m_top_constraint
 
Constraint m_bottom_constraint
 
Constraint m_left_constraint
 
Constraint m_right_constraint
 
int m_top_offset
 
int m_bottom_offset
 
int m_left_offset
 
int m_right_offset
 
int m_clip_x
 
int m_clip_y
 
int m_clip_w
 
int m_clip_h
 
int m_eff_clip_x
 
int m_eff_clip_y
 
int m_eff_clip_w
 
int m_eff_clip_h
 
GMathVec2i m_size
 
GMathVec2i m_position
 
GuiColorSchemem_color_scheme
 
GuiDcm_dc
 

Friends

class GuiNodalNode
 
class GuiNodalNodeBase
 
class GuiNodalLink
 
class GuiNodalLayouter
 
class GridOptions
 

Additional Inherited Members

- Static Public Attributes inherited from GuiGlWidget
static const unsigned int kDefaultWidgetBorderSize = 2u
 

Detailed Description

Gui Nodal definition, manages nodes and links.

Nodal widget, defining the OpenGl view to display a nodal view, its nodes, links and general behavior.

Member Function Documentation

void GuiNodal::add_clickable_node ( GuiNodalItem object,
GMathVec3uc &  picking_color 
)

register a node to be selectable and generate a unique color for it.

Parameters
[in]objectto be selectable
[out]generatedcolor
bool GuiNodal::add_to_selection ( GuiNodalNodeBase node_base)
protected

Adds node to selection.

Returns
True if selection has been modified
void GuiNodal::compute_node_neighbours_recursively ( GuiNodalNodeBase node,
CoreSet< GuiNodalNodeBase * > &  neighbours,
const bool &  want_nodes_from,
const bool &  want_nodes_to 
)
staticprotected

Computes node neighbours recursively, building a list of all the nodes connected to incoming node.

Parameters
[in]nodenode to search neighbours for
[out]neighboursfound neighbours
[in]specifyif we want to considerer incoming nodes in the search
[in]specifyif we want to considerer outgoing nodes in the search
void GuiNodal::draw ( GuiDc dc)
overrideprotectedvirtual

This is the main drawing method of the widget.

Parameters
dcThe drawing context used to draw stuff.

Reimplemented from GuiGlWidget.

void GuiNodal::draw_text ( GuiGlWidgetDc dc,
const CoreString txt,
const unsigned int &  width = 0,
GuiGlWidget::TextEllipsis  ellipsis = GuiGlWidget::TEXT_ELLIPSIS_RIGHT,
const GuiWidget::Justify &  just = GuiWidget::JUSTIFY_LEFT,
const int &  zone_w = 0,
const float &  scale = 1.f 
)
protected

draw text

Parameters
[in]dcDrawing Context with drawing functions
[in]textto draw
[in]widthtext width
[in]ellipsisspecifies which part of the text will be croped if needed.
[in]justtext alignement
[in]sizesize of the zone to draw the text in
[in]scalescale to use
void GuiNodal::get_selected_nodes ( CoreSet< GuiNodalNode * > &  selected_nodes,
bool  skip_backdrops = false 
) const
protected

Gets selected nodes, optionally ignore those belonging to backdrops.

Parameters
[out]selected_nodesselected nodes
void GuiNodal::get_selected_nodes ( CoreSet< GuiNodalNodeBase * > &  selected_nodes,
short  filter = NODAL_ITEM_ALL 
) const
protected

Gets selected nodes.

Parameters
[out]selected_nodesselected nodes
int GuiNodal::process_event ( const CoreString event_id)
overridevirtual

This method is called whenever an event happens on this widget. Override this to catch and process them.

Parameters
event_idThe event name.
Returns
1 if the event was consumed, 0 otherwise (to let the other widgets catch it)

Reimplemented from GuiWidget.