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 Sketcher;
00018
00020 PyTypeObject SketchPy::Type = {
00021 PyObject_HEAD_INIT(&PyType_Type)
00022 0,
00023 "Sketcher.Sketch",
00024 sizeof(SketchPy),
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 "With this objects you can handle constraint sketches",
00046 0,
00047 0,
00048 0,
00049 0,
00050 0,
00051 0,
00052 Sketcher::SketchPy::Methods,
00053 0,
00054 Sketcher::SketchPy::GetterSetter,
00055 &Base::PersistencePy::Type,
00056 0,
00057 0,
00058 0,
00059 0,
00060 __PyInit,
00061 0,
00062 Sketcher::SketchPy::PyMake,
00063 0,
00064 0,
00065 0,
00066 0,
00067 0,
00068 0,
00069 0,
00070 0
00071 };
00072
00074 PyMethodDef SketchPy::Methods[] = {
00075 {"solve",
00076 (PyCFunction) staticCallback_solve,
00077 METH_VARARGS,
00078 "solve the actuall set of geometry and constraints"
00079 },
00080 {"addGeometry",
00081 (PyCFunction) staticCallback_addGeometry,
00082 METH_VARARGS,
00083 "add a geometric object to the sketch"
00084 },
00085 {"addConstraint",
00086 (PyCFunction) staticCallback_addConstraint,
00087 METH_VARARGS,
00088 "add an constraint object to the sketch"
00089 },
00090 {"clear",
00091 (PyCFunction) staticCallback_clear,
00092 METH_VARARGS,
00093 "clear the sketch"
00094 },
00095 {"movePoint",
00096 (PyCFunction) staticCallback_movePoint,
00097 METH_VARARGS,
00098 "\n movePoint(GeoIndex,PointPos,Vector,[relative]) - move a given point (or curve)\n to another location.\n It moves the specified point (or curve) to the given location by adding some\n temporary weak constraints and solve the sketch.\n This method is mostly used to allow the user to drag some portions of the sketch\n in real time by e.g. the mouse and it works only for underconstrained portions of\n the sketch.\n The argument 'relative', if present, states if the new location is given\n relatively to the current one.\n "
00099 },
00100 {NULL, NULL, 0, NULL}
00101 };
00102
00103
00104
00106 PyGetSetDef SketchPy::GetterSetter[] = {
00107 {"Constraint",
00108 (getter) staticCallback_getConstraint,
00109 (setter) staticCallback_setConstraint,
00110 "0: exactly constraint, -1 under-constraint, 1 over-constraint",
00111 NULL
00112 },
00113 {"Constraints",
00114 (getter) staticCallback_getConstraints,
00115 (setter) staticCallback_setConstraints,
00116 "Tuple of all constrains in this sketch",
00117 NULL
00118 },
00119 {"Geometries",
00120 (getter) staticCallback_getGeometries,
00121 (setter) staticCallback_setGeometries,
00122 "Tuple of all geometric elements in this sketch",
00123 NULL
00124 },
00125 {"Shape",
00126 (getter) staticCallback_getShape,
00127 (setter) staticCallback_setShape,
00128 "Resulting shape from the sketch geometry",
00129 NULL
00130 },
00131 {NULL, NULL, NULL, NULL, NULL}
00132 };
00133
00134
00135
00136
00137 PyObject * SketchPy::staticCallback_solve (PyObject *self, PyObject *args)
00138 {
00139
00140 if (!((PyObjectBase*) self)->isValid()){
00141 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00142 return NULL;
00143 }
00144
00145
00146 if (((PyObjectBase*) self)->isConst()){
00147 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00148 return NULL;
00149 }
00150
00151 try {
00152 PyObject* ret = ((SketchPy*)self)->solve(args);
00153 if (ret != 0)
00154 ((SketchPy*)self)->startNotify();
00155 return ret;
00156 }
00157 catch(const Base::Exception& e)
00158 {
00159 std::string str;
00160 str += "FreeCAD exception thrown (";
00161 str += e.what();
00162 str += ")";
00163 e.ReportException();
00164 PyErr_SetString(PyExc_Exception,str.c_str());
00165 return NULL;
00166 }
00167 catch(const boost::filesystem::filesystem_error& e)
00168 {
00169 std::string str;
00170 str += "File system exception thrown (";
00171
00172
00173 str += e.what();
00174 str += ")\n";
00175 Base::Console().Error(str.c_str());
00176 PyErr_SetString(PyExc_Exception,str.c_str());
00177 return NULL;
00178 }
00179 catch(const Py::Exception&)
00180 {
00181
00182 return NULL;
00183 }
00184 catch(const char* e)
00185 {
00186 Base::Console().Error(e);
00187 PyErr_SetString(PyExc_Exception,e);
00188 return NULL;
00189 }
00190
00191 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00192 catch(const std::exception& e)
00193 {
00194 std::string str;
00195 str += "FC++ exception thrown (";
00196 str += e.what();
00197 str += ")";
00198 Base::Console().Error(str.c_str());
00199 PyErr_SetString(PyExc_Exception,str.c_str());
00200 return NULL;
00201 }
00202 catch(...)
00203 {
00204 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00205 return NULL;
00206 }
00207 #endif
00208 }
00209
00210
00211
00212
00213 PyObject * SketchPy::staticCallback_addGeometry (PyObject *self, PyObject *args)
00214 {
00215
00216 if (!((PyObjectBase*) self)->isValid()){
00217 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00218 return NULL;
00219 }
00220
00221
00222 if (((PyObjectBase*) self)->isConst()){
00223 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00224 return NULL;
00225 }
00226
00227 try {
00228 PyObject* ret = ((SketchPy*)self)->addGeometry(args);
00229 if (ret != 0)
00230 ((SketchPy*)self)->startNotify();
00231 return ret;
00232 }
00233 catch(const Base::Exception& e)
00234 {
00235 std::string str;
00236 str += "FreeCAD exception thrown (";
00237 str += e.what();
00238 str += ")";
00239 e.ReportException();
00240 PyErr_SetString(PyExc_Exception,str.c_str());
00241 return NULL;
00242 }
00243 catch(const boost::filesystem::filesystem_error& e)
00244 {
00245 std::string str;
00246 str += "File system exception thrown (";
00247
00248
00249 str += e.what();
00250 str += ")\n";
00251 Base::Console().Error(str.c_str());
00252 PyErr_SetString(PyExc_Exception,str.c_str());
00253 return NULL;
00254 }
00255 catch(const Py::Exception&)
00256 {
00257
00258 return NULL;
00259 }
00260 catch(const char* e)
00261 {
00262 Base::Console().Error(e);
00263 PyErr_SetString(PyExc_Exception,e);
00264 return NULL;
00265 }
00266
00267 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00268 catch(const std::exception& e)
00269 {
00270 std::string str;
00271 str += "FC++ exception thrown (";
00272 str += e.what();
00273 str += ")";
00274 Base::Console().Error(str.c_str());
00275 PyErr_SetString(PyExc_Exception,str.c_str());
00276 return NULL;
00277 }
00278 catch(...)
00279 {
00280 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00281 return NULL;
00282 }
00283 #endif
00284 }
00285
00286
00287
00288
00289 PyObject * SketchPy::staticCallback_addConstraint (PyObject *self, PyObject *args)
00290 {
00291
00292 if (!((PyObjectBase*) self)->isValid()){
00293 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00294 return NULL;
00295 }
00296
00297
00298 if (((PyObjectBase*) self)->isConst()){
00299 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00300 return NULL;
00301 }
00302
00303 try {
00304 PyObject* ret = ((SketchPy*)self)->addConstraint(args);
00305 if (ret != 0)
00306 ((SketchPy*)self)->startNotify();
00307 return ret;
00308 }
00309 catch(const Base::Exception& e)
00310 {
00311 std::string str;
00312 str += "FreeCAD exception thrown (";
00313 str += e.what();
00314 str += ")";
00315 e.ReportException();
00316 PyErr_SetString(PyExc_Exception,str.c_str());
00317 return NULL;
00318 }
00319 catch(const boost::filesystem::filesystem_error& e)
00320 {
00321 std::string str;
00322 str += "File system exception thrown (";
00323
00324
00325 str += e.what();
00326 str += ")\n";
00327 Base::Console().Error(str.c_str());
00328 PyErr_SetString(PyExc_Exception,str.c_str());
00329 return NULL;
00330 }
00331 catch(const Py::Exception&)
00332 {
00333
00334 return NULL;
00335 }
00336 catch(const char* e)
00337 {
00338 Base::Console().Error(e);
00339 PyErr_SetString(PyExc_Exception,e);
00340 return NULL;
00341 }
00342
00343 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00344 catch(const std::exception& e)
00345 {
00346 std::string str;
00347 str += "FC++ exception thrown (";
00348 str += e.what();
00349 str += ")";
00350 Base::Console().Error(str.c_str());
00351 PyErr_SetString(PyExc_Exception,str.c_str());
00352 return NULL;
00353 }
00354 catch(...)
00355 {
00356 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00357 return NULL;
00358 }
00359 #endif
00360 }
00361
00362
00363
00364
00365 PyObject * SketchPy::staticCallback_clear (PyObject *self, PyObject *args)
00366 {
00367
00368 if (!((PyObjectBase*) self)->isValid()){
00369 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00370 return NULL;
00371 }
00372
00373
00374 if (((PyObjectBase*) self)->isConst()){
00375 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00376 return NULL;
00377 }
00378
00379 try {
00380 PyObject* ret = ((SketchPy*)self)->clear(args);
00381 if (ret != 0)
00382 ((SketchPy*)self)->startNotify();
00383 return ret;
00384 }
00385 catch(const Base::Exception& e)
00386 {
00387 std::string str;
00388 str += "FreeCAD exception thrown (";
00389 str += e.what();
00390 str += ")";
00391 e.ReportException();
00392 PyErr_SetString(PyExc_Exception,str.c_str());
00393 return NULL;
00394 }
00395 catch(const boost::filesystem::filesystem_error& e)
00396 {
00397 std::string str;
00398 str += "File system exception thrown (";
00399
00400
00401 str += e.what();
00402 str += ")\n";
00403 Base::Console().Error(str.c_str());
00404 PyErr_SetString(PyExc_Exception,str.c_str());
00405 return NULL;
00406 }
00407 catch(const Py::Exception&)
00408 {
00409
00410 return NULL;
00411 }
00412 catch(const char* e)
00413 {
00414 Base::Console().Error(e);
00415 PyErr_SetString(PyExc_Exception,e);
00416 return NULL;
00417 }
00418
00419 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00420 catch(const std::exception& e)
00421 {
00422 std::string str;
00423 str += "FC++ exception thrown (";
00424 str += e.what();
00425 str += ")";
00426 Base::Console().Error(str.c_str());
00427 PyErr_SetString(PyExc_Exception,str.c_str());
00428 return NULL;
00429 }
00430 catch(...)
00431 {
00432 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00433 return NULL;
00434 }
00435 #endif
00436 }
00437
00438
00439
00440
00441 PyObject * SketchPy::staticCallback_movePoint (PyObject *self, PyObject *args)
00442 {
00443
00444 if (!((PyObjectBase*) self)->isValid()){
00445 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00446 return NULL;
00447 }
00448
00449
00450 if (((PyObjectBase*) self)->isConst()){
00451 PyErr_SetString(PyExc_ReferenceError, "This object is immutable, you can not set any attribute or call a non const method");
00452 return NULL;
00453 }
00454
00455 try {
00456 PyObject* ret = ((SketchPy*)self)->movePoint(args);
00457 if (ret != 0)
00458 ((SketchPy*)self)->startNotify();
00459 return ret;
00460 }
00461 catch(const Base::Exception& e)
00462 {
00463 std::string str;
00464 str += "FreeCAD exception thrown (";
00465 str += e.what();
00466 str += ")";
00467 e.ReportException();
00468 PyErr_SetString(PyExc_Exception,str.c_str());
00469 return NULL;
00470 }
00471 catch(const boost::filesystem::filesystem_error& e)
00472 {
00473 std::string str;
00474 str += "File system exception thrown (";
00475
00476
00477 str += e.what();
00478 str += ")\n";
00479 Base::Console().Error(str.c_str());
00480 PyErr_SetString(PyExc_Exception,str.c_str());
00481 return NULL;
00482 }
00483 catch(const Py::Exception&)
00484 {
00485
00486 return NULL;
00487 }
00488 catch(const char* e)
00489 {
00490 Base::Console().Error(e);
00491 PyErr_SetString(PyExc_Exception,e);
00492 return NULL;
00493 }
00494
00495 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00496 catch(const std::exception& e)
00497 {
00498 std::string str;
00499 str += "FC++ exception thrown (";
00500 str += e.what();
00501 str += ")";
00502 Base::Console().Error(str.c_str());
00503 PyErr_SetString(PyExc_Exception,str.c_str());
00504 return NULL;
00505 }
00506 catch(...)
00507 {
00508 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00509 return NULL;
00510 }
00511 #endif
00512 }
00513
00514
00515
00516
00517 PyObject * SketchPy::staticCallback_getConstraint (PyObject *self, void * )
00518 {
00519 if (!((PyObjectBase*) self)->isValid()){
00520 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00521 return NULL;
00522 }
00523
00524 try {
00525 return Py::new_reference_to(((SketchPy*)self)->getConstraint());
00526 } catch (const Py::Exception&) {
00527
00528 return NULL;
00529 } catch (...) {
00530 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Constraint' of object 'Sketch'");
00531 return NULL;
00532 }
00533 }
00534
00535 int SketchPy::staticCallback_setConstraint (PyObject *self, PyObject * , void * )
00536 {
00537 if (!((PyObjectBase*) self)->isValid()){
00538 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00539 return -1;
00540 }
00541
00542 PyErr_SetString(PyExc_AttributeError, "Attribute 'Constraint' of object 'Sketch' is read-only");
00543 return -1;
00544 }
00545
00546
00547
00548
00549 PyObject * SketchPy::staticCallback_getConstraints (PyObject *self, void * )
00550 {
00551 if (!((PyObjectBase*) self)->isValid()){
00552 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00553 return NULL;
00554 }
00555
00556 try {
00557 return Py::new_reference_to(((SketchPy*)self)->getConstraints());
00558 } catch (const Py::Exception&) {
00559
00560 return NULL;
00561 } catch (...) {
00562 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Constraints' of object 'Sketch'");
00563 return NULL;
00564 }
00565 }
00566
00567 int SketchPy::staticCallback_setConstraints (PyObject *self, PyObject * , void * )
00568 {
00569 if (!((PyObjectBase*) self)->isValid()){
00570 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00571 return -1;
00572 }
00573
00574 PyErr_SetString(PyExc_AttributeError, "Attribute 'Constraints' of object 'Sketch' is read-only");
00575 return -1;
00576 }
00577
00578
00579
00580
00581 PyObject * SketchPy::staticCallback_getGeometries (PyObject *self, void * )
00582 {
00583 if (!((PyObjectBase*) self)->isValid()){
00584 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00585 return NULL;
00586 }
00587
00588 try {
00589 return Py::new_reference_to(((SketchPy*)self)->getGeometries());
00590 } catch (const Py::Exception&) {
00591
00592 return NULL;
00593 } catch (...) {
00594 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Geometries' of object 'Sketch'");
00595 return NULL;
00596 }
00597 }
00598
00599 int SketchPy::staticCallback_setGeometries (PyObject *self, PyObject * , void * )
00600 {
00601 if (!((PyObjectBase*) self)->isValid()){
00602 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00603 return -1;
00604 }
00605
00606 PyErr_SetString(PyExc_AttributeError, "Attribute 'Geometries' of object 'Sketch' is read-only");
00607 return -1;
00608 }
00609
00610
00611
00612
00613 PyObject * SketchPy::staticCallback_getShape (PyObject *self, void * )
00614 {
00615 if (!((PyObjectBase*) self)->isValid()){
00616 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00617 return NULL;
00618 }
00619
00620 try {
00621 return Py::new_reference_to(((SketchPy*)self)->getShape());
00622 } catch (const Py::Exception&) {
00623
00624 return NULL;
00625 } catch (...) {
00626 PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute 'Shape' of object 'Sketch'");
00627 return NULL;
00628 }
00629 }
00630
00631 int SketchPy::staticCallback_setShape (PyObject *self, PyObject * , void * )
00632 {
00633 if (!((PyObjectBase*) self)->isValid()){
00634 PyErr_SetString(PyExc_ReferenceError, "This object is already deleted most likely through closing a document. This reference is no longer valid!");
00635 return -1;
00636 }
00637
00638 PyErr_SetString(PyExc_AttributeError, "Attribute 'Shape' of object 'Sketch' is read-only");
00639 return -1;
00640 }
00641
00642
00643
00644
00645
00646
00647 PyParentObject SketchPy::Parents[] = { PARENTSSketcherSketchPy };
00648
00649
00650
00651
00652 SketchPy::SketchPy(Sketch *pcObject, PyTypeObject *T)
00653 : PersistencePy(reinterpret_cast<PersistencePy::PointerType>(pcObject), T)
00654 {
00655 }
00656
00657
00658
00659
00660
00661 SketchPy::~SketchPy()
00662 {
00663 }
00664
00665
00666
00667
00668 PyObject *SketchPy::_repr(void)
00669 {
00670 return Py_BuildValue("s", representation().c_str());
00671 }
00672
00673
00674
00675
00676 PyObject *SketchPy::_getattr(char *attr)
00677 {
00678 try {
00679
00680 PyObject *r = getCustomAttributes(attr);
00681 if(r) return r;
00682 }
00683 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00684 catch(const Base::Exception& e)
00685 {
00686 std::string str;
00687 str += "FreeCAD exception thrown (";
00688 str += e.what();
00689 str += ")";
00690 e.ReportException();
00691 PyErr_SetString(PyExc_Exception,str.c_str());
00692 return NULL;
00693 }
00694 catch(const std::exception& e)
00695 {
00696 std::string str;
00697 str += "FC++ exception thrown (";
00698 str += e.what();
00699 str += ")";
00700 Base::Console().Error(str.c_str());
00701 PyErr_SetString(PyExc_Exception,str.c_str());
00702 return NULL;
00703 }
00704 catch(const Py::Exception&)
00705 {
00706
00707 return NULL;
00708 }
00709 catch(...)
00710 {
00711 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00712 return NULL;
00713 }
00714 #else // DONT_CATCH_CXX_EXCEPTIONS
00715 catch(const Base::Exception& e)
00716 {
00717 std::string str;
00718 str += "FreeCAD exception thrown (";
00719 str += e.what();
00720 str += ")";
00721 e.ReportException();
00722 PyErr_SetString(PyExc_Exception,str.c_str());
00723 return NULL;
00724 }
00725 catch(const Py::Exception&)
00726 {
00727
00728 return NULL;
00729 }
00730 #endif // DONT_CATCH_CXX_EXCEPTIONS
00731
00732 PyObject *rvalue = Py_FindMethod(Methods, this, attr);
00733 if (rvalue == NULL)
00734 {
00735 PyErr_Clear();
00736 return PersistencePy::_getattr(attr);
00737 }
00738 else
00739 {
00740 return rvalue;
00741 }
00742 }
00743
00744 int SketchPy::_setattr(char *attr, PyObject *value)
00745 {
00746 try {
00747
00748 int r = setCustomAttributes(attr, value);
00749 if(r==1) return 0;
00750 }
00751 #ifndef DONT_CATCH_CXX_EXCEPTIONS
00752 catch(const Base::Exception& e)
00753 {
00754 std::string str;
00755 str += "FreeCAD exception thrown (";
00756 str += e.what();
00757 str += ")";
00758 e.ReportException();
00759 PyErr_SetString(PyExc_Exception,str.c_str());
00760 return -1;
00761 }
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 -1;
00771 }
00772 catch(const Py::Exception&)
00773 {
00774
00775 return -1;
00776 }
00777 catch(...)
00778 {
00779 PyErr_SetString(PyExc_Exception,"Unknown C++ exception");
00780 return -1;
00781 }
00782 #else // DONT_CATCH_CXX_EXCEPTIONS
00783 catch(const Base::Exception& e)
00784 {
00785 std::string str;
00786 str += "FreeCAD exception thrown (";
00787 str += e.what();
00788 str += ")";
00789 e.ReportException();
00790 PyErr_SetString(PyExc_Exception,str.c_str());
00791 return -1;
00792 }
00793 catch(const Py::Exception&)
00794 {
00795
00796 return -1;
00797 }
00798 #endif // DONT_CATCH_CXX_EXCEPTIONS
00799
00800 return PersistencePy::_setattr(attr, value);
00801 }
00802
00803 Sketch *SketchPy::getSketchPtr(void) const
00804 {
00805 return static_cast<Sketch *>(_pcTwinPointer);
00806 }
00807
00808 #if 0
00809
00810
00811
00812
00813 PyObject *SketchPy::PyMake(struct _typeobject *, PyObject *, PyObject *)
00814 {
00815
00816 return new SketchPy(new Sketch);
00817 }
00818
00819
00820 int SketchPy::PyInit(PyObject* , PyObject* )
00821 {
00822 return 0;
00823 }
00824
00825
00826 std::string SketchPy::representation(void) const
00827 {
00828 return std::string("<Sketch object>");
00829 }
00830
00831 PyObject* SketchPy::solve(PyObject *args)
00832 {
00833 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
00834 return 0;
00835 }
00836
00837 PyObject* SketchPy::addGeometry(PyObject *args)
00838 {
00839 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
00840 return 0;
00841 }
00842
00843 PyObject* SketchPy::addConstraint(PyObject *args)
00844 {
00845 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
00846 return 0;
00847 }
00848
00849 PyObject* SketchPy::clear(PyObject *args)
00850 {
00851 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
00852 return 0;
00853 }
00854
00855 PyObject* SketchPy::movePoint(PyObject *args)
00856 {
00857 PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
00858 return 0;
00859 }
00860
00861
00862
00863 Py::Int SketchPy::getConstraint(void) const
00864 {
00865
00866 throw Py::AttributeError("Not yet implemented");
00867 }
00868
00869 Py::Tuple SketchPy::getConstraints(void) const
00870 {
00871
00872 throw Py::AttributeError("Not yet implemented");
00873 }
00874
00875 Py::Tuple SketchPy::getGeometries(void) const
00876 {
00877
00878 throw Py::AttributeError("Not yet implemented");
00879 }
00880
00881 Py::Object SketchPy::getShape(void) const
00882 {
00883
00884 throw Py::AttributeError("Not yet implemented");
00885 }
00886
00887 PyObject *SketchPy::getCustomAttributes(const char* attr) const
00888 {
00889 return 0;
00890 }
00891
00892 int SketchPy::setCustomAttributes(const char* attr, PyObject *obj)
00893 {
00894 return 0;
00895 }
00896 #endif
00897
00898
00899