C++ API Reference: MTimeSliderCustomDrawManager Class Reference
Introduced in 2023.0
More...
#include <MTimeSliderCustomDrawManager.h>
MTimeSliderCustomDrawManager ()
MTimeSliderCustomDrawManager represents a singleton on which you can register multiple draw context Each context is represented by an integer value. More...
~MTimeSliderCustomDrawManager ()
MTimeSliderCustomDrawManager destructor.
MCustomDrawID registerCustomDrawOn (const MString &name, int drawLayer)
Will create a context to draw primitive on the timeline itself. More...
MCustomDrawID registerCustomDrawOutside (MDrawLocation loc, const MString &name, const MString &tooltip, int drawPriority, int height=kUseDefaultHeight)
Will create a context to draw primitive above/below the timeline. More...
void deregisterCustomDraw (MCustomDrawID id)
Will destroy the previously created context along with all its primitives. More...
void clearDrawPrimitives (MCustomDrawID id)
Remove all primitives set on the draw context. More...
void setDrawPrimitives (MCustomDrawID id, const MTimeSliderDrawPrimitives &prims)
Set all the primitives to be displayed on the timeline for this context. More...
void setDrawPrimitives (MCustomDrawID id, MTimeSliderDrawPrimitives &&prims)
Move all the primitives to be displayed on the timeline for this conte. More...
void setDrawVisible (MCustomDrawID id, bool vis)
Change the visibility of the draw context. More...
void setDrawLayer (MCustomDrawID id, int drawLayer)
Set layer for this context to control overlapping context. More...
void setDrawHeight (MCustomDrawID id, int height)
Set layer for this context to control overlapping context. More...
void setDrawLocation (MCustomDrawID id, MDrawLocation loc)
Change draw location for the specified context. More...
void setDrawPriority (MCustomDrawID id, int drawPriority)
Change the order of drawing for all the context above or below Only valid for draw objects that have location of 'above' and 'below'. More...
void setTooltip (MCustomDrawID id, const MString &tooltip)
Change the tooltip for the context. More...
void setStartPrimitiveEditFunction (MCustomDrawID id, MSharedPtr < MStartPrimitiveEditingFct > fct)
Set the callback to be called to start editing primitive. More...
void setEditPrimitiveFunction (MCustomDrawID id, MSharedPtr < MEditPrimitiveFct > fct)
Set the callback to be called while editing primitive. More...
void setStopPrimitiveEditFunction (MCustomDrawID id, MSharedPtr < MStopPrimitiveEditingFct > fct)
Set the callback to be called to stop editing primitive. More...
void setBackgroundColor (MCustomDrawID id, MColor color)
Change the background color reserved for the specified context. More...
void requestTimeSliderRedraw () const
Force redraw of all primitives in all contexts. More...
bool empty () const
Returns true if no primitives are set on any context. More...
Introduced in 2023.0
2023.0: Introduced in this version.
MTimeSliderCustomDrawManager represents a singleton on which you can register multiple draw context Each context is represented by an integer value.
Use the draw context and provide primitives to draw custom drawings on the time line. All the instance of MTimeSliderCustomDrawManager use the same service. no need to keep a copy of this object.
MTimeSliderCustomDrawManager::MCustomDrawID registerCustomDrawOn
(
const MString &
name ,
int
drawLayer
)
Will create a context to draw primitive on the timeline itself.
The Location of the primitives will be specified by kOn.
Parameters
name Name of the context.
drawLayer When drawing on the timeline, multiple context can draw on the same time range, layer set the priority.
Returns Context that must be pass to all functions that modifies this context.
MTimeSliderCustomDrawManager::MCustomDrawID registerCustomDrawOutside
(
MDrawLocation
loc ,
const MString &
name ,
const MString &
tooltip ,
int
drawPriority ,
int
height = kUseDefaultHeight
)
Will create a context to draw primitive above/below the timeline.
Parameters
location kAbove or kBelow. For kOn use registerCustomDrawOn.
name Name of the context.
tooltip To be shown when hovering mouse over the reserved space.
drawPriority Determine the order above/below the timeline.
height Height of the reserved space.
Returns Context that must be pass to all function that modify this context.
void deregisterCustomDraw
(
MCustomDrawID
id )
Will destroy the previously created context along with all its primitives.
Parameters
id Context to be unregistered.
void clearDrawPrimitives
(
MCustomDrawID
id )
Remove all primitives set on the draw context.
Parameters
id The context returned by one of the register functions.
Set all the primitives to be displayed on the timeline for this context.
Parameters
id The context returned by one of the register functions.
prims Arrays of primitives to be set.
Move all the primitives to be displayed on the timeline for this conte.
Parameters
id The context returned by one of the register functions.
prims Array of primitives to be moved.
void setDrawVisible
(
MCustomDrawID
id ,
bool
vis
)
Change the visibility of the draw context.
Parameters
id The context returned by one of the register functions.
vis The visibility of the context: true/false for visible/invisible.
void setDrawLayer
(
MCustomDrawID
id ,
int
drawLayer
)
Set layer for this context to control overlapping context.
Parameters
id The context returned by one of the register functions.
drawLayer The highest number will be on top.
void setDrawHeight
(
MCustomDrawID
id ,
int
height
)
Set layer for this context to control overlapping context.
Parameters
id The context returned by one of the register functions.
height Height of the drawing zone for this context.
void setDrawLocation
(
MCustomDrawID
id ,
MDrawLocation
loc
)
Change draw location for the specified context.
Parameters
id The context returned by one of the register functions.
loc Location to draw for the specified context.
void setDrawPriority
(
MCustomDrawID
id ,
int
drawPriority
)
Change the order of drawing for all the context above or below Only valid for draw objects that have location of 'above' and 'below'.
Parameters
id The context returned by one of the register functions.
drawPriority The drawPriority determine what is the order context of above or below will be drawn.
void setTooltip
(
MCustomDrawID
id ,
const MString &
tooltip
)
Change the tooltip for the context.
The tooltip will be shown when hovering the mouse over the context reserved space.
Parameters
id The context returned by one of the register functions.
tooltip The tooltip to be shown on mouse hover.
Set the callback to be called to start editing primitive.
Parameters
id The context returned by one of the register functions.
fct The callback to be triggered.
Set the callback to be called while editing primitive.
Parameters
id The context returned by one of the register functions.
fct The callback to be triggered.
Set the callback to be called to stop editing primitive.
Parameters
id The context returned by one of the register functions.
fct The callback to be triggered.
void setBackgroundColor
(
MCustomDrawID
id ,
MColor
color
)
Change the background color reserved for the specified context.
Parameters
id The context returned by one of the register functions.
color The color to be set as background.
void requestTimeSliderRedraw
(
)
const
Force redraw of all primitives in all contexts.
After all the modifications are done, request a draw to update the timeline.
Returns true if no primitives are set on any context.
Returns true if no primitives are set on any context.
The documentation for this class was generated from the following files:
MTimeSliderCustomDrawManager.h
MTimeSliderCustomDrawManager.cpp