Skip to content

DIWNE::DiwneObject

All objects in DIWNE are inherited from DiwneObjectDiwneObject covers the functionality common to all Objects in the node editor - such as selecting, dragging, hovering,...

#include "DIWNE/DiwneObject.h"

Inherits from std::enable_shared_from_this< DiwneObject >

Inherited by DIWNE::Diwne, DIWNE::Link, DIWNE::Node, DIWNE::Pin

Public Functions

Name
DiwneObject(DIWNE::Diwne & diwne, DIWNE::ID id, std::string const labelDiwne)<br>Constructor.
virtual~DiwneObject() =default
virtual boolafterContent()
virtual boolafterContentDiwne()
virtual boolafterEnd()
virtual boolafterEndDiwne()
virtual boolallowDrawing()<br>Decision maker whether object should be drawn (not outside of window for example)
virtual boolallowInteraction()<br>Decision maker whether object can interact (not include content elements)
virtual boolallowProcessDrag()
virtual boolallowProcessFocused()
virtual boolallowProcessFocusedForInteraction()
virtual boolallowProcessHold()
virtual boolallowProcessRaisePopup()
virtual boolallowProcessSelect()
virtual boolallowProcessUnhold()
virtual boolallowProcessUnselect()
virtual boolbeforeBegin()
virtual boolbeforeBeginDiwne()
virtual boolbeforeContent()
virtual boolbeforeContentDiwne()
virtual voidbegin() =0
virtual boolbypassDragAction()
virtual boolbypassFocusAction()
virtual boolbypassFocusForInteractionAction()
virtual boolbypassHoldAction()
virtual boolbypassRaisePopupAction()
virtual boolbypassSelectAction()
virtual boolbypassTouchAction()
virtual boolbypassUnholdAction()
virtual boolbypassUnselectAction()
virtual boolcontent()
virtual boolcontentDiwne()
virtual booldrawDiwne(DrawMode drawMode =DrawMode::Interacting)<br>Main function for drawing object and deal with interactions.
virtual voidend() =0
virtual boolfinalize()
virtual boolfinalizeDiwne()
virtual DIWNE::DiwneActiongetDragActionType() const =0
virtual DIWNE::DiwneActiongetHoldActionType() const =0
DIWNE::ID constgetIdDiwne() const
virtual ImRectgetRectDiwne() const =0
virtual boolgetSelectable()
virtual boolgetSelected() const<br>Getter of selection state.
virtual DIWNE::DiwneActiongetTouchActionType() const =0
virtual boolinitialize()
virtual boolinitializeDiwne()
virtual boolinteractionBeginInLastDraw()
virtual boolinteractionEndInLastDraw()
virtual voidpopupContent()<br>Content of popup menu raise on this object.
virtual boolprocessDrag()
virtual boolprocessFocused()
virtual boolprocessFocusedForInteraction()
virtual boolprocessHold()
virtual boolprocessInteractions()
virtual boolprocessInteractionsAlways()
virtual boolprocessInteractionsDiwne()
virtual boolprocessObjectDrag()
virtual boolprocessObjectFocused()
virtual boolprocessObjectFocusedForInteraction()
virtual boolprocessObjectHold()
virtual boolprocessObjectSelect()
virtual boolprocessObjectUnhold()
virtual boolprocessObjectUnselect()
virtual boolprocessRaisePopupDiwne()
virtual boolprocessSelect()
virtual boolprocessShowPopupDiwne()
virtual boolprocessUnhold()
virtual boolprocessUnselect()
virtual voidsetSelectable(bool const selectable)
virtual boolsetSelected(bool const selected)
voidshowTooltipLabel(std::string const & label, ImColor const && color)<br>Show a colored text for example for immediate hints.
virtual voidupdateSizes()

Public Attributes

Name
DIWNE::Diwne &diwne
DrawModem_drawMode
boolm_focused
boolm_focusedForInteraction
DIWNE::ID constm_idDiwne
boolm_inner_interaction_happen
boolm_inner_interaction_happen_previous_draw
boolm_isActive
boolm_isDragged
boolm_isHeld
std::string constm_labelDiwne
std::string constm_popupIDDiwne
boolm_selectable
boolm_selected

Public Functions Documentation

function DiwneObject

