Gui: Fix header uniformity, whitespace, and doxygen fixes

This commit is contained in:
luz paz
2020-11-25 22:03:45 -05:00
committed by wwmayer
parent c6faecdcee
commit 298c677873
283 changed files with 2026 additions and 1903 deletions

View File

@@ -62,11 +62,11 @@ std::string DocumentPy::representation(void) const
PyObject* DocumentPy::show(PyObject *args)
{
char *psFeatStr;
if (!PyArg_ParseTuple(args, "s;Name of the Feature to show have to be given!",&psFeatStr)) // convert args: Python->C
return NULL; // NULL triggers exception
if (!PyArg_ParseTuple(args, "s;Name of the Feature to show have to be given!",&psFeatStr)) // convert args: Python->C
return NULL; // NULL triggers exception
PY_TRY {
getDocumentPtr()->setShow(psFeatStr);
getDocumentPtr()->setShow(psFeatStr);
Py_Return;
} PY_CATCH;
}
@@ -74,11 +74,11 @@ PyObject* DocumentPy::show(PyObject *args)
PyObject* DocumentPy::hide(PyObject *args)
{
char *psFeatStr;
if (!PyArg_ParseTuple(args, "s;Name of the Feature to hide have to be given!",&psFeatStr)) // convert args: Python->C
return NULL; // NULL triggers exception
if (!PyArg_ParseTuple(args, "s;Name of the Feature to hide have to be given!",&psFeatStr)) // convert args: Python->C
return NULL; // NULL triggers exception
PY_TRY {
getDocumentPtr()->setHide(psFeatStr);
getDocumentPtr()->setHide(psFeatStr);
Py_Return;
} PY_CATCH;
}
@@ -90,13 +90,13 @@ PyObject* DocumentPy::setPos(PyObject *args)
PyObject *pcMatObj;
if (!PyArg_ParseTuple(args, "sO!;Name of the Feature and the transformation matrix have to be given!",
&psFeatStr,
&(Base::MatrixPy::Type), &pcMatObj)) // convert args: Python->C
return NULL; // NULL triggers exception
&(Base::MatrixPy::Type), &pcMatObj)) // convert args: Python->C
return NULL; // NULL triggers exception
mat = static_cast<Base::MatrixPy*>(pcMatObj)->value();
PY_TRY {
getDocumentPtr()->setPos(psFeatStr,mat);
getDocumentPtr()->setPos(psFeatStr,mat);
Py_Return;
} PY_CATCH;
}
@@ -159,8 +159,8 @@ PyObject* DocumentPy::getInEdit(PyObject *args)
PyObject* DocumentPy::resetEdit(PyObject *args)
{
if (!PyArg_ParseTuple(args, ";No arguments allowed")) // convert args: Python->C
return NULL; // NULL triggers exception
if (!PyArg_ParseTuple(args, ";No arguments allowed")) // convert args: Python->C
return NULL; // NULL triggers exception
getDocumentPtr()->resetEdit();
Py_Return;
@@ -169,8 +169,8 @@ PyObject* DocumentPy::resetEdit(PyObject *args)
PyObject* DocumentPy::addAnnotation(PyObject *args)
{
char *psAnnoName,*psFileName,*psModName=0;
if (!PyArg_ParseTuple(args, "ss|s;Name of the Annotation and a file name have to be given!",&psAnnoName,&psFileName,&psModName)) // convert args: Python->C
return NULL; // NULL triggers exception
if (!PyArg_ParseTuple(args, "ss|s;Name of the Annotation and a file name have to be given!",&psAnnoName,&psFileName,&psModName)) // convert args: Python->C
return NULL; // NULL triggers exception
PY_TRY {
ViewProviderExtern *pcExt = new ViewProviderExtern();
@@ -187,8 +187,8 @@ PyObject* DocumentPy::addAnnotation(PyObject *args)
PyObject* DocumentPy::update(PyObject *args)
{
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
return NULL; // NULL triggers exception
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
return NULL; // NULL triggers exception
PY_TRY {
getDocumentPtr()->onUpdate();
@@ -199,8 +199,8 @@ PyObject* DocumentPy::update(PyObject *args)
PyObject* DocumentPy::getObject(PyObject *args)
{
char *sName;
if (!PyArg_ParseTuple(args, "s",&sName)) // convert args: Python->C
return NULL; // NULL triggers exception
if (!PyArg_ParseTuple(args, "s",&sName)) // convert args: Python->C
return NULL; // NULL triggers exception
PY_TRY {
ViewProvider *pcView = getDocumentPtr()->getViewProviderByName(sName);
@@ -214,8 +214,8 @@ PyObject* DocumentPy::getObject(PyObject *args)
PyObject* DocumentPy::activeObject(PyObject *args)
{
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
return NULL; // NULL triggers exception
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
return NULL; // NULL triggers exception
PY_TRY {
App::DocumentObject *pcFtr = getDocumentPtr()->getDocument()->getActiveObject();
@@ -230,8 +230,8 @@ PyObject* DocumentPy::activeObject(PyObject *args)
PyObject* DocumentPy::activeView(PyObject *args)
{
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
return NULL; // NULL triggers exception
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
return NULL; // NULL triggers exception
PY_TRY {
Gui::MDIView *pcView = getDocumentPtr()->getActiveView();
@@ -247,8 +247,8 @@ PyObject* DocumentPy::activeView(PyObject *args)
PyObject* DocumentPy::mdiViewsOfType(PyObject *args)
{
char* sType;
if (!PyArg_ParseTuple(args, "s", &sType)) // convert args: Python->C
return NULL; // NULL triggers exception
if (!PyArg_ParseTuple(args, "s", &sType)) // convert args: Python->C
return NULL; // NULL triggers exception
Base::Type type = Base::Type::fromName(sType);
if (type == Base::Type::badType()) {
@@ -268,8 +268,8 @@ PyObject* DocumentPy::mdiViewsOfType(PyObject *args)
PyObject* DocumentPy::sendMsgToViews(PyObject *args)
{
char* msg;
if (!PyArg_ParseTuple(args, "s", &msg)) // convert args: Python->C
return NULL; // NULL triggers exception
if (!PyArg_ParseTuple(args, "s", &msg)) // convert args: Python->C
return NULL; // NULL triggers exception
PY_TRY {
getDocumentPtr()->sendMsgToViews(msg);
@@ -280,8 +280,8 @@ PyObject* DocumentPy::sendMsgToViews(PyObject *args)
PyObject* DocumentPy::mergeProject(PyObject *args)
{
char* filename;
if (!PyArg_ParseTuple(args, "s", &filename)) // convert args: Python->C
return NULL; // NULL triggers exception
if (!PyArg_ParseTuple(args, "s", &filename)) // convert args: Python->C
return NULL; // NULL triggers exception
PY_TRY {
Base::FileInfo fi(filename);
@@ -301,18 +301,18 @@ PyObject* DocumentPy::toggleTreeItem(PyObject *args)
if (PyArg_ParseTuple(args,"O!|is",&(App::DocumentObjectPy::Type), &object,&mod,&subname)) {
App::DocumentObject* Object = static_cast<App::DocumentObjectPy*>(object)->getDocumentObjectPtr();
// Should be set!
assert(Object);
assert(Object);
App::DocumentObject *parent = 0;
if (subname) {
auto sobj = Object->getSubObject(subname);
if (!sobj)
if (!sobj)
throw Py::RuntimeError("Sub-object not found");
parent = Object;
Object = sobj;
}
// get the gui document of the Assembly Item
// get the gui document of the Assembly Item
//ActiveAppDoc = Item->getDocument();
//ActiveGuiDoc = Gui::Application::Instance->getDocument(getDocumentPtr());
Gui::ViewProviderDocumentObject* ActiveVp = dynamic_cast<Gui::ViewProviderDocumentObject*> (getDocumentPtr()->getViewProvider(Object));
@@ -410,8 +410,8 @@ Py::Object DocumentPy::getInEditInfo(void) const {
ViewProviderDocumentObject *vp = 0;
std::string subname,subelement;
int mode = 0;
getDocumentPtr()->getInEdit(&vp,&subname,&mode,&subelement);
if (!vp || !vp->getObject() || !vp->getObject()->getNameInDocument())
getDocumentPtr()->getInEdit(&vp,&subname,&mode,&subelement);
if (!vp || !vp->getObject() || !vp->getObject()->getNameInDocument())
return Py::None();
return Py::TupleN(Py::Object(vp->getObject()->getPyObject(),true),
Py::String(subname),Py::String(subelement),Py::Int(mode));
@@ -420,7 +420,7 @@ Py::Object DocumentPy::getInEditInfo(void) const {
void DocumentPy::setInEditInfo(Py::Object arg) {
PyObject *pyobj = 0;
const char *subname = 0;
if (!PyArg_ParseTuple(arg.ptr(), "O!s",
if (!PyArg_ParseTuple(arg.ptr(), "O!s",
&Gui::ViewProviderDocumentObjectPy::Type, &pyobj,&subname))
throw Py::Exception();
getDocumentPtr()->setInEdit(static_cast<ViewProviderDocumentObjectPy*>(
@@ -476,11 +476,11 @@ int DocumentPy::setCustomAttributes(const char* attr, PyObject *)
ViewProvider* obj = getDocumentPtr()->getViewProviderByName(attr);
if (obj) {
std::stringstream str;
str << "'Document' object attribute '" << attr
str << "'Document' object attribute '" << attr
<< "' must not be set this way" << std::ends;
throw Py::AttributeError(str.str());
}
return 0;
}