NAP
Public Member Functions | List of all members
SequenceEventTrackSegmentView< T > Class Template Referencefinal

#include <sequenceeventtrackview.h>

Public Member Functions

 SequenceEventTrackSegmentView ()
 
void handleEditPopupContent (sequenceguiactions::Action &action) override
 
void drawEvent (const SequenceTrackSegment &segment, ImDrawList *drawList, const ImVec2 &topLeft, float x, ImU32 color) override
 
void insertSegment (SequenceControllerEvent &controller, const std::string &trackID, double time) override
 
std::unique_ptr< sequenceguiactions::ActioncreateEditAction (const SequenceTrackSegmentEventBase *segment, const std::string &trackID, const std::string &segmentID) override
 
- Public Member Functions inherited from SequenceEventTrackSegmentViewBase
 SequenceEventTrackSegmentViewBase ()=default
 
virtual ~SequenceEventTrackSegmentViewBase ()=default
 
virtual void drawEvent (const SequenceTrackSegment &segment, ImDrawList *drawList, const ImVec2 &topLeft, float x)=0
 
 SequenceEventTrackSegmentViewBase ()=default
 
virtual ~SequenceEventTrackSegmentViewBase ()=default
 

Description

template<typename T>
class nap::SequenceEventTrackSegmentView< T >

The SequenceEventTrackSegmentView<T> is responsible for drawing and handling the GUI for event types of type T The track view looks up the appropriate view for each event type exists on the track. You can register new views for new type of events from outside, enabling to write your own views and add your own event types relatively simple Extend this class if you want a view for your own event type Override the methods "handleEditPopupContent" and "drawEvent" when implementing your custom view for your custom event For examples. Take a look at the template specializations in SequenceEventTrackView.cpp

Inheritance diagram for SequenceEventTrackSegmentView< T >:
[legend]
Collaboration diagram for SequenceEventTrackSegmentView< T >:
[legend]

Constructor & Destructor Documentation

◆ SequenceEventTrackSegmentView()

Constructor

Member Function Documentation

◆ createEditAction()

std::unique_ptr< sequenceguiactions::Action > createEditAction ( const SequenceTrackSegmentEventBase segment,
const std::string &  trackID,
const std::string &  segmentID 
)
overridevirtual

Specialize this method to specify the way an edit action for this event segment needs to be created Generally, this method doesn't need specialization

Parameters
segmentconst pointer to segment
trackIDthe track id
segmentIDthe segment id
Returns
unique pointer to created action, cannot be nullptr

Implements SequenceEventTrackSegmentViewBase.

◆ drawEvent()

void drawEvent ( const SequenceTrackSegment segment,
ImDrawList *  drawList,
const ImVec2 &  topLeft,
float  x,
ImU32  color 
)
overridevirtual

Specialize this method to specify a way to draw this event type For examples, see template specializations in SequenceEventTrackView.cpp

Parameters
segmentreference to segment
drawListpointer to ImGui drawlist
topLefttop left position
xx position of segment on track
colordraw color

Implements SequenceEventTrackSegmentViewBase.

◆ handleEditPopupContent()

void handleEditPopupContent ( sequenceguiactions::Action action)
overridevirtual

This method needs specialization in order to implement the way popups are handled when editing this segment For examples, see template specializations in SequenceEventTrackView.cpp

Parameters
actionthe incoming action from the gui, contains information about the track time and segment. Segment can be assumed to be of type SequenceTrackSegmentEvent<T>

Implements SequenceEventTrackSegmentViewBase.

◆ insertSegment()

void insertSegment ( SequenceControllerEvent controller,
const std::string &  trackID,
double  time 
)
overridevirtual

Specialize this method to specify the way the controller needs to be called to add your custom event type Generally, this method doesn't need specialization

Parameters
controllerreference to controller
trackIDid of event track
timetime at which to insert custom event

Implements SequenceEventTrackSegmentViewBase.