Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEDrawingShape.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 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/****************************************************************************/
18// Frame for draw shapes
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
24
25// ===========================================================================
26// class declaration
27// ===========================================================================
28
29class GNEFrame;
30
31// ===========================================================================
32// class definitions
33// ===========================================================================
34
37 FXDECLARE(GNEDrawingShape)
38
39public:
41 GNEDrawingShape(GNEFrame* frameParent);
42
45
47 void showDrawingShape();
48
50 void hideDrawingShape();
51
53 void startDrawing();
54
56 void stopDrawing();
57
59 void abortDrawing();
60
62 void addNewPoint(const Position& P);
63
65 void removeLastPoint();
66
68 const PositionVector& getTemporalShape() const;
69
71 bool isDrawing() const;
72
74 void setDeleteLastCreatedPoint(bool value);
75
78
82 long onCmdStartDrawing(FXObject*, FXSelector, void*);
83
85 long onCmdStopDrawing(FXObject*, FXSelector, void*);
86
88 long onCmdAbortDrawing(FXObject*, FXSelector, void*);
90
91protected:
92 FOX_CONSTRUCTOR(GNEDrawingShape)
93
94private:
97
100
103
106
109
112
115};
void startDrawing()
start drawing
GNEFrame * myFrameParent
pointer to frame parent
bool isDrawing() const
return true if currently a shape is drawed
FXButton * myStartDrawingButton
button for start drawing
FXButton * myAbortDrawingButton
button for abort drawing
void addNewPoint(const Position &P)
add new point to temporal shape
bool getDeleteLastCreatedPoint()
get flag delete last created point
void abortDrawing()
abort drawing
bool myDeleteLastCreatedPoint
flag to enable/disable delete point mode
void setDeleteLastCreatedPoint(bool value)
enable or disable delete last created point
FXLabel * myInformationLabel
Label with information.
~GNEDrawingShape()
destructor
long onCmdAbortDrawing(FXObject *, FXSelector, void *)
Called when the user press abort drawing button.
PositionVector myTemporalShape
current drawed shape
void removeLastPoint()
remove last added point
long onCmdStartDrawing(FXObject *, FXSelector, void *)
FXButton * myStopDrawingButton
button for stop drawing
void showDrawingShape()
show Drawing mode
void stopDrawing()
stop drawing and check if shape can be created
void hideDrawingShape()
hide Drawing mode
long onCmdStopDrawing(FXObject *, FXSelector, void *)
Called when the user press stop drawing button.
const PositionVector & getTemporalShape() const
get Temporal shape
MFXGroupBoxModule (based on FXGroupBox)
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.