rsvs3D
0.0.0
Codes for the c++ implementation of the 3D RSVS
|
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. | |
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.
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::PolyScopeRSVS::PolyScopeRSVS | ( | bool | isHeadless | ) |
Construct a new Poly Scope RSVS object.
isHeadless | Whether to use the headless mode or not, when headless the OpenGL mocked back end is used. |
Definition at line 54 of file polyscopersvs.cpp.
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.
name | The name to give to the polyscope object. |
meshIn | The mesh from which the elements need to be extracted. |
cellIndices | The indicies of the volume elements to be displayed. |
isIndex | Wether an index (true) or the position in the array (false) is used to identify volume elements. |
name | |
meshIn | |
cellIndices | |
isIndex |
Definition at line 218 of file polyscopersvs.cpp.
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.
name | The name (in polyscope) to give to that mesh, if it is the same as an existing one the previous one will be overwritten. |
meshIn | The mesh object to plot. |
name | The name of the surface mesh in polyscope. Using an existing name will allow to overwrite a previous mesh. |
meshIn | The 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.
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.
name | The name of the mesh which will be used to display the snake. |
snakeIn | The 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.
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.
name | |
surfaceMesh |
Definition at line 190 of file polyscopersvs.cpp.
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.
RSVSobj | The 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.
RSVSobj | A 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.
void polyscopersvs::PolyScopeRSVS::show | ( | size_t | forFrames = SIZE_MAX | ) |
Show the polyscope window.
forFrames | The 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.