PropertyTopoShape.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) Jürgen Riegel          (juergen.riegel@web.de) 2008     *
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 PROPERTYTOPOSHAPE_H
00025 #define PROPERTYTOPOSHAPE_H
00026 
00027 #include "TopoShape.h"
00028 #include <App/DocumentObject.h>
00029 #include <App/PropertyGeo.h>
00030 
00031 namespace Part
00032 {
00033 
00034 class Property;
00035 
00039 class PartExport PropertyPartShape : public App::PropertyComplexGeoData
00040 {
00041     TYPESYSTEM_HEADER();
00042 
00043 public:
00044     PropertyPartShape();
00045     ~PropertyPartShape();
00046 
00049 
00050     void setValue(const TopoShape&);
00052     void setValue(const TopoDS_Shape&);
00054     const TopoDS_Shape& getValue(void) const;
00055     const TopoShape& getShape() const;
00056     const Data::ComplexGeoData* getComplexData() const;
00058 
00061 
00062     void transformGeometry(const Base::Matrix4D &rclMat);
00064 
00068     Base::BoundBox3d getBoundingBox() const;
00070     virtual void getFaces(std::vector<Base::Vector3d> &Points,
00071         std::vector<Data::ComplexGeoData::Facet> &Topo,
00072         float Accuracy, uint16_t flags=0) const;
00074 
00077     PyObject* getPyObject(void);
00078     void setPyObject(PyObject *value);
00080 
00083     void Save (Base::Writer &writer) const;
00084     void Restore(Base::XMLReader &reader);
00085 
00086     void SaveDocFile (Base::Writer &writer) const;
00087     void RestoreDocFile(Base::Reader &reader);
00088 
00089     App::Property *Copy(void) const;
00090     void Paste(const App::Property &from);
00091     unsigned int getMemSize (void) const;
00093 
00094 private:
00095     TopoShape _Shape;
00096 };
00097 
00101 struct PartExport FilletElement {
00102     int edgeid;
00103     double radius1, radius2;
00104 };
00105 
00106 class PartExport PropertyFilletEdges : public App::PropertyLists
00107 {
00108     TYPESYSTEM_HEADER();
00109 
00110 public:
00111     PropertyFilletEdges();
00112     ~PropertyFilletEdges();
00113 
00114     virtual void setSize(int newSize) {
00115         _lValueList.resize(newSize);
00116     }
00117     virtual int getSize(void) const {
00118         return _lValueList.size();
00119     }
00120 
00123     void setValue(int id, double r1, double r2);
00124 
00125     void setValues (const std::vector<FilletElement>& values);
00126 
00127     const std::vector<FilletElement> &getValues(void) const {
00128         return _lValueList;
00129     }
00130 
00131     virtual PyObject *getPyObject(void);
00132     virtual void setPyObject(PyObject *);
00133 
00134     virtual void Save (Base::Writer &writer) const;
00135     virtual void Restore(Base::XMLReader &reader);
00136 
00137     virtual void SaveDocFile (Base::Writer &writer) const;
00138     virtual void RestoreDocFile(Base::Reader &reader);
00139 
00140     virtual Property *Copy(void) const;
00141     virtual void Paste(const Property &from);
00142 
00143     virtual unsigned int getMemSize (void) const {
00144         return _lValueList.size() * sizeof(FilletElement);
00145     }
00146 
00147 private:
00148     std::vector<FilletElement> _lValueList;
00149 };
00150 
00151 } //namespace Part
00152 
00153 
00154 #endif // PROPERTYTOPOSHAPE_H

Generated on Wed Nov 23 19:00:31 2011 for FreeCAD by  doxygen 1.6.1