Skip to content

Commit 1b2202e

Browse files
authoredOct 27, 2021
Scale mode - Part3 (#882)
* enable scale mode Signed-off-by: Ian Chen <ichen@osrfoundation.org>
1 parent 61f59f5 commit 1b2202e

File tree

9 files changed

+350
-51
lines changed

9 files changed

+350
-51
lines changed
 

‎include/ignition/gazebo/components/Model.hh

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ namespace serializers
7474
return _in;
7575
}
7676

77-
_model.Load(root.Element()->GetElement("model"));
77+
_model = *root.ModelByIndex(0);
7878
return _in;
7979
}
8080
};

‎include/ignition/gazebo/gui/GuiEvents.hh

+25
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,31 @@ namespace events
210210
/// \brief The path of SDF file to be previewed.
211211
std::string filePath;
212212
};
213+
214+
/// \brief Event called to enable/disable scale mode for the current
215+
/// selected model.
216+
class ScaleMode : public QEvent
217+
{
218+
/// \brief Constructor
219+
/// \param[in] _enabled Whether scale mode should be enabled or not.
220+
public: explicit ScaleMode(bool _enabled)
221+
: QEvent(kType), enabled(_enabled)
222+
{
223+
}
224+
225+
/// \brief Unique type for this event.
226+
static const QEvent::Type kType = QEvent::Type(QEvent::User + 6);
227+
228+
/// \brief Is scale mode enabled?
229+
/// \return True when scale mode is enabled or false otherwise.
230+
public: bool Enabled() const
231+
{
232+
return this->enabled;
233+
}
234+
235+
/// \brief Is scale mode enabled?
236+
bool enabled;
237+
};
213238
} // namespace events
214239
}
215240
} // namespace gui

0 commit comments

Comments
 (0)