37 #include <OgreVector3.h> 38 #include <OgreQuaternion.h> 39 #include <OgreSceneNode.h> 45 Ogre::SceneNode* parent_node)
46 :
MarkerBase(owner, context, parent_node), lines_(nullptr)
58 ROS_ASSERT(new_message->type == visualization_msgs::Marker::LINE_LIST);
65 Ogre::Vector3 pos, scale;
66 Ogre::Quaternion orient;
67 transform(new_message, pos, orient, scale);
72 lines_->
setColor(new_message->color.r, new_message->color.g, new_message->color.b,
73 new_message->color.a);
77 if (new_message->points.empty())
82 bool has_per_point_color = new_message->colors.size() == new_message->points.size();
84 if (new_message->points.size() % 2 == 0)
91 std::vector<geometry_msgs::Point>::const_iterator it = new_message->points.begin();
92 std::vector<geometry_msgs::Point>::const_iterator end = new_message->points.end();
95 if (it != new_message->points.begin())
100 for (uint32_t j = 0; j < 2; ++j, ++it, ++i)
102 const geometry_msgs::Point& p = *it;
105 if (has_per_point_color)
107 const std_msgs::ColorRGBA& color = new_message->colors[i];
115 c.r = new_message->color.r;
116 c.g = new_message->color.g;
117 c.b = new_message->color.b;
118 c.a = new_message->color.a;
121 Ogre::Vector3 v(p.x, p.y, p.z);
Ogre::SceneNode * scene_node_
bool transform(const MarkerConstPtr &message, Ogre::Vector3 &pos, Ogre::Quaternion &orient, Ogre::Vector3 &scale)
void addPoint(const Ogre::Vector3 &point)
An object that displays a multi-segment line strip rendered as billboards.
LineListMarker(MarkerDisplay *owner, DisplayContext *context, Ogre::SceneNode *parent_node)
Ogre::MaterialPtr getMaterial()
virtual void setPosition(const Ogre::Vector3 &position)
Ogre::SceneNode * getSceneNode()
Get the scene node associated with this object.
std::pair< std::string, int32_t > MarkerID
Pure-virtual base class for objects which give Display subclasses context in which to work...
boost::shared_ptr< MarkerSelectionHandler > handler_
S_MaterialPtr getMaterials() override
DisplayContext * context_
void onNewMessage(const MarkerConstPtr &old_message, const MarkerConstPtr &new_message) override
void setColor(float r, float g, float b, float a) override
Set the color of the object. Values are in the range [0, 1].
void setNumLines(uint32_t num)
void setMaxPointsPerLine(uint32_t max)
~LineListMarker() override
visualization_msgs::Marker::ConstPtr MarkerConstPtr
virtual Ogre::SceneManager * getSceneManager() const =0
Returns the Ogre::SceneManager used for the main RenderPanel.
std::set< Ogre::MaterialPtr > S_MaterialPtr
virtual void setOrientation(const Ogre::Quaternion &orientation)
void setScale(const Ogre::Vector3 &scale) override
Set the scale of the object. Always relative to the identity orientation of the object.
Displays "markers" sent in by other ROS nodes on the "visualization_marker" topic.
void setLineWidth(float width)