AtilaCalculatorSoftware  2.3.4
C++ Interface for Atila fem resources files
BinaryDataWrapper Class Reference

Wrapper around the BinaryData class that allows to interact with VTK. More...

#include <binary_data_wrapper.h>

Inheritance diagram for BinaryDataWrapper:
BinaryData

Public Member Functions

 BinaryDataWrapper (const std::string &file)
 
 ~BinaryDataWrapper ()
 Empty but needed for unstructuredGrid destruction. More...
 
void loadResult (Result &result, const int &component)
 Load the given component of the given result, set inner values. More...
 
void reload ()
 Re-read points, use to update hidden/shown elements. More...
 
void hideElement (const std::string &element)
 Prevent an element from being plot. More...
 
void showElement (const std::string &element)
 Set a hidden element to non hidden. More...
 
void toggleElement (const std::string &element)
 Set hidden element to non hidden and non hidden element to shown. More...
 
void showAllElements ()
 Set all elements to non hidden. More...
 
vtkSmartPointer< vtkUnstructuredGrid > getUnstructuredGrid () const
 
vtkSmartPointer< vtkFloatArray > getScalars () const
 
std::set< std::string > getElements () const
 
std::set< std::string > getHiddenElements () const
 
bool isElementHidden (const std::string &element) const
 
QStringList getInformationList () const
 
- Public Member Functions inherited from BinaryData
 BinaryData (const std::string &file)
 
gzFile getFile ()
 
std::vector< Mesh > & getMeshes ()
 
std::vector< Result > & getResults ()
 
 ~BinaryData ()
 Closes open files. More...
 
void readMeshes ()
 
std::optional< ResultreadResult ()
 Read one result from the res gzFile. More...
 
std::vector< ResultreadResults (unsigned int n=0)
 Read the n given results, stops if there is no more result. More...
 

Private Member Functions

void loadMeshInformation (Mesh &mesh)
 Read information from the mesh and write it to the informationList. More...
 
void convertFromGiD ()
 Read points from BinaryData values loaded with GiD (meshes) More...
 

Static Private Member Functions

static vtkSmartPointer< vtkCell > getPolygonVTKCell (const std::string &meshElement, const unsigned int &dimCount)
 Find and return the good polygon fitting the mesh elements and dimensions. More...
 

Private Attributes

vtkSmartPointer< vtkUnstructuredGrid > unstructuredGrid
 DataSet of all the points converted from GiD representation. More...
 
vtkSmartPointer< vtkPoints > points
 Mesh nodes as vtkPoints object. More...
 
vtkSmartPointer< vtkFloatArray > scalars
 Observed values. More...
 
std::set< std::string > elements
 All elements loaded by the mesh. More...
 
std::set< std::string > hiddenElements
 GiD elements of the mesh that won't be shown. More...
 
QStringList informationList
 Information about the current results. More...
 

Additional Inherited Members

- Protected Attributes inherited from BinaryData
gzFile file
 Opened res gzFile. More...
 
std::vector< Meshmeshes
 Read meshes. More...
 
std::vector< Resultresults
 Read meshes. More...
 
- Static Protected Attributes inherited from BinaryData
static const int byteOrderCheck = 0x91d
 Constant value for reading check. More...
 

Detailed Description

Wrapper around the BinaryData class that allows to interact with VTK.

Constructor & Destructor Documentation

◆ BinaryDataWrapper()

BinaryDataWrapper::BinaryDataWrapper ( const std::string &  file)
explicit
Parameters
filePath to the res gzFile

◆ ~BinaryDataWrapper()

BinaryDataWrapper::~BinaryDataWrapper ( )
default

Empty but needed for unstructuredGrid destruction.

Member Function Documentation

◆ convertFromGiD()

void BinaryDataWrapper::convertFromGiD ( )
private

Read points from BinaryData values loaded with GiD (meshes)

◆ getElements()

std::set< std::string > BinaryDataWrapper::getElements ( ) const
Returns
A set of the loaded elements

◆ getHiddenElements()

std::set< std::string > BinaryDataWrapper::getHiddenElements ( ) const
Returns
A set of all the hidden elements

◆ getInformationList()

QStringList BinaryDataWrapper::getInformationList ( ) const
Returns
Information about the current results as a QT usable object

◆ getPolygonVTKCell()

vtkSmartPointer< vtkCell > BinaryDataWrapper::getPolygonVTKCell ( const std::string &  meshElement,
const unsigned int &  dimCount 
)
staticprivate

Find and return the good polygon fitting the mesh elements and dimensions.

Parameters
meshElementElement of the mesh
dimCountNumber of dimensions of the count
Returns
The well fitting polygon as a VTKCell object

◆ getScalars()

vtkSmartPointer< vtkFloatArray > BinaryDataWrapper::getScalars ( ) const
Returns
Observed values of the loaded result

◆ getUnstructuredGrid()

vtkSmartPointer< vtkUnstructuredGrid > BinaryDataWrapper::getUnstructuredGrid ( ) const
Returns
The DataSet of points of the loaded and converted GiD resource file

◆ hideElement()

void BinaryDataWrapper::hideElement ( const std::string &  element)

Prevent an element from being plot.

Parameters
elementElement to prevent from plotting

◆ isElementHidden()

bool BinaryDataWrapper::isElementHidden ( const std::string &  element) const
Returns
True if the given element is set on hidden

◆ loadMeshInformation()

void BinaryDataWrapper::loadMeshInformation ( Mesh mesh)
private

Read information from the mesh and write it to the informationList.

◆ loadResult()

void BinaryDataWrapper::loadResult ( Result result,
const int &  component 
)

Load the given component of the given result, set inner values.

Parameters
resultResult to load
componentComponent to load

◆ reload()

void BinaryDataWrapper::reload ( )

Re-read points, use to update hidden/shown elements.

◆ showAllElements()

void BinaryDataWrapper::showAllElements ( )

Set all elements to non hidden.

◆ showElement()

void BinaryDataWrapper::showElement ( const std::string &  element)

Set a hidden element to non hidden.

Parameters
elementElement to set

◆ toggleElement()

void BinaryDataWrapper::toggleElement ( const std::string &  element)

Set hidden element to non hidden and non hidden element to shown.

Parameters
elementElement to toggle

Member Data Documentation

◆ elements

std::set<std::string> BinaryDataWrapper::elements
private

All elements loaded by the mesh.

◆ hiddenElements

std::set<std::string> BinaryDataWrapper::hiddenElements
private

GiD elements of the mesh that won't be shown.

◆ informationList

QStringList BinaryDataWrapper::informationList
private

Information about the current results.

◆ points

vtkSmartPointer<vtkPoints> BinaryDataWrapper::points
private

Mesh nodes as vtkPoints object.

◆ scalars

vtkSmartPointer<vtkFloatArray> BinaryDataWrapper::scalars
private

Observed values.

◆ unstructuredGrid

vtkSmartPointer<vtkUnstructuredGrid> BinaryDataWrapper::unstructuredGrid
private

DataSet of all the points converted from GiD representation.


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