Microflow 3D  v1.0
MF::GB::GeometryBuildFromSTL Class Reference

#include <GeometryBuildFromSTL.h>

Public Member Functions

 GeometryBuildFromSTL ()=default
 
 ~GeometryBuildFromSTL ()=default
 
void ReadGrid (bool verbose=false)
 Reads grid from .stl file. More...
 
void AutomaticBoundaryFind ()
 Boundary nodes automatic finding. More...
 
void BoundaryAddFromThreadFile ()
 Adds boundary from thread.cfg file. More...
 
void FluidAddFromThreadFile ()
 Adds fluid from thread.cfg file. More...
 
void SolidAddFromThreadFile ()
 Adds solid from thread.cfg file. More...
 
void WriteGeometryGridToVtiFile ()
 Writes geometry Int32 geometry grid to .vti file. More...
 
void WriteGeometryGridToVDBFile ()
 Writes geometry Int32 geometry grid to .vti file. More...
 
void Clean ()
 Delete some unnecessary objects. More...
 

Static Public Member Functions

static std::shared_ptr< MF::GB::GeometryBuildFromSTLNew (const std::shared_ptr< MF::Database::ConfigData > &ConfigData_Ptr, const std::shared_ptr< MF::GU::LatticeParametersD3Q19 > &LatticeParameters_Ptr)
 

Data Fields

openvdb::FloatGrid::Ptr m_STLGeometryGrid_Ptr
 Shared pointer to the VDB geometry grid of float value - a volumetric mesh created from the .stl file. More...
 
openvdb::Int64Grid::Ptr m_VDBInt64GeometryGrid_Ptr
 Shared pointer to the VDB geometry grid of Int64 value. More...
 
openvdb::Int32Grid::Ptr m_VDBPropagationGrid_Ptr
 Shared pointer to the VDB propagation grid of int value. More...
 
std::shared_ptr< MF::Database::GridVDB< openvdb::Int64Grid > > m_MFGrid_GeometryGrid_Ptr
 Shared pointer to the MFGrid geometry grid of Int64 value. More...
 

Detailed Description

Definition at line 41 of file GeometryBuildFromSTL.h.

Constructor & Destructor Documentation

◆ GeometryBuildFromSTL()

MF::GB::GeometryBuildFromSTL::GeometryBuildFromSTL ( )
default

◆ ~GeometryBuildFromSTL()

MF::GB::GeometryBuildFromSTL::~GeometryBuildFromSTL ( )
default

Member Function Documentation

◆ AutomaticBoundaryFind()

void MF::GB::GeometryBuildFromSTL::AutomaticBoundaryFind ( )

Boundary nodes automatic finding.

Definition at line 35 of file GeometryBuildFromSTL.cpp.

References m_VDBInt64GeometryGrid_Ptr, m_VDBPropagationGrid_Ptr, and MF::GB::AutoSettingNode::New().

Referenced by New().

35  {
36  m_AutoSettingNode_Ptr = MF::GB::AutoSettingNode::New(m_ConfigData_Ptr, m_VDBInt64GeometryGrid_Ptr, m_LatticeParameters_Ptr, m_VDBPropagationGrid_Ptr);
37  m_AutoSettingNode_Ptr->BoundaryFind();
38 }
openvdb::Int32Grid::Ptr m_VDBPropagationGrid_Ptr
Shared pointer to the VDB propagation grid of int value.
static std::shared_ptr< MF::GB::AutoSettingNode > New(const std::shared_ptr< MF::Database::ConfigData > &ConfigData_Ptr, const openvdb::Int64Grid::Ptr &GeometryGrid_Ptr, const std::shared_ptr< MF::GU::LatticeParametersD3Q19 > &LatticeParameters_Ptr, const openvdb::Int32Grid::Ptr &PropagationGrid_Ptr)
openvdb::Int64Grid::Ptr m_VDBInt64GeometryGrid_Ptr
Shared pointer to the VDB geometry grid of Int64 value.

◆ BoundaryAddFromThreadFile()

void MF::GB::GeometryBuildFromSTL::BoundaryAddFromThreadFile ( )

Adds boundary from thread.cfg file.

Definition at line 47 of file GeometryBuildFromSTL.cpp.

References m_VDBInt64GeometryGrid_Ptr, and MF::GB::BoundaryFromThread::VDBBoundaryAdd().

Referenced by New().

