VTK  9.0.3
vtkPolyData.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPolyData.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
62 #ifndef vtkPolyData_h
63 #define vtkPolyData_h
64 
65 #include "vtkCommonDataModelModule.h" // For export macro
66 #include "vtkPointSet.h"
67 
68 #include "vtkCellArray.h" // Needed for inline methods
69 #include "vtkCellLinks.h" // Needed for inline methods
70 #include "vtkPolyDataInternals.h" // Needed for inline methods
71 
72 class vtkVertex;
73 class vtkPolyVertex;
74 class vtkLine;
75 class vtkPolyLine;
76 class vtkTriangle;
77 class vtkQuad;
78 class vtkPolygon;
79 class vtkTriangleStrip;
80 class vtkEmptyCell;
81 struct vtkPolyDataDummyContainter;
83 
84 class VTKCOMMONDATAMODEL_EXPORT vtkPolyData : public vtkPointSet
85 {
86 public:
87  static vtkPolyData* New();
88 
89  vtkTypeMacro(vtkPolyData, vtkPointSet);
90  void PrintSelf(ostream& os, vtkIndent indent) override;
91 
95  int GetDataObjectType() override { return VTK_POLY_DATA; }
96 
100  void CopyStructure(vtkDataSet* ds) override;
101 
103 
106  vtkIdType GetNumberOfCells() override;
107  using vtkDataSet::GetCell;
108  vtkCell* GetCell(vtkIdType cellId) override;
109  void GetCell(vtkIdType cellId, vtkGenericCell* cell) override;
110  int GetCellType(vtkIdType cellId) override;
111  void GetCellBounds(vtkIdType cellId, double bounds[6]) override;
112  void GetCellNeighbors(vtkIdType cellId, vtkIdList* ptIds, vtkIdList* cellIds) override;
114 
122  void CopyCells(vtkPolyData* pd, vtkIdList* idList, vtkIncrementalPointLocator* locator = nullptr);
123 
127  void GetCellPoints(vtkIdType cellId, vtkIdList* ptIds) override;
128 
133  void GetPointCells(vtkIdType ptId, vtkIdList* cellIds) override;
134 
140  void ComputeBounds() override;
141 
148  void Squeeze() override;
149 
153  int GetMaxCellSize() override;
154 
159 
165 
170 
176 
181 
187 
192 
199 
201 
204  vtkIdType GetNumberOfVerts() { return (this->Verts ? this->Verts->GetNumberOfCells() : 0); }
205  vtkIdType GetNumberOfLines() { return (this->Lines ? this->Lines->GetNumberOfCells() : 0); }
206  vtkIdType GetNumberOfPolys() { return (this->Polys ? this->Polys->GetNumberOfCells() : 0); }
207  vtkIdType GetNumberOfStrips() { return (this->Strips ? this->Strips->GetNumberOfCells() : 0); }
209 
219  bool AllocateEstimate(vtkIdType numCells, vtkIdType maxCellSize);
220 
230  bool AllocateEstimate(vtkIdType numVerts, vtkIdType maxVertSize, vtkIdType numLines,
231  vtkIdType maxLineSize, vtkIdType numPolys, vtkIdType maxPolySize, vtkIdType numStrips,
232  vtkIdType maxStripSize);
233 
243  bool AllocateExact(vtkIdType numCells, vtkIdType connectivitySize);
244 
255  bool AllocateExact(vtkIdType numVerts, vtkIdType vertConnSize, vtkIdType numLines,
256  vtkIdType lineConnSize, vtkIdType numPolys, vtkIdType polyConnSize, vtkIdType numStrips,
257  vtkIdType stripConnSize);
258 
268 
278  bool AllocateProportional(vtkPolyData* pd, double ratio);
279 
286  void Allocate(vtkIdType numCells = 1000, int vtkNotUsed(extSize) = 1000)
287  {
288  this->AllocateExact(numCells, numCells);
289  }
290 
301  void Allocate(vtkPolyData* inPolyData, vtkIdType numCells = 1000, int vtkNotUsed(extSize) = 1000)
302  {
303  this->AllocateProportional(
304  inPolyData, static_cast<double>(numCells) / inPolyData->GetNumberOfCells());
305  }
306 
314  vtkIdType InsertNextCell(int type, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
315 
324 
329  void Reset();
330 
338  void BuildCells();
339 
343  bool NeedToBuildCells() { return this->Cells == nullptr; }
344 
351  void BuildLinks(int initialSize = 0);
352 
358  void DeleteCells();
359 
363  void DeleteLinks();
364 
366 
370  void GetPointCells(vtkIdType ptId, vtkIdType& ncells, vtkIdType*& cells)
371  VTK_SIZEHINT(cells, ncells);
372 #ifndef VTK_LEGACY_REMOVE
373  VTK_LEGACY(void GetPointCells(vtkIdType ptId, unsigned short& ncells, vtkIdType*& cells))
374  VTK_SIZEHINT(cells, ncells);
375 #endif
377 
384 
394  unsigned char GetCellPoints(vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts)
395  VTK_SIZEHINT(pts, npts);
396 
401  int IsTriangle(int v1, int v2, int v3);
402 
411 
416  int IsPointUsedByCell(vtkIdType ptId, vtkIdType cellId);
417 
426  void ReplaceCell(vtkIdType cellId, vtkIdList* ids);
427  void ReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
434  void ReplaceCellPoint(vtkIdType cellId, vtkIdType oldPtId, vtkIdType newPtId);
435 
440  void ReverseCell(vtkIdType cellId);
441 
443 
447  void DeletePoint(vtkIdType ptId);
448  void DeleteCell(vtkIdType cellId);
450 
460 
462 
471  vtkIdType InsertNextLinkedPoint(double x[3], int numLinks);
473 
480  vtkIdType InsertNextLinkedCell(int type, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
481 
491  void ReplaceLinkedCell(vtkIdType cellId, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
492 
500  void RemoveCellReference(vtkIdType cellId);
501 
509  void AddCellReference(vtkIdType cellId);
510 
519 
528 
534  void ResizeCellList(vtkIdType ptId, int size);
535 
539  void Initialize() override;
540 
542 
545  virtual int GetPiece();
546  virtual int GetNumberOfPieces();
548 
552  virtual int GetGhostLevel();
553 
562  unsigned long GetActualMemorySize() override;
563 
565 
568  void ShallowCopy(vtkDataObject* src) override;
569  void DeepCopy(vtkDataObject* src) override;
571 
578 
580 
584  static vtkPolyData* GetData(vtkInformationVector* v, int i = 0);
586 
605  enum
606  {
607  ERR_NO_SUCH_FIELD = -4,
608  ERR_INCORRECT_FIELD = -3,
609  ERR_NON_MANIFOLD_STAR = -2,
610  REGULAR_POINT = -1,
611  MINIMUM = 0,
612  SADDLE = 1,
613  MAXIMUM = 2
614  };
615 
617  int GetScalarFieldCriticalIndex(vtkIdType pointId, int fieldId);
618  int GetScalarFieldCriticalIndex(vtkIdType pointId, const char* fieldName);
619 
628 
632  vtkMTimeType GetMTime() override;
633 
643  unsigned char GetCell(vtkIdType cellId, const vtkIdType*& pts);
644 
645 protected:
647  ~vtkPolyData() override;
648 
651 
652  vtkCellArray* GetCellArrayInternal(TaggedCellId tag);
653 
654  // constant cell objects returned by GetCell called.
664 
665  // points inherited
666  // point data (i.e., scalars, vectors, normals, tcoords) inherited
671 
672  // supporting structures for more complex topological operations
673  // built only when necessary
676 
678 
679  // dummy static member below used as a trick to simplify traversal
680  static vtkPolyDataDummyContainter DummyContainer;
681 
682 private:
683  // Hide these from the user and the compiler.
684 
688  void GetCellNeighbors(vtkIdType cellId, vtkIdList& ptIds, vtkIdList& cellIds)
689  {
690  this->GetCellNeighbors(cellId, &ptIds, &cellIds);
691  }
692 
693  void Cleanup();
694 
695 private:
696  vtkPolyData(const vtkPolyData&) = delete;
697  void operator=(const vtkPolyData&) = delete;
698 };
699 
700 //------------------------------------------------------------------------------
701 inline void vtkPolyData::GetPointCells(vtkIdType ptId, vtkIdType& ncells, vtkIdType*& cells)
702 {
703  ncells = this->Links->GetNcells(ptId);
704  cells = this->Links->GetCells(ptId);
705 }
706 
707 #ifndef VTK_LEGACY_REMOVE
708 inline void vtkPolyData::GetPointCells(vtkIdType ptId, unsigned short& ncells, vtkIdType*& cells)
709 {
710  VTK_LEGACY_BODY(vtkPolyData::GetPointCells, "VTK 9.0");
711  ncells = static_cast<unsigned short>(this->Links->GetNcells(ptId));
712  cells = this->Links->GetCells(ptId);
713 }
714 #endif
715 
716 //------------------------------------------------------------------------------
718 {
719  return (this->GetNumberOfVerts() + this->GetNumberOfLines() + this->GetNumberOfPolys() +
720  this->GetNumberOfStrips());
721 }
722 
723 //------------------------------------------------------------------------------
725 {
726  if (!this->Cells)
727  {
728  this->BuildCells();
729  }
730  return static_cast<int>(this->Cells->GetTag(cellId).GetCellType());
731 }
732 
733 //------------------------------------------------------------------------------
734 inline int vtkPolyData::IsTriangle(int v1, int v2, int v3)
735 {
736  vtkIdType n1;
737  int i, j, tVerts[3];
738  vtkIdType* cells;
739  const vtkIdType* tVerts2;
740  vtkIdType n2;
741 
742  tVerts[0] = v1;
743  tVerts[1] = v2;
744  tVerts[2] = v3;
745 
746  for (i = 0; i < 3; i++)
747  {
748  this->GetPointCells(tVerts[i], n1, cells);
749  for (j = 0; j < n1; j++)
750  {
751  this->GetCellPoints(cells[j], n2, tVerts2);
752  if ((tVerts[0] == tVerts2[0] || tVerts[0] == tVerts2[1] || tVerts[0] == tVerts2[2]) &&
753  (tVerts[1] == tVerts2[0] || tVerts[1] == tVerts2[1] || tVerts[1] == tVerts2[2]) &&
754  (tVerts[2] == tVerts2[0] || tVerts[2] == tVerts2[1] || tVerts[2] == tVerts2[2]))
755  {
756  return 1;
757  }
758  }
759  }
760  return 0;
761 }
762 
763 //------------------------------------------------------------------------------
765 {
766  vtkIdType npts;
767  const vtkIdType* pts;
768 
769  this->GetCellPoints(cellId, npts, pts);
770  for (vtkIdType i = 0; i < npts; i++)
771  {
772  if (pts[i] == ptId)
773  {
774  return 1;
775  }
776  }
777 
778  return 0;
779 }
780 
781 //------------------------------------------------------------------------------
783 {
784  this->Links->DeletePoint(ptId);
785 }
786 
787 //------------------------------------------------------------------------------
789 {
790  this->Cells->GetTag(cellId).MarkDeleted();
791 }
792 
793 //------------------------------------------------------------------------------
795 {
796  const vtkIdType* pts;
797  vtkIdType npts;
798 
799  this->GetCellPoints(cellId, npts, pts);
800  for (vtkIdType i = 0; i < npts; i++)
801  {
802  this->Links->RemoveCellReference(cellId, pts[i]);
803  }
804 }
805 
806 //------------------------------------------------------------------------------
808 {
809  const vtkIdType* pts;
810  vtkIdType npts;
811 
812  this->GetCellPoints(cellId, npts, pts);
813  for (vtkIdType i = 0; i < npts; i++)
814  {
815  this->Links->AddCellReference(cellId, pts[i]);
816  }
817 }
818 
819 //------------------------------------------------------------------------------
821 {
822  this->Links->ResizeCellList(ptId, size);
823 }
824 
825 //------------------------------------------------------------------------------
827 {
828  switch (tag.GetTarget())
829  {
831  return this->Verts;
833  return this->Lines;
835  return this->Polys;
837  return this->Strips;
838  }
839  return nullptr; // unreachable
840 }
841 
842 //------------------------------------------------------------------------------
843 inline void vtkPolyData::ReplaceCellPoint(vtkIdType cellId, vtkIdType oldPtId, vtkIdType newPtId)
844 {
845  vtkNew<vtkIdList> ids;
846  this->GetCellPoints(cellId, ids);
847  for (vtkIdType i = 0; i < ids->GetNumberOfIds(); i++)
848  {
849  if (ids->GetId(i) == oldPtId)
850  {
851  ids->SetId(i, newPtId);
852  break;
853  }
854  }
855  this->ReplaceCell(cellId, static_cast<int>(ids->GetNumberOfIds()), ids->GetPointer(0));
856 }
857 
858 //------------------------------------------------------------------------------
859 inline unsigned char vtkPolyData::GetCellPoints(
860  vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts)
861 {
862  if (!this->Cells)
863  {
864  this->BuildCells();
865  }
866 
867  const TaggedCellId tag = this->Cells->GetTag(cellId);
868  if (tag.IsDeleted())
869  {
870  npts = 0;
871  pts = nullptr;
872  return VTK_EMPTY_CELL;
873  }
874 
875  vtkCellArray* cells = this->GetCellArrayInternal(tag);
876  cells->GetCellAtId(tag.GetCellId(), npts, pts);
877  return tag.GetCellType();
878 }
879 
880 #endif
object to represent cell connectivity
Definition: vtkCellArray.h:180
void GetCellAtId(vtkIdType cellId, vtkIdType &cellSize, vtkIdType const *&cellPoints)
Return the point ids for the cell at cellId.
abstract class to specify cell behavior
Definition: vtkCell.h:57
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:50
general representation of visualization data
Definition: vtkDataObject.h:60
abstract class to specify dataset behavior
Definition: vtkDataSet.h:57
virtual void GetPointCells(vtkIdType ptId, vtkIdList *cellIds)=0
Topological inquiry to get cells using point.
virtual vtkCell * GetCell(vtkIdType cellId)=0
Get cell with cellId such that: 0 <= cellId < NumberOfCells.
virtual vtkIdType GetNumberOfCells()=0
Determine the number of cells composing the dataset.
virtual int GetCellType(vtkIdType cellId)=0
Get type of cell with cellId such that: 0 <= cellId < NumberOfCells.
virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds)=0
Topological inquiry to get points defining cell.
virtual void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds, vtkIdList *cellIds)
Topological inquiry to get all cells using list of points exclusive of cell specified (e....
an empty cell used as a place-holder during processing
Definition: vtkEmptyCell.h:30
provides thread-safe access to cells
list of point or cell ids
Definition: vtkIdList.h:31
vtkIdType * GetPointer(const vtkIdType i)
Get a pointer to a particular data index.
Definition: vtkIdList.h:120
vtkIdType GetNumberOfIds()
Return the number of id's in the list.
Definition: vtkIdList.h:57
void SetId(const vtkIdType i, const vtkIdType vtkid)
Set the id at location i.
Definition: vtkIdList.h:89
vtkIdType GetId(const vtkIdType i)
Return the id at location i.
Definition: vtkIdList.h:62
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
cell represents a 1D line
Definition: vtkLine.h:30
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:63
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkIdType InsertNextCell(int type, int npts, const vtkIdType pts[])
Insert a cell of type VTK_VERTEX, VTK_POLY_VERTEX, VTK_LINE, VTK_POLY_LINE, VTK_TRIANGLE,...
vtkSmartPointer< vtkPolyVertex > PolyVertex
Definition: vtkPolyData.h:656
void GetCell(vtkIdType cellId, vtkGenericCell *cell) override
Get cell with cellId such that: 0 <= cellId < NumberOfCells.
void Squeeze() override
Recover extra allocated memory when creating data whose initial size is unknown.
static vtkPolyData * GetData(vtkInformationVector *v, int i=0)
bool NeedToBuildCells()
Check if BuildCells is needed.
Definition: vtkPolyData.h:343
bool AllocateEstimate(vtkIdType numCells, vtkIdType maxCellSize)
Preallocate memory for the internal cell arrays.
int GetScalarFieldCriticalIndex(vtkIdType pointId, const char *fieldName)
void SetPolys(vtkCellArray *p)
Set the cell array defining polygons.
vtkCellArray * GetCellArrayInternal(TaggedCellId tag)
Definition: vtkPolyData.h:826
vtkCellArray * GetStrips()
Get the cell array defining triangle strips.
void RemoveCellReference(vtkIdType cellId)
Remove all references to cell in cell structure.
Definition: vtkPolyData.h:794
vtkIdType GetNumberOfLines()
Definition: vtkPolyData.h:205
bool AllocateEstimate(vtkIdType numVerts, vtkIdType maxVertSize, vtkIdType numLines, vtkIdType maxLineSize, vtkIdType numPolys, vtkIdType maxPolySize, vtkIdType numStrips, vtkIdType maxStripSize)
Preallocate memory for the internal cell arrays.
void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) override
Copy a cells point ids into list provided.
int IsTriangle(int v1, int v2, int v3)
Given three vertices, determine whether it's a triangle.
Definition: vtkPolyData.h:734
void SetLines(vtkCellArray *l)
Set the cell array defining lines.
void SetVerts(vtkCellArray *v)
Set the cell array defining vertices.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSmartPointer< vtkCellLinks > Links
Definition: vtkPolyData.h:675
bool AllocateExact(vtkIdType numVerts, vtkIdType vertConnSize, vtkIdType numLines, vtkIdType lineConnSize, vtkIdType numPolys, vtkIdType polyConnSize, vtkIdType numStrips, vtkIdType stripConnSize)
Preallocate memory for the internal cell arrays.
void Initialize() override
Restore object to initial state.
void AddReferenceToCell(vtkIdType ptId, vtkIdType cellId)
Add a reference to a cell in a particular point's link list.
void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds, vtkIdList *cellIds) override
Topological inquiry to get all cells using list of points exclusive of cell specified (e....
~vtkPolyData() override
int GetScalarFieldCriticalIndex(vtkIdType pointId, int fieldId)
void ReplaceLinkedCell(vtkIdType cellId, int npts, const vtkIdType pts[])
Replace one cell with another in cell structure.
void CopyStructure(vtkDataSet *ds) override
Copy the geometric and topological structure of an input poly data object.
vtkNew< vtkIdList > LegacyBuffer
Definition: vtkPolyData.h:677
int GetCellType(vtkIdType cellId) override
Get type of cell with cellId such that: 0 <= cellId < NumberOfCells.
Definition: vtkPolyData.h:724
void GetCellBounds(vtkIdType cellId, double bounds[6]) override
Get the bounds of the cell with cellId such that: 0 <= cellId < NumberOfCells.
void ReplaceCell(vtkIdType cellId, vtkIdList *ids)
Replace the points defining cell "cellId" with a new set of points.
virtual int GetGhostLevel()
Get the ghost level.
vtkMTimeType GetMTime() override
Get MTime which also considers its cell array MTime.
vtkSmartPointer< vtkCellArray > Verts
Definition: vtkPolyData.h:667
vtkSmartPointer< vtkPolyLine > PolyLine
Definition: vtkPolyData.h:658
vtkIdType GetNumberOfStrips()
Definition: vtkPolyData.h:207
int GetScalarFieldCriticalIndex(vtkIdType pointId, vtkDataArray *scalarField)
vtkCellArray * GetVerts()
Get the cell array defining vertices.
bool AllocateCopy(vtkPolyData *pd)
Preallocate memory for the internal cell arrays such that they are the same size as those in pd.
static vtkPolyData * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
vtkIdType InsertNextLinkedCell(int type, int npts, const vtkIdType pts[])
Add a new cell to the cell data structure (after cell pointers have been built).
vtkIdType InsertNextCell(int type, vtkIdList *pts)
Insert a cell of type VTK_VERTEX, VTK_POLY_VERTEX, VTK_LINE, VTK_POLY_LINE, VTK_TRIANGLE,...
vtkIdType GetNumberOfPolys()
Definition: vtkPolyData.h:206
void ShallowCopy(vtkDataObject *src) override
Shallow and Deep copy.
vtkSmartPointer< vtkCellArray > Strips
Definition: vtkPolyData.h:670
vtkSmartPointer< vtkQuad > Quad
Definition: vtkPolyData.h:660
vtkCell * GetCell(vtkIdType cellId) override
Get cell with cellId such that: 0 <= cellId < NumberOfCells.
void DeleteCell(vtkIdType cellId)
Definition: vtkPolyData.h:788
vtkSmartPointer< vtkPolygon > Polygon
Definition: vtkPolyData.h:661
vtkIdType InsertNextLinkedPoint(double x[3], int numLinks)
int GetMaxCellSize() override
Return the maximum cell size in this poly data.
void RemoveGhostCells()
This method will remove any cell that is marked as ghost (has the vtkDataSetAttributes::DUPLICATECELL...
vtkSmartPointer< vtkLine > Line
Definition: vtkPolyData.h:657
void ResizeCellList(vtkIdType ptId, int size)
Resize the list of cells using a particular point.
Definition: vtkPolyData.h:820
virtual int GetPiece()
Get the piece and the number of pieces.
vtkCellArray * GetPolys()
Get the cell array defining polygons.
vtkIdType GetNumberOfCells() override
Standard vtkDataSet interface.
Definition: vtkPolyData.h:717
bool AllocateExact(vtkIdType numCells, vtkIdType connectivitySize)
Preallocate memory for the internal cell arrays.
vtkIdType InsertNextLinkedPoint(int numLinks)
Add a point to the cell data structure (after cell pointers have been built).
unsigned char GetCell(vtkIdType cellId, const vtkIdType *&pts)
Get a pointer to the cell, ie [npts pid1 .
vtkSmartPointer< vtkCellArray > Polys
Definition: vtkPolyData.h:669
void Reset()
Begin inserting data all over again.
static vtkPolyData * New()
unsigned long GetActualMemorySize() override
Return the actual size of the data in kibibytes (1024 bytes).
void RemoveReferenceToCell(vtkIdType ptId, vtkIdType cellId)
Remove a reference to a cell in a particular point's link list.
int IsEdge(vtkIdType p1, vtkIdType p2)
Determine whether two points form an edge.
void ReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[])
Replace the points defining cell "cellId" with a new set of points.
static vtkPolyDataDummyContainter DummyContainer
Definition: vtkPolyData.h:680
void AddCellReference(vtkIdType cellId)
Add references to cell in cell structure.
Definition: vtkPolyData.h:807
int GetDataObjectType() override
Return what type of dataset this is.
Definition: vtkPolyData.h:95
vtkSmartPointer< vtkCellArray > Lines
Definition: vtkPolyData.h:668
void ComputeBounds() override
Compute the (X, Y, Z) bounds of the data.
void GetCellEdgeNeighbors(vtkIdType cellId, vtkIdType p1, vtkIdType p2, vtkIdList *cellIds)
Get the neighbors at an edge.
vtkSmartPointer< vtkEmptyCell > EmptyCell
Definition: vtkPolyData.h:663
virtual int GetNumberOfPieces()
void DeepCopy(vtkDataObject *src) override
void RemoveDeletedCells()
The cells marked by calls to DeleteCell are stored in the Cell Array VTK_EMPTY_CELL,...
vtkIdType GetNumberOfVerts()
Return the number of primitives of a particular type held.
Definition: vtkPolyData.h:204
void DeleteCells()
Release data structure that allows random access of the cells.
virtual vtkMTimeType GetMeshMTime()
Return the mesh (geometry/topology) modification time.
vtkSmartPointer< vtkVertex > Vertex
Definition: vtkPolyData.h:655
int IsPointUsedByCell(vtkIdType ptId, vtkIdType cellId)
Determine whether a point is used by a particular cell.
Definition: vtkPolyData.h:764
void ReplaceCellPoint(vtkIdType cellId, vtkIdType oldPtId, vtkIdType newPtId)
Replace a point in the cell connectivity list with a different point.
Definition: vtkPolyData.h:843
vtkSmartPointer< CellMap > Cells
Definition: vtkPolyData.h:674
void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) override
Efficient method to obtain cells using a particular point.
vtkCellArray * GetLines()
Get the cell array defining lines.
vtkSmartPointer< vtkTriangle > Triangle
Definition: vtkPolyData.h:659
void BuildCells()
Create data structure that allows random access of cells.
void DeletePoint(vtkIdType ptId)
Mark a point/cell as deleted from this vtkPolyData.
Definition: vtkPolyData.h:782
void CopyCells(vtkPolyData *pd, vtkIdList *idList, vtkIncrementalPointLocator *locator=nullptr)
Copy cells listed in idList from pd, including points, point data, and cell data.
void Allocate(vtkIdType numCells=1000, int vtkNotUsed(extSize)=1000)
Method allocates initial storage for vertex, line, polygon, and triangle strip arrays.
Definition: vtkPolyData.h:286
void BuildLinks(int initialSize=0)
Create upward links from points to cells that use each point.
void Allocate(vtkPolyData *inPolyData, vtkIdType numCells=1000, int vtkNotUsed(extSize)=1000)
Similar to the method above, this method allocates initial storage for vertex, line,...
Definition: vtkPolyData.h:301
void DeleteLinks()
Release the upward links from point to cells that use each point.
void ReverseCell(vtkIdType cellId)
Reverse the order of point ids defining the cell.
vtkSmartPointer< vtkTriangleStrip > TriangleStrip
Definition: vtkPolyData.h:662
void SetStrips(vtkCellArray *s)
Set the cell array defining triangle strips.
bool AllocateProportional(vtkPolyData *pd, double ratio)
Preallocate memory for the internal cell arrays such that they are proportional to those in pd by a f...
cell represents a set of 1D lines
Definition: vtkPolyLine.h:37
cell represents a set of 0D vertices
Definition: vtkPolyVertex.h:33
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:40
a cell that represents a 2D quadrilateral
Definition: vtkQuad.h:36
a cell that represents a triangle strip
a cell that represents a triangle
Definition: vtkTriangle.h:36
a cell that represents a 3D point
Definition: vtkVertex.h:31
@ info
Definition: vtkX3D.h:382
@ type
Definition: vtkX3D.h:522
@ size
Definition: vtkX3D.h:259
unsigned char GetCellType() const noexcept
vtkIdType GetCellId() const noexcept
@ VTK_EMPTY_CELL
Definition: vtkCellType.h:46
int vtkIdType
Definition: vtkType.h:338
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293
#define VTK_POLY_DATA
Definition: vtkType.h:85
#define VTK_SIZEHINT(...)