VTK  9.3.0
vtkPolyData.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
65#ifndef vtkPolyData_h
66#define vtkPolyData_h
67
68#include "vtkCommonDataModelModule.h" // For export macro
69#include "vtkPointSet.h"
70
71#include "vtkCellArray.h" // Needed for inline methods
72#include "vtkCellLinks.h" // Needed for inline methods
73#include "vtkPolyDataInternals.h" // Needed for inline methods
74
75VTK_ABI_NAMESPACE_BEGIN
76class vtkVertex;
77class vtkPolyVertex;
78class vtkLine;
79class vtkPolyLine;
80class vtkTriangle;
81class vtkQuad;
82class vtkPolygon;
84class vtkEmptyCell;
85struct vtkPolyDataDummyContainter;
87
88class VTKCOMMONDATAMODEL_EXPORT vtkPolyData : public vtkPointSet
89{
90public:
91 static vtkPolyData* New();
93
94 vtkTypeMacro(vtkPolyData, vtkPointSet);
95 void PrintSelf(ostream& os, vtkIndent indent) override;
96
100 int GetDataObjectType() override { return VTK_POLY_DATA; }
101
105 void CopyStructure(vtkDataSet* ds) override;
106
108
111 vtkIdType GetNumberOfCells() override;
113 vtkCell* GetCell(vtkIdType cellId) override;
114 void GetCell(vtkIdType cellId, vtkGenericCell* cell) override;
115 int GetCellType(vtkIdType cellId) override;
116 vtkIdType GetCellSize(vtkIdType cellId) override;
117 void GetCellBounds(vtkIdType cellId, double bounds[6]) override;
118 void GetCellNeighbors(vtkIdType cellId, vtkIdList* ptIds, vtkIdList* cellIds) override;
120
128 void CopyCells(vtkPolyData* pd, vtkIdList* idList, vtkIncrementalPointLocator* locator = nullptr);
129
133 void GetCellPoints(vtkIdType cellId, vtkIdList* ptIds) override;
134
139 void GetPointCells(vtkIdType ptId, vtkIdList* cellIds) override;
140
160
166 void GetCellsBounds(double bounds[6]);
167
174 void Squeeze() override;
175
179 int GetMaxCellSize() override;
180
187
192
198
203
209
214
220
225
232
234
237 vtkIdType GetNumberOfVerts() { return (this->Verts ? this->Verts->GetNumberOfCells() : 0); }
238 vtkIdType GetNumberOfLines() { return (this->Lines ? this->Lines->GetNumberOfCells() : 0); }
239 vtkIdType GetNumberOfPolys() { return (this->Polys ? this->Polys->GetNumberOfCells() : 0); }
240 vtkIdType GetNumberOfStrips() { return (this->Strips ? this->Strips->GetNumberOfCells() : 0); }
242
252 bool AllocateEstimate(vtkIdType numCells, vtkIdType maxCellSize);
253
263 bool AllocateEstimate(vtkIdType numVerts, vtkIdType maxVertSize, vtkIdType numLines,
264 vtkIdType maxLineSize, vtkIdType numPolys, vtkIdType maxPolySize, vtkIdType numStrips,
265 vtkIdType maxStripSize);
266
276 bool AllocateExact(vtkIdType numCells, vtkIdType connectivitySize);
277
288 bool AllocateExact(vtkIdType numVerts, vtkIdType vertConnSize, vtkIdType numLines,
289 vtkIdType lineConnSize, vtkIdType numPolys, vtkIdType polyConnSize, vtkIdType numStrips,
290 vtkIdType stripConnSize);
291
301
311 bool AllocateProportional(vtkPolyData* pd, double ratio);
312
319 void Allocate(vtkIdType numCells = 1000, int vtkNotUsed(extSize) = 1000)
320 {
321 this->AllocateExact(numCells, numCells);
322 }
323
334 void Allocate(vtkPolyData* inPolyData, vtkIdType numCells = 1000, int vtkNotUsed(extSize) = 1000)
335 {
336 this->AllocateProportional(
337 inPolyData, static_cast<double>(numCells) / inPolyData->GetNumberOfCells());
338 }
339
347 vtkIdType InsertNextCell(int type, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
348
357
362 void Reset();
363
372
376 bool NeedToBuildCells() { return this->Cells == nullptr; }
377
384 void BuildLinks(int initialSize = 0);
385
387
392 virtual void SetLinks(vtkAbstractCellLinks* links);
395
402
407
409
413 void GetPointCells(vtkIdType ptId, vtkIdType& ncells, vtkIdType*& cells)
414 VTK_SIZEHINT(cells, ncells);
416
423
435 unsigned char GetCellPoints(vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts)
436 VTK_SIZEHINT(pts, npts);
437
452 void GetCellPoints(vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts, vtkIdList* ptIds)
453 VTK_SIZEHINT(pts, npts) override;
454
459 int IsTriangle(int v1, int v2, int v3);
460
469
474 int IsPointUsedByCell(vtkIdType ptId, vtkIdType cellId);
475
484 void ReplaceCell(vtkIdType cellId, vtkIdList* ids);
485 void ReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
489
498 void ReplaceCellPoint(vtkIdType cellId, vtkIdType oldPtId, vtkIdType newPtId);
499 void ReplaceCellPoint(
500 vtkIdType cellId, vtkIdType oldPtId, vtkIdType newPtId, vtkIdList* cellPointIds);
502
507 void ReverseCell(vtkIdType cellId);
508
510
514 void DeletePoint(vtkIdType ptId);
515 void DeleteCell(vtkIdType cellId);
517
527
529
538 vtkIdType InsertNextLinkedPoint(double x[3], int numLinks);
540
547 vtkIdType InsertNextLinkedCell(int type, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
548
558 void ReplaceLinkedCell(vtkIdType cellId, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
559
567 void RemoveCellReference(vtkIdType cellId);
568
576 void AddCellReference(vtkIdType cellId);
577
586
595
601 void ResizeCellList(vtkIdType ptId, int size);
602
606 void Initialize() override;
607
609
612 virtual int GetPiece();
613 virtual int GetNumberOfPieces();
615
619 virtual int GetGhostLevel();
620
629 unsigned long GetActualMemorySize() override;
630
632
635 void ShallowCopy(vtkDataObject* src) override;
636 void DeepCopy(vtkDataObject* src) override;
638
646
648
654
673 enum
674 {
675 ERR_NO_SUCH_FIELD = -4,
676 ERR_INCORRECT_FIELD = -3,
677 ERR_NON_MANIFOLD_STAR = -2,
678 REGULAR_POINT = -1,
679 MINIMUM = 0,
680 SADDLE = 1,
681 MAXIMUM = 2
682 };
683
685 int GetScalarFieldCriticalIndex(vtkIdType pointId, int fieldId);
686 int GetScalarFieldCriticalIndex(vtkIdType pointId, const char* fieldName);
687
696
701
711 unsigned char GetCell(vtkIdType cellId, const vtkIdType*& pts);
712
713protected:
715 ~vtkPolyData() override;
716
718
721
722 vtkCellArray* GetCellArrayInternal(TaggedCellId tag);
723
724 // constant cell objects returned by GetCell called.
734
735 // points inherited
736 // point data (i.e., scalars, vectors, normals, tcoords) inherited
741
742 // supporting structures for more complex topological operations
743 // built only when necessary
746
748
749 // dummy static member below used as a trick to simplify traversal
750 static vtkPolyDataDummyContainter DummyContainer;
751
752 // Take into account only points that belong to at least one cell.
753 double CellsBounds[6];
754
756
757private:
758 void Cleanup();
759
760 vtkPolyData(const vtkPolyData&) = delete;
761 void operator=(const vtkPolyData&) = delete;
762};
763
764//------------------------------------------------------------------------------
765inline void vtkPolyData::GetPointCells(vtkIdType ptId, vtkIdType& ncells, vtkIdType*& cells)
766{
767 ncells = this->Links->GetNcells(ptId);
768 cells = this->Links->GetCells(ptId);
769}
770
771//------------------------------------------------------------------------------
773{
774 return (this->GetNumberOfVerts() + this->GetNumberOfLines() + this->GetNumberOfPolys() +
775 this->GetNumberOfStrips());
776}
777
778//------------------------------------------------------------------------------
780{
781 if (!this->Cells)
782 {
783 this->BuildCells();
784 }
785 return static_cast<int>(this->Cells->GetTag(cellId).GetCellType());
786}
787
788//------------------------------------------------------------------------------
790{
791 if (!this->Cells)
792 {
793 this->BuildCells();
794 }
795 switch (this->GetCellType(cellId))
796 {
797 case VTK_EMPTY_CELL:
798 return 0;
799 case VTK_VERTEX:
800 return 1;
801 case VTK_LINE:
802 return 2;
803 case VTK_TRIANGLE:
804 return 3;
805 case VTK_QUAD:
806 return 4;
807 case VTK_POLY_VERTEX:
808 return this->Verts ? this->Verts->GetCellSize(this->GetCellIdRelativeToCellArray(cellId)) : 0;
809 case VTK_POLY_LINE:
810 return this->Lines ? this->Lines->GetCellSize(this->GetCellIdRelativeToCellArray(cellId)) : 0;
811 case VTK_POLYGON:
812 return this->Polys ? this->Polys->GetCellSize(this->GetCellIdRelativeToCellArray(cellId)) : 0;
814 return this->Strips ? this->Strips->GetCellSize(this->GetCellIdRelativeToCellArray(cellId))
815 : 0;
816 }
817 vtkWarningMacro(<< "Cell type not supported.");
818 return 0;
819}
820
821//------------------------------------------------------------------------------
822inline int vtkPolyData::IsTriangle(int v1, int v2, int v3)
823{
824 vtkIdType n1;
825 int i, j, tVerts[3];
826 vtkIdType* cells;
827 const vtkIdType* tVerts2;
828 vtkIdType n2;
829
830 tVerts[0] = v1;
831 tVerts[1] = v2;
832 tVerts[2] = v3;
833
834 for (i = 0; i < 3; i++)
835 {
836 this->GetPointCells(tVerts[i], n1, cells);
837 for (j = 0; j < n1; j++)
838 {
839 this->GetCellPoints(cells[j], n2, tVerts2);
840 if ((tVerts[0] == tVerts2[0] || tVerts[0] == tVerts2[1] || tVerts[0] == tVerts2[2]) &&
841 (tVerts[1] == tVerts2[0] || tVerts[1] == tVerts2[1] || tVerts[1] == tVerts2[2]) &&
842 (tVerts[2] == tVerts2[0] || tVerts[2] == tVerts2[1] || tVerts[2] == tVerts2[2]))
843 {
844 return 1;
845 }
846 }
847 }
848 return 0;
849}
850
851//------------------------------------------------------------------------------
853{
854 vtkIdType npts;
855 const vtkIdType* pts;
856
857 this->GetCellPoints(cellId, npts, pts);
858 for (vtkIdType i = 0; i < npts; i++)
859 {
860 if (pts[i] == ptId)
861 {
862 return 1;
863 }
864 }
865
866 return 0;
867}
868
869//------------------------------------------------------------------------------
871{
872 this->Links->DeletePoint(ptId);
873}
874
875//------------------------------------------------------------------------------
877{
878 this->Cells->GetTag(cellId).MarkDeleted();
879}
880
881//------------------------------------------------------------------------------
883{
884 const vtkIdType* pts;
885 vtkIdType npts;
886
887 this->GetCellPoints(cellId, npts, pts);
888 for (vtkIdType i = 0; i < npts; i++)
889 {
890 this->Links->RemoveCellReference(cellId, pts[i]);
891 }
892}
893
894//------------------------------------------------------------------------------
896{
897 const vtkIdType* pts;
898 vtkIdType npts;
899
900 this->GetCellPoints(cellId, npts, pts);
901 for (vtkIdType i = 0; i < npts; i++)
902 {
903 this->Links->AddCellReference(cellId, pts[i]);
904 }
905}
906
907//------------------------------------------------------------------------------
908inline void vtkPolyData::ResizeCellList(vtkIdType ptId, int size)
909{
910 this->Links->ResizeCellList(ptId, size);
911}
912
913//------------------------------------------------------------------------------
915{
916 switch (tag.GetTarget())
917 {
919 return this->Verts;
921 return this->Lines;
923 return this->Polys;
925 return this->Strips;
926 }
927 return nullptr; // unreachable
928}
929
930//------------------------------------------------------------------------------
931inline void vtkPolyData::ReplaceCellPoint(vtkIdType cellId, vtkIdType oldPtId, vtkIdType newPtId)
932{
934 this->ReplaceCellPoint(cellId, oldPtId, newPtId, ids);
935}
936
937//------------------------------------------------------------------------------
939 vtkIdType cellId, vtkIdType oldPtId, vtkIdType newPtId, vtkIdList* cellPointIds)
940{
941 if (!this->Cells)
942 {
943 this->BuildCells();
944 }
945 vtkIdType npts;
946 const vtkIdType* pts;
947 this->GetCellPoints(cellId, npts, pts, cellPointIds);
948 for (vtkIdType i = 0; i < npts; i++)
949 {
950 if (pts[i] == oldPtId)
951 {
952 const TaggedCellId tag = this->Cells->GetTag(cellId);
953 vtkCellArray* cells = this->GetCellArrayInternal(tag);
954 cells->ReplaceCellPointAtId(tag.GetCellId(), i, newPtId);
955 break;
956 }
957 }
958}
959
960//------------------------------------------------------------------------------
961inline unsigned char vtkPolyData::GetCellPoints(
962 vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts)
963{
964 if (!this->Cells)
965 {
966 this->BuildCells();
967 }
968
969 const TaggedCellId tag = this->Cells->GetTag(cellId);
970 if (tag.IsDeleted())
971 {
972 npts = 0;
973 pts = nullptr;
974 return VTK_EMPTY_CELL;
975 }
976
977 vtkCellArray* cells = this->GetCellArrayInternal(tag);
978 cells->GetCellAtId(tag.GetCellId(), npts, pts);
979 return tag.GetCellType();
980}
981
982//------------------------------------------------------------------------------
984 vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts, vtkIdList* ptIds)
985{
986 if (!this->Cells)
987 {
988 this->BuildCells();
989 }
990
991 const TaggedCellId tag = this->Cells->GetTag(cellId);
992 if (tag.IsDeleted())
993 {
994 npts = 0;
995 pts = nullptr;
996 }
997
998 vtkCellArray* cells = this->GetCellArrayInternal(tag);
999 cells->GetCellAtId(tag.GetCellId(), npts, pts, ptIds);
1000}
1001
1002VTK_ABI_NAMESPACE_END
1003#endif
object to represent cell connectivity
vtkIdType GetCellSize(vtkIdType cellId) const
Return the size of the cell at cellId.
void GetCellAtId(vtkIdType cellId, vtkIdType &cellSize, vtkIdType const *&cellPoints)
Return the point ids for the cell at cellId.
void ReplaceCellPointAtId(vtkIdType cellId, vtkIdType cellPointIndex, vtkIdType newPointId)
Replaces the pointId at cellPointIndex of a cell with newPointId.
abstract class to specify cell behavior
Definition vtkCell.h:59
abstract superclass for arrays of numeric data
general representation of visualization data
abstract class to specify dataset behavior
Definition vtkDataSet.h:62
virtual vtkCell * GetCell(vtkIdType cellId)=0
Get cell with cellId such that: 0 <= cellId < NumberOfCells.
an empty cell used as a place-holder during processing
Detect and break reference loops.
provides thread-safe access to cells
list of point or cell ids
Definition vtkIdList.h:32
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
cell represents a 1D line
Definition vtkLine.h:32
Allocate and hold a VTK object.
Definition vtkNew.h:60
concrete class for storing a set of points
Definition vtkPointSet.h:68
void GetCellPoints(vtkIdType, vtkIdList *idList) override
This method resets parameter idList, as there is no cell in a vtkPointSet.
void GetPointCells(vtkIdType, vtkIdList *idList) override
This method resets parameter idList, as there is no cell in a vtkPointSet.
vtkIdType GetCellSize(vtkIdType) override
This method always returns 1, as all cells are point in a pure vtkPointSet.
vtkIdType GetNumberOfCells() override
This method always returns 0, as there are no cells in a vtkPointSet.
int GetCellType(vtkIdType) override
This method always returns VTK_EMPTY_CELL, as there is no cell in a vtkPointSet.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:89
vtkCellArray * GetStrips()
Get the cell array defining triangle strips.
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
static vtkPolyData * ExtendedNew()
void GetCell(vtkIdType cellId, vtkGenericCell *cell) override
Standard vtkDataSet interface.
void Squeeze() override
Recover extra allocated memory when creating data whose initial size is unknown.
bool NeedToBuildCells()
Check if BuildCells is needed.
bool AllocateEstimate(vtkIdType numCells, vtkIdType maxCellSize)
Preallocate memory for the internal cell arrays.
int GetScalarFieldCriticalIndex(vtkIdType pointId, const char *fieldName)
vtkCell * GetCell(vtkIdType cellId) override
Standard vtkDataSet interface.
void SetPolys(vtkCellArray *p)
Set the cell array defining polygons.
vtkCellArray * GetCellArrayInternal(TaggedCellId tag)
vtkIdType GetCellIdRelativeToCellArray(vtkIdType cellId)
Maps the cell at position cellId inside the vtkPolyData to its location in the corresponding cell arr...
void GetCellsBounds(double bounds[6])
Get the cells bounds.
void RemoveCellReference(vtkIdType cellId)
Remove all references to cell in cell structure.
static vtkPolyData * GetData(vtkInformationVector *v, int i=0)
Retrieve an instance of this class from an information object.
void ComputeCellsBounds()
Compute the (X, Y, Z) bounds of the data.
vtkIdType GetNumberOfLines()
Return the number of primitives of a particular type held.
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.
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
Standard methods for type information and printing.
vtkSmartPointer< vtkCellLinks > Links
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
Standard vtkDataSet interface.
~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.
vtkGetSmartPointerMacro(Links, vtkAbstractCellLinks)
Set/Get the links that you created possibly without using BuildLinks.
void CopyStructure(vtkDataSet *ds) override
Copy the geometric and topological structure of an input poly data object.
vtkNew< vtkIdList > LegacyBuffer
int GetCellType(vtkIdType cellId) override
Standard vtkDataSet interface.
void GetCellBounds(vtkIdType cellId, double bounds[6]) override
Standard vtkDataSet interface.
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
vtkSmartPointer< vtkPolyLine > PolyLine
vtkIdType GetNumberOfStrips()
Return the number of primitives of a particular type held.
int GetScalarFieldCriticalIndex(vtkIdType pointId, vtkDataArray *scalarField)
bool AllocateCopy(vtkPolyData *pd)
Preallocate memory for the internal cell arrays such that they are the same size as those in pd.
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()
Return the number of primitives of a particular type held.
void ShallowCopy(vtkDataObject *src) override
Shallow and Deep copy.
vtkSmartPointer< vtkCellArray > Strips
vtkSmartPointer< vtkQuad > Quad
void DeleteCell(vtkIdType cellId)
Mark a point/cell as deleted from this vtkPolyData.
vtkSmartPointer< vtkPolygon > Polygon
vtkIdType InsertNextLinkedPoint(double x[3], int numLinks)
Add a point to the cell data structure (after cell pointers have been built).
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
void ResizeCellList(vtkIdType ptId, int size)
Resize the list of cells using a particular point.
virtual int GetPiece()
Get the piece and the number of pieces.
vtkTimeStamp CellsBoundsTime
virtual void SetLinks(vtkAbstractCellLinks *links)
Set/Get the links that you created possibly without using BuildLinks.
vtkIdType GetNumberOfCells() override
Standard vtkDataSet interface.
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 .
vtkCellArray * GetVerts()
Get the cell array defining vertices.
vtkSmartPointer< vtkCellArray > Polys
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
vtkCellArray * GetPolys()
Get the cell array defining polygons.
void AddCellReference(vtkIdType cellId)
Add references to cell in cell structure.
int GetDataObjectType() override
Return what type of dataset this is.
void ReportReferences(vtkGarbageCollector *) override
vtkSmartPointer< vtkCellArray > Lines
void GetCellEdgeNeighbors(vtkIdType cellId, vtkIdType p1, vtkIdType p2, vtkIdList *cellIds)
Get the neighbors at an edge.
vtkSmartPointer< vtkEmptyCell > EmptyCell
virtual int GetNumberOfPieces()
Get the piece and the number of pieces.
void DeepCopy(vtkDataObject *src) override
Shallow and Deep copy.
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.
void DeleteCells()
Release data structure that allows random access of the cells.
virtual vtkMTimeType GetMeshMTime()
Return the mesh (geometry/topology) modification time.
static vtkPolyData * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
vtkSmartPointer< vtkVertex > Vertex
int IsPointUsedByCell(vtkIdType ptId, vtkIdType cellId)
Determine whether a point is used by a particular cell.
void ReplaceCellPoint(vtkIdType cellId, vtkIdType oldPtId, vtkIdType newPtId)
Replace a point in the cell connectivity list with a different point.
vtkSmartPointer< CellMap > Cells
void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) override
Efficient method to obtain cells using a particular point.
vtkSmartPointer< vtkTriangle > Triangle
void BuildCells()
Create data structure that allows random access of cells.
void DeletePoint(vtkIdType ptId)
Mark a point/cell as deleted from this vtkPolyData.
void CopyCells(vtkPolyData *pd, vtkIdList *idList, vtkIncrementalPointLocator *locator=nullptr)
Copy cells listed in idList from pd, including points, point data, and cell data.
vtkCellArray * GetLines()
Get the cell array defining lines.
void Allocate(vtkIdType numCells=1000, int vtkNotUsed(extSize)=1000)
Method allocates initial storage for vertex, line, polygon, and triangle strip arrays.
void BuildLinks(int initialSize=0)
Create upward links from points to cells that use each point.
vtkIdType GetCellSize(vtkIdType cellId) override
Standard vtkDataSet interface.
void Allocate(vtkPolyData *inPolyData, vtkIdType numCells=1000, int vtkNotUsed(extSize)=1000)
Similar to the method above, this method allocates initial storage for vertex, line,...
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
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:39
cell represents a set of 0D vertices
a cell that represents an n-sided polygon
Definition vtkPolygon.h:41
a cell that represents a 2D quadrilateral
Definition vtkQuad.h:37
Hold a reference to a vtkObjectBase instance.
record modification and/or execution time
a cell that represents a triangle strip
a cell that represents a triangle
Definition vtkTriangle.h:37
a cell that represents a 3D point
Definition vtkVertex.h:32
unsigned char GetCellType() const noexcept
vtkIdType GetCellId() const noexcept
@ VTK_TRIANGLE_STRIP
Definition vtkCellType.h:43
@ VTK_POLY_LINE
Definition vtkCellType.h:41
@ VTK_TRIANGLE
Definition vtkCellType.h:42
@ VTK_POLYGON
Definition vtkCellType.h:44
@ VTK_EMPTY_CELL
Definition vtkCellType.h:37
@ VTK_LINE
Definition vtkCellType.h:40
@ VTK_QUAD
Definition vtkCellType.h:46
@ VTK_VERTEX
Definition vtkCellType.h:38
@ VTK_POLY_VERTEX
Definition vtkCellType.h:39
int vtkIdType
Definition vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270
#define VTK_POLY_DATA
Definition vtkType.h:65
#define VTK_SIZEHINT(...)