Skip to content
Snippets Groups Projects
Select Git revision
  • gmsh_4_11_0
  • master default protected
  • steplayer
  • bl
  • pluginMeshQuality
  • fixBugsAmaury
  • hierarchical-basis
  • alphashapes
  • relaying
  • new_export_boris
  • oras_vs_osm
  • reassign_partitions
  • distributed_fwi
  • rename-classes
  • fix/fortran-api-example-t4
  • robust_partitions
  • reducing_files
  • fix_overlaps
  • 3115-issue-fix
  • 3023-Fillet2D-Update
  • convert_fdivs
  • gmsh_4_14_0
  • gmsh_4_13_1
  • gmsh_4_13_0
  • gmsh_4_12_2
  • gmsh_4_12_1
  • gmsh_4_12_0
  • gmsh_4_11_1
  • gmsh_4_10_5
  • gmsh_4_10_4
  • gmsh_4_10_3
  • gmsh_4_10_2
  • gmsh_4_10_1
  • gmsh_4_10_0
  • gmsh_4_9_5
  • gmsh_4_9_4
  • gmsh_4_9_3
  • gmsh_4_9_2
  • gmsh_4_9_1
  • gmsh_4_9_0
40 results

t11.geo

Blame
  • Colorbar_Window.cpp 17.91 KiB
    // $Id: Colorbar_Window.cpp,v 1.46 2004-12-31 04:04:50 geuzaine Exp $
    //
    // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
    //
    // This program is free software; you can redistribute it and/or modify
    // it under the terms of the GNU General Public License as published by
    // the Free Software Foundation; either version 2 of the License, or
    // (at your option) any later version.
    //
    // This program is distributed in the hope that it will be useful,
    // but WITHOUT ANY WARRANTY; without even the implied warranty of
    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    // GNU General Public License for more details.
    //
    // You should have received a copy of the GNU General Public License
    // along with this program; if not, write to the Free Software
    // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
    // USA.
    // 
    // Please report all bugs and problems to <gmsh@geuz.org>.
    
    // This class was inspired by the colorbar widget provided in Vis5d, a
    // program for visualizing five dimensional gridded data sets
    // Copyright (C) 1990 - 1995 Bill Hibbard, Brian Paul, Dave Santek,
    // and Andre Battaiola.
       
    #include "Gmsh.h"
    #include "GmshUI.h"
    #include "GUI.h"
    #include "ColorTable.h"
    #include "Colorbar_Window.h"
    #include "Context.h"
    
    extern Context_T CTX;
    
    #define EPS         1.e-10
    
    // This file defines the Colorbar_Window class (subclass of Fl_Window)
    
    // The constructor
    
    Colorbar_Window::Colorbar_Window(int x, int y, int w, int h, const char *l)
      : Fl_Window(x, y, w, h, l)
    {
      ct = NULL;
      label = NULL;
      help_flag = 1;
      font_height = CTX.fontsize;
      marker_height = font_height;
      wedge_height = marker_height;
      marker_pos = 0;
      minval = maxval = 0.0;
    }
    
    // Convert window X coordinate to color table index
    
    int Colorbar_Window::x_to_index(int x)
    {
      int index;
      index = (int)(x * (double)ct->size / (double)w());
      if(index < 0)
        index = 0;
      else if(index >= ct->size)
        index = ct->size - 1;
      return index;
    }
    
    // Convert color table index to window X coordinate
    
    int Colorbar_Window::index_to_x(int index)