Skip to content
Snippets Groups Projects
Commit b5bf1a7d authored by Erik Andresen's avatar Erik Andresen
Browse files

Merge branch 'v0.8'

Conflicts:
	CHANGELOG.md
parents 11ee9517 9631cf8f
Branches
Tags v0.8
No related merge requests found
Showing with 1179 additions and 336 deletions
jupedsim
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
JuPedSim contributors:
(Date: 27.01.2016)
Erik Andresen
Mohcine Chraibi
Arne Graf
David Haensel
Weichen Liao
Ulrich Kemloh
Maximilian Osterkamp
Andrea Portz
Oliver Schmidts
Benjamin Schröder
Denis Shhikhalev
Antoine Tordeux
Jun Zhang
JPSeditor contributors:
(Date: 27.01.2016)
Erik Andresen
Maximilian Osterkamp
......@@ -2,6 +2,32 @@
All notable changes to this project will be documented in this file.
## v0.8.0 [Unreleased]
### Added
#### JPSEDITOR
- 1.2.16 Undo/Redo when Line was edited
- 1.2.16 Change Info Text
- 1.2.16 Load HLines
- 1.2.16 Create and save HLines
- First approaches of an undo/redo framework
- Undo/Redo working when line added or deleted
- DXF import with different layers - Not working properly with AutoCAD ?!
- Bug fixes
- CAD features
- Point and line grid
- object snap
- Orthomode
- Zooming
- Line editing
- Length of line is displayed
- Show origin
- ...
- Room and door declarations
# Change Log
All notable changes to this project will be documented in this file.
## v0.8.0 [Unreleased]
......
......@@ -7,13 +7,21 @@
#================
# 1. CMAKE_BUILD_TYPE=Release (default Debug)
# 2. DESIRED_QT_VERSION=5 (default 4)
# example: >> cmake -DDESIRED_QT_VERSION=5 -DCMAKE_PREFIX_PATH=~/Qt/5.5/clang_64 ..
# Flags for VS: -G "Visual Studio ..." -DCMAKE_PREFIX_PATH=... -DCMAKE_C_FLAGS="-mwindows"
cmake_minimum_required(VERSION 2.8.9)
IF (POLICY CMP0048) # in CMake 3.0.0+
CMAKE_POLICY (SET CMP0048 OLD) # keep PROJECT() from clearing VERSION variables
ENDIF (POLICY CMP0048)
IF (POLICY CMP0043) # in CMake 3.0.0+
CMAKE_POLICY (SET CMP0043 OLD) # keep PROJECT() from clearing VERSION variables
ENDIF (POLICY CMP0043)
IF (POLICY CMP0020)
CMAKE_POLICY (SET CMP0020 OLD) # keep old POLICY (2.8.10 and lower) The OLD behavior for this policy is not to link executables to
ENDIF (POLICY CMP0020) #qtmain.lib automatically when they link to the QtCore IMPORTEDtarget
project(JPSeditor)
cmake_minimum_required(VERSION 2.8.9)
set(README_FILE "${CMAKE_SOURCE_DIR}/README.md")
......@@ -66,6 +74,7 @@ message(STATUS "${PROJECT_NAME} will be installed to ${CMAKE_INSTALL_PREFIX}")
#--------------------
if (NOT MSVC)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
......@@ -77,13 +86,14 @@ else()
message(AUTHOR_WARNING "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
message(STATUS "Checking for C++11 compiler - available")
endif()
#---------------------
set( SRCS
src/mainWindow.cpp
src/main.cpp
src/GraphicView.cpp
src/graphicscene.cpp
src/roomwidget.cpp
src/rooms.cpp
src/datamanager.cpp
......@@ -94,6 +104,9 @@ set( SRCS
src/jpslandmark.cpp
src/jpswaypoint.cpp
src/widgetlandmark.cpp
src/widgetsettings.cpp
src/jpsyahpointer.cpp
src/jpsconnection.cpp
dxflib/src/dl_writer_ascii.cpp
dxflib/src/dl_dxf.cpp
)
......@@ -101,6 +114,7 @@ set( SRCS
set( HDR
src/mainWindow.h
src/GraphicView.h
src/graphicscene.h
src/roomwidget.h
src/rooms.h
src/datamanager.h
......@@ -111,6 +125,9 @@ set( HDR
src/jpslandmark.h
src/jpswaypoint.h
src/widgetlandmark.h
src/widgetsettings.h
src/jpsyahpointer.h
src/jpsconnection.h
dxflib/src/dl_writer_ascii.h
dxflib/src/dl_writer.h
dxflib/src/dl_global.h
......@@ -130,6 +147,7 @@ set( UIS
forms/mainwindow.ui
forms/roomwidget.ui
forms/widgetlandmark.ui
forms/widgetsettings.ui
)
# and finally a resource file
......@@ -153,7 +171,7 @@ ENDIF (WIN32)
message(STATUS "QT_Qmake_executable " ${QT_QMAKE_EXECUTABLE})
if($QT_QMAKE_EXECUTABLE STREQUAL "")
FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake)
if (NOT QT_QMAKE_EXECUTABL)
if (NOT QT_QMAKE_EXECUTABLE)
message(WARNING "QT not found - abort.")
endif()
endif()
......@@ -186,7 +204,7 @@ elseif("${DESIRED_QT_VERSION}" STREQUAL "4")
# QT4_INSTALLED is set to TRUE if qt4 is found and
# QT3_INSTALLED is set to TRUE if qt3 is found.
FIND_PACKAGE(Qt COMPONENTS QtXml QT_USE_QTNETWORK QtXmlPatterns REQUIRED)
set(QT4_INSTALLED TRUE)
endif()
......
JuPedSim v0.6 alpha
JuPedSim v0.8 alpha
JPSeditor v0.8 alpha
====================
Ulrich Kemloh drafted this on 25 Jun 2014
Erik Andresen drafted this on 27 Jun 2016
We are proud to announce the first alpha release of our software JuPedSim for simulating pedestrians evacuations. Please note that it is a pre release version for developers only. We are working hard towards the final release for this version. Two modules are shipped with this pre-release:
We are proud to announce the first alpha release of our software JPSeditor (part of JuPedSim for simulating pedestrians evacuations). Please note that it is a pre release version for developers only. We are working hard towards the final release for this version.
JPSeditor is a graphical user interface to create the geometry of a scenario simulated by JuPedSim. It comes with set of CAD- and further tools to simplify the creation of proper xml-files
incorporating information about the scenario' geometry.
- *jpscore*: command line simulation core
- *jpsvis*: visualization module
Features
========
- Simulate pedestrians movement in a space continuous geometry
- Forces-based models for describing the pedestrians interactions
- Shortest and quickest path route choice strategies
- Loading and visualizing trajectories and geometries
- Easy to use visualization interface
- Making high quality videos directly from the visualization interface or generating png screenshots
- XML based input files
- DXF Import / Export
- CAD features
- Point and line grid
- object snap
- Orthomode
- Zooming
- Line editing
- ...
- Tools for room and door declarations
Showcase
Tutorial
========
To highlight some features of JuPedSim we have uploaded some videos on our [YouTube channel](https://www.youtube.com/user/JuPedSim).
To highlight some features of JuPedSim we have uploaded some videos on our [YouTube channel](https://www.youtube.com/user/JuPedSim) including a tutorial showing how to use the editor.
Installing
......@@ -39,39 +43,7 @@ As JuPedSim comes with no installer, you just need to delete the unziped directo
Running
=======
jpscore.exe my_simulation_ini.xml
from the command line (or also dropping the file on the executable) will generate a trajectory file, which you can visualize with `jpsvis`.
You will find some projects samples in the downloaded files and further information in the manual.
Compiling from sources
======================
You can compile the simulation core for your specific platform with the supplied cmake script.
The only requirement is a compiler supporting the new standard c++11.
Windows (tested on Win7 with MinGW 4.8)
---------------------------------------
cmake -G "MinGW Makefiles" CMakeList.txt
make-mingw32.exe
Linux (tested on Ubuntu 14.04 with gcc 4.8)
---------------
cmake CMakeList.txt
make
OSX (tested on OSX Maverick with clang 5.1 and Yosemite with clang 6.1)
---------------------
cmake CMakeList.txt
make
Note that the OpenMP acceleration might be missing under OSX
For the visualization module (`jpsvis`) at least Qt version 4.5 and VTK version 4.8 are required.
You can download the latest version of QT [here](https://www.qt.io/download/) and the latest version of VTK [here](http://www.vtk.org/download/).
Start the application by clicking on the binary file. (For example .exe)
System Requirements
==============
......@@ -79,11 +51,6 @@ System Requirements
There is no special hardware/software requirements for running JuPedSim. The distributed binaries however, are only available for windows at the moment. For compiling from sources you need a compiler with c++11 support is needed for the core. Qt version >=4.5 and VTK >5.8 are needed for the visualization.
Known Issues
============
Some verification tests are still failing. The actual cdash-board can be found [here](http://my.cdash.org/index.php?project=JuPedSim)
Occasionaly jpscore crashes if the input file is not valid. Make sure to validate your XML input files with the supplied XSD files.
Frequently Asked Questions
===========================
......
forms/HLine.png

1.6 KiB

forms/Redo-Icon.png

11.3 KiB

......@@ -38,5 +38,9 @@
<file>jupedsim.png</file>
<file>statue.jpg</file>
<file>statue_specs.jpg</file>
<file>anglesnap.PNG</file>
<file>Undo-icon.png</file>
<file>Redo-Icon.png</file>
<file>HLine.png</file>
</qresource>
</RCC>
forms/Undo-icon.png

23 KiB

forms/anglesnap.PNG

18.2 KiB

......@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>JuPedSim</string>
<string>JPSeditor</string>
</property>
<property name="windowIcon">
<iconset resource="Ressource.qrc">
......@@ -36,6 +36,9 @@
<addaction name="actionSpeichern"/>
<addaction name="actionSpeichern_dxf"/>
<addaction name="separator"/>
<addaction name="separator"/>
<addaction name="actionSettings"/>
<addaction name="separator"/>
<addaction name="actionBeenden"/>
</widget>
<widget class="QMenu" name="menuHilfe">
......@@ -50,11 +53,16 @@
</property>
<addaction name="actionSelect_Mode"/>
<addaction name="separator"/>
<addaction name="actionUndo"/>
<addaction name="actionRedo"/>
<addaction name="separator"/>
<addaction name="actionWall"/>
<addaction name="actionDoor"/>
<addaction name="actionHLine"/>
<addaction name="separator"/>
<addaction name="actionanglesnap"/>
<addaction name="actiongridmode"/>
<addaction name="actionObjectsnap"/>
<addaction name="actionanglesnap"/>
<addaction name="actionDelete_lines"/>
<addaction name="actionDelete_single_line"/>
<addaction name="separator"/>
......@@ -65,6 +73,7 @@
<string>View</string>
</property>
<addaction name="actionRotate_90_deg_clockwise"/>
<addaction name="actionShow_Point_of_Origin"/>
</widget>
<addaction name="menuDatei"/>
<addaction name="menuTools"/>
......@@ -84,21 +93,27 @@
</attribute>
<addaction name="actionSelect_Mode"/>
<addaction name="separator"/>
<addaction name="actionUndo"/>
<addaction name="actionRedo"/>
<addaction name="separator"/>
<addaction name="actionWall"/>
<addaction name="actionDoor"/>
<addaction name="actionHLine"/>
<addaction name="separator"/>
<addaction name="actionanglesnap"/>
<addaction name="actiongridmode"/>
<addaction name="separator"/>
<addaction name="actionObjectsnap"/>
<addaction name="separator"/>
<addaction name="actionanglesnap"/>
<addaction name="separator"/>
<addaction name="actionDelete_lines"/>
<addaction name="separator"/>
<addaction name="actionDelete_single_line"/>
<addaction name="separator"/>
<addaction name="actionRoom"/>
<addaction name="separator"/>
<addaction name="actionLandmark"/>
<addaction name="actionLandmarkWidget"/>
<addaction name="actionLandmark"/>
</widget>
<action name="action_ffnen">
<property name="icon">
......@@ -156,7 +171,7 @@
<string>F1</string>
</property>
</action>
<action name="actionanglesnap">
<action name="actiongridmode">
<property name="checkable">
<bool>true</bool>
</property>
......@@ -168,10 +183,10 @@
<normaloff>:/Grid.png</normaloff>:/Grid.png</iconset>
</property>
<property name="text">
<string>Angle snap</string>
<string>Gridmode</string>
</property>
<property name="toolTip">
<string>Angle snap</string>
<string>Gridmode</string>
</property>
<property name="shortcut">
<string>Ctrl+G</string>
......@@ -391,7 +406,7 @@
<bool>true</bool>
</property>
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="Ressource.qrc">
......@@ -403,13 +418,16 @@
<property name="toolTip">
<string>Landmark</string>
</property>
<property name="visible">
<bool>false</bool>
</property>
</action>
<action name="actionLandmarkWidget">
<property name="checkable">
<bool>true</bool>
</property>
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="Ressource.qrc">
......@@ -421,6 +439,126 @@
<property name="toolTip">
<string>LandmarkSpecs</string>
</property>
<property name="visible">
<bool>false</bool>
</property>
</action>
<action name="actionanglesnap">
<property name="checkable">
<bool>true</bool>
</property>
<property name="enabled">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="Ressource.qrc">
<normaloff>:/anglesnap.PNG</normaloff>:/anglesnap.PNG</iconset>
</property>
<property name="text">
<string>Orthomode</string>
</property>
<property name="toolTip">
<string>Orthomode</string>
</property>
<property name="shortcut">
<string>Ctrl+H</string>
</property>
</action>
<action name="actionSettings">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Settings</string>
</property>
<property name="toolTip">
<string>Settings</string>
</property>
<property name="shortcut">
<string>Ctrl+E</string>
</property>
</action>
<action name="action_ffnen_CogMap">
<property name="icon">
<iconset resource="Ressource.qrc">
<normaloff>:/open.png</normaloff>:/open.png</iconset>
</property>
<property name="text">
<string>Load CognitiveMap</string>
</property>
<property name="toolTip">
<string>Load CognitiveMap</string>
</property>
</action>
<action name="actionRun_visualisation">
<property name="text">
<string>Run visualisation</string>
</property>
</action>
<action name="actionShow_Point_of_Origin">
<property name="text">
<string>Show Point of Origin</string>
</property>
</action>
<action name="actionUndo">
<property name="enabled">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="Ressource.qrc">
<normaloff>:/Undo-icon.png</normaloff>:/Undo-icon.png</iconset>
</property>
<property name="text">
<string>Undo</string>
</property>
<property name="toolTip">
<string>Undo PaintEvent</string>
</property>
<property name="shortcut">
<string>Ctrl+Z</string>
</property>
<property name="visible">
<bool>true</bool>
</property>
</action>
<action name="actionRedo">
<property name="icon">
<iconset resource="Ressource.qrc">
<normaloff>:/Redo-Icon.png</normaloff>:/Redo-Icon.png</iconset>
</property>
<property name="text">
<string>Redo</string>
</property>
<property name="toolTip">
<string>Redo PaintEvent</string>
</property>
<property name="shortcut">
<string>Ctrl+Y</string>
</property>
</action>
<action name="actionHLine">
<property name="checkable">
<bool>true</bool>
</property>
<property name="enabled">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="Ressource.qrc">
<normaloff>:/HLine.png</normaloff>:/HLine.png</iconset>
</property>
<property name="text">
<string>HLine</string>
</property>
<property name="toolTip">
<string>HLine</string>
</property>
<property name="shortcut">
<string>H</string>
</property>
<property name="iconVisibleInMenu">
<bool>true</bool>
</property>
</action>
</widget>
<resources>
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>320</width>
<height>678</height>
<height>725</height>
</rect>
</property>
<property name="windowTitle">
......@@ -42,7 +42,7 @@
<property name="geometry">
<rect>
<x>20</x>
<y>510</y>
<y>560</y>
<width>291</width>
<height>31</height>
</rect>
......@@ -55,7 +55,7 @@
<property name="geometry">
<rect>
<x>10</x>
<y>330</y>
<y>380</y>
<width>291</width>
<height>171</height>
</rect>
......@@ -65,7 +65,7 @@
<property name="geometry">
<rect>
<x>110</x>
<y>610</y>
<y>660</y>
<width>93</width>
<height>28</height>
</rect>
......@@ -78,7 +78,7 @@
<property name="geometry">
<rect>
<x>30</x>
<y>550</y>
<y>600</y>
<width>112</width>
<height>34</height>
</rect>
......@@ -91,7 +91,7 @@
<property name="geometry">
<rect>
<x>170</x>
<y>550</y>
<y>600</y>
<width>112</width>
<height>34</height>
</rect>
......@@ -117,7 +117,7 @@
<property name="geometry">
<rect>
<x>10</x>
<y>290</y>
<y>340</y>
<width>191</width>
<height>31</height>
</rect>
......@@ -199,7 +199,7 @@
<property name="geometry">
<rect>
<x>-10</x>
<y>270</y>
<y>320</y>
<width>341</width>
<height>20</height>
</rect>
......@@ -212,7 +212,7 @@
<property name="geometry">
<rect>
<x>10</x>
<y>240</y>
<y>280</y>
<width>121</width>
<height>28</height>
</rect>
......@@ -225,7 +225,7 @@
<property name="geometry">
<rect>
<x>202</x>
<y>240</y>
<y>280</y>
<width>101</width>
<height>28</height>
</rect>
......@@ -234,6 +234,37 @@
<string>Highlight Room</string>
</property>
</widget>
<widget class="QComboBox" name="classBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>100</x>
<y>240</y>
<width>111</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_6">
<property name="geometry">
<rect>
<x>10</x>
<y>240</y>
<width>91</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string>Roomtype:</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="tab">
<attribute name="title">
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>WidgetSettings</class>
<widget class="QTabWidget" name="WidgetSettings">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>330</height>
</rect>
</property>
<property name="windowTitle">
<string>TabWidget</string>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>View Settings</string>
</attribute>
<widget class="QGroupBox" name="GridSettings">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>171</width>
<height>241</height>
</rect>
</property>
<property name="title">
<string>Grid Settings</string>
</property>
<widget class="QRadioButton" name="en_pointGrid">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>95</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Point Grid</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
<widget class="QRadioButton" name="en_lineGrid">
<property name="geometry">
<rect>
<x>10</x>
<y>60</y>
<width>95</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Line Grid</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
<widget class="Line" name="line">
<property name="geometry">
<rect>
<x>0</x>
<y>90</y>
<width>171</width>
<height>16</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</widget>
<widget class="QPushButton" name="pushButtoncloseSettings">
<property name="geometry">
<rect>
<x>150</x>
<y>260</y>
<width>101</width>
<height>28</height>
</rect>
</property>
<property name="text">
<string>Apply and Close</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="tab2">
<attribute name="title">
<string>Tab 2</string>
</attribute>
</widget>
</widget>
<resources/>
<connections/>
</ui>
......@@ -27,7 +27,8 @@ QMAKE_CXXFLAGS += -std=c++11
FORMS += \
forms/mainwindow.ui \
forms/roomwidget.ui \
forms/widgetlandmark.ui
forms/widgetlandmark.ui \
forms/widgetsettings.ui
HEADERS += \
src/mainWindow.h \
......@@ -52,7 +53,14 @@ HEADERS += \
dxflib/src/dl_codes.h \
dxflib/src/dl_attributes.h \
src/jpswaypoint.h \
src/widgetlandmark.h
src/widgetlandmark.h \
src/graphicscene.h \
src/widgetsettings.h \
src/jpsyahpointer.h \
src/jpsconnection.h \
src/UndoFramework/actionstack.h \
src/UndoFramework/action.h \
src/UndoFramework/lineaction.h
SOURCES += \
......@@ -70,7 +78,14 @@ SOURCES += \
dxflib/src/dl_writer_ascii.cpp \
dxflib/src/dl_dxf.cpp \
src/jpswaypoint.cpp \
src/widgetlandmark.cpp
src/widgetlandmark.cpp \
src/graphicscene.cpp \
src/widgetsettings.cpp \
src/jpsyahpointer.cpp \
src/jpsconnection.cpp \
src/UndoFramework/actionstack.cpp \
src/UndoFramework/action.cpp \
src/UndoFramework/lineaction.cpp
RESOURCES += forms/Ressource.qrc
......
This diff is collapsed.
......@@ -30,97 +30,130 @@
#include <QGraphicsView>
#include <QGraphicsSceneMouseEvent>
//#include <QGraphicsSceneMouseEvent>
#include "graphicscene.h"
#include <QGraphicsLineItem>
#include "jpsLineItem.h"
#include "jpslandmark.h"
#include "jpsconnection.h"
#include "./UndoFramework/actionstack.h"
using ptrConnection = std::shared_ptr<jpsConnection>;
class jpsGraphicsView: public QGraphicsView {
Q_OBJECT
public:
///Constructor
//Constructor
jpsGraphicsView(QWidget* parent = nullptr);
///Destructor
//Destructor
~jpsGraphicsView();
///Change modes
void change_gridmode();
bool get_gridmode();
bool use_gridmode(QGraphicsLineItem *currentline, int accuracy);
//Change modes
void change_stat_anglesnap();
bool get_stat_anglesnap();
void change_objectsnap();
bool get_objectsnap();
void change_gridmode();
bool statusWall();
void en_disableWall();
bool statusDoor();
void en_disableDoor();
bool statusExit();
void en_disableExit();
bool statusHLine();
void en_disableHLine();
bool statusLandmark();
void en_disableLandmark();
///Pos
// global functions
qreal get_scale_f();
void take_l_from_lineEdit(const qreal &length);
void disable_drawing();
bool use_anglesnap(QGraphicsLineItem *currentline, int accuracy);
void use_gridmode();
//View
void zoom(int delta);
void translations(QPointF old_pos);
void AutoZoom();
qreal CalcGridSize();
void ShowOrigin();
//Pos
QPointF return_Pos();
///Catch points
//Catch lines, points and intersections
void catch_points();
void locate_intersection(jpsLineItem* item1, jpsLineItem* item2);
void line_collision();
void catch_lines();
///Delete all
//Delete all
void delete_all(bool final=false);
///Line operations
void catch_lines();
//Line operations
void drawLine();
qreal calc_d_point(const QLineF &line, const qreal &x, const qreal &y);
void delete_marked_lines();
void RemoveLineItem(jpsLineItem *mline);
void RemoveLineItem(const QLineF &line);
void RemoveIntersections(jpsLineItem* lineItem);
// lines read from dxf-file
jpsLineItem *addLineItem(const qreal &x1, const qreal &y1, const qreal &x2, const qreal &y2, const QString &type="");
jpsLineItem *addLineItem(const QLineF &line, const QString &type="");
QList<jpsLineItem *> get_markedLines();
QList<jpsLineItem *> get_line_vector();
void unmark_all_lines();
void select_line(jpsLineItem *mline);
void SetVLine();
void EditLine(QPointF* point);
qreal ReturnLineLength();
/// Landmark
// Landmark
void delete_landmark();
void catch_landmark();
void select_landmark(jpsLandmark *landmark);
void addLandmark();
void unmarkLandmark();
// unmark Landmarks see slots
QList<jpsLandmark *> get_landmarks();
///Waypoints
//Waypoints/Connections and YAHPointer
QGraphicsRectItem* GetCurrentSelectRect();
void ShowWaypoints(QList<jpsWaypoint* > waypoints);
/// Lines
void take_l_from_lineEdit(const qreal &length);
QList<jpsLineItem *> get_markedLines();
QList<jpsLineItem *> get_line_vector();
qreal get_scale_f();
void unmark_all_lines();
void select_line(jpsLineItem *mline);
void disable_drawing();
jpsLineItem *addLineItem(const qreal &x1, const qreal &y1, const qreal &x2, const qreal &y2, const QString &type="");
void locate_intersection(jpsLineItem* item1, jpsLineItem* item2);
void SetVLine();
void EditLine(QPointF* point);
void ShowWaypoints(QList<ptrWaypoint > waypoints);
void ShowYAHPointer(const QPointF& pos, const qreal& dir);
void ClearWaypointLabels();
void ShowConnections(QList<ptrConnection> cons);
void ClearConnections();
///RoomCaption
//RoomCaption
bool show_hide_roomCaption(QString name, qreal x, qreal y);
void line_collision();
void create_grid();
///View
void zoom(int delta);
void translations(QPointF old_pos);
void AutoZoom();
//Undo Framework
void RecordUndoLineAction(const QString &name, const QString &type, const int &itemID, const QLineF &oldLine);
void RecordRedoLineAction(const QString &name, const QString &type, const int &itemID, const QLineF &oldLine);
void UndoLineEdit(const int &lineID, const QLineF &old_line);
void RedoLineEdit(const int &lineID, const QLineF &old_line);
public slots:
///Waypoints
//Waypoints
void StatAssoDef();
void ClearWaypoints();
//GridSettings
void ActivateLineGrid();
void ActivatePointGrid();
//Landmarks
void unmarkLandmark();
//Line operations
void SelectAllLines();
//Undo Redo
void Undo();
void Redo();
protected:
//Mouse events
virtual void mouseMoveEvent(QMouseEvent * mouseEvent);
//void paintEvent(QPaintEvent* event);
virtual void mousePressEvent(QMouseEvent *event);
......@@ -130,27 +163,31 @@ protected:
private:
QGraphicsLineItem* current_line;
QPolygonF polygon;
//std::vector<jpsLineItem> line_vector;
QList<QPointF *> intersect_point_vector;
QList<QPointF> grid_point_vector;
//QList<QPointF> grid_point_vector;
QList<jpsLineItem *> line_vector;
QList<QGraphicsLineItem *> origin;
QList<QGraphicsLineItem *> _origin;
//QList<QList<jpsLineItem*> *> mainlist;
QPointF pos;
//QPointF* intersection_point;
QGraphicsScene* Scene;
GraphicScene* Scene;
bool midbutton_hold;
bool leftbutton_hold;
qreal translation_x;
qreal translation_y;
QPointF translated_pos;
bool gridmode;
bool anglesnap;
bool statWall;
bool statDoor;
bool statExit;
bool statLandmark;
bool _statHLine;
qreal catch_radius;
qreal _scaleFactor;
qreal gl_scale_f;
qreal _gridSize;
bool point_tracked;
QGraphicsItem* current_rect;
QGraphicsRectItem* currentSelectRect;
......@@ -162,20 +199,29 @@ private:
QList<jpsLineItem *> marked_lines;
QGraphicsTextItem* current_caption;
QList<QGraphicsTextItem* > caption_list;
int id_counter;
//Landmark and waypoints
QList<jpsLandmark* > LLandmarks;
jpsLandmark* markedLandmark;
QGraphicsRectItem* currentLandmarkRect;
QList<QGraphicsEllipseItem* > _waypoints;
QList<QGraphicsLineItem* > _connections;
QList<QGraphicsLineItem* > _yahPointer;
QList<QGraphicsTextItem* > _waypointLabels;
QGraphicsLineItem* _currentVLine;
QPointF* _currentTrackedPoint;
QGraphicsPixmapItem* gridmap;
bool _statLineEdit;
bool lines_collided;
bool _assoDef;
bool _gridmode;
//Undo/Redo
ActionStack _undoStack;
ActionStack _redoStack;
//qreal gl_min_x;
//qreal gl_min_y;
signals:
void mouse_moved();
......@@ -186,11 +232,9 @@ signals:
void remove_all();
void landmark_added();
void AssoDefCompleted();
void LineLengthChanged();
//void DoubleClick();
};
......
#include "action.h"
Action::Action()
{
}
Action::Action(const QString &name, const QString &type)
{
_name=name;
_type=type;
}
Action::~Action()
{
}
const QString &Action::GetName() const
{
return _name;
}
const QString &Action::GetType() const
{
return _type;
}
#ifndef ACTION_H
#define ACTION_H
#include <QString>
class Action
{
public:
Action();
Action(const QString& name, const QString& type);
~Action();
//Getter
const QString& GetName() const;
const QString& GetType() const;
private:
QString _name;
QString _type;
};
#endif // ACTION_H
#include "actionstack.h"
ActionStack::ActionStack()
{
}
ActionStack::~ActionStack()
{
}
LineAction ActionStack::GetRecentAction()
{
return _actionstack.pop();
}
void ActionStack::PushNewAction(const LineAction &action)
{
_actionstack.push_back(action);
}
bool ActionStack::IsEmpty()
{
return _actionstack.isEmpty();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment