Coin  4.0.3
Coin3D core library
Loading...
Searching...
No Matches
SoPrimitiveVertex.h
1#ifndef COIN_SOPRIMITIVEVERTEX_H
2#define COIN_SOPRIMITIVEVERTEX_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/SbVec2f.h>
37#include <Inventor/SbVec3f.h>
38#include <Inventor/SbVec4f.h>
39#include <Inventor/system/inttypes.h>
40
41class SoDetail;
42
44public:
48
50
51 const SbVec3f & getPoint(void) const { return point; }
52 const SbVec3f & getNormal(void) const { return normal; }
53 const SbVec4f & getTextureCoords(void) const { return textureCoords; }
54 int getMaterialIndex(void) const { return materialIndex; }
55 uint32_t getPackedColor(void) const { return packedColor; }
56 const SoDetail * getDetail(void) const { return detail; }
57
58 void setPoint(const SbVec3f & pt) { point = pt; }
59 void setPoint(float x, float y, float z) { point.setValue(x, y, z); }
60 void setNormal(const SbVec3f & n) { normal = n; }
61 void setNormal(float nx, float ny, float nz) { normal.setValue(nx, ny, nz); }
62 void setTextureCoords(const SbVec2f & tex) { textureCoords.setValue(tex[0], tex[1], 0.0f, 1.0f); }
63 void setTextureCoords(float tx, float ty) { textureCoords.setValue(tx, ty, 0.0f, 1.0f); }
64 void setTextureCoords(const SbVec3f & tex) { textureCoords.setValue(tex[0], tex[1], tex[2], 1.0f); }
65 void setTextureCoords(float tx, float ty, float tz) { textureCoords.setValue(tx, ty, tz, 1.0f); }
66 void setTextureCoords(const SbVec4f & tex) { textureCoords = tex; }
67 void setTextureCoords(float tx, float ty, float tz, float tw) { textureCoords.setValue(tx, ty, tz, tw); }
68
69 void setMaterialIndex(int index) { materialIndex = index; }
70 void setPackedColor(uint32_t rgba) { packedColor = rgba; }
71 void setDetail(SoDetail * d) { detail = d; }
72
73private:
74 SbVec3f point;
75 SbVec3f normal;
76 SbVec4f textureCoords;
77 int materialIndex;
78 SoDetail * detail;
79 uint32_t packedColor;
80
81}; // SoPrimitiveVertex
82
83#endif // !COIN_SOPRIMITIVEVERTEX_H
The SbList class is a template container class for lists.
Definition SbList.h:70
SbList< Type > & operator=(const SbList< Type > &l)
Definition SbList.h:99
SbList(const int sizehint=DEFAULTSIZE)
Definition SbList.h:78
The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition SbVec2f.h:49
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition SbVec3f.h:51
The SbVec4f class is a 4 dimensional vector with floating point coordinates.
Definition SbVec4f.h:49
The SoDetail class is the superclass for all classes storing detailed information about particular sh...
Definition SoDetail.h:39
The SoPrimitiveVertex class represents a single vertex of a generated primitive.
Definition SoPrimitiveVertex.h:43
const SoDetail * getDetail(void) const
Definition SoPrimitiveVertex.h:56
int getMaterialIndex(void) const
Definition SoPrimitiveVertex.h:54
const SbVec3f & getNormal(void) const
Definition SoPrimitiveVertex.h:52
void setNormal(float nx, float ny, float nz)
Definition SoPrimitiveVertex.h:61
void setTextureCoords(float tx, float ty, float tz, float tw)
Definition SoPrimitiveVertex.h:67
void setPoint(const SbVec3f &pt)
Definition SoPrimitiveVertex.h:58
const SbVec3f & getPoint(void) const
Definition SoPrimitiveVertex.h:51
void setTextureCoords(const SbVec3f &tex)
Definition SoPrimitiveVertex.h:64
void setTextureCoords(float tx, float ty, float tz)
Definition SoPrimitiveVertex.h:65
void setPackedColor(uint32_t rgba)
Definition SoPrimitiveVertex.h:70
void setTextureCoords(const SbVec4f &tex)
Definition SoPrimitiveVertex.h:66
void setDetail(SoDetail *d)
Definition SoPrimitiveVertex.h:71
void setMaterialIndex(int index)
Definition SoPrimitiveVertex.h:69
void setNormal(const SbVec3f &n)
Definition SoPrimitiveVertex.h:60
void setTextureCoords(float tx, float ty)
Definition SoPrimitiveVertex.h:63
void setTextureCoords(const SbVec2f &tex)
Definition SoPrimitiveVertex.h:62
void setPoint(float x, float y, float z)
Definition SoPrimitiveVertex.h:59
const SbVec4f & getTextureCoords(void) const
Definition SoPrimitiveVertex.h:53
uint32_t getPackedColor(void) const
Definition SoPrimitiveVertex.h:55