00001 /*************************************************************************** 00002 * Copyright (c) 2007 Werner Mayer <wmayer[at]users.sourceforge.net> * 00003 * * 00004 * This file is part of the FreeCAD CAx development system. * 00005 * * 00006 * This library is free software; you can redistribute it and/or * 00007 * modify it under the terms of the GNU Library General Public * 00008 * License as published by the Free Software Foundation; either * 00009 * version 2 of the License, or (at your option) any later version. * 00010 * * 00011 * This library is distributed in the hope that it will be useful, * 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00014 * GNU Library General Public License for more details. * 00015 * * 00016 * You should have received a copy of the GNU Library General Public * 00017 * License along with this library; see the file COPYING.LIB. If not, * 00018 * write to the Free Software Foundation, Inc., 59 Temple Place, * 00019 * Suite 330, Boston, MA 02111-1307, USA * 00020 * * 00021 ***************************************************************************/ 00022 00023 00024 #ifndef PART_PRIMITIVEFEATURE_H 00025 #define PART_PRIMITIVEFEATURE_H 00026 00027 #include <App/PropertyUnits.h> 00028 #include "PartFeature.h" 00029 00030 namespace Part 00031 { 00032 00033 class PartExport Primitive : public Part::Feature 00034 { 00035 PROPERTY_HEADER(Part::Primitive); 00036 00037 public: 00038 Primitive(); 00039 virtual ~Primitive(); 00040 00043 00044 App::DocumentObjectExecReturn *execute(void) = 0; 00045 short mustExecute() const; 00047 00048 protected: 00049 void onChanged (const App::Property* prop); 00050 }; 00051 00052 class PartExport Vertex : public Part::Primitive 00053 { 00054 PROPERTY_HEADER(Part::Vertex); 00055 00056 public: 00057 Vertex(); 00058 virtual ~Vertex(); 00059 00060 App::PropertyFloat X; 00061 App::PropertyFloat Y; 00062 App::PropertyFloat Z; 00063 00066 00067 App::DocumentObjectExecReturn *execute(void); 00068 short mustExecute() const; 00069 void onChanged(const App::Property*); 00071 }; 00072 00073 class PartExport Plane : public Primitive 00074 { 00075 PROPERTY_HEADER(Part::Plane); 00076 00077 public: 00078 Plane(); 00079 00080 App::PropertyLength Length; 00081 App::PropertyLength Width; 00082 00085 00086 App::DocumentObjectExecReturn *execute(void); 00087 short mustExecute() const; 00089 }; 00090 00091 class PartExport Sphere : public Primitive 00092 { 00093 PROPERTY_HEADER(Part::Sphere); 00094 00095 public: 00096 Sphere(); 00097 00098 App::PropertyFloatConstraint Radius; 00099 App::PropertyFloatConstraint Angle1; 00100 App::PropertyFloatConstraint Angle2; 00101 App::PropertyFloatConstraint Angle3; 00102 00105 00106 App::DocumentObjectExecReturn *execute(void); 00107 short mustExecute() const; 00109 }; 00110 00111 class PartExport Ellipsoid : public Primitive 00112 { 00113 PROPERTY_HEADER(Part::Ellipsoid); 00114 00115 public: 00116 Ellipsoid(); 00117 00118 App::PropertyFloatConstraint Radius1; 00119 App::PropertyFloatConstraint Radius2; 00120 App::PropertyFloatConstraint Angle1; 00121 App::PropertyFloatConstraint Angle2; 00122 App::PropertyFloatConstraint Angle3; 00123 00126 00127 App::DocumentObjectExecReturn *execute(void); 00128 short mustExecute() const; 00130 virtual const char* getViewProviderName(void) const { 00131 return "PartGui::ViewProviderEllipsoid"; 00132 } 00133 }; 00134 00135 class PartExport Cylinder : public Primitive 00136 { 00137 PROPERTY_HEADER(Part::Cylinder); 00138 00139 public: 00140 Cylinder(); 00141 00142 App::PropertyLength Radius; 00143 App::PropertyLength Height; 00144 App::PropertyFloatConstraint Angle; 00145 00148 00149 App::DocumentObjectExecReturn *execute(void); 00150 short mustExecute() const; 00152 }; 00153 00154 class PartExport Cone : public Primitive 00155 { 00156 PROPERTY_HEADER(Part::Cone); 00157 00158 public: 00159 Cone(); 00160 00161 App::PropertyLength Radius1; 00162 App::PropertyLength Radius2; 00163 App::PropertyLength Height; 00164 App::PropertyFloatConstraint Angle; 00165 00168 00169 App::DocumentObjectExecReturn *execute(void); 00170 short mustExecute() const; 00172 }; 00173 00174 class PartExport Torus : public Primitive 00175 { 00176 PROPERTY_HEADER(Part::Torus); 00177 00178 public: 00179 Torus(); 00180 00181 App::PropertyFloatConstraint Radius1; 00182 App::PropertyFloatConstraint Radius2; 00183 App::PropertyFloatConstraint Angle1; 00184 App::PropertyFloatConstraint Angle2; 00185 App::PropertyFloatConstraint Angle3; 00186 00189 00190 App::DocumentObjectExecReturn *execute(void); 00191 short mustExecute() const; 00193 }; 00194 00195 class PartExport Helix : public Primitive 00196 { 00197 PROPERTY_HEADER(Part::Helix); 00198 00199 public: 00200 Helix(); 00201 00202 App::PropertyFloatConstraint Pitch; 00203 App::PropertyFloatConstraint Height; 00204 App::PropertyFloatConstraint Radius; 00205 App::PropertyFloatConstraint Angle; 00206 00209 00210 App::DocumentObjectExecReturn *execute(void); 00211 short mustExecute() const; 00213 }; 00214 00215 class PartExport Wedge : public Primitive 00216 { 00217 PROPERTY_HEADER(Part::Wedge); 00218 00219 public: 00220 Wedge(); 00221 00222 App::PropertyFloat Xmin; 00223 App::PropertyFloat Ymin; 00224 App::PropertyFloat Zmin; 00225 App::PropertyFloat Z2min; 00226 App::PropertyFloat X2min; 00227 App::PropertyFloat Xmax; 00228 App::PropertyFloat Ymax; 00229 App::PropertyFloat Zmax; 00230 App::PropertyFloat Z2max; 00231 App::PropertyFloat X2max; 00232 00235 00236 App::DocumentObjectExecReturn *execute(void); 00237 short mustExecute() const; 00239 00240 protected: 00241 void onChanged(const App::Property* prop); 00242 }; 00243 00244 } //namespace Part 00245 00246 00247 #endif // PART_PRIMITIVEFEATURE_H