Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
https://bitbucket.org/Coin3D/
http://www.kongsberg.com/kogt/
SoVertexShape.h
1 #ifndef COIN_SOVERTEXSHAPE_H
2 #define COIN_SOVERTEXSHAPE_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/nodes/SoSubNode.h>
37 #include <Inventor/nodes/SoShape.h>
38 #include <Inventor/fields/SoSFNode.h>
39 #ifndef COIN_INTERNAL
40 // For Open Inventor compatibility.
41 #include <Inventor/nodes/SoVertexProperty.h>
42 #endif // !COIN_INTERNAL
43 
44 class SoNormalBundle;
45 class SoNormalCache;
46 class SbVec3f;
48 class SoVertexShapeP;
49 
50 class COIN_DLL_API SoVertexShape : public SoShape {
51  typedef SoShape inherited;
52 
54 
55 public:
56  static void initClass(void);
57 
59 
60  virtual void notify(SoNotList * nl);
61  virtual SbBool generateDefaultNormals(SoState * state,
62  SoNormalBundle * bundle);
63  virtual SbBool generateDefaultNormals(SoState * state,
64  SoNormalCache * cache);
65  virtual void write(SoWriteAction * action);
66 
67 protected:
68  SoVertexShape(void);
69  virtual ~SoVertexShape();
70 
71  virtual SbBool shouldGLRender(SoGLRenderAction * action);
72 
73  void setNormalCache(SoState * const state,
74  const int num, const SbVec3f * normals);
75  SoNormalCache * getNormalCache(void) const;
76 
77  SoNormalCache * generateAndReadLockNormalCache(SoState * const state);
78  void getVertexData(SoState * state,
79  const SoCoordinateElement *& coords,
80  const SbVec3f *& normals,
81  const SbBool neednormals);
82 
83  void readLockNormalCache(void);
84  void readUnlockNormalCache(void);
85 
86 private:
87  void writeLockNormalCache(void);
88  void writeUnlockNormalCache(void);
89  SoVertexShapeP * pimpl;
90 };
91 
92 #endif // !COIN_SOVERTEXSHAPE_H
The SoBase class is the top-level superclass for a number of class-hierarchies.
Definition: SoBase.h:45
The SoNormalCache class is used to hold cached normals.
Definition: SoNormalCache.h:43
The SoNormalBundle class simplifies normal handling.
Definition: SoNormalBundle.h:42
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 SoSFNode class is a container for a single node.
Definition: SoSFNode.h:47
SoSFNode vertexProperty
Definition: SoVertexShape.h:58
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition: SbVec3f.h:51
virtual SbBool shouldGLRender(SoGLRenderAction *action)
Definition: SoShape.cpp:553
virtual void notify(SoNotList *nl)
Definition: SoShape.cpp:1419
The SoWriteAction class writes a scene graph to file.
Definition: SoWriteAction.h:42
The SoVertexShape class is the superclass for all vertex based shapes.
Definition: SoVertexShape.h:50
The SoShape class is the superclass for geometry shapes.
Definition: SoShape.h:52
The SoNotList class is a list of SoNotRec notification records.
Definition: SoNotification.h:43
virtual void write(SoWriteAction *action)
Definition: SoNode.cpp:1241
#define SO_NODE_ABSTRACT_HEADER(classname)
The SoGLRenderAction class renders the scene graph with OpenGL calls.
Definition: SoGLRenderAction.h:50