Insert.h

00001 /**************************************************************************\
00002  * 
00003  *  FILE: Insert.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_INSERT_H
00031 #define DIME_INSERT_H
00032 
00033 #include <dime/Basic.h>
00034 #include <dime/entities/Entity.h>
00035 #include <dime/util/Linear.h>
00036 
00037 class dimeBlock;
00038 
00039 class DIME_DLL_API dimeInsert : public dimeEntity
00040 {
00041   friend class dimeEntitiesSection;
00042   friend class dimeBlocksSection;
00043 
00044 public:
00045   dimeInsert();
00046   virtual ~dimeInsert();
00047 
00048   void setBlock(dimeBlock * const block);
00049   dimeBlock * getBlock() const;
00050 
00051   virtual dimeEntity *copy(dimeModel * const model) const;
00052   virtual bool getRecord(const int groupcode,
00053                          dimeParam &param,
00054                          const int index = 0) const;
00055   virtual const char *getEntityName() const;
00056 
00057   virtual bool read(dimeInput * const in);
00058   virtual bool write(dimeOutput * const out);
00059   virtual int typeId() const;
00060   virtual int countRecords() const;
00061 
00062   void setInsertionPoint(const dimeVec3f &v);
00063   const dimeVec3f &getInsertionPoint() const;
00064 
00065   void setScale(const dimeVec3f &v);
00066   const dimeVec3f & getScale() const;
00067   
00068   void setRotAngle(dxfdouble angle);
00069   dxfdouble getRotAngle() const;
00070 
00071   // FIXME: more set and get methods
00072   
00073 protected:
00074   virtual void fixReferences(dimeModel * const model);
00075   virtual bool handleRecord(const int groupcode, 
00076                             const dimeParam &param,
00077                             dimeMemHandler * const memhandler);
00078   virtual bool traverse(const dimeState * const state, 
00079                         dimeCallback callback,
00080                         void *userdata);
00081 
00082 private:
00083   void makeMatrix(dimeMatrix &m) const;
00084 
00085   int16 attributesFollow;
00086   const char *blockName;
00087   dimeVec3f insertionPoint;
00088   dimeVec3f extrusionDir;
00089   dimeVec3f scale;
00090   dxfdouble rotAngle;
00091   dimeEntity **entities;
00092   int numEntities;
00093 #ifdef DIME_FIXBIG
00094   int32 rowCount;
00095 #else
00096   int16 rowCount;
00097 #endif
00098   int16 columnCount;
00099   dxfdouble rowSpacing;
00100   dxfdouble columnSpacing;
00101   dimeEntity *seqend;
00102   dimeBlock *block;
00103 
00104 }; // class dimeInsert
00105 
00106 
00107 
00108 inline void 
00109 dimeInsert::setInsertionPoint(const dimeVec3f &v)
00110 {
00111   this->insertionPoint = v;
00112 }
00113 
00114 inline const dimeVec3f &
00115 dimeInsert::getInsertionPoint() const
00116 {
00117   return this->insertionPoint;
00118 }
00119 
00120 inline dimeBlock *
00121 dimeInsert::getBlock() const
00122 {
00123   return this->block;
00124 }
00125 
00126 inline void 
00127 dimeInsert::setScale(const dimeVec3f &v)
00128 {
00129   this->scale = v;
00130 }
00131 
00132 inline const dimeVec3f &
00133 dimeInsert::getScale() const
00134 {
00135   return this->scale;
00136 }
00137 
00138 inline void 
00139 dimeInsert::setRotAngle(dxfdouble angle)
00140 {
00141   this->rotAngle = angle;
00142 }
00143 
00144 inline dxfdouble
00145 dimeInsert::getRotAngle() const
00146 {
00147   return this->rotAngle;
00148 }
00149 
00150 
00151 #endif // ! DIME_INSERT_H
00152 

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