Version: 6.3.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends

SMDS_DownTriangle Class Reference

#include <SMDS_Downward.hxx>

Inheritance diagram for SMDS_DownTriangle:
Inheritance graph
[legend]

Public Member Functions

virtual int getNumberOfUpCells (int cellId)
virtual const intgetUpCells (int cellId)
virtual const unsigned char * getUpTypes (int cellId)
virtual void getNodeIds (int cellId, std::set< int > &nodeSet)
virtual int getNumberOfDownCells (int cellId)
 Get the number of downward entities associated to a cell (always the same for a given vtk type of cell)
virtual const intgetDownCells (int cellId)
 get a pointer on the downward entities id's associated to a cell.
virtual const unsigned char * getDownTypes (int cellId)
 get a list of vtk cell types associated to downward entities of a given cell, in the same order than the downward entities id's list (
virtual int getNodes (int cellId, int *nodevec)
int getVtkCellId (int cellId)
int getMaxId ()

Static Public Member Functions

static int getCellDimension (unsigned char cellType)
 get the dimension of a cell (1,2,3 for 1D, 2D 3D) given the vtk cell type

Protected Member Functions

 SMDS_DownTriangle (SMDS_UnstructuredGrid *grid)
 ~SMDS_DownTriangle ()
virtual void computeEdgesWithNodes (int cellId, ListElemByNodesType &edgesWithNodes)
virtual void addDownCell (int cellId, int lowCellId, unsigned char aType)
 Id's are downward connectivity id's.
virtual void allocate (int nbElems)
 Resize the downward connectivity storage vector if needed.
virtual void compactStorage ()
virtual void addUpCell (int cellId, int upCellId, unsigned char aType)
 Id's are downward connectivity id's.
virtual int getNodeSet (int cellId, int *nodeSet)
int computeVolumeIds (int cellId, int *ids)
 Find in vtkUnstructuredGrid the volumes containing a face already stored in vtkUnstructuredGrid.
int computeVolumeIds (ElemByNodesType &faceByNodes, int *ids)
 Find in vtkUnstructuredGrid the volumes containing a face described by it's nodes Search the volumes containing a face, to store the info in SMDS_Down2D for later uses with SMDS_Down2D.getUpCells and SMDS_Down2D.getUpTypes.
int computeVolumeIdsFromNodesFace (int *nodes, int nbNodes, int *ids)
 Find in vtkUnstructuredGrid the volumes containing a face described by it's nodes Search the volumes containing a face, to store the info in SMDS_Down2D for later uses with SMDS_Down2D.getUpCells and SMDS_Down2D.getUpTypes.
void setTempNodes (int cellId, int vtkId)
void setTempNodes (int cellId, ElemByNodesType &faceByNodes)
bool isInFace (int cellId, int *pts, int npts)
 Find if all the nodes belongs to the face.
int FindEdgeByNodes (int cellId, ElemByNodesType &edgeByNodes)
int addCell (int vtkId=-1)
 Give or create an entry for downward connectivity structure relative to a cell.
virtual void initCell (int cellId)
 generic method do nothing.

Protected Attributes

std::vector< int_upCellIds
 2 volumes max.
std::vector< unsigned char > _upCellTypes
 2 volume types per face
std::vector< int_tempNodes
 temporary storage of nodes, until downward connectivity completion
int _nbNodes
 number of nodes in a face
SMDS_UnstructuredGrid_grid
int _maxId
int _nbDownCells
 the same number for all cells of a derived class
std::vector< int_cellIds
 growing size: all the down cell id's, size = _maxId * _nbDownCells
std::vector< int_vtkCellIds
 growing size: size = _maxId, either vtkId or -1
std::vector< unsigned char > _cellTypes
 fixed size: the same vector for all cells of a derived class

Static Protected Attributes

static std::vector< int_cellDimension
 conversion table: type --> dimension

Friends

class SMDS_UnstructuredGrid

Detailed Description

Definition at line 209 of file SMDS_Downward.hxx.


Constructor & Destructor Documentation

