156#pragma warning(disable: 4355)
162 myGLObjectType(type),
163 myMicrosimID(microsimID),
176 paramWindow->removeObject(
this);
258GUIGlObject::getNode()
const {
264GUIGlObject::setNode(osg::Node* node) {
274 new FXMenuSeparator(ret);
283 new FXMenuSeparator(ret);
293 new FXMenuSeparator(ret);
306 new FXMenuSeparator(ret);
315 new FXMenuSeparator(ret);
324 new FXMenuSeparator(ret);
335 FXMenuPane* showCursorGeoPositionPane =
new FXMenuPane(ret);
337 new FXMenuCascade(ret,
"Show cursor geo-position in ",
nullptr, showCursorGeoPositionPane);
339 if (mapper.first ==
"GeoHack") {
341 }
else if (mapper.first ==
"GoogleSat") {
343 }
else if (mapper.first ==
"OSM") {
357 new FXMenuSeparator(ret);
370 std::set<GUIParameterTableWindow*>::iterator i =
myParamWindows.find(t);
395 new FXMenuSeparator(ret);
418 new FXMenuSeparator(ret);
457 const double offsetX,
const double offsetY,
const double rot)
const {
461 shape.push_back(
Position(0 + width, 0 + height));
462 shape.push_back(
Position(0 + width, 0 - height));
463 shape.push_back(
Position(0 - width, 0 - height));
464 shape.push_back(
Position(0 - width, 0 + height));
466 shape.
add(offsetX, offsetY, 0);
486 if (settings.
show(
this) || forceShow) {
@ MID_MANIP
Open the object's manipulator.
@ MID_ADDSELECT
Add to selected items - menu entry.
@ MID_COPY_CURSOR_GEOPOSITION
Copy cursor geo-coordinate position - popup entry.
@ MID_CENTER
Center view to object - popup entry.
@ MID_SHOW_GEOPOSITION_ONLINE
Show the cursor geo-coordinate position online in GeoHack - popup entry.
@ MID_COPY_TYPED_NAME
Copy typed object name - popup entry.
@ MID_COPY_CURSOR_POSITION
Copy cursor position - popup entry.
@ MID_SHOWPARS
Show object parameter - popup entry.
@ MID_COPY_NAME
Copy object name - popup entry.
@ MID_SHOWTYPEPARS
Show object type parameter - popup entry.
@ MID_REMOVESELECT
Remove from selected items - Menu Entry.
@ GLO_EDGERELDATA
edge relation data
@ GLO_DET_EXIT
a DetExit detector
@ GLO_TAZRELDATA
TAZ relation data.
@ GLO_WALKINGAREA
a walkingArea
@ GLO_TEMPORALSHAPE
temporal shape (used in NETEDIT)
@ GLO_STOP_CONTAINER
a container stop
@ GLO_ROUTEELEMENT
reserved GLO type to pack all RouteElements (note: In this case the sorting of GLO_<element> is impor...
@ GLO_REROUTER_EDGE
a Rerouter over edge
@ GLO_REROUTER_DESTPROBREROUTE
a destiny probability reroute
@ GLO_TESTELEMENT
test element (used in NETEDIT)
@ GLO_DOTTEDCONTOUR_INSPECTED
dotted contour inspected element (used in NETEDIT)
@ GLO_E2DETECTOR
a E2 detector
@ GLO_DET_ENTRY
a DetEntry detector
@ GLO_TRANSHIP
a container tranship
@ GLO_ROUTEPROBE
a RouteProbe
@ GLO_E1DETECTOR
a E1 detector
@ GLO_DOTTEDCONTOUR_FRONT
dotted contour front element (used in NETEDIT)
@ GLO_VAPORIZER
a Vaporizer
@ GLO_ROUTEFLOW
a routeFlow
@ GLO_CONTAINER_STOP
a containerStop
@ GLO_WIRE
reserved GLO type for packing all wire elements
@ GLO_CALIBRATOR
a Calibrator
@ GLO_E3DETECTOR
a E3 detector
@ GLO_CHARGING_STATION
a chargingStation
@ GLO_PARKING_AREA
a ParkingArea
@ GLO_VSS_STEP
a Variable Speed Sign step
@ GLO_TAZ
Traffic Assignment Zones (TAZs)
@ GLO_LANEARROWS
lane details
@ GLO_CONTAINER
a container
@ GLO_PARENTCHILDLINE
line between parent and childrens
@ GLO_CONNECTION
a connection
@ GLO_REROUTER_PARKINGAREAREROUTE
a parking area reroute
@ GLO_ADDITIONALELEMENT
reserved GLO type for packing all additionals elements
@ GLO_PERSONTRIP
a person trip
@ GLO_TRANSPORT
a container transport
@ GLO_STOP_PERSON
a person stop
@ GLO_NETWORK
The network - empty.
@ GLO_SHAPE
reserved GLO type to pack shapes
@ GLO_REROUTER_CLOSINGLANEREROUTE
a closing lane reroute
@ GLO_RECTANGLESELECTION
rectangle selection shape (used in NETEDIT)
@ GLO_OVERHEAD_WIRE_SEGMENT
a segment of an overhead line
@ GLO_TEXTNAME
text element (used in NETEDIT)
@ GLO_NETWORKELEMENT
reserved GLO type to pack all network elements
@ GLO_REROUTER_CLOSINGREROUTE
a closing reroute
@ GLO_PARKING_SPACE
a ParkingSpace
@ GLO_CONTAINERFLOW
a person flow
@ GLO_E1DETECTOR_ME
a E1 detector
@ GLO_PERSONFLOW
a person flow
@ GLO_E1DETECTOR_INSTANT
a E1 detector
@ GLO_REROUTER_INTERVAL
a rerouter interval
@ GLO_REROUTER_ROUTEPROBREROUTE
a route probability reroute
@ GLO_TRACTIONSUBSTATION
a segment of an overhead line
@ GLO_VSS
a Variable Speed Sign
@ GLO_LOCKICON
Lock icon (used in NETEDIT)
GUIPostDrawing gPostDrawing
GUISelectedStorage gSelected
A global holder of selected objects.
@ GEOHACK
icons for geo tools
#define UNUSED_PARAMETER(x)
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048, const int align=0)
static void removeObject(GUIGlObject &o)
Removes all instances that pass values from the object with the given id.
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
FXIcon * getGLIcon() const
get icon associated with this GL Object
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
std::string myMicrosimID
ID of GL object.
virtual void markAsFrontElement()
mark element as front element (Currently used only in NETEDIT)
std::string myFullName
full name of GL Object
void buildShowTypeParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the type parameter window.
void buildShowManipulatorPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the manipulator window.
virtual void deleteGLObject()
delete GLObject (Currently used only in NETEDIT)
const GUIGlObjectType myGLObjectType
The type of the object.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
virtual GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own type parameter window (optional)
virtual const std::string getOptionalName() const
Returns the name of the object (default "")
static const GUIGlID INVALID_ID
void buildShapePopupOptions(GUIMainWindow &app, GUIGLObjectPopupMenu *ret, const std::string &type)
build basic shape popup options. Used to unify pop-ups menu in netedit and SUMO-GUI
static StringBijection< GUIGlObjectType >::Entry GUIGlObjectTypeNamesInitializer[]
vector for TypeNames Initializer
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
const std::string & getFullName() const
virtual std::string getParentName() const
Returns the name of the parent object (if any)
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
virtual void updateGLObject()
update GLObject (geometry, ID, etc.) (optional)
void mouseWithinGeometry(const Position center, const double radius) const
check if mouse is within elements geometry (for circles)
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
void addParameterTable(GUIParameterTableWindow *w)
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
static StringBijection< GUIGlObjectType > TypeNames
associates object types with strings
void buildAdditionalsPopupOptions(GUIMainWindow &app, GUIGLObjectPopupMenu *ret, const std::string &type)
build basic additional popup options. Used to unify pop-ups menu in netedit and SUMO-GUI
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
virtual ~GUIGlObject()
Destructor.
void removeParameterTable(GUIParameterTableWindow *w)
Lets this object know a parameter window showing the object's values was closed.
virtual void drawGLAdditional(GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
Draws additional, user-triggered visualisations.
virtual bool isGLObjectLocked()
check if element is locked (Currently used only in NETEDIT)
virtual void selectGLObject()
select GLObject (Currently used only in NETEDIT)
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
FXIcon * myIcon
icon associatd with this GL Object
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, const GUIMainWindow &app) const
Builds an entry which allows to copy the cursor position if geo projection is used,...
GUIGlID getGlID() const
Returns the numerical id of the object.
std::string createFullName() const
create full name
std::set< GUIParameterTableWindow * > myParamWindows
Parameter table windows which refer to this object.
GUIGlObject(GUIGlObjectType type, const std::string µsimID, FXIcon *icon)
Constructor.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0, bool forceShow=false) const
draw name of item
A storage for of displayed objects via their numerical id.
void changeName(GUIGlObject *object, const std::string &fullName)
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
bool remove(GUIGlID id)
Removes the named object from this container.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
FXFont * getBoldFont()
get bold front
const std::map< std::string, std::string > & getOnlineMaps() const
A window containing a gl-object's parameter.
void addElementUnderCursor(const GUIGlObject *GLObject)
add element into list of elements under cursor
Position mousePos
mouse position before rendering elements
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
Stores the information about how to visualize structures.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
A point in 2D or 3D with translation and scaling methods.
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
void rotate2D(double angle)
void add(double xoff, double yoff, double zoff)
double distance2D(const Position &p, bool perpendicular=false) const
closest 2D-distance to point p (or -1 if perpendicular is true and the point is beyond this vector)
bool around(const Position &p, double offset=0) const
Returns the information whether the position vector describes a polygon lying around the given point.
const std::string & getString(const T key) const
static std::string emptyString
An empty string.
bool show(const GUIGlObject *o) const
whether to show the text