mesh_shape.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_MESH_SHAPE_H
31 #define OGRE_TOOLS_MESH_SHAPE_H
32 
33 #include "shape.h"
34 
35 namespace Ogre
36 {
37 class ManualObject;
38 }
39 
40 namespace rviz
41 {
42 
69 class MeshShape : public Shape
70 {
71 public:
72 
79  MeshShape(Ogre::SceneManager* scene_manager, Ogre::SceneNode* parent_node = NULL);
80  virtual ~MeshShape();
81 
82  /* \brief Estimate the number of vertices ahead of time. */
83  void estimateVertexCount(size_t vcount);
84 
86  void beginTriangles();
87 
94  void addVertex(const Ogre::Vector3& position);
95 
102  void addVertex(const Ogre::Vector3& position, const Ogre::Vector3& normal);
103 
110  void addVertex(const Ogre::Vector3& position, const Ogre::Vector3& normal, const Ogre::ColourValue &color);
111 
113  void addNormal(const Ogre::Vector3 &normal);
114 
116  void addColor(const Ogre::ColourValue &color);
117 
119  void addTriangle(unsigned int p1, unsigned int p2, unsigned int p3);
120 
122  void endTriangles();
123 
125  void clear();
126 
128  Ogre::ManualObject* getManualObject()
129  {
130  return manual_object_;
131  }
132 
133 private:
134 
135  // true in between calls to beginTriangles() and endTriangles()
136  bool started_;
137  Ogre::ManualObject *manual_object_;
138 
139 };
140 
141 } // namespace rviz
142 
143 #endif
144 
#define NULL
Definition: global.h:37
Ogre::ManualObject * getManualObject()
Get the manual object created for the mesh.
Definition: mesh_shape.h:128
Ogre::ManualObject * manual_object_
Definition: mesh_shape.h:137
This class allows constructing Ogre shapes manually, from triangle lists.
Definition: mesh_shape.h:69


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Sat Apr 27 2019 02:33:41