SMDS_DownTriangle::SMDS_DownTriangle ( SMDS_UnstructuredGrid grid) [protected]

Definition at line 884 of file SMDS_Downward.cxx.

References SMDS_Downward._cellTypes, and SMDS_Down2D._nbNodes.

                                                                :
  SMDS_Down2D(grid, 3)
{
  _cellTypes.push_back(VTK_LINE);
  _cellTypes.push_back(VTK_LINE);
  _cellTypes.push_back(VTK_LINE);
  _nbNodes = 3;
}
SMDS_DownTriangle::~SMDS_DownTriangle ( ) [protected]

Definition at line 893 of file SMDS_Downward.cxx.

{
}

Member Function Documentation

int SMDS_Downward::addCell ( int  vtkId = -1) [protected, inherited]

Give or create an entry for downward connectivity structure relative to a cell.

If the entry already exists, just return its id, otherwise, create it. The internal storage memory is allocated if needed. The SMDS_UnstructuredGrid._cellIdToDownId vector is completed for vtkUnstructuredGrid cells.

Parameters:
vtkIdfor a vtkUnstructuredGrid cell or -1 (default) for a created downward cell.
Returns:
the rank in downward[vtkType] structure.

Definition at line 112 of file SMDS_Downward.cxx.

References SMDS_Downward._grid, SMDS_Downward._maxId, SMDS_Downward._vtkCellIds, SMDS_Downward.allocate(), SMDS_UnstructuredGrid.CellIdToDownId(), SMDS_Downward.initCell(), and SMDS_UnstructuredGrid.setCellIdToDownId().

{
  int localId = -1;
  if (vtkId >= 0)
    localId = _grid->CellIdToDownId(vtkId);
  if (localId >= 0)
    return localId;

  localId = this->_maxId;
  this->_maxId++;
  this->allocate(_maxId);
  if (vtkId >= 0)
    {
      this->_vtkCellIds[localId] = vtkId;
      _grid->setCellIdToDownId(vtkId, localId);
    }
  this->initCell(localId);
  return localId;
}
void SMDS_DownTriangle::addDownCell ( int  cellId,
int  lowCellId,
unsigned char  aType 
) [protected, virtual]

Id's are downward connectivity id's.

Reimplemented from SMDS_Downward.

Definition at line 918 of file SMDS_Downward.cxx.

References SMDS_Downward._cellIds, SMDS_Downward._nbDownCells, and ex21_lamp.faces.

{
  //ASSERT((cellId >=0)&& (cellId < _maxId));
  //ASSERT(aType == VTK_LINE);
  int *faces = &_cellIds[_nbDownCells * cellId];
  for (int i = 0; i < _nbDownCells; i++)
    {
      if (faces[i] < 0)
        {
          faces[i] = lowCellId;
          return;
        }
      if (faces[i] == lowCellId)
        return;
    }
  ASSERT(0);
}
void SMDS_Down2D::addUpCell ( int  cellId,
int  upCellId,
unsigned char  aType 
) [protected, virtual, inherited]

Id's are downward connectivity id's.

add a downward entity of dimension n+1 to a given cell.

Actual implementation is done in derived methods.

Parameters:
cellIdindex of the children cell (dimension n) in the downward structure relative to a vtk cell type.
upCellIdindex of the parent cell to add (dimension n+1)
aTypevtk cell type of the cell to add (needed to find the SMDS_Downward structure containing the cell to add).

Reimplemented from SMDS_Downward.

Definition at line 708 of file SMDS_Downward.cxx.

References SMDS_Down2D._upCellIds, and SMDS_Down2D._upCellTypes.

{
  //ASSERT((cellId >=0)&& (cellId < _maxId));
  int *vols = &_upCellIds[2 * cellId];
  unsigned char *types = &_upCellTypes[2 * cellId];
  for (int i = 0; i < 2; i++)
    {
      if (vols[i] < 0)
        {
          vols[i] = upCellId; // use non affected volume
          types[i] = aType;
          return;
        }
      if ((vols[i] == upCellId) && (types[i] == aType)) // already done
        return;
    }
  ASSERT(0);
}
void SMDS_Down2D::allocate ( int  nbElems) [protected, virtual, inherited]

