49FXIMPLEMENT(
GNEInspectorFrame, FXVerticalFrame, GNEInspectorFrameMap, ARRAYNUMBER(GNEInspectorFrameMap))
63 myInspectorFrameParent(inspectorFrameParent),
64 myEdgeTemplate(
nullptr) {
81 if (myInspectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeNetwork()) {
82 for (
const auto& AC : myInspectorFrameParent->getViewNet()->getInspectedElements().getACs()) {
104 return myEdgeTemplate;
111 if (myEdgeTemplate) {
112 delete myEdgeTemplate;
113 myEdgeTemplate =
nullptr;
119 myInspectorFrameParent->myViewNet->getViewParent()->getCreateEdgeFrame()->setUseEdgeTemplate();
126 if (myEdgeTemplate) {
127 myEdgeTemplate->updateLaneTemplates();
129 myInspectorFrameParent->myViewNet->getViewParent()->getCreateEdgeFrame()->setUseEdgeTemplate();
136 if (shown() && mySetTemplateButton->isEnabled()) {
137 onCmdSetTemplate(
nullptr, 0,
nullptr);
145 if (shown() && myCopyTemplateButton->isEnabled()) {
146 onCmdCopyTemplate(
nullptr, 0,
nullptr);
154 if (shown() && myClearTemplateButton->isEnabled()) {
155 onCmdClearTemplate(
nullptr, 0,
nullptr);
163 for (
const auto& AC : myInspectorFrameParent->myViewNet->getInspectedElements().getACs()) {
166 setEdgeTemplate(myInspectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveEdge(AC->getID()));
178 if (myEdgeTemplate) {
180 myInspectorFrameParent->myViewNet->getUndoList()->begin(myEdgeTemplate,
"copy edge template");
182 for (
const auto& AC : myInspectorFrameParent->myViewNet->getInspectedElements().getACs()) {
184 if (AC->getID() != myEdgeTemplate->getID()) {
186 myInspectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveEdge(AC->getID())->copyTemplate(myEdgeTemplate, myInspectorFrameParent->myViewNet->getUndoList());
190 myInspectorFrameParent->myViewNet->getUndoList()->end();
192 myInspectorFrameParent->myAttributesEditor->refreshAttributesEditor();
201 setEdgeTemplate(
nullptr);
210 const auto& inspectedElements = myInspectorFrameParent->getViewNet()->getInspectedElements();
212 if (inspectedElements.isInspectingSingleElement() && (inspectedElements.getFirstAC()->getTagProperty().getTag() ==
SUMO_TAG_EDGE)) {
213 mySetTemplateButton->setText((
TLF(
"Set edge '%' as Template", inspectedElements.getFirstAC()->getID())).c_str());
214 mySetTemplateButton->show();
216 mySetTemplateButton->hide();
219 if (myEdgeTemplate) {
221 if (inspectedElements.isInspectingSingleElement()) {
222 myCopyTemplateButton->setText((
"Copy '" + myEdgeTemplate->getID() +
"' into edge '" + inspectedElements.getFirstAC()->getID() +
"'").c_str());
224 myCopyTemplateButton->setText((
"Copy '" + myEdgeTemplate->getID() +
"' into " +
toString(inspectedElements.getACs().size()) +
" selected edges").c_str());
227 myCopyTemplateButton->enable();
228 myClearTemplateButton->enable();
231 myCopyTemplateButton->setText(
TL(
"No edge Template Set"));
233 myCopyTemplateButton->disable();
234 myClearTemplateButton->disable();
243 GNEFrame(viewParent, viewNet,
"Inspector") {
299 const Position &clickedPosition,
const bool shiftKeyPressed) {
307 if (AC->isAttributeCarrierSelected()) {
310 AC->selectAttributeCarrier();
327 std::vector<GNEAttributeCarrier*> itemsToInspect;
334 itemsToInspect.reserve(selectedACs.size());
336 for (
const auto& selectedAC : selectedACs) {
339 itemsToInspect.push_back(selectedAC);
343 itemsToInspect.push_back(AC);
385 if (inspectedElements.isInspectingElements()) {
387 std::string headerString;
388 if (inspectedElements.getFirstAC()->getTagProperty().isNetworkElement()) {
389 headerString =
"Net: ";
390 }
else if (inspectedElements.getFirstAC()->getTagProperty().isAdditionalElement()) {
391 headerString =
"Additional: ";
392 }
else if (inspectedElements.getFirstAC()->getTagProperty().isShapeElement()) {
393 headerString =
"Shape: ";
394 }
else if (inspectedElements.getFirstAC()->getTagProperty().isTAZElement()) {
395 headerString =
"TAZ: ";
396 }
else if (inspectedElements.getFirstAC()->getTagProperty().isWireElement()) {
397 headerString =
"WIRE: ";
398 }
else if (inspectedElements.getFirstAC()->getTagProperty().isVehicle()) {
399 headerString =
"Vehicle: ";
400 }
else if (inspectedElements.getFirstAC()->getTagProperty().isRoute()) {
401 headerString =
"Route: ";
402 }
else if (inspectedElements.getFirstAC()->getTagProperty().isPerson()) {
403 headerString =
"Person: ";
404 }
else if (inspectedElements.getFirstAC()->getTagProperty().isPlanPerson()) {
405 headerString =
"PersonPlan: ";
406 }
else if (inspectedElements.getFirstAC()->getTagProperty().isContainer()) {
407 headerString =
"Container: ";
408 }
else if (inspectedElements.getFirstAC()->getTagProperty().isPlanContainer()) {
409 headerString =
"ContainerPlan: ";
410 }
else if (inspectedElements.getFirstAC()->getTagProperty().isVehicleStop()) {
411 headerString =
"Stop: ";
412 }
else if (inspectedElements.getFirstAC()->getTagProperty().isDataElement()) {
413 headerString =
"Data: ";
416 headerString +=
toString(inspectedElements.getACs().size()) +
" ";
418 headerString += inspectedElements.getFirstAC()->getTagStr();
432 if (inspectedElements.isInspectingSingleElement()) {
FXDEFMAP(GNEInspectorFrame) GNEInspectorFrameMap[]
@ MID_GNE_INSPECTORFRAME_INSPECTPREVIOUSELEMENT
go back to the previous element
@ MID_HOTKEY_SHIFT_F2_TEMPLATE_COPY
copy template
@ MID_HOTKEY_SHIFT_F1_TEMPLATE_SET
set template
@ MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR
clear template
#define GUIDesignButtonRectangular
little rectangular button used in frames (For example, in "help" buttons)
@ SUMO_TAG_EDGE
begin/end of the description of an edge
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
void unselectAttributeCarrier()
unselect attribute carrier using GUIGlobalSelection
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
void showAttributesEditor(GNEAttributeCarrier *AC)
edit attributes of the given AC (usually the edited template AC)
void abortReparenting()
abort selecting parent
A road/street connecting two junctions (netedit-version)
void hideHierarchicalElementTree()
hide GNEElementTree
void showHierarchicalElementTree(GNEAttributeCarrier *AC)
show GNEElementTree
void hideParametersEditor()
hide netedit attributes EditorInspector
void showParametersEditor()
show netedit attributes EditorInspector
void setFrameWidth(const int newWidth)
set width of GNEFrame
void focusUpperElement()
focus upper element of frame
FXLabel * getFrameHeaderLabel() const
get the label for the frame's header
GNEViewNet * myViewNet
FOX need this.
virtual void show()
show Frame
virtual void hide()
hide Frame
FXHorizontalFrame * myHeaderLeftFrame
fame for left header elements
void updateButtons()
FOX need this.
void hideTemplateEditor()
hide template editor
void clearTemplate()
clear template (used by shortcut)
void setEdgeTemplate(const GNEEdge *edge)
set edge template
~TemplateEditor()
destructor
long onCmdCopyTemplate(FXObject *, FXSelector, void *)
copy edge attributes from edge template
void setTemplate()
set template (used by shortcut)
long onCmdSetTemplate(FXObject *, FXSelector, void *)
GNEEdgeTemplate * getEdgeTemplate() const
get edge template (to copy attributes from)
void copyTemplate()
copy template (used by shortcut)
void updateEdgeTemplate()
update edge template
bool showTemplateEditor()
show template editor
long onCmdClearTemplate(FXObject *, FXSelector, void *)
clear current edge template
GNEAttributesEditor * myNeteditAttributesEditor
Netedit Attributes editor.
long onCmdInspectPreviousElement(FXObject *, FXSelector, void *)
called when user press inspet previous elemnt button
GNEAttributeCarrier * myPreviousInspectedAC
Pointer to previous element inspected.
void selectedOverlappedElement(GNEAttributeCarrier *AC)
open GNEAttributesCreator extended dialog (can be reimplemented in frame children)
TemplateEditor * getTemplateEditor() const
get template editor
GNEInspectorFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
void inspectElements(const std::vector< GNEAttributeCarrier * > &ACs, GNEAttributeCarrier *previousInspectedAC=nullptr)
Inspect the given elements.
GNEElementTree * getHierarchicalElementTree() const
get GNEElementTree modul
bool inspectClickedElements(GNEViewNetHelper::ViewObjectsSelector &viewObjects, const Position &clickedPosition, const bool shiftKeyPressed)
process click over Viewnet
void show()
show inspector frame
GNEFrameAttributeModules::ParametersEditor * myParametersEditor
Parameters editor inspector.
GNEAttributesEditor * myFlowAttributesEditor
Flow attributes editor.
GNEAttributesEditor * myAttributesEditor
Attributes editor.
GNEAttributesEditor * myGEOAttributesEditor
GEO Attributes editor.
GNEOverlappedInspection * myOverlappedInspection
FOX need this.
GNEOverlappedInspection * getOverlappedInspection() const
get GNEOverlappedInspection modul
void clearInspection()
clear inspection
GNEAttributesEditor * getAttributesEditor() const
get AttributesEditor
void hide()
hide inspector frame
FXButton * myBackButton
Back Button.
void inspectElement(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousInspectedAC=nullptr)
Inspect a single element.
GNEElementTree * myHierarchicalElementTree
Attribute Carrier Hierarchy.
void refreshInspection()
refresh current inspection
~GNEInspectorFrame()
Destructor.
TemplateEditor * myTemplateEditor
Template editor.
GNEAttributesEditor * getNeteditAttributesEditor() const
get Netedit Attributes editor
void updateFrameAfterUndoRedo()
function called after undo/redo in the current frame (can be reimplemented in frame children)
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(const bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
void clearOverlappedInspection()
clear overlapped inspection
void hiderOverlappedInspection()
hide overlapped inspection
void showOverlappedInspection(GNEViewNetHelper::ViewObjectsSelector &viewObjects, const Position &clickedPosition, const bool shiftKeyPressed)
show overlapped inspection
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void inspectACs(const std::vector< GNEAttributeCarrier * > &ACs)
inspect multiple ACs
bool isInspectingMultipleElements() const
check if we're inspecting more than one elements
class used to group all variables related with objects under cursor after a click over view
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier or a pointer to nullptr
GNENet * getNet() const
get the net object
const GNEViewNetHelper::MouseButtonKeyPressed & getMouseButtonKeyPressed() const
get Key Pressed module
GNEViewNetHelper::InspectedElements & getInspectedElements()
get inspected elements
GNEViewParent * getViewParent() const
get the net object
void updateViewNet(const bool ignoreViewUpdater=true) const
Mark the entire GNEViewNet to be repainted later.
A single child window which contains a view of the simulation area.
int getFrameAreaWidth() const
get frame area width
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
MFXGroupBoxModule (based on FXGroupBox)
A point in 2D or 3D with translation and scaling methods.