1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2011 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
30 #ifndef _OSGFASTTRIANGLEITERATOR_H_
31 #define _OSGFASTTRIANGLEITERATOR_H_
33 #include "OSGConfig.h"
34 #include "OSGDrawableDef.h"
35 #include "OSGPrimitiveIterator.h"
39 class OSG_DRAWABLE_DLLMAPPING FastTriangleIterator
: public PrimitiveIterator
41 /*========================== PUBLIC =================================*/
43 /*---------------------------------------------------------------------*/
44 /*! \name Constructors / Destructor */
47 FastTriangleIterator( void );
48 FastTriangleIterator(const FastTriangleIterator
&source
);
49 FastTriangleIterator(const Geometry
*geo
);
50 FastTriangleIterator(const Node
*node
);
52 virtual ~FastTriangleIterator(void);
55 /*---------------------------------------------------------------------*/
59 virtual void setToBegin(void);
60 virtual void setToEnd (void);
63 /*---------------------------------------------------------------------*/
67 inline Int32
getIndex(Int32 which
) const;
68 inline Int32
getIndex(void ) const;
70 inline Int32
getPropertyIndex(UInt16 att
, Int32 which
) const;
71 template <class ReturnT
>
72 inline ReturnT
getPropertyValue(UInt16 att
, Int32 which
) const;
75 /*---------------------------------------------------------------------*/
76 /*! \name Operators */
79 FastTriangleIterator
&operator++(void);
80 inline FastTriangleIterator
operator++(int );
82 FastTriangleIterator
&seek (Int32 index
);
84 FastTriangleIterator
&operator= (const FastTriangleIterator
&source
);
85 bool operator< (const FastTriangleIterator
&rhs
) const;
86 bool operator==(const FastTriangleIterator
&rhs
) const;
87 bool operator!=(const FastTriangleIterator
&rhs
) const;
90 /*========================= PROTECTED ===============================*/
92 typedef PrimitiveIterator Inherited
;
94 void startPrim (void);
95 UInt32
getTrisInActPrim(void) const;
96 UInt32
getTriInActPrim (void) const;
100 UInt32 _triPntIndex
[3];
105 #include "OSGFastTriangleIterator.inl"
107 #endif // _OSGFASTTRIANGLEITERATOR_H_