![]() |
http://www.sim.no/ http://www.coin3d.org/ |
00001 #ifndef COIN_SOPRIMITIVEVERTEX_H 00002 #define COIN_SOPRIMITIVEVERTEX_H 00003 00004 /**************************************************************************\ 00005 * 00006 * This file is part of the Coin 3D visualization library. 00007 * Copyright (C) 1998-2008 by Kongsberg SIM. All rights reserved. 00008 * 00009 * This library is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU General Public License 00011 * ("GPL") version 2 as published by the Free Software Foundation. 00012 * See the file LICENSE.GPL at the root directory of this source 00013 * distribution for additional information about the GNU GPL. 00014 * 00015 * For using Coin with software that can not be combined with the GNU 00016 * GPL, and for taking advantage of the additional benefits of our 00017 * support services, please contact Kongsberg SIM about acquiring 00018 * a Coin Professional Edition License. 00019 * 00020 * See http://www.coin3d.org/ for more information. 00021 * 00022 * Kongsberg SIM, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY. 00023 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org 00024 * 00025 \**************************************************************************/ 00026 00027 #include <Inventor/SbVec2f.h> 00028 #include <Inventor/SbVec3f.h> 00029 #include <Inventor/SbVec4f.h> 00030 #include <Inventor/system/inttypes.h> 00031 00032 class SoDetail; 00033 00034 class COIN_DLL_API SoPrimitiveVertex { 00035 public: 00036 SoPrimitiveVertex(void); 00037 SoPrimitiveVertex(const SoPrimitiveVertex & pv); 00038 ~SoPrimitiveVertex(void); 00039 00040 SoPrimitiveVertex & operator = (const SoPrimitiveVertex & pv); 00041 00042 const SbVec3f & getPoint(void) const { return point; } 00043 const SbVec3f & getNormal(void) const { return normal; } 00044 const SbVec4f & getTextureCoords(void) const { return textureCoords; } 00045 int getMaterialIndex(void) const { return materialIndex; } 00046 uint32_t getPackedColor(void) const { return packedColor; } 00047 const SoDetail * getDetail(void) const { return detail; } 00048 00049 void setPoint(const SbVec3f & pt) { point = pt; } 00050 void setPoint(float x, float y, float z) { point.setValue(x, y, z); } 00051 void setNormal(const SbVec3f & n) { normal = n; } 00052 void setNormal(float nx, float ny, float nz) { normal.setValue(nx, ny, nz); } 00053 void setTextureCoords(const SbVec2f & tex) { textureCoords.setValue(tex[0], tex[1], 0.0f, 1.0f); } 00054 void setTextureCoords(float tx, float ty) { textureCoords.setValue(tx, ty, 0.0f, 1.0f); } 00055 void setTextureCoords(const SbVec3f & tex) { textureCoords.setValue(tex[0], tex[1], tex[2], 1.0f); } 00056 void setTextureCoords(float tx, float ty, float tz) { textureCoords.setValue(tx, ty, tz, 1.0f); } 00057 void setTextureCoords(const SbVec4f & tex) { textureCoords = tex; } 00058 void setTextureCoords(float tx, float ty, float tz, float tw) { textureCoords.setValue(tx, ty, tz, tw); } 00059 00060 void setMaterialIndex(int index) { materialIndex = index; } 00061 void setPackedColor(uint32_t rgba) { packedColor = rgba; } 00062 void setDetail(SoDetail * d) { detail = d; } 00063 00064 private: 00065 SbVec3f point; 00066 SbVec3f normal; 00067 SbVec4f textureCoords; 00068 int materialIndex; 00069 SoDetail * detail; 00070 uint32_t packedColor; 00071 00072 }; // SoPrimitiveVertex 00073 00074 #endif // !COIN_SOPRIMITIVEVERTEX_H
Copyright © 1998-2008 by Kongsberg SIM. All rights reserved.
Generated on Tue May 5 02:52:06 2009 for Coin by Doxygen 1.5.5.