00001 /**************************************************************************\ 00002 * 00003 * FILE: Ellipse.h 00004 * 00005 * This source file is part of DIME. 00006 * Copyright (C) 1998-1999 by Systems In Motion. All rights reserved. 00007 * 00008 * This library is free software; you can redistribute it and/or modify it 00009 * under the terms of the GNU General Public License, version 2, as 00010 * published by the Free Software Foundation. 00011 * 00012 * This library is distributed in the hope that it will be useful, but 00013 * WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * General Public License (the accompanying file named COPYING) for more 00016 * details. 00017 * 00018 ************************************************************************** 00019 * 00020 * If you need DIME for a non-GPL project, contact Systems In Motion 00021 * to acquire a Professional Edition License: 00022 * 00023 * Systems In Motion http://www.sim.no/ 00024 * Prof. Brochs gate 6 sales@sim.no 00025 * N-7030 Trondheim Voice: +47 22114160 00026 * NORWAY Fax: +47 67172912 00027 * 00028 \**************************************************************************/ 00029 00030 #ifndef DIME_ELLIPSE_H 00031 #define DIME_ELLIPSE_H 00032 00033 #include <dime/Basic.h> 00034 #include <dime/entities/ExtrusionEntity.h> 00035 #include <dime/util/Linear.h> 00036 00037 // 00038 // please note that the thickness will always be 0.0 for this entity 00039 // 00040 00041 class dimeEllipse : public dimeExtrusionEntity 00042 { 00043 public: 00044 dimeEllipse(); 00045 00046 void setCenter(const dimeVec3f &c); 00047 const dimeVec3f &getCenter() const; 00048 00049 void setMajorAxisEndpoint(const dimeVec3f &v); 00050 const dimeVec3f &getMajorAxisEndpoint() const; 00051 00052 void setMinorMajorRatio(const dxfdouble ratio); 00053 dxfdouble getMinorMajorRatio() const; 00054 00055 void setStartParam(const dxfdouble p); 00056 dxfdouble getStartParam() const; 00057 00058 void setEndParam(const dxfdouble p); 00059 dxfdouble getEndParam() const; 00060 00061 virtual dimeEntity *copy(dimeModel * const model) const; 00062 virtual bool getRecord(const int groupcode, 00063 dimeParam ¶m, 00064 const int index = 0) const; 00065 virtual const char *getEntityName() const; 00066 virtual void print() const; 00067 virtual bool write(dimeOutput * const out); 00068 virtual int typeId() const; 00069 virtual int countRecords() const; 00070 00071 protected: 00072 virtual bool handleRecord(const int groupcode, 00073 const dimeParam ¶m, 00074 dimeMemHandler * const memhandler); 00075 private: 00076 dimeVec3f center; 00077 dimeVec3f majorAxisEndpoint; 00078 dxfdouble ratio; 00079 dxfdouble startParam; 00080 dxfdouble endParam; 00081 00082 }; // class dimeEllipse 00083 00084 inline const dimeVec3f & 00085 dimeEllipse::getCenter() const 00086 { 00087 return this->center; 00088 } 00089 00090 inline void 00091 dimeEllipse::setCenter(const dimeVec3f &c) 00092 { 00093 this->center = c; 00094 } 00095 00096 inline void 00097 dimeEllipse::setMajorAxisEndpoint(const dimeVec3f &v) 00098 { 00099 this->majorAxisEndpoint = v; 00100 } 00101 00102 inline const dimeVec3f & 00103 dimeEllipse::getMajorAxisEndpoint() const 00104 { 00105 return this->majorAxisEndpoint; 00106 } 00107 00108 inline void 00109 dimeEllipse::setMinorMajorRatio(const dxfdouble ratio) 00110 { 00111 this->ratio = ratio; 00112 } 00113 00114 inline dxfdouble 00115 dimeEllipse::getMinorMajorRatio() const 00116 { 00117 return this->ratio; 00118 } 00119 00120 inline void 00121 dimeEllipse::setStartParam(const dxfdouble p) 00122 { 00123 this->startParam = p; 00124 } 00125 00126 inline dxfdouble 00127 dimeEllipse::getStartParam() const 00128 { 00129 return this->startParam; 00130 } 00131 00132 inline void 00133 dimeEllipse::setEndParam(const dxfdouble p) 00134 { 00135 this->endParam = p; 00136 } 00137 00138 inline dxfdouble 00139 dimeEllipse::getEndParam() const 00140 { 00141 return this->endParam; 00142 } 00143 00144 #endif // ! DIME_ELLIPSE_H 00145