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) 1998-2007 by Systems in Motion. All rights reserved.
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 Systems in Motion about acquiring
18  * a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, 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 
31 class SoDetail;
32 
33 class COIN_DLL_API SoPrimitiveVertex {
34 public:
35  SoPrimitiveVertex(void);
37  ~SoPrimitiveVertex(void);
38  const SbVec3f & getPoint(void) const;
39  const SbVec3f & getNormal(void) const;
40  const SbVec4f & getTextureCoords(void) const;
41  int getMaterialIndex(void) const;
42  const SoDetail * getDetail(void) const;
43  SoPrimitiveVertex & operator = (const SoPrimitiveVertex & pv);
44 
45  void setPoint(const SbVec3f & point);
46  void setPoint(float x, float y, float z) { point.setValue(x, y, z); }
47  void setNormal(const SbVec3f & normal);
48  void setNormal(float nx, float ny, float nz) { normal.setValue(nx, ny, nz); }
49  void setTextureCoords(const SbVec2f & texcoords);
50  void setTextureCoords(float tx, float ty) { textureCoords.setValue(tx, ty, 0.0f, 1.0f); }
51  void setTextureCoords(const SbVec3f & texcoords);
52  void setTextureCoords(float tx, float ty, float tz) { textureCoords.setValue(tx, ty, tz, 1.0f); }
53  void setTextureCoords(const SbVec4f & texcoords);
54  void setTextureCoords(float tx, float ty, float tz, float tw) { textureCoords.setValue(tx, ty, tz, tw); }
55 
56  void setMaterialIndex(const int index);
57  void setDetail(SoDetail * const d);
58 
59 private:
60  SbVec3f point;
61  SbVec3f normal;
62  SbVec4f textureCoords;
63  int materialIndex;
64  SoDetail * detail;
65 };
66 
67 #endif // !COIN_SOPRIMITIVEVERTEX_H
The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition: SbVec2f.h:36
The SoPrimitiveVertex class represents a single vertex of a generated primitive.Instances of SoPrimit...
Definition: SoPrimitiveVertex.h:33
The SbVec4f class is a 4 dimensional vector with floating point coordinates.
Definition: SbVec4f.h:34
void setTextureCoords(float tx, float ty, float tz, float tw)
Definition: SoPrimitiveVertex.h:54
void setNormal(float nx, float ny, float nz)
Definition: SoPrimitiveVertex.h:48
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition: SbVec3f.h:37
void setTextureCoords(float tx, float ty)
Definition: SoPrimitiveVertex.h:50
SbVec3f & setValue(const float v[3])
Definition: SbVec3f.cpp:461
void setTextureCoords(float tx, float ty, float tz)
Definition: SoPrimitiveVertex.h:52
void setPoint(float x, float y, float z)
Definition: SoPrimitiveVertex.h:46
The SoDetail class is the superclass for all classes storing detailed information about particular sh...
Definition: SoDetail.h:30

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Fri Jul 20 2018 for Coin by Doxygen. 1.8.14