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

Revision 10671, 3.1 kB (checked in by robert, 5 years ago)

From Cedric Pinson, "Here a patch to be able to clone stateattribute, in order to do that i
moved the StateAttribute::Callback structure to a file
StateAttributeCallback? with the same behavior as NodeCallback?.
"

  • 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;
[10671]27class StateAttributeCallback;
[4084]28class Uniform;
[329]29class Node;
30class Drawable;
[972]31class Array;
[1166]32class PrimitiveSet;
[1242]33class Shape;
[10362]34class NodeCallback;
[329]35
[10671]36
[3350]37/** Copy Op(erator) used to control whether shallow or deep copy is used
[329]38  * during copy construction and clone operation.*/
[4021]39class OSG_EXPORT CopyOp
[329]40{
41
42    public:
43   
44        enum Options
45        {
[4803]46            SHALLOW_COPY                = 0,
[8119]47            DEEP_COPY_OBJECTS           = 1<<0,
48            DEEP_COPY_NODES             = 1<<1,
49            DEEP_COPY_DRAWABLES         = 1<<2,
50            DEEP_COPY_STATESETS         = 1<<3,
51            DEEP_COPY_STATEATTRIBUTES   = 1<<4,
52            DEEP_COPY_TEXTURES          = 1<<5,
53            DEEP_COPY_IMAGES            = 1<<6,
54            DEEP_COPY_ARRAYS            = 1<<7,
55            DEEP_COPY_PRIMITIVES        = 1<<8,
56            DEEP_COPY_SHAPES            = 1<<9,
57            DEEP_COPY_UNIFORMS          = 1<<10,
[10671]58            DEEP_COPY_CALLBACKS         = 1<<11,
[9407]59            DEEP_COPY_ALL               = 0x7FFFFFFF
[329]60        };
61
62        typedef unsigned int CopyFlags;
63
64        inline CopyOp(CopyFlags flags=SHALLOW_COPY):_flags(flags) {}
65        virtual ~CopyOp() {}
66
67        virtual Referenced*     operator() (const Referenced* ref) const;
68        virtual Object*         operator() (const Object* obj) const;
69        virtual Node*           operator() (const Node* node) const;
70        virtual Drawable*       operator() (const Drawable* drawable) const;
71        virtual StateSet*       operator() (const StateSet* stateset) const;
72        virtual StateAttribute* operator() (const StateAttribute* attr) const;
[1099]73        virtual Texture*        operator() (const Texture* text) const;
[329]74        virtual Image*          operator() (const Image* image) const;
[1166]75        virtual Array*          operator() (const Array* array) const;
76        virtual PrimitiveSet*   operator() (const PrimitiveSet* primitives) const;
[4803]77        virtual Shape*          operator() (const Shape* shape) const;
78        virtual Uniform*        operator() (const Uniform* shape) const;
[10362]79        virtual NodeCallback*   operator() (const NodeCallback* nodecallback) const;
[10671]80        virtual StateAttributeCallback* operator() (const StateAttributeCallback* stateattributecallback) const;
[329]81
82    protected:
83   
84        CopyFlags _flags;
85};
86
[349]87}
[329]88
89#endif
Note: See TracBrowser for help on using the browser.