42 myShapeEdited(false) {
50 myShapeEdited(false) {
82GNENetworkElement::GNENetworkElement::isNetworkElementValid()
const {
89GNENetworkElement::GNENetworkElement::getNetworkElementProblem()
const {
102 if (attributeProperty->isUnique()) {
103 ret->
mkItem(attributeProperty->getAttrStr().c_str(),
false,
getAttribute(attributeProperty->getAttr()));
105 ret->
mkItem(attributeProperty->getAttrStr().c_str(),
true,
getAttribute(attributeProperty->getAttr()));
194 geometryPointRadius = s.neteditSizeSettings.junctionGeometryPointRadius;
196 geometryPointRadius = s.neteditSizeSettings.edgeGeometryPointRadius;
198 geometryPointRadius = s.neteditSizeSettings.laneGeometryPointRadius;
200 geometryPointRadius = s.neteditSizeSettings.connectionGeometryPointRadius;
202 geometryPointRadius = s.neteditSizeSettings.crossingGeometryPointRadius;
204 const auto geometryPointRadiusSquared = (geometryPointRadius * geometryPointRadius);
207 for (
int i = 0; i < (int)shape.size(); i++) {
208 if (shape[i].distanceSquaredTo2D(mousePos) < geometryPointRadiusSquared) {
219 const Boundary b = shape.getBoxBoundary();
226 if (shape.isClosed()) {
227 simplifiedShape.push_back(simplifiedShape[0]);
238 straigthenShape.push_back(shape.back());
246 shape.closePolygon();
263 for (
int i = index; i < (int)shape.size(); i++) {
264 newShape.push_back(shape[i]);
266 for (
int i = 0; i < index; i++) {
267 newShape.push_back(shape[i]);
277 for (
int i = 0; i < (int)shape.size(); i++) {
279 newShape.push_back(shape[i]);
326 const std::string headerName =
TLF(
"% (Edited shape)",
getFullName());
332 new FXMenuSeparator(ret);
337 if (shape.size() <= 2) {
338 simplifyShape->disable();
348 if (shape.size() <= 2) {
349 straightenShape->disable();
358 if ((shape.
isClosed() && (shape.size() <= 4)) || (!shape.
isClosed() && (shape.size() <= 2))) {
359 removeGeometryPoint->disable();
363 setFirstPoint->disable();
367 new FXMenuSeparator(ret);
377 for (
const auto& shapePosition : shape) {
@ NETWORK
Network mode (Edges, junctions, etc..)
@ MID_COPY_TEST_COORDINATES
Copy test coordinates.
@ MID_GNE_SHAPEEDITED_DELETE_GEOMETRY_POINT
delete geometry point in shape edited
@ MID_GNE_SHAPEEDITED_STRAIGHTEN
straighten shape edited geometry
@ MID_GNE_SHAPEEDITED_OPEN
open closed shape edited
@ MID_GNE_SHAPEEDITED_SIMPLIFY
simplify shape edited geometry
@ MID_GNE_SHAPEEDITED_FINISH
finish editing shape edited
@ MID_GNE_SHAPEEDITED_CLOSE
close opened shape edited
@ MID_GNE_SHAPEEDITED_SET_FIRST_POINT
Set a vertex of shape edited as first vertex.
GUIViewObjectsHandler gViewObjectsHandler
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_CONNECTION
connectioon between two lanes
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
double ymin() const
Returns minimum y-coordinate.
double xmin() const
Returns minimum x-coordinate.
double ymax() const
Returns maximum y-coordinate.
double xmax() const
Returns maximum x-coordinate.
virtual PositionVector getAttributePositionVector(SumoXMLAttr key) const =0
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
void markForDrawingFront()
mark for drawing front
void selectAttributeCarrier()
FileBucket * myFileBucket
filebucket vinculated whith this AC
const std::string getID() const override
get ID (all Attribute Carriers have one)
void unselectAttributeCarrier()
unselect attribute carrier using GUIGlobalSelection
const std::string & getTagStr() const
get tag assigned to this object in string format
GNENet * myNet
pointer to net
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
virtual std::string getAttribute(SumoXMLAttr key) const =0
const GNETagProperties * myTagProperty
reference to tagProperty associated with this attribute carrier
const GNEHierarchicalContainerChildren< GNEGenericData * > & getChildGenericDatas() const
return child generic data elements
const GNEHierarchicalContainerChildren< GNEAdditional * > & getChildAdditionals() const
return child additionals
const GNEHierarchicalContainerChildrenSet< GNETAZSourceSink * > & getChildTAZSourceSinks() const
return child TAZSourceSinks (Set)
const GNEHierarchicalContainerChildren< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
void requireSaveAdditionals()
inform that additionals has to be saved
void requireSaveDataElements()
inform that data elements has to be saved
void requireSaveDemandElements()
inform that demand elements has to be saved
GNENetHelper::SavingStatus * getSavingStatus() const
get saving status
GNEViewParent * getViewParent() const
get view parent (used for simplify code)
GNEViewNet * getViewNet() const
get view net (used for simplify code)
bool checkDrawingBoundarySelection() const
void closeShapeEdited(GNEUndoList *undoList)
close shape edited
void setFirstGeometryPointShapeEdited(const int index, GNEUndoList *undoList)
set first geometry point shape edited
void openShapeEdited(GNEUndoList *undoList)
open shape edited
GUIGlObject * getGUIGlObject() override
get GUIGlObject associated with this AttributeCarrier
GNEHierarchicalElement * getHierarchicalElement() override
methods to retrieve the elements linked to this network element
bool isGLObjectLocked() const override
check if element is locked
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own parameter window.
void setShapeEdited(const bool value)
set shape edited
int getGeometryPointUnderCursorShapeEdited() const
get index geometry point under cursor of shape edited
bool myShapeEdited
flag to check if element shape is being edited
FileBucket * getFileBucket() const override
get reference to fileBucket in which save this AC
GNENetworkElement(GNENet *net, SumoXMLTag tag)
Constructor for templates.
void simplifyShapeEdited(GNEUndoList *undoList)
simplify shape edited
void straigthenShapeEdited(GNEUndoList *undoList)
straighten shape edited
GUIGLObjectPopupMenu * getShapeEditedPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent, const PositionVector &shape)
get shape edited popup menu
void markAsFrontElement() override
mark element as front element
void deleteGeometryPointShapeEdited(const int index, GNEUndoList *undoList)
delete geometry point shape edited
void resetShapeEdited(GNEUndoList *undoList)
reset shape edited
void selectGLObject() override
select element
virtual const std::string getOptionalName() const override
Returns the name of the object (default "")
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
void setNetworkElementID(const std::string &newID)
set network element id
bool isShapeEdited() const
check if shape is being edited
int getVertexIndex(const PositionVector &shape, const Position &pos)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge
virtual ~GNENetworkElement()
Destructor.
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
SelectionInformation * getSelectionInformation() const
get modul for selection information
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
const std::vector< const GNEAttributeProperties * > & getAttributeProperties() const
get all attribute properties
bool isObjectLocked(GUIGlObjectType objectType, const bool selected) const
check if given GLObject is locked for inspect, select, delete and move
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
GNEViewNetHelper::LockManager & getLockManager()
get lock manager
GNESelectorFrame * getSelectorFrame() const
get frame for select elements
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel, const bool disable=false)
build menu command
FXIcon * getGLIcon() const
get icon associated with this GL Object
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
const std::string & getFullName() const
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
FXFont * getBoldFont()
get bold front
A window containing a gl-object's parameter.
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
const GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings (read only)
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
bool isObjectSelected(const GUIGlObject *GLObject) const
check if element was already selected
bool selectingUsingRectangle() const
return true if we're selecting using a triangle
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
static OptionsCont & getOptions()
Retrieves the options.
A point in 2D or 3D with translation and scaling methods.
int indexOfClosest(const Position &p, bool twoD=false) const
void push_front(const Position &p)
insert in front a Position
bool isClosed() const
check if PositionVector is closed
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
static const double polygonGeometryPointRadius
moving geometry point radius