NAP
Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
SequenceCurveTrackView Class Referencefinal

#include <sequencecurvetrackview.h>

Public Member Functions

 SequenceCurveTrackView (SequenceGUIService &service, SequenceEditorGUIView &view, SequenceEditorGUIState &state)
 
 SequenceCurveTrackView (const SequenceCurveTrackView &)=delete
 
SequenceCurveTrackViewoperator= (const SequenceCurveTrackView &)=delete
 
void handleActions () override
 
- Public Member Functions inherited from SequenceTrackView
 SequenceTrackView (SequenceEditorGUIView &view, SequenceEditorGUIState &state)
 
virtual ~SequenceTrackView ()=default
 
virtual void showInspector (const SequenceTrack &track)
 
virtual void showTrack (const SequenceTrack &track)
 

Protected Types

using DrawSegmentMemFunPtr = void(SequenceCurveTrackView::*)(const SequenceTrack &track, const SequenceTrackSegment &segment, const ImVec2 &trackTopLeft, float previousSegmentX, float segmentWidth, float segmentX, ImDrawList *drawList, bool drawStartValue)
 

Protected Member Functions

template<typename T >
void drawSegmentContent (const SequenceTrack &track, const SequenceTrackSegment &segment, const ImVec2 &trackTopLeft, float previousSegmentX, float segmentWidth, float segmentX, ImDrawList *drawList, bool drawStartValue)
 
template<typename T >
void drawSegmentValue (const SequenceTrack &track, const SequenceTrackSegment &segment, const ImVec2 &trackTopLeft, float segmentX, float segmentWidth, sequencecurveenums::ESegmentValueTypes segmentType, ImDrawList *drawList)
 
void drawSegmentHandler (const SequenceTrack &track, const SequenceTrackSegment &segment, const ImVec2 &trackTopLeft, float segmentX, float segmentWidth, ImDrawList *drawList)
 
template<typename T >
void drawControlPoints (const SequenceTrack &track, const SequenceTrackSegment &segment, const ImVec2 &trackTopLeft, float segmentX, float segmentWidth, ImDrawList *drawList)
 
template<typename T >
void drawCurves (const SequenceTrack &track, const SequenceTrackSegment &segment, const ImVec2 &trackTopLeft, float previousSegmentX, float segmentWidth, float segmentX, ImDrawList *drawList)
 
template<typename T >
void drawTanHandler (const SequenceTrack &track, const SequenceTrackSegment &segment, std::ostringstream &stringStream, float segmentWidth, const math::FCurvePoint< float, float > &curvePoint, const ImVec2 &circlePoint, int controlPointIndex, int curveIndex, sequencecurveenums::ETanPointTypes type, ImDrawList *drawList)
 
void handleInsertSegmentPopup ()
 
void handleEditSegmentPopup ()
 
void handleInsertCurvePointPopup ()
 
template<typename T >
void handleCurvePointActionPopup ()
 
template<typename T >
void handleSegmentValueActionPopup ()
 
template<typename T >
void handleChangeMinMaxCurve ()
 
void handleDragTanPoint ()
 
void handleAssignOutputIDToTrack ()
 
void handleDragSegmentHandler ()
 
void handleCurveTypePopup ()
 
void handleTanPointActionPopup ()
 
void handleDraggingSegmentValue ()
 
void handleDraggingControlPoints ()
 
void handleLoadPresetPopup ()
 
template<typename T >
void drawInspectorRange (const SequenceTrack &track)
 
template<typename T >
void showValue (const SequenceTrack &track, const SequenceTrackSegmentCurve< T > &segment, float x, double time, int curveIndex)
 
template<typename T >
bool inputFloat (T &, int precision)
 
void showInspectorContent (const SequenceTrack &track) override
 
void showTrackContent (const SequenceTrack &track, const ImVec2 &trackTopLeft) override
 
template<typename T >
bool pasteClipboardSegments (const std::string &trackId, double time, utility::ErrorState &errorState)
 
template<typename T >
void pasteClipboardSegmentInto (const std::string &trackID, const std::string &segmentID)
 
void updateSegmentInClipboard (const std::string &trackID, const std::string &segmentID)
 
void updateSegmentsInClipboard (const std::string &trackID)
 
template<>
void handleCurvePointActionPopup ()
 
template<>
void handleSegmentValueActionPopup ()
 
template<>
void showValue (const SequenceTrack &track, const SequenceTrackSegmentCurve< float > &segment, float x, double time, int curveIndex)
 
template<>
bool inputFloat (float &v, int precision)
 
- Protected Member Functions inherited from SequenceTrackView
void handleTrackOptionsPopup ()
 
void registerActionHandler (const rttr::type &type, const std::function< void()> &handler)
 
const SequencePlayergetPlayer ()
 
SequenceEditorgetEditor ()
 

Static Protected Member Functions

static std::unordered_map< rttr::type, DrawSegmentMemFunPtr > & getDrawCurveSegmentsMap ()
 

Protected Attributes

std::unordered_map< std::string, std::vector< std::vector< ImVec2 > > > mCurveCache
 
