Kage Studio 0.7.240121
A Simple Free and Open Source 2D Animation Software
Loading...
Searching...
No Matches
KageLayer Class Reference

#include <layer.h>

Collaboration diagram for KageLayer:

Public Member Functions

 KageLayer (KageScene *p_scene, unsigned int p_layerID, unsigned int p_frameCount)
 
KageLayer operator= (const KageLayer &p_layer)
 
virtual ~KageLayer ()
 
unsigned int getID ()
 
bool selectAllFrame (bool p_selectAll)
 
bool addFrame ()
 
void duplicateFrame ()
 
void extendFrame ()
 
bool removeFrame ()
 
unsigned int getCurrentFrame ()
 
void setCurrentFrame (unsigned int p_frame, bool p_addSelected)
 
void setCurrentFrameByID (unsigned int p_frameID)
 
bool removeAllFrames ()
 
KageScenegetScene ()
 
KageFramegetFrame ()
 
KageFramegetFrameAt (unsigned int p_frame)
 
unsigned int getFrameNumberByID (unsigned int p_frameID)
 
void setSelected (KageFrame *p_frame)
 
std::vector< unsigned int > raiseSelectedShape (std::vector< unsigned int > p_selectedShapes)
 
std::vector< unsigned int > lowerSelectedShape (std::vector< unsigned int > p_selectedShapes)
 
std::vector< unsigned int > raiseToTopSelectedShape (std::vector< unsigned int > p_selectedShapes)
 
std::vector< unsigned int > lowerToBottomSelectedShape (std::vector< unsigned int > p_selectedShapes)
 
std::vector< unsigned int > groupSelectedShapes (std::vector< unsigned int > p_selectedShapes)
 
std::vector< unsigned int > ungroupSelectedShapes (std::vector< unsigned int > p_selectedShapes)
 
std::vector< unsigned int > duplicateShapes (std::vector< unsigned int > p_selectedShapes)
 
bool flipHorizontalSelectedShape (std::vector< unsigned int > p_selectedShapes)
 
bool flipVerticalSelectedShape (std::vector< unsigned int > p_selectedShapes)
 
bool doFlipVerticalSelectedShapeOn (unsigned int p_frameIndex, std::vector< unsigned int > p_selectedShapes)
 
bool doFlipVerticalSelectedShapeOnExtendedFrame (unsigned int p_frameIndex, std::vector< unsigned int > p_selectedShapes)
 
bool recenterRotationPoint (std::vector< unsigned int > p_selectedShapes)
 
bool addDataToFrame (VectorDataManager p_vectorsData)
 
bool setFrameData (VectorDataManager p_vectorsData)
 
VectorDataManager getFrameTweenData (unsigned int p_frameIndex)
 
VectorDataManager getFrameData ()
 
VectorDataManager getFrameDataAt (unsigned int p_frame, bool p_frameOnion, bool p_layerOnion)
 
VectorDataManager getPreviousFrameData (unsigned int p_frameID)
 NOTE: "Frame" – NOT "frame ID".
 
bool setFrameDataToPreviousFrame (VectorDataManager p_vectorsData, unsigned int p_frameID)
 Called by KageFrame if KageFrame is Extended.
 
bool addDataToPreviousFrame (VectorDataManager v, unsigned int p_frameID)
 Called by KageFrame if KageFrame is Extended.
 
bool setPreviousFrameTween (unsigned int p_frameID, unsigned int p_tween)
 Called by KageFrame if KageFrame is Extended.
 
bool setExtendedFrameTween (unsigned int p_frameID, unsigned int p_tween)
 
bool forceSetTween (unsigned int p_tween)
 
bool setTween (unsigned int p_tween)
 
unsigned int getTween ()
 
bool switchToPreviousFrame ()
 
bool switchToPreviousFrame (unsigned int p_frameID)
 Called by FrameSet for navigating to Previous Frame.
 
bool switchToNextFrame ()
 Called by KageFrame for navigating to Previous Frame.
 
bool switchToNextFrame (unsigned int p_frameID)
 Called by FrameSet for navigating to Next Frame.
 
bool isCurrentFrame (unsigned int p_frameID)
 Called by KageFrame for navigating to Next Frame.
 
