Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
https://bitbucket.org/Coin3D/
http://www.kongsberg.com/kogt/
LWPolyline.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_LWPOLYLINE_H
34 #define DIME_LWPOLYLINE_H
35 
36 #include <dime/entities/ExtrusionEntity.h>
37 
38 class DIME_DLL_API dimeLWPolyline : public dimeExtrusionEntity
39 {
40 public:
42  virtual ~dimeLWPolyline();
43 
44  virtual dimeEntity *copy(dimeModel * const model) const;
45  virtual bool getRecord(const int groupcode,
46  dimeParam &param,
47  const int index) const;
48  virtual const char *getEntityName() const;
49 
50  virtual void print() const;
51  virtual bool write(dimeOutput * const out);
52  virtual int typeId() const;
53  virtual int countRecords() const;
54 
55  virtual GeometryType extractGeometry(dimeArray <dimeVec3f> &verts,
56  dimeArray <int> &indices,
57  dimeVec3f &extrusionDir,
58  dxfdouble &thickness);
59  int getNumVertices() const;
60  const dxfdouble *getXCoords() const;
61  const dxfdouble *getYCoords() const;
62  const dxfdouble *getStartingWidths() const;
63  const dxfdouble *getEndWidths() const;
64  const dxfdouble *getBulges() const;
65 
66  dxfdouble getElevation() const;
67  dxfdouble getConstantWidth() const;
68  int16 getFlags() const;
69 
70 protected:
71  virtual bool handleRecord(const int groupcode,
72  const dimeParam &param,
73  dimeMemHandler * const memhandler);
74 
75 private:
76  dxfdouble constantWidth;
77  dxfdouble elevation;
78  int16 flags;
79  int32 numVertices;
80  int16 tmpCounter; // used during loading only
81  int16 tmpFlags; // ""
82  dxfdouble *xcoord;
83  dxfdouble *ycoord;
84  dxfdouble *startingWidth;
85  dxfdouble *endWidth;
86  dxfdouble *bulge;
87 
88 }; // class dimeLWPolyLine
89 
90 
91 inline int
92 dimeLWPolyline::getNumVertices() const
93 {
94  return this->numVertices;
95 }
96 
97 inline const dxfdouble *
98 dimeLWPolyline::getXCoords() const
99 {
100  return this->xcoord;
101 }
102 inline const dxfdouble *
103 dimeLWPolyline::getYCoords() const
104 {
105  return this->ycoord;
106 }
107 
108 inline const dxfdouble *
109 dimeLWPolyline::getStartingWidths() const
110 {
111  return this->startingWidth;
112 
113 }
114 
115 inline const dxfdouble *
116 dimeLWPolyline::getEndWidths() const
117 {
118  return this->endWidth;
119 }
120 
121 inline const dxfdouble *
122 dimeLWPolyline::getBulges() const
123 {
124  return this->bulge;
125 }
126 
127 inline dxfdouble
128 dimeLWPolyline::getElevation() const
129 {
130  return this->elevation;
131 }
132 
133 inline dxfdouble
134 dimeLWPolyline::getConstantWidth() const
135 {
136  return this->constantWidth;
137 }
138 
139 inline int16
140 dimeLWPolyline::getFlags() const
141 {
142  return this->flags;
143 }
144 
145 
146 #endif // ! DIME_LWPOLYLINE_H
147 
The dimeMemHandler class is a special-purpose memory manager.
Definition: MemHandler.h:38
The dimeLWPolyline class handles an LWPOLYLINE entity.
Definition: LWPolyline.h:38
virtual dimeEntity * copy(dimeModel *const model) const =0
virtual int countRecords() const
Definition: ExtrusionEntity.cpp:113
virtual int typeId() const
Definition: ExtrusionEntity.cpp:96
The dimeEntity class is the superclass of all entity classes.
Definition: Entity.h:60
The dimeModel class organizes a model.
Definition: Model.h:54
virtual const char * getEntityName() const =0
The dimeVec3f class is for containing and operating on a 3D vector / coordinate.
Definition: Linear.h:61
The dimeParam class is a union of the different parameter types.
Definition: Basic.h:102
The dimeExtrusionEntity class is the superclass of all entity classes with extrusion data...
Definition: ExtrusionEntity.h:38
virtual GeometryType extractGeometry(dimeArray< dimeVec3f > &verts, dimeArray< int > &indices, dimeVec3f &extrusionDir, dxfdouble &thickness)
Definition: Entity.cpp:583
virtual bool write(dimeOutput *const out)
Definition: Entity.cpp:271
virtual bool getRecord(const int groupcode, dimeParam &param, const int index=0) const
Definition: ExtrusionEntity.cpp:155
The dimeOutput class handles writing of DXF and DXB files.
Definition: Output.h:41
virtual bool handleRecord(const int groupcode, const dimeParam &param, dimeMemHandler *const memhandler)
Definition: ExtrusionEntity.cpp:135