rsvs3D  0.0.0
Codes for the c++ implementation of the 3D RSVS
polyscopersvs::PolyScopeRSVS Class Reference

A structure containing the information about the polyscope display and the RSVS elements to display. More...

#include <polyscopersvs.hpp>

Public Member Functions

 PolyScopeRSVS ()
 Initialize polyscope, creating graphics contexts and constructing a window. More...
 
 PolyScopeRSVS (bool isHeadless)
 Construct a new Poly Scope RSVS object. More...
 
void show (size_t forFrames=SIZE_MAX)
 Show the polyscope window. More...
 
void addMesh (std::string name, const mesh &meshIn)
 Add a mesh with a given name to the polyscope window. More...
 
void addSnake (std::string name, const snake &snakeIn)
 PLot a snake with it's velocity in the given polyscope window. More...
 
void addSurfaceProperties (std::string name, const mesh &surfaceMesh)
 Adds properties of the surface of a snake to it's mesh as scalar quantities. More...
 
float addCells (std::string name, const mesh &meshIn, const std::vector< int > &&cellIndices, bool isIndex=true)
 Plot specified volume elements into polyscope. More...
 
void setInteractiveCallback (integrate::RSVSclass &RSVSobj)
 Set polyscope's user callback to a lambda which allows control of the RSVSobj. More...
 

Private Attributes

bool isHeadless
 Captures whether the RSVS window is being displayed or not.
 

Detailed Description

A structure containing the information about the polyscope display and the RSVS elements to display.

The normal lifetime of that class is to call its show method when you want to display the polyscope window. To use the RSVS in interactive mode you can call the setInteractiveCallback method which enables interaction with the RSVS's configuration and execution flow.

Definition at line 53 of file polyscopersvs.hpp.

Constructor & Destructor Documentation

◆ PolyScopeRSVS() [1/2]

polyscopersvs::PolyScopeRSVS::PolyScopeRSVS ( )

Initialize polyscope, creating graphics contexts and constructing a window.

Should be called exactly once.

Definition at line 39 of file polyscopersvs.cpp.

◆ PolyScopeRSVS() [2/2]

polyscopersvs::PolyScopeRSVS::PolyScopeRSVS ( bool  isHeadless)

Construct a new Poly Scope RSVS object.

Parameters
isHeadlessWhether to use the headless mode or not, when headless the OpenGL mocked back end is used.

Definition at line 54 of file polyscopersvs.cpp.

Member Function Documentation

◆ addCells()

float polyscopersvs::PolyScopeRSVS::addCells ( std::string  name,
const mesh meshIn,
const std::vector< int > &&  cellIndices,
bool  isIndex = true 
)

Plot specified volume elements into polyscope.

This method can be used to highlight specific volume elements in the mesh.

Parameters
nameThe name to give to the polyscope object.
meshInThe mesh from which the elements need to be extracted.
cellIndicesThe indicies of the volume elements to be displayed.
isIndexWether an index (true) or the position in the array (false) is used to identify volume elements.
Returns
float The value of the target volume fraction in the last volume cell that was accessed.
Parameters
name
meshIn
cellIndices
isIndex
Returns
float : This is the volume of the last cell that was encountered

Definition at line 218 of file polyscopersvs.cpp.

◆ addMesh()

void polyscopersvs::PolyScopeRSVS::addMesh ( std::string  name,
const mesh meshIn 
)

Add a mesh with a given name to the polyscope window.

Add a new surface mesh from a mesh object to polyscope.

This method plots the given mesh as a surface mesh in polyscope.

Parameters
nameThe name (in polyscope) to give to that mesh, if it is the same as an existing one the previous one will be overwritten.
meshInThe mesh object to plot.
nameThe name of the surface mesh in polyscope. Using an existing name will allow to overwrite a previous mesh.
meshInThe mesh object that will be parsed for polyscope. This mesh must have been prepared (Using the mesh::PrepareForUse method).

Definition at line 98 of file polyscopersvs.cpp.

◆ addSnake()

void polyscopersvs::PolyScopeRSVS::addSnake ( std::string  name,
const snake snakeIn 
)

PLot a snake with it's velocity in the given polyscope window.

Color a surface mesh using a snake's properties.

Parameters
nameThe name of the mesh which will be used to display the snake.
snakeInThe snake object which will be plotted.

Uses the snake's velocity to color a new surface mesh.

Definition at line 141 of file polyscopersvs.cpp.

◆ addSurfaceProperties()

void polyscopersvs::PolyScopeRSVS::addSurfaceProperties ( std::string  name,
const mesh surfaceMesh 
)

Adds properties of the surface of a snake to it's mesh as scalar quantities.

Plots all the available surface quantities on a surface mesh.

Parameters
name
surfaceMesh

Definition at line 190 of file polyscopersvs.cpp.

◆ setInteractiveCallback()

void polyscopersvs::PolyScopeRSVS::setInteractiveCallback ( integrate::RSVSclass RSVSobj)

Set polyscope's user callback to a lambda which allows control of the RSVSobj.

A method which sets the polyscope userCallback to a UI controlling the giving RSVS object.

This method is called to run the RSVS process in interactive mode. Once you have initialised the RSVS process you are ready to call this method. The callback it will set captures the RSVS object and allows an interactive configuration, control and visualization.

Parameters
RSVSobjThe main object of the RSVS process. A reference is kept in the callback to allow iteration.

This will make the current object active in the session.

Parameters
RSVSobjA fully formed RSVSclass which allows handling of the RSVS iteration process.

A ImGui callback for configuring and controlling the RSVS execution.

This lambda function is only meant to be used as the user callback of polyscope.

Definition at line 704 of file polyscopersvs.cpp.

◆ show()

void polyscopersvs::PolyScopeRSVS::show ( size_t  forFrames = SIZE_MAX)

Show the polyscope window.

Parameters
forFramesThe number of frames for which to display the window. This can be used to make show non blocking.

Pass control flow to polyscope, displaying the interactive window. Function will return when user closes the window.

Definition at line 78 of file polyscopersvs.cpp.


The documentation for this class was generated from the following files: