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 _OSGLINEITERATOR_H_ 00041 #define _OSGLINEITERATOR_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 LineIterator : public PrimitiveIterator 00059 { 00060 /*========================== PUBLIC =================================*/ 00061 public: 00062 00063 /*---------------------------------------------------------------------*/ 00067 static const char *getClassname(void) { return "LineIterator"; } 00068 00070 /*---------------------------------------------------------------------*/ 00074 LineIterator(void); 00075 LineIterator(const LineIterator &source); 00076 LineIterator(const GeometryPtr& geo); 00077 LineIterator(const NodePtr& geo); 00078 00080 /*---------------------------------------------------------------------*/ 00084 virtual ~LineIterator(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 inline Int32 getTexCoordsIndex4 (Int32 which) const; 00114 inline Vec2f getTexCoords4 (Int32 which) const; 00115 inline Int32 getTexCoordsIndex5 (Int32 which) const; 00116 inline Vec2f getTexCoords5 (Int32 which) const; 00117 inline Int32 getTexCoordsIndex6 (Int32 which) const; 00118 inline Vec2f getTexCoords6 (Int32 which) const; 00119 inline Int32 getTexCoordsIndex7 (Int32 which) const; 00120 inline Vec2f getTexCoords7 (Int32 which) const; 00121 00122 inline Int32 getIndexIndex (Int32 which) const; 00123 00124 00126 /*---------------------------------------------------------------------*/ 00130 void operator ++(void); 00131 void seek(Int32 index); 00132 00133 LineIterator & operator =(const LineIterator &source); 00134 bool operator < (const LineIterator &other) const; 00135 bool operator == (const LineIterator &other) const; 00136 bool operator != (const LineIterator &other) const; 00137 00139 /*========================= PROTECTED ===============================*/ 00140 protected: 00141 00142 typedef PrimitiveIterator Inherited; 00143 00144 /*---------------------------------------------------------------------*/ 00148 void setToBegin(void); 00149 void setToEnd(void); 00150 00152 /*========================== PRIVATE ================================*/ 00153 private: 00154 00155 friend class Geometry; 00156 00157 static char cvsid[]; 00158 00159 /*---------------------------------------------------------------------*/ 00163 Int32 _lineIndex; 00164 UInt32 _actPrimIndex; 00165 Int32 _linePntIndex[2]; 00166 00169 void startPrim(void); 00170 }; 00171 00172 typedef LineIterator *LineIteratorP; 00173 00174 OSG_END_NAMESPACE 00175 00176 #include "OSGLineIterator.inl" 00177 00178 #endif /* _OSGLINEITERATOR_H_ */
1.5.5