root/OpenSceneGraph/trunk/include/osg/CopyOp @ 9407

Revision 9407, 2.8 kB (checked in by robert, 6 years ago)

Fixed warning

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
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
19namespace osg {
20
21class Referenced;
22class Object;
23class Image;
24class Texture;
25class StateSet;
26class StateAttribute;
27class Uniform;
28class Node;
29class Drawable;
30class Array;
31class PrimitiveSet;
32class Shape;
33
34/** Copy Op(erator) used to control whether shallow or deep copy is used
35  * during copy construction and clone operation.*/
36class OSG_EXPORT CopyOp
37{
38
39    public:
40   
41        enum Options
42        {
43            SHALLOW_COPY                = 0,
44            DEEP_COPY_OBJECTS           = 1<<0,
45            DEEP_COPY_NODES             = 1<<1,
46            DEEP_COPY_DRAWABLES         = 1<<2,
47            DEEP_COPY_STATESETS         = 1<<3,
48            DEEP_COPY_STATEATTRIBUTES   = 1<<4,
49            DEEP_COPY_TEXTURES          = 1<<5,
50            DEEP_COPY_IMAGES            = 1<<6,
51            DEEP_COPY_ARRAYS            = 1<<7,
52            DEEP_COPY_PRIMITIVES        = 1<<8,
53            DEEP_COPY_SHAPES            = 1<<9,
54            DEEP_COPY_UNIFORMS          = 1<<10,
55            DEEP_COPY_ALL               = 0x7FFFFFFF
56        };
57
58        typedef unsigned int CopyFlags;
59
60        inline CopyOp(CopyFlags flags=SHALLOW_COPY):_flags(flags) {}
61        virtual ~CopyOp() {}
62
63        virtual Referenced*     operator() (const Referenced* ref) const;
64        virtual Object*         operator() (const Object* obj) const;
65        virtual Node*           operator() (const Node* node) const;
66        virtual Drawable*       operator() (const Drawable* drawable) const;
67        virtual StateSet*       operator() (const StateSet* stateset) const;
68        virtual StateAttribute* operator() (const StateAttribute* attr) const;
69        virtual Texture*        operator() (const Texture* text) const;
70        virtual Image*          operator() (const Image* image) const;
71        virtual Array*          operator() (const Array* array) const;
72        virtual PrimitiveSet*   operator() (const PrimitiveSet* primitives) const;
73        virtual Shape*          operator() (const Shape* shape) const;
74        virtual Uniform*        operator() (const Uniform* shape) const;
75
76    protected:
77   
78        CopyFlags _flags;
79};
80
81}
82
83#endif
Note: See TracBrowser for help on using the browser.