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 Base;
00018
00020 PyTypeObject MatrixPy::Type = {
00021 PyObject_HEAD_INIT(&PyType_Type)
00022 0,
00023 "Base.Matrix",
00024 sizeof(MatrixPy),
00025 0,
00026
00027 PyDestructor,
00028 0,
00029 __getattr,
00030 __setattr,
00031 0,
00032 __repr,
00033 Base::MatrixPy::Number,
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 "A 4x4 Matrix",
00046 0,
00047 0,
00048 0,
00049 0,
00050 0,
00051 0,
00052 Base::MatrixPy::Methods,
00053 0,
00054 Base::MatrixPy::GetterSetter,
00055 &Base::PyObjectBase::Type,
00056 0,
00057 0,
00058 0,
00059 0,
00060 __PyInit,
00061 0,
00062 Base::MatrixPy::PyMake,
00063 0,
00064 0,
00065 0,
00066 0,
00067 0,
00068 0,
00069 0,
00070 0
00071 };
00072
00074 PyMethodDef MatrixPy::Methods[] = {
00075 {"move",
00076 (PyCFunction) staticCallback_move,
00077 METH_VARARGS,
00078 "\nmove(Vector)\nMove the matrix along the vector\n "
00079 },
00080 {"scale",
00081 (PyCFunction) staticCallback_scale,
00082 METH_VARARGS,
00083 "\nscale(Vector)\nScale the matrix with the vector\n "
00084 },
00085 {"unity",
00086 (PyCFunction) staticCallback_unity,
00087 METH_VARARGS,
00088 "unity() - make this matrix to unity"
00089 },
00090 {"transform",
00091 (PyCFunction) staticCallback_transform,
00092 METH_VARARGS,
00093 "transform(Vector,Matrix) - return the dot product of the two vectors"
00094 },
00095 {"rotateX",
00096 (PyCFunction) staticCallback_rotateX,
00097 METH_VARARGS,
00098 "rotateX(float) - rotate around X"
00099 },
00100 {"rotateY",
00101 (PyCFunction) staticCallback_rotateY,
00102 METH_VARARGS,
00103 "rotateY(float) - rotate around Y"
00104 },
00105 {"rotateZ",
00106 (PyCFunction) staticCallback_rotateZ,
00107 METH_VARARGS,
00108 "rotateZ(float) - rotate around Z"
00109 },
00110 {"multiply",
00111 (PyCFunction) staticCallback_multiply,
00112 METH_VARARGS,
00113 "\nmultiply(Matrix|Vector)\nMultiply a matrix or vector with this matrix\n "
00114 },
00115 {"invert",
00116 (PyCFunction) staticCallback_invert,
00117 METH_VARARGS,
00118 "\ninvert() -> None\nCompute the inverse matrix, if possible\n "
00119 },
00120 {"inverse",
00121 (PyCFunction) staticCallback_inverse,
00122 METH_VARARGS,
00123 "\ninverse() -> Matrix\nCompute the inverse matrix, if possible\n "
00124 },
00125 {"determinant",
00126 (PyCFunction) staticCallback_determinant,
00127 METH_VARARGS,
00128 "\ndeterminant() -> Float\nCompute the determinant of the matrix\n "
00129 },
00130 {NULL, NULL, 0, NULL}
00131 };
00132
00133 PyNumberMethods MatrixPy::Number[] = { {
00134 number_add_handler,
00135 number_subtract_handler,
00136 number_multiply_handler,
00137 NULL
00138 } };
00139
00140
00142 PyGetSetDef MatrixPy::GetterSetter[] = {
00143 {"A11",
00144 (getter) staticCallback_getA11,
00145 (setter) staticCallback_setA11,
00146 "The matrix elements",
00147 NULL
00148 },
00149 {"A12",
00150 (getter) staticCallback_getA12,
00151 (setter) staticCallback_setA12,
00152 "The matrix elements",
00153 NULL
00154 },
00155 {"A13",
00156 (getter) staticCallback_getA13,
00157 (setter) staticCallback_setA13,
00158 "The matrix elements",
00159 NULL
00160 },
00161 {"A14",
00162 (getter) staticCallback_getA14,
00163 (setter) staticCallback_setA14,
00164 "The matrix elements",
00165 NULL
00166 },
00167 {"A21",
00168 (getter) staticCallback_getA21,
00169 (setter) staticCallback_setA21,
00170 "The matrix elements",
00171 NULL
00172 },
00173 {"A22",
00174 (getter) staticCallback_getA22,
00175 (setter) staticCallback_setA22,
00176 "The matrix elements",
00177 NULL
00178 },
00179 {"A23",
00180 (getter) staticCallback_getA23,
00181 (setter) staticCallback_setA23,
00182 "The matrix elements",
00183 NULL
00184 },
00185 {"A24",
00186 (getter) staticCallback_getA24,
00187 (setter) staticCallback_setA24,
00188 "The matrix elements",
00189 NULL
00190 },
00191 {"A31",
00192 (getter) staticCallback_getA31,
00193 (setter) staticCallback_setA31,
00194 "The matrix elements",
00195 NULL
00196 },
00197 {"A32",
00198 (getter) staticCallback_getA32,
00199 (setter) staticCallback_setA32,
00200 "The matrix elements",
00201 NULL
00202 },
00203 {"A33",
00204 (getter) staticCallback_getA33,
00205 (setter) staticCallback_setA33,
00206 "The matrix elements",
00207 NULL
00208 },
00209 {"A34",
00210 (getter) staticCallback_getA34,
00211 (setter) staticCallback_setA34,
00212 "The matrix elements",
00213 NULL
00214 },
00215 {"A41",
00216 (getter) staticCallback_getA41,
00217 (setter) staticCallback_setA41,
00218 "The matrix elements",
00219 NULL
00220 },
00221 {"A42",
00222 (getter) staticCallback_getA42,
00223 (setter) staticCallback_setA42,
00224 "The matrix elements",
00225 NULL
00226 },
00227 {"A43",
00228 (getter) staticCallback_getA43,
00229 (setter) staticCallback_setA43,
00230 "The matrix elements",
00231 NULL
00232 },
00233 {"A44",
00234 (getter) staticCallback_getA44,
00235 (setter) staticCallback_setA44,
00236 "The matrix elements",
00237 NULL
00238 },
00239 {"A",
00240 (getter) staticCallback_getA,
00241 (setter) staticCallback_setA,
00242 "The matrix elements",
00243 NULL
00244 },
00245 {NULL, NULL, NULL, NULL, NULL}
00246 };
00247
00248
00249
00250
00251 PyObject * MatrixPy::staticCallback_move (PyObject *self, PyObject *args)
00252 {
00253
00254 if (!((PyObjectBase*) self)->isValid()){
00255 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00256 return NULL;
00257 }
00258
00259
00260 if (((PyObjectBase*) self)->isConst()){
00261 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00262 return NULL;
00263 }
00264
00265 try {
00266 PyObject* ret = ((MatrixPy*)self)->move(args);
00267 if (ret != 0)
00268 ((MatrixPy*)self)->startNotify();
00269 return ret;
00270 }
00271 catch(const Base::Exception& e)
00272 {
00273 std::string str;
00274 str += "FreeCAD exception thrown (";
00275 str += e.what();
00276 str += ")";
00277 e.ReportException();
00278 PyErr_SetString(PyExc_Exception,str.c_str());
00279 return NULL;
00280 }
00281 catch(const boost::filesystem::filesystem_error& e)
00282 {
00283 std::string str;
00284 str += "File system exception thrown (";
00285
00286
00287 str += e.what();
00288 str += ")\n";
00289 Base::Console().Error(str.c_str());
00290 PyErr_SetString(PyExc_Exception,str.c_str());
00291 return NULL;
00292 }
00293 catch(const Py::Exception&)
00294 {
00295
00296 return NULL;
00297 }
00298 catch(const char* e)
00299 {
00300 Base::Console().Error(e);
00301 PyErr_SetString(PyExc_Exception,e);
00302 return NULL;
00303 }
00304
00305 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00306 catch(const std::exception& e)
00307 {
00308 std::string str;
00309 str += "FC++ exception thrown (";
00310 str += e.what();
00311 str += ")";
00312 Base::Console().Error(str.c_str());
00313 PyErr_SetString(PyExc_Exception,str.c_str());
00314 return NULL;
00315 }
00316 catch(...)
00317 {
00318 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00319 return NULL;
00320 }
00321 #endif
00322 }
00323
00324
00325
00326
00327 PyObject * MatrixPy::staticCallback_scale (PyObject *self, PyObject *args)
00328 {
00329
00330 if (!((PyObjectBase*) self)->isValid()){
00331 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00332 return NULL;
00333 }
00334
00335
00336 if (((PyObjectBase*) self)->isConst()){
00337 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00338 return NULL;
00339 }
00340
00341 try {
00342 PyObject* ret = ((MatrixPy*)self)->scale(args);
00343 if (ret != 0)
00344 ((MatrixPy*)self)->startNotify();
00345 return ret;
00346 }
00347 catch(const Base::Exception& e)
00348 {
00349 std::string str;
00350 str += "FreeCAD exception thrown (";
00351 str += e.what();
00352 str += ")";
00353 e.ReportException();
00354 PyErr_SetString(PyExc_Exception,str.c_str());
00355 return NULL;
00356 }
00357 catch(const boost::filesystem::filesystem_error& e)
00358 {
00359 std::string str;
00360 str += "File system exception thrown (";
00361
00362
00363 str += e.what();
00364 str += ")\n";
00365 Base::Console().Error(str.c_str());
00366 PyErr_SetString(PyExc_Exception,str.c_str());
00367 return NULL;
00368 }
00369 catch(const Py::Exception&)
00370 {
00371
00372 return NULL;
00373 }
00374 catch(const char* e)
00375 {
00376 Base::Console().Error(e);
00377 PyErr_SetString(PyExc_Exception,e);
00378 return NULL;
00379 }
00380
00381 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00382 catch(const std::exception& e)
00383 {
00384 std::string str;
00385 str += "FC++ exception thrown (";
00386 str += e.what();
00387 str += ")";
00388 Base::Console().Error(str.c_str());
00389 PyErr_SetString(PyExc_Exception,str.c_str());
00390 return NULL;
00391 }
00392 catch(...)
00393 {
00394 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00395 return NULL;
00396 }
00397 #endif
00398 }
00399
00400
00401
00402
00403 PyObject * MatrixPy::staticCallback_unity (PyObject *self, PyObject *args)
00404 {
00405
00406 if (!((PyObjectBase*) self)->isValid()){
00407 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00408 return NULL;
00409 }
00410
00411
00412 if (((PyObjectBase*) self)->isConst()){
00413 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00414 return NULL;
00415 }
00416
00417 try {
00418 PyObject* ret = ((MatrixPy*)self)->unity(args);
00419 if (ret != 0)
00420 ((MatrixPy*)self)->startNotify();
00421 return ret;
00422 }
00423 catch(const Base::Exception& e)
00424 {
00425 std::string str;
00426 str += "FreeCAD exception thrown (";
00427 str += e.what();
00428 str += ")";
00429 e.ReportException();
00430 PyErr_SetString(PyExc_Exception,str.c_str());
00431 return NULL;
00432 }
00433 catch(const boost::filesystem::filesystem_error& e)
00434 {
00435 std::string str;
00436 str += "File system exception thrown (";
00437
00438
00439 str += e.what();
00440 str += ")\n";
00441 Base::Console().Error(str.c_str());
00442 PyErr_SetString(PyExc_Exception,str.c_str());
00443 return NULL;
00444 }
00445 catch(const Py::Exception&)
00446 {
00447
00448 return NULL;
00449 }
00450 catch(const char* e)
00451 {
00452 Base::Console().Error(e);
00453 PyErr_SetString(PyExc_Exception,e);
00454 return NULL;
00455 }
00456
00457 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00458 catch(const std::exception& e)
00459 {
00460 std::string str;
00461 str += "FC++ exception thrown (";
00462 str += e.what();
00463 str += ")";
00464 Base::Console().Error(str.c_str());
00465 PyErr_SetString(PyExc_Exception,str.c_str());
00466 return NULL;
00467 }
00468 catch(...)
00469 {
00470 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00471 return NULL;
00472 }
00473 #endif
00474 }
00475
00476
00477
00478
00479 PyObject * MatrixPy::staticCallback_transform (PyObject *self, PyObject *args)
00480 {
00481
00482 if (!((PyObjectBase*) self)->isValid()){
00483 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00484 return NULL;
00485 }
00486
00487
00488 if (((PyObjectBase*) self)->isConst()){
00489 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00490 return NULL;
00491 }
00492
00493 try {
00494 PyObject* ret = ((MatrixPy*)self)->transform(args);
00495 if (ret != 0)
00496 ((MatrixPy*)self)->startNotify();
00497 return ret;
00498 }
00499 catch(const Base::Exception& e)
00500 {
00501 std::string str;
00502 str += "FreeCAD exception thrown (";
00503 str += e.what();
00504 str += ")";
00505 e.ReportException();
00506 PyErr_SetString(PyExc_Exception,str.c_str());
00507 return NULL;
00508 }
00509 catch(const boost::filesystem::filesystem_error& e)
00510 {
00511 std::string str;
00512 str += "File system exception thrown (";
00513
00514
00515 str += e.what();
00516 str += ")\n";
00517 Base::Console().Error(str.c_str());
00518 PyErr_SetString(PyExc_Exception,str.c_str());
00519 return NULL;
00520 }
00521 catch(const Py::Exception&)
00522 {
00523
00524 return NULL;
00525 }
00526 catch(const char* e)
00527 {
00528 Base::Console().Error(e);
00529 PyErr_SetString(PyExc_Exception,e);
00530 return NULL;
00531 }
00532
00533 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00534 catch(const std::exception& e)
00535 {
00536 std::string str;
00537 str += "FC++ exception thrown (";
00538 str += e.what();
00539 str += ")";
00540 Base::Console().Error(str.c_str());
00541 PyErr_SetString(PyExc_Exception,str.c_str());
00542 return NULL;
00543 }
00544 catch(...)
00545 {
00546 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00547 return NULL;
00548 }
00549 #endif
00550 }
00551
00552
00553
00554
00555 PyObject * MatrixPy::staticCallback_rotateX (PyObject *self, PyObject *args)
00556 {
00557
00558 if (!((PyObjectBase*) self)->isValid()){
00559 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00560 return NULL;
00561 }
00562
00563
00564 if (((PyObjectBase*) self)->isConst()){
00565 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00566 return NULL;
00567 }
00568
00569 try {
00570 PyObject* ret = ((MatrixPy*)self)->rotateX(args);
00571 if (ret != 0)
00572 ((MatrixPy*)self)->startNotify();
00573 return ret;
00574 }
00575 catch(const Base::Exception& e)
00576 {
00577 std::string str;
00578 str += "FreeCAD exception thrown (";
00579 str += e.what();
00580 str += ")";
00581 e.ReportException();
00582 PyErr_SetString(PyExc_Exception,str.c_str());
00583 return NULL;
00584 }
00585 catch(const boost::filesystem::filesystem_error& e)
00586 {
00587 std::string str;
00588 str += "File system exception thrown (";
00589
00590
00591 str += e.what();
00592 str += ")\n";
00593 Base::Console().Error(str.c_str());
00594 PyErr_SetString(PyExc_Exception,str.c_str());
00595 return NULL;
00596 }
00597 catch(const Py::Exception&)
00598 {
00599
00600 return NULL;
00601 }
00602 catch(const char* e)
00603 {
00604 Base::Console().Error(e);
00605 PyErr_SetString(PyExc_Exception,e);
00606 return NULL;
00607 }
00608
00609 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00610 catch(const std::exception& e)
00611 {
00612 std::string str;
00613 str += "FC++ exception thrown (";
00614 str += e.what();
00615 str += ")";
00616 Base::Console().Error(str.c_str());
00617 PyErr_SetString(PyExc_Exception,str.c_str());
00618 return NULL;
00619 }
00620 catch(...)
00621 {
00622 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00623 return NULL;
00624 }
00625 #endif
00626 }
00627
00628
00629
00630
00631 PyObject * MatrixPy::staticCallback_rotateY (PyObject *self, PyObject *args)
00632 {
00633
00634 if (!((PyObjectBase*) self)->isValid()){
00635 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00636 return NULL;
00637 }
00638
00639
00640 if (((PyObjectBase*) self)->isConst()){
00641 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00642 return NULL;
00643 }
00644
00645 try {
00646 PyObject* ret = ((MatrixPy*)self)->rotateY(args);
00647 if (ret != 0)
00648 ((MatrixPy*)self)->startNotify();
00649 return ret;
00650 }
00651 catch(const Base::Exception& e)
00652 {
00653 std::string str;
00654 str += "FreeCAD exception thrown (";
00655 str += e.what();
00656 str += ")";
00657 e.ReportException();
00658 PyErr_SetString(PyExc_Exception,str.c_str());
00659 return NULL;
00660 }
00661 catch(const boost::filesystem::filesystem_error& e)
00662 {
00663 std::string str;
00664 str += "File system exception thrown (";
00665
00666
00667 str += e.what();
00668 str += ")\n";
00669 Base::Console().Error(str.c_str());
00670 PyErr_SetString(PyExc_Exception,str.c_str());
00671 return NULL;
00672 }
00673 catch(const Py::Exception&)
00674 {
00675
00676 return NULL;
00677 }
00678 catch(const char* e)
00679 {
00680 Base::Console().Error(e);
00681 PyErr_SetString(PyExc_Exception,e);
00682 return NULL;
00683 }
00684
00685 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00686 catch(const std::exception& e)
00687 {
00688 std::string str;
00689 str += "FC++ exception thrown (";
00690 str += e.what();
00691 str += ")";
00692 Base::Console().Error(str.c_str());
00693 PyErr_SetString(PyExc_Exception,str.c_str());
00694 return NULL;
00695 }
00696 catch(...)
00697 {
00698 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00699 return NULL;
00700 }
00701 #endif
00702 }
00703
00704
00705
00706
00707 PyObject * MatrixPy::staticCallback_rotateZ (PyObject *self, PyObject *args)
00708 {
00709
00710 if (!((PyObjectBase*) self)->isValid()){
00711 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00712 return NULL;
00713 }
00714
00715
00716 if (((PyObjectBase*) self)->isConst()){
00717 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00718 return NULL;
00719 }
00720
00721 try {
00722 PyObject* ret = ((MatrixPy*)self)->rotateZ(args);
00723 if (ret != 0)
00724 ((MatrixPy*)self)->startNotify();
00725 return ret;
00726 }
00727 catch(const Base::Exception& e)
00728 {
00729 std::string str;
00730 str += "FreeCAD exception thrown (";
00731 str += e.what();
00732 str += ")";
00733 e.ReportException();
00734 PyErr_SetString(PyExc_Exception,str.c_str());
00735 return NULL;
00736 }
00737 catch(const boost::filesystem::filesystem_error& e)
00738 {
00739 std::string str;
00740 str += "File system exception thrown (";
00741
00742
00743 str += e.what();
00744 str += ")\n";
00745 Base::Console().Error(str.c_str());
00746 PyErr_SetString(PyExc_Exception,str.c_str());
00747 return NULL;
00748 }
00749 catch(const Py::Exception&)
00750 {
00751
00752 return NULL;
00753 }
00754 catch(const char* e)
00755 {
00756 Base::Console().Error(e);
00757 PyErr_SetString(PyExc_Exception,e);
00758 return NULL;
00759 }
00760
00761 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00762 catch(const std::exception& e)
00763 {
00764 std::string str;
00765 str += "FC++ exception thrown (";
00766 str += e.what();
00767 str += ")";
00768 Base::Console().Error(str.c_str());
00769 PyErr_SetString(PyExc_Exception,str.c_str());
00770 return NULL;
00771 }
00772 catch(...)
00773 {
00774 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00775 return NULL;
00776 }
00777 #endif
00778 }
00779
00780
00781
00782
00783 PyObject * MatrixPy::staticCallback_multiply (PyObject *self, PyObject *args)
00784 {
00785
00786 if (!((PyObjectBase*) self)->isValid()){
00787 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00788 return NULL;
00789 }
00790
00791
00792 if (((PyObjectBase*) self)->isConst()){
00793 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00794 return NULL;
00795 }
00796
00797 try {
00798 PyObject* ret = ((MatrixPy*)self)->multiply(args);
00799 if (ret != 0)
00800 ((MatrixPy*)self)->startNotify();
00801 return ret;
00802 }
00803 catch(const Base::Exception& e)
00804 {
00805 std::string str;
00806 str += "FreeCAD exception thrown (";
00807 str += e.what();
00808 str += ")";
00809 e.ReportException();
00810 PyErr_SetString(PyExc_Exception,str.c_str());
00811 return NULL;
00812 }
00813 catch(const boost::filesystem::filesystem_error& e)
00814 {
00815 std::string str;
00816 str += "File system exception thrown (";
00817
00818
00819 str += e.what();
00820 str += ")\n";
00821 Base::Console().Error(str.c_str());
00822 PyErr_SetString(PyExc_Exception,str.c_str());
00823 return NULL;
00824 }
00825 catch(const Py::Exception&)
00826 {
00827
00828 return NULL;
00829 }
00830 catch(const char* e)
00831 {
00832 Base::Console().Error(e);
00833 PyErr_SetString(PyExc_Exception,e);
00834 return NULL;
00835 }
00836
00837 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00838 catch(const std::exception& e)
00839 {
00840 std::string str;
00841 str += "FC++ exception thrown (";
00842 str += e.what();
00843 str += ")";
00844 Base::Console().Error(str.c_str());
00845 PyErr_SetString(PyExc_Exception,str.c_str());
00846 return NULL;
00847 }
00848 catch(...)
00849 {
00850 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00851 return NULL;
00852 }
00853 #endif
00854 }
00855
00856
00857
00858
00859 PyObject * MatrixPy::staticCallback_invert (PyObject *self, PyObject *args)
00860 {
00861
00862 if (!((PyObjectBase*) self)->isValid()){
00863 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00864 return NULL;
00865 }
00866
00867
00868 if (((PyObjectBase*) self)->isConst()){
00869 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00870 return NULL;
00871 }
00872
00873 try {
00874 PyObject* ret = ((MatrixPy*)self)->invert(args);
00875 if (ret != 0)
00876 ((MatrixPy*)self)->startNotify();
00877 return ret;
00878 }
00879 catch(const Base::Exception& e)
00880 {
00881 std::string str;
00882 str += "FreeCAD exception thrown (";
00883 str += e.what();
00884 str += ")";
00885 e.ReportException();
00886 PyErr_SetString(PyExc_Exception,str.c_str());
00887 return NULL;
00888 }
00889 catch(const boost::filesystem::filesystem_error& e)
00890 {
00891 std::string str;
00892 str += "File system exception thrown (";
00893
00894
00895 str += e.what();
00896 str += ")\n";
00897 Base::Console().Error(str.c_str());
00898 PyErr_SetString(PyExc_Exception,str.c_str());
00899 return NULL;
00900 }
00901 catch(const Py::Exception&)
00902 {
00903
00904 return NULL;
00905 }
00906 catch(const char* e)
00907 {
00908 Base::Console().Error(e);
00909 PyErr_SetString(PyExc_Exception,e);
00910 return NULL;
00911 }
00912
00913 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00914 catch(const std::exception& e)
00915 {
00916 std::string str;
00917 str += "FC++ exception thrown (";
00918 str += e.what();
00919 str += ")";
00920 Base::Console().Error(str.c_str());
00921 PyErr_SetString(PyExc_Exception,str.c_str());
00922 return NULL;
00923 }
00924 catch(...)
00925 {
00926 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00927 return NULL;
00928 }
00929 #endif
00930 }
00931
00932
00933
00934
00935 PyObject * MatrixPy::staticCallback_inverse (PyObject *self, PyObject *args)
00936 {
00937
00938 if (!((PyObjectBase*) self)->isValid()){
00939 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00940 return NULL;
00941 }
00942
00943
00944 if (((PyObjectBase*) self)->isConst()){
00945 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00946 return NULL;
00947 }
00948
00949 try {
00950 PyObject* ret = ((MatrixPy*)self)->inverse(args);
00951 if (ret != 0)
00952 ((MatrixPy*)self)->startNotify();
00953 return ret;
00954 }
00955 catch(const Base::Exception& e)
00956 {
00957 std::string str;
00958 str += "FreeCAD exception thrown (";
00959 str += e.what();
00960 str += ")";
00961 e.ReportException();
00962 PyErr_SetString(PyExc_Exception,str.c_str());
00963 return NULL;
00964 }
00965 catch(const boost::filesystem::filesystem_error& e)
00966 {
00967 std::string str;
00968 str += "File system exception thrown (";
00969
00970
00971 str += e.what();
00972 str += ")\n";
00973 Base::Console().Error(str.c_str());
00974 PyErr_SetString(PyExc_Exception,str.c_str());
00975 return NULL;
00976 }
00977 catch(const Py::Exception&)
00978 {
00979
00980 return NULL;
00981 }
00982 catch(const char* e)
00983 {
00984 Base::Console().Error(e);
00985 PyErr_SetString(PyExc_Exception,e);
00986 return NULL;
00987 }
00988
00989 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00990 catch(const std::exception& e)
00991 {
00992 std::string str;
00993 str += "FC++ exception thrown (";
00994 str += e.what();
00995 str += ")";
00996 Base::Console().Error(str.c_str());
00997 PyErr_SetString(PyExc_Exception,str.c_str());
00998 return NULL;
00999 }
01000 catch(...)
01001 {
01002 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01003 return NULL;
01004 }
01005 #endif
01006 }
01007
01008
01009
01010
01011 PyObject * MatrixPy::staticCallback_determinant (PyObject *self, PyObject *args)
01012 {
01013
01014 if (!((PyObjectBase*) self)->isValid()){
01015 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01016 return NULL;
01017 }
01018
01019
01020 if (((PyObjectBase*) self)->isConst()){
01021 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
01022 return NULL;
01023 }
01024
01025 try {
01026 PyObject* ret = ((MatrixPy*)self)->determinant(args);
01027 if (ret != 0)
01028 ((MatrixPy*)self)->startNotify();
01029 return ret;
01030 }
01031 catch(const Base::Exception& e)
01032 {
01033 std::string str;
01034 str += "FreeCAD exception thrown (";
01035 str += e.what();
01036 str += ")";
01037 e.ReportException();
01038 PyErr_SetString(PyExc_Exception,str.c_str());
01039 return NULL;
01040 }
01041 catch(const boost::filesystem::filesystem_error& e)
01042 {
01043 std::string str;
01044 str += "File system exception thrown (";
01045
01046
01047 str += e.what();
01048 str += ")\n";
01049 Base::Console().Error(str.c_str());
01050 PyErr_SetString(PyExc_Exception,str.c_str());
01051 return NULL;
01052 }
01053 catch(const Py::Exception&)
01054 {
01055
01056 return NULL;
01057 }
01058 catch(const char* e)
01059 {
01060 Base::Console().Error(e);
01061 PyErr_SetString(PyExc_Exception,e);
01062 return NULL;
01063 }
01064
01065 #ifndef DONT_CATCH_CXX_EXCEPTIONS
01066 catch(const std::exception& e)
01067 {
01068 std::string str;
01069 str += "FC++ exception thrown (";
01070 str += e.what();
01071 str += ")";
01072 Base::Console().Error(str.c_str());
01073 PyErr_SetString(PyExc_Exception,str.c_str());
01074 return NULL;
01075 }
01076 catch(...)
01077 {
01078 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01079 return NULL;
01080 }
01081 #endif
01082 }
01083
01084
01085
01086
01087 PyObject * MatrixPy::staticCallback_getA11 (PyObject *self, void * )
01088 {
01089 if (!((PyObjectBase*) self)->isValid()){
01090 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01091 return NULL;
01092 }
01093
01094 try {
01095 return Py::new_reference_to(((MatrixPy*)self)->getA11());
01096 } catch (const Py::Exception&) {
01097
01098 return NULL;
01099 } catch (...) {
01100 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'A11' of object 'Matrix'");
01101 return NULL;
01102 }
01103 }
01104
01105 int MatrixPy::staticCallback_setA11 (PyObject *self, PyObject *value, void * )
01106 {
01107 if (!((PyObjectBase*) self)->isValid()){
01108 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01109 return -1;
01110 }
01111 if (((PyObjectBase*) self)->isConst()){
01112 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
01113 return -1;
01114 }
01115
01116 try {
01117 ((MatrixPy*)self)->setA11(Py::Float(value,false));
01118 return 0;
01119 } catch (const Py::Exception&) {
01120
01121 return -1;
01122 } catch (...) {
01123 PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'A11' of object 'Matrix'");
01124 return -1;
01125 }
01126 }
01127
01128
01129
01130
01131 PyObject * MatrixPy::staticCallback_getA12 (PyObject *self, void * )
01132 {
01133 if (!((PyObjectBase*) self)->isValid()){
01134 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01135 return NULL;
01136 }
01137
01138 try {
01139 return Py::new_reference_to(((MatrixPy*)self)->getA12());
01140 } catch (const Py::Exception&) {
01141
01142 return NULL;
01143 } catch (...) {
01144 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'A12' of object 'Matrix'");
01145 return NULL;
01146 }
01147 }
01148
01149 int MatrixPy::staticCallback_setA12 (PyObject *self, PyObject *value, void * )
01150 {
01151 if (!((PyObjectBase*) self)->isValid()){
01152 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01153 return -1;
01154 }
01155 if (((PyObjectBase*) self)->isConst()){
01156 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
01157 return -1;
01158 }
01159
01160 try {
01161 ((MatrixPy*)self)->setA12(Py::Float(value,false));
01162 return 0;
01163 } catch (const Py::Exception&) {
01164
01165 return -1;
01166 } catch (...) {
01167 PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'A12' of object 'Matrix'");
01168 return -1;
01169 }
01170 }
01171
01172
01173
01174
01175 PyObject * MatrixPy::staticCallback_getA13 (PyObject *self, void * )
01176 {
01177 if (!((PyObjectBase*) self)->isValid()){
01178 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01179 return NULL;
01180 }
01181
01182 try {
01183 return Py::new_reference_to(((MatrixPy*)self)->getA13());
01184 } catch (const Py::Exception&) {
01185
01186 return NULL;
01187 } catch (...) {
01188 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'A13' of object 'Matrix'");
01189 return NULL;
01190 }
01191 }
01192
01193 int MatrixPy::staticCallback_setA13 (PyObject *self, PyObject *value, void * )
01194 {
01195 if (!((PyObjectBase*) self)->isValid()){
01196 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01197 return -1;
01198 }
01199 if (((PyObjectBase*) self)->isConst()){
01200 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
01201 return -1;
01202 }
01203
01204 try {
01205 ((MatrixPy*)self)->setA13(Py::Float(value,false));
01206 return 0;
01207 } catch (const Py::Exception&) {
01208
01209 return -1;
01210 } catch (...) {
01211 PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'A13' of object 'Matrix'");
01212 return -1;
01213 }
01214 }
01215
01216
01217
01218
01219 PyObject * MatrixPy::staticCallback_getA14 (PyObject *self, void * )
01220 {
01221 if (!((PyObjectBase*) self)->isValid()){
01222 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01223 return NULL;
01224 }
01225
01226 try {
01227 return Py::new_reference_to(((MatrixPy*)self)->getA14());
01228 } catch (const Py::Exception&) {
01229
01230 return NULL;
01231 } catch (...) {
01232 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'A14' of object 'Matrix'");
01233 return NULL;
01234 }
01235 }
01236
01237 int MatrixPy::staticCallback_setA14 (PyObject *self, PyObject *value, void * )
01238 {
01239 if (!((PyObjectBase*) self)->isValid()){
01240 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01241 return -1;
01242 }
01243 if (((PyObjectBase*) self)->isConst()){
01244 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
01245 return -1;
01246 }
01247
01248 try {
01249 ((MatrixPy*)self)->setA14(Py::Float(value,false));
01250 return 0;
01251 } catch (const Py::Exception&) {
01252
01253 return -1;
01254 } catch (...) {
01255 PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'A14' of object 'Matrix'");
01256 return -1;
01257 }
01258 }
01259
01260
01261
01262
01263 PyObject * MatrixPy::staticCallback_getA21 (PyObject *self, void * )
01264 {
01265 if (!((PyObjectBase*) self)->isValid()){
01266 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01267 return NULL;
01268 }
01269
01270 try {
01271 return Py::new_reference_to(((MatrixPy*)self)->getA21());
01272 } catch (const Py::Exception&) {
01273
01274 return NULL;
01275 } catch (...) {
01276 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'A21' of object 'Matrix'");
01277 return NULL;
01278 }
01279 }
01280
01281 int MatrixPy::staticCallback_setA21 (PyObject *self, PyObject *value, void * )
01282 {
01283 if (!((PyObjectBase*) self)->isValid()){
01284 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01285 return -1;
01286 }
01287 if (((PyObjectBase*) self)->isConst()){
01288 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
01289 return -1;
01290 }
01291
01292 try {
01293 ((MatrixPy*)self)->setA21(Py::Float(value,false));
01294 return 0;
01295 } catch (const Py::Exception&) {
01296
01297 return -1;
01298 } catch (...) {
01299 PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'A21' of object 'Matrix'");
01300 return -1;
01301 }
01302 }
01303
01304
01305
01306
01307 PyObject * MatrixPy::staticCallback_getA22 (PyObject *self, void * )
01308 {
01309 if (!((PyObjectBase*) self)->isValid()){
01310 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01311 return NULL;
01312 }
01313
01314 try {
01315 return Py::new_reference_to(((MatrixPy*)self)->getA22());
01316 } catch (const Py::Exception&) {
01317
01318 return NULL;
01319 } catch (...) {
01320 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'A22' of object 'Matrix'");
01321 return NULL;
01322 }
01323 }
01324
01325 int MatrixPy::staticCallback_setA22 (PyObject *self, PyObject *value, void * )
01326 {
01327 if (!((PyObjectBase*) self)->isValid()){
01328 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01329 return -1;
01330 }
01331 if (((PyObjectBase*) self)->isConst()){
01332 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
01333 return -1;
01334 }
01335
01336 try {
01337 ((MatrixPy*)self)->setA22(Py::Float(value,false));
01338 return 0;
01339 } catch (const Py::Exception&) {
01340
01341 return -1;
01342 } catch (...) {
01343 PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'A22' of object 'Matrix'");
01344 return -1;
01345 }
01346 }
01347
01348
01349
01350
01351 PyObject * MatrixPy::staticCallback_getA23 (PyObject *self, void * )
01352 {
01353 if (!((PyObjectBase*) self)->isValid()){
01354 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01355 return NULL;
01356 }
01357
01358 try {
01359 return Py::new_reference_to(((MatrixPy*)self)->getA23());
01360 } catch (const Py::Exception&) {
01361
01362 return NULL;
01363 } catch (...) {
01364 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'A23' of object 'Matrix'");
01365 return NULL;
01366 }
01367 }
01368
01369 int MatrixPy::staticCallback_setA23 (PyObject *self, PyObject *value, void * )
01370 {
01371 if (!((PyObjectBase*) self)->isValid()){
01372 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01373 return -1;
01374 }
01375 if (((PyObjectBase*) self)->isConst()){
01376 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
01377 return -1;
01378 }
01379
01380 try {
01381 ((MatrixPy*)self)->setA23(Py::Float(value,false));
01382 return 0;
01383 } catch (const Py::Exception&) {
01384
01385 return -1;
01386 } catch (...) {
01387 PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'A23' of object 'Matrix'");
01388 return -1;
01389 }
01390 }
01391
01392
01393
01394
01395 PyObject * MatrixPy::staticCallback_getA24 (PyObject *self, void * )
01396 {
01397 if (!((PyObjectBase*) self)->isValid()){
01398 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01399 return NULL;
01400 }
01401
01402 try {
01403 return Py::new_reference_to(((MatrixPy*)self)->getA24());
01404 } catch (const Py::Exception&) {
01405
01406 return NULL;
01407 } catch (...) {
01408 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'A24' of object 'Matrix'");
01409 return NULL;
01410 }
01411 }
01412
01413 int MatrixPy::staticCallback_setA24 (PyObject *self, PyObject *value, void * )
01414 {
01415 if (!((PyObjectBase*) self)->isValid()){
01416 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01417 return -1;
01418 }
01419 if (((PyObjectBase*) self)->isConst()){
01420 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
01421 return -1;
01422 }
01423
01424 try {
01425 ((MatrixPy*)self)->setA24(Py::Float(value,false));
01426 return 0;
01427 } catch (const Py::Exception&) {
01428
01429 return -1;
01430 } catch (...) {
01431 PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'A24' of object 'Matrix'");
01432 return -1;
01433 }
01434 }
01435
01436
01437
01438
01439 PyObject * MatrixPy::staticCallback_getA31 (PyObject *self, void * )
01440 {
01441 if (!((PyObjectBase*) self)->isValid()){
01442 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01443 return NULL;
01444 }
01445
01446 try {
01447 return Py::new_reference_to(((MatrixPy*)self)->getA31());
01448 } catch (const Py::Exception&) {
01449
01450 return NULL;
01451 } catch (...) {
01452 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'A31' of object 'Matrix'");
01453 return NULL;
01454 }
01455 }
01456
01457 int MatrixPy::staticCallback_setA31 (PyObject *self, PyObject *value, void * )
01458 {
01459 if (!((PyObjectBase*) self)->isValid()){
01460 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01461 return -1;
01462 }
01463 if (((PyObjectBase*) self)->isConst()){
01464 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
01465 return -1;
01466 }
01467
01468 try {
01469 ((MatrixPy*)self)->setA31(Py::Float(value,false));
01470 return 0;
01471 } catch (const Py::Exception&) {
01472
01473 return -1;
01474 } catch (...) {
01475 PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'A31' of object 'Matrix'");
01476 return -1;
01477 }
01478 }
01479
01480
01481
01482
01483 PyObject * MatrixPy::staticCallback_getA32 (PyObject *self, void * )
01484 {
01485 if (!((PyObjectBase*) self)->isValid()){
01486 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01487 return NULL;
01488 }
01489
01490 try {
01491 return Py::new_reference_to(((MatrixPy*)self)->getA32());
01492 } catch (const Py::Exception&) {
01493
01494 return NULL;
01495 } catch (...) {
01496 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'A32' of object 'Matrix'");
01497 return NULL;
01498 }
01499 }
01500
01501 int MatrixPy::staticCallback_setA32 (PyObject *self, PyObject *value, void * )
01502 {
01503 if (!((PyObjectBase*) self)->isValid()){
01504 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01505 return -1;
01506 }
01507 if (((PyObjectBase*) self)->isConst()){
01508 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
01509 return -1;
01510 }
01511
01512 try {
01513 ((MatrixPy*)self)->setA32(Py::Float(value,false));
01514 return 0;
01515 } catch (const Py::Exception&) {
01516
01517 return -1;
01518 } catch (...) {
01519 PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'A32' of object 'Matrix'");
01520 return -1;
01521 }
01522 }
01523
01524
01525
01526
01527 PyObject * MatrixPy::staticCallback_getA33 (PyObject *self, void * )
01528 {
01529 if (!((PyObjectBase*) self)->isValid()){
01530 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01531 return NULL;
01532 }
01533
01534 try {
01535 return Py::new_reference_to(((MatrixPy*)self)->getA33());
01536 } catch (const Py::Exception&) {
01537
01538 return NULL;
01539 } catch (...) {
01540 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'A33' of object 'Matrix'");
01541 return NULL;
01542 }
01543 }
01544
01545 int MatrixPy::staticCallback_setA33 (PyObject *self, PyObject *value, void * )
01546 {
01547 if (!((PyObjectBase*) self)->isValid()){
01548 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01549 return -1;
01550 }
01551 if (((PyObjectBase*) self)->isConst()){
01552 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
01553 return -1;
01554 }
01555
01556 try {
01557 ((MatrixPy*)self)->setA33(Py::Float(value,false));
01558 return 0;
01559 } catch (const Py::Exception&) {
01560
01561 return -1;
01562 } catch (...) {
01563 PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'A33' of object 'Matrix'");
01564 return -1;
01565 }
01566 }
01567
01568
01569
01570
01571 PyObject * MatrixPy::staticCallback_getA34 (PyObject *self, void * )
01572 {
01573 if (!((PyObjectBase*) self)->isValid()){
01574 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01575 return NULL;
01576 }
01577
01578 try {
01579 return Py::new_reference_to(((MatrixPy*)self)->getA34());
01580 } catch (const Py::Exception&) {
01581
01582 return NULL;
01583 } catch (...) {
01584 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'A34' of object 'Matrix'");
01585 return NULL;
01586 }
01587 }
01588
01589 int MatrixPy::staticCallback_setA34 (PyObject *self, PyObject *value, void * )
01590 {
01591 if (!((PyObjectBase*) self)->isValid()){
01592 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01593 return -1;
01594 }
01595 if (((PyObjectBase*) self)->isConst()){
01596 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
01597 return -1;
01598 }
01599
01600 try {
01601 ((MatrixPy*)self)->setA34(Py::Float(value,false));
01602 return 0;
01603 } catch (const Py::Exception&) {
01604
01605 return -1;
01606 } catch (...) {
01607 PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'A34' of object 'Matrix'");
01608 return -1;
01609 }
01610 }
01611
01612
01613
01614
01615 PyObject * MatrixPy::staticCallback_getA41 (PyObject *self, void * )
01616 {
01617 if (!((PyObjectBase*) self)->isValid()){
01618 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01619 return NULL;
01620 }
01621
01622 try {
01623 return Py::new_reference_to(((MatrixPy*)self)->getA41());
01624 } catch (const Py::Exception&) {
01625
01626 return NULL;
01627 } catch (...) {
01628 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'A41' of object 'Matrix'");
01629 return NULL;
01630 }
01631 }
01632
01633 int MatrixPy::staticCallback_setA41 (PyObject *self, PyObject *value, void * )
01634 {
01635 if (!((PyObjectBase*) self)->isValid()){
01636 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01637 return -1;
01638 }
01639 if (((PyObjectBase*) self)->isConst()){
01640 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
01641 return -1;
01642 }
01643
01644 try {
01645 ((MatrixPy*)self)->setA41(Py::Float(value,false));
01646 return 0;
01647 } catch (const Py::Exception&) {
01648
01649 return -1;
01650 } catch (...) {
01651 PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'A41' of object 'Matrix'");
01652 return -1;
01653 }
01654 }
01655
01656
01657
01658
01659 PyObject * MatrixPy::staticCallback_getA42 (PyObject *self, void * )
01660 {
01661 if (!((PyObjectBase*) self)->isValid()){
01662 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01663 return NULL;
01664 }
01665
01666 try {
01667 return Py::new_reference_to(((MatrixPy*)self)->getA42());
01668 } catch (const Py::Exception&) {
01669
01670 return NULL;
01671 } catch (...) {
01672 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'A42' of object 'Matrix'");
01673 return NULL;
01674 }
01675 }
01676
01677 int MatrixPy::staticCallback_setA42 (PyObject *self, PyObject *value, void * )
01678 {
01679 if (!((PyObjectBase*) self)->isValid()){
01680 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01681 return -1;
01682 }
01683 if (((PyObjectBase*) self)->isConst()){
01684 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
01685 return -1;
01686 }
01687
01688 try {
01689 ((MatrixPy*)self)->setA42(Py::Float(value,false));
01690 return 0;
01691 } catch (const Py::Exception&) {
01692
01693 return -1;
01694 } catch (...) {
01695 PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'A42' of object 'Matrix'");
01696 return -1;
01697 }
01698 }
01699
01700
01701
01702
01703 PyObject * MatrixPy::staticCallback_getA43 (PyObject *self, void * )
01704 {
01705 if (!((PyObjectBase*) self)->isValid()){
01706 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01707 return NULL;
01708 }
01709
01710 try {
01711 return Py::new_reference_to(((MatrixPy*)self)->getA43());
01712 } catch (const Py::Exception&) {
01713
01714 return NULL;
01715 } catch (...) {
01716 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'A43' of object 'Matrix'");
01717 return NULL;
01718 }
01719 }
01720
01721 int MatrixPy::staticCallback_setA43 (PyObject *self, PyObject *value, void * )
01722 {
01723 if (!((PyObjectBase*) self)->isValid()){
01724 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01725 return -1;
01726 }
01727 if (((PyObjectBase*) self)->isConst()){
01728 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
01729 return -1;
01730 }
01731
01732 try {
01733 ((MatrixPy*)self)->setA43(Py::Float(value,false));
01734 return 0;
01735 } catch (const Py::Exception&) {
01736
01737 return -1;
01738 } catch (...) {
01739 PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'A43' of object 'Matrix'");
01740 return -1;
01741 }
01742 }
01743
01744
01745
01746
01747 PyObject * MatrixPy::staticCallback_getA44 (PyObject *self, void * )
01748 {
01749 if (!((PyObjectBase*) self)->isValid()){
01750 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01751 return NULL;
01752 }
01753
01754 try {
01755 return Py::new_reference_to(((MatrixPy*)self)->getA44());
01756 } catch (const Py::Exception&) {
01757
01758 return NULL;
01759 } catch (...) {
01760 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'A44' of object 'Matrix'");
01761 return NULL;
01762 }
01763 }
01764
01765 int MatrixPy::staticCallback_setA44 (PyObject *self, PyObject *value, void * )
01766 {
01767 if (!((PyObjectBase*) self)->isValid()){
01768 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01769 return -1;
01770 }
01771 if (((PyObjectBase*) self)->isConst()){
01772 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
01773 return -1;
01774 }
01775
01776 try {
01777 ((MatrixPy*)self)->setA44(Py::Float(value,false));
01778 return 0;
01779 } catch (const Py::Exception&) {
01780
01781 return -1;
01782 } catch (...) {
01783 PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'A44' of object 'Matrix'");
01784 return -1;
01785 }
01786 }
01787
01788
01789
01790
01791 PyObject * MatrixPy::staticCallback_getA (PyObject *self, void * )
01792 {
01793 if (!((PyObjectBase*) self)->isValid()){
01794 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01795 return NULL;
01796 }
01797
01798 try {
01799 return Py::new_reference_to(((MatrixPy*)self)->getA());
01800 } catch (const Py::Exception&) {
01801
01802 return NULL;
01803 } catch (...) {
01804 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'A' of object 'Matrix'");
01805 return NULL;
01806 }
01807 }
01808
01809 int MatrixPy::staticCallback_setA (PyObject *self, PyObject *value, void * )
01810 {
01811 if (!((PyObjectBase*) self)->isValid()){
01812 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
01813 return -1;
01814 }
01815 if (((PyObjectBase*) self)->isConst()){
01816 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a method");
01817 return -1;
01818 }
01819
01820 try {
01821 ((MatrixPy*)self)->setA(Py::List(value,false));
01822 return 0;
01823 } catch (const Py::Exception&) {
01824
01825 return -1;
01826 } catch (...) {
01827 PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute 'A' of object 'Matrix'");
01828 return -1;
01829 }
01830 }
01831
01832
01833
01834
01835
01836
01837 PyParentObject MatrixPy::Parents[] = { PARENTSBaseMatrixPy };
01838
01839
01840
01841
01842 MatrixPy::MatrixPy(Matrix4D *pcObject, PyTypeObject *T)
01843 : PyObjectBase(reinterpret_cast<PyObjectBase::PointerType>(pcObject), T)
01844 {
01845 }
01846
01847
01848
01849
01850
01851 MatrixPy::~MatrixPy()
01852 {
01853
01854 MatrixPy::PointerType ptr = reinterpret_cast<MatrixPy::PointerType>(_pcTwinPointer);
01855 delete ptr;
01856 }
01857
01858
01859
01860
01861 PyObject *MatrixPy::_repr(void)
01862 {
01863 return Py_BuildValue("s", representation().c_str());
01864 }
01865
01866
01867
01868
01869 PyObject *MatrixPy::_getattr(char *attr)
01870 {
01871 try {
01872
01873 PyObject *r = getCustomAttributes(attr);
01874 if(r) return r;
01875 }
01876 #ifndef DONT_CATCH_CXX_EXCEPTIONS
01877 catch(const Base::Exception& e)
01878 {
01879 std::string str;
01880 str += "FreeCAD exception thrown (";
01881 str += e.what();
01882 str += ")";
01883 e.ReportException();
01884 PyErr_SetString(PyExc_Exception,str.c_str());
01885 return NULL;
01886 }
01887 catch(const std::exception& e)
01888 {
01889 std::string str;
01890 str += "FC++ exception thrown (";
01891 str += e.what();
01892 str += ")";
01893 Base::Console().Error(str.c_str());
01894 PyErr_SetString(PyExc_Exception,str.c_str());
01895 return NULL;
01896 }
01897 catch(const Py::Exception&)
01898 {
01899
01900 return NULL;
01901 }
01902 catch(...)
01903 {
01904 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01905 return NULL;
01906 }
01907 #else // DONT_CATCH_CXX_EXCEPTIONS
01908 catch(const Base::Exception& e)
01909 {
01910 std::string str;
01911 str += "FreeCAD exception thrown (";
01912 str += e.what();
01913 str += ")";
01914 e.ReportException();
01915 PyErr_SetString(PyExc_Exception,str.c_str());
01916 return NULL;
01917 }
01918 catch(const Py::Exception&)
01919 {
01920
01921 return NULL;
01922 }
01923 #endif // DONT_CATCH_CXX_EXCEPTIONS
01924
01925 PyObject *rvalue = Py_FindMethod(Methods, this, attr);
01926 if (rvalue == NULL)
01927 {
01928 PyErr_Clear();
01929 return PyObjectBase::_getattr(attr);
01930 }
01931 else
01932 {
01933 return rvalue;
01934 }
01935 }
01936
01937 int MatrixPy::_setattr(char *attr, PyObject *value)
01938 {
01939 try {
01940
01941 int r = setCustomAttributes(attr, value);
01942 if(r==1) return 0;
01943 }
01944 #ifndef DONT_CATCH_CXX_EXCEPTIONS
01945 catch(const Base::Exception& e)
01946 {
01947 std::string str;
01948 str += "FreeCAD exception thrown (";
01949 str += e.what();
01950 str += ")";
01951 e.ReportException();
01952 PyErr_SetString(PyExc_Exception,str.c_str());
01953 return -1;
01954 }
01955 catch(const std::exception& e)
01956 {
01957 std::string str;
01958 str += "FC++ exception thrown (";
01959 str += e.what();
01960 str += ")";
01961 Base::Console().Error(str.c_str());
01962 PyErr_SetString(PyExc_Exception,str.c_str());
01963 return -1;
01964 }
01965 catch(const Py::Exception&)
01966 {
01967
01968 return -1;
01969 }
01970 catch(...)
01971 {
01972 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
01973 return -1;
01974 }
01975 #else // DONT_CATCH_CXX_EXCEPTIONS
01976 catch(const Base::Exception& e)
01977 {
01978 std::string str;
01979 str += "FreeCAD exception thrown (";
01980 str += e.what();
01981 str += ")";
01982 e.ReportException();
01983 PyErr_SetString(PyExc_Exception,str.c_str());
01984 return -1;
01985 }
01986 catch(const Py::Exception&)
01987 {
01988
01989 return -1;
01990 }
01991 #endif // DONT_CATCH_CXX_EXCEPTIONS
01992
01993 return PyObjectBase::_setattr(attr, value);
01994 }
01995
01996 Matrix4D *MatrixPy::getMatrixPtr(void) const
01997 {
01998 return static_cast<Matrix4D *>(_pcTwinPointer);
01999 }
02000
02001 #if 0
02002
02003
02004
02005
02006 PyObject *MatrixPy::PyMake(struct _typeobject *, PyObject *, PyObject *)
02007 {
02008
02009 return new MatrixPy(new Matrix4D);
02010 }
02011
02012
02013 int MatrixPy::PyInit(PyObject* , PyObject* )
02014 {
02015 return 0;
02016 }
02017
02018
02019 std::string MatrixPy::representation(void) const
02020 {
02021 return std::string("<Matrix object>");
02022 }
02023
02024 PyObject* MatrixPy::move(PyObject *args)
02025 {
02026 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
02027 return 0;
02028 }
02029
02030 PyObject* MatrixPy::scale(PyObject *args)
02031 {
02032 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
02033 return 0;
02034 }
02035
02036 PyObject* MatrixPy::unity(PyObject *args)
02037 {
02038 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
02039 return 0;
02040 }
02041
02042 PyObject* MatrixPy::transform(PyObject *args)
02043 {
02044 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
02045 return 0;
02046 }
02047
02048 PyObject* MatrixPy::rotateX(PyObject *args)
02049 {
02050 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
02051 return 0;
02052 }
02053
02054 PyObject* MatrixPy::rotateY(PyObject *args)
02055 {
02056 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
02057 return 0;
02058 }
02059
02060 PyObject* MatrixPy::rotateZ(PyObject *args)
02061 {
02062 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
02063 return 0;
02064 }
02065
02066 PyObject* MatrixPy::multiply(PyObject *args)
02067 {
02068 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
02069 return 0;
02070 }
02071
02072 PyObject* MatrixPy::invert(PyObject *args)
02073 {
02074 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
02075 return 0;
02076 }
02077
02078 PyObject* MatrixPy::inverse(PyObject *args)
02079 {
02080 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
02081 return 0;
02082 }
02083
02084 PyObject* MatrixPy::determinant(PyObject *args)
02085 {
02086 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
02087 return 0;
02088 }
02089
02090 PyObject* MatrixPy::number_add_handler(PyObject *self, PyObject *other)
02091 {
02092 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
02093 return 0;
02094 }
02095
02096 PyObject* MatrixPy::number_subtract_handler(PyObject *self, PyObject *other)
02097 {
02098 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
02099 return 0;
02100 }
02101
02102 PyObject* MatrixPy::number_multiply_handler(PyObject *self, PyObject *other)
02103 {
02104 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
02105 return 0;
02106 }
02107
02108
02109 Py::Float MatrixPy::getA11(void) const
02110 {
02111
02112 throw Py::AttributeError("Not yet implemented");
02113 }
02114
02115 void MatrixPy::setA11(Py::Float arg)
02116 {
02117 throw Py::AttributeError("Not yet implemented");
02118 }
02119
02120 Py::Float MatrixPy::getA12(void) const
02121 {
02122
02123 throw Py::AttributeError("Not yet implemented");
02124 }
02125
02126 void MatrixPy::setA12(Py::Float arg)
02127 {
02128 throw Py::AttributeError("Not yet implemented");
02129 }
02130
02131 Py::Float MatrixPy::getA13(void) const
02132 {
02133
02134 throw Py::AttributeError("Not yet implemented");
02135 }
02136
02137 void MatrixPy::setA13(Py::Float arg)
02138 {
02139 throw Py::AttributeError("Not yet implemented");
02140 }
02141
02142 Py::Float MatrixPy::getA14(void) const
02143 {
02144
02145 throw Py::AttributeError("Not yet implemented");
02146 }
02147
02148 void MatrixPy::setA14(Py::Float arg)
02149 {
02150 throw Py::AttributeError("Not yet implemented");
02151 }
02152
02153 Py::Float MatrixPy::getA21(void) const
02154 {
02155
02156 throw Py::AttributeError("Not yet implemented");
02157 }
02158
02159 void MatrixPy::setA21(Py::Float arg)
02160 {
02161 throw Py::AttributeError("Not yet implemented");
02162 }
02163
02164 Py::Float MatrixPy::getA22(void) const
02165 {
02166
02167 throw Py::AttributeError("Not yet implemented");
02168 }
02169
02170 void MatrixPy::setA22(Py::Float arg)
02171 {
02172 throw Py::AttributeError("Not yet implemented");
02173 }
02174
02175 Py::Float MatrixPy::getA23(void) const
02176 {
02177
02178 throw Py::AttributeError("Not yet implemented");
02179 }
02180
02181 void MatrixPy::setA23(Py::Float arg)
02182 {
02183 throw Py::AttributeError("Not yet implemented");
02184 }
02185
02186 Py::Float MatrixPy::getA24(void) const
02187 {
02188
02189 throw Py::AttributeError("Not yet implemented");
02190 }
02191
02192 void MatrixPy::setA24(Py::Float arg)
02193 {
02194 throw Py::AttributeError("Not yet implemented");
02195 }
02196
02197 Py::Float MatrixPy::getA31(void) const
02198 {
02199
02200 throw Py::AttributeError("Not yet implemented");
02201 }
02202
02203 void MatrixPy::setA31(Py::Float arg)
02204 {
02205 throw Py::AttributeError("Not yet implemented");
02206 }
02207
02208 Py::Float MatrixPy::getA32(void) const
02209 {
02210
02211 throw Py::AttributeError("Not yet implemented");
02212 }
02213
02214 void MatrixPy::setA32(Py::Float arg)
02215 {
02216 throw Py::AttributeError("Not yet implemented");
02217 }
02218
02219 Py::Float MatrixPy::getA33(void) const
02220 {
02221
02222 throw Py::AttributeError("Not yet implemented");
02223 }
02224
02225 void MatrixPy::setA33(Py::Float arg)
02226 {
02227 throw Py::AttributeError("Not yet implemented");
02228 }
02229
02230 Py::Float MatrixPy::getA34(void) const
02231 {
02232
02233 throw Py::AttributeError("Not yet implemented");
02234 }
02235
02236 void MatrixPy::setA34(Py::Float arg)
02237 {
02238 throw Py::AttributeError("Not yet implemented");
02239 }
02240
02241 Py::Float MatrixPy::getA41(void) const
02242 {
02243
02244 throw Py::AttributeError("Not yet implemented");
02245 }
02246
02247 void MatrixPy::setA41(Py::Float arg)
02248 {
02249 throw Py::AttributeError("Not yet implemented");
02250 }
02251
02252 Py::Float MatrixPy::getA42(void) const
02253 {
02254
02255 throw Py::AttributeError("Not yet implemented");
02256 }
02257
02258 void MatrixPy::setA42(Py::Float arg)
02259 {
02260 throw Py::AttributeError("Not yet implemented");
02261 }
02262
02263 Py::Float MatrixPy::getA43(void) const
02264 {
02265
02266 throw Py::AttributeError("Not yet implemented");
02267 }
02268
02269 void MatrixPy::setA43(Py::Float arg)
02270 {
02271 throw Py::AttributeError("Not yet implemented");
02272 }
02273
02274 Py::Float MatrixPy::getA44(void) const
02275 {
02276
02277 throw Py::AttributeError("Not yet implemented");
02278 }
02279
02280 void MatrixPy::setA44(Py::Float arg)
02281 {
02282 throw Py::AttributeError("Not yet implemented");
02283 }
02284
02285 Py::List MatrixPy::getA(void) const
02286 {
02287
02288 throw Py::AttributeError("Not yet implemented");
02289 }
02290
02291 void MatrixPy::setA(Py::List arg)
02292 {
02293 throw Py::AttributeError("Not yet implemented");
02294 }
02295
02296 PyObject *MatrixPy::getCustomAttributes(const char* attr) const
02297 {
02298 return 0;
02299 }
02300
02301 int MatrixPy::setCustomAttributes(const char* attr, PyObject *obj)
02302 {
02303 return 0;
02304 }
02305 #endif
02306
02307
02308