##

DynamicLines.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_DYNAMICLINES_HH
#define GAZEBO_RENDERING_DYNAMICLINES_HH
#include <memory>
#include <vector>
#include <string>
#include <ignition/math/Color.hh>
#include "gazebo/common/CommonIface.hh"
#include "gazebo/rendering/Conversions.hh"
#include "gazebo/rendering/DynamicRenderable.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace rendering
{
class DynamicLinesPrivate;
class GZ_RENDERING_VISIBLE DynamicLines : public DynamicRenderable
{
public: explicit DynamicLines(
RenderOpType _opType = RENDERING_LINE_STRIP);
public: virtual ~DynamicLines();
public: static std::string GetMovableType();
public: virtual const Ogre::String &getMovableType() const;
public: void AddPoint(const ignition::math::Vector3d &_pt,
const common::Color &_color) GAZEBO_DEPRECATED(9.0);
public: void AddPoint(const ignition::math::Vector3d &_pt,
const ignition::math::Color &_color = ignition::math::Color::White);
public: void AddPoint(double _x, double _y, double _z,
const common::Color &_color) GAZEBO_DEPRECATED(9.0);
public: void AddPoint(const double _x, const double _y, const double _z,
const ignition::math::Color &_color = ignition::math::Color::White);
public: void SetPoint(const unsigned int _index,
const ignition::math::Vector3d &_value);
public: void SetColor(unsigned int _index, const common::Color &_color)
GAZEBO_DEPRECATED(9.0);
public: void SetColor(const unsigned int _index,
const ignition::math::Color &_color);
public: ignition::math::Vector3d Point(const unsigned int _index) const;
public: unsigned int GetPointCount() const;
public: void Clear();
public: void Update();
private: virtual void CreateVertexDeclaration();
private: virtual void FillHardwareBuffers();
private: std::vector<ignition::math::Vector3d> points;
private: bool dirty;
private: std::unique_ptr<DynamicLinesPrivate> dataPtr;
};
}
}
#endif
DynamicRenderable.hh
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::rendering::DynamicLines::SetPoint
void SetPoint(const unsigned int _index, const ignition::math::Vector3d &_value)
Change the location of an existing point in the point list.
gazebo::rendering::DynamicRenderable
Abstract base class providing mechanisms for dynamically growing hardware buffers.
Definition: DynamicRenderable.hh:35
system.hh
gazebo::rendering::DynamicLines
Class for drawing lines that can change.
Definition: DynamicLines.hh:42
gazebo::rendering::DynamicLines::DynamicLines
DynamicLines(RenderOpType _opType=RENDERING_LINE_STRIP)
Constructor.
gazebo::rendering::RENDERING_LINE_STRIP
A strip of connected lines, 1 vertex per line plus 1 start vertex.
Definition: RenderTypes.hh:226
Conversions.hh
gazebo::rendering::RenderOpType
RenderOpType
Type of render operation for a drawable.
Definition: RenderTypes.hh:216
gazebo::rendering::DynamicLines::~DynamicLines
virtual ~DynamicLines()
Destructor.
gazebo::rendering::DynamicLines::Clear
void Clear()
Remove all points from the point list.
rendering
rendering
Definition: RenderEngine.hh:31
gazebo::rendering::DynamicLines::GetPointCount
unsigned int GetPointCount() const
Return the total number of points in the point list.
gazebo::rendering::DynamicLines::Update
void Update()
Call this to update the hardware buffer after making changes.
gazebo::rendering::DynamicLines::SetColor
void SetColor(unsigned int _index, const common::Color &_color) GAZEBO_DEPRECATED(9.0)
Change the color of an existing point in the point list.
gazebo::rendering::DynamicLines::getMovableType
virtual const Ogre::String & getMovableType() const
Overridden function from Ogre's base class.
gazebo::rendering::DynamicLines::Point
ignition::math::Vector3d Point(const unsigned int _index) const
Return the location of an existing point in the point list.
gazebo::common::Color
Defines a color.
Definition: Color.hh:36
gazebo::rendering::DynamicLines::AddPoint
void AddPoint(const ignition::math::Vector3d &_pt, const common::Color &_color) GAZEBO_DEPRECATED(9.0)
Add a point to the point list.
CommonIface.hh
GAZEBO_DEPRECATED
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:328
gazebo::rendering::DynamicLines::GetMovableType
static std::string GetMovableType()
Get type of movable.