00001
00002
00003
00004
00005
00006 #include <boost/filesystem/path.hpp>
00007 #include <boost/filesystem/operations.hpp>
00008 #include <boost/filesystem/exception.hpp>
00009 #include <Base/PyObjectBase.h>
00010 #include <Base/Console.h>
00011 #include <Base/Exception.h>
00012 #include <CXX/Objects.hxx>
00013
00014 #define new DEBUG_CLIENTBLOCK
00015
00016 using Base::streq;
00017 using namespace Part;
00018
00020 PyTypeObject BezierCurvePy::Type = {
00021 PyObject_HEAD_INIT(&PyType_Type)
00022 0,
00023 "Part.GeomBezierCurve",
00024 sizeof(BezierCurvePy),
00025 0,
00026
00027 PyDestructor,
00028 0,
00029 __getattr,
00030 __setattr,
00031 0,
00032 __repr,
00033 0,
00034 0,
00035 0,
00036 0,
00037 0,
00038 0,
00039 0,
00040 0,
00041
00042 0,
00043
00044 Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_CLASS,
00045 "\n"
00046 " Describes a rational or non-rational Bezier curve:\n"
00047 " -- a non-rational Bezier curve is defined by a table of poles (also called control points)\n"
00048 " -- a rational Bezier curve is defined by a table of poles with varying weights\n"
00049 " ",
00050 0,
00051 0,
00052 0,
00053 0,
00054 0,
00055 0,
00056 Part::BezierCurvePy::Methods,
00057 0,
00058 Part::BezierCurvePy::GetterSetter,
00059 &Part::GeometryCurvePy::Type,
00060 0,
00061 0,
00062 0,
00063 0,
00064 __PyInit,
00065 0,
00066 Part::BezierCurvePy::PyMake,
00067 0,
00068 0,
00069 0,
00070 0,
00071 0,
00072 0,
00073 0,
00074 0
00075 };
00076
00078 PyMethodDef BezierCurvePy::Methods[] = {
00079 {"isRational",
00080 (PyCFunction) staticCallback_isRational,
00081 METH_VARARGS,
00082 "Returns false if the weights of all the poles of this Bezier curve are equal."
00083 },
00084 {"isPeriodic",
00085 (PyCFunction) staticCallback_isPeriodic,
00086 METH_VARARGS,
00087 "Returns false."
00088 },
00089 {"isClosed",
00090 (PyCFunction) staticCallback_isClosed,
00091 METH_VARARGS,
00092 "Returns true if the distance between the start point and end point of\n this Bezier curve is less than or equal to gp::Resolution().\n "
00093 },
00094 {"increase",
00095 (PyCFunction) staticCallback_increase,
00096 METH_VARARGS,
00097 "increase(Int=Degree)\nIncreases the degree of this Bezier curve to Degree.\nAs a result, the poles and weights tables are modified."
00098 },
00099 {"insertPoleAfter",
00100 (PyCFunction) staticCallback_insertPoleAfter,
00101 METH_VARARGS,
00102 "Inserts after the pole of index."
00103 },
00104 {"insertPoleBefore",
00105 (PyCFunction) staticCallback_insertPoleBefore,
00106 METH_VARARGS,
00107 "Inserts before the pole of index."
00108 },
00109 {"removePole",
00110 (PyCFunction) staticCallback_removePole,
00111 METH_VARARGS,
00112 "Removes the pole of index Index from the table of poles of this Bezier curve.\nIf this Bezier curve is rational, it can become non-rational."
00113 },
00114 {"segment",
00115 (PyCFunction) staticCallback_segment,
00116 METH_VARARGS,
00117 "Modifies this Bezier curve by segmenting it."
00118 },
00119 {"setPole",
00120 (PyCFunction) staticCallback_setPole,
00121 METH_VARARGS,
00122 "Set a pole of the Bezier curve."
00123 },
00124 {"getPole",
00125 (PyCFunction) staticCallback_getPole,
00126 METH_VARARGS,
00127 "Get a pole of the Bezier curve."
00128 },
00129 {"getPoles",
00130 (PyCFunction) staticCallback_getPoles,
00131 METH_VARARGS,
00132 "Get all poles of the Bezier curve."
00133 },
00134 {"setPoles",
00135 (PyCFunction) staticCallback_setPoles,
00136 METH_VARARGS,
00137 "Set the poles of the Bezier curve."
00138 },
00139 {"setWeight",
00140 (PyCFunction) staticCallback_setWeight,
00141 METH_VARARGS,
00142 "Set a weight of the Bezier curve."
00143 },
00144 {"getWeight",
00145 (PyCFunction) staticCallback_getWeight,
00146 METH_VARARGS,
00147 "Get a weight of the Bezier curve."
00148 },
00149 {"getWeights",
00150 (PyCFunction) staticCallback_getWeights,
00151 METH_VARARGS,
00152 "Get all weights of the Bezier curve."
00153 },
00154 {"getResolution",
00155 (PyCFunction) staticCallback_getResolution,
00156 METH_VARARGS,
00157 "Computes for this Bezier curve the parametric tolerance (UTolerance)\nfor a given 3D tolerance (Tolerance3D).\nIf f(t) is the equation of this Bezier curve, the parametric tolerance\nensures that:\n|t1-t0| < UTolerance =""==> |f(t1)-f(t0)| < Tolerance3D"
00158 },
00159 {NULL, NULL, 0, NULL}
00160 };
00161
00162
00163
00165 PyGetSetDef BezierCurvePy::GetterSetter[] = {
00166 {"Degree",
00167 (getter) staticCallback_getDegree,
00168 (setter) staticCallback_setDegree,
00169 "Returns the polynomial degree of this Bezier curve,\nwhich is equal to the number of poles minus 1.",
00170 NULL
00171 },
00172 {"MaxDegree",
00173 (getter) staticCallback_getMaxDegree,
00174 (setter) staticCallback_setMaxDegree,
00175 "Returns the value of the maximum polynomial degree of any\nBezier curve curve. This value is 25.",
00176 NULL
00177 },
00178 {"NbPoles",
00179 (getter) staticCallback_getNbPoles,
00180 (setter) staticCallback_setNbPoles,
00181 "Returns the number of poles of this Bezier curve.\n ",
00182 NULL
00183 },
00184 {"StartPoint",
00185 (getter) staticCallback_getStartPoint,
00186 (setter) staticCallback_setStartPoint,
00187 "Returns the start point of this Bezier curve.",
00188 NULL
00189 },
00190 {"EndPoint",
00191 (getter) staticCallback_getEndPoint,
00192 (setter) staticCallback_setEndPoint,
00193 "Returns the end point of this Bezier curve.",
00194 NULL
00195 },
00196 {NULL, NULL, NULL, NULL, NULL}
00197 };
00198
00199
00200
00201
00202 PyObject * BezierCurvePy::staticCallback_isRational (PyObject *self, PyObject *args)
00203 {
00204
00205 if (!((PyObjectBase*) self)->isValid()){
00206 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00207 return NULL;
00208 }
00209
00210
00211 if (((PyObjectBase*) self)->isConst()){
00212 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00213 return NULL;
00214 }
00215
00216 try {
00217 PyObject* ret = ((BezierCurvePy*)self)->isRational(args);
00218 if (ret != 0)
00219 ((BezierCurvePy*)self)->startNotify();
00220 return ret;
00221 }
00222 catch(const Base::Exception& e)
00223 {
00224 std::string str;
00225 str += "FreeCAD exception thrown (";
00226 str += e.what();
00227 str += ")";
00228 e.ReportException();
00229 PyErr_SetString(PyExc_Exception,str.c_str());
00230 return NULL;
00231 }
00232 catch(const boost::filesystem::filesystem_error& e)
00233 {
00234 std::string str;
00235 str += "File system exception thrown (";
00236
00237
00238 str += e.what();
00239 str += ")\n";
00240 Base::Console().Error(str.c_str());
00241 PyErr_SetString(PyExc_Exception,str.c_str());
00242 return NULL;
00243 }
00244 catch(const Py::Exception&)
00245 {
00246
00247 return NULL;
00248 }
00249 catch(const char* e)
00250 {
00251 Base::Console().Error(e);
00252 PyErr_SetString(PyExc_Exception,e);
00253 return NULL;
00254 }
00255
00256 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00257 catch(const std::exception& e)
00258 {
00259 std::string str;
00260 str += "FC++ exception thrown (";
00261 str += e.what();
00262 str += ")";
00263 Base::Console().Error(str.c_str());
00264 PyErr_SetString(PyExc_Exception,str.c_str());
00265 return NULL;
00266 }
00267 catch(...)
00268 {
00269 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00270 return NULL;
00271 }
00272 #endif
00273 }
00274
00275
00276
00277
00278 PyObject * BezierCurvePy::staticCallback_isPeriodic (PyObject *self, PyObject *args)
00279 {
00280
00281 if (!((PyObjectBase*) self)->isValid()){
00282 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00283 return NULL;
00284 }
00285
00286
00287 if (((PyObjectBase*) self)->isConst()){
00288 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00289 return NULL;
00290 }
00291
00292 try {
00293 PyObject* ret = ((BezierCurvePy*)self)->isPeriodic(args);
00294 if (ret != 0)
00295 ((BezierCurvePy*)self)->startNotify();
00296 return ret;
00297 }
00298 catch(const Base::Exception& e)
00299 {
00300 std::string str;
00301 str += "FreeCAD exception thrown (";
00302 str += e.what();
00303 str += ")";
00304 e.ReportException();
00305 PyErr_SetString(PyExc_Exception,str.c_str());
00306 return NULL;
00307 }
00308 catch(const boost::filesystem::filesystem_error& e)
00309 {
00310 std::string str;
00311 str += "File system exception thrown (";
00312
00313
00314 str += e.what();
00315 str += ")\n";
00316 Base::Console().Error(str.c_str());
00317 PyErr_SetString(PyExc_Exception,str.c_str());
00318 return NULL;
00319 }
00320 catch(const Py::Exception&)
00321 {
00322
00323 return NULL;
00324 }
00325 catch(const char* e)
00326 {
00327 Base::Console().Error(e);
00328 PyErr_SetString(PyExc_Exception,e);
00329 return NULL;
00330 }
00331
00332 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00333 catch(const std::exception& e)
00334 {
00335 std::string str;
00336 str += "FC++ exception thrown (";
00337 str += e.what();
00338 str += ")";
00339 Base::Console().Error(str.c_str());
00340 PyErr_SetString(PyExc_Exception,str.c_str());
00341 return NULL;
00342 }
00343 catch(...)
00344 {
00345 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00346 return NULL;
00347 }
00348 #endif
00349 }
00350
00351
00352
00353
00354 PyObject * BezierCurvePy::staticCallback_isClosed (PyObject *self, PyObject *args)
00355 {
00356
00357 if (!((PyObjectBase*) self)->isValid()){
00358 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00359 return NULL;
00360 }
00361
00362
00363 if (((PyObjectBase*) self)->isConst()){
00364 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00365 return NULL;
00366 }
00367
00368 try {
00369 PyObject* ret = ((BezierCurvePy*)self)->isClosed(args);
00370 if (ret != 0)
00371 ((BezierCurvePy*)self)->startNotify();
00372 return ret;
00373 }
00374 catch(const Base::Exception& e)
00375 {
00376 std::string str;
00377 str += "FreeCAD exception thrown (";
00378 str += e.what();
00379 str += ")";
00380 e.ReportException();
00381 PyErr_SetString(PyExc_Exception,str.c_str());
00382 return NULL;
00383 }
00384 catch(const boost::filesystem::filesystem_error& e)
00385 {
00386 std::string str;
00387 str += "File system exception thrown (";
00388
00389
00390 str += e.what();
00391 str += ")\n";
00392 Base::Console().Error(str.c_str());
00393 PyErr_SetString(PyExc_Exception,str.c_str());
00394 return NULL;
00395 }
00396 catch(const Py::Exception&)
00397 {
00398
00399 return NULL;
00400 }
00401 catch(const char* e)
00402 {
00403 Base::Console().Error(e);
00404 PyErr_SetString(PyExc_Exception,e);
00405 return NULL;
00406 }
00407
00408 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00409 catch(const std::exception& e)
00410 {
00411 std::string str;
00412 str += "FC++ exception thrown (";
00413 str += e.what();
00414 str += ")";
00415 Base::Console().Error(str.c_str());
00416 PyErr_SetString(PyExc_Exception,str.c_str());
00417 return NULL;
00418 }
00419 catch(...)
00420 {
00421 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00422 return NULL;
00423 }
00424 #endif
00425 }
00426
00427
00428
00429
00430 PyObject * BezierCurvePy::staticCallback_increase (PyObject *self, PyObject *args)
00431 {
00432
00433 if (!((PyObjectBase*) self)->isValid()){
00434 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00435 return NULL;
00436 }
00437
00438
00439 if (((PyObjectBase*) self)->isConst()){
00440 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00441 return NULL;
00442 }
00443
00444 try {
00445 PyObject* ret = ((BezierCurvePy*)self)->increase(args);
00446 if (ret != 0)
00447 ((BezierCurvePy*)self)->startNotify();
00448 return ret;
00449 }
00450 catch(const Base::Exception& e)
00451 {
00452 std::string str;
00453 str += "FreeCAD exception thrown (";
00454 str += e.what();
00455 str += ")";
00456 e.ReportException();
00457 PyErr_SetString(PyExc_Exception,str.c_str());
00458 return NULL;
00459 }
00460 catch(const boost::filesystem::filesystem_error& e)
00461 {
00462 std::string str;
00463 str += "File system exception thrown (";
00464
00465
00466 str += e.what();
00467 str += ")\n";
00468 Base::Console().Error(str.c_str());
00469 PyErr_SetString(PyExc_Exception,str.c_str());
00470 return NULL;
00471 }
00472 catch(const Py::Exception&)
00473 {
00474
00475 return NULL;
00476 }
00477 catch(const char* e)
00478 {
00479 Base::Console().Error(e);
00480 PyErr_SetString(PyExc_Exception,e);
00481 return NULL;
00482 }
00483
00484 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00485 catch(const std::exception& e)
00486 {
00487 std::string str;
00488 str += "FC++ exception thrown (";
00489 str += e.what();
00490 str += ")";
00491 Base::Console().Error(str.c_str());
00492 PyErr_SetString(PyExc_Exception,str.c_str());
00493 return NULL;
00494 }
00495 catch(...)
00496 {
00497 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00498 return NULL;
00499 }
00500 #endif
00501 }
00502
00503
00504
00505
00506 PyObject * BezierCurvePy::staticCallback_insertPoleAfter (PyObject *self, PyObject *args)
00507 {
00508
00509 if (!((PyObjectBase*) self)->isValid()){
00510 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00511 return NULL;
00512 }
00513
00514
00515 if (((PyObjectBase*) self)->isConst()){
00516 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00517 return NULL;
00518 }
00519
00520 try {
00521 PyObject* ret = ((BezierCurvePy*)self)->insertPoleAfter(args);
00522 if (ret != 0)
00523 ((BezierCurvePy*)self)->startNotify();
00524 return ret;
00525 }
00526 catch(const Base::Exception& e)
00527 {
00528 std::string str;
00529 str += "FreeCAD exception thrown (";
00530 str += e.what();
00531 str += ")";
00532 e.ReportException();
00533 PyErr_SetString(PyExc_Exception,str.c_str());
00534 return NULL;
00535 }
00536 catch(const boost::filesystem::filesystem_error& e)
00537 {
00538 std::string str;
00539 str += "File system exception thrown (";
00540
00541
00542 str += e.what();
00543 str += ")\n";
00544 Base::Console().Error(str.c_str());
00545 PyErr_SetString(PyExc_Exception,str.c_str());
00546 return NULL;
00547 }
00548 catch(const Py::Exception&)
00549 {
00550
00551 return NULL;
00552 }
00553 catch(const char* e)
00554 {
00555 Base::Console().Error(e);
00556 PyErr_SetString(PyExc_Exception,e);
00557 return NULL;
00558 }
00559
00560 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00561 catch(const std::exception& e)
00562 {
00563 std::string str;
00564 str += "FC++ exception thrown (";
00565 str += e.what();
00566 str += ")";
00567 Base::Console().Error(str.c_str());
00568 PyErr_SetString(PyExc_Exception,str.c_str());
00569 return NULL;
00570 }
00571 catch(...)
00572 {
00573 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00574 return NULL;
00575 }
00576 #endif
00577 }
00578
00579
00580
00581
00582 PyObject * BezierCurvePy::staticCallback_insertPoleBefore (PyObject *self, PyObject *args)
00583 {
00584
00585 if (!((PyObjectBase*) self)->isValid()){
00586 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00587 return NULL;
00588 }
00589
00590
00591 if (((PyObjectBase*) self)->isConst()){
00592 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00593 return NULL;
00594 }
00595
00596 try {
00597 PyObject* ret = ((BezierCurvePy*)self)->insertPoleBefore(args);
00598 if (ret != 0)
00599 ((BezierCurvePy*)self)->startNotify();
00600 return ret;
00601 }
00602 catch(const Base::Exception& e)
00603 {
00604 std::string str;
00605 str += "FreeCAD exception thrown (";
00606 str += e.what();
00607 str += ")";
00608 e.ReportException();
00609 PyErr_SetString(PyExc_Exception,str.c_str());
00610 return NULL;
00611 }
00612 catch(const boost::filesystem::filesystem_error& e)
00613 {
00614 std::string str;
00615 str += "File system exception thrown (";
00616
00617
00618 str += e.what();
00619 str += ")\n";
00620 Base::Console().Error(str.c_str());
00621 PyErr_SetString(PyExc_Exception,str.c_str());
00622 return NULL;
00623 }
00624 catch(const Py::Exception&)
00625 {
00626
00627 return NULL;
00628 }
00629 catch(const char* e)
00630 {
00631 Base::Console().Error(e);
00632 PyErr_SetString(PyExc_Exception,e);
00633 return NULL;
00634 }
00635
00636 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00637 catch(const std::exception& e)
00638 {
00639 std::string str;
00640 str += "FC++ exception thrown (";
00641 str += e.what();
00642 str += ")";
00643 Base::Console().Error(str.c_str());
00644 PyErr_SetString(PyExc_Exception,str.c_str());
00645 return NULL;
00646 }
00647 catch(...)
00648 {
00649 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00650 return NULL;
00651 }
00652 #endif
00653 }
00654
00655
00656
00657
00658 PyObject * BezierCurvePy::staticCallback_removePole (PyObject *self, PyObject *args)
00659 {
00660
00661 if (!((PyObjectBase*) self)->isValid()){
00662 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00663 return NULL;
00664 }
00665
00666
00667 if (((PyObjectBase*) self)->isConst()){
00668 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00669 return NULL;
00670 }
00671
00672 try {
00673 PyObject* ret = ((BezierCurvePy*)self)->removePole(args);
00674 if (ret != 0)
00675 ((BezierCurvePy*)self)->startNotify();
00676 return ret;
00677 }
00678 catch(const Base::Exception& e)
00679 {
00680 std::string str;
00681 str += "FreeCAD exception thrown (";
00682 str += e.what();
00683 str += ")";
00684 e.ReportException();
00685 PyErr_SetString(PyExc_Exception,str.c_str());
00686 return NULL;
00687 }
00688 catch(const boost::filesystem::filesystem_error& e)
00689 {
00690 std::string str;
00691 str += "File system exception thrown (";
00692
00693
00694 str += e.what();
00695 str += ")\n";
00696 Base::Console().Error(str.c_str());
00697 PyErr_SetString(PyExc_Exception,str.c_str());
00698 return NULL;
00699 }
00700 catch(const Py::Exception&)
00701 {
00702
00703 return NULL;
00704 }
00705 catch(const char* e)
00706 {
00707 Base::Console().Error(e);
00708 PyErr_SetString(PyExc_Exception,e);
00709 return NULL;
00710 }
00711
00712 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00713 catch(const std::exception& e)
00714 {
00715 std::string str;
00716 str += "FC++ exception thrown (";
00717 str += e.what();
00718 str += ")";
00719 Base::Console().Error(str.c_str());
00720 PyErr_SetString(PyExc_Exception,str.c_str());
00721 return NULL;
00722 }
00723 catch(...)
00724 {
00725 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00726 return NULL;
00727 }
00728 #endif
00729 }
00730
00731
00732
00733
00734 PyObject * BezierCurvePy::staticCallback_segment (PyObject *self, PyObject *args)
00735 {
00736
00737 if (!((PyObjectBase*) self)->isValid()){
00738 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00739 return NULL;
00740 }
00741
00742
00743 if (((PyObjectBase*) self)->isConst()){
00744 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00745 return NULL;
00746 }
00747
00748 try {
00749 PyObject* ret = ((BezierCurvePy*)self)->segment(args);
00750 if (ret != 0)
00751 ((BezierCurvePy*)self)->startNotify();
00752 return ret;
00753 }
00754 catch(const Base::Exception& e)
00755 {
00756 std::string str;
00757 str += "FreeCAD exception thrown (";
00758 str += e.what();
00759 str += ")";
00760 e.ReportException();
00761 PyErr_SetString(PyExc_Exception,str.c_str());
00762 return NULL;
00763 }
00764 catch(const boost::filesystem::filesystem_error& e)
00765 {
00766 std::string str;
00767 str += "File system exception thrown (";
00768
00769
00770 str += e.what();
00771 str += ")\n";
00772 Base::Console().Error(str.c_str());
00773 PyErr_SetString(PyExc_Exception,str.c_str());
00774 return NULL;
00775 }
00776 catch(const Py::Exception&)
00777 {
00778
00779 return NULL;
00780 }
00781 catch(const char* e)
00782 {
00783 Base::Console().Error(e);
00784 PyErr_SetString(PyExc_Exception,e);
00785 return NULL;
00786 }
00787
00788 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00789 catch(const std::exception& e)
00790 {
00791 std::string str;
00792 str += "FC++ exception thrown (";
00793 str += e.what();
00794 str += ")";
00795 Base::Console().Error(str.c_str());
00796 PyErr_SetString(PyExc_Exception,str.c_str());
00797 return NULL;
00798 }
00799 catch(...)
00800 {
00801 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00802 return NULL;
00803 }
00804 #endif
00805 }
00806
00807
00808
00809
00810 PyObject * BezierCurvePy::staticCallback_setPole (PyObject *self, PyObject *args)
00811 {
00812
00813 if (!((PyObjectBase*) self)->isValid()){
00814 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00815 return NULL;
00816 }
00817
00818
00819 if (((PyObjectBase*) self)->isConst()){
00820 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00821 return NULL;
00822 }
00823
00824 try {
00825 PyObject* ret = ((BezierCurvePy*)self)->setPole(args);
00826 if (ret != 0)
00827 ((BezierCurvePy*)self)->startNotify();
00828 return ret;
00829 }
00830 catch(const Base::Exception& e)
00831 {
00832 std::string str;
00833 str += "FreeCAD exception thrown (";
00834 str += e.what();
00835 str += ")";
00836 e.ReportException();
00837 PyErr_SetString(PyExc_Exception,str.c_str());
00838 return NULL;
00839 }
00840 catch(const boost::filesystem::filesystem_error& e)
00841 {
00842 std::string str;
00843 str += "File system exception thrown (";
00844
00845
00846 str += e.what();
00847 str += ")\n";
00848 Base::Console().Error(str.c_str());
00849 PyErr_SetString(PyExc_Exception,str.c_str());
00850 return NULL;
00851 }
00852 catch(const Py::Exception&)
00853 {
00854
00855 return NULL;
00856 }
00857 catch(const char* e)
00858 {
00859 Base::Console().Error(e);
00860 PyErr_SetString(PyExc_Exception,e);
00861 return NULL;
00862 }
00863
00864 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00865 catch(const std::exception& e)
00866 {
00867 std::string str;
00868 str += "FC++ exception thrown (";
00869 str += e.what();
00870 str += ")";
00871 Base::Console().Error(str.c_str());
00872 PyErr_SetString(PyExc_Exception,str.c_str());
00873 return NULL;
00874 }
00875 catch(...)
00876 {
00877 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00878 return NULL;
00879 }
00880 #endif
00881 }
00882
00883
00884
00885
00886 PyObject * BezierCurvePy::staticCallback_getPole (PyObject *self, PyObject *args)
00887 {
00888
00889 if (!((PyObjectBase*) self)->isValid()){
00890 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00891 return NULL;
00892 }
00893
00894
00895 if (((PyObjectBase*) self)->isConst()){
00896 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00897 return NULL;
00898 }
00899
00900 try {
00901 PyObject* ret = ((BezierCurvePy*)self)->getPole(args);
00902 if (ret != 0)
00903 ((BezierCurvePy*)self)->startNotify();
00904 return ret;
00905 }
00906 catch(const Base::Exception& e)
00907 {
00908 std::string str;
00909 str += "FreeCAD exception thrown (";
00910 str += e.what();
00911 str += ")";
00912 e.ReportException();
00913 PyErr_SetString(PyExc_Exception,str.c_str());
00914 return NULL;
00915 }
00916 catch(const boost::filesystem::filesystem_error& e)
00917 {
00918 std::string str;
00919 str += "File system exception thrown (";
00920
00921
00922 str += e.what();
00923 str += ")\n";
00924 Base::Console().Error(str.c_str());
00925 PyErr_SetString(PyExc_Exception,str.c_str());
00926 return NULL;
00927 }
00928 catch(const Py::Exception&)
00929 {
00930
00931 return NULL;
00932 }
00933 catch(const char* e)
00934 {
00935 Base::Console().Error(e);
00936 PyErr_SetString(PyExc_Exception,e);
00937 return NULL;
00938 }
00939
00940 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00941 catch(const std::exception& e)
00942 {
00943 std::string str;
00944 str += "FC++ exception thrown (";
00945 str += e.what();
00946 str += ")";
00947 Base::Console().Error(str.c_str());
00948 PyErr_SetString(PyExc_Exception,str.c_str());
00949 return NULL;
00950 }
00951 catch(...)
00952 {
00953 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00954 return NULL;
00955 }
00956 #endif
00957 }
00958
00959
00960
00961
00962 PyObject * BezierCurvePy::staticCallback_getPoles (PyObject *self, PyObject *args)
00963 {
00964
00965 if (!((PyObjectBase*) self)->isValid()){
00966 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00967 return NULL;
00968 }
00969
00970
00971 if (((PyObjectBase*) self)->isConst()){
00972 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00973 return NULL;
00974 }
00975
00976 try {
00977 PyObject* ret = ((BezierCurvePy*)self)->getPoles(args);
00978 if (ret != 0)
00979 ((BezierCurvePy*)self)->startNotify();
00980 return ret;
00981 }
00982 catch(const Base::Exception& e)
00983 {
00984 std::string str;
00985 str += "FreeCAD exception thrown (";
00986 str += e.what();
00987 str += ")";
00988 e.ReportException();
00989 PyErr_SetString(PyExc_Exception,str.c_str());
00990 return NULL;
00991 }
00992 catch(const boost::filesystem::filesystem_error& e)
00993 {
00994 std::string str;
00995 str += "File system exception thrown (";
00996
00997
00998 str += e.what();
00999 str += ")\n";
01000 Base::Console().Error(str.c_str());
01001 PyErr_SetString(PyExc_Exception,str.c_str());
01002 return NULL;
01003 }
01004 catch(const Py::Exception&)
01005 {
01006
01007 return NULL;
01008 }
01009 catch(const char* e)
01010 {
01011 Base::Console().Error(e);
01012 PyErr_SetString(PyExc_Exception,e);
01013 return NULL;
01014 }
01015
01016 #ifndef DONT_CATCH_CXX_EXCEPTIONS
01017 catch(const std::exception& e)
01018 {
01019 std::string str;
01020 str += "FC++ exception thrown (";
01021 str += e.what();
01022 str += ")";
01023 Base::Console().Error(str.c_str());
01024 PyErr_SetString(PyExc_Exception,str.c_str());
01025 return NULL;
01026 }
01027 catch(...)
01028 {
01029 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01030 return NULL;
01031 }
01032 #endif
01033 }
01034
01035
01036
01037
01038 PyObject * BezierCurvePy::staticCallback_setPoles (PyObject *self, PyObject *args)
01039 {
01040
01041 if (!((PyObjectBase*) self)->isValid()){
01042 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01043 return NULL;
01044 }
01045
01046
01047 if (((PyObjectBase*) self)->isConst()){
01048 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
01049 return NULL;
01050 }
01051
01052 try {
01053 PyObject* ret = ((BezierCurvePy*)self)->setPoles(args);
01054 if (ret != 0)
01055 ((BezierCurvePy*)self)->startNotify();
01056 return ret;
01057 }
01058 catch(const Base::Exception& e)
01059 {
01060 std::string str;
01061 str += "FreeCAD exception thrown (";
01062 str += e.what();
01063 str += ")";
01064 e.ReportException();
01065 PyErr_SetString(PyExc_Exception,str.c_str());
01066 return NULL;
01067 }
01068 catch(const boost::filesystem::filesystem_error& e)
01069 {
01070 std::string str;
01071 str += "File system exception thrown (";
01072
01073
01074 str += e.what();
01075 str += ")\n";
01076 Base::Console().Error(str.c_str());
01077 PyErr_SetString(PyExc_Exception,str.c_str());
01078 return NULL;
01079 }
01080 catch(const Py::Exception&)
01081 {
01082
01083 return NULL;
01084 }
01085 catch(const char* e)
01086 {
01087 Base::Console().Error(e);
01088 PyErr_SetString(PyExc_Exception,e);
01089 return NULL;
01090 }
01091
01092 #ifndef DONT_CATCH_CXX_EXCEPTIONS
01093 catch(const std::exception& e)
01094 {
01095 std::string str;
01096 str += "FC++ exception thrown (";
01097 str += e.what();
01098 str += ")";
01099 Base::Console().Error(str.c_str());
01100 PyErr_SetString(PyExc_Exception,str.c_str());
01101 return NULL;
01102 }
01103 catch(...)
01104 {
01105 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01106 return NULL;
01107 }
01108 #endif
01109 }
01110
01111
01112
01113
01114 PyObject * BezierCurvePy::staticCallback_setWeight (PyObject *self, PyObject *args)
01115 {
01116
01117 if (!((PyObjectBase*) self)->isValid()){
01118 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01119 return NULL;
01120 }
01121
01122
01123 if (((PyObjectBase*) self)->isConst()){
01124 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
01125 return NULL;
01126 }
01127
01128 try {
01129 PyObject* ret = ((BezierCurvePy*)self)->setWeight(args);
01130 if (ret != 0)
01131 ((BezierCurvePy*)self)->startNotify();
01132 return ret;
01133 }
01134 catch(const Base::Exception& e)
01135 {
01136 std::string str;
01137 str += "FreeCAD exception thrown (";
01138 str += e.what();
01139 str += ")";
01140 e.ReportException();
01141 PyErr_SetString(PyExc_Exception,str.c_str());
01142 return NULL;
01143 }
01144 catch(const boost::filesystem::filesystem_error& e)
01145 {
01146 std::string str;
01147 str += "File system exception thrown (";
01148
01149
01150 str += e.what();
01151 str += ")\n";
01152 Base::Console().Error(str.c_str());
01153 PyErr_SetString(PyExc_Exception,str.c_str());
01154 return NULL;
01155 }
01156 catch(const Py::Exception&)
01157 {
01158
01159 return NULL;
01160 }
01161 catch(const char* e)
01162 {
01163 Base::Console().Error(e);
01164 PyErr_SetString(PyExc_Exception,e);
01165 return NULL;
01166 }
01167
01168 #ifndef DONT_CATCH_CXX_EXCEPTIONS
01169 catch(const std::exception& e)
01170 {
01171 std::string str;
01172 str += "FC++ exception thrown (";
01173 str += e.what();
01174 str += ")";
01175 Base::Console().Error(str.c_str());
01176 PyErr_SetString(PyExc_Exception,str.c_str());
01177 return NULL;
01178 }
01179 catch(...)
01180 {
01181 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01182 return NULL;
01183 }
01184 #endif
01185 }
01186
01187
01188
01189
01190 PyObject * BezierCurvePy::staticCallback_getWeight (PyObject *self, PyObject *args)
01191 {
01192
01193 if (!((PyObjectBase*) self)->isValid()){
01194 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01195 return NULL;
01196 }
01197
01198
01199 if (((PyObjectBase*) self)->isConst()){
01200 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
01201 return NULL;
01202 }
01203
01204 try {
01205 PyObject* ret = ((BezierCurvePy*)self)->getWeight(args);
01206 if (ret != 0)
01207 ((BezierCurvePy*)self)->startNotify();
01208 return ret;
01209 }
01210 catch(const Base::Exception& e)
01211 {
01212 std::string str;
01213 str += "FreeCAD exception thrown (";
01214 str += e.what();
01215 str += ")";
01216 e.ReportException();
01217 PyErr_SetString(PyExc_Exception,str.c_str());
01218 return NULL;
01219 }
01220 catch(const boost::filesystem::filesystem_error& e)
01221 {
01222 std::string str;
01223 str += "File system exception thrown (";
01224
01225
01226 str += e.what();
01227 str += ")\n";
01228 Base::Console().Error(str.c_str());
01229 PyErr_SetString(PyExc_Exception,str.c_str());
01230 return NULL;
01231 }
01232 catch(const Py::Exception&)
01233 {
01234
01235 return NULL;
01236 }
01237 catch(const char* e)
01238 {
01239 Base::Console().Error(e);
01240 PyErr_SetString(PyExc_Exception,e);
01241 return NULL;
01242 }
01243
01244 #ifndef DONT_CATCH_CXX_EXCEPTIONS
01245 catch(const std::exception& e)
01246 {
01247 std::string str;
01248 str += "FC++ exception thrown (";
01249 str += e.what();
01250 str += ")";
01251 Base::Console().Error(str.c_str());
01252 PyErr_SetString(PyExc_Exception,str.c_str());
01253 return NULL;
01254 }
01255 catch(...)
01256 {
01257 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01258 return NULL;
01259 }
01260 #endif
01261 }
01262
01263
01264
01265
01266 PyObject * BezierCurvePy::staticCallback_getWeights (PyObject *self, PyObject *args)
01267 {
01268
01269 if (!((PyObjectBase*) self)->isValid()){
01270 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01271 return NULL;
01272 }
01273
01274
01275 if (((PyObjectBase*) self)->isConst()){
01276 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
01277 return NULL;
01278 }
01279
01280 try {
01281 PyObject* ret = ((BezierCurvePy*)self)->getWeights(args);
01282 if (ret != 0)
01283 ((BezierCurvePy*)self)->startNotify();
01284 return ret;
01285 }
01286 catch(const Base::Exception& e)
01287 {
01288 std::string str;
01289 str += "FreeCAD exception thrown (";
01290 str += e.what();
01291 str += ")";
01292 e.ReportException();
01293 PyErr_SetString(PyExc_Exception,str.c_str());
01294 return NULL;
01295 }
01296 catch(const boost::filesystem::filesystem_error& e)
01297 {
01298 std::string str;
01299 str += "File system exception thrown (";
01300
01301
01302 str += e.what();
01303 str += ")\n";
01304 Base::Console().Error(str.c_str());
01305 PyErr_SetString(PyExc_Exception,str.c_str());
01306 return NULL;
01307 }
01308 catch(const Py::Exception&)
01309 {
01310
01311 return NULL;
01312 }
01313 catch(const char* e)
01314 {
01315 Base::Console().Error(e);
01316 PyErr_SetString(PyExc_Exception,e);
01317 return NULL;
01318 }
01319
01320 #ifndef DONT_CATCH_CXX_EXCEPTIONS
01321 catch(const std::exception& e)
01322 {
01323 std::string str;
01324 str += "FC++ exception thrown (";
01325 str += e.what();
01326 str += ")";
01327 Base::Console().Error(str.c_str());
01328 PyErr_SetString(PyExc_Exception,str.c_str());
01329 return NULL;
01330 }
01331 catch(...)
01332 {
01333 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01334 return NULL;
01335 }
01336 #endif
01337 }
01338
01339
01340
01341
01342 PyObject * BezierCurvePy::staticCallback_getResolution (PyObject *self, PyObject *args)
01343 {
01344
01345 if (!((PyObjectBase*) self)->isValid()){
01346 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01347 return NULL;
01348 }
01349
01350
01351 try {
01352 PyObject* ret = ((BezierCurvePy*)self)->getResolution(args);
01353 return ret;
01354 }
01355 catch(const Base::Exception& e)
01356 {
01357 std::string str;
01358 str += "FreeCAD exception thrown (";
01359 str += e.what();
01360 str += ")";
01361 e.ReportException();
01362 PyErr_SetString(PyExc_Exception,str.c_str());
01363 return NULL;
01364 }
01365 catch(const boost::filesystem::filesystem_error& e)
01366 {
01367 std::string str;
01368 str += "File system exception thrown (";
01369
01370
01371 str += e.what();
01372 str += ")\n";
01373 Base::Console().Error(str.c_str());
01374 PyErr_SetString(PyExc_Exception,str.c_str());
01375 return NULL;
01376 }
01377 catch(const Py::Exception&)
01378 {
01379
01380 return NULL;
01381 }
01382 catch(const char* e)
01383 {
01384 Base::Console().Error(e);
01385 PyErr_SetString(PyExc_Exception,e);
01386 return NULL;
01387 }
01388
01389 #ifndef DONT_CATCH_CXX_EXCEPTIONS
01390 catch(const std::exception& e)
01391 {
01392 std::string str;
01393 str += "FC++ exception thrown (";
01394 str += e.what();
01395 str += ")";
01396 Base::Console().Error(str.c_str());
01397 PyErr_SetString(PyExc_Exception,str.c_str());
01398 return NULL;
01399 }
01400 catch(...)
01401 {
01402 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01403 return NULL;
01404 }
01405 #endif
01406 }
01407
01408
01409
01410
01411 PyObject * BezierCurvePy::staticCallback_getDegree (PyObject *self, void * )
01412 {
01413 if (!((PyObjectBase*) self)->isValid()){
01414 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01415 return NULL;
01416 }
01417
01418 try {
01419 return Py::new_reference_to(((BezierCurvePy*)self)->getDegree());
01420 } catch (const Py::Exception&) {
01421
01422 return NULL;
01423 } catch (...) {
01424 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Degree' of object 'GeomBezierCurve'");
01425 return NULL;
01426 }
01427 }
01428
01429 int BezierCurvePy::staticCallback_setDegree (PyObject *self, PyObject * , void * )
01430 {
01431 if (!((PyObjectBase*) self)->isValid()){
01432 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01433 return -1;
01434 }
01435
01436 PyErr_SetString(PyExc_AttributeError, "Attribute 'Degree' of object 'GeomBezierCurve' is read-only");
01437 return -1;
01438 }
01439
01440
01441
01442
01443 PyObject * BezierCurvePy::staticCallback_getMaxDegree (PyObject *self, void * )
01444 {
01445 if (!((PyObjectBase*) self)->isValid()){
01446 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01447 return NULL;
01448 }
01449
01450 try {
01451 return Py::new_reference_to(((BezierCurvePy*)self)->getMaxDegree());
01452 } catch (const Py::Exception&) {
01453
01454 return NULL;
01455 } catch (...) {
01456 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'MaxDegree' of object 'GeomBezierCurve'");
01457 return NULL;
01458 }
01459 }
01460
01461 int BezierCurvePy::staticCallback_setMaxDegree (PyObject *self, PyObject * , void * )
01462 {
01463 if (!((PyObjectBase*) self)->isValid()){
01464 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01465 return -1;
01466 }
01467
01468 PyErr_SetString(PyExc_AttributeError, "Attribute 'MaxDegree' of object 'GeomBezierCurve' is read-only");
01469 return -1;
01470 }
01471
01472
01473
01474
01475 PyObject * BezierCurvePy::staticCallback_getNbPoles (PyObject *self, void * )
01476 {
01477 if (!((PyObjectBase*) self)->isValid()){
01478 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01479 return NULL;
01480 }
01481
01482 try {
01483 return Py::new_reference_to(((BezierCurvePy*)self)->getNbPoles());
01484 } catch (const Py::Exception&) {
01485
01486 return NULL;
01487 } catch (...) {
01488 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'NbPoles' of object 'GeomBezierCurve'");
01489 return NULL;
01490 }
01491 }
01492
01493 int BezierCurvePy::staticCallback_setNbPoles (PyObject *self, PyObject * , void * )
01494 {
01495 if (!((PyObjectBase*) self)->isValid()){
01496 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01497 return -1;
01498 }
01499
01500 PyErr_SetString(PyExc_AttributeError, "Attribute 'NbPoles' of object 'GeomBezierCurve' is read-only");
01501 return -1;
01502 }
01503
01504
01505
01506
01507 PyObject * BezierCurvePy::staticCallback_getStartPoint (PyObject *self, void * )
01508 {
01509 if (!((PyObjectBase*) self)->isValid()){
01510 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01511 return NULL;
01512 }
01513
01514 try {
01515 return Py::new_reference_to(((BezierCurvePy*)self)->getStartPoint());
01516 } catch (const Py::Exception&) {
01517
01518 return NULL;
01519 } catch (...) {
01520 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'StartPoint' of object 'GeomBezierCurve'");
01521 return NULL;
01522 }
01523 }
01524
01525 int BezierCurvePy::staticCallback_setStartPoint (PyObject *self, PyObject * , void * )
01526 {
01527 if (!((PyObjectBase*) self)->isValid()){
01528 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01529 return -1;
01530 }
01531
01532 PyErr_SetString(PyExc_AttributeError, "Attribute 'StartPoint' of object 'GeomBezierCurve' is read-only");
01533 return -1;
01534 }
01535
01536
01537
01538
01539 PyObject * BezierCurvePy::staticCallback_getEndPoint (PyObject *self, void * )
01540 {
01541 if (!((PyObjectBase*) self)->isValid()){
01542 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01543 return NULL;
01544 }
01545
01546 try {
01547 return Py::new_reference_to(((BezierCurvePy*)self)->getEndPoint());
01548 } catch (const Py::Exception&) {
01549
01550 return NULL;
01551 } catch (...) {
01552 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'EndPoint' of object 'GeomBezierCurve'");
01553 return NULL;
01554 }
01555 }
01556
01557 int BezierCurvePy::staticCallback_setEndPoint (PyObject *self, PyObject * , void * )
01558 {
01559 if (!((PyObjectBase*) self)->isValid()){
01560 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01561 return -1;
01562 }
01563
01564 PyErr_SetString(PyExc_AttributeError, "Attribute 'EndPoint' of object 'GeomBezierCurve' is read-only");
01565 return -1;
01566 }
01567
01568
01569
01570
01571
01572
01573 PyParentObject BezierCurvePy::Parents[] = { PARENTSPartBezierCurvePy };
01574
01575
01576
01577
01578 BezierCurvePy::BezierCurvePy(GeomBezierCurve *pcObject, PyTypeObject *T)
01579 : GeometryCurvePy(reinterpret_cast<GeometryCurvePy::PointerType>(pcObject), T)
01580 {
01581 }
01582
01583
01584
01585
01586
01587 BezierCurvePy::~BezierCurvePy()
01588 {
01589 }
01590
01591
01592
01593
01594 PyObject *BezierCurvePy::_repr(void)
01595 {
01596 return Py_BuildValue("s", representation().c_str());
01597 }
01598
01599
01600
01601
01602 PyObject *BezierCurvePy::_getattr(char *attr)
01603 {
01604 try {
01605
01606 PyObject *r = getCustomAttributes(attr);
01607 if(r) return r;
01608 }
01609 #ifndef DONT_CATCH_CXX_EXCEPTIONS
01610 catch(const Base::Exception& e)
01611 {
01612 std::string str;
01613 str += "FreeCAD exception thrown (";
01614 str += e.what();
01615 str += ")";
01616 e.ReportException();
01617 PyErr_SetString(PyExc_Exception,str.c_str());
01618 return NULL;
01619 }
01620 catch(const std::exception& e)
01621 {
01622 std::string str;
01623 str += "FC++ exception thrown (";
01624 str += e.what();
01625 str += ")";
01626 Base::Console().Error(str.c_str());
01627 PyErr_SetString(PyExc_Exception,str.c_str());
01628 return NULL;
01629 }
01630 catch(const Py::Exception&)
01631 {
01632
01633 return NULL;
01634 }
01635 catch(...)
01636 {
01637 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01638 return NULL;
01639 }
01640 #else // DONT_CATCH_CXX_EXCEPTIONS
01641 catch(const Base::Exception& e)
01642 {
01643 std::string str;
01644 str += "FreeCAD exception thrown (";
01645 str += e.what();
01646 str += ")";
01647 e.ReportException();
01648 PyErr_SetString(PyExc_Exception,str.c_str());
01649 return NULL;
01650 }
01651 catch(const Py::Exception&)
01652 {
01653
01654 return NULL;
01655 }
01656 #endif // DONT_CATCH_CXX_EXCEPTIONS
01657
01658 PyObject *rvalue = Py_FindMethod(Methods, this, attr);
01659 if (rvalue == NULL)
01660 {
01661 PyErr_Clear();
01662 return GeometryCurvePy::_getattr(attr);
01663 }
01664 else
01665 {
01666 return rvalue;
01667 }
01668 }
01669
01670 int BezierCurvePy::_setattr(char *attr, PyObject *value)
01671 {
01672 try {
01673
01674 int r = setCustomAttributes(attr, value);
01675 if(r==1) return 0;
01676 }
01677 #ifndef DONT_CATCH_CXX_EXCEPTIONS
01678 catch(const Base::Exception& e)
01679 {
01680 std::string str;
01681 str += "FreeCAD exception thrown (";
01682 str += e.what();
01683 str += ")";
01684 e.ReportException();
01685 PyErr_SetString(PyExc_Exception,str.c_str());
01686 return -1;
01687 }
01688 catch(const std::exception& e)
01689 {
01690 std::string str;
01691 str += "FC++ exception thrown (";
01692 str += e.what();
01693 str += ")";
01694 Base::Console().Error(str.c_str());
01695 PyErr_SetString(PyExc_Exception,str.c_str());
01696 return -1;
01697 }
01698 catch(const Py::Exception&)
01699 {
01700
01701 return -1;
01702 }
01703 catch(...)
01704 {
01705 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01706 return -1;
01707 }
01708 #else // DONT_CATCH_CXX_EXCEPTIONS
01709 catch(const Base::Exception& e)
01710 {
01711 std::string str;
01712 str += "FreeCAD exception thrown (";
01713 str += e.what();
01714 str += ")";
01715 e.ReportException();
01716 PyErr_SetString(PyExc_Exception,str.c_str());
01717 return -1;
01718 }
01719 catch(const Py::Exception&)
01720 {
01721
01722 return -1;
01723 }
01724 #endif // DONT_CATCH_CXX_EXCEPTIONS
01725
01726 return GeometryCurvePy::_setattr(attr, value);
01727 }
01728
01729 GeomBezierCurve *BezierCurvePy::getGeomBezierCurvePtr(void) const
01730 {
01731 return static_cast<GeomBezierCurve *>(_pcTwinPointer);
01732 }
01733
01734 #if 0
01735
01736
01737
01738
01739 PyObject *BezierCurvePy::PyMake(struct _typeobject *, PyObject *, PyObject *)
01740 {
01741
01742 return new BezierCurvePy(new GeomBezierCurve);
01743 }
01744
01745
01746 int BezierCurvePy::PyInit(PyObject* , PyObject* )
01747 {
01748 return 0;
01749 }
01750
01751
01752 std::string BezierCurvePy::representation(void) const
01753 {
01754 return std::string("<GeomBezierCurve object>");
01755 }
01756
01757 PyObject* BezierCurvePy::isRational(PyObject *args)
01758 {
01759 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01760 return 0;
01761 }
01762
01763 PyObject* BezierCurvePy::isPeriodic(PyObject *args)
01764 {
01765 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01766 return 0;
01767 }
01768
01769 PyObject* BezierCurvePy::isClosed(PyObject *args)
01770 {
01771 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01772 return 0;
01773 }
01774
01775 PyObject* BezierCurvePy::increase(PyObject *args)
01776 {
01777 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01778 return 0;
01779 }
01780
01781 PyObject* BezierCurvePy::insertPoleAfter(PyObject *args)
01782 {
01783 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01784 return 0;
01785 }
01786
01787 PyObject* BezierCurvePy::insertPoleBefore(PyObject *args)
01788 {
01789 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01790 return 0;
01791 }
01792
01793 PyObject* BezierCurvePy::removePole(PyObject *args)
01794 {
01795 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01796 return 0;
01797 }
01798
01799 PyObject* BezierCurvePy::segment(PyObject *args)
01800 {
01801 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01802 return 0;
01803 }
01804
01805 PyObject* BezierCurvePy::setPole(PyObject *args)
01806 {
01807 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01808 return 0;
01809 }
01810
01811 PyObject* BezierCurvePy::getPole(PyObject *args)
01812 {
01813 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01814 return 0;
01815 }
01816
01817 PyObject* BezierCurvePy::getPoles(PyObject *args)
01818 {
01819 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01820 return 0;
01821 }
01822
01823 PyObject* BezierCurvePy::setPoles(PyObject *args)
01824 {
01825 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01826 return 0;
01827 }
01828
01829 PyObject* BezierCurvePy::setWeight(PyObject *args)
01830 {
01831 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01832 return 0;
01833 }
01834
01835 PyObject* BezierCurvePy::getWeight(PyObject *args)
01836 {
01837 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01838 return 0;
01839 }
01840
01841 PyObject* BezierCurvePy::getWeights(PyObject *args)
01842 {
01843 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01844 return 0;
01845 }
01846
01847 PyObject* BezierCurvePy::getResolution(PyObject *args)
01848 {
01849 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
01850 return 0;
01851 }
01852
01853
01854
01855 Py::Int BezierCurvePy::getDegree(void) const
01856 {
01857
01858 throw Py::AttributeError("Not yet implemented");
01859 }
01860
01861 Py::Int BezierCurvePy::getMaxDegree(void) const
01862 {
01863
01864 throw Py::AttributeError("Not yet implemented");
01865 }
01866
01867 Py::Int BezierCurvePy::getNbPoles(void) const
01868 {
01869
01870 throw Py::AttributeError("Not yet implemented");
01871 }
01872
01873 Py::Object BezierCurvePy::getStartPoint(void) const
01874 {
01875
01876 throw Py::AttributeError("Not yet implemented");
01877 }
01878
01879 Py::Object BezierCurvePy::getEndPoint(void) const
01880 {
01881
01882 throw Py::AttributeError("Not yet implemented");
01883 }
01884
01885 PyObject *BezierCurvePy::getCustomAttributes(const char* attr) const
01886 {
01887 return 0;
01888 }
01889
01890 int BezierCurvePy::setCustomAttributes(const char* attr, PyObject *obj)
01891 {
01892 return 0;
01893 }
01894 #endif
01895
01896
01897