NAP
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SequenceControllerCurve Class Reference

#include <sequencecontrollercurve.h>

Public Member Functions

 SequenceControllerCurve (SequenceService &service, SequencePlayer &player, SequenceEditor &editor)
 
double segmentDurationChange (const std::string &trackID, const std::string &segmentID, float duration)
 
template<typename T >
void addNewCurveTrack ()
 
void changeCurveSegmentValue (const std::string &trackID, const std::string &segmentID, float newValue, int curveIndex, sequencecurveenums::ESegmentValueTypes valueType)
 
void insertCurvePoint (const std::string &trackID, const std::string &segmentID, float pos, int curveIndex)
 
void deleteCurvePoint (const std::string &trackID, const std::string &segmentID, int index, int curveIndex)
 
void changeCurvePoint (const std::string &trackID, const std::string &segmentID, int pointIndex, int curveIndex, float time, float value)
 
bool changeTanPoint (const std::string &trackID, const std::string &segmentID, int pointIndex, int curveIndex, sequencecurveenums::ETanPointTypes tanType, float time, float value)
 
template<typename T >
void changeMinMaxCurveTrack (const std::string &trackID, T minimum, T maximum)
 
template<typename T >
void changeCurveType (SequenceTrackSegment &segment, math::ECurveInterp type, int curveIndex)
 
const SequenceTrackSegmentinsertSegment (const std::string &trackID, double time) override
 
void deleteSegment (const std::string &trackID, const std::string &segmentID) override
 
void insertTrack (rtti::TypeInfo type) override
 
void updateCurveSegments (const std::string &trackID)
 
void changeCurveType (const std::string &trackID, const std::string &segmentID, math::ECurveInterp type, int curveIndex)
 
template<>
void NAPAPI changeMinMaxCurveTrack (const std::string &trackID, float minimum, float maximum)
 
- Public Member Functions inherited from SequenceController
 SequenceController (SequenceService &service, SequencePlayer &player, SequenceEditor &editor)
 
virtual ~SequenceController ()=default
 
void changeTrackName (const std::string &trackID, const std::string &name)
 
void changeSegmentLabel (const std::string &trackID, const std::string &segmentID, const std::string &newLabel)
 
void assignNewOutputID (const std::string &trackID, const std::string &outputID)
 
void deleteTrack (const std::string &deleteTrackID)
 
void moveTrackUp (const std::string &trackID)
 
void moveTrackDown (const std::string &trackID)
 
const SequenceTrackgetTrack (const std::string &trackID) const
 
const SequenceTrackSegmentgetSegment (const std::string &trackID, const std::string &segmentID) const
 
void changeTrackHeight (const std::string &trackID, float newHeight)
 

Protected Member Functions

template<typename T >
void updateCurveSegments (SequenceTrack &track)
 
template<typename T >
const SequenceTrackSegmentinsertCurveSegment (const std::string &trackID, double time)
 
template<typename T >
bool changeTanPoint (SequenceTrackSegment &segment, const std::string &trackID, int pointIndex, int curveIndex, sequencecurveenums::ETanPointTypes tanType, float time, float value)
 
template<typename T >
void changeCurvePoint (SequenceTrackSegment &segment, int pointIndex, int curveIndex, float time, float value)
 
template<typename T >
void changeLastCurvePoint (SequenceTrackSegment &segment, int curveIndex, float time, float value)
 
template<typename T >
void deleteCurvePoint (SequenceTrackSegment &segment, int index, int curveIndex)
 
template<typename T >
void insertCurvePoint (SequenceTrackSegment &segment, float pos, int curveIndex)
 
template<typename T >
void changeCurveSegmentValue (SequenceTrack &track, SequenceTrackSegment &segment, float newValue, int curveIndex, sequencecurveenums::ESegmentValueTypes valueType)
 
- Protected Member Functions inherited from SequenceController
SequencegetSequence ()
 
SequenceTrackSegmentfindSegment (const std::string &trackID, const std::string &segmentID)
 
