51FXIMPLEMENT(
GNEInspectorFrame, FXVerticalFrame, GNEInspectorFrameMap, ARRAYNUMBER(GNEInspectorFrameMap))
65 myInspectorFrameParent(inspectorFrameParent),
66 myEdgeTemplate(
nullptr) {
83 if (myInspectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeNetwork()) {
84 for (
const auto& AC : myInspectorFrameParent->getViewNet()->getInspectedElements().getACs()) {
106 return myEdgeTemplate;
113 if (myEdgeTemplate) {
114 delete myEdgeTemplate;
115 myEdgeTemplate =
nullptr;
121 myInspectorFrameParent->myViewNet->getViewParent()->getCreateEdgeFrame()->setUseEdgeTemplate();
128 if (myEdgeTemplate) {
129 myEdgeTemplate->updateLaneTemplates();
131 myInspectorFrameParent->myViewNet->getViewParent()->getCreateEdgeFrame()->setUseEdgeTemplate();
138 if (shown() && mySetTemplateButton->isEnabled()) {
139 onCmdSetTemplate(
nullptr, 0,
nullptr);
147 if (shown() && myCopyTemplateButton->isEnabled()) {
148 onCmdCopyTemplate(
nullptr, 0,
nullptr);
156 if (shown() && myClearTemplateButton->isEnabled()) {
157 onCmdClearTemplate(
nullptr, 0,
nullptr);
165 for (
const auto& AC : myInspectorFrameParent->myViewNet->getInspectedElements().getACs()) {
168 setEdgeTemplate(myInspectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveEdge(AC->getID()));
180 if (myEdgeTemplate) {
182 myInspectorFrameParent->myViewNet->getUndoList()->begin(myEdgeTemplate,
"copy edge template");
184 for (
const auto& AC : myInspectorFrameParent->myViewNet->getInspectedElements().getACs()) {
186 if (AC->getID() != myEdgeTemplate->getID()) {
188 myInspectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveEdge(AC->getID())->copyTemplate(myEdgeTemplate, myInspectorFrameParent->myViewNet->getUndoList());
192 myInspectorFrameParent->myViewNet->getUndoList()->end();
194 myInspectorFrameParent->myAttributesEditor->refreshAttributesEditor();
203 setEdgeTemplate(
nullptr);
212 const auto& inspectedElements = myInspectorFrameParent->getViewNet()->getInspectedElements();
214 if (inspectedElements.isInspectingSingleElement() && (inspectedElements.getFirstAC()->getTagProperty()->getTag() ==
SUMO_TAG_EDGE)) {
215 mySetTemplateButton->setText((
TLF(
"Set edge '%' as Template", inspectedElements.getFirstAC()->getID())).c_str());
216 mySetTemplateButton->show();
218 mySetTemplateButton->hide();
221 if (myEdgeTemplate) {
223 if (inspectedElements.isInspectingSingleElement()) {
224 myCopyTemplateButton->setText((
"Copy '" + myEdgeTemplate->getID() +
"' into edge '" + inspectedElements.getFirstAC()->getID() +
"'").c_str());
226 myCopyTemplateButton->setText((
"Copy '" + myEdgeTemplate->getID() +
"' into " +
toString(inspectedElements.getACs().size()) +
" selected edges").c_str());
229 myCopyTemplateButton->enable();
230 myClearTemplateButton->enable();
233 myCopyTemplateButton->setText(
TL(
"No edge Template Set"));
235 myCopyTemplateButton->disable();
236 myClearTemplateButton->disable();
245 GNEFrame(viewParent, viewNet,
"Inspector") {
289 const Position& clickedPosition,
const bool shiftKeyPressed) {
297 if (AC->isAttributeCarrierSelected()) {
300 AC->selectAttributeCarrier();
317 std::vector<GNEAttributeCarrier*> itemsToInspect;
324 itemsToInspect.reserve(selectedACs.size());
326 for (
const auto& selectedAC : selectedACs) {
329 itemsToInspect.push_back(selectedAC);
333 itemsToInspect.push_back(AC);
371 if (inspectedElements.isInspectingElements()) {
373 std::string headerString;
374 if (inspectedElements.getFirstAC()->getTagProperty()->isNetworkElement()) {
375 headerString =
"Net: ";
376 }
else if (inspectedElements.getFirstAC()->getTagProperty()->isAdditionalElement()) {
377 headerString =
"Additional: ";
378 }
else if (inspectedElements.getFirstAC()->getTagProperty()->isShapeElement()) {
379 headerString =
"Shape: ";
380 }
else if (inspectedElements.getFirstAC()->getTagProperty()->isTAZElement()) {
381 headerString =
"TAZ: ";
382 }
else if (inspectedElements.getFirstAC()->getTagProperty()->isWireElement()) {
383 headerString =
"WIRE: ";
384 }
else if (inspectedElements.getFirstAC()->getTagProperty()->isVehicle()) {
385 headerString =
"Vehicle: ";
386 }
else if (inspectedElements.getFirstAC()->getTagProperty()->isRoute()) {
387 headerString =
"Route: ";
388 }
else if (inspectedElements.getFirstAC()->getTagProperty()->isPerson()) {
389 headerString =
"Person: ";
390 }
else if (inspectedElements.getFirstAC()->getTagProperty()->isPlanPerson()) {
391 headerString =
"PersonPlan: ";
392 }
else if (inspectedElements.getFirstAC()->getTagProperty()->isContainer()) {
393 headerString =
"Container: ";
394 }
else if (inspectedElements.getFirstAC()->getTagProperty()->isPlanContainer()) {
395 headerString =
"ContainerPlan: ";
396 }
else if (inspectedElements.getFirstAC()->getTagProperty()->isVehicleStop()) {
397 headerString =
"Stop: ";
398 }
else if (inspectedElements.getFirstAC()->getTagProperty()->isDataElement()) {
399 headerString =
"Data: ";
402 headerString +=
toString(inspectedElements.getACs().size()) +
" ";
404 headerString += inspectedElements.getFirstAC()->getTagStr();
415 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, const bool primaryAttributeEditor)
edit attributes of the given AC (usually the edited template AC)
void abortReparenting()
abort selecting parent
void hideHierarchicalElementTree()
hide GNEElementTree
void showHierarchicalElementTree(GNEAttributeCarrier *AC)
show GNEElementTree
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
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
GNEAttributesEditor * myAttributesEditor
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.
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.