Kage Studio 0.7.230612
A Simple Free and Open Source 2D Animation Software
Loading...
Searching...
No Matches
vectordatamanager.h
Go to the documentation of this file.
1/*
2 * Kage Studio - a simple free and open source vector-based 2D animation software
3 * Copyright (C) 2011~2022 Mj Mendoza IV
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA. Or, see <https://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef GTKMM_KAGE_MANAGER_DATA_VECTOR_Hx
23 #define GTKMM_KAGE_MANAGER_DATA_VECTOR_Hx
24
25 #include <vector>
26 #include <iostream>
27
28 #include "data/color.h"
29 #include "data/point.h"
30 #include "data/strokecolor.h"
31 #include "data/vectordata.h"
32
33 class Kage; //forward declaration
34
35 using namespace std;
36
38 public:
39 static unsigned int idmaker;
41 VectorDataManager(vector<VectorData> p_vectorData);
42 virtual ~VectorDataManager();
43
44 void setVectorData(vector<VectorData> p_vectorData);
45 vector<VectorData> getVectorData();
47
48 void clear();
49 void addInit();
50 void addInit(PointData p_point);
51 void addFill(ColorData p_color);
52 void addFill(string p_gradientID);
53 void addEndFill();
54 void addClosePath();
55 void addCubic(PointData p_point1, PointData p_point2, PointData p_point3);
56 void addQuadratic(PointData p_point1, PointData p_point2, PointData p_point3);
57 void addLine(PointData p_point);
58 void addLinePoly(PointData p_point, double p_x, double p_y);
59 void addMove(PointData p_point);
60 void addLineStyle(StrokeColorData p_stroke);
61
62 void addImage(PointData p_IDandBuff, PointData p_xy, PointData p_scaleRotate);
63
64// void init(ColorData p_fill, StrokeColorData p_stroke);
65 void push(VectorDataManager p_vectorsData);
66
67 bool isEmpty();
68
69 vector<unsigned int> raiseSelectedShape(vector<unsigned int> p_selectedShapes);
70 vector<unsigned int> lowerSelectedShape(vector<unsigned int> p_selectedShapes);
71 vector<unsigned int> raiseToTopSelectedShape(vector<unsigned int> p_selectedShapes);
72 vector<unsigned int> lowerToBottomSelectedShape(vector<unsigned int> p_selectedShapes);
73 vector<unsigned int> groupSelectedShapes(vector<unsigned int> p_selectedShapes);
74 vector<unsigned int> ungroupSelectedShapes(vector<unsigned int> p_selectedShapes);
75 vector<unsigned int> duplicateShapes(vector<unsigned int> p_selectedShapes);
76 bool flipHorizontalSelectedShape(vector<unsigned int> p_selectedShapes);
77 bool flipVerticalSelectedShape(vector<unsigned int> p_selectedShapes);
78
79 bool recenterRotationPoint(vector<unsigned int> p_selectedShapes);
80 protected:
81 void add(VectorData::type p_type, ColorData p_fill, StrokeColorData p_stroke);
82 void add(VectorData::type p_type, string p_fillGradientID, StrokeColorData p_stroke);
83
84 vector<VectorData> vectorData;
85
86 void addCurve(PointData p_point1, PointData p_point2, PointData p_point3, VectorData::type p_curveType);
87
88 //for use on z-ordering~ish
89 vector<VectorData> copySelectedShapes(vector<unsigned int> p_selectedShapes);
90 vector<unsigned int> pasteSelectedShapes(vector<VectorData> p_vectorDataCopyBuffer);
91 bool deleteSelectedShapes(vector<unsigned int> p_selectedShapes);
92 };
93#endif //GTKMM_KAGE_MANAGER_DATA_VECTOR_Hx
Definition: color.h:28
Definition: kage.h:69
Definition: point.h:27
Definition: strokecolor.h:27
type
Definition: vectordata.h:34
Definition: vectordatamanager.h:37
void addLine(PointData p_point)
Definition: vectordatamanager.cpp:249
vector< VectorData > copySelectedShapes(vector< unsigned int > p_selectedShapes)
Definition: vectordatamanager.cpp:352
vector< unsigned int > lowerToBottomSelectedShape(vector< unsigned int > p_selectedShapes)
Definition: vectordatamanager.cpp:666
void addCurve(PointData p_point1, PointData p_point2, PointData p_point3, VectorData::type p_curveType)
Definition: vectordatamanager.cpp:312
bool deleteSelectedShapes(vector< unsigned int > p_selectedShapes)
Definition: vectordatamanager.cpp:401
vector< unsigned int > duplicateShapes(vector< unsigned int > p_selectedShapes)
Definition: vectordatamanager.cpp:767
void addCubic(PointData p_point1, PointData p_point2, PointData p_point3)
Definition: vectordatamanager.cpp:213
void add(VectorData::type p_type, ColorData p_fill, StrokeColorData p_stroke)
Definition: vectordatamanager.cpp:60
VectorDataManager clone()
Definition: vectordatamanager.cpp:202
bool isEmpty()
Definition: vectordatamanager.cpp:347
void addImage(PointData p_IDandBuff, PointData p_xy, PointData p_scaleRotate)
Definition: vectordatamanager.cpp:330
virtual ~VectorDataManager()
Definition: vectordatamanager.cpp:35
vector< VectorData > getVectorData()
Definition: vectordatamanager.cpp:43
void push(VectorDataManager p_vectorsData)
Definition: vectordatamanager.cpp:51
static unsigned int idmaker
Definition: vectordatamanager.h:39
vector< unsigned int > lowerSelectedShape(vector< unsigned int > p_selectedShapes)
Definition: vectordatamanager.cpp:545
vector< unsigned int > groupSelectedShapes(vector< unsigned int > p_selectedShapes)
Definition: vectordatamanager.cpp:698
void addLineStyle(StrokeColorData p_stroke)
Definition: vectordatamanager.cpp:288
vector< VectorData > vectorData
Definition: vectordatamanager.h:84
void addQuadratic(PointData p_point1, PointData p_point2, PointData p_point3)
Definition: vectordatamanager.cpp:217
bool recenterRotationPoint(vector< unsigned int > p_selectedShapes)
Definition: vectordatamanager.cpp:101
void addLinePoly(PointData p_point, double p_x, double p_y)
Definition: vectordatamanager.cpp:221
void setVectorData(vector< VectorData > p_vectorData)
Definition: vectordatamanager.cpp:39
vector< unsigned int > ungroupSelectedShapes(vector< unsigned int > p_selectedShapes)
Definition: vectordatamanager.cpp:724
void addClosePath()
Definition: vectordatamanager.cpp:300
VectorDataManager()
Definition: vectordatamanager.cpp:26
vector< unsigned int > raiseSelectedShape(vector< unsigned int > p_selectedShapes)
Definition: vectordatamanager.cpp:451
vector< unsigned int > pasteSelectedShapes(vector< VectorData > p_vectorDataCopyBuffer)
Definition: vectordatamanager.cpp:381
void clear()
Definition: vectordatamanager.cpp:47
vector< unsigned int > raiseToTopSelectedShape(vector< unsigned int > p_selectedShapes)
Definition: vectordatamanager.cpp:637
bool flipHorizontalSelectedShape(vector< unsigned int > p_selectedShapes)
Definition: vectordatamanager.cpp:784
void addMove(PointData p_point)
Definition: vectordatamanager.cpp:272
bool flipVerticalSelectedShape(vector< unsigned int > p_selectedShapes)
Definition: vectordatamanager.cpp:871
void addEndFill()
Definition: vectordatamanager.cpp:195
void addInit()
Definition: vectordatamanager.cpp:81
void addFill(ColorData p_color)
Definition: vectordatamanager.cpp:171