[Bf-blender-cvs] [c5a9add] wiggly-widgets: Dial widget, used in rotation manipulator code.

Antony Riakiotakis noreply at git.blender.org
Mon Oct 13 18:16:23 CEST 2014


Commit: c5a9add3707fc6781c9cc82e3cb6f5159c67f7d6
Author: Antony Riakiotakis
Date:   Mon Oct 13 18:16:09 2014 +0200
Branches: wiggly-widgets
https://developer.blender.org/rBc5a9add3707fc6781c9cc82e3cb6f5159c67f7d6

Dial widget, used in rotation manipulator code.

The widget can still change in the future, also widget styles can always
be used to create new widget visualizations.

===================================================================

M	release/datafiles/widget_export.py
M	source/blender/editors/include/ED_transform.h
M	source/blender/editors/include/UI_interface.h
M	source/blender/editors/interface/3d_widgets/arrow_widget.c
A	source/blender/editors/interface/3d_widgets/dial_widget.c
M	source/blender/editors/interface/3d_widgets/ui_widget_library.h
M	source/blender/editors/interface/CMakeLists.txt
M	source/blender/editors/interface/interface_generic_widgets.c
M	source/blender/editors/space_view3d/space_view3d.c
M	source/blender/editors/transform/transform_manipulator.c
M	source/blender/windowmanager/intern/wm_widgets.c

===================================================================

diff --git a/release/datafiles/widget_export.py b/release/datafiles/widget_export.py
index b43c616..c700f25 100644
--- a/release/datafiles/widget_export.py
+++ b/release/datafiles/widget_export.py
@@ -45,7 +45,7 @@ class ExportWidget(Operator, ExportHelper):
         name = ob.name
         f = open(self.filepath, 'w')
         f.write("int _WIDGET_nverts_%s = %d;\n" % (name, len(me.vertices)))
-        f.write("int _WIDGET_nfaces_%s = %d;\n\n" % (name, len(me.polygons)))
+        f.write("int _WIDGET_ntris_%s = %d;\n\n" % (name, len(me.polygons)))
         f.write("float _WIDGET_verts_%s[][3] = {\n" % name)
         for v in me.vertices:
             f.write("    {%.6f, %.6f, %.6f},\n" % v.co[:])            
diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h
index 940580a..b2b0404 100644
--- a/source/blender/editors/include/ED_transform.h
+++ b/source/blender/editors/include/ED_transform.h
@@ -166,6 +166,7 @@ typedef struct ManipulatorGroup {
 int WIDGET_manipulator_handler(struct bContext *C, const struct wmEvent *event, struct wmWidget *widget);
 
 int WIDGET_manipulator_handler_trans(struct bContext *C, const struct wmEvent *event, struct wmWidget *widget);
+int WIDGET_manipulator_handler_rot(struct bContext *C, const struct wmEvent *event, struct wmWidget *widget);
 
 void WIDGET_manipulator_render_3d_intersect(const struct bContext *C, struct wmWidget *widget, float scale, int selectionbase);
 void WIDGET_manipulator_draw(struct wmWidget *widget, const struct bContext *C, float scale);
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 73fb042..ef087ba 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -1013,4 +1013,8 @@ struct wmWidget *WIDGET_arrow_new(int style, int (*handler)(struct bContext *C,
 void WIDGET_arrow_set_color(struct wmWidget *widget, float color[4]);
 void WIDGET_arrow_set_direction(struct wmWidget *widget, float direction[3]);
 
+struct wmWidget *WIDGET_dial_new(int style, int (*handler)(struct bContext *C, const struct wmEvent *event, struct wmWidget *widget));
+void WIDGET_dial_set_color(struct wmWidget *widget, float color[4]);
+void WIDGET_dial_set_direction(struct wmWidget *widget, float direction[3]);
+
 #endif  /* __UI_INTERFACE_H__ */
diff --git a/source/blender/editors/interface/3d_widgets/arrow_widget.c b/source/blender/editors/interface/3d_widgets/arrow_widget.c
index 2cd4dd2..6cd427a 100644
--- a/source/blender/editors/interface/3d_widgets/arrow_widget.c
+++ b/source/blender/editors/interface/3d_widgets/arrow_widget.c
@@ -1,5 +1,5 @@
 int _WIDGET_nverts_arrow = 81;
-int _WIDGET_nfaces_arrow = 76;
+int _WIDGET_ntris_arrow = 76;
 
 float _WIDGET_verts_arrow[][3] = {
     {0.023005, 0.023005, 0.000524},
diff --git a/source/blender/editors/interface/3d_widgets/dial_widget.c b/source/blender/editors/interface/3d_widgets/dial_widget.c
new file mode 100644
index 0000000..e14e2e1
--- /dev/null
+++ b/source/blender/editors/interface/3d_widgets/dial_widget.c
@@ -0,0 +1,523 @@
+int _WIDGET_nverts_dial = 160;
+int _WIDGET_ntris_dial = 192;
+
+float _WIDGET_verts_dial[][3] = {
+    {-0.000000, 0.979766, 0.037380},
+    {-0.382683, 0.923880, 0.080198},
+    {-0.707107, 0.707107, 0.080198},
+    {-0.905186, 0.374940, 0.037380},
+    {-0.979766, -0.000000, 0.037380},
+    {-0.923880, -0.382684, 0.080198},
+    {-0.707107, -0.707107, 0.080198},
+    {-0.374940, -0.905186, 0.037380},
+    {-0.000000, -0.979766, 0.037380},
+    {0.382683, -0.923880, 0.080198},
+    {0.707107, -0.707107, 0.080198},
+    {0.905186, -0.374940, 0.037380},
+    {0.979766, 0.000000, 0.037380},
+    {0.923879, 0.382684, 0.080198},
+    {0.707107, 0.707107, 0.080198},
+    {0.374940, 0.905186, 0.037380},
+    {-0.000000, 0.799034, 0.037380},
+    {-0.298034, 0.719517, 0.080198},
+    {-0.550695, 0.550695, 0.080198},
+    {-0.738211, 0.305777, 0.037380},
+    {-0.799034, -0.000000, 0.037380},
+    {-0.719517, -0.298034, 0.080198},
+    {-0.550695, -0.550695, 0.080198},
+    {-0.305777, -0.738211, 0.037380},
+    {-0.000000, -0.799034, 0.037380},
+    {0.298034, -0.719517, 0.080198},
+    {0.550695, -0.550695, 0.080198},
+    {0.738211, -0.305777, 0.037380},
+    {0.799034, 0.000000, 0.037380},
+    {0.719517, 0.298034, 0.080198},
+    {0.550694, 0.550695, 0.080198},
+    {0.305777, 0.738211, 0.037380},
+    {-0.000000, 0.799034, 0.037380},
+    {-0.298034, 0.719517, 0.080198},
+    {-0.550695, 0.550695, 0.080198},
+    {-0.738211, 0.305777, 0.037380},
+    {-0.799034, -0.000000, 0.037380},
+    {-0.719517, -0.298034, 0.080198},
+    {-0.550695, -0.550695, 0.080198},
+    {-0.305777, -0.738211, 0.037380},
+    {-0.000000, -0.799034, 0.037380},
+    {0.298034, -0.719517, 0.080198},
+    {0.550695, -0.550695, 0.080198},
+    {0.738211, -0.305777, 0.037380},
+    {0.799034, 0.000000, 0.037380},
+    {0.719517, 0.298034, 0.080198},
+    {0.550694, 0.550695, 0.080198},
+    {0.305777, 0.738211, 0.037380},
+    {-0.000000, 0.979766, 0.037380},
+    {-0.382683, 0.923880, 0.080198},
+    {-0.707107, 0.707107, 0.080198},
+    {-0.905186, 0.374940, 0.037380},
+    {-0.979766, -0.000000, 0.037380},
+    {-0.923880, -0.382684, 0.080198},
+    {-0.707107, -0.707107, 0.080198},
+    {-0.374940, -0.905186, 0.037380},
+    {-0.000000, -0.979766, 0.037380},
+    {0.382683, -0.923880, 0.080198},
+    {0.707107, -0.707107, 0.080198},
+    {0.905186, -0.374940, 0.037380},
+    {0.979766, 0.000000, 0.037380},
+    {0.923879, 0.382684, 0.080198},
+    {0.707107, 0.707107, 0.080198},
+    {0.374940, 0.905186, 0.037380},
+    {0.382683, 0.923880, 0.000000},
+    {0.725722, 0.725722, 0.000000},
+    {0.948202, 0.392758, 0.000000},
+    {1.000000, 0.000000, 0.000000},
+    {0.923880, -0.382684, 0.000000},
+    {0.725722, -0.725722, 0.000000},
+    {0.392758, -0.948202, 0.000000},
+    {-0.000000, -1.000000, 0.000000},
+    {-0.382683, -0.923880, 0.000000},
+    {-0.725722, -0.725722, 0.000000},
+    {-0.948202, -0.392758, 0.000000},
+    {-1.000000, -0.000000, 0.000000},
+    {-0.923880, 0.382683, 0.000000},
+    {-0.725722, 0.725722, 0.000000},
+    {-0.392758, 0.948202, 0.000000},
+    {0.000000, 1.000000, 0.000000},
+    {-0.000000, 0.979766, -0.037380},
+    {-0.382683, 0.923880, -0.080198},
+    {-0.707107, 0.707107, -0.080198},
+    {-0.905186, 0.374940, -0.037380},
+    {-0.979766, -0.000000, -0.037380},
+    {-0.923880, -0.382684, -0.080198},
+    {-0.707107, -0.707107, -0.080198},
+    {-0.374940, -0.905186, -0.037380},
+    {-0.000000, -0.979766, -0.037380},
+    {0.382683, -0.923880, -0.080198},
+    {0.707107, -0.707107, -0.080198},
+    {0.905186, -0.374940, -0.037380},
+    {0.979766, 0.000000, -0.037380},
+    {0.923879, 0.382684, -0.080198},
+    {0.707107, 0.707107, -0.080198},
+    {0.374940, 0.905186, -0.037380},
+    {-0.000000, 0.799034, -0.037380},
+    {-0.298034, 0.719517, -0.080198},
+    {-0.550695, 0.550695, -0.080198},
+    {-0.738211, 0.305777, -0.037380},
+    {-0.799034, -0.000000, -0.037380},
+    {-0.719517, -0.298034, -0.080198},
+    {-0.550695, -0.550695, -0.080198},
+    {-0.305777, -0.738211, -0.037380},
+    {-0.000000, -0.799034, -0.037380},
+    {0.298034, -0.719517, -0.080198},
+    {0.550695, -0.550695, -0.080198},
+    {0.738211, -0.305777, -0.037380},
+    {0.799034, 0.000000, -0.037380},
+    {0.719517, 0.298034, -0.080198},
+    {0.550694, 0.550695, -0.080198},
+    {0.305777, 0.738211, -0.037380},
+    {-0.000000, 0.778800, 0.000000},
+    {-0.287395, 0.693834, 0.000000},
+    {-0.531037, 0.531037, 0.000000},
+    {-0.719517, 0.298034, 0.000000},
+    {-0.778800, -0.000000, 0.000000},
+    {-0.693834, -0.287395, 0.000000},
+    {-0.531037, -0.531037, 0.000000},
+    {-0.298034, -0.719517, 0.000000},
+    {-0.000000, -0.778800, 0.000000},
+    {0.287395, -0.693834, 0.000000},
+    {0.531037, -0.531038, 0.000000},
+    {0.719517, -0.298034, 0.000000},
+    {0.778800, 0.000000, 0.000000},
+    {0.693834, 0.287396, 0.000000},
+    {0.531037, 0.531038, 0.000000},
+    {0.298033, 0.719517, 0.000000},
+    {-0.000000, 0.799034, -0.037380},
+    {-0.298034, 0.719517, -0.080198},
+    {-0.550695, 0.550695, -0.080198},
+    {-0.738211, 0.305777, -0.037380},
+    {-0.799034, -0.000000, -0.037380},
+    {-0.719517, -0.298034, -0.080198},
+    {-0.550695, -0.550695, -0.080198},
+    {-0.305777, -0.738211, -0.037380},
+    {-0.000000, -0.799034, -0.037380},
+    {0.298034, -0.719517, -0.080198},
+    {0.550695, -0.550695, -0.080198},
+    {0.738211, -0.305777, -0.037380},
+    {0.799034, 0.000000, -0.037380},
+    {0.719517, 0.298034, -0.080198},
+    {0.550694, 0.550695, -0.080198},
+    {0.305777, 0.738211, -0.037380},
+    {-0.000000, 0.979766, -0.037380},
+    {-0.382683, 0.923880, -0.080198},
+    {-0.707107, 0.707107, -0.080198},
+    {-0.905186, 0.374940, -0.037380},
+    {-0.979766, -0.000000, -0.037380},
+    {-0.923880, -0.382684, -0.080198},
+    {-0.707107, -0.707107, -0.080198},
+    {-0.374940, -0.905186, -0.037380},
+    {-0.000000, -0.979766, -0.037380},
+    {0.382683, -0.923880, -0.080198},
+    {0.707107, -0.707107, -0.080198},
+    {0.905186, -0.374940, -0.037380},
+    {0.979766, 0.000000, -0.037380},
+    {0.923879, 0.382684, -0.080198},
+    {0.707107, 0.707107, -0.080198},
+    {0.374940, 0.905186, -0.037380},
+};
+
+float _WIDGET_normals_dial[][3] = {
+    {0.064974, 0.008820, 0.997833},
+    {0.051515, 0.021332, 0.998413},
+    {-0.039430, -0.039430, 0.998413},
+    {-0.033021, -0.056642, 0.997833},
+    {-0.008820, 0.064974, 0.997833},
+    {-0.021332, 0.051515, 0.998413},
+    {0.039430, -0.039430, 0.998413},
+    {0.056642, -0.033021, 0.997833},
+    {-0.064974, -0.008820, 0.997833},
+    {-0.051515, -0.021332, 0.998413},
+    {0.039430, 0.039430, 0.998413},
+    {0.033021, 0.056642, 0.997833},
+    {0.008820, -0.064974, 0.997833},
+    {0.021332, -0.051515, 0.998413},
+    {-0.039430, 0.039430, 0.998413},
+    {-0.056642, 0.033021, 0.997833},
+    {0.072481, 0.000000, 0.997345},
+    {0.056429, 0.015625, 0.998260},
+    {-0.036042, -0.046144, 0.998260},
+    {-0.027741, -0.066988, 0.997345},
+    {0.000000, 0.072481, 0.997345},
+    {-0.

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list