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 | Protected Member Functions | Protected Attributes | List of all members
GuiNodalNode Class Reference

Defines a GuiNodalNode, displaying a node in a GuiNodal. More...

Inheritance diagram for GuiNodalNode:
GuiNodalNodeBase GuiNodalItem EventObject CoreCustomData CoreBaseObject CoreBaseType GuiNodalDot

Public Types

enum  ZoneDisplay {
  ZONE_DISPLAY_ALL,
  ZONE_DISPLAY_USED,
  ZONE_DISPLAY_NONE,
  ZONE_DISPLAY_COUNT
}
 
- Public Types inherited from GuiNodalNodeBase
enum  NodeAnchor {
  NODE_ANCHOR_NONE = 0,
  NODE_ANCHOR_LEFT = 0x01,
  NODE_ANCHOR_RIGHT = 0x02,
  NODE_ANCHOR_UP = 0x04,
  NODE_ANCHOR_BOTTOM = 0x08,
  NODE_ANCHOR_SIDES = NODE_ANCHOR_LEFT|NODE_ANCHOR_RIGHT,
  NODE_ANCHOR_ALL = NODE_ANCHOR_LEFT|NODE_ANCHOR_RIGHT|NODE_ANCHOR_UP|NODE_ANCHOR_BOTTOM
}
 
enum  NodeState {
  NODE_STATE_SELECTED = 1,
  NODE_STATE_HIGHLIGHTED = 2,
  NODE_STATE_DISABLED = 4,
  NODE_STATE_FADING_IN = 8,
  NODE_STATE_FADING_IN_DELAYED = 16,
  NODE_STATE_FADING_OUT = 32,
  NODE_STATE_FADING_OUT_DELAYED = 64,
  NODE_STATE_SIMPLIFIED = 128,
  NODE_STATE_HIDDEN = 256,
  NODE_STATE_PRESELECTED = 512,
  NODE_STATE_MOVING = 1024,
  NODE_STATE_COLLAPSED = 2048,
  NODE_STATE_GHOST =4096,
  NODE_STATE_GUEST_IN =8192
}
 
- Public Types inherited from GuiNodalItem
enum  ItemDrawState {
  ITEM_DRAW_DIRTY,
  ITEM_DRAW_UPDATED,
  ITEM_DRAW_CACHED,
  ITEM_DRAW_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