cpp
DiwneObject(
    DIWNE::Diwne & diwne,
    DIWNE::ID id,
    std::string const labelDiwne
)
DiwneObject(
    DIWNE::Diwne & diwne,
    DIWNE::ID id,
    std::string const labelDiwne
)

Constructor.

Parameters:

  • diwne is node editor object that this object belongs to
  • id used to identification
  • labelDiwne used to identification

function ~DiwneObject

cpp
virtual ~DiwneObject() =default
virtual ~DiwneObject() =default

function afterContent

cpp
virtual bool afterContent()
virtual bool afterContent()

Reimplemented by: WorkspaceSequence::afterContent, WorkspaceTransformation::afterContent, WorkspaceDiwne::afterContent

is called as last inside object

function afterContentDiwne

cpp
virtual bool afterContentDiwne()
virtual bool afterContentDiwne()

Reimplemented by: DIWNE::Diwne::afterContentDiwne

DIWNE wrapper

function afterEnd

cpp
virtual bool afterEnd()
virtual bool afterEnd()

Reimplemented by: WorkspaceDiwne::afterEnd

is called after closing object, sizes are updated already

function afterEndDiwne

cpp
virtual bool afterEndDiwne()
virtual bool afterEndDiwne()

Reimplemented by: DIWNE::Diwne::afterEndDiwne, DIWNE::Node::afterEndDiwne

DIWNE wrapper

function allowDrawing

cpp
virtual bool allowDrawing()
virtual bool allowDrawing()

Decision maker whether object should be drawn (not outside of window for example)

Return: draw object on its position?

Reimplemented by: DIWNE::Diwne::allowDrawing, WorkspaceSequence::allowDrawing, DIWNE::Node::allowDrawing, WorkspaceTransformation::allowDrawing

function allowInteraction

cpp
virtual bool allowInteraction()
virtual bool allowInteraction()

Decision maker whether object can interact (not include content elements)

Return: can this object interact?

function allowProcessDrag

cpp
virtual bool allowProcessDrag()
virtual bool allowProcessDrag()

function allowProcessFocused

cpp
virtual bool allowProcessFocused()
virtual bool allowProcessFocused()

Reimplemented by: DIWNE::Diwne::allowProcessFocused

function allowProcessFocusedForInteraction

cpp
virtual bool allowProcessFocusedForInteraction()
virtual bool allowProcessFocusedForInteraction()

function allowProcessHold

cpp
virtual bool allowProcessHold()
virtual bool allowProcessHold()

function allowProcessRaisePopup

cpp
virtual bool allowProcessRaisePopup()
virtual bool allowProcessRaisePopup()

function allowProcessSelect

cpp
virtual bool allowProcessSelect()
virtual bool allowProcessSelect()

function allowProcessUnhold

cpp
virtual bool allowProcessUnhold()
virtual bool allowProcessUnhold()

function allowProcessUnselect

cpp
virtual bool allowProcessUnselect()
virtual bool allowProcessUnselect()

function beforeBegin

cpp
virtual bool beforeBegin()
virtual bool beforeBegin()

Reimplemented by: WorkspaceTransformation::beforeBegin, WorkspaceDiwne::beforeBegin

is called before begin of object drawing (but after allowDrawing() decision)

function beforeBeginDiwne

cpp
virtual bool beforeBeginDiwne()
virtual bool beforeBeginDiwne()

Reimplemented by: DIWNE::Diwne::beforeBeginDiwne, DIWNE::Node::beforeBeginDiwne

DIWNE wrapper

function beforeContent

cpp
virtual bool beforeContent()
virtual bool beforeContent()

Reimplemented by: WorkspaceOperator::beforeContent, WorkspaceOperator::beforeContent, WorkspaceSequence::beforeContent, WorkspaceNode::beforeContent, WorkspaceTransformation::beforeContent, WorkspaceDiwne::beforeContent

is called first inside of object

function beforeContentDiwne

cpp
virtual bool beforeContentDiwne()
virtual bool beforeContentDiwne()

DIWNE wrapper

function begin

cpp
virtual void begin() =0
virtual void begin() =0

Reimplemented by: DIWNE::Diwne::begin, DIWNE::Link::begin, DIWNE::Node::begin, DIWNE::Pin::begin

