OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CopyOp.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2  *
3  * This library is open source and may be redistributed and/or modified under
4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5  * (at your option) any later version. The full license is in LICENSE file
6  * included with this distribution, and on the openscenegraph.org website.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * OpenSceneGraph Public License for more details.
12 */
13 
14 #ifndef OSG_COPYOP
15 #define OSG_COPYOP 1
16 
17 #include <osg/Export>
18 
19 namespace osg {
20 
21 class Referenced;
22 class Object;
23 class Image;
24 class Texture;
25 class StateSet;
26 class StateAttribute;
27 class StateAttributeCallback;
28 class Uniform;
29 class UniformCallback;
30 class Node;
31 class Drawable;
32 class Array;
33 class PrimitiveSet;
34 class Shape;
35 class Callback;
36 
37 
41 {
42 
43  public:
44 
45  enum Options
46  {
47  SHALLOW_COPY = 0,
48  DEEP_COPY_OBJECTS = 1<<0,
49  DEEP_COPY_NODES = 1<<1,
50  DEEP_COPY_DRAWABLES = 1<<2,
51  DEEP_COPY_STATESETS = 1<<3,
52  DEEP_COPY_STATEATTRIBUTES = 1<<4,
53  DEEP_COPY_TEXTURES = 1<<5,
54  DEEP_COPY_IMAGES = 1<<6,
55  DEEP_COPY_ARRAYS = 1<<7,
56  DEEP_COPY_PRIMITIVES = 1<<8,
57  DEEP_COPY_SHAPES = 1<<9,
58  DEEP_COPY_UNIFORMS = 1<<10,
59  DEEP_COPY_CALLBACKS = 1<<11,
60  DEEP_COPY_USERDATA = 1<<12,
61  DEEP_COPY_ALL = 0x7FFFFFFF
62  };
63 
64  typedef unsigned int CopyFlags;
65 
66  inline CopyOp(CopyFlags flags=SHALLOW_COPY):_flags(flags) {}
67  virtual ~CopyOp() {}
68 
69  void setCopyFlags(CopyFlags flags) { _flags = flags; }
70  CopyFlags getCopyFlags() const { return _flags; }
71 
72  virtual Referenced* operator() (const Referenced* ref) const;
73  virtual Object* operator() (const Object* obj) const;
74  virtual Node* operator() (const Node* node) const;
75  virtual Drawable* operator() (const Drawable* drawable) const;
76  virtual StateSet* operator() (const StateSet* stateset) const;
77  virtual StateAttribute* operator() (const StateAttribute* attr) const;
78  virtual Texture* operator() (const Texture* text) const;
79  virtual Image* operator() (const Image* image) const;
80  virtual Array* operator() (const Array* array) const;
81  virtual PrimitiveSet* operator() (const PrimitiveSet* primitives) const;
82  virtual Shape* operator() (const Shape* shape) const;
83  virtual Uniform* operator() (const Uniform* shape) const;
84  virtual Callback* operator() (const Callback* nodecallback) const;
85  virtual StateAttributeCallback* operator() (const StateAttributeCallback* stateattributecallback) const;
86  virtual UniformCallback* operator() (const UniformCallback* uniformcallback) const;
87 
88  protected:
89 
90  CopyFlags _flags;
91 };
92 
93 }
94 
95 #endif
#define OSG_EXPORT
Definition: Export.h:43
void setCopyFlags(CopyFlags flags)
Definition: CopyOp.h:69
CopyOp(CopyFlags flags=SHALLOW_COPY)
Definition: CopyOp.h:66
Definition: Node.h:71
Definition: AlphaFunc.h:19
CopyFlags getCopyFlags() const
Definition: CopyOp.h:70
unsigned int CopyFlags
Definition: CopyOp.h:64
virtual ~CopyOp()
Definition: CopyOp.h:67
CopyFlags _flags
Definition: CopyOp.h:90