2002-07-17 04:07:32 +08:00
|
|
|
//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield
|
2002-01-29 20:52:04 +08:00
|
|
|
//Distributed under the terms of the GNU Library General Public License (LGPL)
|
|
|
|
//as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
#ifndef OSG_COPYOP
|
|
|
|
#define OSG_COPYOP 1
|
|
|
|
|
2002-01-30 04:25:45 +08:00
|
|
|
#include <osg/Export>
|
|
|
|
|
2002-01-29 20:52:04 +08:00
|
|
|
namespace osg {
|
|
|
|
|
|
|
|
class Referenced;
|
|
|
|
class Object;
|
|
|
|
class Image;
|
2002-08-25 03:39:39 +08:00
|
|
|
//class Texture;
|
2002-08-28 23:28:11 +08:00
|
|
|
class Texture;
|
2002-01-29 20:52:04 +08:00
|
|
|
class StateSet;
|
|
|
|
class StateAttribute;
|
|
|
|
class Node;
|
|
|
|
class Drawable;
|
2002-07-26 05:50:08 +08:00
|
|
|
class Array;
|
|
|
|
class Primitive;
|
2002-01-29 20:52:04 +08:00
|
|
|
|
|
|
|
/** Copy Op(erator) used to control the whether shallow or deep copy is used
|
|
|
|
* during copy construction and clone operation.*/
|
2002-01-30 04:25:45 +08:00
|
|
|
class SG_EXPORT CopyOp
|
2002-01-29 20:52:04 +08:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum Options
|
|
|
|
{
|
|
|
|
SHALLOW_COPY = 0,
|
|
|
|
DEEP_COPY_OBJECTS = 1,
|
|
|
|
DEEP_COPY_NODES = 2,
|
|
|
|
DEEP_COPY_DRAWABLES = 4,
|
|
|
|
DEEP_COPY_STATESETS = 8,
|
|
|
|
DEEP_COPY_STATEATTRIBUTES = 16,
|
|
|
|
DEEP_COPY_TEXTURES = 32,
|
|
|
|
DEEP_COPY_IMAGES = 64,
|
2002-07-26 05:50:08 +08:00
|
|
|
DEEP_COPY_ARRAYS = 128,
|
|
|
|
DEEP_COPY_PRIMITIVES = 256,
|
2002-01-29 20:52:04 +08:00
|
|
|
DEEP_COPY_ALL = 0xffffffff
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef unsigned int CopyFlags;
|
|
|
|
|
|
|
|
inline CopyOp(CopyFlags flags=SHALLOW_COPY):_flags(flags) {}
|
|
|
|
virtual ~CopyOp() {}
|
|
|
|
|
|
|
|
virtual Referenced* operator() (const Referenced* ref) const;
|
|
|
|
virtual Object* operator() (const Object* obj) const;
|
|
|
|
virtual Node* operator() (const Node* node) const;
|
|
|
|
virtual Drawable* operator() (const Drawable* drawable) const;
|
|
|
|
virtual StateSet* operator() (const StateSet* stateset) const;
|
|
|
|
virtual StateAttribute* operator() (const StateAttribute* attr) const;
|
2002-08-28 23:28:11 +08:00
|
|
|
virtual Texture* operator() (const Texture* text) const;
|
2002-01-29 20:52:04 +08:00
|
|
|
virtual Image* operator() (const Image* image) const;
|
2002-07-26 05:50:08 +08:00
|
|
|
virtual Array* operator() (const Array* image) const;
|
|
|
|
virtual Primitive* operator() (const Primitive* image) const;
|
2002-01-29 20:52:04 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
CopyFlags _flags;
|
|
|
|
};
|
|
|
|
|
2002-02-03 20:33:41 +08:00
|
|
|
}
|
2002-01-29 20:52:04 +08:00
|
|
|
|
|
|
|
#endif
|