begin of object

function bypassDragAction

cpp
virtual bool bypassDragAction()
virtual bool bypassDragAction()

Reimplemented by: WorkspaceDiwne::bypassDragAction

action used for dragging object

function bypassFocusAction

cpp
virtual bool bypassFocusAction()
virtual bool bypassFocusAction()

Reimplemented by: DIWNE::Link::bypassFocusAction

action identified as focusing on object (and prevent underlying object from focusing)

function bypassFocusForInteractionAction

cpp
virtual bool bypassFocusForInteractionAction()
virtual bool bypassFocusForInteractionAction()

Reimplemented by: DIWNE::Link::bypassFocusForInteractionAction, WorkspaceNode::bypassFocusForInteractionAction, WorkspaceCorePin::bypassFocusForInteractionAction

action identified as focusing on object for interacting with it

function bypassHoldAction

cpp
virtual bool bypassHoldAction()
virtual bool bypassHoldAction()

Reimplemented by: WorkspaceDiwne::bypassHoldAction

action used for holding object (check only if object is not held)

function bypassRaisePopupAction

cpp
virtual bool bypassRaisePopupAction()
virtual bool bypassRaisePopupAction()

action used for raising popup menu

function bypassSelectAction

cpp
virtual bool bypassSelectAction()
virtual bool bypassSelectAction()

action used for selecting object

function bypassTouchAction

cpp
virtual bool bypassTouchAction()
virtual bool bypassTouchAction()

action used for touching object - not interact with it, just move it to front of other objects

function bypassUnholdAction

cpp
virtual bool bypassUnholdAction()
virtual bool bypassUnholdAction()

Reimplemented by: WorkspaceDiwne::bypassUnholdAction

action used for unholding object (check only if object is held)

function bypassUnselectAction

cpp
virtual bool bypassUnselectAction()
virtual bool bypassUnselectAction()

action used for unselecting object

function content

cpp
virtual bool content()
virtual bool content()

Reimplemented by: DIWNE::Link::content, DIWNE::Pin::content, DIWNE::Node::content, WorkspaceCorePin::content, WorkspaceCoreInputPin::content, WorkspaceCoreOutputPin::content, WorkspaceCoreOutputPinWithData::content, WorkspaceDiwne::content

content of object

function contentDiwne

cpp
virtual bool contentDiwne()
virtual bool contentDiwne()

DIWNE wrapper

function drawDiwne

cpp
virtual bool drawDiwne(
    DrawMode drawMode =DrawMode::Interacting
)
virtual bool drawDiwne(
    DrawMode drawMode =DrawMode::Interacting
)

Main function for drawing object and deal with interactions.

Parameters:

  • drawMode allows interactions with object

Return: true if some interaction with object (or inner of this object) happen, false otherwise

Reimplemented by: WorkspaceCoreInputPin::drawDiwne

function end

cpp
virtual void end() =0
virtual void end() =0

Reimplemented by: DIWNE::Diwne::end, DIWNE::Link::end, DIWNE::Node::end, DIWNE::Pin::end

closing object

function finalize

cpp
virtual bool finalize()
virtual bool finalize()

Reimplemented by: WorkspaceNodeWithCoreDataWithPins::finalize, WorkspaceDiwne::finalize

is called every time in drawDiwne() do any finalization of your object here

function finalizeDiwne

cpp
virtual bool finalizeDiwne()
virtual bool finalizeDiwne()

Reimplemented by: DIWNE::Diwne::finalizeDiwne

DIWNE wrapper

function getDragActionType

cpp
virtual DIWNE::DiwneAction getDragActionType() const =0
virtual DIWNE::DiwneAction getDragActionType() const =0

Reimplemented by: DIWNE::Diwne::getDragActionType, DIWNE::Link::getDragActionType, DIWNE::Node::getDragActionType, DIWNE::Pin::getDragActionType

return which type of object/action this object is

function getHoldActionType

cpp
virtual DIWNE::DiwneAction getHoldActionType() const =0
virtual DIWNE::DiwneAction getHoldActionType() const =0

Reimplemented by: DIWNE::Diwne::getHoldActionType, DIWNE::Link::getHoldActionType, DIWNE::Node::getHoldActionType, DIWNE::Pin::getHoldActionType

