OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
clone.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_COMPONENTS_SCENEUTIL_CLONE_H
2 #define OPENMW_COMPONENTS_SCENEUTIL_CLONE_H
3 
4 #include <map>
5 
6 #include <osg/CopyOp>
7 
8 namespace osgParticle
9 {
10  class ParticleProcessor;
11  class ParticleSystem;
12  class ParticleSystemUpdater;
13 }
14 
15 namespace SceneUtil
16 {
17 
23  class CopyOp : public osg::CopyOp
24  {
25  public:
26  CopyOp();
27 
28  virtual osgParticle::ParticleSystem* operator() (const osgParticle::ParticleSystem* partsys) const;
29  virtual osgParticle::ParticleProcessor* operator() (const osgParticle::ParticleProcessor* processor) const;
30 
31  virtual osg::Node* operator() (const osg::Node* node) const;
32  virtual osg::Drawable* operator() (const osg::Drawable* drawable) const;
33 
34  virtual osg::StateSet* operator() (const osg::StateSet* stateset) const;
35 
36  private:
37  // maps new ParticleProcessor to their old ParticleSystem pointer
38  // a little messy, but I think this should be the most efficient way
39  mutable std::map<osgParticle::ParticleProcessor*, const osgParticle::ParticleSystem*> mMap;
40  mutable std::map<osgParticle::ParticleSystemUpdater*, const osgParticle::ParticleSystem*> mMap2;
41  };
42 
43 }
44 
45 #endif
std::map< osgParticle::ParticleSystemUpdater *, const osgParticle::ParticleSystem * > mMap2
Definition: clone.hpp:40
Definition: clone.hpp:23
CopyOp()
Definition: clone.cpp:18
virtual osgParticle::ParticleSystem * operator()(const osgParticle::ParticleSystem *partsys) const
Definition: clone.cpp:102
std::map< osgParticle::ParticleProcessor *, const osgParticle::ParticleSystem * > mMap
Definition: clone.hpp:39