Skip to content
Snippets Groups Projects
Select Git revision
  • d792a3163f7bfe51f68b575e389ef2231ed6b450
  • master default protected
  • 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
  • tmp_jcjc24
  • 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_11_0
  • 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
41 results

discreteRegion.cpp

Blame
  • NewView.cpp 1.44 KiB
    // Gmsh - Copyright (C) 1997-2013 C. Geuzaine, J.-F. Remacle
    //
    // See the LICENSE.txt file for license information. Please report all
    // bugs and problems to the public mailing list <gmsh@geuz.org>.
    //
    // Contributor(s):
    //   Ruth Sabariego  & Francois Henrotte
    //
    
    
    #include "NewView.h"
    #include "GModel.h"
    #include "MElement.h"
    
    StringXNumber NewViewOptions_Number[] = {
      {GMSH_FULLRC, "View", NULL, -1.}
    };
    
    extern "C"
    {
      GMSH_Plugin *GMSH_RegisterNewViewPlugin()
      {
        return new GMSH_NewViewPlugin();
      }
    }
    
    std::string GMSH_NewViewPlugin::getHelp() const
    {
      return "Plugin(NewView) creates a new view from a mesh." ;
    }
    
    int GMSH_NewViewPlugin::getNbOptions() const
    {
      return sizeof(NewViewOptions_Number) / sizeof(StringXNumber);
    }
    
    StringXNumber *GMSH_NewViewPlugin::getOption(int iopt)
    {
      return &NewViewOptions_Number[iopt];
    }
    
    PView *GMSH_NewViewPlugin::execute(PView * v)
    {
      if(GModel::current()->getMeshStatus() < 1){
        Msg::Error("No mesh available to create the view: please mesh your model!");
        return v ;
      }
      std::map<int, std::vector<double> > d;
      std::vector<GEntity*> entities;
      GModel::current()->getEntities(entities);
      for(unsigned int i = 0; i < entities.size(); i++){
        for(unsigned int j = 0; j < entities[i]->mesh_vertices.size(); j++){
          MVertex *ve = entities[i]->mesh_vertices[j];
          d[ve->getNum()].push_back(0.);
        }
      }
    
      PView *vn = new PView("New view", "NodeData", GModel::current(), d);
      return vn ;
    }