38 #include <OgreVector3.h> 39 #include <OgreQuaternion.h> 40 #include <OgreSceneNode.h> 58 ROS_ASSERT(new_message->type == visualization_msgs::Marker::LINE_STRIP);
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, new_message->color.a);
75 if (new_message->points.empty())
83 bool has_per_point_color = new_message->colors.size() == new_message->points.size();
86 std::vector<geometry_msgs::Point>::const_iterator it = new_message->points.begin();
87 std::vector<geometry_msgs::Point>::const_iterator end = new_message->points.end();
88 for ( ; it != end; ++it, ++i )
90 const geometry_msgs::Point& p = *it;
92 Ogre::Vector3 v( p.x, p.y, p.z );
95 if (has_per_point_color)
97 const std_msgs::ColorRGBA& color = new_message->colors[i];
105 c.r = new_message->color.r;
106 c.g = new_message->color.g;
107 c.b = new_message->color.b;
108 c.a = new_message->color.a;
Ogre::SceneNode * scene_node_
bool transform(const MarkerConstPtr &message, Ogre::Vector3 &pos, Ogre::Quaternion &orient, Ogre::Vector3 &scale)
void addPoint(const Ogre::Vector3 &point)
virtual S_MaterialPtr getMaterials()
An object that displays a multi-segment line strip rendered as billboards.
virtual void onNewMessage(const MarkerConstPtr &old_message, const MarkerConstPtr &new_message)
Ogre::MaterialPtr getMaterial()
virtual void setPosition(const Ogre::Vector3 &position)
Ogre::SceneNode * getSceneNode()
Get the scene node associated with this object.
virtual void setColor(float r, float g, float b, float a)
Set the color of the object. Values are in the range [0, 1].
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_
DisplayContext * context_
void setMaxPointsPerLine(uint32_t max)
LineStripMarker(MarkerDisplay *owner, DisplayContext *context, Ogre::SceneNode *parent_node)
visualization_msgs::Marker::ConstPtr MarkerConstPtr
virtual Ogre::SceneManager * getSceneManager() const =0
Returns the Ogre::SceneManager used for the main RenderPanel.
virtual void setScale(const Ogre::Vector3 &scale)
Set the scale of the object. Always relative to the identity orientation of the object.
std::set< Ogre::MaterialPtr > S_MaterialPtr
virtual void setOrientation(const Ogre::Quaternion &orientation)
Displays "markers" sent in by other ROS nodes on the "visualization_marker" topic.
void setLineWidth(float width)