Revision: 49108
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49108
Author:   nazgul
Date:     2012-07-21 19:21:12 +0000 (Sat, 21 Jul 2012)
Log Message:
-----------
Merging r49105 through r49107 from trunk into soc-2011-tomato

Revision Links:
--------------
    
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49105
    
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49107

Modified Paths:
--------------
    branches/soc-2011-tomato/intern/boolop/intern/BOP_CarveInterface.cpp
    branches/soc-2011-tomato/source/blender/blenlib/intern/math_rotation.c
    branches/soc-2011-tomato/source/blender/editors/interface/interface.c
    branches/soc-2011-tomato/source/blender/editors/interface/interface_icons.c
    branches/soc-2011-tomato/source/blender/editors/interface/resources.c
    branches/soc-2011-tomato/source/blender/editors/interface/view2d_ops.c

Property Changed:
----------------
    branches/soc-2011-tomato/
    branches/soc-2011-tomato/source/blender/editors/interface/interface.c
    branches/soc-2011-tomato/source/blender/editors/space_outliner/


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-49104
   + 
/branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-49107

Modified: branches/soc-2011-tomato/intern/boolop/intern/BOP_CarveInterface.cpp
===================================================================
--- branches/soc-2011-tomato/intern/boolop/intern/BOP_CarveInterface.cpp        
2012-07-21 19:19:45 UTC (rev 49107)
+++ branches/soc-2011-tomato/intern/boolop/intern/BOP_CarveInterface.cpp        
2012-07-21 19:21:12 UTC (rev 49108)
@@ -547,13 +547,32 @@
        return 0;
 }
 
