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 00040 #ifndef _OSGTRIANGLEITERATOR_H_ 00041 #define _OSGTRIANGLEITERATOR_H_ 00042 #ifdef __sgi 00043 #pragma once 00044 #endif 00045 00046 #include <OSGBaseTypes.h> 00047 #include <OSGFieldContainerPtr.h> 00048 #include <OSGNodeCore.h> 00049 #include <OSGGeoProperty.h> 00050 #include <OSGPrimitiveIterator.h> 00051 00052 OSG_BEGIN_NAMESPACE 00053 00058 class OSG_SYSTEMLIB_DLLMAPPING TriangleIterator : public PrimitiveIterator 00059 { 00060 /*========================== PUBLIC =================================*/ 00061 public: 00062 00063 /*---------------------------------------------------------------------*/ 00067 static const char *getClassname(void) { return "TriangleIterator"; } 00068 00070 /*---------------------------------------------------------------------*/ 00074 TriangleIterator(void); 00075 TriangleIterator(const TriangleIterator &source); 00076 TriangleIterator(const GeometryPtr& geo); 00077 TriangleIterator(const NodePtr& geo); 00078 00080 /*---------------------------------------------------------------------*/ 00084 virtual ~TriangleIterator(void); 00085 00087 /*---------------------------------------------------------------------*/ 00091 inline Int32 getIndex (void ) const; 00092 00093 inline Int32 getPositionIndex (Int32 which) const; 00094 inline Pnt3f getPosition (Int32 which) const; 00095 00096 inline Int32 getNormalIndex (Int32 which) const; 00097 inline Vec3f getNormal (Int32 which) const; 00098 00099 inline Int32 getColorIndex (Int32 which) const; 00100 inline Color3f getColor (Int32 which) const; 00101 00102 inline Int32 getSecondaryColorIndex (Int32 which) const; 00103 inline Color3f getSecondaryColor (Int32 which) const; 00104 00105 inline Int32 getTexCoordsIndex (Int32 which) const; 00106 inline Vec2f getTexCoords (Int32 which) const; 00107 inline Int32 getTexCoordsIndex1 (Int32 which) const; 00108 inline Vec2f getTexCoords1 (Int32 which) const; 00109 inline Int32 getTexCoordsIndex2 (Int32 which) const; 00110 inline Vec2f getTexCoords2 (Int32 which) const; 00111 inline Int32 getTexCoordsIndex3 (Int32 which) const; 00112 inline Vec2f getTexCoords3 (Int32 which) const; 00113 00114 inline Int32 getIndexIndex (Int32 which) const; 00115 00116 00118 /*---------------------------------------------------------------------*/ 00122 void operator ++(void); 00123 void seek(Int32 index); 00124 00125 TriangleIterator & operator =(const TriangleIterator &source); 00126 bool operator < (const TriangleIterator &other) const; 00127 bool operator == (const TriangleIterator &other) const; 00128 bool operator != (const TriangleIterator &other) const; 00129 00131 /*========================= PROTECTED ===============================*/ 00132 protected: 00133 00134 typedef PrimitiveIterator Inherited; 00135 00136 /*---------------------------------------------------------------------*/ 00140 void setToBegin(void); 00141 void setToEnd(void); 00142 00144 /*========================== PRIVATE ================================*/ 00145 private: 00146 00147 friend class Geometry; 00148 00149 static char cvsid[]; 00150 00151 /*---------------------------------------------------------------------*/ 00155 Int32 _triIndex; 00156 UInt32 _actPrimIndex; 00157 Int32 _triPntIndex[3]; 00158 00161 void startPrim(void); 00162 }; 00163 00164 typedef TriangleIterator *TriangleIteratorP; 00165 00166 OSG_END_NAMESPACE 00167 00168 #include "OSGTriangleIterator.inl" 00169 00170 #endif /* _OSGTRIANGLEITERATOR_H_ */
1.4.3