Main Page | Class Hierarchy | Compound List | File List | Compound Members

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

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