Back to index

salome-med  6.5.0
Public Member Functions | Public Attributes | Private Member Functions
SauvUtilities::Cell Struct Reference

#include <SauvMedConvertor.hxx>

Collaboration diagram for SauvUtilities::Cell:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Cell (size_t nnNodes=0)
 Cell (const Cell &ma)
 Avoid coping sortedNodeIDs.
void init () const
 ~Cell ()
const TIDgetSortedNodes () const
 creates if needed and return _sortedNodeIDs
bool operator< (const Cell &ma) const
 Compare sorted ids of cell nodes.
Link link (int i) const
 Rerturn the i-th link of face.

Public Attributes

std::vector< Node * > _nodes
bool _reverse
TID_sortedNodeIDs
TID _number

Private Member Functions

Celloperator= (const Cell &ma)

Detailed Description

Definition at line 69 of file SauvMedConvertor.hxx.


Constructor & Destructor Documentation

SauvUtilities::Cell::Cell ( size_t  nnNodes = 0) [inline]

Definition at line 76 of file SauvMedConvertor.hxx.

: _nodes(nnNodes),_reverse(false),_sortedNodeIDs(0),_number(0) {}
Cell::Cell ( const Cell ma)

Avoid coping sortedNodeIDs.

Definition at line 297 of file SauvMedConvertor.cxx.

  : _nodes(ma._nodes), _reverse(ma._reverse), _sortedNodeIDs(0), _number(ma._number)
{
  if ( ma._sortedNodeIDs )
    {
      _sortedNodeIDs = new int[ _nodes.size() ];
      std::copy( ma._sortedNodeIDs, ma._sortedNodeIDs + _nodes.size(), _sortedNodeIDs );
    }
}

Definition at line 79 of file SauvMedConvertor.hxx.

{ init(); }

Here is the call graph for this function:


Member Function Documentation

const TID * Cell::getSortedNodes ( ) const

creates if needed and return _sortedNodeIDs

Definition at line 328 of file SauvMedConvertor.cxx.

{
  if ( !_sortedNodeIDs )
  {
    size_t l=_nodes.size();
    _sortedNodeIDs = new int[ l ];

    for (size_t i=0; i!=l; ++i)
      _sortedNodeIDs[i]=_nodes[i]->_number;
    std::sort( _sortedNodeIDs, _sortedNodeIDs + l );
  }
  return _sortedNodeIDs;
}

Here is the caller graph for this function:

void SauvUtilities::Cell::init ( ) const [inline]

Definition at line 78 of file SauvMedConvertor.hxx.

{ if ( _sortedNodeIDs ) delete [] _sortedNodeIDs; _sortedNodeIDs = 0; }

Here is the caller graph for this function:

SauvUtilities::Link Cell::link ( int  i) const

Rerturn the i-th link of face.

Definition at line 313 of file SauvMedConvertor.cxx.

{
  int i2 = ( i + 1 ) % _nodes.size();
  if ( _reverse )
    return make_pair( _nodes[i2]->_number, _nodes[i]->_number );
  else
    return make_pair( _nodes[i]->_number, _nodes[i2]->_number );
}

Here is the caller graph for this function:

bool Cell::operator< ( const Cell ma) const

Compare sorted ids of cell nodes.

Definition at line 348 of file SauvMedConvertor.cxx.

{
  if ( _nodes.size() == 1 )
    return _nodes[0] < ma._nodes[0];

  const int* v1 = getSortedNodes();
  const int* v2 = ma.getSortedNodes();
  for ( const int* vEnd = v1 + _nodes.size(); v1 < vEnd; ++v1, ++v2 )
    if(*v1 != *v2)
      return *v1 < *v2;
  return false;
}

Here is the call graph for this function:

Cell& SauvUtilities::Cell::operator= ( const Cell ma) [private]

Member Data Documentation

Definition at line 71 of file SauvMedConvertor.hxx.

Definition at line 74 of file SauvMedConvertor.hxx.

Definition at line 72 of file SauvMedConvertor.hxx.

Definition at line 73 of file SauvMedConvertor.hxx.


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