CCurve Class Reference

#include <c4d_canimation.h>

Inheritance diagram for CCurve:

详细描述

Represents the animation curve.
Belongs to a track and contains keys .

注意
Cannot be allocated.

私有成员函数

  CCurve ()
  ~CCurve (void)
const CCurve &  operator= (const CCurve &seq)

Key

Int32   GetKeyCount (void) const
const CKey *  GetKey ( Int32 index) const
CKey *  GetKey ( Int32 index)
const CKey *  FindKey (const BaseTime &time, Int32 *idx=nullptr, FINDANIM match= FINDANIM::EXACT ) const
CKey *  FindKey (const BaseTime &time, Int32 *idx=nullptr, FINDANIM match= FINDANIM::EXACT )
CKey *  AddKey (const BaseTime &time, Int32 *nidx=nullptr, Bool bUndo=false, Bool SynchronizeKeys=false)
CKey *  AddKeyAdaptTangent (const BaseTime &time, Bool bUndo, Int32 *nidx=nullptr, Bool SynchronizeKeys=false)
Bool   InsertKey ( CKey *ckey, Bool bUndo=false, Bool SynchronizeKeys=false)
Bool   DelKey ( Int32 index, Bool bUndo=false, Bool SynchronizeKeys=false)
Int32   MoveKey (const BaseTime &time, Int32 idx, CCurve *dseq=nullptr, Bool bUndo=false, Bool SynchronizeKeys=false)
void  FlushKeys ( Bool bUndo=false, Bool SynchronizeKeys=false)

Calculation

Float64   CalcHermite ( Float64 time, Float64 t1, Float64 t2, Float64 val1, Float64 val2, Float64 tan1_val, Float64 tan2_val, Float64 tan1_t, Float64 tan2_t, Bool deriv) const
void  CalcSoftTangents ( Int32 kidx, Float *vl, Float *vr, BaseTime *tl, BaseTime *tr)
void  GetTangents ( Int32 kidx, Float64 *vl, Float64 *vr, Float64 *tl, Float64 *tr)
Float   GetValue (const BaseTime &time) const

杂项

CTrack *  GetTrack ()
void  SetKeyDefault ( BaseDocument *doc, Int32 kidx)
void  SetKeyDirty ()
void  SortKeysByTime ( Bool bUndo=false, Bool SynchronizeKeys=false)

Start/End Time

BaseTime   GetStartTime (void) const
BaseTime   GetEndTime (void) const

Unmuted

const CKey *  FindNextUnmuted ( Int32 idx, Int32 *ret_idx=nullptr) const
CKey *  FindNextUnmuted ( Int32 idx, Int32 *ret_idx=nullptr)
const CKey *  FindPrevUnmuted ( Int32 idx, Int32 *ret_idx=nullptr) const
CKey *  FindPrevUnmuted ( Int32 idx, Int32 *ret_idx=nullptr)

Additional Inherited Members

