22#ifndef GTKMM_KAGE_STAGE_H
23 #define GTKMM_KAGE_STAGE_H
25 #include <gtkmm/drawingarea.h>
33 #include <cairomm/context.h>
34 #include <gdkmm/general.h>
35 #include "../util/cairo/cairo_kage.h"
98 void setFill(Gdk::Color p_Color);
105 void clearScreen(Cairo::RefPtr<Cairo::Context> p_context);
106 void renderFrame(Cairo::RefPtr<Cairo::Context> p_context,
bool p_force =
false);
107 void renderOnionFrame(Cairo::RefPtr<Cairo::Context> p_context, vector<VectorData> p_vectorData,
double p_alpha);
108 void renderFrame(Cairo::RefPtr<Cairo::Context> p_context, vector<VectorData> p_vectorData,
double p_alpha = 1.0);
109 void renderFrameOffset(Cairo::RefPtr<Cairo::Context> p_context,
bool p_force =
false,
double p_offsetX = 0.0,
double p_offsetY = 0.0);
110 void renderFrameOffset(Cairo::RefPtr<Cairo::Context> p_context, vector<VectorData> p_vectorData,
double p_alpha = 1.0,
double p_offsetX = 0.0,
double p_offsetY = 0.0);
148 Glib::RefPtr<Gdk::Pixbuf>
_bg;
149 Cairo::RefPtr<Cairo::Surface>
_bgcr;
170 unsigned int getShape(
unsigned int p_index, vector<VectorData> p_v);
174 void updateShapeX(
double p_value,
bool p_stackDo =
true);
175 void updateShapeY(
double p_value,
bool p_stackDo =
true);
178 void updateNodeX(
double p_value,
bool p_stackDo =
true);
179 void updateNodeY(
double p_value,
bool p_stackDo =
true);
186 bool renderToPNG(
string p_path,
bool p_transparent);
187 bool renderToPNGOffset(
string p_path,
bool p_transparent,
double p_offsetX = 0.0,
double p_offsetY = 0.0);
189 void renderFrameToPNGOffset(Cairo::RefPtr<Cairo::Context> p_context,
double p_offsetX = 0.0,
double p_offsetY = 0.0);
191 Cairo::RefPtr<Cairo::Context>
cr;
206 vector<VectorData>
applyZoom(vector<VectorData> p_v);
240 virtual bool on_event(GdkEvent *e)
override;
242 bool on_draw(
const Cairo::RefPtr<Cairo::Context>&
cr)
override;
256 void renderNode(
double p_x,
double p_y,
unsigned int p_state = 5);
258 bool isMouseOnNode(
double p_x,
double p_y,
unsigned int p_buffer = 5);
type
Definition: anchor.h:30
AnchorData anchor_lowerRight
Definition: stage.h:275
void setSelectedShapes(vector< unsigned int > p_selectedShapes)
Definition: shape.cpp:28
void renderOnionFrame(Cairo::RefPtr< Cairo::Context > p_context, vector< VectorData > p_vectorData, double p_alpha)
Definition: stage.cpp:1148
bool on_draw(const Cairo::RefPtr< Cairo::Context > &cr) override
Definition: stage.cpp:929
bool isSelectedShape(unsigned int p_index)
Definition: shape.cpp:36
double polyXhead
Definition: stage.h:226
unsigned int mouseOnNode
Definition: stage.h:245
unsigned int drawCtr
Definition: stage.h:235
double polyYhead
Definition: stage.h:226
AnchorData anchor_center
Definition: stage.h:274
bool isMouseOnNode(double p_x, double p_y, unsigned int p_buffer=5)
Definition: node.cpp:949
unsigned int fps
Definition: stage.h:77
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_045
Definition: stage.h:42
void handleShapes_scaleNorth()
Definition: shape.cpp:57
double polyXtail
Definition: stage.h:227
GdkPoint _mouseLocation
Definition: stage.h:231
bool deleteSelectedNodes()
Definition: node.cpp:973
double nodeX
Definition: stage.h:87
PointData draw1
Definition: stage.h:218
bool renderToPNG(string p_path, bool p_transparent)
Definition: stage.cpp:1037
void clearScreen(Cairo::RefPtr< Cairo::Context > p_context)
for use with zoom; default value is stageWidth; can be changed as preferred
Definition: stage.cpp:1003
double propHeight
Definition: stage.h:86
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_NW
Definition: stage.h:47
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_135
Definition: stage.h:44
PointData drawFree2
Definition: stage.h:221
void updateNodeXY()
Definition: node.cpp:1137
unsigned int getSelectedShapeViaNode(unsigned int p_index, vector< VectorData > p_v)
Definition: node.cpp:743
unsigned int selectedNode
Definition: stage.h:249
double propY
Definition: stage.h:82
Cairo::RefPtr< Cairo::Context > cr
Definition: stage.h:191
void handleFill()
Definition: stage.cpp:1540
vector< unsigned int > selectedNodes
Definition: stage.h:252
void handleStrokeMouseUp()
Definition: stage.cpp:1533
void renderFrameOffset(Cairo::RefPtr< Cairo::Context > p_context, bool p_force=false, double p_offsetX=0.0, double p_offsetY=0.0)
Definition: stage.cpp:1131
unsigned int mouseOnNodeIndex
Definition: stage.h:248
PointData applyZoomRatio(PointData p_value)
Definition: stage.cpp:625
Gdk::Color getStroke()
Definition: stage.cpp:752
bool keyDownDown
Definition: stage.h:282
VectorDataManager _polyVectors
Definition: stage.h:228
PointData drawFree1
Definition: stage.h:220
vector< unsigned int > selectedShapes
Definition: stage.h:253
Glib::RefPtr< Gdk::Pixbuf > _bg
Definition: stage.h:148
void updateNodeY(double p_value, bool p_stackDo=true)
Definition: node.cpp:121
AnchorData anchor_rotate
Definition: stage.h:277
PointData _rotateReference
Definition: stage.h:202
bool pasteSelectedShapes()
Definition: shape.cpp:1290
bool toggleLineSelectedNodes()
Definition: node.cpp:1083
void invalidateToRender()
Definition: stage.cpp:914
PointData selectionBox2
Definition: stage.h:261
Cairo::RefPtr< Cairo::Surface > _bgcr
Definition: stage.h:149
bool keyUpDown
Definition: stage.h:281
void handleShapes_modifyingShape()
Definition: shape.cpp:691
double fpsElapse
Definition: stage.h:78
PointData _zoomReference
Definition: stage.h:198
const unsigned int _NO_SELECTION
Definition: stage.h:71
bool deleteSelectedShapes()
Definition: shape.cpp:1324
bool keyLeftDown
Definition: stage.h:283
bool keyShiftDown
Definition: stage.h:279
virtual bool on_key_press_event(GdkEventKey *e) override
Definition: stage.cpp:65
void applyZoom()
Definition: stage.cpp:654
short int drawFreeCtr
Definition: stage.h:224
PointData origin
Definition: stage.h:192
void handleDrawOvalMouseUp()
Definition: oval.cpp:28
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_090
Definition: stage.h:43
void normalizeSelectionBox()
Definition: node.cpp:912
int propXindex1
Definition: stage.h:80
bool _isModifyingShape
Definition: stage.h:194
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_000
Definition: stage.h:41
void updateShapeColor(bool p_doFill=true, bool p_doStroke=true)
Definition: shape.cpp:337
void handlePoly()
Definition: poly.cpp:88
unsigned int nodeIndexX
Definition: stage.h:89
PointData drawFree4
Definition: stage.h:223
PointData draw2
Definition: stage.h:219
Kage * win
Definition: stage.h:217
bool isSelectedNode(unsigned int p_index)
Definition: node.cpp:38
void handleDrawPolyMouseUp()
Definition: poly.cpp:28
double propX
Definition: stage.h:79
void handleShapes_scaleEast()
Definition: shape.cpp:113
virtual bool on_key_release_event(GdkEventKey *e) override
Definition: stage.cpp:158
void renderNodeControl(double p_x, double p_y, bool p_selected)
Definition: node.cpp:890
void handleNodes_rendering()
Definition: node.cpp:487
double propWidth
Definition: stage.h:85
void updateShapeXY()
Definition: shape.cpp:1371
PointData selectionBox1
Definition: stage.h:260
void handleDrawPencilMouseUp()
Definition: pencil.cpp:78
void handleDrawRectMouseUp()
Definition: rect.cpp:28
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_MOVE
Definition: stage.h:45
int _registerWidth
Definition: stage.h:286
virtual bool on_event(GdkEvent *e) override
Definition: stage.cpp:260
bool draw
Definition: stage.h:234
bool _rotateMode
Definition: stage.h:208
GdkPoint _copyBufferMouse
Definition: stage.h:233
void updateShapeWidth(double p_value)
Definition: shape.cpp:501
static ColorData stageBG
Definition: stage.h:72
void handleEyedrop()
Definition: stage.cpp:1551
void initNodeTool()
Definition: node.cpp:28
void handleDrawPencilMouseMove(PointData p_point)
Definition: pencil.cpp:47
void trySingleSelectShape()
Definition: shape.cpp:1083
double nodeY
Definition: stage.h:88
int propXindex2
Definition: stage.h:81
int propYindex2
Definition: stage.h:84
void handleShapesMouseDown()
void handleNodes_selection()
Definition: node.cpp:182
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_NE
Definition: stage.h:46
unsigned int selectedShape
Definition: stage.h:251
double currentScale
Definition: stage.h:104
PointData drawFree3
Definition: stage.h:222
GdkPoint drawConstraint
Definition: stage.h:225
void unpressKeys()
Definition: stage.cpp:248
void updateShapeHeight(double p_value)
Definition: shape.cpp:558
void setStageBG(Gdk::Color p_Color)
Gdk::Color getFill()
Definition: stage.cpp:726
void renderFrame(Cairo::RefPtr< Cairo::Context > p_context, bool p_force=false)
Definition: stage.cpp:1076
void renderNode(double p_x, double p_y, unsigned int p_state=5)
Definition: node.cpp:869
static GdkPoint moveStageXY
Definition: stage.h:76
void drawSelectionArea()
Definition: stage.cpp:1510
bool isSelectionBoxNormalized()
Definition: node.cpp:906
void handleFillMouseUp()
Definition: stage.cpp:1544
bool keyRightDown
Definition: stage.h:284
void handleNodes_relocation()
Definition: node.cpp:301
void handleShapes_modifyingShapeRotate()
Definition: shape.cpp:618
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_SE
Definition: stage.h:49
PointData __stageArea
Definition: stage.h:200
void tryMultiSelectShapes_populateShapes()
Definition: shape.cpp:1111
void handleShapes_updateAnchors(double p_x, double p_y)
Definition: shape.cpp:322
void addSelectedShape(unsigned int p_index)
Definition: shape.cpp:48
void setStroke(Gdk::Color p_Color)
Definition: stage.cpp:740
void handleShapesMouseUp()
Definition: shape.cpp:1179
double polyYtail
Definition: stage.h:227
void handlePencil()
Definition: pencil.cpp:115
bool keyControlDown
Definition: stage.h:280
unsigned int mouseOnShape
Definition: stage.h:250
static ToolMode toolMode
direct use for get only
Definition: stage.h:75
vector< unsigned int > getSelectedShapes()
Definition: shape.cpp:32
int propYindex1
Definition: stage.h:83
unsigned int mouseOnNodeHover
Definition: stage.h:247
bool handleNodes_getNearestShape(double p_x, double p_y, unsigned int p_index, vector< VectorData > p_v)
Definition: node.cpp:710
void handleNodesMouseUp()
Definition: node.cpp:646
double _zoomValue
Definition: stage.h:197
vector< VectorData > _vectorDataZOrderBufferA
Definition: stage.h:182
double _nodeToMouseDistance
Definition: stage.h:271
bool _stackDo
Definition: stage.h:180
void handleOval()
Definition: oval.cpp:75
bool renderToPNGOffset(string p_path, bool p_transparent, double p_offsetX=0.0, double p_offsetY=0.0)
Definition: stage.cpp:1091
bool cutSelectedShapes()
Definition: shape.cpp:1188
void handleShapes_scaleSouth()
Definition: shape.cpp:225
void setFill(Gdk::Color p_Color)
Definition: stage.cpp:714
double _zoomRatio
Definition: stage.h:196
void handleEyedropMouseUp()
Definition: stage.cpp:1627
AnchorData::type mouseOnAnchor
Definition: stage.h:255
void handleShapes_scaleWest()
Definition: shape.cpp:169
double stageHeight
Definition: stage.h:103
bool deleteSelectedNode(unsigned int p_index)
Definition: node.cpp:1005
void addSelectedNode(unsigned int p_index)
Definition: node.cpp:53
int _registerHeight
Definition: stage.h:287
bool copySelectedShapes()
Definition: shape.cpp:1210
void renderFrameToPNG(Cairo::RefPtr< Cairo::Context > p_context)
Definition: stage.cpp:1073
void updateShapeX(double p_value, bool p_stackDo=true)
Definition: shape.cpp:378
bool _rotateApply
Definition: stage.h:209
unsigned int getShape(unsigned int p_index, vector< VectorData > p_v)
Definition: shape.cpp:1166
void handleEyedropMouseMove()
Definition: stage.cpp:1619
AnchorData anchor_upperLeft
Definition: stage.h:273
void handleShapes_moveShape(double p_diffX, double p_diffY)
Definition: shape.cpp:281
void handleRect()
Definition: rect.cpp:58
unsigned int _mouseLocationShapeIndex
Definition: stage.h:232
PointData mouseOnNodeOffset
Definition: stage.h:246
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_SW
Definition: stage.h:48
void tryMultiSelectShapes()
Definition: shape.cpp:1121
vector< VectorData > _vectorDataCopyBuffer
Definition: stage.h:181
Glib::RefPtr< Gdk::Window > window
Definition: stage.h:229
void handleNodesMouseDown()
Definition: node.cpp:643
void updateNodeX(double p_value, bool p_stackDo=true)
Definition: node.cpp:63
bool cancelDrawingPoly()
Definition: poly.cpp:132
unsigned int nodeIndexY
Definition: stage.h:90
vector< VectorData > _vectorDataZOrderBufferB
Definition: stage.h:183
PointData __origin
Definition: stage.h:199
ToolMode
Definition: stage.h:55
@ MODE_SELECT
Definition: stage.h:57
@ MODE_MOVE_STAGE
Definition: stage.h:63
@ MODE_NONE
Definition: stage.h:56
@ MODE_ZOOM
Definition: stage.h:62
@ MODE_DRAW_TEXT
Definition: stage.h:65
@ MODE_FILL
Definition: stage.h:60
@ MODE_DRAW_POLY
Definition: stage.h:66
@ MODE_DRAW_RECT
Definition: stage.h:64
@ MODE_STROKE
Definition: stage.h:59
@ MODE_NODE
Definition: stage.h:58
@ MODE_DRAW_OVAL
Definition: stage.h:67
@ MODE_DRAW_PENCIL
Definition: stage.h:69
@ MODE_EYEDROP
Definition: stage.h:61
@ MODE_DRAW_LINE
Definition: stage.h:68
void handleShapes()
Definition: shape.cpp:917
vector< VectorData > _vectorDataZOrderBufferC
Definition: stage.h:184
bool mouseDown
Definition: stage.h:230
bool deselectSelectedShapes()
Definition: shape.cpp:1268
void updateShapeY(double p_value, bool p_stackDo=true)
Definition: shape.cpp:439
void handleNodes()
Definition: node.cpp:177
bool selectAllShapes()
Definition: shape.cpp:1245
void printVectors()
Definition: stage.cpp:766
static StrokeColorData stroke
direct use for get only
Definition: stage.h:74
double stageWidth
Definition: stage.h:102
static Glib::RefPtr< Gdk::Pixbuf > imageSHAPE_ROTATE
Definition: stage.h:50
virtual bool on_expose_event(GdkEventExpose *e)
Definition: stage.cpp:242
ToolMode prevTool
Definition: stage.h:216
static ColorData fillColor
direct use for get only
Definition: stage.h:73
void cleanSlate()
Definition: stage.cpp:875
void handleDrawPencilMouseDown(PointData p_point)
Definition: pencil.cpp:28
bool deselectSelectedNodes()
Definition: node.cpp:957
void renderFrameToPNGOffset(Cairo::RefPtr< Cairo::Context > p_context, double p_offsetX=0.0, double p_offsetY=0.0)
Definition: stage.cpp:1127
bool isNodeOnSelectionBox(double p_nodeX, double p_nodeY)
Definition: node.cpp:940
void handleStrokeMouseMove()
Definition: stage.cpp:1529
virtual ~KageStage()
Definition: stage.cpp:61
Definition: strokecolor.h:27
Definition: vectordatamanager.h:37