Resize the downward connectivity storage vector if needed.

Parameters:
nbElemstotal number of elements of the same type required

Implements SMDS_Downward.

Definition at line 687 of file SMDS_Downward.cxx.

References SMDS_Downward._cellIds, SMDS_Downward._nbDownCells, SMDS_Down2D._nbNodes, SMDS_Down2D._tempNodes, SMDS_Down2D._upCellIds, SMDS_Down2D._upCellTypes, SMDS_Downward._vtkCellIds, and SMDS_Mesh.chunkSize.

{
  if (nbElems >= _vtkCellIds.size())
    {
      _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
      _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
      _upCellIds.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1);
      _upCellTypes.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1);
      _tempNodes.resize(_nbNodes * (nbElems + SMDS_Mesh::chunkSize), -1);
    }
}
void SMDS_Down2D::compactStorage ( ) [protected, virtual, inherited]
void SMDS_DownTriangle::computeEdgesWithNodes ( int  cellId,
ListElemByNodesType edgesWithNodes 
) [protected, virtual]

Implements SMDS_Down2D.

Definition at line 897 of file SMDS_Downward.cxx.

References SMDS_Down2D._nbNodes, SMDS_Down2D._tempNodes, ListElemByNodesType.elems, ListElemByNodesType.nbElems, ElemByNodesType.nbNodes, ElemByNodesType.nodeIds, SMESH_AdvancedEditor.nodes, and ElemByNodesType.vtkType.

{
  int *nodes = &_tempNodes[_nbNodes * cellId];
  edgesWithNodes.nbElems = 3;

  edgesWithNodes.elems[0].nodeIds[0] = nodes[0];
  edgesWithNodes.elems[0].nodeIds[1] = nodes[1];
  edgesWithNodes.elems[0].nbNodes = 2;
  edgesWithNodes.elems[0].vtkType = VTK_LINE;

  edgesWithNodes.elems[1].nodeIds[0] = nodes[1];
  edgesWithNodes.elems[1].nodeIds[1] = nodes[2];
  edgesWithNodes.elems[1].nbNodes = 2;
  edgesWithNodes.elems[1].vtkType = VTK_LINE;

  edgesWithNodes.elems[2].nodeIds[0] = nodes[2];
  edgesWithNodes.elems[2].nodeIds[1] = nodes[0];
  edgesWithNodes.elems[2].nbNodes = 2;
  edgesWithNodes.elems[2].vtkType = VTK_LINE;
}
int SMDS_Down2D::computeVolumeIds ( int  cellId,
int ids 
) [protected, inherited]

Find in vtkUnstructuredGrid the volumes containing a face already stored in vtkUnstructuredGrid.

Search the volumes containing a face, to store the info in SMDS_Down2D for later uses with SMDS_Down2D.getUpCells and SMDS_Down2D.getUpTypes. A face belongs to 0, 1 or 2 volumes, identified by their id in vtkUnstructuredGrid.

Parameters:
cellIdthe face cell id in vkUnstructuredGrid
idsa couple of vtkId, initialized at -1 (no parent volume)
Returns:
number of volumes (0, 1 or 2)

Definition at line 542 of file SMDS_Downward.cxx.

References SMDS_Downward._grid, SMDS_Down2D.computeVolumeIdsFromNodesFace(), and SMESH_AdvancedEditor.nodes.

Referenced by SMDS_UnstructuredGrid.BuildDownwardConnectivity().

{
  // --- find point id's of the face

  vtkIdType npts = 0;
  vtkIdType *pts; // will refer to the point id's of the face
  _grid->GetCellPoints(cellId, npts, pts);
  vector<int> nodes;
  for (int i = 0; i < npts; i++)
    nodes.push_back(pts[i]);
  int nvol = this->computeVolumeIdsFromNodesFace(&nodes[0], npts, ids);
  return nvol;
}
int SMDS_Down2D::computeVolumeIds ( ElemByNodesType faceByNodes,
int ids 
) [protected, inherited]

