Back to index

salome-smesh  6.5.0
Public Member Functions | Protected Member Functions | Protected Attributes
SMDS_VtkCellIterator Class Reference

#include <SMDS_VtkCellIterator.hxx>

Inheritance diagram for SMDS_VtkCellIterator:
Inheritance graph
[legend]
Collaboration diagram for SMDS_VtkCellIterator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SMDS_VtkCellIterator (SMDS_Mesh *mesh, int vtkCellId, SMDSAbs_EntityType aType)
virtual ~SMDS_VtkCellIterator ()
virtual bool more ()
 Return true if and only if there are other object in this iterator.
virtual const SMDS_MeshElement * next ()
 Return the current object and step to the next one.
void exchange (vtkIdType a, vtkIdType b)
virtual void remove ()
 Delete the current element and step to the next one.

Protected Member Functions

 SMDS_VtkCellIterator ()

Protected Attributes

SMDS_Mesh * _mesh
int _cellId
int _index
int _nbNodes
SMDSAbs_EntityType _type
vtkIdList * _vtkIdList

Detailed Description

Definition at line 30 of file SMDS_VtkCellIterator.hxx.


Constructor & Destructor Documentation

SMDS_VtkCellIterator::SMDS_VtkCellIterator ( SMDS_Mesh *  mesh,
int  vtkCellId,
SMDSAbs_EntityType  aType 
)

Definition at line 23 of file SMDS_VtkCellIterator.cxx.

                                                                                                   :
  _mesh(mesh), _cellId(vtkCellId), _index(0), _type(aType)
{
  vtkUnstructuredGrid* grid = _mesh->getGrid();
  _vtkIdList = vtkIdList::New();
  const std::vector<int>& interlace = SMDS_MeshCell::fromVtkOrder( aType );
  if ( interlace.empty() )
  {
    grid->GetCellPoints(_cellId, _vtkIdList);
    _nbNodes = _vtkIdList->GetNumberOfIds();
  }
  else
  {
    vtkIdType npts, *pts;
    grid->GetCellPoints( _cellId, npts, pts );
    _vtkIdList->SetNumberOfIds( _nbNodes = npts );
    for (int i = 0; i < _nbNodes; i++)
      _vtkIdList->SetId(i, pts[interlace[i]]);
  }
}

Definition at line 44 of file SMDS_VtkCellIterator.cxx.

{
  _vtkIdList->Delete();
}

Definition at line 45 of file SMDS_VtkCellIterator.hxx.

{};

Member Function Documentation

void SMDS_VtkCellIterator::exchange ( vtkIdType  a,
vtkIdType  b 
) [inline]

Definition at line 37 of file SMDS_VtkCellIterator.hxx.

  {
    vtkIdType t = _vtkIdList->GetId(a);
    _vtkIdList->SetId(a, _vtkIdList->GetId(b));
    _vtkIdList->SetId(b, t);
  }
bool SMDS_VtkCellIterator::more ( ) [virtual]

Return true if and only if there are other object in this iterator.

Implements SMDS_Iterator< const SMDS_MeshElement * >.

Reimplemented in SMDS_VtkCellIteratorPolyH.

Definition at line 49 of file SMDS_VtkCellIterator.cxx.

{
  return (_index < _nbNodes);
}
const SMDS_MeshElement * SMDS_VtkCellIterator::next ( ) [virtual]

Return the current object and step to the next one.

Implements SMDS_Iterator< const SMDS_MeshElement * >.

Definition at line 54 of file SMDS_VtkCellIterator.cxx.

{
  vtkIdType id = _vtkIdList->GetId(_index++);
  return _mesh->FindNodeVtk(id);
}
virtual void SMDS_Iterator< const SMDS_MeshElement * >::remove ( ) [inline, virtual, inherited]

Delete the current element and step to the next one.

Definition at line 44 of file SMDS_Iterator.hxx.

{}

Member Data Documentation

Definition at line 48 of file SMDS_VtkCellIterator.hxx.

Definition at line 49 of file SMDS_VtkCellIterator.hxx.

SMDS_Mesh* SMDS_VtkCellIterator::_mesh [protected]

Definition at line 45 of file SMDS_VtkCellIterator.hxx.

Definition at line 50 of file SMDS_VtkCellIterator.hxx.

Definition at line 51 of file SMDS_VtkCellIterator.hxx.

vtkIdList* SMDS_VtkCellIterator::_vtkIdList [protected]

Definition at line 52 of file SMDS_VtkCellIterator.hxx.


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