fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / State / OpenGL / OSGLogicOpChunk.h
blob677a6b80d852955c0c24e63b26898c5f6db50d5e
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2006 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
18 * *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGLOGICOPCHUNK_H_
40 #define _OSGLOGICOPCHUNK_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGLogicOpChunkBase.h"
47 OSG_BEGIN_NAMESPACE
49 /*! \brief LogicOpChunk class. See \ref
50 PageStateLogicOpChunk for a description.
51 \ingroup GrpStateOpenGLObj
52 \ingroup GrpLibOSGState
53 \includebasedoc
56 class OSG_STATE_DLLMAPPING LogicOpChunk : public LogicOpChunkBase
58 /*========================== PUBLIC =================================*/
59 public:
61 typedef LogicOpChunkBase Inherited;
62 typedef LogicOpChunk Self;
64 /*---------------------------------------------------------------------*/
65 /*! \name Chunk Class Access */
66 /*! \{ */
68 virtual const StateChunkClass *getClass(void) const;
70 /*! \} */
71 /*---------------------------------------------------------------------*/
72 /*! \name Static Chunk Class Access */
73 /*! \{ */
75 static UInt32 getStaticClassId(void);
76 static const StateChunkClass * getStaticClass (void);
78 /*! \} */
79 /*---------------------------------------------------------------------*/
80 /*! \name Sync */
81 /*! \{ */
83 virtual void changed(ConstFieldMaskArg whichField,
84 UInt32 origin,
85 BitVector details );
87 /*! \} */
88 /*---------------------------------------------------------------------*/
89 /*! \name Output */
90 /*! \{ */
92 virtual void dump( UInt32 uiIndent = 0,
93 const BitVector bvFlags = 0) const;
95 /*! \} */
96 /*---------------------------------------------------------------------*/
97 /*! \name State Commands */
98 /*! \{ */
100 virtual void activate (DrawEnv *action,
101 UInt32 index = 0);
103 virtual void changeFrom(DrawEnv *action,
104 StateChunk *old,
105 UInt32 index = 0);
107 virtual void deactivate(DrawEnv *action,
108 UInt32 index = 0);
110 /*! \} */
111 /*---------------------------------------------------------------------*/
112 /*! \name Comparison */
113 /*! \{ */
115 virtual Real32 switchCost(StateChunk *chunk);
117 virtual bool operator < (const StateChunk &other) const;
119 virtual bool operator == (const StateChunk &other) const;
120 virtual bool operator != (const StateChunk &other) const;
122 /*========================= PROTECTED ===============================*/
123 protected:
125 // Variables should all be in LogicOpChunkBase.
127 /*---------------------------------------------------------------------*/
128 /*! \name Constructors */
129 /*! \{ */
131 LogicOpChunk(void);
132 LogicOpChunk(const LogicOpChunk &source);
134 /*! \} */
135 /*---------------------------------------------------------------------*/
136 /*! \name Destructors */
137 /*! \{ */
139 virtual ~LogicOpChunk(void);
141 /*! \} */
142 /*---------------------------------------------------------------------*/
143 /*! \name Init */
144 /*! \{ */
146 static void initMethod(InitPhase ePhase);
148 /*! \} */
149 /*========================== PRIVATE ================================*/
151 private:
153 friend class FieldContainer;
154 friend class LogicOpChunkBase;
156 // class. Used for indexing in State
157 static StateChunkClass _class;
159 // prohibit default functions (move to 'public' if you need one)
160 void operator =(const LogicOpChunk &source);
163 typedef LogicOpChunk *LogicOpChunkP;
165 OSG_END_NAMESPACE
167 #include "OSGLogicOpChunkBase.inl"
168 #include "OSGLogicOpChunk.inl"
170 #endif /* _OSGLOGICOPCHUNK_H_ */