Debian Codegraph @

src/Gui/Inventor/Draggers/SoLinearDraggerGeometry.h

raw
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 /****************************************************************************
3 * *
4 * Copyright (c) 2025 Sayantan Deb <sayantandebin[at]gmail.com> *
5 * *
6 * This file is part of FreeCAD. *
7 * *
8 * FreeCAD is free software: you can redistribute it and/or modify it *
9 * under the terms of the GNU Lesser General Public License as *
10 * published by the Free Software Foundation, either version 2.1 of the *
11 * License, or (at your option) any later version. *
12 * *
13 * FreeCAD is distributed in the hope that it will be useful, but *
14 * WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with FreeCAD. If not, see *
20 * <https://www.gnu.org/licenses/>. *
21 * *
22 ***************************************************************************/
23
24 #ifndef GUI_LINEAR_DRAGGER_GEOMETRY_H
25 #define GUI_LINEAR_DRAGGER_GEOMETRY_H
26
27 #include <Inventor/fields/SoSFBool.h>
28 #include <Inventor/fields/SoSFColor.h>
29 #include <Inventor/fields/SoSFFloat.h>
30 #include <Inventor/fields/SoSFVec3f.h>
31 #include <Inventor/nodekits/SoBaseKit.h>
32
33 #include <Base/Vector3D.h>
34
35 #include <FCGlobal.h>
36
37 namespace Gui
38 {
39
40 class GuiExport SoLinearGeometryKit: public SoBaseKit
41 {
42 SO_KIT_HEADER(SoLinearGeometryKit);
43
44 public:
45 static void initClass();
46
47 SoSFVec3f tipPosition;
48
49 protected:
50 SoLinearGeometryKit();
51 ~SoLinearGeometryKit() override = default;
52
53 private:
54 using inherited = SoBaseKit;
55 };
56
57 class GuiExport SoArrowGeometry: public SoLinearGeometryKit
58 {
59 SO_KIT_HEADER(SoArrowGeometry);
60 SO_KIT_CATALOG_ENTRY_HEADER(separator);
61 SO_KIT_CATALOG_ENTRY_HEADER(lightModel);
62 SO_KIT_CATALOG_ENTRY_HEADER(pickStyle);
63 SO_KIT_CATALOG_ENTRY_HEADER(arrowBody);
64 SO_KIT_CATALOG_ENTRY_HEADER(arrowTip);
65
66 SO_KIT_CATALOG_ENTRY_HEADER(_arrowBodyTranslation);
67 SO_KIT_CATALOG_ENTRY_HEADER(_arrowTipTranslation);
68
69 public:
70 static void initClass();
71 SoArrowGeometry();
72
73 SoSFFloat coneBottomRadius;
74 SoSFFloat coneHeight;
75 SoSFFloat cylinderHeight;
76 SoSFFloat cylinderRadius;
77
78 protected:
79 ~SoArrowGeometry() override = default;
80
81 void notify(SoNotList* notList) override;
82
83 private:
84 using inherited = SoLinearGeometryKit;
85 };
86
87 class GuiExport SoLinearGeometryBaseKit: public SoBaseKit
88 {
89 SO_KIT_HEADER(SoLinearGeometryBaseKit);
90
91 public:
92 static void initClass();
93
94 SoSFVec3f translation; //!< set from the parent dragger
95 SoSFVec3f geometryScale; //!< set from the parent dragger
96 SoSFBool active; //!< set from the parent dragger
97
98 protected:
99 SoLinearGeometryBaseKit();
100 ~SoLinearGeometryBaseKit() override = default;
101
102 private:
103 using inherited = SoBaseKit;
104 };
105
106 class GuiExport SoArrowBase: public SoLinearGeometryBaseKit
107 {
108 SO_KIT_HEADER(SoArrowBase);
109 SO_KIT_CATALOG_ENTRY_HEADER(separator);
110 SO_KIT_CATALOG_ENTRY_HEADER(lightModel);
111 SO_KIT_CATALOG_ENTRY_HEADER(pickStyle);
112 SO_KIT_CATALOG_ENTRY_HEADER(baseColor);
113 SO_KIT_CATALOG_ENTRY_HEADER(cylinder);
114
115 SO_KIT_CATALOG_ENTRY_HEADER(_cylinderTranslation);
116
117 public:
118 static void initClass();
119 SoArrowBase();
120
121 SoSFFloat cylinderHeight;
122 SoSFFloat cylinderRadius;
123 SoSFColor color;
124
125 protected:
126 ~SoArrowBase() override = default;
127
128 void notify(SoNotList* notList) override;
129
130 private:
131 using inherited = SoLinearGeometryBaseKit;
132 };
133
134 } // namespace Gui
135
136 #endif /* GUI_LINEAR_DRAGGER_GEOMETRY_H */