[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38098] branches/soc-2011-onion/source/ blender/editors: UV island manager

Antony Riakiotakis kalast at gmail.com
Tue Jul 5 00:37:28 CEST 2011


Revision: 38098
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38098
Author:   psy-fi
Date:     2011-07-04 22:37:28 +0000 (Mon, 04 Jul 2011)
Log Message:
-----------
UV island manager
=====================
-code moving to appropriate files
-get and set enable state for manager

Most likely manager will be a per-UV layer state.

Modified Paths:
--------------
    branches/soc-2011-onion/source/blender/editors/include/ED_image.h
    branches/soc-2011-onion/source/blender/editors/include/ED_uvedit.h
    branches/soc-2011-onion/source/blender/editors/space_image/space_image.c
    branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_island_manager.c

Modified: branches/soc-2011-onion/source/blender/editors/include/ED_image.h
===================================================================
--- branches/soc-2011-onion/source/blender/editors/include/ED_image.h	2011-07-04 22:03:32 UTC (rev 38097)
+++ branches/soc-2011-onion/source/blender/editors/include/ED_image.h	2011-07-04 22:37:28 UTC (rev 38098)
@@ -68,8 +68,7 @@
 /* UI level image (texture) updating... render calls own stuff (too) */
 void ED_image_update_frame(const struct Main *mainp, int cfra);
 
-/* uvedit_island_manager.c */
-void ED_space_image_enable_island_manager(int state);
-
+/* enable uvedit_island_manager */
+void ED_uvedit_enable_island_manager(int state);
 #endif /* ED_IMAGE_H */
 

Modified: branches/soc-2011-onion/source/blender/editors/include/ED_uvedit.h
===================================================================
--- branches/soc-2011-onion/source/blender/editors/include/ED_uvedit.h	2011-07-04 22:03:32 UTC (rev 38097)
+++ branches/soc-2011-onion/source/blender/editors/include/ED_uvedit.h	2011-07-04 22:37:28 UTC (rev 38098)
@@ -40,6 +40,7 @@
 struct Scene;
 struct bContext;
 struct wmKeyConfig;
+struct UVIslandManager;
 
 /* uvedit_ops.c */
 void ED_operatortypes_uvedit(void);
@@ -81,5 +82,11 @@
 /* uvedit_buttons.c */
 void ED_uvedit_buttons_register(struct ARegionType *art);
 
+/* uvedit_island_manager.c */
+struct UVIslandManager *ED_get_island_manager_handle(void);
+/* get enable state of island manager */
+int ED_uvedit_island_manager_get_enabled(void);
+/* draw the island manager */
+void ED_uvedit_island_manager_draw(void);
 #endif /* ED_UVEDIT_H */
 

Modified: branches/soc-2011-onion/source/blender/editors/space_image/space_image.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/space_image/space_image.c	2011-07-04 22:03:32 UTC (rev 38097)
+++ branches/soc-2011-onion/source/blender/editors/space_image/space_image.c	2011-07-04 22:37:28 UTC (rev 38098)
@@ -311,8 +311,8 @@
 void ED_space_image_enable_island_manager(int state)
 {
 	/* in uvedit_island_manager */
-	extern UVIslandManager _island_manager;
-	_island_manager.active = (state > 0);
+	UVIslandManager *manager = ED_get_island_manager_handle();
+	manager->active = (state > 0);
 }
 
 static void image_scopes_tag_refresh(ScrArea *sa)

Modified: branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_island_manager.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_island_manager.c	2011-07-04 22:03:32 UTC (rev 38097)
+++ branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_island_manager.c	2011-07-04 22:37:28 UTC (rev 38098)
@@ -31,34 +31,33 @@
  */
 
 #include "GL/glew.h"
+#include  "DNA_scene_types.h"
 
-/*
- * UVIsland Component, stores boundaries for uv island, possibly a list of faces too, though this would be
- */
-typedef struct UVIslandComponent {
-		float x_pos;
-		float y_pos;
-		float width;
-		float height;
-		/* Looks like a family reunion :p */
-		struct UVIslandComponent *brother;
-		struct UVIslandComponent *child;
-} UVIslandComponent;
+#include "ED_image.h"
+#include "ED_uvedit.h"
 
 
-static void draw_UV_island_cell(UVIslandComponent *cell)
+
+static UVIslandManager _island_manager;
+
+/* get enable state of island manager */
+int ED_uvedit_island_manager_get_enabled(void)
 {
+	/* in uvedit_island_manager */
+	return _island_manager.active;
+}
 
+UVIslandManager *ED_get_island_manager_handle(void)
+{
+	return (&_island_manager);
 }
 
+void ED_uvedit_island_manager_draw(void)
+{
 
-/**
- * Island Manager, holds the state necessary to use/display the island manager
- */
-typedef struct UVIslandManager {
-		char active;
+}
 
-		UVIslandComponent *rootIsland;
-} UVIslandManager;
+static void draw_UV_island_cell(UVIslandComponent *cell)
+{
 
-UVIslandManager _island_manager;
+}




More information about the Bf-blender-cvs mailing list