Coin: SoVertexShape.h Source File

| Coin3D is Free Software, published under the BSD 3-clause license. | https://coin3d.github.io https://www.kongsberg.com/en/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
44class SoNormalBundle;
45class SoNormalCache;
46class SbVec3f;
47class SoCoordinateElement;
48class SoVertexShapeP;
49
50 class COIN_DLL_API SoVertexShape : public SoShape {
51 typedef SoShape inherited;
52
53 SO_NODE_ABSTRACT_HEADER(SoVertexShape);
54
55public:
56 static void initClass(void);
57
58 SoSFNode vertexProperty;
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
67protected:
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
86private:
87 void writeLockNormalCache(void);
88 void writeUnlockNormalCache(void);
89 SoVertexShapeP * pimpl;
90};
91
92#endif // !COIN_SOVERTEXSHAPE_H
SbVec3f
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition SbVec3f.h:51
SoCoordinateElement
The SoCoordinateElement class is yet to be documented.
Definition SoCoordinateElement.h:40
SoGLRenderAction
The SoGLRenderAction class renders the scene graph with OpenGL calls.
Definition SoGLRenderAction.h:50
SoNode::write
virtual void write(SoWriteAction *action)
Definition SoNode.cpp:1290
SoNormalBundle
The SoNormalBundle class simplifies normal handling.
Definition SoNormalBundle.h:42
SoNormalCache
The SoNormalCache class is used to hold cached normals.
Definition SoNormalCache.h:43
SoNotList
The SoNotList class is a list of SoNotRec notification records.
Definition SoNotification.h:43
SoSFNode
The SoSFNode class is a container for a single node.
Definition SoSFNode.h:47
SoShape::SoShape
SoShape(void)
Definition SoShape.cpp:350
SoShape::initClass
static void initClass(void)
Sets up initialization for data common to all instances of this class, like submitting necessary info...
Definition SoShape.cpp:368
SoShape::notify
virtual void notify(SoNotList *nl)
Definition SoShape.cpp:1421
SoShape::shouldGLRender
virtual SbBool shouldGLRender(SoGLRenderAction *action)
Definition SoShape.cpp:555
SoState
The SoState class manages the Coin scene graph traversal state data.
Definition SoState.h:44
SoVertexShape::vertexProperty
SoSFNode vertexProperty
Definition SoVertexShape.h:58
SoVertexShape::generateDefaultNormals
virtual SbBool generateDefaultNormals(SoState *state, SoNormalBundle *bundle)
Definition SoVertexShape.cpp:194
SoVertexShape::readUnlockNormalCache
void readUnlockNormalCache(void)
Definition SoVertexShape.cpp:364
SoVertexShape::generateAndReadLockNormalCache
SoNormalCache * generateAndReadLockNormalCache(SoState *const state)
Definition SoVertexShape.cpp:275
SoVertexShape::readLockNormalCache
void readLockNormalCache(void)
Definition SoVertexShape.cpp:349
SoVertexShape::getNormalCache
SoNormalCache * getNormalCache(void) const
Definition SoVertexShape.cpp:254
SoVertexShape::setNormalCache
void setNormalCache(SoState *const state, const int num, const SbVec3f *normals)
Definition SoVertexShape.cpp:231
SoVertexShape::SoVertexShape
SoVertexShape(void)
Definition SoVertexShape.cpp:150
SoVertexShape::getVertexData
void getVertexData(SoState *state, const SoCoordinateElement *&coords, const SbVec3f *&normals, const SbBool neednormals)
Definition SoVertexShape.cpp:313
SoWriteAction
The SoWriteAction class writes a scene graph to file.
Definition SoWriteAction.h:42
SO_NODE_ABSTRACT_HEADER
#define SO_NODE_ABSTRACT_HEADER(classname)
Definition Coin_macros.dox:61