1 /***************************************************************************
2 * Copyright (C) 2006 by David Cuadrado *
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 2 of the License, or *
8 * (at your option) any later version. *
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. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
21 #ifndef YAMF_DRAWINGPHOTOGRAM_H
22 #define YAMF_DRAWINGPHOTOGRAM_H
24 #include <QGraphicsScene>
26 #include <yamf/common/yamf_exports.h>
51 * @brief Esta clase presenta un fotograma, un fotograma es agrupaciĆ³n de capas en el mismo marco.
52 * @author David Cuadrado \<krawek@gmail.com\>
54 class YAMF_EXPORT Photogram
: public QGraphicsScene
58 friend class PaintArea
;
60 Photogram(PaintArea
*parent
= 0);
63 void setCurrent(int pos
);
65 void setCurrentScene(Model::Scene
*scene
);
67 void drawItems(QPainter
*painter
, int numItems
, QGraphicsItem
*items
[], const QStyleOptionGraphicsItem options
[], QWidget
*widget
);
69 void drawPhotogram(int photogram
);
70 void addFrame(Model::Frame
*frame
, double opacity
= 1.0);
71 void addGraphicObject(Model::Object
*object
, double opacity
= 1.0);
75 void setNextOnionSkinCount(int n
);
76 void setPreviousOnionSkinCount(int n
);
78 void setLayerVisible(int layerIndex
, bool visible
);
80 Model::Scene
*scene() const;
82 void setTool(AbstractTool
*tool
);
83 AbstractTool
*currentTool() const;
85 bool isDrawing() const;
87 Model::Object
*recorded() const;
88 void recordObject(Model::Object
*record
);
90 BrushManager
*brushManager() const;
91 virtual void aboutToMousePress();
94 void drawCurrentPhotogram();
97 void mouseMoved(QGraphicsSceneMouseEvent
*event
);
98 void mouseReleased(QGraphicsSceneMouseEvent
*event
);
100 virtual void mousePressEvent(QGraphicsSceneMouseEvent
*event
);
101 virtual void mouseMoveEvent(QGraphicsSceneMouseEvent
*event
);
102 virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent
*mouseEvent
);
103 virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent
*event
);
104 virtual void keyPressEvent(QKeyEvent
*keyEvent
);
106 virtual void dragLeaveEvent( QGraphicsSceneDragDropEvent
* event
);
107 virtual void dragEnterEvent( QGraphicsSceneDragDropEvent
* event
);
108 virtual void dragMoveEvent( QGraphicsSceneDragDropEvent
* event
);
109 virtual void dropEvent( QGraphicsSceneDragDropEvent
* event
);
111 virtual bool event(QEvent
*e
);