- Protected Attributes inherited from SequenceTrackView
SequenceEditorGUIViewmView
 
SequenceEditorGUIStatemState
 
std::unordered_map< rttr::type, std::function< void()> > mActionHandlers
 
SequenceGUIServicemService
 

Additional Inherited Members

- Static Public Member Functions inherited from SequenceTrackView
static bool Combo (const char *label, int *currIndex, std::vector< std::string > &values)
 
static bool ListBox (const char *label, int *currIndex, std::vector< std::string > &values)
 
static std::string formatTimeString (double time)
 

Description

SequenceCurveTrackView shows and handles contents for curve tracks

Inheritance diagram for SequenceCurveTrackView:
[legend]
Collaboration diagram for SequenceCurveTrackView:
[legend]

Member Typedef Documentation

◆ DrawSegmentMemFunPtr

using DrawSegmentMemFunPtr = void (SequenceCurveTrackView::*)(const SequenceTrack &track, const SequenceTrackSegment &segment, const ImVec2 &trackTopLeft, float previousSegmentX, float segmentWidth, float segmentX, ImDrawList *drawList, bool drawStartValue)
protected

Constructor & Destructor Documentation

◆ SequenceCurveTrackView() [1/2]

Constructor

Parameters
servicesequence gui service handle
viewreference to editor view
statereference to editor state

◆ SequenceCurveTrackView() [2/2]

Member Function Documentation

◆ drawControlPoints()

void drawControlPoints ( const SequenceTrack track,
const SequenceTrackSegment segment,
const ImVec2 &  trackTopLeft,
float  segmentX,
float  segmentWidth,
ImDrawList *  drawList 
)
protected

draws control points of curve segment

Parameters
trackreference to track
segmentreference to segment
trackTopLefttracks topleft position
segmentXsegment x position
segmentWidthwidth of segment
drawListpointer to window drawlist

◆ drawCurves()

void drawCurves ( const SequenceTrack track,
const SequenceTrackSegment segment,
const ImVec2 &  trackTopLeft,
float  previousSegmentX,
float  segmentWidth,
float  segmentX,
ImDrawList *  drawList 
)
protected

draws curves of segment

Template Parameters
Tthe type of this segment
Parameters
trackreference to track
segmentreference to segment
trackTopLefttopleft position of track
previousSegmentXthe x position of the previous segment
segmentWidththe width of this segment
segmentXthe x position of this segment
drawListpointer to drawlist of this track window

◆ drawInspectorRange()

void drawInspectorRange ( const SequenceTrack track)
protected

Draws min/max range of inspector

Template Parameters
Ttype
Parameters
trackreference to track

◆ drawSegmentContent()

void drawSegmentContent ( const SequenceTrack track,
const SequenceTrackSegment segment,
const ImVec2 &  trackTopLeft,
float  previousSegmentX,
float  segmentWidth,
float  segmentX,
ImDrawList *  drawList,
bool  drawStartValue 
)
protected

draws the contents of a segment

Template Parameters
Tthe type of this segment
Parameters
trackreference to track
segmentreference to segment
trackTopLefttopleft position of track
previousSegmentXthe x position of the previous segment
segmentWidththe width of this segment
segmentXthe x position of this segment
drawListpointer to drawlist of this track window
drawStartValueshould we draw the start value ? only used in first segment of track

◆ drawSegmentHandler()

void drawSegmentHandler ( const SequenceTrack track,
const SequenceTrackSegment segment,
const ImVec2 &  trackTopLeft,
float  segmentX,
float  segmentWidth,
ImDrawList *  drawList 
)
protected

draws segment handler

Parameters
trackreference to track
segmentreference to segment
trackTopLefttracks topleft position
segmentXsegment x position
segmentWidthwidth of segment
drawListpointer to window drawlist

◆ drawSegmentValue()

void drawSegmentValue ( const SequenceTrack track,
const SequenceTrackSegment segment,
const ImVec2 &  trackTopLeft,
float  segmentX,
float  segmentWidth,
sequencecurveenums::ESegmentValueTypes  segmentType,
ImDrawList *  drawList 
)
protected

draws a segments value

Template Parameters
Ttype of segment
Parameters
trackreference to track
segmentreference to segment
trackTopLefttracks topleft position
segmentXsegment x position
segmentWidthwidth of segment
segmentTypetype of segment
drawListpointer to window drawlist

◆ drawTanHandler()

void drawTanHandler ( const SequenceTrack track,
const SequenceTrackSegment segment,
std::ostringstream &  stringStream,
float  segmentWidth,
const math::FCurvePoint< float, float > &  curvePoint,
const ImVec2 &  circlePoint,
int  controlPointIndex,
int  curveIndex,
sequencecurveenums::ETanPointTypes  type,
ImDrawList *  drawList 
)
protected

draws handlers of curve point

Template Parameters
Ttype of segment
Parameters
trackreference to track
segmentreference to segment
stringStreamstringstream, used to keep track of object id
segmentWidthwidth of segment
curvePointreference to curvePoint
circlePointcirclePoint position
controlPointIndexindex of control point
curveIndexindex of curve
typetangent type ( in or out )
drawListpointer to window drawlist

