Skip to content
Snippets Groups Projects
Select Git revision
  • 856d14f0cf5cb22936fc8c6cec15805b452d89c3
  • master default
  • cgnsUnstructured
  • partitioning
  • poppler
  • HighOrderBLCurving
  • gmsh_3_0_4
  • gmsh_3_0_3
  • gmsh_3_0_2
  • gmsh_3_0_1
  • gmsh_3_0_0
  • gmsh_2_16_0
  • gmsh_2_15_0
  • gmsh_2_14_1
  • gmsh_2_14_0
  • gmsh_2_13_2
  • gmsh_2_13_1
  • gmsh_2_12_0
  • gmsh_2_11_0
  • gmsh_2_10_1
  • gmsh_2_10_0
  • gmsh_2_9_3
  • gmsh_2_9_2
  • gmsh_2_9_1
  • gmsh_2_9_0
  • gmsh_2_8_6
26 results

GUI.cpp

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    title.script 1.70 KiB
    // This scripts adds a title using Plugin(Annotate)
    
    // create an empty view
    View "Title" {};
    
    num = PostProcessing.NbViews-1;
    
    // add the main project name
    x = -25;
    y = 40;
    Plugin(Annotate).View = num; 
    Plugin(Annotate).Text = StrCat("Project: ", StrPrefix(StrRelative(Sprintf(General.FileName))));
    Plugin(Annotate).Font = "Helvetica-Bold"; 
    Plugin(Annotate).FontSize = 20; 
    Plugin(Annotate).Align = "Right";
    Plugin(Annotate).X = x;
    Plugin(Annotate).Y = y; 
    Plugin(Annotate).Run; 
    
    // add data and gmsh version info
    y += 25;
    Plugin(Annotate).Text = StrCat(Today, Sprintf(" (Gmsh %g.%g.%g)", GMSH_MAJOR_VERSION,
                                                                      GMSH_MINOR_VERSION,
                                                                      GMSH_PATCH_VERSION));
    Plugin(Annotate).Font = "Helvetica" ; 
    Plugin(Annotate).FontSize = 14 ; 
    Plugin(Annotate).Y = y ; 
    Plugin(Annotate).Run ; 
    
    // if we have a mesh, print some statistics
    nbelm = Mesh.NbTriangles + Mesh.NbQuadrangles + Mesh.NbTetrahedra + 
            Mesh.NbHexahedra + Mesh.NbPrisms + Mesh.NbPyramids  + Mesh.NbTrihedra;
    nbnod = Mesh.NbNodes;
    If(nbelm && nbnod)
      y += 20;
      Plugin(Annotate).Text = Sprintf("Mesh: %g nodes/%g elements", nbelm, nbnod);
      Plugin(Annotate).Font = "Helvetica-Oblique" ; 
      Plugin(Annotate).FontSize = 12 ; 
      Plugin(Annotate).Y = y;
      Plugin(Annotate).Run ; 
    EndIf
    
    // if we have some post-processing views, add the variable names
    If(num > 0)
      y += 20;
      For i In {0:num-1}
        Plugin(Annotate).Text = StrCat(Sprintf("Variable %g: ", i), Sprintf(View[i].Name));
        Plugin(Annotate).Font = "Helvetica-Oblique";
        Plugin(Annotate).FontSize = 12; 
        Plugin(Annotate).Y = y; 
        Plugin(Annotate).Run;
        y += 16;
      EndFor
    EndIf