| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /********************************************************************** 00002 VRS - The Virtual Rendering System 00003 Copyright (C) 2001 Computer Graphics Systems Group at the 00004 Hasso-Plattner-Institute, Potsdam, Germany. 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 This library is distributed in the hope that it will be useful, but 00010 WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 See the GNU Lesser General Public License for more details. 00013 You should have received a copy of the GNU Lesser+ General Public 00014 License along with this library; if not, write to the FreeSoftware 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA, 02111-1307, USA. 00016 **********************************************************************/ 00017 // $Id: technique.h 4633 2005-01-03 01:43:11Z klimetschek $ 00018 // $Date: 2005-01-03 02:43:11 +0100 (Mon, 03 Jan 2005) $ 00019 // $Revision: 4633 $ 00020 // $State$ 00021 // $Author: klimetschek $ 00022 // 00023 // $Log$ 00024 // Revision 1.33 2005/01/03 01:43:08 klimetschek 00025 // - modified win32 project layout, splitted vrs.vcproj into vrs_container, vrs_core, vrs_sg, vrs_image, vrs_opengl and vrs_io 00026 // - removed vrs.vcproj 00027 // minor things: 00028 // - added all glutexamples to vrs4glut.sln 00029 // - fixed some problems in glutexamples 00030 // - removed all project references from all VS projects (using solution wide project dependencies instead) 00031 // 00032 // Revision 1.32 2004/11/05 13:58:09 basch 00033 // Class comment changed (Doxygen style) 00034 // 00035 // Revision 1.31 2004/07/09 13:26:10 kirsch 00036 // made getPass() const 00037 // 00038 // Revision 1.30 2004/06/17 14:33:09 kirsch 00039 // cleanup: made pass_ and passArray_ private; added trivial accesor methods for them 00040 // 00041 // Revision 1.29 2004/03/12 16:28:39 baumann 00042 // macros VRS_NAMESPACE_BEGIN/_END expanded and removed 00043 // 00044 // Revision 1.28 2004/01/19 11:43:57 baumann 00045 // serialization mechanism improved 00046 // 00047 // Revision 1.27 2004/01/19 07:28:03 baumann 00048 // serialization mechanism improved 00049 // 00050 // Revision 1.26 2003/11/30 14:40:57 kirsch 00051 // reduced include dependencies 00052 // 00053 // Revision 1.25 2003/11/29 11:29:23 kirsch 00054 // - added support for local poly attributes 00055 // - removed PolyAttribute::switchDefault() and Attribute::rememberTransform() 00056 // - renamed Engine::SwType: On/Off/All to Engine::SwitchType: ON/OFF/ALL 00057 // - changed class hierarchy of TechniqueProcessor and Technique 00058 // - GLCanvas::prepareRedisplay() / finishRedisplay() now push / pop standard attributes 00059 // 00060 // Revision 1.24 2003/11/07 14:19:24 kirsch 00061 // removed leading underscore from include guards 00062 // 00063 // Revision 1.23 2003/07/23 17:04:49 baumann 00064 // code cleanup (especially untabified) 00065 // 00066 // Revision 1.22 2003/01/14 08:20:47 kirsch 00067 // made addPass() static 00068 // 00069 // Revision 1.21 2002/12/12 13:04:07 kirsch 00070 // Technique constructor does not get a number denoting the number of rendering 00071 // passes anymore, only an empty array of passes is created by default. 00072 // 00073 // Revision 1.20 2002/12/11 11:09:12 kirsch 00074 // made activatePass virtual 00075 // 00076 // Revision 1.19 2002/11/30 17:01:12 kirsch 00077 // cleaned up includes 00078 // 00079 // Revision 1.18 2002/11/29 09:54:49 kirsch 00080 // cleaned up includes 00081 // 00082 // Revision 1.17 2002/10/29 10:32:52 baumann 00083 // macros VRS_CLASSNAME_* and VRS_IMPL_TYPEINFO_* removed 00084 // 00085 // Revision 1.16 2002/04/12 12:28:14 kirsch 00086 // removed numberOfPasses_ 00087 // 00088 // Revision 1.15 2002/03/03 21:44:25 kosta 00089 // VRS_TYPEINFO-macro rewritten 00090 // 00091 // Revision 1.14 2002/02/19 10:34:13 kosta 00092 // undone all changes since 2002-02-15 00093 // 00094 // Revision 1.11 2002/01/25 16:42:06 kirsch 00095 // added canBeUsed() for techniques, and properly react in some OpenGL 00096 // techniques when needed extensions are missing 00097 // 00098 // Revision 1.10 2002/01/15 16:25:54 kosta 00099 // macros rewritten for a better namespace support 00100 // 00101 // Revision 1.9 2001/11/13 16:36:31 kirsch 00102 // changed line feed to unix style (removed control-M) 00103 // 00104 // Revision 1.8 2001/09/13 11:11:36 kirsch 00105 // made usesPass() virtual 00106 // 00107 // Revision 1.7 2001/09/05 10:56:11 kirsch 00108 // Documentation updates 00109 // 00110 // Revision 1.6 2001/09/04 15:17:25 kirsch 00111 // documentation updates, code cleanup 00112 // 00113 // Revision 1.5 2001/08/31 15:45:10 kirsch 00114 // changed List to Array for faster access 00115 // Post/Pretraversal is computed simplier 00116 // 00117 // Revision 1.4 2001/08/20 13:47:37 kirsch 00118 // Stencilbuffer was cleared unnecessarily in TechniqueGL 00119 // 00120 // Revision 1.3 2001/08/01 12:36:51 kirsch 00121 // removed REMOVECAMERA pass, now using posttraversal. This way, 00122 // a problem with the trackball is fixed 00123 // 00124 // Revision 1.2 2001/07/26 15:23:22 kirsch 00125 // enhanced engine to support rendering techniques 00126 // 00127 // Revision 1.1.2.3 2001/06/26 20:24:38 kirsch 00128 // Added camera-attribute, painter and technique 00129 // 00130 // Revision 1.1.2.2 2001/06/20 17:34:01 kirsch 00131 // Switches and TransformTable in Engine totally rewritten, 00132 // posttraversal added. SceneConfiguration nodes are now 00133 // properly installed. 00134 // 00135 // Revision 1.1.2.1 2001/06/14 10:23:40 kirsch 00136 // techniques and techniqueprocessor, initial revision 00137 // 00138 00139 #ifndef VRS_TECHNIQUE_H 00140 #define VRS_TECHNIQUE_H 00141 00142 #include <vrs/renderobj.h> 00143 00144 namespace VRS { 00145 00146 class Engine; 00147 class Shape; 00148 template<typename T> class NonPersistentArray; 00149 00151 class VRS_CORE_API Technique : public RenderObj { 00152 00153 public: 00154 Technique(); 00156 00176 virtual void start(Engine*); 00182 virtual void stop(Engine*); 00186 virtual void activatePass(int pass); 00189 virtual bool preparePass(Engine*) = 0; 00196 virtual void finishPass(Engine*) = 0; 00199 virtual void nextPass(Engine*); 00204 virtual bool usesPass(int pass) const; 00208 virtual bool prepareEval(Engine* engine, const Shape* shape) = 0; 00216 virtual void finishEval(Engine* engine, const Shape* shape) = 0; 00221 virtual ID target() const; 00227 virtual bool canBeUsed(Engine*) const; 00231 enum PassNumbers { 00232 PRE = 0, 00233 INITCAMERA = 1, 00234 MAIN = 100, 00235 POST = 1000 00236 }; 00237 VRS_SERIALIZABLE_CLASS_ENUM(PassNumbers); 00241 VRS_TYPEINFO(Technique, RenderObj); 00242 00243 protected: 00244 00245 void registerPass(int pass); 00250 int getPass() const; 00252 00253 static void addPass(Engine*, int pass); 00258 private: 00259 int pass_; 00261 SO<NonPersistentArray<int> > passArray_; 00263 }; 00264 00265 inline int Technique::getPass() const { 00266 return pass_; 00267 } 00268 00269 } // namespace VRS 00270 00271 #endif // VRS_TECHNIQUE_H