43 myParentJunction(parentJunction),
44myTesselation(ID,
"",
RGBColor::GREY, parentJunction->getNBNode()->getWalkingArea(ID).shape,
false,
true, 0) {
46 updateCenteringBoundary(
false);
119 if (walkingAreaColor.
alpha() != 0) {
137 glTranslated(mousePosition.
x(), mousePosition.
y(), 0.1);
178 (walkingAreaExaggeration >= 1) ? walkingAreaExaggeration : 1);
183 (walkingAreaExaggeration >= 1) ? walkingAreaExaggeration : 1);
188 (walkingAreaExaggeration >= 1) ? walkingAreaExaggeration : 1);
193 (walkingAreaExaggeration >= 1) ? walkingAreaExaggeration : 1);
229 mcCustomShape->disable();
232 mcCustomShape->disable();
242 if (shape.size() == 0) {
262 return toString(walkingArea.length);
311 return canParse<double>(value) && (parse<double>(value) > 0);
313 if (canParse<PositionVector>(value)) {
314 return parse<PositionVector>(value).size() > 0;
319 return canParse<bool>(value);
342 walkingArea.width = parse<double>(value);
345 walkingArea.length = parse<double>(value);
348 walkingArea.shape = parse<PositionVector>(value);
349 walkingArea.hasCustomShape =
true;
352 if (parse<bool>(value)) {
NetworkEditMode
@brie enum for network edit modes
@ NETWORK_MOVE
mode for moving network elements
@ NETWORK_CREATE_EDGE
mode for creating new edges
@ NETWORK_TLS
mode for editing tls
@ NETWORK_CONNECT
mode for connecting lanes
@ MID_GNE_WALKINGAREA_EDIT_SHAPE
edit crossing shape
@ GLO_WALKINGAREA
a walkingArea
GUIIcon
An enumeration of icons used by the gui applications.
@ SUMO_TAG_WALKINGAREA
walking area for pedestrians
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Boundary & grow(double by)
extends the boundary by the given amount
static void drawFilledPoly(const PositionVector &v, bool close)
Draws a filled polygon described by the list of points.
static void drawBoundary(const Boundary &b)
Draw a boundary (used for debugging)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
static void pushName(unsigned int name)
push Name
static void popMatrix()
pop matrix
static void popName()
pop Name
static void pushMatrix()
push matrix
const std::string getID() const
get ID (all Attribute Carriers have one)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
friend class GNEChange_Attribute
declare friend class
const std::string & getTagStr() const
get tag assigned to this object in string format
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
static const Parameterised::Map PARAMETERS_EMPTY
empty parameter maps (used by ACs without parameters)
GNENet * myNet
pointer to net
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
double getMaxDrawingSize() const
get the maximum size (in either x-, or y-dimension) for determining whether to draw or not
Position getPositionInView() const
Returns position of hierarchical element in view.
NBNode * getNBNode() const
Return net build node.
GNEMoveOperation * calculateMoveShapeOperation(const PositionVector originalShape, const Position mousePosition, const double snapRadius, const bool onlyContour)
calculate move shape operation
PositionVector shapeToUpdate
shape to update (edited in moveElement)
GNEViewNet * getViewNet() const
get view net
bool myShapeEdited
flag to check if element shape is being edited
bool isShapeEdited() const
check if shape is being edited
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Boundary myBoundary
object boundary
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
void add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
bool drawSelectContour(const GUIGlObject *GLObject, const GNEAttributeCarrier *AC) const
check if draw select contour
bool drawDeleteContour(const GUIGlObject *GLObject, const GNEAttributeCarrier *AC) const
check if draw delete contour
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, double typeOrLayer, const double extraOffset=0)
draw front attributeCarrier
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
~GNEWalkingArea()
Destructor.
GNEMoveOperation * getMoveOperation()
get move operation
std::string getAttribute(SumoXMLAttr key) const
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
double myExaggeration
exaggeration used in tesselation
Position getPositionInView() const
Returns position of hierarchical element in view.
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
NBNode::WalkingArea & getNBWalkingArea() const
get referente to NBode::WalkingArea
void deleteGLObject()
delete element
bool isValid(SumoXMLAttr key, const std::string &value)
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
GNEJunction * myParentJunction
the parent junction of this crossing
TesselatedPolygon myTesselation
An object that stores the shape and its tesselation.
GNEWalkingArea(GNEJunction *parentJunction, const std::string &ID)
Constructor.
void updateGLObject()
update GLObject (geometry, ID, etc.)
void updateGeometry()
update pre-computed geometry information
GNEJunction * getParentJunction() const
get parent Junction
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
bool isAttributeEnabled(SumoXMLAttr key) const
const Parameterised::Map & getACParametersMap() const
get parameters map
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
static void drawDottedContourClosedShape(const GUIVisualizationSettings &s, const DottedContourType type, const PositionVector &shape, const double exaggeration, const double customWidth=1)
draw dotted contour for the given closed shape (used by Juctions, shapes and TAZs)
static void drawGeometryPoints(const GUIVisualizationSettings &s, const Position &mousePos, const PositionVector &shape, const RGBColor &geometryPointColor, const RGBColor &textColor, const double radius, const double exaggeration, const bool editingElevation, const bool drawExtremeSymbols)
draw geometry points
static void drawMovingHint(const GUIVisualizationSettings &s, const Position &mousePos, const PositionVector &shape, const RGBColor &hintColor, const double radius, const double exaggeration)
draw moving hint
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
bool mouseWithinGeometry(const Position center, const double radius) const
check if mouse is within elements geometry (for circles)
virtual double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
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.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0, bool forceShow=false) const
draw name of item
T getColor(const double value) const
const GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings (read only)
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
Stores the information about how to visualize structures.
bool drawBoundaries
enable or disable draw boundaries
bool drawForPositionSelection
whether drawing is performed for the purpose of selecting objects with a single click
GUIVisualizationTextSettings cwaEdgeName
bool drawMovingGeometryPoint(const double exaggeration, const double radius) const
check if moving geometry point can be draw
GUIVisualizationColorSettings colorSettings
color settings
double scale
information about a lane's width (temporary, used for a single view)
GUIVisualizationTextSettings edgeName
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions
bool drawCrossingsAndWalkingareas
whether crosings and walkingareas shall be drawn
GUIColorer junctionColorer
The junction colorer.
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
const PositionVector & getShape() const
retrieve the junction shape
WalkingArea & getWalkingArea(const std::string &id)
return the walkingArea with the given ID
std::map< std::string, std::string > Map
parameters map
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
double y() const
Returns the y-position.
void closePolygon()
ensures that the last position equals the first
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
void scaleRelative(double factor)
enlarges/shrinks the polygon by a factor based at the centroid
double area() const
Returns the area (0 for non-closed)
bool around(const Position &p, double offset=0) const
Returns the information whether the position vector describes a polygon lying around the given point.
static const RGBColor BLUE
unsigned char alpha() const
Returns the alpha-amount of the color.
static const RGBColor GREY
static const RGBColor BLACK
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
const PositionVector & getShape() const
Returns the shape of the polygon.
virtual void setShape(const PositionVector &shape)
Sets the shape of the polygon.
PositionVector & getShapeRef()
Return the exterior shape of the polygon.
std::vector< GLPrimitive > myTesselation
id of the display list for the cached tesselation
void drawTesselation(const PositionVector &shape) const
perform the tesselation / drawing
NetworkEditMode networkEditMode
the current Network edit mode
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
bool editingElevation() const
check if we're editing elevation
static const RGBColor editShapeColor
color for edited shapes (Junctions, crossings and connections)
static const double crossingGeometryPointRadius
moving crossing geometry point radius
bool show(const GUIGlObject *o) const
whether to show the text
A definition of a pedestrian walking area.
PositionVector shape
The polygonal shape.