00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
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 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 ¶m,
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
00070
00071 protected:
00072 virtual void fixReferences(dimeModel * const model);
00073 virtual bool handleRecord(const int groupcode,
00074 const dimeParam ¶m,
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 };
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