00001 /*---------------------------------------------------------------------------*\ 00002 00003 * OpenSG * 00004 00005 * * 00006 00007 * * 00008 00009 * Copyright (C) 2000-2002 by the OpenSG Forum * 00010 00011 * * 00012 00013 * www.opensg.org * 00014 00015 * * 00016 00017 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de * 00018 00019 * * 00020 00021 \*---------------------------------------------------------------------------*/ 00022 00023 /*---------------------------------------------------------------------------*\ 00024 00025 * License * 00026 00027 * * 00028 00029 * This library is free software; you can redistribute it and/or modify it * 00030 00031 * under the terms of the GNU Library General Public License as published * 00032 00033 * by the Free Software Foundation, version 2. * 00034 00035 * * 00036 00037 * This library is distributed in the hope that it will be useful, but * 00038 00039 * WITHOUT ANY WARRANTY; without even the implied warranty of * 00040 00041 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00042 00043 * Library General Public License for more details. * 00044 00045 * * 00046 00047 * You should have received a copy of the GNU Library General Public * 00048 00049 * License along with this library; if not, write to the Free Software * 00050 00051 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 00052 00053 * * 00054 00055 \*---------------------------------------------------------------------------*/ 00056 00057 /*---------------------------------------------------------------------------*\ 00058 00059 * Changes * 00060 00061 * * 00062 00063 * * 00064 00065 * * 00066 00067 * * 00068 00069 * * 00070 00071 * * 00072 00073 \*---------------------------------------------------------------------------*/ 00074 00075 00076 00077 #ifndef _OSGINVERSETRANSFORM_H_ 00078 00079 #define _OSGINVERSETRANSFORM_H_ 00080 00081 #ifdef __sgi 00082 00083 #pragma once 00084 00085 #endif 00086 00087 00088 00089 #include <OSGConfig.h> 00090 00091 00092 00093 #include <OSGInverseTransformBase.h> 00094 00095 00096 00097 #include "OSGMatrix.h" 00098 00099 00100 00101 OSG_BEGIN_NAMESPACE 00102 00103 00104 00105 class DrawActionBase; 00106 00107 00108 00117 class OSG_SYSTEMLIB_DLLMAPPING InverseTransform : public InverseTransformBase 00118 00119 { 00120 00121 private: 00122 00123 00124 00125 typedef InverseTransformBase Inherited; 00126 00127 00128 00129 /*========================== PUBLIC =================================*/ 00130 00131 public: 00132 00133 00134 00135 /*---------------------------------------------------------------------*/ 00136 00143 virtual void changed(BitVector whichField, 00144 00145 UInt32 origin ); 00146 00147 00148 00151 /*---------------------------------------------------------------------*/ 00152 00159 void initMatrix(const Matrix &mToWorld); 00160 00161 00162 00163 void calcMatrix( DrawActionBase *pAction, 00164 00165 const Matrix &mToWorld, 00166 00167 Matrix &mResult); 00168 00169 00170 00173 /*---------------------------------------------------------------------*/ 00174 00181 virtual void dump( UInt32 uiIndent = 0, 00182 00183 const BitVector bvFlags = 0) const; 00184 00185 00186 00189 /*========================= PROTECTED ===============================*/ 00190 00191 protected: 00192 00193 00194 00195 // Variables should all be in InverseTransformBase. 00196 00197 00198 00199 /*---------------------------------------------------------------------*/ 00200 00207 InverseTransform(void); 00208 00209 InverseTransform(const InverseTransform &source); 00210 00211 00212 00215 /*---------------------------------------------------------------------*/ 00216 00223 virtual ~InverseTransform(void); 00224 00225 00226 00231 /*---------------------------------------------------------------------*/ 00232 00239 void adjustVolume (Volume & volume); 00240 00241 00242 00243 virtual void accumulateMatrix(Matrix &result); 00244 00245 00246 00249 /*---------------------------------------------------------------------*/ 00250 00257 Action::ResultE drawEnter (Action *action); 00258 00259 Action::ResultE drawLeave (Action *action); 00260 00261 00262 00263 Action::ResultE intersectEnter(Action *action); 00264 00265 Action::ResultE intersectLeave(Action *action); 00266 00267 00268 00269 Action::ResultE renderEnter (Action *action); 00270 00271 Action::ResultE renderLeave (Action *action); 00272 00273 00274 00279 /*========================== PRIVATE ================================*/ 00280 00281 private: 00282 00283 00284 00285 friend class FieldContainer; 00286 00287 friend class InverseTransformBase; 00288 00289 00290 00291 static void initMethod(void); 00292 00293 00294 00295 Matrix _invWorld; 00296 00297 00298 00299 // prohibit default functions (move to 'public' if you need one) 00300 00301 00302 00303 void operator =(const InverseTransform &source); 00304 00305 }; 00306 00307 00308 00309 typedef InverseTransform *InverseTransformP; 00310 00311 00312 00313 OSG_END_NAMESPACE 00314 00315 00316 00317 #include <OSGInverseTransformBase.inl> 00318 00319 #include <OSGInverseTransform.inl> 00320 00321 00322 00323 #define OSGINVERSETRANSFORM_HEADER_CVSID "@(#)$Id: OSGInverseTransform.h,v 1.2 2004/10/13 14:51:34 a-m-z Exp $" 00324 00325 00326 00327 #endif /* _OSGINVERSETRANSFORM_H_ */ 00328
1.5.5