Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/frames/GNEDrawingShape.h
169678 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4
// This program and the accompanying materials are made available under the
5
// terms of the Eclipse Public License 2.0 which is available at
6
// https://www.eclipse.org/legal/epl-2.0/
7
// This Source Code may also be made available under the following Secondary
8
// Licenses when the conditions for such availability set forth in the Eclipse
9
// Public License 2.0 are satisfied: GNU General Public License, version 2
10
// or later which is available at
11
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13
/****************************************************************************/
14
/// @file GNEDrawingShape.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Mar 2022
17
///
18
// Frame for draw shapes
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <utils/foxtools/MFXGroupBoxModule.h>
24
25
// ===========================================================================
26
// class declaration
27
// ===========================================================================
28
29
class GNEFrame;
30
31
// ===========================================================================
32
// class definitions
33
// ===========================================================================
34
35
class GNEDrawingShape : public MFXGroupBoxModule {
36
/// @brief FOX-declaration
37
FXDECLARE(GNEDrawingShape)
38
39
public:
40
/// @brief constructor
41
GNEDrawingShape(GNEFrame* frameParent);
42
43
/// @brief destructor
44
~GNEDrawingShape();
45
46
/// @brief show Drawing mode
47
void showDrawingShape();
48
49
/// @brief hide Drawing mode
50
void hideDrawingShape();
51
52
/// @brief start drawing
53
void startDrawing();
54
55
/// @brief stop drawing and check if shape can be created
56
void stopDrawing();
57
58
/// @brief abort drawing
59
void abortDrawing();
60
61
/// @brief add new point to temporal shape
62
void addNewPoint(const Position& P);
63
64
/// @brief remove last added point
65
void removeLastPoint();
66
67
/// @brief get Temporal shape
68
const PositionVector& getTemporalShape() const;
69
70
/// @brief return true if currently a shape is drawed
71
bool isDrawing() const;
72
73
/// @brief enable or disable delete last created point
74
void setDeleteLastCreatedPoint(bool value);
75
76
/// @brief get flag delete last created point
77
bool getDeleteLastCreatedPoint();
78
79
/// @name FOX-callbacks
80
/// @{
81
/// @brief Called when the user press start drawing button
82
long onCmdStartDrawing(FXObject*, FXSelector, void*);
83
84
/// @brief Called when the user press stop drawing button
85
long onCmdStopDrawing(FXObject*, FXSelector, void*);
86
87
/// @brief Called when the user press abort drawing button
88
long onCmdAbortDrawing(FXObject*, FXSelector, void*);
89
/// @}
90
91
protected:
92
FOX_CONSTRUCTOR(GNEDrawingShape)
93
94
private:
95
/// @brief pointer to frame parent
96
GNEFrame* myFrameParent;
97
98
/// @brief flag to enable/disable delete point mode
99
bool myDeleteLastCreatedPoint;
100
101
/// @brief current drawed shape
102
PositionVector myTemporalShape;
103
104
/// @brief button for start drawing
105
FXButton* myStartDrawingButton;
106
107
/// @brief button for stop drawing
108
FXButton* myStopDrawingButton;
109
110
/// @brief button for abort drawing
111
FXButton* myAbortDrawingButton;
112
113
/// @brief Label with information
114
FXLabel* myInformationLabel;
115
};
116
117