47  {
49  m_AutoSettingNode_Ptr->DefaultTypeSet();
50  m_AutoSettingNode_Ptr->NodeTypeClass();
51 }
static void VDBBoundaryAdd(const openvdb::Int64Grid::Ptr &VDBGrid, const std::shared_ptr< MF::Database::ConfigData > &ConfigData_Ptr)
openvdb::Int64Grid::Ptr m_VDBInt64GeometryGrid_Ptr
Shared pointer to the VDB geometry grid of Int64 value.

◆ Clean()

void MF::GB::GeometryBuildFromSTL::Clean ( )

Delete some unnecessary objects.

Definition at line 79 of file GeometryBuildFromSTL.cpp.

References m_MFGrid_GeometryGrid_Ptr, m_STLGeometryGrid_Ptr, m_VDBInt64GeometryGrid_Ptr, m_VDBPropagationGrid_Ptr, MF::GU::PropagationD3Q19::New(), MF::GB::StlMesher::New(), MF::Database::GridVDB< T_VDBGridType >::New(), MF::GB::NodeID::Node, MF::GB::NodeID::node_id, and MF::GB::NodeID::NodeID.

Referenced by New().

79  {
80  m_PropagationTest_Ptr.reset();
81  m_PropagationGrid_Ptr.reset();
82  m_VDBPropagationGrid_Ptr = nullptr;
83  m_STLMesher_Ptr.reset();
84  m_STLGeometryGrid_Ptr = nullptr;
85  m_AutoSettingNode_Ptr.reset();
86 }
openvdb::Int32Grid::Ptr m_VDBPropagationGrid_Ptr
Shared pointer to the VDB propagation grid of int value.
openvdb::FloatGrid::Ptr m_STLGeometryGrid_Ptr
Shared pointer to the VDB geometry grid of float value - a volumetric mesh created from the ...

◆ FluidAddFromThreadFile()

void MF::GB::GeometryBuildFromSTL::FluidAddFromThreadFile ( )

Adds fluid from thread.cfg file.

Definition at line 53 of file GeometryBuildFromSTL.cpp.

References m_VDBInt64GeometryGrid_Ptr, and MF::GB::FluidFromThread::VDBFluidAdd().

Referenced by New().

53  {
55  m_AutoSettingNode_Ptr->BoundaryFind();
56 }
static void VDBFluidAdd(const openvdb::Int64Grid::Ptr &VDBGrid, const std::shared_ptr< MF::Database::ConfigData > &ConfigData_Ptr)
openvdb::Int64Grid::Ptr m_VDBInt64GeometryGrid_Ptr
Shared pointer to the VDB geometry grid of Int64 value.

◆ New()

static std::shared_ptr<MF::GB::GeometryBuildFromSTL> MF::GB::GeometryBuildFromSTL::New ( const std::shared_ptr< MF::Database::ConfigData > &  ConfigData_Ptr,
const std::shared_ptr< MF::GU::LatticeParametersD3Q19 > &  LatticeParameters_Ptr 
)
inlinestatic

Definition at line 47 of file GeometryBuildFromSTL.h.

References AutomaticBoundaryFind(), BoundaryAddFromThreadFile(), Clean(), FluidAddFromThreadFile(), ReadGrid(), SolidAddFromThreadFile(), WriteGeometryGridToVDBFile(), and WriteGeometryGridToVtiFile().

Referenced by main().

47  {
48  auto GeometryBuildFromSTL_Ptr = std::make_shared<MF::GB::GeometryBuildFromSTL>();
49  GeometryBuildFromSTL_Ptr->m_ConfigData_Ptr = ConfigData_Ptr;
50  GeometryBuildFromSTL_Ptr->m_LatticeParameters_Ptr = LatticeParameters_Ptr;
51  GeometryBuildFromSTL_Ptr->m_voxelSize = ConfigData_Ptr->getCaseFloatParam("GeometryParams.VoxelSize");
52  return GeometryBuildFromSTL_Ptr;
53  };

◆ ReadGrid()

void MF::GB::GeometryBuildFromSTL::ReadGrid ( bool  verbose = false)

Reads grid from .stl file.

Referenced by New().

◆ SolidAddFromThreadFile()

void MF::GB::GeometryBuildFromSTL::SolidAddFromThreadFile ( )

Adds solid from thread.cfg file.

Definition at line 58 of file GeometryBuildFromSTL.cpp.

References m_VDBInt64GeometryGrid_Ptr, and MF::GB::SolidFromThread::VDBSolidAdd().

Referenced by New().