 GuiNodalNode (GuiNodal &graph, const CoreString &label, const int &x=0, const int &y=0, const unsigned int &active_anchors=NODE_ANCHOR_LEFT)
 Constructor.
 
virtual ~GuiNodalNode () override
 Destructor.
 
void draw (GuiDc &dc) override
 
void _draw (GuiDc &dc) override
 
void cache_draw (GuiDc &dc)
 
void draw_select (GuiDc &dc) override
 
void _draw_select (GuiDc &dc) override
 
void cache_draw_select (GuiDc &dc)
 
virtual void draw_mini (GuiDc &dc)
 
virtual void _draw_mini (GuiDc &dc)
 
void cache_draw_mini (GuiDc &dc)
 
void draw_outline (int thickness) override
 Draws a silhouette using current gl color.
 
void reset_gl_lists ()
 
void update_content (GuiDc &dc) override
 Updates node content.
 
void compute_size ()
 Computes size of the node, depending on its content (children and zones)
 
int get_width () const override
 
int get_height () const override
 
void get_zoomed_offset (GMathVec2f &off) const override
 Override so that node in omnidirectional graph is always X-centered on its position.
 
GMathVec2i get_unzoomed_offset () const override
 Override so that node in omnidirectional graph is always X-centered on its position.
 
GMathVec2i get_displayed_center () const override
 Override so that node in omnidirectional graph is always X-centered on its position.
 
void get_bbox (GMathVec2i &tl, GMathVec2i &br) const override
 Computes world bounding box.
 
const int get_zone_count () const
 
GuiNodalNodeZoneget_zone (int const &index) const
 
const CoreVector
< GuiNodalNodeZone * > & 
get_zones ()
 
void add_zone (GuiNodalNodeZone &zone)
 adds a zone
 
void remove_zone (GuiNodalNodeZone &zone)
 removes a zone
 
void set_zones_display_mode (const ZoneDisplay &dsp, bool update=false)
 
const ZoneDisplay & get_zones_display_mode () const
 
void compute_link_order ()
 
int get_default_input_y () const
 
void set_is_highlighted (const bool &value) override
 Activates or desactivates highlight state for the node.
 
void set_selected (bool selected) override
 Selects or deselects the node.
 
void set_disabled (bool disabled) override
 Disables or enables the node.
 
void set_ghost (bool ghost) override
 
unsigned int set_depth (unsigned int d) override
 Override to assign a depth to child nodes when expanded.
 
void set_is_culled (const bool &value) override
 Override to recurse on child nodes when expanded.
 
void set_pass_through (GuiNodalNodeZone *z)
 
GuiNodalNodeZoneget_pass_through () const
 
void remove_plug_button ()
 
void add_plug_button ()
 
bool has_plug_button () const
 
const GMathVec3uc & get_title_bg_color () const
 
void set_title_normal_color (const GMathVec3uc &color)
 
void set_title_selected_color (const GMathVec3uc &color)
 
GuiNodalNodeZoneHeaderget_header () const
 
const CoreStringget_name () const
 Gets name.
 
void set_name (const CoreString &name)
 Sets name.
 
void set_name (const GuiNodal::GraphTextInfo &text_data)
 Sets name.
 
void set_info (const CoreString &info)
 Sets header's last line text.
 
virtual bool is_animatable () const
 
void set_animatable (const bool &value)
 
virtual float get_animated_scale () const
 
const unsigned int & get_dependency_count () const
 
void set_dependency_count (const unsigned int &value)
 
void ask_dependencies_update (const bool &value)
 
const unsigned int & get_references_count () const
 
void set_references_count (const unsigned int &value)
 
bool is_embedded () const
 
GuiNodalNodeget_embedded_node () const
 
GMathVec2i get_position () const override
 Override to ensure stability of node center:
 
void set_position (const GMathVec2i &pos) override
 Override to ensure stability of node center:
 
void switch_position ()
 Change y position in order to ensure stability of node center (header top bar vanishes in simplified layout)
 
void apply_graph_layout ()
 Tune node aspect depending on omnidirectional or legacy graph layout.
 
virtual void center_icon (bool centered)
 
void set_color (const GMathVec3uc &color)
 Sets background/selected/highlight colors as requested, compute border color accordingly.
 
bool is_expanded_folder () const
 
GMathVec2i get_expanded_folder_content_offset () const
 
virtual bool can_accept_child_node () const
 
void select_child (GuiNodalNodeBase &child)
 Manage ordered list of children: last selected on top.
 
void focus_child (GuiNodalNodeBase *child)
 Manage ordered list of children: temporarily focused on top.
 
void draw_select_with_mmb (GuiDc &dc) override
 Implement MMB/RMB picking for expanded container node: the whole node area is sensible.
 
- Public Member Functions inherited from GuiNodalNodeBase
 GuiNodalNodeBase (GuiNodalNodeBase *parent, GuiNodal &graph, const int &x=0, const int &y=0, const unsigned int &active_anchors=NODE_ANCHOR_LEFT)
 Constructor.
 