SequenceTrackfindTrack (const std::string &trackID)
 
void deleteObjectFromSequencePlayer (const std::string &id)
 
void updateTracks ()
 
void performEditAction (std::function< void()> action)
 
std::vector< std::unique_ptr< rtti::Object > > & getPlayerOwnedObjects ()
 
std::unordered_set< std::string > & getPlayerReadObjectIDs ()
 

Protected Attributes

std::unordered_map< rttr::type, std::function< void(SequenceTrack &)> > mUpdateSegmentFunctionMap
 
std::unordered_map< rttr::type, std::function< const SequenceTrackSegment *(const std::string &, double)> > mInsertSegmentFunctionMap
 
std::unordered_map< rtti::TypeInfo, std::function< void(SequenceControllerCurve *)> > mInsertTrackFunctionMap
 
std::unordered_map< rtti::TypeInfo, std::function< bool(SequenceTrackSegment &, const std::string &, const int, const int, sequencecurveenums::ETanPointTypes, float, float)> > mChangeTanPointFunctionMap
 
std::unordered_map< rtti::TypeInfo, std::function< void(SequenceTrackSegment &, const int, const int, float, float)> > mChangeCurvePointFunctionMap
 
std::unordered_map< rtti::TypeInfo, std::function< void(SequenceTrackSegment &, const int, float, float)> > mChangeLastCurvePointFunctionMap
 
std::unordered_map< rtti::TypeInfo, std::function< void(SequenceTrackSegment &, const int, int)> > mDeleteCurvePointFunctionMap
 
std::unordered_map< rtti::TypeInfo, std::function< void(SequenceTrackSegment &, float, int)> > mInsertCurvePointFunctionMap
 
std::unordered_map< rtti::TypeInfo, std::function< void(SequenceTrack &, SequenceTrackSegment &segment, float, int, sequencecurveenums::ESegmentValueTypes)> > mChangeSegmentValueFunctionMap
 
std::unordered_map< rtti::TypeInfo, std::function< void(SequenceTrackSegment &, math::ECurveInterp type, int curveIndex)> > mChangeCurveTypeFunctionMap
 
- Protected Attributes inherited from SequenceController
SequencePlayermPlayer
 
SequenceEditormEditor
 
SequenceServicemService
 

Description

Controller class for curve tracks

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

Constructor & Destructor Documentation

◆ SequenceControllerCurve()

SequenceControllerCurve ( SequenceService service,
SequencePlayer player,
SequenceEditor editor 
)

Constructor

Parameters
servicereference to service
playerreference to player
editorreference to editor

Member Function Documentation

◆ addNewCurveTrack()

void addNewCurveTrack

adds a new curve track of type T ( float, vec2, vec3, vec4 )

◆ changeCurvePoint() [1/2]

void changeCurvePoint ( const std::string &  trackID,
const std::string &  segmentID,
int  pointIndex,
int  curveIndex,
float  time,
float  value 
)

changes a curvepoint value and time / position

Parameters
trackIDthe trackID
segmentIDthe segmentID
pointIndexthe point index
curveIndexthe curve index
timenew time in percentage of segment duration normalized between 0 and 1
valuenew value

◆ changeCurvePoint() [2/2]

void changeCurvePoint ( SequenceTrackSegment segment,
int  pointIndex,
int  curveIndex,
float  time,
float  value 
)
protected

changes a curvepoint value and time / position

Parameters
segmentthe segmentID
pointIndexthe point index
curveIndexthe curve index
timeoffset for new time
valueoffset for new value

◆ changeCurveSegmentValue() [1/2]

void changeCurveSegmentValue ( const std::string &  trackID,
const std::string &  segmentID,
float  newValue,
int  curveIndex,
sequencecurveenums::ESegmentValueTypes  valueType 
)

changes start or end value of segment of type T

Parameters
trackIDthe track id
segmentIDid of segment
newValuethe new value
curveIndexthe curve index of the value
valueTypethe segment value type ( first or last value )

◆ changeCurveSegmentValue() [2/2]

void changeCurveSegmentValue ( SequenceTrack track,
SequenceTrackSegment segment,
float  newValue,
int  curveIndex,
sequencecurveenums::ESegmentValueTypes  valueType 
)
protected

changes start or end value of segment of type T

Parameters
trackthe track id
segmentid of segment
newValuenew value
curveIndexthe curve index of the value
valueTypethe segment value type ( first or last value )

◆ changeCurveType() [1/2]

void changeCurveType ( const std::string &  trackID,
const std::string &  segmentID,
math::ECurveInterp  type,
int  curveIndex 
)

changes curvetype ( linear or bezier )

Parameters
trackIDthe trackID
segmentIDthe segmentID
typethe new curve type
curveIndexthe index of the curve

◆ changeCurveType() [2/2]

void changeCurveType ( SequenceTrackSegment segment,
math::ECurveInterp  type,
int  curveIndex 
)

changes curvetype ( linear or bezier )

Parameters
segmentthe segment
typethe new curve type
curveIndexindex of the curve

◆ changeLastCurvePoint()

void changeLastCurvePoint ( SequenceTrackSegment segment,
int  curveIndex,
float  time,
float  value 
)
protected

◆ changeMinMaxCurveTrack() [1/2]

void NAPAPI changeMinMaxCurveTrack ( const std::string &  trackID,
float  minimum,
float  maximum 
)

◆ changeMinMaxCurveTrack() [2/2]

void changeMinMaxCurveTrack ( const std::string &  trackID,
minimum,
maximum 
)

changes minimum and maximum value of track

Parameters
trackIDthe trackID
minimumnew minimum
maximumnew maximum

◆ changeTanPoint() [1/2]

bool changeTanPoint ( const std::string &  trackID,
const std::string &  segmentID,
int  pointIndex,
int  curveIndex,
sequencecurveenums::ETanPointTypes  tanType,
float  time,
float  value 
)

changes tangent of curve point. Tangents are always aligned

Parameters
trackIDthe trackID
segmentIDthe segmentID
pointIndexthe point index
curveIndexthe curve index
tanTypein or out tangent
timeoffset for new time
valueoffset for new value
Returns
if true, tangents have been flipped

◆ changeTanPoint() [2/2]

bool changeTanPoint ( SequenceTrackSegment segment,
const std::string &  trackID,
int  pointIndex,
int  curveIndex,
sequencecurveenums::ETanPointTypes  tanType,
float  time,
float  value 
)
protected

changes tangent of curve point. Tangents are always aligned

Parameters
segmentthe segment
trackIDthe trackID
pointIndexthe point index
curveIndexthe curve index
tanTypein or out tangent
timeoffset for new time
valueoffset for new value
Returns
if tangents have been flipped

◆ deleteCurvePoint() [1/2]

void deleteCurvePoint ( const std::string &  trackID,
const std::string &  segmentID,
int  index,
int  curveIndex 
)

deletes point from curve

Parameters
trackIDthe trackID
segmentIDthe segmentID
indexthe point index
curveIndexthe curveIndex

◆ deleteCurvePoint() [2/2]

void deleteCurvePoint ( SequenceTrackSegment segment,
int  index,
int  curveIndex 
)
protected

deletes point from curve

Parameters
segmentthe segmentID
indexthe point index
curveIndexthe curveIndex

◆ deleteSegment()

void deleteSegment ( const std::string &  trackID,
const std::string &  segmentID 
)
overridevirtual

overloaded delete segment function

Parameters
trackIDtrack id
segmentIDsegment id

Implements SequenceController.

◆ insertCurvePoint() [1/2]

void insertCurvePoint ( const std::string &  trackID,
const std::string &  segmentID,
float  pos,
int  curveIndex 
)

insert point in curve of segment

Parameters
trackIDthe track id
segmentIDthe segment id
posthe position at which to insert the curvepoint in curve ( range 0-1 )
curveIndexthe index of the curve

◆ insertCurvePoint() [2/2]

void insertCurvePoint ( SequenceTrackSegment segment,
float  pos,
int  curveIndex 
)
protected

insert point in curve of segment

Parameters
segmentthe segment id
posthe position at which to insert the curvepoint in curve ( range 0-1 )
curveIndexthe index of the curve

◆ insertCurveSegment()

const SequenceTrackSegment * insertCurveSegment ( const std::string &  trackID,
double  time 
)
protected

insertCurveSegment inserts a new curvesegment of type T ( vec2, vec3, vec4, float )

Parameters
trackIDthe track in which to insert the segment
timethe time at when to insert segment

◆ insertSegment()

const SequenceTrackSegment* insertSegment ( const std::string &  trackID,
double  time 
)
overridevirtual

overloaded insert segment function

Parameters
trackIDthe track id
timetime
Returns
const pointer to newly created segment

Implements SequenceController.

◆ insertTrack()

void insertTrack ( rtti::TypeInfo  type)
overridevirtual

overloaded insert track function

Parameters
typetrack type

Implements SequenceController.

◆ segmentDurationChange()

double segmentDurationChange ( const std::string &  trackID,
const std::string &  segmentID,
float  duration 
)
Parameters
trackIDthe id of the track
segmentIDthe id of the segment we need to edit
durationthe new duration
Returns
new duration of segment

◆ updateCurveSegments() [1/2]

void updateCurveSegments ( const std::string &  trackID)

updates curve segments values to be continuous ( segment 1 end value == segment 2 start value etc )

Parameters
trackIDthe track id of the track that we want to update

◆ updateCurveSegments() [2/2]

void updateCurveSegments ( SequenceTrack track)
protected

updates curve segments values to be continuous ( segment 1 end value == segment 2 start value etc )

Parameters
trackreference to sequence track

Member Data Documentation

◆ mChangeCurvePointFunctionMap

std::unordered_map<rtti::TypeInfo, std::function<void(SequenceTrackSegment&, const int, const int, float, float)> > mChangeCurvePointFunctionMap
protected

◆ mChangeCurveTypeFunctionMap

std::unordered_map<rtti::TypeInfo, std::function<void(SequenceTrackSegment&, math::ECurveInterp type, int curveIndex)> > mChangeCurveTypeFunctionMap
protected

◆ mChangeLastCurvePointFunctionMap

std::unordered_map<rtti::TypeInfo, std::function<void(SequenceTrackSegment&, const int, float, float)> > mChangeLastCurvePointFunctionMap
protected

◆ mChangeSegmentValueFunctionMap

std::unordered_map<rtti::TypeInfo, std::function<void(SequenceTrack&, SequenceTrackSegment& segment, float, int, sequencecurveenums::ESegmentValueTypes)> > mChangeSegmentValueFunctionMap
protected

◆ mChangeTanPointFunctionMap

std::unordered_map<rtti::TypeInfo, std::function<bool(SequenceTrackSegment&, const std::string&, const int, const int, sequencecurveenums::ETanPointTypes, float, float)> > mChangeTanPointFunctionMap
protected

◆ mDeleteCurvePointFunctionMap

std::unordered_map<rtti::TypeInfo, std::function<void(SequenceTrackSegment&, const int, int)> > mDeleteCurvePointFunctionMap
protected

◆ mInsertCurvePointFunctionMap

std::unordered_map<rtti::TypeInfo, std::function<void(SequenceTrackSegment&, float, int)> > mInsertCurvePointFunctionMap
protected

◆ mInsertSegmentFunctionMap

std::unordered_map<rttr::type, std::function<const SequenceTrackSegment*(const std::string&,double)> > mInsertSegmentFunctionMap
protected

◆ mInsertTrackFunctionMap

std::unordered_map<rtti::TypeInfo, std::function<void(SequenceControllerCurve*)> > mInsertTrackFunctionMap
protected

◆ mUpdateSegmentFunctionMap

std::unordered_map<rttr::type, std::function<void(SequenceTrack&)> > mUpdateSegmentFunctionMap
protected