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

#include <assetmanager.h>

Inheritance diagram for KageAssetManager:
Collaboration diagram for KageAssetManager:

Public Member Functions

 KageAssetManager (Kage *p_kage)
 
virtual ~KageAssetManager ()
 
unsigned int assetCount ()
 
unsigned int addAsset (Glib::ustring p_name="")
 
void deleteAsset ()
 
bool removeAllAssets ()
 
void setSelected (KageAsset *p_asset)
 
KageAssetgetAsset ()
 
unsigned int getCurrentAsset ()
 
void setCurrentAsset (unsigned int p_asset)
 
void setCurrentAssetByID (unsigned int p_assetID)
 
void renderStage ()
 
KageAsset::AssetType getAssetType ()
 
void setAssetType (KageAsset::AssetType p_assetType)
 
void render (unsigned int p_renderID)
 
void renameAsset (KageAsset *p_asset)
 
void renameAsset ()
 
void setLabel (string p_label)
 Sets the label of current active Asset.
 
string getLabel ()
 
bool moveToTop ()
 
bool moveUp ()
 
bool moveDown ()
 
bool moveToBottom ()
 
bool exists (string p_filePath)
 
void setAssetHash (string p_assetHash)
 
string getImagePathByID (unsigned int p_index)
 
string getImageByID (unsigned int p_id)
 
void renderLibrary (unsigned int p_ID)
 

Data Fields

string _KageStudioAsset
 
Kage_kage
 

Protected Attributes

unsigned int assetCtr
 
std::vector< Gtk::Button * > labels
 
std::vector< KageAsset * > assets
 
unsigned int _currentAssetID
 
unsigned int _currentAssetIndex
 

Constructor & Destructor Documentation

◆ KageAssetManager()

KageAssetManager::KageAssetManager ( Kage p_kage)
Here is the call graph for this function:

◆ ~KageAssetManager()

KageAssetManager::~KageAssetManager ( )
virtual

Member Function Documentation

◆ addAsset()

unsigned int KageAssetManager::addAsset ( Glib::ustring  p_name = "")

TODO:

  1. [DONE] check p_name exists – done in Kage with AssetManager
  2. if project is saved, copy file to project path [DONE] else, copy file to temporary
  3. [DONE] create hash for path and filesize for future check by assetManager if already existing in Library use kHash from Quixie

TODO:

  1. [DONE] check if file p_name exists
  2. [DONE] if existing, copy to temp path
  3. [DONE] load copied file – use original path as hash
  4. select image on stage
  5. resize image on stage
  6. delete image on stage
  7. add image on stage FROM LIBRARY (double click)
  8. add image on stage FROM ASSET (double click)
  9. add image on stage FROM LIBRARY (drag-n-drop)
  10. add image on stage FROM ASSET (drag-n-dropl)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ assetCount()

unsigned int KageAssetManager::assetCount ( )

For use of Kage when exporting/saving to file.

Returns
size of array of KageAsset
Here is the caller graph for this function:

◆ deleteAsset()

void KageAssetManager::deleteAsset ( )
Here is the call graph for this function:

◆ exists()

bool KageAssetManager::exists ( string  p_filePath)

Checks all Asset if already imported

Parameters
p_filePathAsset's full path1
Returns
true if p_filePath is in AssetManager. Otherwise, false.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAsset()

KageAsset * KageAssetManager::getAsset ( )

Not to be confused of getCurrentAsset(). This function returns the pointer to active KageAsset Object to caller

Returns
pointer to registered active asset
Here is the call graph for this function:

◆ getAssetType()

KageAsset::AssetType KageAssetManager::getAssetType ( )
Here is the call graph for this function:

◆ getCurrentAsset()

unsigned int KageAssetManager::getCurrentAsset ( )

For use of Kage. To keep track of active Asset in-check of all assets in KageAssetManager.

Returns
index of registered active asset
See also
setCurrentAsset()
Here is the call graph for this function:

◆ getImageByID()

string KageAssetManager::getImageByID ( unsigned int  p_id)

For use by Stage when rendering an Asset, it needs the image path (why not the loaded image object?)

Parameters
p_id
Here is the call graph for this function:

◆ getImagePathByID()

string KageAssetManager::getImagePathByID ( unsigned int  p_index)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLabel()

string KageAssetManager::getLabel ( )
Here is the call graph for this function:

◆ moveDown()

bool KageAssetManager::moveDown ( )

NOTE: assets are organized as index 0 as BOTTOM and last index is TOP

See also
moveToBottom() moveToTop() moveUp()
Returns
True if successfully moved to bottom
Here is the call graph for this function:
Here is the caller graph for this function:

◆ moveToBottom()

bool KageAssetManager::moveToBottom ( )

NOTE: assets are organized as index 0 as BOTTOM and last index is TOP

See also
moveDown() moveToTop() moveUp()
Returns
True if successfully moved to bottom
Here is the call graph for this function:

◆ moveToTop()

bool KageAssetManager::moveToTop ( )

NOTE: assets are organized as index 0 as BOTTOM and last index is TOP

See also
moveDown() moveToBottom() moveUp()
Returns
True if successfully moved to bottom
Here is the call graph for this function:

◆ moveUp()

bool KageAssetManager::moveUp ( )

NOTE: assets are organized as index 0 as BOTTOM and last index is TOP

See also
moveDown() moveToBottom() moveToTop()
Returns
True if successfully moved to bottom
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeAllAssets()

bool KageAssetManager::removeAllAssets ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ renameAsset() [1/2]

void KageAssetManager::renameAsset ( )

For use of Kage when User clicked Asset->Rename

See also
renameAsset(KageAsset)
Here is the call graph for this function:

◆ renameAsset() [2/2]

void KageAssetManager::renameAsset ( KageAsset p_asset)

For use of KageAsset when User double-clicked Asset

See also
renameAsset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ render()

void KageAssetManager::render ( unsigned int  p_renderID)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ renderLibrary()

void KageAssetManager::renderLibrary ( unsigned int  p_ID)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ renderStage()

void KageAssetManager::renderStage ( )

For use of KageAsset. When a KageAsset's visibility is clicked, this function will be called to reflect Asset's visibility on stage.

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

◆ setAssetHash()

void KageAssetManager::setAssetHash ( string  p_assetHash)

Set's an Asset's hash

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

◆ setAssetType()

void KageAssetManager::setAssetType ( KageAsset::AssetType  p_assetType)

Set the AssetType of the selected Asset

Parameters
p_assetTypewhich AssetType to set
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCurrentAsset()

void KageAssetManager::setCurrentAsset ( unsigned int  p_asset)

For use of Kage. When a KageFrame is clicked, KageFramesetManager will call this function via Kage then sets currently active Asset via Index

Parameters
p_assetis index of Asset known to KageFrame
See also
getCurrentAsset()
Here is the call graph for this function:

◆ setCurrentAssetByID()

void KageAssetManager::setCurrentAssetByID ( unsigned int  p_assetID)

For use of Kage. When a KageFrame is clicked, KageFramesetManager will call this function via Kage then sets currently active Asset via Asset ID

Parameters
p_assetIDis assetID of Asset known to KageFrame
See also
getCurrentAsset()
Here is the call graph for this function:

◆ setLabel()

void KageAssetManager::setLabel ( string  p_label)

Sets the label of current active Asset.

Parameters
p_labelthe new label for the active Asset
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSelected()

void KageAssetManager::setSelected ( KageAsset p_asset)

For use of KageAsset. When a KageAsset is clicked, previously clicked KageAsset should be un-selected.

Parameters
p_assetis pointer to KageAsset who called this function
Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ _currentAssetID

unsigned int KageAssetManager::_currentAssetID
protected

◆ _currentAssetIndex

unsigned int KageAssetManager::_currentAssetIndex
protected

◆ _kage

Kage* KageAssetManager::_kage

◆ _KageStudioAsset

string KageAssetManager::_KageStudioAsset

◆ assetCtr

unsigned int KageAssetManager::assetCtr
protected

◆ assets

std::vector<KageAsset*> KageAssetManager::assets
protected

◆ labels

std::vector<Gtk::Button*> KageAssetManager::labels
protected

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