vtkBridgePointIteratorOnCell.h 2.66 KB
Newer Older
Francois Bertel's avatar
Francois Bertel committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkBridgePointIteratorOnCell.h

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
15 16 17 18 19 20 21 22
/**
 * @class   vtkBridgePointIteratorOnCell
 * @brief   Implementation of vtkGenericPointIterator.
 *
 * It iterates over the corner points of a cell.
 * @sa
 * vtkGenericPointIterator, vtkBridgeDataSet
*/
Francois Bertel's avatar
Francois Bertel committed
23

24 25
#ifndef vtkBridgePointIteratorOnCell_h
#define vtkBridgePointIteratorOnCell_h
Francois Bertel's avatar
Francois Bertel committed
26

David E. DeMarle's avatar
David E. DeMarle committed
27
#include "vtkBridgeExport.h" //for module export macro
Francois Bertel's avatar
Francois Bertel committed
28 29 30 31 32 33
#include "vtkGenericPointIterator.h"

class vtkBridgeDataSet;
class vtkBridgeCell;
class vtkIdList;

34
class VTKTESTINGGENERICBRIDGE_EXPORT vtkBridgePointIteratorOnCell : public vtkGenericPointIterator
Francois Bertel's avatar
Francois Bertel committed
35 36 37
{
public:
  static vtkBridgePointIteratorOnCell *New();
38
  vtkTypeMacro(vtkBridgePointIteratorOnCell,vtkGenericPointIterator);
39
  void PrintSelf(ostream& os, vtkIndent indent) override;
40

41 42 43
  /**
   * Move iterator to first position if any (loop initialization).
   */
44
  void Begin() override;
Francois Bertel's avatar
Francois Bertel committed
45

46 47 48
  /**
   * Is there no point at iterator position? (exit condition).
   */
49
  vtkTypeBool IsAtEnd() override;
Francois Bertel's avatar
Francois Bertel committed
50

51 52 53 54
  /**
   * Move iterator to next position. (loop progression).
   * \pre not_off: !IsAtEnd()
   */
55
  void Next() override;
56

57 58 59 60 61
  /**
   * Point at iterator position.
   * \pre not_off: !IsAtEnd()
   * \post result_exists: result!=0
   */
62
  double *GetPosition() override;
Francois Bertel's avatar
Francois Bertel committed
63

64 65 66 67 68
  /**
   * Point at iterator position.
   * \pre not_off: !IsAtEnd()
   * \pre x_exists: x!=0
   */
69
  void GetPosition(double x[3]) override;
70

71 72 73 74
  /**
   * Unique identifier for the point, could be non-contiguous
   * \pre not_off: !IsAtEnd()
   */
75
  vtkIdType GetId() override;
76

77 78 79 80
  /**
   * The iterator will iterate over the point of a cell
   * \pre cell_exists: cell!=0
   */
Francois Bertel's avatar
Francois Bertel committed
81
  void InitWithCell(vtkBridgeCell *cell);
82

Francois Bertel's avatar
Francois Bertel committed
83
protected:
84 85 86
  /**
   * Default constructor.
   */
Francois Bertel's avatar
Francois Bertel committed
87
  vtkBridgePointIteratorOnCell();
88

89 90 91
  /**
   * Destructor.
   */
92
  ~vtkBridgePointIteratorOnCell() override;
93

luz.paz's avatar
luz.paz committed
94
  vtkBridgeDataSet *DataSet; // the structure on which the object iterates.
Francois Bertel's avatar
Francois Bertel committed
95
  vtkIdType Cursor; // current position
96

Francois Bertel's avatar
Francois Bertel committed
97
  vtkIdList *PtIds; // list of points of the cell
98

Francois Bertel's avatar
Francois Bertel committed
99
private:
100 101
  vtkBridgePointIteratorOnCell(const vtkBridgePointIteratorOnCell&) = delete;
  void operator=(const vtkBridgePointIteratorOnCell&) = delete;
Francois Bertel's avatar
Francois Bertel committed
102 103 104
};

#endif