Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/elements/moving/GNEMoveElementViewResizable.h
185790 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 GNEMoveElementViewResizable.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Sep 2025
17
///
18
// Class used for elements that can be moved over view and resized
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include "GNEMoveElementView.h"
24
25
// ===========================================================================
26
// class definitions
27
// ===========================================================================
28
29
class GNEMoveElementViewResizable : public GNEMoveElementView {
30
31
public:
32
/// @brief attributes format
33
enum class ResizingFormat {
34
WIDTH_HEIGHT, /// @brief width and height
35
WIDTH_LENGTH, /// @brief width and length
36
};
37
38
/// @brief constructor
39
GNEMoveElementViewResizable(GNEAttributeCarrier* element, AttributesFormat attributesFormat,
40
ResizingFormat resizingFormat, SumoXMLAttr posAttr,
41
Position& position);
42
43
//// @brief empty destructor
44
~GNEMoveElementViewResizable();
45
46
/**@brief get move operation
47
* @note returned GNEMoveOperation can be nullptr
48
*/
49
GNEMoveOperation* getMoveOperation() override;
50
51
// temporal
52
//protected:
53
/// @brief shape width
54
PositionVector myShapeWidth;
55
56
/// @brief shape height
57
PositionVector myShapeHeight;
58
59
/// @brief variable used for moving geometry point contour up
60
GNEContour myMovingContourUp;
61
62
/// @brief variable used for moving geometry point contour down
63
GNEContour myMovingContourDown;
64
65
/// @brief variable used for moving geometry point contour left
66
GNEContour myMovingContourLeft;
67
68
/// @brief variable used for moving geometry point contour right
69
GNEContour myMovingContourRight;
70
71
private:
72
/// @brief check if width can be edited
73
const bool myEditWidth = false;
74
75
/// @brief check if height can be edited
76
const bool myEditHeight = false;
77
78
/// @brief check if length can be edited
79
const bool myEditLength = false;
80
81
/// @brief set move shape
82
void setMoveShape(const GNEMoveResult& moveResult) override;
83
84
/// @brief commit move shape
85
void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList) override;
86
87
/// @brief Invalidated copy constructor.
88
GNEMoveElementViewResizable(const GNEMoveElementViewResizable&) = delete;
89
90
/// @brief Invalidated assignment operator.
91
GNEMoveElementViewResizable& operator=(const GNEMoveElementViewResizable&) = delete;
92
};
93
94