OpenCOVER
coInstanceRenderer.h
Go to the documentation of this file.
1/* This file is part of COVISE.
2
3 You can use it under the terms of the GNU Lesser General Public License
4 version 2.1 or later, see lgpl-2.1.txt.
5
6 * License: LGPL 2+ */
7
8#ifndef CO_INSTANCERENDERER_H
9#define CO_INSTANCERENDERER_H
10
24#include <util/common.h>
25#include <osg/Geode>
26namespace opencover
27{
28class PLUGIN_UTILEXPORT coInstanceObject
29{
30public:
31 coInstanceObject(std::string textureName, float width, float height);
33 void addInstances(osg::Vec3Array &positions);
34 osg::Geode *getGeode()
35 {
36 return geode.get();
37 };
38
39protected:
40 void createTwoQuadGeometry(float width, float height);
41 osg::ref_ptr<osg::Geode> geode;
42 osg::ref_ptr<osg::Geometry> geom;
44 std::string textureName;
45 float width, height;
46 osg::StateSet *stateSet;
47};
48class PLUGIN_UTILEXPORT coInstanceRenderer
49{
50public:
54
55 void addInstances(osg::Vec3Array &positions, int type);
56 int addObject(std::string textureName, float width, float height);
57
58protected:
60 std::vector<coInstanceObject *> objects;
61 osg::ref_ptr<osg::Group> instanceObjects;
62
63private:
64 static coInstanceRenderer *instance_;
65};
66}
67#endif
Definition: ARToolKit.h:33
Definition: coInstanceRenderer.h:29
osg::Geode * getGeode()
Definition: coInstanceRenderer.h:34
void addInstances(osg::Vec3Array &positions)
osg::StateSet * stateSet
Definition: coInstanceRenderer.h:46
osg::ref_ptr< osg::Geode > geode
Definition: coInstanceRenderer.h:41
float height
Definition: coInstanceRenderer.h:45
std::string textureName
Definition: coInstanceRenderer.h:44
void createTwoQuadGeometry(float width, float height)
int numInstances
Definition: coInstanceRenderer.h:43
coInstanceObject(std::string textureName, float width, float height)
osg::ref_ptr< osg::Geometry > geom
Definition: coInstanceRenderer.h:42
Definition: coInstanceRenderer.h:49
static coInstanceRenderer * instance()
osg::ref_ptr< osg::Group > instanceObjects
Definition: coInstanceRenderer.h:61
int addObject(std::string textureName, float width, float height)
int numObjects
Definition: coInstanceRenderer.h:59
void addInstances(osg::Vec3Array &positions, int type)
std::vector< coInstanceObject * > objects
Definition: coInstanceRenderer.h:60