Eclipse SUMO - Simulation of Urban MObility
GNETAZRelDataFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2020 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 // The Widget for add TAZRelationData elements
19 /****************************************************************************/
20 #include <config.h>
21 
23 #include <netedit/GNEViewNet.h>
24 
25 #include "GNETAZRelDataFrame.h"
26 
27 
28 // ===========================================================================
29 // method definitions
30 // ===========================================================================
31 
32 GNETAZRelDataFrame::GNETAZRelDataFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) :
33  GNEGenericDataFrame(horizontalFrameParent, viewNet, SUMO_TAG_TAZREL, false),
34  myFirstTAZElement(nullptr) {
35 }
36 
37 
39 
40 
41 bool
43  // check if myFirstTAZElement is empty
44  if (myFirstTAZElement) {
45  if (objectsUnderCursor.getTAZElementFront()) {
46  // finally create TAZRelationData
48  // TAZRelationData created, then return true
49  return true;
50  } else {
51  return false;
52  }
53  } else if (objectsUnderCursor.getTAZElementFront()) {
54  myFirstTAZElement = objectsUnderCursor.getTAZElementFront();
55  return true;
56  } else {
57  return false;
58  }
59 }
60 
61 
62 void
64  myFirstTAZElement = nullptr;
65 }
66 
67 /****************************************************************************/
@ SUMO_TAG_TAZREL
a relation between two TAZs
static GNEGenericData * buildTAZRelationData(GNENet *net, bool allowUndoRedo, GNEDataInterval *dataIntervalParent, GNETAZElement *fromTAZ, GNETAZElement *toTAZ, const std::map< std::string, std::string > &parameters)
Builds TAZRelationData.
const std::map< std::string, std::string > & getParametersMap() const
get parameters as map
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:113
GNEDataInterval * getDataInterval() const
get current select data set ID
IntervalSelector * myIntervalSelector
interval selector modul
GNEFrameAttributesModuls::ParametersEditorCreator * myParametersEditorCreator
parameters editor creator
GNETAZElement * myFirstTAZElement
first selected TAZ Element
bool addTAZRelationData(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed &mouseButtonKeyPressed)
add additional element
GNETAZRelDataFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
~GNETAZRelDataFrame()
Destructor.
void clearTAZSelection()
clear TAZ selection
class used to group all variables related with objects under cursor after a click over view
GNETAZElement * getTAZElementFront() const
get front TAZElement or a pointer to nullptr
GNENet * getNet() const
get the net object
class used to group all variables related with mouse buttons and key pressed after certain events