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

Revision 10362, 2.9 kB (checked in by robert, 6 years ago)

From Cedric Pinson and Robert Osfield, addition of NodeCallbacks? to osg::CopyOp? and osg::Node copy constructor.

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