fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / NodeCores / Drawables / Geometry / Util / OSGFastTriangleIterator.h
blobfa019dbd7575f4ed49847db7f5140c261c698b1a
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2011 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
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. *
18 * *
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. *
23 * *
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. *
27 * *
28 \*---------------------------------------------------------------------------*/
30 #ifndef _OSGFASTTRIANGLEITERATOR_H_
31 #define _OSGFASTTRIANGLEITERATOR_H_
33 #include "OSGConfig.h"
34 #include "OSGDrawableDef.h"
35 #include "OSGPrimitiveIterator.h"
37 OSG_BEGIN_NAMESPACE
39 class OSG_DRAWABLE_DLLMAPPING FastTriangleIterator : public PrimitiveIterator
41 /*========================== PUBLIC =================================*/
42 public:
43 /*---------------------------------------------------------------------*/
44 /*! \name Constructors / Destructor */
45 /*! \{ */
47 FastTriangleIterator( void );
48 FastTriangleIterator(const FastTriangleIterator &source);
49 FastTriangleIterator(const Geometry *geo );
50 FastTriangleIterator(const Node *node );
52 virtual ~FastTriangleIterator(void);
54 /*! \} */
55 /*---------------------------------------------------------------------*/
56 /*! \name Set */
57 /*! \{ */
59 virtual void setToBegin(void);
60 virtual void setToEnd (void);
62 /*! \} */
63 /*---------------------------------------------------------------------*/
64 /*! \name Get */
65 /*! \{ */
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;
74 /*! \} */
75 /*---------------------------------------------------------------------*/
76 /*! \name Operators */
77 /*! \{ */
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;
89 /*! \} */
90 /*========================= PROTECTED ===============================*/
91 protected:
92 typedef PrimitiveIterator Inherited;
94 void startPrim (void);
95 UInt32 getTrisInActPrim(void) const;
96 UInt32 getTriInActPrim (void) const;
98 Int32 _triIndex;
99 UInt32 _actPrimIndex;
100 UInt32 _triPntIndex[3];
103 OSG_END_NAMESPACE
105 #include "OSGFastTriangleIterator.inl"
107 #endif // _OSGFASTTRIANGLEITERATOR_H_