58  {
60  MF::GB::GeometryBuildFromSTL::NewPropagationTest();
61  m_AutoSettingNode_Ptr->BoundaryFind();
62 }
static void VDBSolidAdd(const openvdb::Int64Grid::Ptr &VDBGrid, const std::shared_ptr< MF::Database::ConfigData > &ConfigData_Ptr)
openvdb::Int64Grid::Ptr m_VDBInt64GeometryGrid_Ptr
Shared pointer to the VDB geometry grid of Int64 value.

◆ WriteGeometryGridToVDBFile()

void MF::GB::GeometryBuildFromSTL::WriteGeometryGridToVDBFile ( )

Writes geometry Int32 geometry grid to .vti file.

Definition at line 70 of file GeometryBuildFromSTL.cpp.

References m_MFGrid_GeometryGrid_Ptr.

Referenced by New().

70  {
71  std::string GridFileName = (m_ConfigData_Ptr->GeometryFile.substr(0, m_ConfigData_Ptr->GeometryFile.length() - 4));
72  std::string GeometryName = m_ConfigData_Ptr->getCaseStringParam("GeometryParams.GeometryName");
73  m_MFGrid_GeometryGrid_Ptr->setGridName(GeometryName);
74  double PhysVoxelSize = m_ConfigData_Ptr->getCaseFloatParam("GeometryParams.PhysicalVoxelSize");
75  m_MFGrid_GeometryGrid_Ptr->insertMetaDataFloat("Physical size of voxel", PhysVoxelSize);
76  m_MFGrid_GeometryGrid_Ptr->saveToVDBFile(GridFileName);
77 }
std::shared_ptr< MF::Database::GridVDB< openvdb::Int64Grid > > m_MFGrid_GeometryGrid_Ptr
Shared pointer to the MFGrid geometry grid of Int64 value.

◆ WriteGeometryGridToVtiFile()

void MF::GB::GeometryBuildFromSTL::WriteGeometryGridToVtiFile ( )

Writes geometry Int32 geometry grid to .vti file.

Definition at line 64 of file GeometryBuildFromSTL.cpp.

References m_MFGrid_GeometryGrid_Ptr.

Referenced by New().

64  {
65  std::string GridFileName = (m_ConfigData_Ptr->GeometryFile.substr(0, m_ConfigData_Ptr->GeometryFile.length() - 4));
66  double PhysVoxelSize = m_ConfigData_Ptr->getCaseFloatParam("GeometryParams.PhysicalVoxelSize");
67  m_MFGrid_GeometryGrid_Ptr->saveToVTIFile<vtkIntArray>(GridFileName, "Node type", 1, PhysVoxelSize);
68 }
std::shared_ptr< MF::Database::GridVDB< openvdb::Int64Grid > > m_MFGrid_GeometryGrid_Ptr
Shared pointer to the MFGrid geometry grid of Int64 value.

Field Documentation

◆ m_MFGrid_GeometryGrid_Ptr

std::shared_ptr<MF::Database::GridVDB<openvdb::Int64Grid> > MF::GB::GeometryBuildFromSTL::m_MFGrid_GeometryGrid_Ptr

Shared pointer to the MFGrid geometry grid of Int64 value.

Definition at line 67 of file GeometryBuildFromSTL.h.

Referenced by Clean(), WriteGeometryGridToVDBFile(), and WriteGeometryGridToVtiFile().

◆ m_STLGeometryGrid_Ptr

openvdb::FloatGrid::Ptr MF::GB::GeometryBuildFromSTL::m_STLGeometryGrid_Ptr

Shared pointer to the VDB geometry grid of float value - a volumetric mesh created from the .stl file.

Definition at line 64 of file GeometryBuildFromSTL.h.

Referenced by Clean().

◆ m_VDBInt64GeometryGrid_Ptr

openvdb::Int64Grid::Ptr MF::GB::GeometryBuildFromSTL::m_VDBInt64GeometryGrid_Ptr

Shared pointer to the VDB geometry grid of Int64 value.

Definition at line 65 of file GeometryBuildFromSTL.h.

Referenced by AutomaticBoundaryFind(), BoundaryAddFromThreadFile(), Clean(), FluidAddFromThreadFile(), and SolidAddFromThreadFile().

◆ m_VDBPropagationGrid_Ptr

openvdb::Int32Grid::Ptr MF::GB::GeometryBuildFromSTL::m_VDBPropagationGrid_Ptr

Shared pointer to the VDB propagation grid of int value.

Definition at line 66 of file GeometryBuildFromSTL.h.

Referenced by AutomaticBoundaryFind(), and Clean().


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