Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
https://bitbucket.org/Coin3D/
http://www.kongsberg.com/kogt/
SoConvexDataCache.h
1 #ifndef COIN_SOCONVEXDATACACHE_H
2 #define COIN_SOCONVEXDATACACHE_H
3 
4 /**************************************************************************\
5  * Copyright (c) Kongsberg Oil & Gas Technologies AS
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are
10  * met:
11  *
12  * Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
15  * Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in the
17  * documentation and/or other materials provided with the distribution.
18  *
19  * Neither the name of the copyright holder nor the names of its
20  * contributors may be used to endorse or promote products derived from
21  * this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 \**************************************************************************/
35 
36 #include <Inventor/caches/SoCache.h>
37 #include <Inventor/system/inttypes.h>
38 
39 class SbVec3f;
41 class SbMatrix;
42 class SoConvexDataCacheP;
43 
44 class COIN_DLL_API SoConvexDataCache : public SoCache {
45  typedef SoCache inherited;
46 public:
47  SoConvexDataCache(SoState * const state);
48  virtual ~SoConvexDataCache();
49 
50  enum Binding {
51  // do not change these values. We rely on them matching
52  // values in SoIndededFaceSet.h and SoGL.cpp...
53  NONE = 0,
54  PER_FACE,
55  PER_FACE_INDEXED,
56  PER_VERTEX,
57  PER_VERTEX_INDEXED
58  };
59 
60  void generate(const SoCoordinateElement * const coords,
61  const SbMatrix & matrix,
62  const int32_t *coordindices,
63  const int numcoordindices,
64  const int32_t *matindices, const int32_t *normindices,
65  const int32_t *texindices,
66  const Binding matbinding, const Binding normbinding,
67  const Binding texbinding);
68 
69  const int32_t *getCoordIndices(void) const;
70  int getNumCoordIndices(void) const;
71  const int32_t *getMaterialIndices(void) const;
72  int getNumMaterialIndices(void) const;
73  const int32_t *getNormalIndices(void) const;
74  int getNumNormalIndices(void) const;
75  const int32_t *getTexIndices(void) const;
76  int getNumTexIndices(void) const;
77 
78 private:
79  SoConvexDataCacheP * pimpl;
80 };
81 
82 #endif // !COIN_SOCONVEXDATACACHE_H
The SoConvexDataCache class is used to cache convexified polygons.
Definition: SoConvexDataCache.h:44
Binding
The Binding enum is used to specify bindings.
Definition: SoConvexDataCache.h:50
The SoState class manages the Coin scenegraph traversal state data.
Definition: SoState.h:44
The SoCoordinateElement class is yet to be documented.
Definition: SoCoordinateElement.h:40
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition: SbVec3f.h:51
The SbMatrix class is a 4x4 dimensional representation of a matrix.
Definition: SbMatrix.h:47
The SoCache class is the superclass for all internal cache classes.
Definition: SoCache.h:43