|
| 1 | +// SPDX-License-Identifier: LGPL-2.1-or-later |
| 2 | + |
| 3 | +/*************************************************************************** |
| 4 | + * Copyright (c) 2024 Mario Passaglia <mpassaglia[at]cbc.uba.ar> * |
| 5 | + * * |
| 6 | + * This file is part of FreeCAD. * |
| 7 | + * * |
| 8 | + * FreeCAD is free software: you can redistribute it and/or modify it * |
| 9 | + * under the terms of the GNU Lesser General Public License as * |
| 10 | + * published by the Free Software Foundation, either version 2.1 of the * |
| 11 | + * License, or (at your option) any later version. * |
| 12 | + * * |
| 13 | + * FreeCAD is distributed in the hope that it will be useful, but * |
| 14 | + * WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * |
| 16 | + * Lesser General Public License for more details. * |
| 17 | + * * |
| 18 | + * You should have received a copy of the GNU Lesser General Public * |
| 19 | + * License along with FreeCAD. If not, see * |
| 20 | + * <https://www.gnu.org/licenses/>. * |
| 21 | + * * |
| 22 | + **************************************************************************/ |
| 23 | + |
| 24 | +#include "PreCompiled.h" |
| 25 | +#ifndef _PreComp_ |
| 26 | +#include <Inventor/nodes/SoSeparator.h> |
| 27 | +#endif |
| 28 | + |
| 29 | +#include <Base/Interpreter.h> |
| 30 | + |
| 31 | +#include "ViewProviderFemConstraintPy.h" |
| 32 | +#include "ViewProviderFemConstraintPy.cpp" |
| 33 | + |
| 34 | + |
| 35 | +using namespace FemGui; |
| 36 | + |
| 37 | +// returns a string which represent the object e.g. when printed in python |
| 38 | +std::string ViewProviderFemConstraintPy::representation() const |
| 39 | +{ |
| 40 | + std::stringstream str; |
| 41 | + str << "<View provider FemConstraint object at " << getViewProviderFemConstraintPtr() << ">"; |
| 42 | + |
| 43 | + return str.str(); |
| 44 | +} |
| 45 | + |
| 46 | + |
| 47 | +Py::Object ViewProviderFemConstraintPy::getSymbolNode() const |
| 48 | +{ |
| 49 | + try { |
| 50 | + SoSeparator* sep = getViewProviderFemConstraintPtr()->getSymbolSeparator(); |
| 51 | + PyObject* Ptr = |
| 52 | + Base::Interpreter().createSWIGPointerObj("pivy.coin", "_p_SoSeparator", sep, 1); |
| 53 | + |
| 54 | + sep->ref(); |
| 55 | + |
| 56 | + return Py::Object(Ptr, true); |
| 57 | + } |
| 58 | + catch (const Base::Exception& e) { |
| 59 | + throw Py::RuntimeError(e.what()); |
| 60 | + } |
| 61 | +} |
| 62 | + |
| 63 | +PyObject* ViewProviderFemConstraintPy::getCustomAttributes(const char* /*attr*/) const |
| 64 | +{ |
| 65 | + return nullptr; |
| 66 | +} |
| 67 | + |
| 68 | +int ViewProviderFemConstraintPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) |
| 69 | +{ |
| 70 | + return 0; |
| 71 | +} |
0 commit comments