Insert.h
1 /**************************************************************************\
2  *
3  * FILE: Insert.h
4  *
5  * This source file is part of DIME.
6  * Copyright (C) 1998-1999 by Systems In Motion. All rights reserved.
7  *
8  * This library is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License, version 2, as
10  * published by the Free Software Foundation.
11  *
12  * This library is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License (the accompanying file named COPYING) for more
16  * details.
17  *
18  **************************************************************************
19  *
20  * If you need DIME for a non-GPL project, contact Systems In Motion
21  * to acquire a Professional Edition License:
22  *
23  * Systems In Motion http://www.sim.no/
24  * Prof. Brochs gate 6 sales@sim.no
25  * N-7030 Trondheim Voice: +47 22114160
26  * NORWAY Fax: +47 67172912
27  *
28 \**************************************************************************/
29 
30 #ifndef DIME_INSERT_H
31 #define DIME_INSERT_H
32 
33 #include <dime/Basic.h>
34 #include <dime/entities/Entity.h>
35 #include <dime/util/Linear.h>
36 
37 class dimeBlock;
38 
39 class DIME_DLL_API dimeInsert : public dimeEntity
40 {
41  friend class dimeEntitiesSection;
42  friend class dimeBlocksSection;
43 
44 public:
45  dimeInsert();
46  virtual ~dimeInsert();
47 
48  void setBlock(dimeBlock * const block);
49  dimeBlock * getBlock() const;
50 
51  virtual dimeEntity *copy(dimeModel * const model) const;
52  virtual bool getRecord(const int groupcode,
53  dimeParam &param,
54  const int index = 0) const;
55  virtual const char *getEntityName() const;
56 
57  virtual bool read(dimeInput * const in);
58  virtual bool write(dimeOutput * const out);
59  virtual int typeId() const;
60  virtual int countRecords() const;
61 
62  void setInsertionPoint(const dimeVec3f &v);
63  const dimeVec3f &getInsertionPoint() const;
64 
65  void setScale(const dimeVec3f &v);
66  const dimeVec3f & getScale() const;
67 
68  void setRotAngle(dxfdouble angle);
69  dxfdouble getRotAngle() const;
70 
71  // FIXME: more set and get methods
72 
73 protected:
74  virtual void fixReferences(dimeModel * const model);
75  virtual bool handleRecord(const int groupcode,
76  const dimeParam &param,
77  dimeMemHandler * const memhandler);
78  virtual bool traverse(const dimeState * const state,
79  dimeCallback callback,
80  void *userdata);
81 
82 private:
83  void makeMatrix(dimeMatrix &m) const;
84 
85  int16 attributesFollow;
86  const char *blockName;
87  dimeVec3f insertionPoint;
88  dimeVec3f extrusionDir;
89  dimeVec3f scale;
90  dxfdouble rotAngle;
91  dimeEntity **entities;
92  int numEntities;
93 #ifdef DIME_FIXBIG
94  int32 rowCount;
95 #else
96  int16 rowCount;
97 #endif
98  int16 columnCount;
99  dxfdouble rowSpacing;
100  dxfdouble columnSpacing;
101  dimeEntity *seqend;
102  dimeBlock *block;
103 
104 }; // class dimeInsert
105 
106 
107 
108 inline void
109 dimeInsert::setInsertionPoint(const dimeVec3f &v)
110 {
111  this->insertionPoint = v;
112 }
113 
114 inline const dimeVec3f &
115 dimeInsert::getInsertionPoint() const
116 {
117  return this->insertionPoint;
118 }
119 
120 inline dimeBlock *
121 dimeInsert::getBlock() const
122 {
123  return this->block;
124 }
125 
126 inline void
127 dimeInsert::setScale(const dimeVec3f &v)
128 {
129  this->scale = v;
130 }
131 
132 inline const dimeVec3f &
133 dimeInsert::getScale() const
134 {
135  return this->scale;
136 }
137 
138 inline void
139 dimeInsert::setRotAngle(dxfdouble angle)
140 {
141  this->rotAngle = angle;
142 }
143 
144 inline dxfdouble
145 dimeInsert::getRotAngle() const
146 {
147  return this->rotAngle;
148 }
149 
150 
151 #endif // ! DIME_INSERT_H
152 
The dimeState class manages various state variables while the model is traversed. ...
Definition: State.h:37
The dimeBlocksSection class handles a BLOCKS section.
Definition: BlocksSection.h:36
The dimeMemHandler class is a special-purpose memory manager.
Definition: MemHandler.h:35
virtual int typeId() const =0
virtual dimeEntity * copy(dimeModel *const model) const =0
class dimeBlock * getBlock(const int idx)
Definition: BlocksSection.cpp:197
virtual bool getRecord(const int groupcode, dimeParam &param, const int index=0) const
Definition: Entity.cpp:709
The dimeEntity class is the superclass of all entity classes.
Definition: Entity.h:57
The dimeModel class organizes a model.
Definition: Model.h:51
virtual const char * getEntityName() const =0
The dimeEntitiesSection class handles an ENTITIES section.
Definition: EntitiesSection.h:36
The dimeInput class offers transparent file I/O for DXF and DXB.
Definition: Input.h:38
The dimeVec3f class is for containing and operating on a 3D vector / coordinate.
Definition: Linear.h:56
virtual void fixReferences(dimeModel *const model)
Definition: Entity.cpp:470
The dimeParam class is a union of the different parameter types.
Definition: Basic.h:97
The dimeInsert class handles an INSERT entity.
Definition: Insert.h:39
The dimeMatrix class is for containing and operating on a four-by-four matrix.
Definition: Linear.h:151
virtual int countRecords() const
Definition: Entity.cpp:520
The dimeBlock class handles a BLOCK entity.
Definition: Block.h:42
virtual bool write(dimeOutput *const out)
Definition: Entity.cpp:267
virtual bool handleRecord(const int groupcode, const dimeParam &param, dimeMemHandler *const memhandler)
Definition: Entity.cpp:653
The dimeOutput class handles writing of DXF and DXB files.
Definition: Output.h:38
virtual bool read(dimeInput *const in)
Definition: Entity.cpp:606
virtual bool traverse(const dimeState *const state, dimeCallback callback, void *userdata)
Definition: Entity.cpp:535

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