HypothesisPy.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) 2010 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 #ifndef FEM_HYPOTHESISPY_H
00024 #define FEM_HYPOTHESISPY_H
00025 
00026 #include <CXX/Extensions.hxx>
00027 #include <boost/shared_ptr.hpp>
00028 
00029 class SMESH_Hypothesis;
00030 class SMESH_Gen;
00031 
00032 namespace Fem {
00033 
00034 class HypothesisPy : public Py::PythonExtension<HypothesisPy>
00035 {
00036 public:
00037     typedef Py::PythonExtension<HypothesisPy> HypothesisPyBase;
00038     HypothesisPy(boost::shared_ptr<SMESH_Hypothesis>);
00039     virtual ~HypothesisPy();
00040     boost::shared_ptr<SMESH_Hypothesis> getHypothesis() const
00041     { return hyp; }
00042 
00043 private:
00044     boost::shared_ptr<SMESH_Hypothesis> hyp;
00045 };
00046 
00047 typedef Py::ExtensionObject<HypothesisPy> Hypothesis;
00048 
00049 template <class T>
00050 class SMESH_HypothesisPy : public Py::PythonExtension<T>
00051 {
00052 public:
00053     typedef SMESH_HypothesisPy<T> SMESH_HypothesisPyBase;
00054     static void init_type(PyObject*);    // announce properties and methods
00055 
00056     SMESH_HypothesisPy(SMESH_Hypothesis*);
00057     virtual ~SMESH_HypothesisPy();
00058 
00059     Py::Object getattr(const char *name);
00060     Py::Object repr();
00061     Py::Object getLibName(const Py::Tuple& args);
00062     Py::Object setLibName(const Py::Tuple& args);
00063     Py::Object setParameters(const Py::Tuple& args);
00064     Py::Object getParameters(const Py::Tuple& args);
00065     Py::Object setLastParameters(const Py::Tuple& args);
00066     Py::Object getLastParameters(const Py::Tuple& args);
00067     Py::Object clearParameters(const Py::Tuple& args);
00068     Py::Object isAuxiliary(const Py::Tuple& args);
00069     Py::Object setParametersByMesh(const Py::Tuple& args);
00070 
00071     boost::shared_ptr<SMESH_Hypothesis> getHypothesis() const
00072     { return hyp; }
00073 
00074 protected:
00075     template<typename type>
00076     type* hypothesis() const
00077     { return static_cast<type*>(hyp.get()); }
00078 
00079 private:
00080     static PyObject *PyMake(struct _typeobject *, PyObject *, PyObject *);
00081 
00082 private:
00083     boost::shared_ptr<SMESH_Hypothesis> hyp;
00084 };
00085 
00086 class StdMeshers_Arithmetic1DPy : public SMESH_HypothesisPy<StdMeshers_Arithmetic1DPy>
00087 {
00088 public:
00089     static void init_type(PyObject*);
00090     StdMeshers_Arithmetic1DPy(int hypId, int studyId, SMESH_Gen* gen);
00091     ~StdMeshers_Arithmetic1DPy();
00092 
00093     Py::Object setLength(const Py::Tuple& args);
00094     Py::Object getLength(const Py::Tuple& args);
00095 };
00096 
00097 class StdMeshers_AutomaticLengthPy : public SMESH_HypothesisPy<StdMeshers_AutomaticLengthPy>
00098 {
00099 public:
00100     static void init_type(PyObject*);
00101     StdMeshers_AutomaticLengthPy(int hypId, int studyId, SMESH_Gen* gen);
00102     ~StdMeshers_AutomaticLengthPy();
00103 
00104     Py::Object setFineness(const Py::Tuple& args);
00105     Py::Object getFineness(const Py::Tuple& args);
00106     Py::Object getLength(const Py::Tuple& args);
00107 };
00108 
00109 class StdMeshers_NotConformAllowedPy : public SMESH_HypothesisPy<StdMeshers_NotConformAllowedPy>
00110 {
00111 public:
00112     static void init_type(PyObject*);
00113     StdMeshers_NotConformAllowedPy(int hypId, int studyId, SMESH_Gen* gen);
00114     ~StdMeshers_NotConformAllowedPy();
00115 };
00116 
00117 class StdMeshers_MaxLengthPy : public SMESH_HypothesisPy<StdMeshers_MaxLengthPy>
00118 {
00119 public:
00120     static void init_type(PyObject*);
00121     StdMeshers_MaxLengthPy(int hypId, int studyId, SMESH_Gen* gen);
00122     ~StdMeshers_MaxLengthPy();
00123 
00124     Py::Object setLength(const Py::Tuple& args);
00125     Py::Object getLength(const Py::Tuple& args);
00126     Py::Object havePreestimatedLength(const Py::Tuple& args);
00127     Py::Object getPreestimatedLength(const Py::Tuple& args);
00128     Py::Object setPreestimatedLength(const Py::Tuple& args);
00129     Py::Object setUsePreestimatedLength(const Py::Tuple& args);
00130     Py::Object getUsePreestimatedLength(const Py::Tuple& args);
00131 };
00132 
00133 class StdMeshers_LocalLengthPy : public SMESH_HypothesisPy<StdMeshers_LocalLengthPy>
00134 {
00135 public:
00136     static void init_type(PyObject*);
00137     StdMeshers_LocalLengthPy(int hypId, int studyId, SMESH_Gen* gen);
00138     ~StdMeshers_LocalLengthPy();
00139 
00140     Py::Object setLength(const Py::Tuple& args);
00141     Py::Object getLength(const Py::Tuple& args);
00142     Py::Object setPrecision(const Py::Tuple& args);
00143     Py::Object getPrecision(const Py::Tuple& args);
00144 };
00145 
00146 class StdMeshers_MaxElementAreaPy : public SMESH_HypothesisPy<StdMeshers_MaxElementAreaPy>
00147 {
00148 public:
00149     static void init_type(PyObject*);
00150     StdMeshers_MaxElementAreaPy(int hypId, int studyId, SMESH_Gen* gen);
00151     ~StdMeshers_MaxElementAreaPy();
00152 
00153     Py::Object setMaxArea(const Py::Tuple& args);
00154     Py::Object getMaxArea(const Py::Tuple& args);
00155 };
00156 
00157 class StdMeshers_QuadranglePreferencePy : public SMESH_HypothesisPy<StdMeshers_QuadranglePreferencePy>
00158 {
00159 public:
00160     static void init_type(PyObject*);
00161     StdMeshers_QuadranglePreferencePy(int hypId, int studyId, SMESH_Gen* gen);
00162     ~StdMeshers_QuadranglePreferencePy();
00163 };
00164 
00165 class StdMeshers_Quadrangle_2DPy : public SMESH_HypothesisPy<StdMeshers_Quadrangle_2DPy>
00166 {
00167 public:
00168     static void init_type(PyObject*);
00169     StdMeshers_Quadrangle_2DPy(int hypId, int studyId, SMESH_Gen* gen);
00170     ~StdMeshers_Quadrangle_2DPy();
00171 };
00172 
00173 class StdMeshers_Regular_1DPy : public SMESH_HypothesisPy<StdMeshers_Regular_1DPy>
00174 {
00175 public:
00176     static void init_type(PyObject*);
00177     StdMeshers_Regular_1DPy(int hypId, int studyId, SMESH_Gen* gen);
00178     ~StdMeshers_Regular_1DPy();
00179 };
00180 
00181 class StdMeshers_UseExisting_1DPy : public SMESH_HypothesisPy<StdMeshers_UseExisting_1DPy>
00182 {
00183 public:
00184     static void init_type(PyObject*);
00185     StdMeshers_UseExisting_1DPy(int hypId, int studyId, SMESH_Gen* gen);
00186     ~StdMeshers_UseExisting_1DPy();
00187 };
00188 
00189 class StdMeshers_UseExisting_2DPy : public SMESH_HypothesisPy<StdMeshers_UseExisting_2DPy>
00190 {
00191 public:
00192     static void init_type(PyObject*);
00193     StdMeshers_UseExisting_2DPy(int hypId, int studyId, SMESH_Gen* gen);
00194     ~StdMeshers_UseExisting_2DPy();
00195 };
00196 
00197 class StdMeshers_CompositeSegment_1DPy : public SMESH_HypothesisPy<StdMeshers_CompositeSegment_1DPy>
00198 {
00199 public:
00200     static void init_type(PyObject*);
00201     StdMeshers_CompositeSegment_1DPy(int hypId, int studyId, SMESH_Gen* gen);
00202     ~StdMeshers_CompositeSegment_1DPy();
00203 };
00204 
00205 class StdMeshers_Deflection1DPy : public SMESH_HypothesisPy<StdMeshers_Deflection1DPy>
00206 {
00207 public:
00208     static void init_type(PyObject*);
00209     StdMeshers_Deflection1DPy(int hypId, int studyId, SMESH_Gen* gen);
00210     ~StdMeshers_Deflection1DPy();
00211 };
00212 
00213 class StdMeshers_Hexa_3DPy : public SMESH_HypothesisPy<StdMeshers_Hexa_3DPy>
00214 {
00215 public:
00216     static void init_type(PyObject*);
00217     StdMeshers_Hexa_3DPy(int hypId, int studyId, SMESH_Gen* gen);
00218     ~StdMeshers_Hexa_3DPy();
00219 };
00220 
00221 class StdMeshers_TrianglePreferencePy : public SMESH_HypothesisPy<StdMeshers_TrianglePreferencePy>
00222 {
00223 public:
00224     static void init_type(PyObject*);
00225     StdMeshers_TrianglePreferencePy(int hypId, int studyId, SMESH_Gen* gen);
00226     ~StdMeshers_TrianglePreferencePy();
00227 };
00228 
00229 class StdMeshers_StartEndLengthPy : public SMESH_HypothesisPy<StdMeshers_StartEndLengthPy>
00230 {
00231 public:
00232     static void init_type(PyObject*);
00233     StdMeshers_StartEndLengthPy(int hypId, int studyId, SMESH_Gen* gen);
00234     ~StdMeshers_StartEndLengthPy();
00235     Py::Object setLength(const Py::Tuple& args);
00236     Py::Object getLength(const Py::Tuple& args);
00237 };
00238 
00239 class StdMeshers_SegmentLengthAroundVertexPy : public SMESH_HypothesisPy<StdMeshers_SegmentLengthAroundVertexPy>
00240 {
00241 public:
00242     static void init_type(PyObject*);
00243     StdMeshers_SegmentLengthAroundVertexPy(int hypId, int studyId, SMESH_Gen* gen);
00244     ~StdMeshers_SegmentLengthAroundVertexPy();
00245     Py::Object setLength(const Py::Tuple& args);
00246     Py::Object getLength(const Py::Tuple& args);
00247 };
00248 
00249 class StdMeshers_SegmentAroundVertex_0DPy : public SMESH_HypothesisPy<StdMeshers_SegmentAroundVertex_0DPy>
00250 {
00251 public:
00252     static void init_type(PyObject*);
00253     StdMeshers_SegmentAroundVertex_0DPy(int hypId, int studyId, SMESH_Gen* gen);
00254     ~StdMeshers_SegmentAroundVertex_0DPy();
00255 };
00256 
00257 class StdMeshers_RadialPrism_3DPy : public SMESH_HypothesisPy<StdMeshers_RadialPrism_3DPy>
00258 {
00259 public:
00260     static void init_type(PyObject*);
00261     StdMeshers_RadialPrism_3DPy(int hypId, int studyId, SMESH_Gen* gen);
00262     ~StdMeshers_RadialPrism_3DPy();
00263 };
00264 
00265 class StdMeshers_QuadraticMeshPy : public SMESH_HypothesisPy<StdMeshers_QuadraticMeshPy>
00266 {
00267 public:
00268     static void init_type(PyObject*);
00269     StdMeshers_QuadraticMeshPy(int hypId, int studyId, SMESH_Gen* gen);
00270     ~StdMeshers_QuadraticMeshPy();
00271 };
00272 
00273 class StdMeshers_ProjectionSource3DPy : public SMESH_HypothesisPy<StdMeshers_ProjectionSource3DPy>
00274 {
00275 public:
00276     static void init_type(PyObject*);
00277     StdMeshers_ProjectionSource3DPy(int hypId, int studyId, SMESH_Gen* gen);
00278     ~StdMeshers_ProjectionSource3DPy();
00279     //Py::Object setSource3DShape(const Py::Tuple& args);
00280     //Py::Object getSource3DShape(const Py::Tuple& args);
00281     //Py::Object setSourceMesh(const Py::Tuple& args);
00282     //Py::Object getSourceMesh(const Py::Tuple& args);
00283     //Py::Object setVertexAssociation(const Py::Tuple& args);
00284     //Py::Object getSourceVertex(const Py::Tuple& args);
00285     //Py::Object getTargetVertex(const Py::Tuple& args);
00286     //Py::Object hasVertexAssociation(const Py::Tuple& args);
00287     //Py::Object getStoreParams(const Py::Tuple& args);
00288     //Py::Object restoreParams(const Py::Tuple& args);
00289 };
00290 
00291 class StdMeshers_ProjectionSource2DPy : public SMESH_HypothesisPy<StdMeshers_ProjectionSource2DPy>
00292 {
00293 public:
00294     static void init_type(PyObject*);
00295     StdMeshers_ProjectionSource2DPy(int hypId, int studyId, SMESH_Gen* gen);
00296     ~StdMeshers_ProjectionSource2DPy();
00297     //Py::Object setSourceFace(const Py::Tuple& args);
00298     //Py::Object getSourceFace(const Py::Tuple& args);
00299     //Py::Object isCompoundSource(const Py::Tuple& args);
00300     //Py::Object setSourceMesh(const Py::Tuple& args);
00301     //Py::Object getSourceMesh(const Py::Tuple& args);
00302     //Py::Object setVertexAssociation(const Py::Tuple& args);
00303     //Py::Object getSourceVertex(const Py::Tuple& args);
00304     //Py::Object getTargetVertex(const Py::Tuple& args);
00305     //Py::Object hasVertexAssociation(const Py::Tuple& args);
00306     //Py::Object getStoreParams(const Py::Tuple& args);
00307     //Py::Object restoreParams(const Py::Tuple& args);
00308 };
00309 
00310 class StdMeshers_ProjectionSource1DPy : public SMESH_HypothesisPy<StdMeshers_ProjectionSource1DPy>
00311 {
00312 public:
00313     static void init_type(PyObject*);
00314     StdMeshers_ProjectionSource1DPy(int hypId, int studyId, SMESH_Gen* gen);
00315     ~StdMeshers_ProjectionSource1DPy();
00316     //Py::Object setSourceEdge(const Py::Tuple& args);
00317     //Py::Object getSourceEdge(const Py::Tuple& args);
00318     //Py::Object isCompoundSource(const Py::Tuple& args);
00319     //Py::Object setSourceMesh(const Py::Tuple& args);
00320     //Py::Object getSourceMesh(const Py::Tuple& args);
00321     //Py::Object setVertexAssociation(const Py::Tuple& args);
00322     //Py::Object getSourceVertex(const Py::Tuple& args);
00323     //Py::Object getTargetVertex(const Py::Tuple& args);
00324     //Py::Object hasVertexAssociation(const Py::Tuple& args);
00325     //Py::Object getStoreParams(const Py::Tuple& args);
00326     //Py::Object restoreParams(const Py::Tuple& args);
00327 };
00328 
00329 class StdMeshers_Projection_3DPy : public SMESH_HypothesisPy<StdMeshers_Projection_3DPy>
00330 {
00331 public:
00332     static void init_type(PyObject*);
00333     StdMeshers_Projection_3DPy(int hypId, int studyId, SMESH_Gen* gen);
00334     ~StdMeshers_Projection_3DPy();
00335 };
00336 
00337 class StdMeshers_Projection_2DPy : public SMESH_HypothesisPy<StdMeshers_Projection_2DPy>
00338 {
00339 public:
00340     static void init_type(PyObject*);
00341     StdMeshers_Projection_2DPy(int hypId, int studyId, SMESH_Gen* gen);
00342     ~StdMeshers_Projection_2DPy();
00343 };
00344 
00345 class StdMeshers_Projection_1DPy : public SMESH_HypothesisPy<StdMeshers_Projection_1DPy>
00346 {
00347 public:
00348     static void init_type(PyObject*);
00349     StdMeshers_Projection_1DPy(int hypId, int studyId, SMESH_Gen* gen);
00350     ~StdMeshers_Projection_1DPy();
00351 };
00352 
00353 class StdMeshers_Prism_3DPy : public SMESH_HypothesisPy<StdMeshers_Prism_3DPy>
00354 {
00355 public:
00356     static void init_type(PyObject*);
00357     StdMeshers_Prism_3DPy(int hypId, int studyId, SMESH_Gen* gen);
00358     ~StdMeshers_Prism_3DPy();
00359 };
00360 
00361 class StdMeshers_NumberOfSegmentsPy : public SMESH_HypothesisPy<StdMeshers_NumberOfSegmentsPy>
00362 {
00363 public:
00364     static void init_type(PyObject*);
00365     StdMeshers_NumberOfSegmentsPy(int hypId, int studyId, SMESH_Gen* gen);
00366     ~StdMeshers_NumberOfSegmentsPy();
00367     Py::Object setNumSegm(const Py::Tuple& args);
00368     Py::Object getNumSegm(const Py::Tuple& args);
00369 };
00370 
00371 class StdMeshers_NumberOfLayersPy : public SMESH_HypothesisPy<StdMeshers_NumberOfLayersPy>
00372 {
00373 public:
00374     static void init_type(PyObject*);
00375     StdMeshers_NumberOfLayersPy(int hypId, int studyId, SMESH_Gen* gen);
00376     ~StdMeshers_NumberOfLayersPy();
00377     Py::Object setNumLayers(const Py::Tuple& args);
00378     Py::Object getNumLayers(const Py::Tuple& args);
00379 };
00380 
00381 class StdMeshers_MEFISTO_2DPy : public SMESH_HypothesisPy<StdMeshers_MEFISTO_2DPy>
00382 {
00383 public:
00384     static void init_type(PyObject*);
00385     StdMeshers_MEFISTO_2DPy(int hypId, int studyId, SMESH_Gen* gen);
00386     ~StdMeshers_MEFISTO_2DPy();
00387 };
00388 
00389 class StdMeshers_MaxElementVolumePy : public SMESH_HypothesisPy<StdMeshers_MaxElementVolumePy>
00390 {
00391 public:
00392     static void init_type(PyObject*);
00393     StdMeshers_MaxElementVolumePy(int hypId, int studyId, SMESH_Gen* gen);
00394     ~StdMeshers_MaxElementVolumePy();
00395     Py::Object setMaxVolume(const Py::Tuple& args);
00396     Py::Object getMaxVolume(const Py::Tuple& args);
00397 };
00398 
00399 class StdMeshers_LengthFromEdgesPy : public SMESH_HypothesisPy<StdMeshers_LengthFromEdgesPy>
00400 {
00401 public:
00402     static void init_type(PyObject*);
00403     StdMeshers_LengthFromEdgesPy(int hypId, int studyId, SMESH_Gen* gen);
00404     ~StdMeshers_LengthFromEdgesPy();
00405     Py::Object setMode(const Py::Tuple& args);
00406     Py::Object getMode(const Py::Tuple& args);
00407 };
00408 
00409 class StdMeshers_LayerDistributionPy : public SMESH_HypothesisPy<StdMeshers_LayerDistributionPy>
00410 {
00411 public:
00412     static void init_type(PyObject*);
00413     StdMeshers_LayerDistributionPy(int hypId, int studyId, SMESH_Gen* gen);
00414     ~StdMeshers_LayerDistributionPy();
00415     Py::Object setLayerDistribution(const Py::Tuple& args);
00416     Py::Object getLayerDistribution(const Py::Tuple& args);
00417 };
00418 
00419 } // namespace Fem
00420 
00421 #endif // FEM_HYPOTHESISPY_H

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