##

SelectionObj.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_RENDERING_SELECTIONOBJ_HH_
#define GAZEBO_RENDERING_SELECTIONOBJ_HH_
#include <string>
#include "gazebo/rendering/RenderTypes.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace rendering
{
class GZ_RENDERING_VISIBLE SelectionObj : public Visual
{
public: enum SelectionMode
{
SELECTION_NONE = 0,
TRANS,
ROT,
SCALE,
TRANS_X,
TRANS_Y,
TRANS_Z,
ROT_X,
ROT_Y,
ROT_Z,
SCALE_X,
SCALE_Y,
SCALE_Z
};
public: SelectionObj(const std::string &_name, VisualPtr _vis);
public: virtual ~SelectionObj();
public: void Load();
public: void Attach(rendering::VisualPtr _vis);
public: void Detach();
public: void SetMode(const std::string &_mode);
public: void SetMode(SelectionMode _mode);
public: void SetState(const std::string &_state);
public: void SetState(SelectionMode _state);
public: SelectionMode GetState();
public: SelectionMode GetMode();
public: void SetGlobal(bool _global);
public: void UpdateSize();
public: void SetHandleVisible(SelectionMode _mode, bool _visible);
public: bool GetHandleVisible(SelectionMode _mode) const;
public: void SetHandleMaterial(SelectionMode _mode, const std::string
&_material, bool _unique = true);
private: void CreateScaleVisual();
private: void CreateRotateVisual();
private: void CreateTranslateVisual();
};
}
}
#endif
gazebo::rendering::SelectionObj::SELECTION_NONE
Translation in x.
Definition: SelectionObj.hh:41
gazebo::rendering::SelectionObj::SCALE_Z
Scale in z.
Definition: SelectionObj.hh:65
gazebo::rendering::SelectionObj::SetHandleVisible
void SetHandleVisible(SelectionMode _mode, bool _visible)
Set the visibility for a specific handle or handle group.
gazebo::rendering::SelectionObj::TRANS_Y
Translation in y.
Definition: SelectionObj.hh:51
gazebo::rendering::SelectionObj::ROT_Z
Rotation in z.
Definition: SelectionObj.hh:59
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::rendering::SelectionObj::SCALE_Y
Scale in y.
Definition: SelectionObj.hh:63
gazebo::rendering::SelectionObj::SelectionObj
SelectionObj(const std::string &_name, VisualPtr _vis)
Constructor.
system.hh
gazebo::rendering::SelectionObj::SCALE
Scale mode.
Definition: SelectionObj.hh:47
gazebo::rendering::SelectionObj::ROT_X
Rotation in x.
Definition: SelectionObj.hh:55
gazebo::rendering::SelectionObj::Load
void Load()
Load.
gazebo::rendering::SelectionObj::Detach
void Detach()
Detach the selection object from the current visual.
gazebo::rendering::SelectionObj::SCALE_X
Scale in x.
Definition: SelectionObj.hh:61
RenderTypes.hh
gazebo::rendering::SelectionObj::SetState
void SetState(const std::string &_state)
Set state by highlighting the corresponding selection object visual.
rendering
rendering
Definition: RenderEngine.hh:31
gazebo::rendering::SelectionObj::GetMode
SelectionMode GetMode()
Get the current selection mode.
gazebo::rendering::Visual
A renderable object.
Definition: Visual.hh:60
gazebo::rendering::SelectionObj::~SelectionObj
virtual ~SelectionObj()
Deconstructor.
gazebo::rendering::SelectionObj::SetHandleMaterial
void SetHandleMaterial(SelectionMode _mode, const std::string &_material, bool _unique=true)
Set the material for a specific handle or handle group.
gazebo::rendering::SelectionObj::TRANS_Z
Translation in z.
Definition: SelectionObj.hh:53
gazebo::rendering::SelectionObj::GetState
SelectionMode GetState()
Get the current selection state.
gazebo::rendering::SelectionObj::ROT
Rotation mode.
Definition: SelectionObj.hh:45
gazebo::rendering::SelectionObj::GetHandleVisible
bool GetHandleVisible(SelectionMode _mode) const
Get the visibility for a specific handle.
gazebo::rendering::SelectionObj::SelectionMode
SelectionMode
Definition: SelectionObj.hh:38
gazebo::rendering::SelectionObj::SetMode
void SetMode(const std::string &_mode)
Set the manipulation mode.
gazebo::rendering::SelectionObj::SetGlobal
void SetGlobal(bool _global)
Set selection object to ignore local transforms.
gazebo::rendering::SelectionObj::Attach
void Attach(rendering::VisualPtr _vis)
Attach the selection object to the given visual.
gazebo::rendering::VisualPtr
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:114
gazebo::rendering::SelectionObj::ROT_Y
Rotation in y.
Definition: SelectionObj.hh:57
gazebo::rendering::SelectionObj::TRANS
Translation mode.
Definition: SelectionObj.hh:43
gazebo::rendering::SelectionObj::TRANS_X
Translation in x.
Definition: SelectionObj.hh:49
gazebo::rendering::SelectionObj::UpdateSize
void UpdateSize()
Update selection object size to match the parent visual.
gazebo::rendering::SelectionObj
Interactive selection object for models and links.
Definition: SelectionObj.hh:34