|
http://www.sim.no http://www.coin3d.org |
00001 /**************************************************************************\ 00002 * 00003 * FILE: Vertex.h 00004 * 00005 * This source file is part of DIME. 00006 * Copyright (C) 1998-1999 by Systems In Motion. All rights reserved. 00007 * 00008 * This library is free software; you can redistribute it and/or modify it 00009 * under the terms of the GNU General Public License, version 2, as 00010 * published by the Free Software Foundation. 00011 * 00012 * This library is distributed in the hope that it will be useful, but 00013 * WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * General Public License (the accompanying file named COPYING) for more 00016 * details. 00017 * 00018 ************************************************************************** 00019 * 00020 * If you need DIME for a non-GPL project, contact Systems In Motion 00021 * to acquire a Professional Edition License: 00022 * 00023 * Systems In Motion http://www.sim.no/ 00024 * Prof. Brochs gate 6 sales@sim.no 00025 * N-7030 Trondheim Voice: +47 22114160 00026 * NORWAY Fax: +47 67172912 00027 * 00028 \**************************************************************************/ 00029 00030 #ifndef DIME_VERTEX_H 00031 #define DIME_VERTEX_H 00032 00033 #include <dime/Basic.h> 00034 #include <dime/entities/Entity.h> 00035 #include <dime/util/Linear.h> 00036 00037 class dimePolyline; 00038 00039 class DIME_DLL_API dimeVertex : public dimeEntity 00040 { 00041 friend class dimePolyline; 00042 friend class dimeEntity; 00043 00044 public: 00045 dimeVertex(); 00046 00047 enum Flags { 00048 CURVE_FITTING_VERTEX = 0x01, 00049 HAS_CURVE_FIT_TANGENT = 0x02, 00050 SPLINE_VERTEX = 0x08, 00051 FRAME_CONTROL_POINT = 0x10, 00052 POLYLINE_3D_VERTEX = 0x20, 00053 POLYGON_MESH_VERTEX = 0x40, 00054 POLYFACE_MESH_VERTEX = 0x80 00055 }; 00056 00057 virtual dimeEntity *copy(dimeModel * const model) const; 00058 virtual bool getRecord(const int groupcode, 00059 dimeParam ¶m, 00060 const int index = 0) const; 00061 virtual const char *getEntityName() const; 00062 00063 int16 getFlags() const; 00064 void setFlags(const int16 flags); 00065 00066 void setCoords(const dimeVec3f &v); 00067 const dimeVec3f &getCoords() const; 00068 00069 int numIndices() const; 00070 int getIndex(const int idx) const; 00071 void setIndex(const int idx, const int val); 00072 00073 virtual bool write(dimeOutput * const out); 00074 virtual int typeId() const; 00075 virtual int countRecords() const; 00076 00077 protected: 00078 virtual bool handleRecord(const int groupcode, 00079 const dimeParam ¶m, 00080 dimeMemHandler * const memhandler); 00081 00082 private: 00083 int16 flags; 00084 #ifdef DIME_FIXBIG 00085 int32 indices[4]; 00086 #else 00087 int16 indices[4]; 00088 #endif 00089 dimeVec3f coords; 00090 dimePolyline *polyline; // link back to polyline... 00091 00092 }; // class dimeVertex 00093 00094 inline void 00095 dimeVertex::setCoords(const dimeVec3f &v) 00096 { 00097 this->coords = v; 00098 } 00099 00100 inline const dimeVec3f & 00101 dimeVertex::getCoords() const 00102 { 00103 return this->coords; 00104 } 00105 00106 inline void 00107 dimeVertex::setIndex(const int idx, const int val) 00108 { 00109 assert(idx >= 0 && idx < 4); 00110 this->indices[idx] = val; 00111 } 00112 00113 inline int16 00114 dimeVertex::getFlags() const 00115 { 00116 return this->flags; 00117 } 00118 00119 inline void 00120 dimeVertex::setFlags(const int16 flags) 00121 { 00122 this->flags = flags; 00123 } 00124 00125 #endif // ! DIME_VERTEX_H 00126
Copyright © 1998-2005 by Systems in Motion AS. All rights reserved.
Generated on Tue Dec 2 23:27:14 2008 for DIME by Doxygen. 1.4.7