FreeCAD

Форк
0
/
AppDrawing.cpp 
67 строк · 2.5 Кб
1
/***************************************************************************
2
 *                                                                         *
3
 *   This program is free software; you can redistribute it and/or modify  *
4
 *   it under the terms of the GNU Library General Public License as       *
5
 *   published by the Free Software Foundation; either version 2 of the    *
6
 *   License, or (at your option) any later version.                       *
7
 *   for detail see the LICENCE text file.                                 *
8
 *   Jürgen Riegel 2007                                                    *
9
 *                                                                         *
10
 ***************************************************************************/
11

12
#include "PreCompiled.h"
13

14
#include <Base/Console.h>
15
#include <Base/Interpreter.h>
16
#include <Base/PyObjectBase.h>
17

18
#include "FeatureClip.h"
19
#include "FeaturePage.h"
20
#include "FeatureProjection.h"
21
#include "FeatureView.h"
22
#include "FeatureViewAnnotation.h"
23
#include "FeatureViewPart.h"
24
#include "FeatureViewSpreadsheet.h"
25
#include "FeatureViewSymbol.h"
26
#include "PageGroup.h"
27

28

29
namespace Drawing
30
{
31
extern PyObject* initModule();
32
}
33

34
/* Python entry */
35
PyMOD_INIT_FUNC(Drawing)
36
{
37
    // load dependent module
38
    try {
39
        Base::Interpreter().loadModule("Part");
40
        // Base::Interpreter().loadModule("Mesh");
41
    }
42
    catch (const Base::Exception& e) {
43
        PyErr_SetString(PyExc_ImportError, e.what());
44
        PyMOD_Return(nullptr);
45
    }
46
    PyObject* mod = Drawing::initModule();
47
    Base::Console().Log("Loading Drawing module... done\n");
48

49

50
    // NOTE: To finish the initialization of our own type objects we must
51
    // call PyType_Ready, otherwise we run into a segmentation fault, later on.
52
    // This function is responsible for adding inherited slots from a type's base class.
53
    // clang-format off
54
    Drawing::FeaturePage            ::init();
55
    Drawing::FeatureView            ::init();
56
    Drawing::FeatureViewPart        ::init();
57
    Drawing::PageGroup              ::init();
58
    Drawing::FeatureProjection      ::init();
59
    Drawing::FeatureViewPartPython  ::init();
60
    Drawing::FeatureViewPython      ::init();
61
    Drawing::FeatureViewAnnotation  ::init();
62
    Drawing::FeatureViewSymbol      ::init();
63
    Drawing::FeatureClip            ::init();
64
    Drawing::FeatureViewSpreadsheet ::init();
65
    // clang-format on
66
    PyMOD_Return(mod);
67
}
68

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.