 ~GuiNodalNodeBase () override
 Destructor.
 
GuiNodalNodeBaseget_parent () const
 
GuiNodalNodeget_parent_node () const
 Returns parent node.
 
void set_parent (GuiNodalNodeBase *parent)
 Sets parent node.
 
bool is_child_of (const GuiNodalNodeBase &node) const
 
const int & get_computed_width () const
 
const int & get_computed_height () const
 
void set_computed_width (const int &width)
 
void set_computed_height (const int &height)
 
void set_local_pos (const GMathVec2i &pos)
 
void set_local_x (const int &x)
 
void set_local_y (const int &y)
 
const int & get_local_x () const
 
const int & get_local_y () const
 
const int & get_world_x () const
 
const int & get_world_y () const
 
const GMathVec2i & get_local_pos () const
 
const GMathVec2i & get_world_pos () const
 
virtual void set_center (const GMathVec2i &pos)
 
virtual GMathVec2i get_center ()
 
int get_default_input_dx () const
 
virtual int get_in_link_x () const
 
virtual int get_in_link_y () const
 
virtual int get_out_link_x () const
 
virtual int get_out_link_y () const
 
const int get_border_size () const
 
void set_border_size (const int &size)
 
const GMathVec3uc & get_border_color () const
 
void set_border_color (const GMathVec3uc &color)
 
void draw_round_rect (const GuiWidget::Roundness &roundness, const int &x, const int &y, const int &w, const int &h, const bool &filled=true)
 Draws a round rect.
 
void draw_thick_ring (double radius, double thickness)
 Draws a thick circle at current gl position, using current gl color.
 
void draw_thick_frame (int x, int y, int w, int h, double thickness, GuiWidget::Roundness roundness=GuiWidget::ROUNDNESS_NONE)
 Draws a thick round frame at current gl position, using current gl color.
 
GuiNodalNodeZoneAnchorget_anchor (const NodeAnchor &anchor)
 
GuiNodalNodeZoneAnchorget_anchor (unsigned int side) const
 
GuiNodalNodeZoneAnchorget_left_anchor () const
 
GuiNodalNodeZoneAnchorget_right_anchor () const
 
GuiNodalNodeZoneAnchorget_up_anchor () const
 
GuiNodalNodeZoneAnchorget_bottom_anchor () const
 
void set_anchor_disabled (bool disabled)
 
bool get_anchor_is_active (const NodeAnchor &anchor) const
 
void activate_anchor (const GuiNodalNodeBase::NodeAnchor &anchor)
 Activates incoming anchor.
 
void desactivate_anchor (const GuiNodalNodeBase::NodeAnchor &anchor)
 Desactivates incoming anchor.
 
void set_anchors_color (const GMathVec3uc &color)
 
void set_text_normal_color (const GMathVec3uc &color)
 
void set_text_selected_color (const GMathVec3uc &color)
 
void set_text_disabled_color (const GMathVec3uc &color)
 
const GMathVec3uc & get_text_normal_color () const
 
const GMathVec3uc & get_text_selected_color () const
 
const GMathVec3uc & get_text_highlight_color () const
 
const GMathVec3uc & get_text_disabled_color () const
 
const GMathVec3uc & get_text_color () const
 
virtual float get_custom_depth () const
 
unsigned int get_depth () const
 
void set_is_highlighted (const bool &value) override
 
bool get_is_highlighted () const override
 
bool is_collapsed () const
 
void set_collapsed (const bool &value)
 
bool is_guest_input () const
 
void set_guest_input (bool value)
 
bool get_is_fading_in () const
 
bool get_is_fading_out () const
 
bool get_is_fading () const
 
bool get_is_selected () const
 
bool get_is_preselected () const
 
virtual void set_is_preselected (const bool &value)
 
bool get_is_disabled () const
 
bool get_is_ghost () const
 
const float & get_scale () const
 
virtual void set_scale (const float &scale)
 
void set_draw_state (const ItemDrawState &state) override
 
virtual void move (const int &d_x, const int &d_y)
 Changes position by a delta.
 
virtual void move_to (const int &x, const int &y)
 Changes position.
 
const unsigned int & get_states () const
 
bool get_state_is_active (const GuiNodalNodeBase::NodeState &state) const
 
void activate_state (const GuiNodalNodeBase::NodeState &state)
 
void desactivate_state (const GuiNodalNodeBase::NodeState &state)
 
virtual void set_is_hidden (bool hidden, const bool &recursive=true)
 
bool get_is_hidden () const
 
void add_link (GuiNodalLink *link)
 
void remove_link (GuiNodalLink *link)
 
void set_screen_size (bool is_screen_size)
 
const bool & is_screen_size () const
 
virtual bool can_begin_link_creation ()
 
virtual bool can_begin_link_destruction (const GuiNodalLink &link)
 
const CoreVector
< GuiNodalNodeBase * > & 
get_children () const
 
void get_connexity (CoreVector< GuiNodalLink * > &links) const
 Fills a vector with all links connected to this node and to any of its children.
 
void get_connexity_from (CoreVector< GuiNodalLink * > &links) const
 gets the number of incoming links connected to this node and to any of its children
 
void get_connexity_to (CoreVector< GuiNodalLink * > &links) const
 gets the number of outgoing links connected to this node and to any of its children
 
const bool & get_propagate_highlight () const
 
void set_propagate_highlight (const bool &propagate)
 
void set_delta_out_link (const int &dx, const int &dy)
 
void set_delta_in_link (const int &dx, const int &dy)
 
const GMathVec2i & get_delta_out_link () const
 
- Public Member Functions inherited from GuiNodalItem
 GuiNodalItem (GuiNodal &graph)
 
const GMathVec3uc & get_select_color () const
 
void set_selectable ()
 
GuiNodalget_graph () const
 
void set_bg_normal_color (const GMathVec3uc &color)
 
void set_bg_highlight_color (const GMathVec3uc &color)
 
void set_bg_selected_color (const GMathVec3uc &color)
 
void set_bg_disabled_color (const GMathVec3uc &color)
 
void set_bg_colors (const GMathVec3uc &normal, const GMathVec3uc &highlight, const GMathVec3uc &selected)
 
const GMathVec3uc & get_bg_normal_color () const
 
const GMathVec3uc & get_bg_highlight_color () const
 
const GMathVec3uc & get_bg_disabled_color () const
 
const GMathVec3uc & get_bg_selected_color () const
 
const GMathVec3uc & get_bg_color () const
 
void set_bg_color (const GMathVec3uc &color)
 
bool get_is_culled () const
 
const ItemDrawState & get_draw_state ()
 
bool get_is_dirty () const
 
- 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
 
virtual size_t get_memory_size () const override
 
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 void pick_folders (GuiDc &dc, const CoreSet< GuiNodalNode * > &folders)
 
- Static Public Member Functions inherited from GuiNodalNodeBase
static CoreString get_node_anchor_name (const NodeAnchor &anchor)
 
static CoreString get_node_state_name (const NodeState &state)
 
static void compute_border_color (const GMathVec3d &src, GMathVec3uc &dst, bool force_darker=false, float diff_factor=0.6f)
 
static void adjust_color (GMathVec3uc rgb, bool use_ghost_alpha, bool use_passthrough_alpha=false)
 

Protected Member Functions

void remove_child (GuiNodalNodeBase &child) override
 Override to manage ordered list of children.
 
void add_child (GuiNodalNodeBase &child) override
 Override to manage ordered list of children.
 
virtual void update_self_plugs (GuiDc &dc)
 
bool is_self_anchor (GuiNodalNodeZone &zone) const
 
void on_references_activate (GuiNodalNode &sender, const EventInfo &evt, void *data)
 
void on_dependencies_activate (GuiNodalNode &sender, const EventInfo &evt, void *data)
 
GuiNodalNodeZoneButtonget_references_button () const
 
GuiNodalNodeZoneButtonget_dependencies_button () const
 
const bool & get_dependencies_update_asked ()
 
virtual GuiWidget::Roundness get_roundness (bool picking) const
 
void set_embedded_node (GuiNodalNode *node)
 
void set_centered_icon ()
 
void unset_centered_icon ()
 
bool is_centered_icon ()
 
void turn_header_to_footer (bool footer)
 
void _draw_children (GuiDc &dc)
 
bool start_fading ()
 Initiate node fading.
 
int get_min_width () const
 
int get_min_height () const
 
void set_width (const int &w)
 
void set_height (const int &h)
 
void setup_gl_location () const
 
- Protected Member Functions inherited from GuiNodalNodeBase
int get_links_count () const
 
GuiNodalLinkget_link (int pos) const
 
const CoreVector< GuiNodalLink * > & get_links () const
 
void remove_links ()
 
void dirty_links ()
 
void compute_world_pos ()
 Computes world position and asks for children world position computation.
 
const bool & get_world_pos_is_dirty ()
 
void set_world_pos_is_dirty (const bool &value)
 

Protected Attributes

const GMathVec3uc * m_title_bg_color
 
GMathVec3uc m_title_normal_bg_color
 
GMathVec3uc m_title_selected_bg_color
 

Additional Inherited Members

- Static Protected Attributes inherited from GuiNodalNodeBase
static unsigned int m_ghost_alpha = 96
 
static unsigned int m_passthrough_alpha = 24
 

Detailed Description

Defines a GuiNodalNode, displaying a node in a GuiNodal.

Constructor & Destructor Documentation

GuiNodalNode::GuiNodalNode ( GuiNodal nodal,
const CoreString label,
const int &  x = 0,
const int &  y = 0,
const unsigned int &  active_anchors = NODE_ANCHOR_LEFT 
)

Constructor.

Parameters
[in]nodal
[in]labelnode label
[in]xx coordinate
[in]yy coordinate
[in]active_anchorsdisplayed visual anchors (connectors)

Member Function Documentation

void GuiNodalNode::get_bbox ( GMathVec2i &  tl,
GMathVec2i &  br 
) const
overridevirtual

Computes world bounding box.

Override to care about decorations such as plugs or folder shape When in omnidirectional layout, also cares about position offset (node autozooms around its center)

Reimplemented from GuiNodalNodeBase.

GMathVec2i GuiNodalNode::get_position ( ) const
overridevirtual

Override to ensure stability of node center:

  • header top bar vanishes in simplified layout
  • for expanded folder, return node position as when collapsed.
    Returns
    node position when displayed in full mode and not expanded

Reimplemented from GuiNodalNodeBase.

void GuiNodalNode::set_position ( const GMathVec2i &  pos)
overridevirtual

Override to ensure stability of node center:

  • header top bar vanishes in simplified layout
  • for expanded folder, node position is top left corner.
    Parameters
    posnode position when displayed in full mode and not expanded

Reimplemented from GuiNodalNodeBase.