Ellipse.h
1 /**************************************************************************\
2  *
3  * FILE: Ellipse.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_ELLIPSE_H
31 #define DIME_ELLIPSE_H
32 
33 #include <dime/Basic.h>
34 #include <dime/entities/ExtrusionEntity.h>
35 #include <dime/util/Linear.h>
36 
37 //
38 // please note that the thickness will always be 0.0 for this entity
39 //
40 
41 class DIME_DLL_API dimeEllipse : public dimeExtrusionEntity
42 {
43 public:
44  dimeEllipse();
45 
46  void setCenter(const dimeVec3f &c);
47  const dimeVec3f &getCenter() const;
48 
49  void setMajorAxisEndpoint(const dimeVec3f &v);
50  const dimeVec3f &getMajorAxisEndpoint() const;
51 
52  void setMinorMajorRatio(const dxfdouble ratio);
53  dxfdouble getMinorMajorRatio() const;
54 
55  void setStartParam(const dxfdouble p);
56  dxfdouble getStartParam() const;
57 
58  void setEndParam(const dxfdouble p);
59  dxfdouble getEndParam() const;
60 
61  virtual dimeEntity *copy(dimeModel * const model) const;
62  virtual bool getRecord(const int groupcode,
63  dimeParam &param,
64  const int index = 0) const;
65  virtual const char *getEntityName() const;
66  virtual void print() const;
67  virtual bool write(dimeOutput * const out);
68  virtual int typeId() const;
69  virtual int countRecords() const;
70 
71 protected:
72  virtual bool handleRecord(const int groupcode,
73  const dimeParam &param,
74  dimeMemHandler * const memhandler);
75 private:
76  dimeVec3f center;
77  dimeVec3f majorAxisEndpoint;
78  dxfdouble ratio;
79  dxfdouble startParam;
80  dxfdouble endParam;
81 
82 }; // class dimeEllipse
83 
84 inline const dimeVec3f &
86 {
87  return this->center;
88 }
89 
90 inline void
92 {
93  this->center = c;
94 }
95 
96 inline void
98 {
99  this->majorAxisEndpoint = v;
100 }
101 
102 inline const dimeVec3f &
104 {
105  return this->majorAxisEndpoint;
106 }
107 
108 inline void
109 dimeEllipse::setMinorMajorRatio(const dxfdouble ratio)
110 {
111  this->ratio = ratio;
112 }
113 
114 inline dxfdouble
116 {
117  return this->ratio;
118 }
119 
120 inline void
121 dimeEllipse::setStartParam(const dxfdouble p)
122 {
123  this->startParam = p;
124 }
125 
126 inline dxfdouble
128 {
129  return this->startParam;
130 }
131 
132 inline void
133 dimeEllipse::setEndParam(const dxfdouble p)
134 {
135  this->endParam = p;
136 }
137 
138 inline dxfdouble
140 {
141  return this->endParam;
142 }
143 
144 #endif // ! DIME_ELLIPSE_H
145 
void setCenter(const dimeVec3f &c)
Definition: Ellipse.h:91
void setStartParam(const dxfdouble p)
Definition: Ellipse.h:121
virtual int typeId() const
Definition: ExtrusionEntity.cpp:93
const dimeVec3f & getMajorAxisEndpoint() const
Definition: Ellipse.h:103
const dimeVec3f & getCenter() const
Definition: Ellipse.h:85
The dimeMemHandler class is a special-purpose memory manager.
Definition: MemHandler.h:35
virtual int countRecords() const
Definition: ExtrusionEntity.cpp:110
virtual dimeEntity * copy(dimeModel *const model) const =0
dxfdouble getStartParam() const
Definition: Ellipse.h:127
dxfdouble getEndParam() const
Definition: Ellipse.h:139
dxfdouble getMinorMajorRatio() const
Definition: Ellipse.h:115
The dimeEntity class is the superclass of all entity classes.
Definition: Entity.h:57
void setMinorMajorRatio(const dxfdouble ratio)
Definition: Ellipse.h:109
The dimeModel class organizes a model.
Definition: Model.h:51
virtual const char * getEntityName() const =0
The dimeVec3f class is for containing and operating on a 3D vector / coordinate.
Definition: Linear.h:56
The dimeParam class is a union of the different parameter types.
Definition: Basic.h:97
The dimeEllipse class handles an ELLIPSE entity.
Definition: Ellipse.h:41
void setEndParam(const dxfdouble p)
Definition: Ellipse.h:133
void setMajorAxisEndpoint(const dimeVec3f &v)
Definition: Ellipse.h:97
The dimeExtrusionEntity class is the superclass of all entity classes with extrusion data...
Definition: ExtrusionEntity.h:35
virtual bool write(dimeOutput *const out)
Definition: Entity.cpp:267
The dimeOutput class handles writing of DXF and DXB files.
Definition: Output.h:38
virtual bool getRecord(const int groupcode, dimeParam &param, const int index=0) const
Definition: ExtrusionEntity.cpp:152
virtual bool handleRecord(const int groupcode, const dimeParam &param, dimeMemHandler *const memhandler)
Definition: ExtrusionEntity.cpp:132

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