|
1 |
| -/* |
2 |
| -##Copyright 2008-2016 Thomas Paviot ([email protected]) |
3 |
| -## |
4 |
| -##This file is part of pythonOCC. |
5 |
| -## |
6 |
| -##pythonOCC is free software: you can redistribute it and/or modify |
7 |
| -##it under the terms of the GNU Lesser General Public License as published by |
8 |
| -##the Free Software Foundation, either version 3 of the License, or |
9 |
| -##(at your option) any later version. |
10 |
| -## |
11 |
| -##pythonOCC is distributed in the hope that it will be useful, |
12 |
| -##but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
| -##MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
| -##GNU General Public License for more details. |
15 |
| -## |
16 |
| -##You should have received a copy of the GNU Lesser General Public License |
17 |
| -##along with pythonOCC. If not, see <http://www.gnu.org/licenses/>. |
18 |
| -*/ |
19 |
| -%module Visualization; |
20 |
| - |
21 |
| -%{ |
22 |
| -#include <Visualization.h> |
23 |
| -#include <Standard.hxx> |
24 |
| -%} |
25 |
| - |
26 |
| -%include ../SWIG_files/common/ExceptionCatcher.i |
27 |
| -%include ../SWIG_files/common/OccHandle.i |
28 |
| -%include "python/std_string.i" |
29 |
| -%include "std_vector.i" |
30 |
| -%include "typemaps.i" |
31 |
| - |
32 |
| -%wrap_handle(AIS_InteractiveContext) |
33 |
| -%wrap_handle(V3d_View) |
34 |
| -%wrap_handle(V3d_Viewer) |
35 |
| -%wrap_handle(Graphic3d_Camera) |
36 |
| -%wrap_handle(Graphic3d_StructureManager) |
37 |
| - |
38 |
| -class Display3d { |
39 |
| - public: |
40 |
| - %feature("autodoc", "1"); |
41 |
| - Display3d(); |
42 |
| - %feature("autodoc", "1"); |
43 |
| - ~Display3d(); |
44 |
| - %feature("autodoc", "1"); |
45 |
| - void Init(const long handle); |
46 |
| - %feature("autodoc", "1"); |
47 |
| - void SetAnaglyphMode(int mode); |
48 |
| - %feature("autodoc", "1"); |
49 |
| - void SetNbMsaaSample(int nb); |
50 |
| - %feature("autodoc", "1"); |
51 |
| - void ChangeRenderingParams(int Method, |
52 |
| - int RaytracingDepth, |
53 |
| - bool IsShadowEnabled, |
54 |
| - bool IsReflectionEnabled, |
55 |
| - bool IsAntialiasingEnabled, |
56 |
| - bool IsTransparentShadowEnabled, |
57 |
| - int StereoMode, |
58 |
| - int AnaglyphFilter, |
59 |
| - bool ToReverseStere); |
60 |
| - %feature("autodoc", "1"); |
61 |
| - void EnableVBO(); |
62 |
| - %feature("autodoc", "1"); |
63 |
| - void DisableVBO(); |
64 |
| - %feature("autodoc", "1"); |
65 |
| - Handle_V3d_View& GetView(); |
66 |
| - %feature("autodoc", "1"); |
67 |
| - Handle_V3d_Viewer& GetViewer(); |
68 |
| - %feature("autodoc", "1"); |
69 |
| - Handle_Graphic3d_Camera& GetCamera(); |
70 |
| - %feature("autodoc", "1"); |
71 |
| - Handle_AIS_InteractiveContext& GetContext(); |
72 |
| - %feature("autodoc", "1"); |
73 |
| - Handle_Graphic3d_StructureManager& GetStructureManager(); |
74 |
| - %feature("autodoc", "1"); |
75 |
| - void Test(); |
76 |
| - %feature("autodoc", "1"); |
77 |
| - void GlInfo(); |
78 |
| - %feature("autodoc", "1"); |
79 |
| - bool InitOffscreen(int size_x, int size_y); |
80 |
| - %feature("autodoc", "1"); |
81 |
| - bool SetSize(int size_x, int size_y); |
82 |
| - %feature("autodoc", "1"); |
83 |
| - bool IsOffscreen(); |
84 |
| -}; |
85 |
| - |
86 |
| -%extend Display3d { |
87 |
| - PyObject* GetImageData(int width, int height, int bufType = 0) { |
88 |
| - const char * data; |
89 |
| - size_t size = 0; |
90 |
| - Graphic3d_BufferType theBufferType = (Graphic3d_BufferType)bufType; |
91 |
| - |
92 |
| - if ($self->GetImageData(width, height, data, size, theBufferType)) { |
93 |
| - return PyBytes_FromStringAndSize(data, (Py_ssize_t)size); |
94 |
| - } |
95 |
| - Py_RETURN_NONE; |
96 |
| - } |
97 |
| - |
98 |
| - PyObject* GetSize() { |
99 |
| - int size_x; |
100 |
| - int size_y; |
101 |
| - |
102 |
| - if ($self->GetSize(size_x, size_y)) { |
103 |
| - return Py_BuildValue("ii", size_x, size_y); |
104 |
| - } |
105 |
| - Py_RETURN_NONE; |
106 |
| - } |
107 |
| -}; |
| 1 | +/* |
| 2 | +##Copyright 2008-2016 Thomas Paviot ([email protected]) |
| 3 | +## |
| 4 | +##This file is part of pythonOCC. |
| 5 | +## |
| 6 | +##pythonOCC is free software: you can redistribute it and/or modify |
| 7 | +##it under the terms of the GNU Lesser General Public License as published by |
| 8 | +##the Free Software Foundation, either version 3 of the License, or |
| 9 | +##(at your option) any later version. |
| 10 | +## |
| 11 | +##pythonOCC is distributed in the hope that it will be useful, |
| 12 | +##but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | +##MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | +##GNU General Public License for more details. |
| 15 | +## |
| 16 | +##You should have received a copy of the GNU Lesser General Public License |
| 17 | +##along with pythonOCC. If not, see <http://www.gnu.org/licenses/>. |
| 18 | +*/ |
| 19 | +%module Visualization; |
| 20 | + |
| 21 | +%{ |
| 22 | +#include <Visualization.h> |
| 23 | +#include <Standard.hxx> |
| 24 | +%} |
| 25 | + |
| 26 | +%include ../SWIG_files/common/ExceptionCatcher.i |
| 27 | +%include ../SWIG_files/common/OccHandle.i |
| 28 | +%include "python/std_string.i" |
| 29 | +%include "std_vector.i" |
| 30 | +%include "typemaps.i" |
| 31 | + |
| 32 | +%wrap_handle(AIS_InteractiveContext) |
| 33 | +%wrap_handle(V3d_View) |
| 34 | +%wrap_handle(V3d_Viewer) |
| 35 | +%wrap_handle(Graphic3d_Camera) |
| 36 | +%wrap_handle(Graphic3d_StructureManager) |
| 37 | + |
| 38 | +class Display3d { |
| 39 | + public: |
| 40 | + %feature("autodoc", "1"); |
| 41 | + Display3d(); |
| 42 | + %feature("autodoc", "1"); |
| 43 | + ~Display3d(); |
| 44 | + %feature("autodoc", "1"); |
| 45 | + void Init(const long handle); |
| 46 | + %feature("autodoc", "1"); |
| 47 | + void SetAnaglyphMode(int mode); |
| 48 | + %feature("autodoc", "1"); |
| 49 | + void SetNbMsaaSample(int nb); |
| 50 | + %feature("autodoc", "1"); |
| 51 | + void ChangeRenderingParams(int Method, |
| 52 | + int RaytracingDepth, |
| 53 | + bool IsShadowEnabled, |
| 54 | + bool IsReflectionEnabled, |
| 55 | + bool IsAntialiasingEnabled, |
| 56 | + bool IsTransparentShadowEnabled, |
| 57 | + int StereoMode, |
| 58 | + int AnaglyphFilter, |
| 59 | + bool ToReverseStere); |
| 60 | + %feature("autodoc", "1"); |
| 61 | + void EnableVBO(); |
| 62 | + %feature("autodoc", "1"); |
| 63 | + void DisableVBO(); |
| 64 | + %feature("autodoc", "1"); |
| 65 | + Handle_V3d_View& GetView(); |
| 66 | + %feature("autodoc", "1"); |
| 67 | + Handle_V3d_Viewer& GetViewer(); |
| 68 | + %feature("autodoc", "1"); |
| 69 | + Handle_Graphic3d_Camera& GetCamera(); |
| 70 | + %feature("autodoc", "1"); |
| 71 | + Handle_AIS_InteractiveContext& GetContext(); |
| 72 | + %feature("autodoc", "1"); |
| 73 | + Handle_Graphic3d_StructureManager& GetStructureManager(); |
| 74 | + %feature("autodoc", "1"); |
| 75 | + void Test(); |
| 76 | + %feature("autodoc", "1"); |
| 77 | + void GlInfo(); |
| 78 | + %feature("autodoc", "1"); |
| 79 | + bool InitOffscreen(int size_x, int size_y); |
| 80 | + %feature("autodoc", "1"); |
| 81 | + bool SetSize(int size_x, int size_y); |
| 82 | + %feature("autodoc", "1"); |
| 83 | + bool IsOffscreen(); |
| 84 | +}; |
| 85 | + |
| 86 | +%extend Display3d { |
| 87 | + PyObject* GetImageData(int width, int height, int bufType = 0) { |
| 88 | + const char * data; |
| 89 | + size_t size = 0; |
| 90 | + Graphic3d_BufferType theBufferType = (Graphic3d_BufferType)bufType; |
| 91 | + |
| 92 | + if ($self->GetImageData(width, height, data, size, theBufferType)) { |
| 93 | + return PyBytes_FromStringAndSize(data, (Py_ssize_t)size); |
| 94 | + } |
| 95 | + Py_RETURN_NONE; |
| 96 | + } |
| 97 | + |
| 98 | + PyObject* GetSize() { |
| 99 | + int size_x; |
| 100 | + int size_y; |
| 101 | + |
| 102 | + if ($self->GetSize(size_x, size_y)) { |
| 103 | + return Py_BuildValue("ii", size_x, size_y); |
| 104 | + } |
| 105 | + Py_RETURN_NONE; |
| 106 | + } |
| 107 | +}; |
0 commit comments