Coin Logo http://www.sim.no/
http://www.coin3d.org/

SoPrimitiveVertex.h
1#ifndef COIN_SOPRIMITIVEVERTEX_H
2#define COIN_SOPRIMITIVEVERTEX_H
3
4/**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25\**************************************************************************/
26
27#include <Inventor/SbVec2f.h>
28#include <Inventor/SbVec3f.h>
29#include <Inventor/SbVec4f.h>
30#include <Inventor/system/inttypes.h>
31
32class SoDetail;
33
34class COIN_DLL_API SoPrimitiveVertex {
35public:
39
40 SoPrimitiveVertex & operator = (const SoPrimitiveVertex & pv);
41
42 const SbVec3f & getPoint(void) const { return point; }
43 const SbVec3f & getNormal(void) const { return normal; }
44 const SbVec4f & getTextureCoords(void) const { return textureCoords; }
45 int getMaterialIndex(void) const { return materialIndex; }
46 uint32_t getPackedColor(void) const { return packedColor; }
47 const SoDetail * getDetail(void) const { return detail; }
48
49 void setPoint(const SbVec3f & pt) { point = pt; }
50 void setPoint(float x, float y, float z) { point.setValue(x, y, z); }
51 void setNormal(const SbVec3f & n) { normal = n; }
52 void setNormal(float nx, float ny, float nz) { normal.setValue(nx, ny, nz); }
53 void setTextureCoords(const SbVec2f & tex) { textureCoords.setValue(tex[0], tex[1], 0.0f, 1.0f); }
54 void setTextureCoords(float tx, float ty) { textureCoords.setValue(tx, ty, 0.0f, 1.0f); }
55 void setTextureCoords(const SbVec3f & tex) { textureCoords.setValue(tex[0], tex[1], tex[2], 1.0f); }
56 void setTextureCoords(float tx, float ty, float tz) { textureCoords.setValue(tx, ty, tz, 1.0f); }
57 void setTextureCoords(const SbVec4f & tex) { textureCoords = tex; }
58 void setTextureCoords(float tx, float ty, float tz, float tw) { textureCoords.setValue(tx, ty, tz, tw); }
59
60 void setMaterialIndex(int index) { materialIndex = index; }
61 void setPackedColor(uint32_t rgba) { packedColor = rgba; }
62 void setDetail(SoDetail * d) { detail = d; }
63
64private:
65 SbVec3f point;
66 SbVec3f normal;
67 SbVec4f textureCoords;
68 int materialIndex;
69 SoDetail * detail;
70 uint32_t packedColor;
71
72}; // SoPrimitiveVertex
73
74#endif // !COIN_SOPRIMITIVEVERTEX_H
The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition SbVec2f.h:39
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition SbVec3f.h:40
The SbVec4f class is a 4 dimensional vector with floating point coordinates.
Definition SbVec4f.h:40
SbVec4f & setValue(const float v[4])
Definition SbVec4f.h:50
The SoDetail class is the superclass for all classes storing detailed information about particular sh...
Definition SoDetail.h:30
The SoPrimitiveVertex class represents a single vertex of a generated primitive.
Definition SoPrimitiveVertex.h:34
const SoDetail * getDetail(void) const
Definition SoPrimitiveVertex.h:47
int getMaterialIndex(void) const
Definition SoPrimitiveVertex.h:45
const SbVec3f & getNormal(void) const
Definition SoPrimitiveVertex.h:43
void setNormal(float nx, float ny, float nz)
Definition SoPrimitiveVertex.h:52
void setPoint(const SbVec3f &pt)
Definition SoPrimitiveVertex.h:49
const SbVec3f & getPoint(void) const
Definition SoPrimitiveVertex.h:42
void setTextureCoords(const SbVec3f &tex)
Definition SoPrimitiveVertex.h:55
void setTextureCoords(float tx, float ty, float tz)
Definition SoPrimitiveVertex.h:56
void setPackedColor(uint32_t rgba)
Definition SoPrimitiveVertex.h:61
void setTextureCoords(const SbVec4f &tex)
Definition SoPrimitiveVertex.h:57
void setDetail(SoDetail *d)
Definition SoPrimitiveVertex.h:62
void setMaterialIndex(int index)
Definition SoPrimitiveVertex.h:60
void setNormal(const SbVec3f &n)
Definition SoPrimitiveVertex.h:51
void setTextureCoords(float tx, float ty)
Definition SoPrimitiveVertex.h:54
void setTextureCoords(const SbVec2f &tex)
Definition SoPrimitiveVertex.h:53
void setPoint(float x, float y, float z)
Definition SoPrimitiveVertex.h:50
const SbVec4f & getTextureCoords(void) const
Definition SoPrimitiveVertex.h:44
uint32_t getPackedColor(void) const
Definition SoPrimitiveVertex.h:46

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated on Wed Jul 17 2024 for Coin by Doxygen 1.12.0.