-static bool Carve_checkDegeneratedFace(MeshSet<3>::face_t *face)
+static bool Carve_checkDegeneratedFace(std::map<MeshSet<3>::vertex_t*, uint> 
*vertexToIndex_map, MeshSet<3>::face_t *face)
 {
        /* only tris and quads for now */
        if (face->n_edges == 3) {
+               uint v1, v2, v3;
+
+               v1 = vertexToIndex_map->find(face->edge->prev->vert)->second;
+               v2 = vertexToIndex_map->find(face->edge->vert)->second;
+               v3 = vertexToIndex_map->find(face->edge->next->vert)->second;
+
+               if (v1 == v2 || v2 == v3 || v1 == v3)
+                       return true;
+
                return triangleArea(face->edge->prev->vert->v, 
face->edge->vert->v, face->edge->next->vert->v) < DBL_EPSILON;
        }
        else if (face->n_edges == 4) {
+               uint v1, v2, v3, v4;
+
+               v1 = vertexToIndex_map->find(face->edge->prev->vert)->second;
+               v2 = vertexToIndex_map->find(face->edge->vert)->second;
+               v3 = vertexToIndex_map->find(face->edge->next->vert)->second;
+               v4 = 
vertexToIndex_map->find(face->edge->next->next->vert)->second;
+
+               if (v1 == v2 || v1 == v3 || v1 == v4 || v2 == v3 || v2 == v4 || 
v3 == v4)
+                       return true;
+
                return triangleArea(face->edge->vert->v, 
face->edge->next->vert->v, face->edge->next->next->vert->v) +
                       triangleArea(face->edge->prev->vert->v, 
face->edge->vert->v, face->edge->next->next->vert->v) < DBL_EPSILON;
        }
@@ -595,8 +614,14 @@
        MeshSet<3>::face_iter face_iter = poly->faceBegin();
        for (i = 0; face_iter != poly->faceEnd(); ++face_iter, ++i) {
                MeshSet<3>::face_t *f = *face_iter;
+
+               if (Carve_checkDegeneratedFace(&vertexToIndex_map, f))
+                       continue;
+
                ofaces[oface_num.getAttribute(f)].push_back(i);
+
                MeshSet<3>::face_t::edge_iter_t edge_iter = f->begin();
+
                for (; edge_iter != f->end(); ++edge_iter) {
                        int index = vertexToIndex_map[edge_iter->vert];
                        vi[index].push_back(i);
@@ -659,36 +684,27 @@
                                }
                        }
 
-                       bool degenerativeFace = false;
+                       // add all information except vertices to the output 
mesh
+                       outputMesh->FaceSet().push_back(BSP_MFace());
+                       BSP_MFace& outFace = outputMesh->FaceSet().back();
+                       outFace.m_verts.clear();
+                       outFace.m_plane.setValue(f->plane.N.v);
+                       outFace.m_orig_face = orig;
 
-                       if (!result) {
-                               /* merged triangles are already checked for 
degenerative quad */
-                               degenerativeFace = 
Carve_checkDegeneratedFace(f);
-                       }
-
-                       if (!degenerativeFace) {
-                               // add all information except vertices to the 
output mesh
-                               outputMesh->FaceSet().push_back(BSP_MFace());
-                               BSP_MFace& outFace = 
outputMesh->FaceSet().back();
-                               outFace.m_verts.clear();
-                               outFace.m_plane.setValue(f->plane.N.v);
-                               outFace.m_orig_face = orig;
-
-                               // if we merged faces, use the list of common 
vertices; otherwise
-                               // use the faces's vertices
-                               if (result) {
-                                       // make quat using verts stored in 
result
-                                       outFace.m_verts.push_back(quadverts[0]);
-                                       outFace.m_verts.push_back(quadverts[1]);
-                                       outFace.m_verts.push_back(quadverts[2]);
-                                       outFace.m_verts.push_back(quadverts[3]);
-                               } else {
-                                       MeshSet<3>::face_t::edge_iter_t 
edge_iter = f->begin();
-                                       for (; edge_iter != f->end(); 
++edge_iter) {
-                                               //int index = 
ofacevert_num.getAttribute(f, edge_iter.idx());
-                                               int index = 
vertexToIndex_map[edge_iter->vert];
-                                               outFace.m_verts.push_back( 
index );
-                                       }
+                       // if we merged faces, use the list of common vertices; 
otherwise
+                       // use the faces's vertices
+                       if (result) {
+                               // make quat using verts stored in result
+                               outFace.m_verts.push_back(quadverts[0]);
+                               outFace.m_verts.push_back(quadverts[1]);
+                               outFace.m_verts.push_back(quadverts[2]);
+                               outFace.m_verts.push_back(quadverts[3]);
+                       } else {
+                               MeshSet<3>::face_t::edge_iter_t edge_iter = 
f->begin();
+                               for (; edge_iter != f->end(); ++edge_iter) {
+                                       //int index = 
ofacevert_num.getAttribute(f, edge_iter.idx());
+                                       int index = 
vertexToIndex_map[edge_iter->vert];
+                                       outFace.m_verts.push_back( index );
                                }
                        }
                }

Modified: branches/soc-2011-tomato/source/blender/blenlib/intern/math_rotation.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenlib/intern/math_rotation.c      
2012-07-21 19:19:45 UTC (rev 49107)
+++ branches/soc-2011-tomato/source/blender/blenlib/intern/math_rotation.c      
2012-07-21 19:21:12 UTC (rev 49108)
@@ -1164,8 +1164,8 @@
        compatible_eul(eul1, oldrot);
        compatible_eul(eul2, oldrot);
 
-       d1 = (float)fabsf(eul1[0] - oldrot[0]) + (float)fabsf(eul1[1] - 
oldrot[1]) + (float)fabsf(eul1[2] - oldrot[2]);
-       d2 = (float)fabsf(eul2[0] - oldrot[0]) + (float)fabsf(eul2[1] - 
oldrot[1]) + (float)fabsf(eul2[2] - oldrot[2]);
+       d1 = fabsf(eul1[0] - oldrot[0]) + fabsf(eul1[1] - oldrot[1]) + 
fabsf(eul1[2] - oldrot[2]);
+       d2 = fabsf(eul2[0] - oldrot[0]) + fabsf(eul2[1] - oldrot[1]) + 
fabsf(eul2[2] - oldrot[2]);
 
        /* return best, which is just the one with lowest difference */
        if (d1 > d2) {

Modified: branches/soc-2011-tomato/source/blender/editors/interface/interface.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/interface/interface.c       
2012-07-21 19:19:45 UTC (rev 49107)
+++ branches/soc-2011-tomato/source/blender/editors/interface/interface.c       
2012-07-21 19:21:12 UTC (rev 49108)
@@ -2243,8 +2243,12 @@
                        UI_GET_BUT_VALUE_INIT(but, value);
 
                        if (ui_is_but_float(but)) {
-                               if (value == (double) FLT_MAX) 
BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%sinf", but->str);
-                               else if (value == (double) -FLT_MAX) 
BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s-inf", but->str);
+                               if (value == (double) FLT_MAX) {
+                                       BLI_snprintf(but->drawstr, 
sizeof(but->drawstr), "%sinf", but->str);
+                               }
+                               else if (value == (double) -FLT_MAX) {
+                                       BLI_snprintf(but->drawstr, 
sizeof(but->drawstr), "%s-inf", but->str);
+                               }
                                /* support length type buttons */
                                else if (ui_is_but_unit(but)) {
                                        char new_str[sizeof(but->drawstr)];
@@ -2550,7 +2554,9 @@
  * - \a a2 Number of decimal point values to display. 0 defaults to 3 (0.000)
  *      1,2,3, and a maximum of 4, all greater values will be clamped to 4.
  */
-static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char 
*str, int x1, int y1, short x2, short y2, void *poin, float min, float max, 
float a1, float a2, const char *tip)
+static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
+                         int x1, int y1, short x2, short y2,
+                         void *poin, float min, float max, float a1, float a2, 
const char *tip)
 {
        uiBut *but;
        int slen;
@@ -2622,10 +2628,14 @@
                }
        }
 
-       if ((block->flag & UI_BLOCK_LOOP) || ELEM8(but->type, MENU, TEX, LABEL, 
IDPOIN, BLOCK, BUTM, SEARCH_MENU, PROGRESSBAR))
+       if ((block->flag & UI_BLOCK_LOOP) ||
+           ELEM8(but->type, MENU, TEX, LABEL, IDPOIN, BLOCK, BUTM, 
SEARCH_MENU, PROGRESSBAR))
+       {
                but->flag |= (UI_TEXT_LEFT | UI_ICON_LEFT);
-       else if (but->type == BUT_TOGDUAL)
+       }
+       else if (but->type == BUT_TOGDUAL) {
                but->flag |= UI_ICON_LEFT;
+       }
 
        but->flag |= (block->flag & UI_BUT_ALIGN);
 
@@ -2670,7 +2680,10 @@
        but->lockstr = ""
 
 
-static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char 
*str, int x1, int y1, short x2, short y2, PointerRNA *ptr, PropertyRNA *prop, 
int index, float min, float max, float a1, float a2,  const char *tip)
+static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char 
*str,
+                             int x1, int y1, short x2, short y2,
+                             PointerRNA *ptr, PropertyRNA *prop, int index,
+                             float min, float max, float a1, float a2,  const 
char *tip)
 {
        const PropertyType proptype = RNA_property_type(prop);
        uiBut *but;


Property changes on: 
branches/soc-2011-tomato/source/blender/editors/interface/interface.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-49104
   + /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989

@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to