From 6eced8c625fc06a1f4236160f73da6a392b864b2 Mon Sep 17 00:00:00 2001
From: "edward.vigmond" <edward.vigmond@u-bordeaux.fr>
Date: Mon, 16 Nov 2020 12:19:50 +0100
Subject: [PATCH] can flip surface normals

---
 src/trimesh.fl | 48 +++++++++++++++++++++++++++++++-----------------
 1 file changed, 31 insertions(+), 17 deletions(-)

diff --git a/src/trimesh.fl b/src/trimesh.fl
index 11c85cf..1926811 100644
--- a/src/trimesh.fl
+++ b/src/trimesh.fl
@@ -1,5 +1,5 @@
 # data file for the Fltk User Interface Designer (fluid)
-version 1.0305
+version 1.0400
 header_name {.h}
 code_name {.cc}
 decl {\#include "Surfaces.h"} {public local
@@ -14,7 +14,7 @@ decl {\#include<list>} {public global
 decl {\#include <algorithm>} {private local
 }
 
-decl {\#include<memory>} {selected private local
+decl {\#include<memory>} {private local
 }
 
 decl {class TBmeshWin;} {public local
@@ -119,7 +119,7 @@ class Controls {open
   } {
     Fl_Window window {
       label {Meshalyzer Controls} open
-      xywh {731 112 350 705} type Double box UP_BOX
+      xywh {1156 124 350 705} type Double box UP_BOX
       code0 {\#include <FL/Fl_Color_Chooser.H>}
       code1 {\#include "VecData.h"} visible
     } {
@@ -915,11 +915,11 @@ reglist->do_callback();}
           tooltip {draw all points; otherwise only those part of displayed objects} xywh {235 145 25 25} box UP_BOX down_box DOWN_BOX align 33
         }
       }
-      Fl_Tabs tabwidget {
+      Fl_Tabs tabwidget {open
         xywh {10 270 330 260} align 0
       } {
         Fl_Group hilightgrp {
-          label Highlight
+          label Highlight selected
           xywh {10 305 330 225} color 11 labelfont 1 labelsize 12 labelcolor 121 align 4
         } {
           Fl_Value_Input tethi {
@@ -1203,7 +1203,7 @@ mwtb->bf_light(1);}
           }
         }
         Fl_Group surfgrp {
-          label Surface
+          label Surface open
           xywh {15 304 325 221} color 93 labelfont 1 labelsize 12 labelcolor 90 hide
         } {
           Fl_Light_Button surfvisbut {
@@ -1211,27 +1211,27 @@ mwtb->bf_light(1);}
             callback {vector<int>lst;
 surfselected(lst);
 mwtb->surfVis(lst,static_cast<bool>(o->value()));}
-            xywh {255 310 80 25} value 1 selection_color 2 labelsize 12 align 16
+            xywh {255 310 80 20} value 1 selection_color 2 labelsize 12 align 16
           }
           Fl_Light_Button surfoutlinebut {
             label Outline
             callback {vector<int>lst;
 surfselected(lst);
 mwtb->surfOutline(lst,static_cast<bool>(o->value()));}
-            xywh {255 345 80 25} color 181 labelsize 12
+            xywh {255 340 80 20} color 181 labelsize 12
           }
           Fl_Light_Button surffillbut {
             label Filled
             callback {vector<int> lst;
 surfselected(lst);
 mwtb->surfFilled(lst,static_cast<bool>(o->value()));}
-            xywh {255 410 80 20} value 1 color 245 labelsize 12
+            xywh {255 395 80 20} value 1 color 245 labelsize 12
           }
           Fl_Button {} {
             label {Outline colour}
             callback {static surfColourChoice *cc=NULL;
 cc=pick_surf_color( SurfEle, "Outline Colour",cc );}
-            tooltip {change colour and opacity} xywh {255 370 80 30} color 181 selection_color 48 labelsize 12
+            tooltip {change colour and opacity} xywh {255 360 80 25} color 181 selection_color 48 labelsize 12
           }
           Fl_Button fillsurfcol {
             label {Fill colour}
@@ -1241,7 +1241,7 @@ cc=pick_surf_color( SurfEle, "Outline Colour",cc );}
 if( (v==(void *)1) && (!cc ||!cc->window->visible_r()) ) return;
 
 cc=pick_surf_color( Surface, "Surface colour",cc );}
-            tooltip {change colour and opacity} xywh {255 430 80 30} color 245 labelsize 12
+            tooltip {change colour and opacity} xywh {255 415 80 25} color 245 labelsize 12
           }
           Fl_Check_Browser surflist {
             callback {fillsurfcol->do_callback(fillsurfcol,1);}
@@ -1249,14 +1249,14 @@ cc=pick_surf_color( Surface, "Surface colour",cc );}
           }
           Fl_Group {} {
             label Select open
-            xywh {45 477 186 48} box ENGRAVED_FRAME labelsize 13 align 17
+            xywh {40 477 186 48} box ENGRAVED_FRAME labelsize 13 align 17
           } {
             Fl_Button {} {
               label all
               callback {surflist->check_all();
 update_surfGUI(0);
 fillsurfcol->do_callback(fillsurfcol,1);}
-              xywh {50 494 55 25}
+              xywh {45 494 55 25}
             }
             Fl_Button {} {
               label invert
@@ -1270,7 +1270,7 @@ for( int i=1; i<=surflist->nitems(); i++ ) {
     surflist->checked(i, !surflist->checked(i));
 }
 fillsurfcol->do_callback(fillsurfcol,1);}
-              xywh {110 494 55 25} color 0 labelfont 1 labelsize 12 labelcolor 49
+              xywh {105 494 55 25} color 0 labelfont 1 labelsize 12 labelcolor 49
             }
             Fl_Button {} {
               label shown
@@ -1284,7 +1284,7 @@ for( int i=1; i<=surflist->nitems(); i++ ) {
     surflist->checked(i,mwtb->model->surface(i-1)->visible());
 }
 fillsurfcol->do_callback(fillsurfcol,1);}
-              xywh {170 494 55 25} color 4 labelfont 1 labelsize 12 labelcolor 49
+              xywh {165 494 55 25} color 4 labelfont 1 labelsize 12 labelcolor 49
             }
           }
           Fl_Menu_Button {} {
@@ -1334,7 +1334,21 @@ refresh_surflist(0);
 surflist->set_checked(sel+1);
 
 write_surfaces(0);}
-            tooltip {rename surface} xywh {255 470 80 25} labelsize 12
+            tooltip {rename surface} xywh {255 450 80 20} labelsize 12
+          }
+          Fl_Menu_Button {} {
+            label flip open
+            xywh {255 470 80 20}
+          } {
+            MenuItem {} {
+              label normals
+              callback {for( int mi=0; mi<surflist->nitems(); mi++ ) 
+ if( surflist->checked(mi+1) ) {
+   mwtb->model->surface(mi)->flip_norms();
+ }
+mwtb->redraw(VBO_Colour);}
+              xywh {0 0 31 20}
+            }
           }
         }
         Fl_Group vectorgrp {
@@ -2316,7 +2330,7 @@ flyby = new FlyBy( mwtb, this );
 lightorient->window(mwtb);
 lightorient->Rot(Quaternion(0.,0.,1.,0.));} {}
   }
-  Function {pick_surf_color(Object_t ot, string winlab, surfColourChoice *cc=NULL)} {return_type {surfColourChoice *}
+  Function {pick_surf_color(Object_t ot, string winlab, surfColourChoice *cc=NULL)} {open return_type {surfColourChoice *}
   } {
     code {int msz = surflist->nitems();
 
-- 
GitLab