Arc.h
1 /**************************************************************************\
2  *
3  * FILE: Arc.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_ARC_H
31 #define DIME_ARC_H
32 
33 #include <dime/Basic.h>
34 #include <dime/entities/ExtrusionEntity.h>
35 #include <dime/util/Linear.h>
36 
37 class DIME_DLL_API dimeArc : public dimeExtrusionEntity
38 {
39 public:
40  dimeArc();
41 
42  void setCenter(const dimeVec3f &c);
43  void getCenter(dimeVec3f &c) const;
44  void setRadius(const dxfdouble r);
45  dxfdouble getRadius() const;
46  void setStartAngle(const dxfdouble a);
47  dxfdouble getStartAngle() const;
48  void setEndAngle(const dxfdouble a);
49  dxfdouble getEndAngle() const;
50 
51  virtual bool getRecord(const int groupcode,
52  dimeParam &param,
53  const int index = 0) const;
54  virtual const char *getEntityName() const;
55 
56  virtual dimeEntity *copy(dimeModel * const model) const;
57 
58  virtual void print() const;
59  virtual bool write(dimeOutput * const out);
60  virtual int typeId() const;
61  virtual int countRecords() const;
62 
63  virtual GeometryType extractGeometry(dimeArray <dimeVec3f> &verts,
64  dimeArray <int> &indices,
65  dimeVec3f &extrusionDir,
66  dxfdouble &thickness);
67 
68 protected:
69  virtual bool handleRecord(const int groupcode,
70  const dimeParam &param,
71  dimeMemHandler * const memhandler);
72 
73 private:
74  dimeVec3f center;
75  dxfdouble radius;
76  dxfdouble startAngle;
77  dxfdouble endAngle;
78 
79 }; // class dimeArc
80 
81 //
82 // inline methods
83 //
84 
85 inline void
86 dimeArc::setCenter(const dimeVec3f &c)
87 {
88  this->center = c;
89 }
90 
91 inline void
92 dimeArc::getCenter(dimeVec3f &c) const
93 {
94  c = this->center;
95 }
96 
97 inline void
98 dimeArc::setRadius(const dxfdouble r)
99 {
100  this->radius = r;
101 }
102 
103 inline dxfdouble
104 dimeArc::getRadius() const
105 {
106  return this->radius;
107 }
108 
109 inline void
110 dimeArc::setStartAngle(const dxfdouble a)
111 {
112  this->startAngle = a;
113 }
114 
115 inline dxfdouble
116 dimeArc::getStartAngle() const
117 {
118  return this->startAngle;
119 }
120 
121 inline void
122 dimeArc::setEndAngle(const dxfdouble a)
123 {
124  this->endAngle = a;
125 }
126 
127 inline dxfdouble
128 dimeArc::getEndAngle() const
129 {
130  return this->endAngle;
131 }
132 
133 #endif // ! DIME_ARC_H
134 

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