Find in vtkUnstructuredGrid the volumes containing a face described by it's nodes Search the volumes containing a face, to store the info in SMDS_Down2D for later uses with SMDS_Down2D.getUpCells and SMDS_Down2D.getUpTypes.

A face belongs to 0, 1 or 2 volumes, identified by their id in vtkUnstructuredGrid.

Parameters:
faceByNodes
idsa couple of vtkId, initialized at -1 (no parent volume)
Returns:
number of volumes (0, 1 or 2)

Definition at line 564 of file SMDS_Downward.cxx.

References SMDS_Down2D.computeVolumeIdsFromNodesFace(), ElemByNodesType.nbNodes, and ElemByNodesType.nodeIds.

{
  int nvol = this->computeVolumeIdsFromNodesFace(&faceByNodes.nodeIds[0], faceByNodes.nbNodes, ids);
  return nvol;
}
int SMDS_Down2D::computeVolumeIdsFromNodesFace ( int pts,
int  npts,
int ids 
) [protected, inherited]

Find in vtkUnstructuredGrid the volumes containing a face described by it's nodes Search the volumes containing a face, to store the info in SMDS_Down2D for later uses with SMDS_Down2D.getUpCells and SMDS_Down2D.getUpTypes.

A face belongs to 0, 1 or 2 volumes, identified by their id in vtkUnstructuredGrid.

Parameters:
ptsarray of vtk node id's
nptsnumber of nodes
ids
Returns:
number of volumes (0, 1 or 2)

Definition at line 579 of file SMDS_Downward.cxx.

References SMDS_Downward._grid, SMDS_Downward.getCellDimension(), SMDS_UnstructuredGrid.GetLinks(), and SMESH_mechanic_editor.point.

Referenced by SMDS_UnstructuredGrid.BuildDownwardConnectivity(), and SMDS_Down2D.computeVolumeIds().

{

  // --- find all the cells the points belong to, and how many of the points belong to a given cell

  int cellIds[1000];
  int cellCnt[1000];
  int cnt = 0;
  for (int i = 0; i < npts; i++)
    {
      vtkIdType point = pts[i];
      int numCells = _grid->GetLinks()->GetNcells(point);
      //MESSAGE("cells pour " << i << " " << numCells);
      vtkIdType *cells = _grid->GetLinks()->GetCells(point);
      for (int j = 0; j < numCells; j++)
        {
          int vtkCellId = cells[j];
          bool found = false;
          for (int k = 0; k < cnt; k++)
            {
              if (cellIds[k] == vtkCellId)
                {
                  cellCnt[k] += 1;
                  found = true;
                  break;
                }
            }
          if (!found)
            {
              cellIds[cnt] = vtkCellId;
              cellCnt[cnt] = 1;
              // TODO ASSERT(cnt<1000);
              cnt++;
            }
        }
    }

  // --- find the volume cells: they contains all the points and are of type volume

  int nvol = 0;
  for (int i = 0; i < cnt; i++)
    {
      //MESSAGE("cell " << cellIds[i] << " points " << cellCnt[i]);
      if (cellCnt[i] == npts)
        {
          int vtkElemId = cellIds[i];
          int vtkType = _grid->GetCellType(vtkElemId);
          if (SMDS_Downward::getCellDimension(vtkType) == 3)
            {
              ids[nvol] = vtkElemId; // store the volume id in given vector
              nvol++;
            }
        }
      if (nvol == 2)
        break;
    }

  return nvol;
}
int SMDS_Down2D::FindEdgeByNodes ( int  cellId,
ElemByNodesType edgeByNodes 
) [protected, inherited]

Definition at line 734 of file SMDS_Downward.cxx.

References SMDS_Downward._cellIds, SMDS_Downward._cellTypes, SMDS_Downward._grid, SMDS_Downward._nbDownCells, SMDS_UnstructuredGrid.getDownArray(), SMDS_Downward.getNodeSet(), ElemByNodesType.nodeIds, SMESH_mechanic_editor.point, and ElemByNodesType.vtkType.