bool canReUseNextFrame ()
 Called by KageFrame when rendering.
 
void setFrameExtension (KageFrame::extension p_extension)
 Called by KageScene when duplicating Frame.
 
unsigned int getActiveFrameID ()
 Will return which Frame is currently active for editing or viewing.
 
bool moveToLeft ()
 
bool moveToLeftAt (unsigned int p_frame)
 Moves Current Frame to Left.
 
bool moveToLeftMost ()
 Moves Current Frame to Left on indicated Frame.
 
void setSelected (bool p_selected)
 
bool isSelected ()
 
void setVisible (bool p_visible)
 
bool isVisible ()
 
void toggleVisibility ()
 
void setLock (bool p_lock)
 
bool isLocked ()
 
void toggleLock ()
 
void setLabel (std::string p_label)
 
std::string getLabel ()
 

Data Fields

unsigned int layerID
 
std::vector< KageFrame * > Frames
 
KageFrame_framePtr
 
unsigned int frameCtr
 
KageScene_scene
 
unsigned int _currentFrameID
 
unsigned int _currentFrameIndex
 
unsigned int _activeFrame
 Moves Current Frame to Left.
 
bool _selected
 
bool _visible
 
bool _lock
 
std::string _label
 

Constructor & Destructor Documentation

◆ KageLayer()

KageLayer::KageLayer ( KageScene * p_scene,
unsigned int p_layerID,
unsigned int p_frameCount )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~KageLayer()

KageLayer::~KageLayer ( )
virtual

Member Function Documentation

◆ addDataToFrame()

bool KageLayer::addDataToFrame ( VectorDataManager p_vectorsData)
Here is the caller graph for this function:

◆ addDataToPreviousFrame()

bool KageLayer::addDataToPreviousFrame ( VectorDataManager v,
unsigned int p_frameID )

Called by KageFrame if KageFrame is Extended.

◆ addFrame()

bool KageLayer::addFrame ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ canReUseNextFrame()

bool KageLayer::canReUseNextFrame ( )

Called by KageFrame when rendering.

◆ doFlipVerticalSelectedShapeOn()

bool KageLayer::doFlipVerticalSelectedShapeOn ( unsigned int p_frameIndex,
std::vector< unsigned int > p_selectedShapes )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ doFlipVerticalSelectedShapeOnExtendedFrame()

bool KageLayer::doFlipVerticalSelectedShapeOnExtendedFrame ( unsigned int p_frameIndex,
std::vector< unsigned int > p_selectedShapes )
Here is the caller graph for this function:

◆ duplicateFrame()

void KageLayer::duplicateFrame ( )
Here is the call graph for this function:

◆ duplicateShapes()

std::vector< unsigned int > KageLayer::duplicateShapes ( std::vector< unsigned int > p_selectedShapes)
Here is the caller graph for this function:

◆ extendFrame()

void KageLayer::extendFrame ( )
Here is the call graph for this function:

◆ flipHorizontalSelectedShape()

bool KageLayer::flipHorizontalSelectedShape ( std::vector< unsigned int > p_selectedShapes)
Here is the caller graph for this function:

◆ flipVerticalSelectedShape()

bool KageLayer::flipVerticalSelectedShape ( std::vector< unsigned int > p_selectedShapes)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ forceSetTween()

bool KageLayer::forceSetTween ( unsigned int p_tween)
Here is the caller graph for this function:

◆ getActiveFrameID()

unsigned int KageLayer::getActiveFrameID ( )

Will return which Frame is currently active for editing or viewing.

Returns
unsigned int 0 is frame 1 (?) //TODO: revisit if index 0 is frame 1

◆ getCurrentFrame()

unsigned int KageLayer::getCurrentFrame ( )
Here is the caller graph for this function:

◆ getFrame()

KageFrame * KageLayer::getFrame ( )

◆ getFrameAt()

KageFrame * KageLayer::getFrameAt ( unsigned int p_frame)
Here is the caller graph for this function:

◆ getFrameData()

VectorDataManager KageLayer::getFrameData ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFrameDataAt()

VectorDataManager KageLayer::getFrameDataAt ( unsigned int p_frame,
bool p_frameOnion,
bool p_layerOnion )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFrameNumberByID()

unsigned int KageLayer::getFrameNumberByID ( unsigned int p_frameID)

◆ getFrameTweenData()

VectorDataManager KageLayer::getFrameTweenData ( unsigned int p_frameIndex)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getID()

unsigned int KageLayer::getID ( )

◆ getLabel()

std::string KageLayer::getLabel ( )
Here is the caller graph for this function:

◆ getPreviousFrameData()

VectorDataManager KageLayer::getPreviousFrameData ( unsigned int p_frameID)

NOTE: "Frame" – NOT "frame ID".

◆ getScene()

KageScene * KageLayer::getScene ( )

◆ getTween()

unsigned int KageLayer::getTween ( )
Here is the caller graph for this function:

◆ groupSelectedShapes()

std::vector< unsigned int > KageLayer::groupSelectedShapes ( std::vector< unsigned int > p_selectedShapes)
Here is the caller graph for this function:

◆ isCurrentFrame()

bool KageLayer::isCurrentFrame ( unsigned int p_frameID)

Called by KageFrame for navigating to Next Frame.

Here is the caller graph for this function:

◆ isLocked()

bool KageLayer::isLocked ( )
Here is the caller graph for this function:

◆ isSelected()

bool KageLayer::isSelected ( )
Here is the caller graph for this function:

◆ isVisible()

bool KageLayer::isVisible ( )
Here is the caller graph for this function:

◆ lowerSelectedShape()

std::vector< unsigned int > KageLayer::lowerSelectedShape ( std::vector< unsigned int > p_selectedShapes)
Here is the caller graph for this function:

◆ lowerToBottomSelectedShape()

std::vector< unsigned int > KageLayer::lowerToBottomSelectedShape ( std::vector< unsigned int > p_selectedShapes)
Here is the caller graph for this function:

◆ moveToLeft()

bool KageLayer::moveToLeft ( )
Here is the caller graph for this function:

◆ moveToLeftAt()

bool KageLayer::moveToLeftAt ( unsigned int p_frame)

Moves Current Frame to Left.

Here is the call graph for this function:

◆ moveToLeftMost()

bool KageLayer::moveToLeftMost ( )

Moves Current Frame to Left on indicated Frame.

Here is the call graph for this function:

◆ operator=()

KageLayer KageLayer::operator= ( const KageLayer & p_layer)
Here is the call graph for this function:

◆ raiseSelectedShape()

std::vector< unsigned int > KageLayer::raiseSelectedShape ( std::vector< unsigned int > p_selectedShapes)
Here is the caller graph for this function:

◆ raiseToTopSelectedShape()

std::vector< unsigned int > KageLayer::raiseToTopSelectedShape ( std::vector< unsigned int > p_selectedShapes)
Here is the caller graph for this function:

◆ recenterRotationPoint()

bool KageLayer::recenterRotationPoint ( std::vector< unsigned int > p_selectedShapes)
Here is the caller graph for this function:

◆ removeAllFrames()

bool KageLayer::removeAllFrames ( )
Here is the caller graph for this function:

◆ removeFrame()

bool KageLayer::removeFrame ( )

If KageFrame is NULL or Last Frame (but not Frame-index0), remove Frame Widget, else, do below steps.

  1. Copy content of Frame+1 to Frame+0; then make Frame+1 as Frame+0
  2. If Frame+0 is not Last Frame, repeat 1
  3. Set last Frame = NULL
Returns
True if Last Frame widget was removed
Here is the call graph for this function:

◆ selectAllFrame()

bool KageLayer::selectAllFrame ( bool p_selectAll)

◆ setCurrentFrame()

void KageLayer::setCurrentFrame ( unsigned int p_frame,
bool p_addSelected )

For use of Kage. When a KageLayer is clicked, KageLayerManager will call this function via Kage then sets currently active Frame along Layer

Parameters
p_frameis Frame Number known to KageFrame(/Layer?)
p_addSelectedadd more selected Frame or not
See also
getCurrentFrame()
Here is the caller graph for this function:

◆ setCurrentFrameByID()

void KageLayer::setCurrentFrameByID ( unsigned int p_frameID)

◆ setExtendedFrameTween()

bool KageLayer::setExtendedFrameTween ( unsigned int p_frameID,
unsigned int p_tween )

◆ setFrameData()

bool KageLayer::setFrameData ( VectorDataManager p_vectorsData)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFrameDataToPreviousFrame()

bool KageLayer::setFrameDataToPreviousFrame ( VectorDataManager p_vectorsData,
unsigned int p_frameID )

Called by KageFrame if KageFrame is Extended.

◆ setFrameExtension()

void KageLayer::setFrameExtension ( KageFrame::extension p_extension)

Called by KageScene when duplicating Frame.

For use of Kage when loading KSF file

Parameters
p_extensionif start/mid/end of frame extension

◆ setLabel()

void KageLayer::setLabel ( std::string p_label)
Here is the caller graph for this function:

◆ setLock()

void KageLayer::setLock ( bool p_lock)
Here is the caller graph for this function:

◆ setPreviousFrameTween()

bool KageLayer::setPreviousFrameTween ( unsigned int p_frameID,
unsigned int p_tween )

Called by KageFrame if KageFrame is Extended.

◆ setSelected() [1/2]

void KageLayer::setSelected ( bool p_selected)

◆ setSelected() [2/2]

void KageLayer::setSelected ( KageFrame * p_frame)

For use of KageScene when Frame is added or duplicated

Parameters
p_frameis pointer to current KageFrame before Frame-add or Frame-duplicate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTween()

bool KageLayer::setTween ( unsigned int p_tween)
Here is the caller graph for this function:

◆ setVisible()

void KageLayer::setVisible ( bool p_visible)
Here is the caller graph for this function:

◆ switchToNextFrame() [1/2]

bool KageLayer::switchToNextFrame ( )

Called by KageFrame for navigating to Previous Frame.

index + 1 = becomes frameNumber for current. then +1 becomes frameNumber of Next Frame

Here is the call graph for this function:
Here is the caller graph for this function:

◆ switchToNextFrame() [2/2]

bool KageLayer::switchToNextFrame ( unsigned int p_frameID)

Called by FrameSet for navigating to Next Frame.

index + 1 = becomes frameNumber for current. then +1 becomes frameNumber of Next Frame

Here is the call graph for this function:

◆ switchToPreviousFrame() [1/2]

bool KageLayer::switchToPreviousFrame ( )

index + 1 = becomes frameNumber for current. then -1 becomes frameNumber of Previous Frame; thus ‘setCurrentFrame(i)’

Here is the call graph for this function:
Here is the caller graph for this function:

◆ switchToPreviousFrame() [2/2]

bool KageLayer::switchToPreviousFrame ( unsigned int p_frameID)

Called by FrameSet for navigating to Previous Frame.

index + 1 = becomes frameNumber for current. then -1 becomes frameNumber of Previous Frame; thus ‘setCurrentFrame(i)’

Here is the call graph for this function:

◆ toggleLock()

void KageLayer::toggleLock ( )
Here is the caller graph for this function:

◆ toggleVisibility()

void KageLayer::toggleVisibility ( )
Here is the caller graph for this function:

◆ ungroupSelectedShapes()

std::vector< unsigned int > KageLayer::ungroupSelectedShapes ( std::vector< unsigned int > p_selectedShapes)
Here is the caller graph for this function:

Field Documentation

◆ _activeFrame

unsigned int KageLayer::_activeFrame

Moves Current Frame to Left.

◆ _currentFrameID

unsigned int KageLayer::_currentFrameID

◆ _currentFrameIndex

unsigned int KageLayer::_currentFrameIndex

◆ _framePtr

KageFrame* KageLayer::_framePtr

◆ _label

std::string KageLayer::_label

◆ _lock

bool KageLayer::_lock

◆ _scene

KageScene* KageLayer::_scene

◆ _selected

bool KageLayer::_selected

◆ _visible

bool KageLayer::_visible

◆ frameCtr

unsigned int KageLayer::frameCtr

◆ Frames

std::vector<KageFrame*> KageLayer::Frames

◆ layerID

unsigned int KageLayer::layerID

The documentation for this class was generated from the following files: