Commit 5d9ffdd3 authored by roangel's avatar roangel
Browse files

Solved zoom issue, now text and handlers will stay same size when zooming....

Solved zoom issue, now text and handlers will stay same size when zooming. Added IDs. Separated rectangles in 2 kinds: CrazyFlyZone and Table(still to be implemented)
parent 94abccb9
......@@ -53,7 +53,8 @@ SOURCES = main.cpp \
myGraphicsScene.cpp \
myGraphicsRectItem.cpp \
cornergrabber.cpp \
myGraphicsView.cpp moc_mainguiwindow.cpp \
myGraphicsView.cpp \
crazyFlyZone.cpp moc_mainguiwindow.cpp \
moc_myGraphicsScene.cpp \
moc_myGraphicsView.cpp
OBJECTS = main.o \
......@@ -62,6 +63,7 @@ OBJECTS = main.o \
myGraphicsRectItem.o \
cornergrabber.o \
myGraphicsView.o \
crazyFlyZone.o \
moc_mainguiwindow.o \
moc_myGraphicsScene.o \
moc_myGraphicsView.o
......@@ -218,12 +220,14 @@ DIST = /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/mkspecs/features/spec_pre.prf
myGraphicsScene.h \
myGraphicsRectItem.h \
cornergrabber.h \
myGraphicsView.h main.cpp \
myGraphicsView.h \
crazyFlyZone.h main.cpp \
mainguiwindow.cpp \
myGraphicsScene.cpp \
myGraphicsRectItem.cpp \
cornergrabber.cpp \
myGraphicsView.cpp
myGraphicsView.cpp \
crazyFlyZone.cpp
QMAKE_TARGET = untitled
DESTDIR =
TARGET = untitled
......@@ -556,8 +560,8 @@ dist: distdir FORCE
distdir: FORCE
@test -d $(DISTDIR) || mkdir -p $(DISTDIR)
$(COPY_FILE) --parents $(DIST) $(DISTDIR)/
$(COPY_FILE) --parents mainguiwindow.h myGraphicsScene.h myGraphicsRectItem.h cornergrabber.h myGraphicsView.h $(DISTDIR)/
$(COPY_FILE) --parents main.cpp mainguiwindow.cpp myGraphicsScene.cpp myGraphicsRectItem.cpp cornergrabber.cpp myGraphicsView.cpp $(DISTDIR)/
$(COPY_FILE) --parents mainguiwindow.h myGraphicsScene.h myGraphicsRectItem.h cornergrabber.h myGraphicsView.h crazyFlyZone.h $(DISTDIR)/
$(COPY_FILE) --parents main.cpp mainguiwindow.cpp myGraphicsScene.cpp myGraphicsRectItem.cpp cornergrabber.cpp myGraphicsView.cpp crazyFlyZone.cpp $(DISTDIR)/
$(COPY_FILE) --parents mainguiwindow.ui $(DISTDIR)/
......@@ -746,9 +750,12 @@ moc_mainguiwindow.cpp: /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QMai
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpen.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qscrollarea.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsscene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QWheelEvent \
myGraphicsScene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsScene \
crazyFlyZone.h \
myGraphicsRectItem.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsSimpleTextItem \
cornergrabber.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QObject \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsItem \
......@@ -842,6 +849,7 @@ moc_myGraphicsScene.cpp: /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QG
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qsharedpointer_impl.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qfont.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpen.h \
crazyFlyZone.h \
myGraphicsRectItem.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsRectItem \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsitem.h \
......@@ -852,6 +860,7 @@ moc_myGraphicsScene.cpp: /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QG
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qlocale.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qset.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qcontiguouscache.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsSimpleTextItem \
cornergrabber.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QObject \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsItem \
......@@ -976,6 +985,7 @@ moc_myGraphicsView.cpp: /home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGr
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qvector2d.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qtouchdevice.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsscene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QWheelEvent \
myGraphicsView.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/bin/moc
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/bin/moc $(DEFINES) -I/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/mkspecs/linux-g++ -I/home/gazebo-cf/work/D-FaLL-System/crazyflie_ws/sandbox/crazypkg/gui/untitled -I/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include -I/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets -I/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui -I/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore -I/usr/include/c++/5 -I/usr/include/x86_64-linux-gnu/c++/5 -I/usr/include/c++/5/backward -I/usr/lib/gcc/x86_64-linux-gnu/5/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include myGraphicsView.h -o moc_myGraphicsView.cpp
......@@ -1092,7 +1102,8 @@ ui_mainguiwindow.h: mainguiwindow.ui \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qfiledevice.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qvector2d.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qtouchdevice.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsscene.h
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsscene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QWheelEvent
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/bin/uic mainguiwindow.ui -o ui_mainguiwindow.h
compiler_yacc_decl_make_all:
......@@ -1265,9 +1276,12 @@ main.o: main.cpp mainguiwindow.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpen.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qscrollarea.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsscene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QWheelEvent \
myGraphicsScene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsScene \
crazyFlyZone.h \
myGraphicsRectItem.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsSimpleTextItem \
cornergrabber.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QObject \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsItem \
......@@ -1441,9 +1455,12 @@ mainguiwindow.o: mainguiwindow.cpp mainguiwindow.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpen.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qscrollarea.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsscene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QWheelEvent \
myGraphicsScene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsScene \
crazyFlyZone.h \
myGraphicsRectItem.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsSimpleTextItem \
cornergrabber.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QObject \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsItem \
......@@ -1544,6 +1561,7 @@ myGraphicsScene.o: myGraphicsScene.cpp myGraphicsScene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qsharedpointer_impl.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qfont.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpen.h \
crazyFlyZone.h \
myGraphicsRectItem.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsRectItem \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsitem.h \
......@@ -1554,6 +1572,7 @@ myGraphicsScene.o: myGraphicsScene.cpp myGraphicsScene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qlocale.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qset.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qcontiguouscache.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsSimpleTextItem \
cornergrabber.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QObject \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsItem \
......@@ -1675,6 +1694,7 @@ myGraphicsRectItem.o: myGraphicsRectItem.cpp myGraphicsRectItem.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qimage.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpixelformat.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qtransform.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsSimpleTextItem \
cornergrabber.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QObject \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsItem \
......@@ -1923,9 +1943,123 @@ myGraphicsView.o: myGraphicsView.cpp myGraphicsView.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qfiledevice.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qvector2d.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qtouchdevice.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsscene.h
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsscene.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QWheelEvent \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QApplication \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qapplication.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qcoreapplication.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qeventloop.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qdesktopwidget.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qguiapplication.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qinputmethod.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QMouseEvent
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o myGraphicsView.o myGraphicsView.cpp
crazyFlyZone.o: crazyFlyZone.cpp crazyFlyZone.h \
myGraphicsRectItem.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsRectItem \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicsitem.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qglobal.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qconfig.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qfeatures.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qsystemdetection.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qprocessordetection.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qcompilerdetection.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qtypeinfo.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qtypetraits.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qisenum.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qsysinfo.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qlogging.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qflags.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qatomic.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qbasicatomic.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qatomic_bootstrap.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qgenericatomic.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qatomic_cxx11.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qatomic_msvc.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qglobalstatic.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qmutex.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qnumeric.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qversiontagging.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qobject.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qobjectdefs.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qnamespace.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qobjectdefs_impl.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qstring.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qchar.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qbytearray.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qrefcount.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qarraydata.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qstringbuilder.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qlist.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qalgorithms.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qiterator.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qhashfunctions.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qpair.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qbytearraylist.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qstringlist.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qregexp.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qstringmatcher.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qcoreevent.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qscopedpointer.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qmetatype.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qvarlengtharray.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qcontainerfwd.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qobject_impl.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qvariant.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qmap.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qdebug.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qhash.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qtextstream.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qiodevice.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qlocale.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qshareddata.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qvector.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qpoint.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qset.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qcontiguouscache.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qsharedpointer.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qsharedpointer_impl.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qrect.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qmargins.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qsize.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpainterpath.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qmatrix.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpolygon.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qregion.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qwindowdefs.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qwindowdefs_win.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qdatastream.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/qline.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpixmap.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpaintdevice.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qcolor.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qrgb.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qrgba64.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qimage.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpixelformat.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qtransform.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsSimpleTextItem \
cornergrabber.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QObject \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsItem \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsTextItem \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsSceneHoverEvent \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/qgraphicssceneevent.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtWidgets/QGraphicsSceneMouseEvent \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QColor \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QPainter \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpainter.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qtextoption.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qpen.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qbrush.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qfontinfo.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qfont.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/qfontmetrics.h \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtGui/QPen \
/home/gazebo-cf/Qt5.7.0/5.7/gcc_64/include/QtCore/QPointF
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o crazyFlyZone.o crazyFlyZone.cpp
moc_mainguiwindow.o: moc_mainguiwindow.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainguiwindow.o moc_mainguiwindow.cpp
......
......@@ -2,24 +2,21 @@
CornerGrabber::CornerGrabber(QGraphicsItem *parent, int corner) :
QGraphicsItem(parent),
mouseDownX(0),
mouseDownY(0),
_outterborderColor(Qt::black),
_outterborderPen(),
_width(6),
_height(6),
_width(GRABBER_WIDTH),
_height(GRABBER_HEIGHT),
_corner(corner),
_mouseButtonState(kMouseReleased),
_is_active(false)
{
setParentItem(parent);
_outterborderPen.setWidth(2);
_outterborderPen.setColor(_outterborderColor);
this->setAcceptHoverEvents(true);
this->setAcceptHoverEvents(true);
this->setFlag(QGraphicsItem::ItemIgnoresTransformations);
}
qreal CornerGrabber::getHeight()
{
return _height;
......@@ -30,16 +27,6 @@ qreal CornerGrabber::getWidth()
return _width;
}
void CornerGrabber::setMouseState(int s)
{
_mouseButtonState = s;
}
int CornerGrabber::getMouseState()
{
return _mouseButtonState;
}
int CornerGrabber::getCorner()
{
return _corner;
......@@ -99,26 +86,71 @@ void CornerGrabber::hoverEnterEvent ( QGraphicsSceneHoverEvent * )
QRectF CornerGrabber::boundingRect() const
{
return QRectF(0,0,_width,_height);
QRectF bounding_rect = this->rect();
return bounding_rect;
}
QRectF CornerGrabber::rect() const
{
return _rect;
}
void CornerGrabber::setRect(const QRectF & rectangle)
{
_rect = rectangle;
}
void CornerGrabber::paint (QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
{
// fill the box with solid color, use sharp corners
prepareGeometryChange();
_outterborderPen.setCapStyle(Qt::SquareCap);
_outterborderPen.setStyle(Qt::SolidLine);
painter->setPen(_outterborderPen);
QPointF topLeft (0, 0);
QPointF bottomRight ( _width, _height);
QRectF rect (topLeft, bottomRight);
QRectF rect = createRect();
this->setRect(rect);
QBrush brush (Qt::SolidPattern);
brush.setColor (_outterborderColor);
painter->fillRect(rect,brush);
painter->fillRect(_rect,brush);
}
QRectF CornerGrabber::createRect()
{
QPointF topLeft(0,0);
QPointF bottomRight(_width, _height);
QRectF rect(topLeft, bottomRight);
switch(_corner)
{
case CornerGrabber::bottomLeft:
{
QPointF move_to(0,0);
rect.moveBottomLeft(move_to);
return rect;
break;
}
case CornerGrabber::topLeft:
{
return rect;
break;
}
case CornerGrabber::topRight:
{
QPointF move_to(0,0);
rect.moveTopRight(move_to);
return rect;
break;
}
case CornerGrabber::bottomRight:
{
QPointF move_to(0,0);
rect.moveBottomRight(move_to);
return rect;
break;
}
default:
break;
}
}
......@@ -13,6 +13,8 @@
#include <QPointF>
#define GRABBER_HEIGHT 10
#define GRABBER_WIDTH 10
class CornerGrabber : public QGraphicsItem
{
......@@ -21,19 +23,13 @@ public:
explicit CornerGrabber(QGraphicsItem *parent = 0, int corner = 0);
int getCorner(); ///< allows the owner to find out which coner this is
void setMouseState(int); ///< allows the owner to record the current mouse state
int getMouseState(); ///< allows the owner to get the current mouse state
qreal getHeight();
qreal getWidth();
bool isActive();
QRectF rect() const;
qreal mouseDownX;
qreal mouseDownY;
enum {kMouseReleased=0, kMouseDown, kMouseMoving}; ///< define the mouse states
enum {noCorner, bottomLeft, topLeft, topRight, bottomRight};
private:
virtual QRectF boundingRect() const; ///< must be re-implemented in this class to provide the diminsions of the box to the QGraphicsView
......@@ -52,6 +48,9 @@ private:
virtual void mousePressEvent(QGraphicsSceneDragDropEvent *event);
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent * event );
QRectF createRect();
void setRect(const QRectF & rectangle);
QColor _outterborderColor; ///< the hover event handlers will toggle this between red and black
QPen _outterborderPen; ///< the pen is used to paint the red/black border
......@@ -62,9 +61,7 @@ private:
bool _is_active;
int _mouseButtonState;
QRectF _rect;
};
#endif // CORNERGRABBER_H
#include "crazyFlyZone.h"
crazyFlyZone::crazyFlyZone(const QRectF & rect, int index, QGraphicsItem * parent)
: myGraphicsRectItem(rect, parent)
{
setIndex(index);
}
void crazyFlyZone::updateLabel(QString string)
{
label->setText(string);
setLabelPosition();
}
void crazyFlyZone::setLabel(QString string)
{
label = new QGraphicsSimpleTextItem(string, this);
label->setFlag(QGraphicsItem::ItemIgnoresTransformations);
label->setFont(QFont("Arial", 18, QFont::Bold, true));
// TODO: choose position and format of text
// label->setPos(label->mapToItem(this, QPointF(0,0)));
setLabelPosition();
}
void crazyFlyZone::setLabelPosition()
{
qreal x_offset = 10;
qreal y_offset = 5;
label->setPos(this->rect().topLeft().x() + x_offset,this->rect().topLeft().y() + y_offset);
}
int crazyFlyZone::getIndex()
{
return _index;
}
void crazyFlyZone::setIndex(int index)
{
// TODO: how to make sure that we never have two rectangles with the same index?
// Maybe only when we reduce the size of the rectangles vector?
_index = index;
}
void crazyFlyZone::rectSizeChanged()
{
setLabelPosition();
}
#ifndef CRAZYFLYZONE_H
#define CRAZYFLYZONE_H
#include <QGraphicsSimpleTextItem>
#include "myGraphicsRectItem.h"
class crazyFlyZone : public myGraphicsRectItem
{
public:
explicit crazyFlyZone(const QRectF & rect, int index, QGraphicsItem * parent = 0);
int getIndex();
void setIndex(int index);
void setLabel(QString string);
void setLabelPosition();
void updateLabel(QString string);
void rectSizeChanged();
protected:
private:
int _index;
QGraphicsSimpleTextItem* label;
};
#endif
......@@ -6,8 +6,9 @@
#include <QBrush>
#include <QApplication>
#include <QVariant>
#include <string.h>
myGraphicsRectItem::myGraphicsRectItem(const QRectF & rect, QGraphicsItem * parent)
myGraphicsRectItem::myGraphicsRectItem(const QRectF & rect, QGraphicsItem * parent)
: QGraphicsRectItem(rect, parent)
{
this->setFlag(QGraphicsItem::ItemIsSelectable);
......@@ -19,9 +20,9 @@ myGraphicsRectItem::myGraphicsRectItem(const QRectF & rect, QGraphicsItem * pare
tmp_rect = 0;
_grabbers_created = false;
resize_mode = false;
// this->setAcceptHoverEvents(true);
}
void myGraphicsRectItem::deleteGrabbers()
{
_bottomLeft_corner->setParentItem(NULL);
......@@ -77,11 +78,10 @@ bool myGraphicsRectItem::grabbersAreCreated()
void myGraphicsRectItem::setCornerPositions() //need to call this function whenever we chnge the size of the rectangle
{
QRectF rect = this->rect();
_bottomLeft_corner->setPos(rect.bottomLeft().x(), rect.bottomLeft().y() - _bottomLeft_corner->getHeight());
_bottomLeft_corner->setPos(rect.bottomLeft().x(), rect.bottomLeft().y());
_topLeft_corner->setPos(rect.topLeft().x(), rect.topLeft().y());
_topRight_corner->setPos(rect.topRight().x() - _topRight_corner->getWidth(), rect.topRight().y());
_bottomRight_corner->setPos(rect.bottomRight().x() - _bottomRight_corner->getWidth(), rect.bottomRight().y() - _bottomRight_corner->getHeight());
_topRight_corner->setPos(rect.topRight().x(), rect.topRight().y());
_bottomRight_corner->setPos(rect.bottomRight().x(), rect.bottomRight().y());
}
void myGraphicsRectItem::createGrabbers()
......@@ -91,7 +91,7 @@ void myGraphicsRectItem::createGrabbers()
_bottomLeft_corner = new CornerGrabber(this, CornerGrabber::bottomLeft);
_topLeft_corner = new CornerGrabber(this, CornerGrabber::topLeft);
_topRight_corner = new CornerGrabber(this, CornerGrabber::topRight);
_bottomRight_corner = new CornerGrabber(this, CornerGrabber::topRight);
_bottomRight_corner = new CornerGrabber(this, CornerGrabber::bottomRight);
_bottomLeft_corner->installSceneEventFilter(this);
......@@ -155,7 +155,6 @@ void myGraphicsRectItem::mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent)
QRectF resize_rect = this->rect();
resize_rect.setBottomLeft(mouseEvent->pos());
this->setRect(resize_rect.normalized());
setCornerPositions();
break;
}
case CornerGrabber::topLeft:
......@@ -164,7 +163,6 @@ void myGraphicsRectItem::mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent)
QRectF resize_rect = this->rect();
resize_rect.setTopLeft(mouseEvent->pos());
this->setRect(resize_rect.normalized());
setCornerPositions();
break;
}
case CornerGrabber::topRight:
......@@ -173,7 +171,6 @@ void myGraphicsRectItem::mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent)
QRectF resize_rect = this->rect();
resize_rect.setTopRight(mouseEvent->pos());
this->setRect(resize_rect.normalized());
setCornerPositions();
break;
}
case CornerGrabber::bottomRight:
......@@ -182,7 +179,6 @@ void myGraphicsRectItem::mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent)
QRectF resize_rect = this->rect();
resize_rect.setBottomRight(mouseEvent->pos());
this->setRect(resize_rect.normalized());
setCornerPositions();
break;
}
case CornerGrabber::noCorner:
......@@ -190,6 +186,8 @@ void myGraphicsRectItem::mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent)
default:
break;
}
setCornerPositions();
rectSizeChanged();
}
QGraphicsRectItem::mouseMoveEvent(mouseEvent);