◆ getDrawCurveSegmentsMap()

static std::unordered_map<rttr::type, DrawSegmentMemFunPtr>& getDrawCurveSegmentsMap ( )
staticprotected

◆ handleActions()

void handleActions ( )
overridevirtual

Handles any actions

Reimplemented from SequenceTrackView.

◆ handleAssignOutputIDToTrack()

void handleAssignOutputIDToTrack ( )
protected

handles assigning new object id to track

◆ handleChangeMinMaxCurve()

void handleChangeMinMaxCurve
protected

handles changing of min max values of curve track

◆ handleCurvePointActionPopup() [1/2]

void handleCurvePointActionPopup
protected

handles curvepoint action popup

◆ handleCurvePointActionPopup() [2/2]

void handleCurvePointActionPopup ( )
protected

◆ handleCurveTypePopup()

void handleCurveTypePopup ( )
protected

handles curve type popup

◆ handleDraggingControlPoints()

void handleDraggingControlPoints ( )
protected

handles dragging of control points

◆ handleDraggingSegmentValue()

void handleDraggingSegmentValue ( )
protected

handles dragging of segment values

◆ handleDragSegmentHandler()

void handleDragSegmentHandler ( )
protected

handle dragging of segment handlers

◆ handleDragTanPoint()

void handleDragTanPoint ( )
protected

handles dragging of tan points

◆ handleEditSegmentPopup()

void handleEditSegmentPopup ( )
protected

handles delete segment popup

◆ handleInsertCurvePointPopup()

void handleInsertCurvePointPopup ( )
protected

handles insert curve point popup

◆ handleInsertSegmentPopup()

void handleInsertSegmentPopup ( )
protected

handles insert segment popup

◆ handleLoadPresetPopup()

void handleLoadPresetPopup ( )
protected

handles loading of popups

◆ handleSegmentValueActionPopup() [1/2]

void handleSegmentValueActionPopup
protected

handles segment value actions

◆ handleSegmentValueActionPopup() [2/2]

void handleSegmentValueActionPopup ( )
protected

◆ handleTanPointActionPopup()

void handleTanPointActionPopup ( )
protected

handles tanpoint action popup

◆ inputFloat() [1/2]

bool inputFloat ( float &  v,
int  precision 
)
protected

◆ inputFloat() [2/2]

bool inputFloat ( T &  ,
int  precision 
)
protected

input float that takes type T as input

Template Parameters
Ttype of inputFloat
Parameters
precisiondecimal precision
Returns
true if dragged

◆ operator=()

SequenceCurveTrackView& operator= ( const SequenceCurveTrackView )
delete

◆ pasteClipboardSegmentInto()

void pasteClipboardSegmentInto ( const std::string &  trackID,
const std::string &  segmentID 
)
protected

pastes content of clipboard segment into another segment

Parameters
trackIDthe track id of the track to insert into
segmentIDthe segment id of the segment to replace

◆ pasteClipboardSegments()

bool pasteClipboardSegments ( const std::string &  trackId,
double  time,
utility::ErrorState errorState 
)
protected

pastes current clipboard as new segments at given time

Parameters
trackIdthe track id of the track to insert into
timethe time at which to create new segment
errorStatecontains any errors
Returns
true on success

◆ showInspectorContent()

void showInspectorContent ( const SequenceTrack track)
overrideprotectedvirtual

show inspector content

Parameters
trackreference to track

Implements SequenceTrackView.

◆ showTrackContent()

void showTrackContent ( const SequenceTrack track,
const ImVec2 &  trackTopLeft 
)
overrideprotectedvirtual

shows track content

Parameters
trackreference to track
trackTopLeftorientation

Implements SequenceTrackView.

◆ showValue() [1/2]

void showValue ( const SequenceTrack track,
const SequenceTrackSegmentCurve< float > &  segment,
float  x,
double  time,
int  curveIndex 
)
protected

◆ showValue() [2/2]

void showValue ( const SequenceTrack track,
const SequenceTrackSegmentCurve< T > &  segment,
float  x,
double  time,
int  curveIndex 
)
protected
Template Parameters
Ttype of value
Parameters
trackreference to track
segmentreference to segment
xvalue to display
timetime in segment
curveIndexcurve index

◆ updateSegmentInClipboard()

void updateSegmentInClipboard ( const std::string &  trackID,
const std::string &  segmentID 
)
protected

updates segment in clipboard with contents of segment in track

Parameters
trackIDthe track id of the segment in clipboard
segmentIDthe segment id of the segment in clipboard

◆ updateSegmentsInClipboard()

void updateSegmentsInClipboard ( const std::string &  trackID)
protected

iterates of all segments in clipboard of specified track and updates them with the ones in the specified track

Parameters
trackIDthe track id containing segments in clipboard

Member Data Documentation

◆ mCurveCache

std::unordered_map<std::string, std::vector<std::vector<ImVec2> > > mCurveCache
protected