00001 /*---------------------------------------------------------------------------*\ 00002 * OpenSG * 00003 * * 00004 * * 00005 * Copyright (C) 2000-2002 by the OpenSG Forum * 00006 * * 00007 * www.opensg.org * 00008 * * 00009 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de * 00010 * * 00011 \*---------------------------------------------------------------------------*/ 00012 /*---------------------------------------------------------------------------*\ 00013 * License * 00014 * * 00015 * This library is free software; you can redistribute it and/or modify it * 00016 * under the terms of the GNU Library General Public License as published * 00017 * by the Free Software Foundation, version 2. * 00018 * * 00019 * This library is distributed in the hope that it will be useful, but * 00020 * WITHOUT ANY WARRANTY; without even the implied warranty of * 00021 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00022 * Library General Public License for more details. * 00023 * * 00024 * You should have received a copy of the GNU Library General Public * 00025 * License along with this library; if not, write to the Free Software * 00026 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 00027 * * 00028 \*---------------------------------------------------------------------------*/ 00029 /*---------------------------------------------------------------------------*\ 00030 * Changes * 00031 * * 00032 * * 00033 * * 00034 * * 00035 * * 00036 * * 00037 \*---------------------------------------------------------------------------*/ 00038 00039 #ifndef _OSGSLICES_H_ 00040 #define _OSGSLICES_H_ 00041 #ifdef __sgi 00042 #pragma once 00043 #endif 00044 00045 #include <OSGConfig.h> 00046 00047 #include <OSGSlicesBase.h> 00048 00049 #include <OSGAction.h> 00050 #include <OSGDrawActionBase.h> 00051 00052 OSG_BEGIN_NAMESPACE 00053 00064 class OSG_SYSTEMLIB_DLLMAPPING Slices : public SlicesBase 00065 { 00066 private: 00067 00068 typedef SlicesBase Inherited; 00069 00070 /*========================== PUBLIC =================================*/ 00071 public: 00072 00073 /*---------------------------------------------------------------------*/ 00077 // draw the object 00078 virtual Action::ResultE drawPrimitives (DrawActionBase *action); 00079 Action::ResultE intersect (Action * action ); 00080 00083 /*---------------------------------------------------------------------*/ 00087 void adjustVolume( Volume & volume ); 00088 00090 /*---------------------------------------------------------------------*/ 00094 void setMaterial (const MaterialPtr &value); 00095 00097 /*---------------------------------------------------------------------*/ 00101 virtual void changed ( BitVector whichField, 00102 UInt32 from); 00103 00105 /*---------------------------------------------------------------------*/ 00109 virtual void dump( UInt32 uiIndent = 0, 00110 const BitVector bvFlags = 0) const; 00111 00113 /*========================= PROTECTED ===============================*/ 00114 protected: 00115 00116 // Variables should all be in SlicesBase. 00117 00118 /*---------------------------------------------------------------------*/ 00122 Slices(void); 00123 Slices(const Slices &source); 00124 00126 /*---------------------------------------------------------------------*/ 00130 virtual ~Slices(void); 00131 00134 /*========================== PRIVATE ================================*/ 00135 private: 00136 00137 friend class FieldContainer; 00138 friend class SlicesBase; 00139 00140 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV) 00141 00142 struct Edge { 00143 00144 // index in to corner points 00145 UInt32 pointIndexA; 00146 UInt32 pointIndexB; 00147 UInt32 edgeTag; 00148 00149 // pos+vec line def., it's redundant but there is 00150 // always a need for speed 00151 Line line; 00152 00153 }; 00154 00155 struct Slice { 00156 00158 bool ccw; 00159 00161 UInt32 numOfIntersection; 00162 00164 UInt32 edgeVec[6]; 00165 00167 Vec3f pointVec[6]; 00168 00169 }; 00170 00171 #endif // remove from all but dev docs 00172 00173 std::vector<Pnt3f> _pointVec; 00174 00175 std::vector<Edge> _edgeVec; 00176 00177 static UInt32 _arbMultitexture; 00178 static UInt32 _funcMultiTexCoord3fARB; 00179 00180 void initEdgeVec ( void ); 00181 00182 unsigned createSlice ( const OSG::Plane &plane, Slice &result ); 00183 00184 void drawSlices (Window *win, const Vec3f &planeNormal, 00185 UInt32 & triCount, UInt32 & vertexCount); 00186 00187 static void initMethod(void); 00188 00189 // prohibit default functions (move to 'public' if you need one) 00190 00191 void operator =(const Slices &source); 00192 }; 00193 00194 typedef Slices *SlicesP; 00195 00196 OSG_END_NAMESPACE 00197 00198 #include <OSGSlicesBase.inl> 00199 #include <OSGSlices.inl> 00200 00201 #define OSGSLICES_HEADER_CVSID "@(#)$Id: FCTemplate_h.h,v 1.14 2002/03/25 01:26:00 vossg Exp $" 00202 00203 #endif /* _OSGSLICES_H_ */
1.4.3