-  Public Member Functions inherited from BaseList2D
const Char *  GetViewportRenderId ( VIEWPORT_RENDER_ID typeId) const
BaseList2D *  GetNext ()
BaseList2D *  GetPred ()
void  SetBit ( Int32 mask)
Bool   GetBit ( Int32 mask) const
void  DelBit ( Int32 mask)
void  ToggleBit ( Int32 mask)
Int32   GetAllBits () const
void  SetAllBits ( Int32 bits)
void  SetBitEx ( Int32 mask, Int32 flags)
BaseContainer   GetData ()
void  SetData (const BaseContainer &bc, Bool add=true)
const BaseContainer *  GetDataInstance () const
BaseContainer *  GetDataInstance ()
const BaseContainer &  GetDataInstanceRef () const
BaseContainer &  GetDataInstanceRef ()
String   GetName () const
void  SetName (const maxon::String &name)
String   GetBubbleHelp ()
Bool   TransferGoal ( BaseList2D *dst, Bool undolink)
Bool   TransferMarker ( BaseList2D *dst) const
Bool   比例 ( Float scale)
Bool   编辑 ()
void  GetIcon ( IconData *dat)
GeListHead *  GetNLARoot ()
BaseList2D *  AnimationLayerRemap ( BaseObject **layer=nullptr)
String   GetTypeName ()
BaseList2D *  GetMain () const
void  InsertTrackSorted ( CTrack *track)
Bool   AddEventNotification ( BaseList2D *bl, NOTIFY_EVENT eventid, NOTIFY_EVENT_FLAG flags, const BaseContainer *data)
Bool   RemoveEventNotification ( BaseDocument *doc, BaseList2D *bl, NOTIFY_EVENT eventid)
Bool   FindEventNotification ( BaseDocument *doc, BaseList2D *bl, NOTIFY_EVENT eventid)
Bool   SetDescIDState (const DescID &id, DESCIDSTATE descidstate)
DESCIDSTATE   GetDescIDState (const DescID &id, Bool tolerant) const
GeListHead *  GetOverrideRoot ()
BaseOverride *  GetFirstOverride ()
GeListHead *  GetShaderRepositoryRoot ()
GeListHead *  GetHiddenShaderRoot ()
maxon::NimbusInterface *  GetNimbusRef (const maxon::Id &spaceId) const
maxon::Result < maxon::NimbusInterface * >  GetOrCreateNimbusRef (const maxon::Id &spaceId)
void  RemoveNimbusRef (const maxon::Id &spaceId)
maxon::Result < maxon::HashMap < maxon::Id , maxon::ForwardRef < maxon::NimbusRef > > >  GetAllNimbusRefs () const
Bool   IsNodeBased () const
void  GetMarkerStampEx ( UInt32 *l1, UInt32 *l2)
const GeMarker &  GetMarker () const
void  SetMarker (const GeMarker &m)
Bool   AddUniqueID ( Int32 appid, const Char *const mem, Int bytes)
Bool   FindUniqueID ( Int32 appid, const Char *&mem, Int &bytes) const
Int32   GetUniqueIDCount () const
Bool   GetUniqueIDIndex ( Int32 idx, Int32 &id, const Char *&mem, Int &bytes) const
Bool   SetAnimatedParameter ( CTrack *track, const DescID &id, const GeData &t_data1, const GeData &t_data2, Float mix, DESCFLAGS_SET flags)
Bool   GetAnimatedParameter (const DescID &id, GeData &t_data1, GeData &t_data2, Float &mix, DESCFLAGS_GET flags)
BaseShader *  GetFirstShader () const
void  InsertShader ( BaseShader *shader, BaseShader *pred=nullptr)
void  ClearKeyframeSelection ()
Bool   FindKeyframeSelection (const DescID &id)
Bool   SetKeyframeSelection (const DescID &id, Bool selection)
Bool   KeyframeSelectionContent ()
LayerObject *  GetLayerObject ( BaseDocument *doc)
Bool   SetLayerObject ( LayerObject *layer)
const LayerData *  GetLayerData ( BaseDocument *doc, Bool rawdata=false)
Bool   SetLayerData ( BaseDocument *doc, const LayerData &data)
GeListHead *  GetCTrackRoot ()
CTrack *  GetFirstCTrack ()
CTrack *  FindCTrack (const DescID &id)
-  Public Member Functions inherited from GeListNode
GeListNode *  GetNext ()
GeListNode *  GetPred ()
GeListNode *  GetDown ()
GeListNode *  GetUp ()
GeListNode *  GetDownLast ()
void  InsertBefore ( GeListNode *bl)
void  InsertAfter ( GeListNode *bl)
void  InsertUnder ( GeListNode *bl)
void  InsertUnderLast ( GeListNode *bl)
void  移除 ()
GeListHead *  GetListHead ()
Int32   GetNodeID ( Int32 index=0) const
template<typename CAST >
const CAST *  GetNodeData ( Int32 index=0) const
template<typename CAST >
CAST *  GetNodeData ( Int32 index=0)
void  SetCustomData ( GeListNode *node)
GeListNode *  GetCustomData ()
BaseDocument *  GetDocument ()
Int32   GetBranchInfo ( BranchInfo *info, Int32 max, GETBRANCHINFO flags)
Bool   IsDocumentRelated ()
Int32   GetInfo ()
Bool   GetNBit ( NBIT bit) const
UInt32   GetNBitMask ( Int32 index) const
Bool   ChangeNBit ( NBIT bit, NBITCONTROL bitmode)
-  Public Member Functions inherited from C4DAtom
Int32   GetType () const
Int32   GetRealType () const
Int32   GetDiskType () const
Bool   IsInstanceOf ( Int32 id) const
Int32   GetClassification () const
Bool   消息 ( Int32 type, void *data=nullptr)
Bool   MultiMessage ( MULTIMSG_ROUTE flags, Int32 type, void *data)
C4DAtom *  GetClone ( COPYFLAGS flags, AliasTrans *trn)
Bool   CopyTo ( C4DAtom *dst, COPYFLAGS flags, AliasTrans *trn)
Bool   读取 ( HyperFile *hf, Int32 id, Int32 level)
Bool   Write ( HyperFile *hf)
Bool   ReadObject ( HyperFile *hf, Bool readheader)
Bool   WriteObject ( HyperFile *hf)
Bool   GetDescription ( 描述 *description, DESCFLAGS_DESC flags)
Bool   GetParameter (const DescID &id, GeData &t_data, DESCFLAGS_GET flags)
Bool   SetParameter (const DescID &id, const GeData &t_data, DESCFLAGS_SET flags)
DynamicDescription *  GetDynamicDescription ()
Bool   GetEnabling (const DescID &id, const GeData &t_data, DESCFLAGS_ENABLE flags, const BaseContainer *itemdesc)
Bool   TranslateDescID (const DescID &id, DescID &res_id, C4DAtom *&res_at)
UInt32   GetDirty ( DIRTYFLAGS flags) const
void  SetDirty ( DIRTYFLAGS flags)
UInt32   GetHDirty ( HDIRTYFLAGS mask) const
void  SetHDirty ( HDIRTYFLAGS mask)
-  Static Public Member Functions inherited from BaseList2D
static BaseList2D *  Alloc ( Int32 type)
static void  Free ( BaseList2D *&bl)
-  Static Public Attributes inherited from BaseList2D
static const Int32   SETBIT_FLAG_NODIRTY
static const Int32   SETBIT_FLAG_REMOVE

构造函数 & 析构函数文档编制

◆  CCurve()

CCurve () private

◆  ~CCurve()

~ CCurve ( void  )
private

成员函数文档编制

◆  operator=()

const CCurve & operator= ( const CCurve &  seq )
private

◆  GetKeyCount()

Int32 GetKeyCount ( void  ) const

Gets the number of keys in the curve.

返回
The number of keys.

◆  GetKey() [1/2]

const CKey * GetKey ( Int32   index ) const

Gets the const key at index in the curve.

参数
[in] index The key index: 0 <= index < GetKeyCount()
返回
The const key, or nullptr . The curve owns the pointed key.

◆  GetKey() [2/2]

CKey * GetKey ( Int32   index )

Gets the key at index in the curve.

参数
[in] index The key index: 0 <= index < GetKeyCount()
返回
The key, or nullptr . The curve owns the pointed key.

◆  FindKey() [1/2]

const CKey * FindKey ( const BaseTime &  time ,
Int32 *  idx = nullptr ,
FINDANIM   match = FINDANIM::EXACT  
) const

Finds the const key at the given time .

参数
[in] time The time to find the key at.
[out] idx Assigned the index of the found key.
[in] match The search method.
返回
The found const key, or nullptr . The curve owns the pointed key.

◆  FindKey() [2/2]

CKey * FindKey ( const BaseTime &  time ,
Int32 *  idx = nullptr ,
FINDANIM   match = FINDANIM::EXACT  
)

Finds the key at the given time .