return which type of object/action this object is

function getIdDiwne

cpp
inline DIWNE::ID const getIdDiwne() const
inline DIWNE::ID const getIdDiwne() const

function getRectDiwne

cpp
virtual ImRect getRectDiwne() const =0
virtual ImRect getRectDiwne() const =0

Reimplemented by: DIWNE::Diwne::getRectDiwne, DIWNE::Link::getRectDiwne, DIWNE::Node::getRectDiwne, DIWNE::Pin::getRectDiwne

return rectangle of object

function getSelectable

cpp
inline virtual bool getSelectable()
inline virtual bool getSelectable()

function getSelected

cpp
inline virtual bool getSelected() const
inline virtual bool getSelected() const

Getter of selection state.

Return: Current selection state of the object.

function getTouchActionType

cpp
virtual DIWNE::DiwneAction getTouchActionType() const =0
virtual DIWNE::DiwneAction getTouchActionType() const =0

Reimplemented by: DIWNE::Diwne::getTouchActionType, DIWNE::Link::getTouchActionType, DIWNE::Node::getTouchActionType, DIWNE::Pin::getTouchActionType

return which type of object/action this object is

function initialize

cpp
virtual bool initialize()
virtual bool initialize()

Reimplemented by: DIWNE::Link::initialize

is called every time in drawDiwne() do any initialization of your object here

function initializeDiwne

cpp
virtual bool initializeDiwne()
virtual bool initializeDiwne()

Reimplemented by: DIWNE::Diwne::initializeDiwne, DIWNE::Link::initializeDiwne

DIWNE wrapper

function interactionBeginInLastDraw

cpp
inline virtual bool interactionBeginInLastDraw()
inline virtual bool interactionBeginInLastDraw()

function interactionEndInLastDraw

cpp
inline virtual bool interactionEndInLastDraw()
inline virtual bool interactionEndInLastDraw()

function popupContent

cpp
virtual void popupContent()
virtual void popupContent()

Content of popup menu raise on this object.

Reimplemented by: WorkspaceNode::popupContent, WorkspaceModel::popupContent, WorkspaceSequence::popupContent, WorkspaceCamera::popupContent, WorkspaceNodeWithCoreData::popupContent, WorkspaceCorePin::popupContent, WorkspaceScreen::popupContent, WorkspaceTransformation::popupContent, WorkspaceDiwne::popupContent

function processDrag

cpp
virtual bool processDrag()
virtual bool processDrag()

Reimplemented by: DIWNE::Diwne::processDrag, DIWNE::Node::processDrag, DIWNE::Pin::processDrag, WorkspaceCorePin::processDrag

function processFocused

cpp
virtual bool processFocused()
virtual bool processFocused()

Reimplemented by: DIWNE::Link::processFocused

function processFocusedForInteraction

cpp
virtual bool processFocusedForInteraction()
virtual bool processFocusedForInteraction()

Reimplemented by: DIWNE::Link::processFocusedForInteraction

function processHold

cpp
virtual bool processHold()
virtual bool processHold()

function processInteractions

cpp
virtual bool processInteractions()
virtual bool processInteractions()

Reimplemented by: DIWNE::Diwne::processInteractions, WorkspaceCoreInputPin::processInteractions

react to interactions with this object

function processInteractionsAlways

cpp
virtual bool processInteractionsAlways()
virtual bool processInteractionsAlways()

Reimplemented by: DIWNE::Pin::processInteractionsAlways

processes that happen even in allowInteraction() return false, but object still has to be in DrawMode::Interaction

function processInteractionsDiwne

cpp
virtual bool processInteractionsDiwne()
virtual bool processInteractionsDiwne()

Reimplemented by: DIWNE::Diwne::processInteractionsDiwne

DIWNE wrapper

function processObjectDrag

cpp
virtual bool processObjectDrag()
virtual bool processObjectDrag()

Reimplemented by: WorkspaceNodeWithCoreData::processObjectDrag

function processObjectFocused

cpp
virtual bool processObjectFocused()
virtual bool processObjectFocused()

function processObjectFocusedForInteraction

cpp
virtual bool processObjectFocusedForInteraction()
virtual bool processObjectFocusedForInteraction()

function processObjectHold

cpp
virtual bool processObjectHold()
virtual bool processObjectHold()

