Skip to content

Calling VisualizationSceneSolution3d from own application #274

@altineller

Description

@altineller

Hello,

I would like to use glVis for my own magnetometer calibration software. For this I am trying to use glVis as a library within QTCreator. I have solved all the dependency issues. And I have attempted to create a new VisualizationSceneSolution3d with a mesh and solution, and then callint SDLMainLoop(true), but it crashes.

   int         geom_ref_type = Quadrature1D::ClosedUniform;
   const char *mesh_file = "/home/can/gl/mfem/data/ref-cube.mesh";

   Mesh *mesh = new Mesh(mesh_file, 1, 1);
   int dim = mesh->Dimension();

   GLVisGeometryRefiner.SetType(geom_ref_type);

   H1_FECollection fec(1, 3);
   FiniteElementSpace fespace(mesh, &fec);
   GridFunction x(&fespace);
   x = 0;

   VisualizationSceneSolution3d * vss;
   vs = vss = new VisualizationSceneSolution3d(*mesh, x);
   SDLMainLoop(true);
   return 0;

And when I debugged it I got:

Screenshot from 2024-02-19 23-14-33

Indicating a problem with renderer.

How can I programmatically visualize a mesh, using glVis library within my own application?

Best Regards,
Can

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions