Main Page   Class Hierarchy   Compound List   File List   Compound Members  

Vertex.h

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 dimeVertex : public dimeEntity
00038 {
00039   friend class dimePolyline;
00040   friend class dimeEntity;
00041   
00042 public:
00043   dimeVertex();
00044 
00045   enum Flags {
00046     CURVE_FITTING_VERTEX   = 0x01,
00047     HAS_CURVE_FIT_TANGENT  = 0x02,
00048     SPLINE_VERTEX          = 0x08,
00049     FRAME_CONTROL_POINT    = 0x10,
00050     POLYLINE_3D_VERTEX     = 0x20,
00051     POLYGON_MESH_VERTEX    = 0x40,
00052     POLYFACE_MESH_VERTEX   = 0x80
00053   };
00054   
00055   virtual dimeEntity *copy(dimeModel * const model) const;
00056   virtual bool getRecord(const int groupcode,
00057                          dimeParam &param,
00058                          const int index = 0) const;
00059   virtual const char *getEntityName() const;
00060 
00061   int16 getFlags() const;
00062   void setFlags(const int16 flags);
00063 
00064   void setCoords(const dimeVec3f &v);
00065   const dimeVec3f &getCoords() const;
00066   
00067   int numIndices() const;
00068   int getIndex(const int idx) const;
00069   void setIndex(const int idx, const int val);
00070 
00071   virtual bool write(dimeOutput * const out);
00072   virtual int typeId() const;
00073   virtual int countRecords() const;
00074 
00075 protected:
00076   virtual bool handleRecord(const int groupcode, 
00077                             const dimeParam &param,
00078                             dimeMemHandler * const memhandler);
00079   
00080 private:
00081   int16 flags;
00082 #ifdef DIME_FIXBIG
00083   int32 indices[4];
00084 #else
00085   int16 indices[4];
00086 #endif
00087   dimeVec3f coords;
00088   dimePolyline *polyline; // link back to polyline...
00089 
00090 }; // class dimeVertex
00091 
00092 inline void 
00093 dimeVertex::setCoords(const dimeVec3f &v)
00094 {
00095   this->coords = v;
00096 }
00097 
00098 inline const dimeVec3f &
00099 dimeVertex::getCoords() const
00100 {
00101   return this->coords;
00102 }
00103 
00104 inline void 
00105 dimeVertex::setIndex(const int idx, const int val)
00106 {
00107   assert(idx >= 0 && idx < 4);
00108   this->indices[idx] = val;
00109 }
00110 
00111 inline int16 
00112 dimeVertex::getFlags() const
00113 {
00114   return this->flags;
00115 }
00116 
00117 inline void 
00118 dimeVertex::setFlags(const int16 flags)
00119 {
00120   this->flags = flags;
00121 }
00122 
00123 #endif // ! DIME_VERTEX_H
00124 

Copyright © 1998-1999, Systems In Motion <sales@sim.no>. All rights reserved.
System documentation was generated using doxygen.