| http://www.coin3d.org/ http://www.kongsberg.com/kogt/

Insert.h
1 /**************************************************************************\
2 * Copyright (c) Kongsberg Oil & Gas Technologies AS
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
8 *
9 * Redistributions of source code must retain the above copyright notice,
10 * this list of conditions and the following disclaimer.
11 *
12 * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * Neither the name of the copyright holder nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 \**************************************************************************/
32
33 #ifndef DIME_INSERT_H
34 #define DIME_INSERT_H
35
36 #include <dime/Basic.h>
37 #include <dime/entities/Entity.h>
38 #include <dime/util/Linear.h>
39
40 class dimeBlock;
41
42 class DIME_DLL_API dimeInsert : public dimeEntity
43 {
44 friend class dimeEntitiesSection;
45 friend class dimeBlocksSection;
46
47 public:
48 dimeInsert();
49 virtual ~dimeInsert();
50
51 void setBlock(dimeBlock * const block);
52 dimeBlock * getBlock() const;
53
54 virtual dimeEntity *copy(dimeModel * const model) const;
55 virtual bool getRecord(const int groupcode,
56 dimeParam &param,
57 const int index = 0) const;
58 virtual const char *getEntityName() const;
59
60 virtual bool read(dimeInput * const in);
61 virtual bool write(dimeOutput * const out);
62 virtual int typeId() const;
63 virtual int countRecords() const;
64
65 void setInsertionPoint(const dimeVec3f &v);
66 const dimeVec3f &getInsertionPoint() const;
67
68 void setScale(const dimeVec3f &v);
69 const dimeVec3f & getScale() const;
70
71 void setRotAngle(dxfdouble angle);
72 dxfdouble getRotAngle() const;
73
74 // FIXME: more set and get methods
75
76 protected:
77 virtual void fixReferences(dimeModel * const model);
78 virtual bool handleRecord(const int groupcode,
79 const dimeParam &param,
80 dimeMemHandler * const memhandler);
81 virtual bool traverse(const dimeState * const state,
82 dimeCallback callback,
83 void *userdata);
84
85 private:
86 void makeMatrix(dimeMatrix &m) const;
87
88 int16 attributesFollow;
89 const char *blockName;
90 dimeVec3f insertionPoint;
91 dimeVec3f extrusionDir;
92 dimeVec3f scale;
93 dxfdouble rotAngle;
94 dimeEntity **entities;
95 int numEntities;
96 #ifdef DIME_FIXBIG
97 int32 rowCount;
98 #else
99 int16 rowCount;
100 #endif
101 int16 columnCount;
102 dxfdouble rowSpacing;
103 dxfdouble columnSpacing;
104 dimeEntity *seqend;
105 dimeBlock *block;
106
107 }; // class dimeInsert
108
109
110
111 inline void
112 dimeInsert::setInsertionPoint(const dimeVec3f &v)
113 {
114 this->insertionPoint = v;
115 }
116
117 inline const dimeVec3f &
118 dimeInsert::getInsertionPoint() const
119 {
120 return this->insertionPoint;
121 }
122
123 inline dimeBlock *
124 dimeInsert::getBlock() const
125 {
126 return this->block;
127 }
128
129 inline void
130 dimeInsert::setScale(const dimeVec3f &v)
131 {
132 this->scale = v;
133 }
134
135 inline const dimeVec3f &
136 dimeInsert::getScale() const
137 {
138 return this->scale;
139 }
140
141 inline void
142 dimeInsert::setRotAngle(dxfdouble angle)
143 {
144 this->rotAngle = angle;
145 }
146
147 inline dxfdouble
148 dimeInsert::getRotAngle() const
149 {
150 return this->rotAngle;
151 }
152
153
154 #endif // ! DIME_INSERT_H
155
dimeState
The dimeState class manages various state variables while the model is traversed. ...
Definition: State.h:40
dimeBlocksSection
The dimeBlocksSection class handles a BLOCKS section.
Definition: BlocksSection.h:39
dimeMemHandler
The dimeMemHandler class is a special-purpose memory manager.
Definition: MemHandler.h:38
dimeBase::typeId
virtual int typeId() const =0
dimeEntity::countRecords
virtual int countRecords() const
Definition: Entity.cpp:526
dimeEntity::copy
virtual dimeEntity * copy(dimeModel *const model) const =0
dimeBlocksSection::getBlock
class dimeBlock * getBlock(const int idx)
Definition: BlocksSection.cpp:200
dimeEntity
The dimeEntity class is the superclass of all entity classes.
Definition: Entity.h:60
dimeModel
The dimeModel class organizes a model.
Definition: Model.h:54
dimeEntity::getEntityName
virtual const char * getEntityName() const =0
dimeEntitiesSection
The dimeEntitiesSection class handles an ENTITIES section.
Definition: EntitiesSection.h:39
dimeInput
The dimeInput class offers transparent file I/O for DXF and DXB.
Definition: Input.h:41
dimeVec3f
The dimeVec3f class is for containing and operating on a 3D vector / coordinate.
Definition: Linear.h:61
dimeEntity::fixReferences
virtual void fixReferences(dimeModel *const model)
Definition: Entity.cpp:476
dimeParam
The dimeParam class is a union of the different parameter types.
Definition: Basic.h:102
dimeInsert
The dimeInsert class handles an INSERT entity.
Definition: Insert.h:42
dimeMatrix
The dimeMatrix class is for containing and operating on a four-by-four matrix.
Definition: Linear.h:158
dimeEntity::getRecord
virtual bool getRecord(const int groupcode, dimeParam &param, const int index=0) const
Definition: Entity.cpp:715
dimeBlock
The dimeBlock class handles a BLOCK entity.
Definition: Block.h:45
dimeEntity::write
virtual bool write(dimeOutput *const out)
Definition: Entity.cpp:271
dimeEntity::handleRecord
virtual bool handleRecord(const int groupcode, const dimeParam &param, dimeMemHandler *const memhandler)
Definition: Entity.cpp:659
dimeOutput
The dimeOutput class handles writing of DXF and DXB files.
Definition: Output.h:41
dimeEntity::read
virtual bool read(dimeInput *const in)
Definition: Entity.cpp:612
dimeEntity::traverse
virtual bool traverse(const dimeState *const state, dimeCallback callback, void *userdata)
Definition: Entity.cpp:541

Copyright © by Kongsberg Oil & Gas Technologies. All rights reserved.