billboard_line.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, Willow Garage, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Willow Garage, Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #ifndef OGRE_TOOLS_BILLBOARD_LINE_H
31 #define OGRE_TOOLS_BILLBOARD_LINE_H
32 
33 #include "object.h"
34 
35 #include <stdint.h>
36 
37 #include <vector>
38 #include <OgreVector3.h>
39 #include <OgreColourValue.h>
40 #include <OgreMaterial.h>
41 #include <OgreSharedPtr.h>
42 
43 namespace Ogre
44 {
45 class SceneManager;
46 class SceneNode;
47 class Quaternion;
48 class Any;
49 class BillboardChain;
50 }
51 
52 namespace rviz
53 {
54 
59 class BillboardLine : public Object
60 {
61 public:
67  BillboardLine( Ogre::SceneManager* manager, Ogre::SceneNode* parent_node = NULL );
68  virtual ~BillboardLine();
69 
70  void clear();
71  void newLine();
72  void addPoint(const Ogre::Vector3& point);
73  void addPoint(const Ogre::Vector3& point, const Ogre::ColourValue& color);
74 
75  void setLineWidth( float width );
76 
77  void setMaxPointsPerLine(uint32_t max);
78  void setNumLines(uint32_t num);
79 
80  // overrides from Object
81  virtual void setOrientation( const Ogre::Quaternion& orientation );
82  virtual void setPosition( const Ogre::Vector3& position );
83  virtual void setScale( const Ogre::Vector3& scale );
84  virtual void setColor( float r, float g, float b, float a );
85  virtual const Ogre::Vector3& getPosition();
86  virtual const Ogre::Quaternion& getOrientation();
87 
92  Ogre::SceneNode* getSceneNode() { return scene_node_; }
93 
97  void setUserData( const Ogre::Any& data ) {}
98 
99  Ogre::MaterialPtr getMaterial() { return material_; }
100 
101 private:
102  void setupChains();
103  Ogre::BillboardChain* createChain();
104 
105  Ogre::SceneNode* scene_node_;
106 
107  typedef std::vector<Ogre::BillboardChain*> V_Chain;
108  V_Chain chains_;
109  Ogre::MaterialPtr material_;
110 
111  Ogre::ColourValue color_;
112  float width_;
113 
114  uint32_t current_line_;
115 
116  // Ogre 1.4 doesn't have getNumChainElements()
117  typedef std::vector<uint32_t> V_uint32;
118  V_uint32 num_elements_;
119  uint32_t total_elements_;
120 
121  uint32_t num_lines_;
124 
125  uint32_t current_chain_;
127 };
128 
129 } // namespace rviz
130 
131 #endif
132 
133 
#define NULL
Definition: global.h:37
Ogre::MaterialPtr material_
uint32_t elements_in_current_chain_
Ogre::ColourValue color_
An object that displays a multi-segment line strip rendered as billboards.
std::vector< uint32_t > V_uint32
Ogre::MaterialPtr getMaterial()
std::vector< Ogre::BillboardChain * > V_Chain
Ogre::SceneNode * getSceneNode()
Get the scene node associated with this object.
Base class for visible objects, providing a minimal generic interface.
Definition: object.h:49
void setUserData(const Ogre::Any &data)
We have no objects that we can set user data on.
uint32_t max_points_per_line_
r
Ogre::SceneNode * scene_node_


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Wed Aug 28 2019 04:01:50