Skip to content

Commit b7200f7

Browse files
committed
first commit
0 parents  commit b7200f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+18508
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build/
2+
3+
docs/
4+
5+
bin/

CMakeLists.txt

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# CMakeLists.txt
2+
cmake_minimum_required(VERSION 3.1.0)
3+
4+
project(greasepad VERSION 1.0.0 LANGUAGES CXX)
5+
6+
set(CMAKE_CXX_STANDARD 11)
7+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
8+
9+
set(CMAKE_AUTOMOC ON)
10+
set(CMAKE_AUTORCC ON)
11+
set(CMAKE_AUTOUIC ON)
12+
13+
# my configuration
14+
set(Qt5_DIR "C:/Qt/5.11.0/msvc2017_64/lib/cmake/Qt5")
15+
set(CMAKE_INSTALL_PREFIX "D:/git/GreasePad")
16+
set(CMAKE_BUILD_TYPE RELEASE)
17+
18+
19+
if(CMAKE_VERSION VERSION_LESS "3.7.0")
20+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
21+
endif()
22+
23+
find_package(Eigen3 3.4 REQUIRED NO_MODULE)
24+
find_package(Qt5 COMPONENTS Widgets REQUIRED)
25+
find_package(Qt5 REQUIRED COMPONENTS Svg)
26+
27+
add_executable(helloworld
28+
src/aabb.cpp
29+
src/adjustment.cpp
30+
src/conics.cpp
31+
src/conncomp.cpp
32+
src/constraints.cpp
33+
src/main.cpp
34+
src/mainwindow.cpp
35+
src/mainscene.cpp
36+
src/mainview.cpp
37+
src/commands.cpp
38+
src/matrix.cpp
39+
src/qconstraints.cpp
40+
src/qformattool.cpp
41+
src/qsegment.cpp
42+
src/qstroke.cpp
43+
src/quantiles.cpp
44+
src/state.cpp
45+
src/statistics.cpp
46+
src/uncertain.cpp
47+
src/upoint.cpp
48+
src/usegment.cpp
49+
src/ustraightline.cpp
50+
src/greasepad.qrc
51+
)
52+
53+
target_link_libraries(greasepad Qt5::Widgets Qt5::Svg Eigen3::Eigen)
54+
55+
56+
install(TARGETS greasepad DESTINATION bin)

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# GreasePad
2+
**Freehand Drawing guided by Geometric Reasoning**
3+
4+
The *GreasePad* provides a drawing area and expects pen strokes as the only user input. These strokes are approximated by straight line segments leading to line drawings. During this interactive process, geometric relations such as orthogonallity are recognized and automatically enforced by an adjustment procedure. The program can be utilzed to analyse systems of straight lines and constraints (theorem proving) or to outline the shapes of human-made objects in images. As an input pointing device, you can use a computer mouse, a stylus, or one of your fingers in combination with a touchscreen.
5+
6+
7+
### Screenshots
8+
9+
<img src="./docs/screenshots/screenshot_orthocenter.png" width = "47.5%">
10+
<img src="./docs/screenshots/screenshot_roofshape.png" width="47.5%">
11+
12+
13+
### Copyright
14+
15+
Copyright (C) 2022 Jochen Meidow, [Fraunhofer IOSB](http::/www.iosb.fraunhofer.de), Germany.
16+
17+
18+
### Licensing
19+
20+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either [version 3 of the License](https://www.gnu.org/licenses/gpl-3.0.en.html), or (at your option) any later version.
21+
22+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
23+
24+
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
25+
26+
### Requirements
27+
28+
For the compiliation and building of the programme, the following components are required:
29+
30+
- The **C++ template library [Eigen](https://eigen.tuxfamily.org)**, version 3.4.0, for linear algebra, i.e, matrices, vectors, numerical solvers, and related algorithms.
31+
- The **widget toolkit [Qt](https://www.qt.io)**, version 5.11.0, for creating the graphical user interface.
32+
33+
34+
### Building from source
35+
36+
- Get the Qt toolkit and the Eigen library.
37+
- Clone the source code, i.e.,
38+
`git clone www.github.com/FraunhoferIOSB/GreasePad.git`
39+
- Building the programme, e.g., using the integrated development environment *QtCreator*.
40+
41+
### Contributing to GreasePad
42+
43+
The software is still under development. Contributions in form of issues and pull requests are highly welcome.
44+
45+
46+
### References
47+
48+
Details on the utilized methods can be found in the following papers:
49+
50+
- J. Meidow and L. Lucks (2019) [Draw and Order - Modeless Interactive Acquisition of Outlines](https://doi.org/10.5194/isprs-annals-IV-2-W7-103-2019). ISPRS - Annals of Photogrammetry, Remote Sensing and Spatial Information Sciences, vol. IV-2/W7, pp. 103-110
51+
- J. Meidow, H. Hammer, and L. Lucks (2020) [Delineation and Construction of 2D Geometries by Freehand Drawing and Geometric Reasoning](https://www.isprs-ann-photogramm-remote-sens-spatial-inf-sci.net/V-5-2020/77/2020/). ISPRS - Annals of the Photogrammetry, Remote Sensing and Spatial Information Sciences, vol. V-5-2020, pp. 77-84
52+
53+
54+
Please cite these papers when using *GreasePad* or parts of it in an academic publication.
55+
56+
### Contact
57+
58+
Jochen Meidow, Fraunhofer IOSB, Ettlingen, Germany.
59+
60+

src/aabb.cpp

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* This file is part of the GreasePad distribution (https://github.com/FraunhoferIOSB/GreasePad).
3+
* Copyright (c) 2022 Jochen Meidow, Fraunhofer IOSB
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, see <https://www.gnu.org/licenses/>.
17+
*/
18+
19+
#include "aabb.h"
20+
21+
#include <Eigen/Dense> // Eigen
22+
#include <QDataStream> // Qt
23+
24+
aabb::aabb( const double x_min,
25+
const double x_max,
26+
const double y_min,
27+
const double y_max)
28+
: x_min_(x_min)
29+
{
30+
x_max_ = x_max;
31+
y_min_ = y_min;
32+
y_max_ = y_max;
33+
34+
assert( x_min_ <= x_max_ ); // option: swap
35+
assert( y_min_ <= y_max_ );
36+
}
37+
38+
39+
bool aabb::intersects( const aabb & other) const
40+
{
41+
return ( ( std::fmin( x_max_, other.x_max_) > std::fmax( x_min_, other.x_min_) )
42+
&& ( std::fmin( y_max_, other.y_max_) > std::fmax( y_min_, other.y_min_) )
43+
);
44+
}
45+
46+
aabb aabb::united( const aabb & other) const
47+
{
48+
return { std::fmin( x_min_, other.x_min_),
49+
std::fmax( x_max_, other.x_max_),
50+
std::fmin( y_min_, other.y_min_),
51+
std::fmax( y_max_, other.y_max_)};
52+
}
53+
54+
55+
void aabb::serialize( QDataStream &out ) const
56+
{
57+
// qDebug() << Q_FUNC_INFO;
58+
out << x_min_ << x_max_ << y_min_ << y_max_;
59+
}
60+
61+
bool aabb::deserialize( QDataStream &in )
62+
{
63+
// qDebug() << Q_FUNC_INFO;
64+
in >> x_min_ >> x_max_ >> y_min_ >> y_max_;
65+
return in.status()==0;
66+
}
67+

src/aabb.h

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* This file is part of the GreasePad distribution (https://github.com/FraunhoferIOSB/GreasePad).
3+
* Copyright (c) 2022 Jochen Meidow, Fraunhofer IOSB
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, see <https://www.gnu.org/licenses/>.
17+
*/
18+
19+
#ifndef AABB_H
20+
#define AABB_H
21+
22+
#include <QDataStream>
23+
24+
class aabb {
25+
26+
public:
27+
// aabb() = default;
28+
// ~aabb() = default;
29+
aabb( double x_min=0, double x_max=0,
30+
double y_min=0, double y_max=0 );
31+
32+
void serialize( QDataStream & out ) const;
33+
bool deserialize( QDataStream & in );
34+
35+
// aabb & operator= (const aabb & rhs) = default;
36+
37+
double x_min() const { return x_min_; }
38+
double x_max() const { return x_max_; }
39+
double y_min() const { return y_min_; }
40+
double y_max() const { return y_max_; }
41+
42+
bool intersects( const aabb & other) const;
43+
/* nodiscard */ aabb united( const aabb & other) const;
44+
45+
private:
46+
double x_min_;
47+
double x_max_;
48+
double y_min_;
49+
double y_max_;
50+
};
51+
52+
#endif // AABB_H

0 commit comments

Comments
 (0)