Debian Codegraph @

src/Gui/View3DPy.h

raw
1 /***************************************************************************
2 * Copyright (c) 2005 Jürgen Riegel <[email protected]> *
3 * *
4 * This file is part of the FreeCAD CAx development system. *
5 * *
6 * This library is free software; you can redistribute it and/or *
7 * modify it under the terms of the GNU Library General Public *
8 * License as published by the Free Software Foundation; either *
9 * version 2 of the License, or (at your option) any later version. *
10 * *
11 * This library 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 Library General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Library General Public *
17 * License along with this library; see the file COPYING.LIB. If not, *
18 * write to the Free Software Foundation, Inc., 59 Temple Place, *
19 * Suite 330, Boston, MA 02111-1307, USA *
20 * *
21 ***************************************************************************/
22
23 #ifndef GUI_VIEW3DPY_H
24 #define GUI_VIEW3DPY_H
25
26 #include "MDIView.h"
27 #include "MDIViewPy.h"
28
29
30 class SoEventCallback;
31 class SoDragger;
32 class QImage;
33
34 namespace Gui
35 {
36
37 class View3DInventor;
38
39 class View3DInventorPy: public Py::PythonExtension<View3DInventorPy>
40 {
41 public:
42 using BaseType = Py::PythonExtension<View3DInventorPy>;
43 static void init_type(); // announce properties and methods
44
45 explicit View3DInventorPy(View3DInventor* vi);
46 ~View3DInventorPy() override;
47
48 View3DInventor* getView3DInventorPtr();
49 Py::Object repr() override;
50 Py::Object getattr(const char*) override;
51 int setattr(const char*, const Py::Object&) override;
52 Py::Object cast_to_base();
53
54 Py::Object fitAll(const Py::Tuple&);
55 Py::Object boxZoom(const Py::Tuple&, const Py::Dict&);
56 Py::Object viewBottom();
57 Py::Object viewFront();
58 Py::Object viewLeft();
59 Py::Object viewRear();
60 Py::Object viewRight();
61 Py::Object viewTop();
62 Py::Object viewIsometric();
63 Py::Object viewDimetric();
64 Py::Object viewTrimetric();
65 Py::Object viewDefaultOrientation(const Py::Tuple&);
66 Py::Object viewPosition(const Py::Tuple&);
67 Py::Object viewRotateLeft();
68 Py::Object viewRotateRight();
69 Py::Object zoomIn();
70 Py::Object zoomOut();
71 Py::Object startAnimating(const Py::Tuple&);
72 Py::Object stopAnimating();
73 Py::Object setAnimationEnabled(const Py::Tuple&);
74 Py::Object isAnimationEnabled();
75 Py::Object setPopupMenuEnabled(const Py::Tuple&);
76 Py::Object isPopupMenuEnabled();
77 Py::Object dump(const Py::Tuple&);
78 Py::Object dumpNode(const Py::Tuple&);
79 Py::Object setStereoType(const Py::Tuple&);
80 Py::Object getStereoType();
81 Py::Object listStereoTypes();
82 Py::Object saveImage(const Py::Tuple&);
83 Py::Object saveVectorGraphic(const Py::Tuple&);
84 Py::Object getCamera();
85 Py::Object getViewDirection();
86 Py::Object getUpDirection();
87 Py::Object setViewDirection(const Py::Tuple&);
88 Py::Object setCamera(const Py::Tuple&);
89 Py::Object setCameraOrientation(const Py::Tuple&);
90 Py::Object getCameraOrientation();
91 Py::Object getCameraType();
92 Py::Object setCameraType(const Py::Tuple&);
93 Py::Object getCameraNode();
94 Py::Object listCameraTypes();
95 Py::Object getCursorPos();
96 Py::Object getObjectInfo(const Py::Tuple&);
97 Py::Object getObjectsInfo(const Py::Tuple&);
98 Py::Object getSize();
99 Py::Object getObjectInfoRay(const Py::Tuple&);
100 Py::Object getPointOnFocalPlane(const Py::Tuple&);
101 Py::Object projectPointToLine(const Py::Tuple&);
102 Py::Object getPointOnViewport(const Py::Tuple&);
103 Py::Object addEventCallback(const Py::Tuple&);
104 Py::Object removeEventCallback(const Py::Tuple&);
105 Py::Object setAnnotation(const Py::Tuple&);
106 Py::Object removeAnnotation(const Py::Tuple&);
107 Py::Object getSceneGraph();
108 Py::Object getViewer();
109 Py::Object addEventCallbackPivy(const Py::Tuple&);
110 Py::Object removeEventCallbackPivy(const Py::Tuple&);
111 Py::Object listNavigationTypes();
112 Py::Object getNavigationType();
113 Py::Object setNavigationType(const Py::Tuple&);
114 Py::Object setAxisCross(const Py::Tuple&);
115 Py::Object hasAxisCross();
116 Py::Object addDraggerCallback(const Py::Tuple&);
117 Py::Object removeDraggerCallback(const Py::Tuple&);
118 Py::Object getViewProvidersOfType(const Py::Tuple&);
119 Py::Object redraw();
120 Py::Object setName(const Py::Tuple&);
121 Py::Object toggleClippingPlane(const Py::Tuple& args, const Py::Dict&);
122 Py::Object hasClippingPlane();
123 Py::Object graphicsView();
124 Py::Object setCornerCrossVisible(const Py::Tuple& args);
125 Py::Object isCornerCrossVisible();
126 Py::Object setCornerCrossSize(const Py::Tuple& args);
127 Py::Object getCornerCrossSize();
128
129 private:
130 void setDefaultCameraHeight(float);
131 static void eventCallback(void* ud, SoEventCallback* n);
132 static void eventCallbackPivy(void* ud, SoEventCallback* n);
133 static void eventCallbackPivyEx(void* ud, SoEventCallback* n);
134 static void draggerCallback(void* ud, SoDragger* dragger);
135
136 private:
137 using method_varargs_handler = PyObject* (*)(PyObject * _self, PyObject* _args);
138 static method_varargs_handler pycxx_handler;
139 static PyObject* method_varargs_ext_handler(PyObject* _self, PyObject* _args);
140 Py::Object getattribute(const char*);
141
142 private:
143 Gui::MDIViewPy base;
144 std::list<PyObject*> callbacks;
145 };
146
147 } // namespace Gui
148
149 #endif // GUI_VIEW3DPY_H