MOAB: Mesh Oriented datABase  (version 5.4.1)
smoab::detail::LoadPoly Class Reference

#include <LoadPoly.h>

+ Collaboration diagram for smoab::detail::LoadPoly:

Public Member Functions

 LoadPoly (const smoab::Range &cells, const smoab::Interface &interface)
const smoab::RangemoabPoints () const
void fill (vtkPolyData *dataSet)

Private Member Functions

void addCoordinates (vtkPointSet *grid)
void addGridsTopology (vtkPolyData *data, vtkIdType numCells, vtkIdType numConnectivity) const

Private Attributes

moab::InterfaceInterface
smoab::detail::LinearCellConnectivity CellConn
smoab::Range Points

Detailed Description

Definition at line 23 of file LoadPoly.h.


Constructor & Destructor Documentation

smoab::detail::LoadPoly::LoadPoly ( const smoab::Range cells,
const smoab::Interface interface 
) [inline]

Definition at line 32 of file LoadPoly.h.

            : Interface( interface.Moab ), CellConn( cells, interface.Moab ), Points()
        {
        }

Member Function Documentation

void smoab::detail::LoadPoly::addCoordinates ( vtkPointSet *  grid) [inline, private]

Definition at line 57 of file LoadPoly.h.

References CellConn, smoab::detail::LinearCellConnectivity::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->CellConn.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::LoadPoly::addGridsTopology ( vtkPolyData *  data,
vtkIdType  numCells,
vtkIdType  numConnectivity 
) const [inline, private]

Definition at line 80 of file LoadPoly.h.

References CellConn, and smoab::detail::LinearCellConnectivity::copyToVtkCellInfo().

Referenced by fill().

        {
            //correct the connectivity size to account for the vtk padding
            const vtkIdType vtkConnectivity = numCells + numConnectivity;

            vtkNew< vtkIdTypeArray > cellArray;
            cellArray->SetNumberOfValues( vtkConnectivity );

            vtkIdType* rawArray = static_cast< vtkIdType* >( cellArray->GetVoidPointer( 0 ) );
            this->CellConn.copyToVtkCellInfo( rawArray );

            vtkNew< vtkCellArray > cells;
            cells->SetCells( numCells, cellArray.GetPointer() );

            data->SetPolys( cells.GetPointer() );
        }
void smoab::detail::LoadPoly::fill ( vtkPolyData *  dataSet) [inline]

Definition at line 44 of file LoadPoly.h.

References addCoordinates(), addGridsTopology(), CellConn, and smoab::detail::LinearCellConnectivity::compactIds().

        {
            //now that CellConn 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->CellConn.compactIds( numCells, connLen );
            this->addGridsTopology( dataSet, numCells, connLen );
            this->addCoordinates( dataSet );
        }

Definition at line 37 of file LoadPoly.h.

References Points.

        {
            return this->Points;
        }

Member Data Documentation

Definition at line 25 of file LoadPoly.h.

Definition at line 27 of file LoadPoly.h.

Referenced by addCoordinates(), and moabPoints().

List of all members.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines