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

#include <vectordatamanager.h>

Public Member Functions

 VectorDataManager ()
 
 VectorDataManager (std::vector< VectorData > p_vectorData)
 
virtual ~VectorDataManager ()
 
void setVectorData (std::vector< VectorData > p_vectorData)
 
std::vector< VectorDatagetVectorData ()
 
VectorDataManager clone ()
 
void clear ()
 
void addInit ()
 
void addInit (PointData p_point)
 
void addFill (ColorData p_color)
 
void addFill (std::string p_gradientID)
 
void addEndFill ()
 
void addClosePath ()
 
void addCubic (PointData p_point1, PointData p_point2, PointData p_point3)
 
void addQuadratic (PointData p_point1, PointData p_point2, PointData p_point3)
 
void addLine (PointData p_point)
 
void addLinePoly (PointData p_point, double p_x, double p_y)
 
void addMove (PointData p_point)
 
void addLineStyle (StrokeColorData p_stroke)
 
void addImage (PointData p_IDandBuff, PointData p_xy, PointData p_size, PointData p_scale, PointData p_rotateAlpha)
 
void push (VectorDataManager p_vectorsData)
 
bool isEmpty ()
 
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 recenterRotationPoint (std::vector< unsigned int > p_selectedShapes)
 
unsigned int getShape (unsigned int p_index)
 
bool isSelectedShape (unsigned int p_index)
 
void addSelectedShape (unsigned int p_index)
 
std::vector< unsigned int > tryMultiSelectShapes_populateShapes ()
 
std::vector< unsigned int > selectAllShapes ()
 
bool cutSelectedShapes ()
 
std::vector< VectorDatacopySelectedShapes (std::vector< unsigned int > p_selectedShapes)
 
std::vector< unsigned int > pasteSelectedShapes (std::vector< VectorData > p_vectorDataCopyBuffer)
 
bool deleteSelectedShapes (std::vector< unsigned int > p_selectedShapes)
 
void add (VectorData::type p_type, ColorData p_fill, StrokeColorData p_stroke)
 
void add (VectorData::type p_type, std::string p_fillGradientID, StrokeColorData p_stroke)
 
void addCurve (PointData p_point1, PointData p_point2, PointData p_point3, VectorData::type p_curveType)
 

Data Fields

const unsigned int _NO_SELECTION = -1
 
std::vector< unsigned int > _selectedNodes
 
std::vector< unsigned int > _selectedShapes
 
std::vector< VectorDatavectorData
 

Static Public Attributes

static unsigned int idmaker
 

Constructor & Destructor Documentation

◆ VectorDataManager() [1/2]

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

◆ VectorDataManager() [2/2]

VectorDataManager::VectorDataManager ( std::vector< VectorData > p_vectorData)
Here is the call graph for this function:

◆ ~VectorDataManager()

VectorDataManager::~VectorDataManager ( )
virtual

Member Function Documentation

◆ add() [1/2]

void VectorDataManager::add ( VectorData::type p_type,
ColorData p_fill,
StrokeColorData p_stroke )
Here is the caller graph for this function:

◆ add() [2/2]

void VectorDataManager::add ( VectorData::type p_type,
std::string p_fillGradientID,
StrokeColorData p_stroke )

◆ addClosePath()

void VectorDataManager::addClosePath ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addCubic()

void VectorDataManager::addCubic ( PointData p_point1,
PointData p_point2,
PointData p_point3 )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addCurve()

void VectorDataManager::addCurve ( PointData p_point1,
PointData p_point2,
PointData p_point3,
VectorData::type p_curveType )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addEndFill()

void VectorDataManager::addEndFill ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addFill() [1/2]

void VectorDataManager::addFill ( ColorData p_color)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addFill() [2/2]

void VectorDataManager::addFill ( std::string p_gradientID)
Here is the call graph for this function:

◆ addImage()

void VectorDataManager::addImage ( PointData p_IDandBuff,
PointData p_xy,
PointData p_size,
PointData p_scale,
PointData p_rotateAlpha )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addInit() [1/2]

void VectorDataManager::addInit ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addInit() [2/2]

void VectorDataManager::addInit ( PointData p_point)
Here is the call graph for this function:

◆ addLine()

void VectorDataManager::addLine ( PointData p_point)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addLinePoly()

void VectorDataManager::addLinePoly ( PointData p_point,
double p_x,
double p_y )
Here is the call graph for this function:

◆ addLineStyle()

void VectorDataManager::addLineStyle ( StrokeColorData p_stroke)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addMove()

void VectorDataManager::addMove ( PointData p_point)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addQuadratic()

void VectorDataManager::addQuadratic ( PointData p_point1,
PointData p_point2,
PointData p_point3 )
Here is the call graph for this function:

◆ addSelectedShape()

void VectorDataManager::addSelectedShape ( unsigned int p_index)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear()

void VectorDataManager::clear ( )

◆ clone()

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

◆ copySelectedShapes()

std::vector< VectorData > VectorDataManager::copySelectedShapes ( std::vector< unsigned int > p_selectedShapes)
Here is the caller graph for this function:

◆ cutSelectedShapes()

bool VectorDataManager::cutSelectedShapes ( )
Here is the call graph for this function:

◆ deleteSelectedShapes()

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

◆ duplicateShapes()

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

◆ flipHorizontalSelectedShape()

bool VectorDataManager::flipHorizontalSelectedShape ( std::vector< unsigned int > p_selectedShapes)
  1. get left-most, right-most, mid-point
  1. loop among selected shapes' points and invert point against location in left-mid-right
Here is the caller graph for this function:

◆ flipVerticalSelectedShape()

bool VectorDataManager::flipVerticalSelectedShape ( std::vector< unsigned int > p_selectedShapes)
  1. get upper-most, lower-most, mid-point
  1. loop among selected shapes' points and invert point against location in upper-mid-lower
Here is the caller graph for this function:

◆ getShape()

unsigned int VectorDataManager::getShape ( unsigned int p_index)
Here is the caller graph for this function:

◆ getVectorData()

std::vector< VectorData > VectorDataManager::getVectorData ( )
Here is the caller graph for this function:

◆ groupSelectedShapes()

std::vector< unsigned int > VectorDataManager::groupSelectedShapes ( std::vector< unsigned int > p_selectedShapes)

erase index if vectorType is TYPE INIT

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

◆ isEmpty()

bool VectorDataManager::isEmpty ( )

◆ isSelectedShape()

bool VectorDataManager::isSelectedShape ( unsigned int p_index)
Here is the caller graph for this function:

◆ lowerSelectedShape()

std::vector< unsigned int > VectorDataManager::lowerSelectedShape ( std::vector< unsigned int > p_selectedShapes)

Multiple selected Shapes can be lowered one step below its z-ordering by splicing the VectorData array into group of four. 1.) Whatever shape is behind the selected Shape less the one behind selected Shape 2.) The one behind the selected Shape 3.) The selected Shape itself 4.) All others infront of selected Shape These four groups will be merged back to one in this exact order: 1 + 3 + 2 + 4

Returns
True if it successfully lowered back selected Shape
See also
raiseSelectedShape(), raiseToTopSelectedShape() and lowerToBottomSelectedShape()
Here is the caller graph for this function:

◆ lowerToBottomSelectedShape()

std::vector< unsigned int > VectorDataManager::lowerToBottomSelectedShape ( std::vector< unsigned int > p_selectedShapes)

To move selected item to the bottom of z-ordering,

  1. Copy selected shapes to Buffer
  2. Delete selected shapes
  3. Append remaining shapes to Buffer
  4. Delete all remaining shapes
  5. Paste Buffer
    Returns
    True if it successfully lowered selected Shape to bottom of z-ordering
    See also
    raiseSelectedShape(), lowerSelectedShape() and raiseToTopSelectedShape()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pasteSelectedShapes()

std::vector< unsigned int > VectorDataManager::pasteSelectedShapes ( std::vector< VectorData > p_vectorDataCopyBuffer)
Here is the caller graph for this function:

◆ push()

void VectorDataManager::push ( VectorDataManager p_vectorsData)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ raiseSelectedShape()

std::vector< unsigned int > VectorDataManager::raiseSelectedShape ( std::vector< unsigned int > p_selectedShapes)

Multiple selected Shapes can be raised one step above its z-ordering by splicing the VectorData array into group of four. 1.) Whatever shape is behind the selected Shape 2.) The selected Shape itself 3.) The one directly infront of the selected Shape 4.) All others infront of selected Shape less the one infront of it These four groups will be merged back to one in this exact order: 1 + 3 + 2 + 4

Returns
True if it successfully lowered back selected Shape
See also
lowerSelectedShape(), raiseToTopSelectedShape() and lowerToBottomSelectedShape()
Here is the caller graph for this function:

◆ raiseToTopSelectedShape()

std::vector< unsigned int > VectorDataManager::raiseToTopSelectedShape ( std::vector< unsigned int > p_selectedShapes)

To move selected item to the top of z-ordering,

  1. Copy selected shapes to Buffer
  2. Delete selected shapes
  3. Paste Buffer
    Returns
    True if it successfully raised selected Shape on top of z-ordering
    See also
    raiseSelectedShape(), lowerSelectedShape() and lowerToBottomSelectedShape()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ recenterRotationPoint()

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

◆ selectAllShapes()

std::vector< unsigned int > VectorDataManager::selectAllShapes ( )
Here is the call graph for this function:

◆ setVectorData()

void VectorDataManager::setVectorData ( std::vector< VectorData > p_vectorData)
Here is the caller graph for this function:

◆ tryMultiSelectShapes_populateShapes()

std::vector< unsigned int > VectorDataManager::tryMultiSelectShapes_populateShapes ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ungroupSelectedShapes()

std::vector< unsigned int > VectorDataManager::ungroupSelectedShapes ( std::vector< unsigned int > p_selectedShapes)

insert TYPE INIT between ENDFILL and FILL

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

Field Documentation

◆ _NO_SELECTION

const unsigned int VectorDataManager::_NO_SELECTION = -1

◆ _selectedNodes

std::vector<unsigned int> VectorDataManager::_selectedNodes

◆ _selectedShapes

std::vector<unsigned int> VectorDataManager::_selectedShapes

◆ idmaker

unsigned int VectorDataManager::idmaker
static

◆ vectorData

std::vector<VectorData> VectorDataManager::vectorData

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