参数
[in] time The time to find the key at.
[out] idx Assigned the index of the found key.
[in] match The search method: FINDANIM
返回
The found key, or nullptr . The curve owns the pointed key.

◆  AddKey()

CKey * AddKey ( const BaseTime &  time ,
Int32 *  nidx = nullptr ,
Bool   bUndo = false ,
Bool   SynchronizeKeys = false  
)

Adds a key to the curve.

参数
[in] time The time to add the key at.
[out] nidx Assigned the index of the added key.
[in] bUndo 若 true this action will be undoable.
[in] SynchronizeKeys Since R18. If true the routine is called on other components of the vector (if valid). Curve must be part of a Track.
返回
The added key. The curve owns the pointed key.

◆  AddKeyAdaptTangent()

CKey * AddKeyAdaptTangent ( const BaseTime &  time ,
Bool   bUndo ,
Int32 *  nidx = nullptr ,
Bool   SynchronizeKeys = false  
)

Adds a key to the curve but retains the curve's current curvature.

参数
[in] time The time to add the key at.
[in] bUndo 若 true this action will be undoable.
[out] nidx Assigned the new key index.
[in] SynchronizeKeys Since R18. If true the routine is called on other components of the vector (if valid). Curve must be part of a Track.
返回
The added key, or nullptr if it failed.

◆  InsertKey()

Bool InsertKey ( CKey *  ckey ,
Bool   bUndo = false ,
Bool   SynchronizeKeys = false  
)

Inserts a key into the curve.

参数
[in] ckey The key to insert. The curve takes over the ownership of the pointed key.
[in] bUndo 若 true this action will be undoable.
[in] SynchronizeKeys Since R18. If true the routine is called on other components of the vector (if valid). Curve must be part of a Track.
返回
true if the key was inserted, otherwise false .

◆  DelKey()

Bool DelKey ( Int32   index ,
Bool   bUndo = false ,
Bool   SynchronizeKeys = false  
)

Deletes a key from the curve.

参数
[in] index The index of the key to delete: 0 <= index < GetKeyCount()
[in] bUndo 若 true this action will be undoable.
[in] SynchronizeKeys Since R18. If true the routine is called on other components of the vector (if valid). Curve must be part of a Track.
返回
true if the key was deleted, otherwise false .

◆  MoveKey()

Int32 MoveKey ( const BaseTime &  time ,
Int32   idx ,
CCurve *  dseq = nullptr ,
Bool   bUndo = false ,
Bool   SynchronizeKeys = false  
)

Moves a key in the curve.

参数
[in] time The time to move the key to.
[in] idx The index of the key to move: 0 <= index < GetKeyCount()
[in] dseq An optional destination curve to move the key to.
[in] bUndo 若 true this action will be undoable.
[in] SynchronizeKeys Since R18. If true the routine is called on other components of the vector (if valid). Curve must be part of a Track.
返回
The new index of the moved key.

◆  FlushKeys()

void FlushKeys ( Bool   bUndo = false ,
Bool   SynchronizeKeys = false  
)

Removes all keys from the curve.

参数
[in] bUndo 若 true this action will be undoable.
[in] SynchronizeKeys Since R18. If true the routine is called on other components of the vector (if valid). Curve must be part of a Track.

◆  CalcHermite()

Float64 CalcHermite ( Float64   time ,
Float64   t1 ,
Float64   t2 ,
Float64   val1 ,
Float64   val2 ,
Float64   tan1_val ,
Float64   tan2_val ,
Float64   tan1_t ,
Float64   tan2_t ,
Bool   deriv  
) const

Calculates the Hermite spline between two sets of key values.

注意
Does not take into account any modes (like zero length), so this method should normally not be used. Call GetTangents() instead.
警告
Only valid for 'Spline' interpolation curves.
参数
[in] time The time to evaluate.
[in] t1 The first time.
[in] t2 The second time.
[in] val1 The first value.
[in] val2 The second value.
[in] tan1_val The first tangent value.
[in] tan2_val The second tangent value.
[in] tan1_t The first tangent time.
[in] tan2_t The second tangent time.
[in] deriv 若 true the derivative is calculated instead of the value.
返回
The spline value at the given coordinates/parameters.

