MOAB: Mesh Oriented datABase
(version 5.4.1)
|
#include <LoadGeometry.h>
Public Member Functions | |
LoadGeometry (const smoab::Range &cells, int topologyDim, const smoab::Interface &interface) | |
const smoab::Range & | moabPoints () const |
template<typename vtkDataSetType > | |
void | fill (vtkDataSetType *dataSet) |
Private Member Functions | |
void | addCoordinates (vtkPointSet *grid) |
template<typename vtkDataSetType > | |
void | addGridsTopology (vtkDataSetType *grid, vtkIdType numCells, vtkIdType numConnectivity) const |
Private Attributes | |
moab::Interface * | Interface |
int | TopologyDim |
smoab::detail::MixedCellConnectivity | MixConn |
smoab::Range | Points |
Definition at line 73 of file LoadGeometry.h.
smoab::detail::LoadGeometry::LoadGeometry | ( | const smoab::Range & | cells, |
int | topologyDim, | ||
const smoab::Interface & | interface | ||
) | [inline] |
Definition at line 83 of file LoadGeometry.h.
void smoab::detail::LoadGeometry::addCoordinates | ( | vtkPointSet * | grid | ) | [inline, private] |
Definition at line 109 of file LoadGeometry.h.
References MixConn, smoab::detail::MixedCellConnectivity::moabPoints(), Points, and moab::Range::size().
Referenced by fill().
{ //this is sorta of hackish as moabPoints is only valid //after compactIds has been called this->MixConn.moabPoints( this->Points ); //since the smoab::range are always unique and sorted //we can use the more efficient coords_iterate //call in moab, which returns moab internal allocated memory vtkNew< vtkPoints > newPoints; newPoints->SetDataTypeToDouble(); newPoints->SetNumberOfPoints( this->Points.size() ); //need a pointer to the allocated vtkPoints memory so that we //don't need to use an extra copy and we can bypass all vtk's check //on out of bounds double* rawPoints = static_cast< double* >( newPoints->GetVoidPointer( 0 ) ); this->Interface->get_coords( this->Points, rawPoints ); grid->SetPoints( newPoints.GetPointer() ); }
void smoab::detail::LoadGeometry::addGridsTopology | ( | vtkDataSetType * | grid, |
vtkIdType | numCells, | ||
vtkIdType | numConnectivity | ||
) | const [inline, private] |
Definition at line 133 of file LoadGeometry.h.
References smoab::detail::MixedCellConnectivity::copyToVtkCellInfo(), MixConn, and TopologyDim.
Referenced by fill().
{ //correct the connectivity size to account for the vtk padding const vtkIdType vtkConnectivity = numCells + numConnectivity; vtkNew< vtkIdTypeArray > cellArray; vtkNew< vtkIdTypeArray > cellLocations; vtkNew< vtkUnsignedCharArray > cellTypes; cellArray->SetNumberOfValues( vtkConnectivity ); cellLocations->SetNumberOfValues( numCells ); cellTypes->SetNumberOfValues( numCells ); vtkIdType* rawArray = static_cast< vtkIdType* >( cellArray->GetVoidPointer( 0 ) ); vtkIdType* rawLocations = static_cast< vtkIdType* >( cellLocations->GetVoidPointer( 0 ) ); unsigned char* rawTypes = static_cast< unsigned char* >( cellTypes->GetVoidPointer( 0 ) ); this->MixConn.copyToVtkCellInfo( rawArray, rawLocations, rawTypes ); vtkNew< vtkCellArray > cells; cells->SetCells( numCells, cellArray.GetPointer() ); setCells< vtkDataSetType >()( grid, this->TopologyDim, cellTypes.GetPointer(), cellLocations.GetPointer(), cells.GetPointer() ); }
void smoab::detail::LoadGeometry::fill | ( | vtkDataSetType * | dataSet | ) | [inline] |
Definition at line 96 of file LoadGeometry.h.
References addCoordinates(), addGridsTopology(), smoab::detail::MixedCellConnectivity::compactIds(), and MixConn.
Referenced by smoab::DataSetConverter::fill().
{ //now that mixConn has all the cells properly stored, lets fixup //the ids so that they start at zero and keep the same logical ordering //as before. vtkIdType numCells, connLen; this->MixConn.compactIds( numCells, connLen ); this->addGridsTopology( dataSet, numCells, connLen ); this->addCoordinates( dataSet ); }
const smoab::Range& smoab::detail::LoadGeometry::moabPoints | ( | ) | const [inline] |
Definition at line 88 of file LoadGeometry.h.
References Points.
Referenced by smoab::DataSetConverter::fill().
{ return this->Points; }
Definition at line 75 of file LoadGeometry.h.
Definition at line 77 of file LoadGeometry.h.
Referenced by addCoordinates(), addGridsTopology(), and fill().
Definition at line 78 of file LoadGeometry.h.
Referenced by addCoordinates(), and moabPoints().
int smoab::detail::LoadGeometry::TopologyDim [private] |
Definition at line 76 of file LoadGeometry.h.
Referenced by addGridsTopology().