1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
10 /// @file    GNEChange_Shape.h
11 /// @author  Pablo Alvarez Lopez
12 /// @date    Oct 2017
13 /// @version $Id$
14 ///
15 // A network change in which a single Shape is created or deleted
16 /****************************************************************************/
17 #ifndef GNEChange_Shape_h
18 #define GNEChange_Shape_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <fx.h>
27 #include <utils/foxtools/fxexdefs.h>
28 #include "GNEChange.h"
29 
30 // ===========================================================================
31 // class declarations
32 // ===========================================================================
33 class GNENet;
34 class GNEShape;
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
39 /**
40 * @class GNEChange_Shape
41 * A network change in which a single poly is created or deleted
42 */
43 class GNEChange_Shape : public GNEChange {
44     FXDECLARE_ABSTRACT(GNEChange_Shape)
45 
46 public:
47     /**@brief Constructor
48     * @param[in] shape the shape to be changed
49     * @param[in] forward Whether to create/delete (true/false)
50     */
51     GNEChange_Shape(GNEShape* shape, bool forward);
52 
53     /// @brief Destructor
54     ~GNEChange_Shape();
55 
56     /// @name inherited from GNEChange
57     /// @{
58     /// @brief get undo Name
59     FXString undoName() const;
60 
61     /// @brief get Redo name
62     FXString redoName() const;
63 
64     /// @brief undo action
65     void undo();
66 
67     /// @brief redo action
68     void redo();
69     /// @}
70 
71 private:
72     /// @brief pointer to shape
73     GNEShape* myShape;
74 
75     /// @brief reference to vector of edge parents
76     const std::vector<GNEEdge*>& myEdgeParents;
77 
78     /// @brief reference to vector of lane parents
79     const std::vector<GNELane*>& myLaneParents;
80 
81     /// @brief reference to vector of shape parents
82     const std::vector<GNEShape*>& myShapeParents;
83 
84     /// @brief reference to vector of additional parents
85     const std::vector<GNEAdditional*>& myAdditionalParents;
86 
87     /// @brief reference to vector of demand element parents
88     const std::vector<GNEDemandElement*>& myDemandElementParents;
89 
90     /// @brief reference to vector of edge childs
91     const std::vector<GNEEdge*>& myEdgeChilds;
92 
93     /// @brief reference to vector of lane childs
94     const std::vector<GNELane*>& myLaneChilds;
95 
96     /// @brief reference to vector of shape childs
97     const std::vector<GNEShape*>& myShapeChilds;
98 
99     /// @brief reference to vector of additional childs
100     const std::vector<GNEAdditional*>& myAdditionalChilds;
101 
102     /// @brief reference to vector of demand element childs
103     const std::vector<GNEDemandElement*>& myDemandElementChilds;
104 };
105 
106 #endif
107 /****************************************************************************/
108