Files
create/src/Mod/Surface/Gui/AppSurfaceGui.cpp
balazs-bamer 254aa167e4 Dialog with radio buttons for choosing Bezier and b-spline surface fill type
A regular common dialog with apply, cancel and OK buttons allowing
surface fill type selection for Bezier and b-spline surfaces.

The Bezier and b-spline surface functionality now seems to be complete.
2017-04-17 16:20:44 +02:00

74 lines
2.9 KiB
C++

/***************************************************************************
* Copyright (c) 2014 Nathan Miller <Nathan.A.Mill[at]gmail.com>,*
* Balázs Bámer *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <Python.h>
#endif
#include <Base/Console.h>
#include <Base/Interpreter.h>
#include <Gui/Application.h>
#include "Workbench.h"
#include "BSurf.h"
// use a different name to CreateCommand()
void CreateSurfaceCommands(void);
/* registration table */
extern struct PyMethodDef SurfaceGui_methods[];
PyDoc_STRVAR(module_SurfaceGui_doc,
"This module is the SurfaceGui module.");
/* Python entry */
extern "C" {
void SurfaceGuiExport initSurfaceGui()
{
if (!Gui::Application::Instance) {
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
return;
}
// Base::Interpreter().runString("import SurfaceGui"); infinite Python recursion comes
Base::Interpreter().runString("import PartGui");
// instanciating the commands
CreateSurfaceCommands();
SurfaceGui::Workbench::init();
SurfaceGui::ViewProviderBSurf::init();
// SurfaceGui::ViewProviderCut::init();
(void) Py_InitModule3("SurfaceGui", SurfaceGui_methods, module_SurfaceGui_doc); /* mod name, table ptr */
Base::Console().Log("Loading GUI of Surface module... done\n");
}
} // extern "C"