Arc.h

00001 /**************************************************************************\
00002  * 
00003  *  FILE: Arc.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_ARC_H
00031 #define DIME_ARC_H
00032   
00033 #include <dime/Basic.h>
00034 #include <dime/entities/ExtrusionEntity.h>
00035 #include <dime/util/Linear.h>
00036 
00037 class DIME_DLL_API dimeArc : public dimeExtrusionEntity
00038 {
00039 public:
00040   dimeArc();
00041 
00042   void setCenter(const dimeVec3f &c);
00043   void getCenter(dimeVec3f &c) const;
00044   void setRadius(const dxfdouble r);
00045   dxfdouble getRadius() const;
00046   void setStartAngle(const dxfdouble a);
00047   dxfdouble getStartAngle() const;
00048   void setEndAngle(const dxfdouble a);
00049   dxfdouble getEndAngle() const;
00050   
00051   virtual bool getRecord(const int groupcode,
00052                          dimeParam &param,
00053                          const int index = 0) const;
00054   virtual const char *getEntityName() const;
00055 
00056   virtual dimeEntity *copy(dimeModel * const model) const;
00057   
00058   virtual void print() const;
00059   virtual bool write(dimeOutput * const out);
00060   virtual int typeId() const;
00061   virtual int countRecords() const;
00062   
00063   virtual GeometryType extractGeometry(dimeArray <dimeVec3f> &verts,
00064                                        dimeArray <int> &indices,
00065                                        dimeVec3f &extrusionDir,
00066                                        dxfdouble &thickness);
00067   
00068 protected:
00069   virtual bool handleRecord(const int groupcode, 
00070                             const dimeParam &param,
00071                             dimeMemHandler * const memhandler);
00072     
00073 private:
00074   dimeVec3f center;
00075   dxfdouble radius;
00076   dxfdouble startAngle;
00077   dxfdouble endAngle;
00078 
00079 }; // class dimeArc
00080 
00081 //
00082 // inline methods
00083 //
00084 
00085 inline void 
00086 dimeArc::setCenter(const dimeVec3f &c)
00087 {
00088   this->center = c;
00089 }
00090 
00091 inline void 
00092 dimeArc::getCenter(dimeVec3f &c) const
00093 {
00094   c = this->center;
00095 }
00096 
00097 inline void 
00098 dimeArc::setRadius(const dxfdouble r)
00099 {
00100   this->radius = r;
00101 }
00102 
00103 inline dxfdouble 
00104 dimeArc::getRadius() const
00105 {
00106   return this->radius;
00107 }
00108 
00109 inline void 
00110 dimeArc::setStartAngle(const dxfdouble a)
00111 {
00112   this->startAngle = a;
00113 }
00114 
00115 inline dxfdouble 
00116 dimeArc::getStartAngle() const
00117 {
00118   return this->startAngle;
00119 }
00120 
00121 inline void 
00122 dimeArc::setEndAngle(const dxfdouble a)
00123 {
00124   this->endAngle = a;
00125 }
00126 
00127 inline dxfdouble 
00128 dimeArc::getEndAngle() const
00129 {
00130   return this->endAngle;
00131 }
00132  
00133 #endif // ! DIME_ARC_H
00134 

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