function processObjectSelect

cpp
virtual bool processObjectSelect()
virtual bool processObjectSelect()

function processObjectUnhold

cpp
virtual bool processObjectUnhold()
virtual bool processObjectUnhold()

function processObjectUnselect

cpp
virtual bool processObjectUnselect()
virtual bool processObjectUnselect()

function processRaisePopupDiwne

cpp
virtual bool processRaisePopupDiwne()
virtual bool processRaisePopupDiwne()

processing raising popup menu

function processSelect

cpp
virtual bool processSelect()
virtual bool processSelect()

Reimplemented by: DIWNE::Node::processSelect, WorkspaceCamera::processSelect, WorkspaceNodeWithCoreData::processSelect, WorkspaceModel::processSelect

function processShowPopupDiwne

cpp
virtual bool processShowPopupDiwne()
virtual bool processShowPopupDiwne()

processing showing popup menu

function processUnhold

cpp
virtual bool processUnhold()
virtual bool processUnhold()

function processUnselect

cpp
virtual bool processUnselect()
virtual bool processUnselect()

Reimplemented by: DIWNE::Node::processUnselect, WorkspaceCamera::processUnselect, WorkspaceNodeWithCoreData::processUnselect, WorkspaceModel::processUnselect

function setSelectable

cpp
inline virtual void setSelectable(
    bool const selectable
)
inline virtual void setSelectable(
    bool const selectable
)

function setSelected

cpp
inline virtual bool setSelected(
    bool const selected
)
inline virtual bool setSelected(
    bool const selected
)

Parameters:

  • selected is the new requested state of the object

Return: New state of selection

Reimplemented by: DIWNE::Node::setSelected

Setter of selection state

function showTooltipLabel

cpp
void showTooltipLabel(
    std::string const & label,
    ImColor const && color
)
void showTooltipLabel(
    std::string const & label,
    ImColor const && color
)

Show a colored text for example for immediate hints.

Parameters:

  • label is the text to show
  • color is the color of the tooltip

function updateSizes

cpp
virtual void updateSizes()
virtual void updateSizes()

Reimplemented by: DIWNE::Node::updateSizes, DIWNE::Pin::updateSizes, WorkspaceTransformation::updateSizes

store object size and position after this frame

Public Attributes Documentation

variable diwne

cpp
DIWNE::Diwne & diwne;
DIWNE::Diwne & diwne;

Every object have access to Diwne - is used for share information if needed

variable m_drawMode

cpp
DrawMode m_drawMode;
DrawMode m_drawMode;

See: enum DrawMode

variable m_focused

cpp
bool m_focused;
bool m_focused;

Is object focused anywhere (and for example can not be¨focus other underlying object)

variable m_focusedForInteraction

cpp
bool m_focusedForInteraction;
bool m_focusedForInteraction;

Is object focus on area that allow interaction with object

variable m_idDiwne

cpp
DIWNE::ID const m_idDiwne;
DIWNE::ID const m_idDiwne;

Used for creating ImGui id/labels

variable m_inner_interaction_happen

cpp
bool m_inner_interaction_happen;
bool m_inner_interaction_happen;

variable m_inner_interaction_happen_previous_draw

cpp
bool m_inner_interaction_happen_previous_draw;
bool m_inner_interaction_happen_previous_draw;

If some interaction happen with inner elements (DragFloat, Button, ...) it block interaction with this object

variable m_isActive

cpp
bool m_isActive;
bool m_isActive;

Something happen with object

variable m_isDragged

cpp
bool m_isDragged;
bool m_isDragged;

Is object dragged

variable m_isHeld

cpp
bool m_isHeld;
bool m_isHeld;

Is object held. When dragged it is still held.

variable m_labelDiwne

cpp
std::string const m_labelDiwne;
std::string const m_labelDiwne;

Used for identifying object and creating ImGui id/labels

variable m_popupIDDiwne

cpp
std::string const m_popupIDDiwne;
std::string const m_popupIDDiwne;

Used for identifying what element raise popup

variable m_selectable

cpp
bool m_selectable;
bool m_selectable;

variable m_selected

cpp
bool m_selected;
bool m_selected;

Is object selected


Updated on 2024-03-16 at 19:15:01 +0000