◆  CalcSoftTangents()

void CalcSoftTangents ( Int32   kidx ,
Float *  vl ,
Float *  vr ,
BaseTime *  tl ,
BaseTime *  tr  
)

Calculates the soft tangents (i.e. auto interpolation) around a key.

参数
[in] kidx The key index: 0 <= kidx < GetKeyCount()
[out] vl Assigned the left value.
[out] vr Assigned the right value.
[out] tl Assigned the left time.
[out] tr Assigned the right time.

◆  GetTangents()

void GetTangents ( Int32   kidx ,
Float64 *  vl ,
Float64 *  vr ,
Float64 *  tl ,
Float64 *  tr  
)

Computes the tangents of a key, taking into account all options like zero slope, link slope etc.

参数
[in] kidx The key index: 0 <= kidx < GetKeyCount()
[out] vl Assigned the left value.
[out] vr Assigned the right value.
[out] tl Assigned the left time.
[out] tr Assigned the right time.

◆  GetValue()

Float GetValue ( const BaseTime &  time ) const

Gets the value calculated at time , taking into account things like time curves.

参数
[in] time The time to calculate the value at.
返回
The calculated value.

◆  GetTrack()

CTrack * GetTrack ( )

Gets the track of the curve.

返回
The track.

◆  SetKeyDefault()

void SetKeyDefault ( BaseDocument *  doc ,
Int32   kidx  
)

Sets the defaults for key kidx of the curve.
This includes lock, mute, clamp, break, auto properties, interpolation and tangents.
This setup a value and complete the missing properties with the defaults.

参数
[in] doc The curve's document.
[in] kidx The key index.

◆  SetKeyDirty()

void SetKeyDirty ( )

Sets keys dirty.

注意
Equivalent to SetDirty(DIRTYFLAGS::CHILDREN).

◆  SortKeysByTime()

void SortKeysByTime ( Bool   bUndo = false ,
Bool   SynchronizeKeys = false  
)

Private .

◆  GetStartTime()

BaseTime GetStartTime ( void  ) const

Gets the start time of the curve.

返回
The start time of the curve.

◆  GetEndTime()

BaseTime GetEndTime ( void  ) const

Gets the end time of the curve.

返回
The end time of the curve.

◆  FindNextUnmuted() [1/2]

const CKey * FindNextUnmuted ( Int32   idx ,
Int32 *  ret_idx = nullptr  
) const

Finds the next unmuted key (read-only).

参数
[in] idx The key index to start the search from: 0 <= idx < GetKeyCount()
[out] ret_idx Assigned the found key index.
返回
The next unmuted key, or nullptr if there is none.

◆  FindNextUnmuted() [2/2]

CKey * FindNextUnmuted ( Int32   idx ,
Int32 *  ret_idx = nullptr  
)

Finds the next unmuted key (writable).

参数
[in] idx The key index to start the search from: 0 <= idx < GetKeyCount()
[out] ret_idx Assigned the found key index.
返回
The next unmuted key, or nullptr if there is none.

◆  FindPrevUnmuted() [1/2]

const CKey * FindPrevUnmuted ( Int32   idx ,
Int32 *  ret_idx = nullptr  
) const

Finds the previous unmuted key (read-only).

参数
[in] idx The key index to start the search from: 0 <= idx < GetKeyCount()
[out] ret_idx Assigned the found key index.
返回
The previous unmuted key, or nullptr if there is none.

◆  FindPrevUnmuted() [2/2]

CKey * FindPrevUnmuted ( Int32   idx ,
Int32 *  ret_idx = nullptr  
)

Finds the previous unmuted key (writable).

参数
[in] idx The key index to start the search from: 0 <= idx < GetKeyCount()
[out] ret_idx Assigned the found key index.
返回
The previous unmuted key, or nullptr if there is none.