Referenced by SMDS_UnstructuredGrid.BuildDownwardConnectivity().

{
  int *edges = &_cellIds[_nbDownCells * cellId];
  for (int i = 0; i < _nbDownCells; i++)
    {
      if ((edges[i] >= 0) && (edgeByNodes.vtkType == _cellTypes[i]))
        {
          int nodeSet[3];
          int npts = this->_grid->getDownArray(edgeByNodes.vtkType)->getNodeSet(edges[i], nodeSet);
          bool found = false;
          for (int j = 0; j < npts; j++)
            {
              int point = edgeByNodes.nodeIds[j];
              found = false;
              for (int k = 0; k < npts; k++)
                {
                  if (nodeSet[k] == point)
                    {
                      found = true;
                      break;
                    }
                }
              if (!found)
                break;
            }
          if (found)
            return edges[i];
        }
    }
  return -1;
}
int SMDS_Downward::getCellDimension ( unsigned char  cellType) [static, inherited]

get the dimension of a cell (1,2,3 for 1D, 2D 3D) given the vtk cell type

Parameters:
cellTypevtk cell type
See also:
vtkCellType.h
Returns:
1,2 or 3

Definition at line 44 of file SMDS_Downward.cxx.

References VTK_MAXTYPE.

Referenced by SMDS_UnstructuredGrid.BuildDownwardConnectivity(), SMDS_Down1D.computeFaces(), SMDS_Down2D.computeVolumeIdsFromNodesFace(), SMDS_Down1D.computeVtkCells(), SMDS_UnstructuredGrid.GetNeighbors(), SMDS_UnstructuredGrid.getOrderedNodesOfFace(), and SMDS_UnstructuredGrid.GetParentVolumes().

{
  if (_cellDimension.empty())
    {
      _cellDimension.resize(VTK_MAXTYPE + 1, 0);
      _cellDimension[VTK_LINE] = 1;
      _cellDimension[VTK_QUADRATIC_EDGE] = 1;
      _cellDimension[VTK_TRIANGLE] = 2;
      _cellDimension[VTK_QUADRATIC_TRIANGLE] = 2;
      _cellDimension[VTK_QUAD] = 2;
      _cellDimension[VTK_QUADRATIC_QUAD] = 2;
      _cellDimension[VTK_TETRA] = 3;
      _cellDimension[VTK_QUADRATIC_TETRA] = 3;
      _cellDimension[VTK_HEXAHEDRON] = 3;
      _cellDimension[VTK_QUADRATIC_HEXAHEDRON] = 3;
      _cellDimension[VTK_WEDGE] = 3;
      _cellDimension[VTK_QUADRATIC_WEDGE] = 3;
      _cellDimension[VTK_PYRAMID] = 3;
      _cellDimension[VTK_QUADRATIC_PYRAMID] = 3;
    }
  return _cellDimension[cellType];
}
const int * SMDS_Downward::getDownCells ( int  cellId) [virtual, inherited]

get a pointer on the downward entities id's associated to a cell.

See also:
SMDS_Downward.getNumberOfDownCells for the number of downward entities.
SMDS_Downward.getDownTypes for the vtk cell types associated to the downward entities.
Parameters:
cellIdindex of the cell in the downward structure relative to a given vtk cell type.
Returns:
table of downward entities id's.

Definition at line 156 of file SMDS_Downward.cxx.

References SMDS_Downward._cellIds, and SMDS_Downward._nbDownCells.

Referenced by SMDS_Down1D.computeFaces(), and SMESH_MeshEditor.DoubleNodesOnGroupBoundaries().

{
  //ASSERT((cellId >=0) && (cellId < _maxId));
  return &_cellIds[_nbDownCells * cellId];
}
const unsigned char * SMDS_Downward::getDownTypes ( int  cellId) [virtual, inherited]

get a list of vtk cell types associated to downward entities of a given cell, in the same order than the downward entities id's list (

