Eclipse SUMO - Simulation of Urban MObility
GNEPythonTool.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 // Python tools used in netedit
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
25 
26 // ===========================================================================
27 // class declarations
28 // ===========================================================================
29 
31 
32 // ===========================================================================
33 // class definitions
34 // ===========================================================================
35 
37 
38 public:
40  GNEPythonTool(GNEApplicationWindow* GNEApp, const std::string& toolPath,
41  const std::string& templateStr, FXMenuPane* menu);
42 
44  virtual ~GNEPythonTool();
45 
48 
50  const std::string& getToolName() const;
51 
54 
56  FXMenuCommand* getMenuCommand() const;
57 
59  virtual void setCurrentValues();
60 
62  virtual void postProcessing();
63 
65  virtual std::string getCommand() const;
66 
68  const std::string getDefaultValue(const std::string& name) const;
69 
71  bool loadConfiguration(const std::string& file);
72 
74  void saveConfiguration(const std::string& file) const;
75 
76 protected:
78  std::string getCommandPath() const;
79 
80 protected:
83 
85  FXMenuCommand* myMenuCommand;
86 
89 
92 
94  const std::string myToolPath;
95 
97  const std::string myPythonToolName;
98 
99 private:
101  GNEPythonTool(const GNEPythonTool&) = delete;
102 
105 };
The main window of Netedit.
GNEPythonTool(GNEApplicationWindow *GNEApp, const std::string &toolPath, const std::string &templateStr, FXMenuPane *menu)
Constructor.
OptionsCont myPythonToolsOptionsOriginal
original tools options
Definition: GNEPythonTool.h:91
FXMenuCommand * myMenuCommand
menu command associated with this tool
Definition: GNEPythonTool.h:85
virtual std::string getCommand() const
get command (python + script + arguments)
GNEApplicationWindow * getGNEApp() const
get to GNEApplicationWindow
void saveConfiguration(const std::string &file) const
save configuration
bool loadConfiguration(const std::string &file)
load configuration
virtual void setCurrentValues()
set current values (used for set values like current folder and similar)
virtual ~GNEPythonTool()
destructor
const std::string getDefaultValue(const std::string &name) const
get default value of the given parameter
GNEPythonTool & operator=(const GNEPythonTool &)=delete
Invalidated assignment operator.
GNEApplicationWindow * myGNEApp
pointer to GNEApplicationWindow
Definition: GNEPythonTool.h:82
std::string getCommandPath() const
get command (python + script)
const std::string & getToolName() const
get tool name
FXMenuCommand * getMenuCommand() const
get menu command
const std::string myPythonToolName
tool name
Definition: GNEPythonTool.h:97
virtual void postProcessing()
execute post processing
OptionsCont & getToolsOptions()
get tools options
const std::string myToolPath
python tool path relative to SUMO_HOME
Definition: GNEPythonTool.h:94
OptionsCont myPythonToolsOptions
tools options
Definition: GNEPythonTool.h:88
GNEPythonTool(const GNEPythonTool &)=delete
Invalidated copy constructor.
A storage for options typed value containers)
Definition: OptionsCont.h:89