Skip to content

Commit

Permalink
Iteration
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Derbasov <[email protected]>
  • Loading branch information
ntfshard committed Jan 13, 2025
1 parent 8663bbb commit 8189f74
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 55 deletions.
66 changes: 12 additions & 54 deletions src/gui/plugins/transform_control/TransformControl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -471,15 +471,8 @@ void TransformControlPrivate::HandleTransform()
{
if (this->transformControl.Node())
{
try
{
this->transformControl.Node()->SetUserData(
"pause-update", static_cast<int>(0));
}
catch (std::bad_variant_access &)
{
// It's ok to get here
}
this->transformControl.Node()->SetUserData(
"pause-update", static_cast<int>(0));
}

if (this->transformControl.Active())
Expand Down Expand Up @@ -550,15 +543,8 @@ void TransformControlPrivate::HandleMouseEvents()
this->transformControl.Start();
if (this->transformControl.Node())
{
try
{
this->transformControl.Node()->SetUserData(
"pause-update", static_cast<int>(1));
}
catch (std::bad_variant_access &)
{
// It's ok to get here
}
this->transformControl.Node()->SetUserData(
"pause-update", static_cast<int>(1));
}
}
else
Expand All @@ -584,15 +570,8 @@ void TransformControlPrivate::HandleMouseEvents()
{
if (this->transformControl.Node())
{
try
{
this->transformControl.Node()->SetUserData(
"pause-update", static_cast<int>(0));
}
catch (std::bad_variant_access &)
{
// It's ok to get here
}
this->transformControl.Node()->SetUserData(
"pause-update", static_cast<int>(0));
}
if (!_result)
gzerr << "Error setting pose" << std::endl;
Expand Down Expand Up @@ -673,28 +652,14 @@ void TransformControlPrivate::HandleMouseEvents()
if (topClickedNode == topClickedVisual)
{
this->transformControl.Attach(topClickedVisual);
try
{
topClickedVisual->SetUserData(
"pause-update", static_cast<int>(1));
}
catch (std::bad_variant_access &)
{
// It's ok to get here
}
topClickedVisual->SetUserData(
"pause-update", static_cast<int>(1));
}
else
{
this->transformControl.Detach();
try
{
topClickedVisual->SetUserData(
"pause-update", static_cast<int>(0));
}
catch (std::bad_variant_access &)
{
// It's ok to get here
}
topClickedVisual->SetUserData(
"pause-update", static_cast<int>(0));
}
}

Expand All @@ -708,15 +673,8 @@ void TransformControlPrivate::HandleMouseEvents()
&& this->transformControl.Active())
{
if (this->transformControl.Node()){
try
{
this->transformControl.Node()->SetUserData(
"pause-update", static_cast<int>(1));
}
catch (std::bad_variant_access &)
{
// It's ok to get here
}
this->transformControl.Node()->SetUserData(
"pause-update", static_cast<int>(1));
}

this->blockOrbit = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
using namespace gz;
using namespace gz::sim;

/// Sensor prefix to be used. All enviornment_sensors are to be prefixed by
/// Sensor prefix to be used. All environment_sensors are to be prefixed by
/// "environment_sensor/" in their gz:type field.
constexpr char SENSOR_TYPE_PREFIX[] = "environmental_sensor/";

Expand Down

0 comments on commit 8189f74

Please sign in to comment.