See also:
SMDS_Downward.getDownCells).
Parameters:
cellIdindex of the cell in the downward structure relative to a vtk cell type.
Returns:
table of downward entities types.

Definition at line 168 of file SMDS_Downward.cxx.

References SMDS_Downward._cellTypes.

Referenced by SMDS_Down1D.computeFaces(), and SMESH_MeshEditor.DoubleNodesOnGroupBoundaries().

{
  return &_cellTypes[0];
}
int SMDS_Downward.getMaxId ( ) [inherited]

Definition at line 85 of file SMDS_Downward.hxx.

References SMDS_Downward._maxId.

Referenced by SMDS_UnstructuredGrid.BuildDownwardConnectivity().

  {
    return _maxId;
  }
void SMDS_Down2D::getNodeIds ( int  cellId,
std::set< int > &  nodeSet 
) [virtual, inherited]

Implements SMDS_Downward.

Definition at line 524 of file SMDS_Downward.cxx.

References SMDS_Downward._cellIds, SMDS_Downward._cellTypes, SMDS_Downward._grid, SMDS_Downward._nbDownCells, SMDS_UnstructuredGrid.getDownArray(), and SMDS_Downward.getNodeIds().

{
  for (int i = 0; i < _nbDownCells; i++)
    {
      int downCellId = _cellIds[_nbDownCells * cellId + i];
      unsigned char cellType = _cellTypes[i];
      this->_grid->getDownArray(cellType)->getNodeIds(downCellId, nodeSet);
    }
}
virtual int SMDS_Downward.getNodes ( int  cellId,
int nodevec 
) [virtual, inherited]

Reimplemented in SMDS_Down1D.

Definition at line 80 of file SMDS_Downward.hxx.

Referenced by SMESH_MeshEditor.DoubleNodesOnGroupBoundaries().

{return 0; }
int SMDS_Down2D::getNodeSet ( int  cellId,
int nodeSet 
) [protected, virtual, inherited]

Reimplemented from SMDS_Downward.

Definition at line 727 of file SMDS_Downward.cxx.

References SMDS_Down2D._nbNodes, and SMDS_Down2D._tempNodes.

{
  for (int i = 0; i < _nbNodes; i++)
    nodeSet[i] = _tempNodes[_nbNodes * cellId + i];
  return _nbNodes;
}
int SMDS_Downward::getNumberOfDownCells ( int  cellId) [virtual, inherited]

Get the number of downward entities associated to a cell (always the same for a given vtk type of cell)

Parameters:
cellIdnot used here.
Returns:

Definition at line 145 of file SMDS_Downward.cxx.

References SMDS_Downward._nbDownCells.

Referenced by SMDS_Down1D.computeFaces(), and SMESH_MeshEditor.DoubleNodesOnGroupBoundaries().

{
  return _nbDownCells;
}
int SMDS_Down2D::getNumberOfUpCells ( int  cellId) [virtual, inherited]

Implements SMDS_Downward.

Definition at line 502 of file SMDS_Downward.cxx.

References SMDS_Down2D._upCellIds.

{
  int nbup = 0;
  if (_upCellIds[2 * cellId] >= 0)
    nbup++;
  if (_upCellIds[2 * cellId + 1] >= 0)
    nbup++;
  return nbup;
}
const int * SMDS_Down2D::getUpCells ( int  cellId) [virtual, inherited]

Implements SMDS_Downward.

Definition at line 512 of file SMDS_Downward.cxx.

References SMDS_Down2D._upCellIds.

{
  //ASSERT((cellId >=0) && (cellId < _maxId));
  return &_upCellIds[2 * cellId];
}
const unsigned char * SMDS_Down2D::getUpTypes ( int  cellId) [virtual, inherited]

Implements SMDS_Downward.

Definition at line 518 of file SMDS_Downward.cxx.

References SMDS_Down2D._upCellTypes.

{
  //ASSERT((cellId >=0) && (cellId < _maxId));
  return &_upCellTypes[2 * cellId];
}
int SMDS_Downward.getVtkCellId ( int  cellId) [inherited]

Definition at line 81 of file SMDS_Downward.hxx.

References SMDS_Downward._vtkCellIds.

  {
    return _vtkCellIds[cellId];
  }
void SMDS_Downward::initCell ( int  cellId) [protected, virtual, inherited]

generic method do nothing.

see derived methods

Parameters:
cellId

Reimplemented in SMDS_Down1D.

Definition at line 136 of file SMDS_Downward.cxx.

Referenced by SMDS_Downward.addCell().

{
}
bool SMDS_Down2D::isInFace ( int  cellId,
int pts,
int  npts 
) [protected, inherited]

Find if all the nodes belongs to the face.

Parameters:
cellIdthe face cell Id
nodeSetset of node id's to be found in the face list of nodes
Returns:

Definition at line 664 of file SMDS_Downward.cxx.

References SMDS_Down2D._nbNodes, SMDS_Down2D._tempNodes, SMESH_AdvancedEditor.nodes, and SMESH_mechanic_editor.point.

Referenced by SMDS_Down1D.computeFaces().

{
  int nbFound = 0;
  int *nodes = &_tempNodes[_nbNodes * cellId];
  for (int j = 0; j < npts; j++)
    {
      int point = pts[j];
      for (int i = 0; i < _nbNodes; i++)
        {
          if (nodes[i] == point)
            {
              nbFound++;
              break;
            }
        }
    }
  return (nbFound == npts);
}
void SMDS_Down2D::setTempNodes ( int  cellId,
ElemByNodesType faceByNodes 
) [protected, inherited]

Definition at line 652 of file SMDS_Downward.cxx.

References SMDS_Down2D._nbNodes, SMDS_Down2D._tempNodes, ElemByNodesType.nbNodes, and ElemByNodesType.nodeIds.

{
  for (int i = 0; i < faceByNodes.nbNodes; i++)
    _tempNodes[_nbNodes * cellId + i] = faceByNodes.nodeIds[i];
}
void SMDS_Down2D::setTempNodes ( int  cellId,
int  vtkId 
) [protected, inherited]

Definition at line 639 of file SMDS_Downward.cxx.

References SMDS_Downward._grid, SMDS_Down2D._nbNodes, and SMDS_Down2D._tempNodes.

Referenced by SMDS_UnstructuredGrid.BuildDownwardConnectivity().

{
  vtkIdType npts = 0;
  vtkIdType *pts; // will refer to the point id's of the face
  _grid->GetCellPoints(vtkId, npts, pts);
  // MESSAGE(vtkId << " " << npts << "  " << _nbNodes);
  //ASSERT(npts == _nbNodes);
  for (int i = 0; i < npts; i++)
    {
      _tempNodes[_nbNodes * cellId + i] = pts[i];
    }
}

Friends And Related Function Documentation

friend class SMDS_UnstructuredGrid [friend]

Reimplemented from SMDS_Down2D.

Definition at line 211 of file SMDS_Downward.hxx.


Field Documentation

vector< int > SMDS_Downward::_cellDimension [static, protected, inherited]

conversion table: type --> dimension

Definition at line 108 of file SMDS_Downward.hxx.

Referenced by SMDS_Downward.SMDS_Downward().

std::vector<int> SMDS_Downward._cellIds [protected, inherited]
std::vector<unsigned char> SMDS_Downward._cellTypes [protected, inherited]
SMDS_UnstructuredGrid* SMDS_Downward._grid [protected, inherited]
int SMDS_Downward._maxId [protected, inherited]
int SMDS_Downward._nbDownCells [protected, inherited]
int SMDS_Down2D._nbNodes [protected, inherited]
std::vector<int> SMDS_Down2D._tempNodes [protected, inherited]
std::vector<int> SMDS_Down2D._upCellIds [protected, inherited]
std::vector<unsigned char> SMDS_Down2D._upCellTypes [protected, inherited]
std::vector<int> SMDS_Downward._vtkCellIds [protected, inherited]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS