VTK  9.2.6
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
72class vtkVertex;
73class vtkPolyVertex;
74class vtkLine;
75class vtkPolyLine;
76class vtkTriangle;
77class vtkQuad;
78class vtkPolygon;
80class vtkEmptyCell;
81struct vtkPolyDataDummyContainter;
83
84class VTKCOMMONDATAMODEL_EXPORT vtkPolyData : public vtkPointSet
85{
86public:
87 static vtkPolyData* New();
89
90 vtkTypeMacro(vtkPolyData, vtkPointSet);
91 void PrintSelf(ostream& os, vtkIndent indent) override;
92
96 int GetDataObjectType() override { return VTK_POLY_DATA; }
97
101 void CopyStructure(vtkDataSet* ds) override;
102
104
107 vtkIdType GetNumberOfCells() override;
109 vtkCell* GetCell(vtkIdType cellId) override;
110 void GetCell(vtkIdType cellId, vtkGenericCell* cell) override;
111 int GetCellType(vtkIdType cellId) override;
112 vtkIdType GetCellSize(vtkIdType cellId) override;
113 void GetCellBounds(vtkIdType cellId, double bounds[6]) override;
114 void GetCellNeighbors(vtkIdType cellId, vtkIdList* ptIds, vtkIdList* cellIds) override;
116
124 void CopyCells(vtkPolyData* pd, vtkIdList* idList, vtkIncrementalPointLocator* locator = nullptr);
125
129 void GetCellPoints(vtkIdType cellId, vtkIdList* ptIds) override;
130
135 void GetPointCells(vtkIdType ptId, vtkIdList* cellIds) override;
136
156
162 void GetCellsBounds(double bounds[6]);
163
170 void Squeeze() override;
171
175 int GetMaxCellSize() override;
176
183
188
194
199
205
210
216
221
228
230
233 vtkIdType GetNumberOfVerts() { return (this->Verts ? this->Verts->GetNumberOfCells() : 0); }
234 vtkIdType GetNumberOfLines() { return (this->Lines ? this->Lines->GetNumberOfCells() : 0); }
235 vtkIdType GetNumberOfPolys() { return (this->Polys ? this->Polys->GetNumberOfCells() : 0); }
236 vtkIdType GetNumberOfStrips() { return (this->Strips ? this->Strips->GetNumberOfCells() : 0); }
238
248 bool AllocateEstimate(vtkIdType numCells, vtkIdType maxCellSize);
249
259 bool AllocateEstimate(vtkIdType numVerts, vtkIdType maxVertSize, vtkIdType numLines,
260 vtkIdType maxLineSize, vtkIdType numPolys, vtkIdType maxPolySize, vtkIdType numStrips,
261 vtkIdType maxStripSize);
262
272 bool AllocateExact(vtkIdType numCells, vtkIdType connectivitySize);
273
284 bool AllocateExact(vtkIdType numVerts, vtkIdType vertConnSize, vtkIdType numLines,
285 vtkIdType lineConnSize, vtkIdType numPolys, vtkIdType polyConnSize, vtkIdType numStrips,
286 vtkIdType stripConnSize);
287
297
307 bool AllocateProportional(vtkPolyData* pd, double ratio);
308
315 void Allocate(vtkIdType numCells = 1000, int vtkNotUsed(extSize) = 1000)
316 {
317 this->AllocateExact(numCells, numCells);
318 }
319
330 void Allocate(vtkPolyData* inPolyData, vtkIdType numCells = 1000, int vtkNotUsed(extSize) = 1000)
331 {
332 this->AllocateProportional(
333 inPolyData, static_cast<double>(numCells) / inPolyData->GetNumberOfCells());
334 }
335
343 vtkIdType InsertNextCell(int type, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
344
353
358 void Reset();
359
368
372 bool NeedToBuildCells() { return this->Cells == nullptr; }
373
380 void BuildLinks(int initialSize = 0);
381
383
388 virtual void SetLinks(vtkAbstractCellLinks* links);
391
398
403
405
409 void GetPointCells(vtkIdType ptId, vtkIdType& ncells, vtkIdType*& cells)
410 VTK_SIZEHINT(cells, ncells);
412
419
431 unsigned char GetCellPoints(vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts)
432 VTK_SIZEHINT(pts, npts);
433
448 void GetCellPoints(vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts, vtkIdList* ptIds)
449 VTK_SIZEHINT(pts, npts) override;
450
455 int IsTriangle(int v1, int v2, int v3);
456
465
470 int IsPointUsedByCell(vtkIdType ptId, vtkIdType cellId);
471
480 void ReplaceCell(vtkIdType cellId, vtkIdList* ids);
481 void ReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
488 void ReplaceCellPoint(vtkIdType cellId, vtkIdType oldPtId, vtkIdType newPtId);
489
494 void ReverseCell(vtkIdType cellId);
495
497
501 void DeletePoint(vtkIdType ptId);
502 void DeleteCell(vtkIdType cellId);
504
514
516
525 vtkIdType InsertNextLinkedPoint(double x[3], int numLinks);
527
534 vtkIdType InsertNextLinkedCell(int type, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
535
545 void ReplaceLinkedCell(vtkIdType cellId, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
546
554 void RemoveCellReference(vtkIdType cellId);
555
563 void AddCellReference(vtkIdType cellId);
564
573
582
588 void ResizeCellList(vtkIdType ptId, int size);
589
593 void Initialize() override;
594
596
599 virtual int GetPiece();
600 virtual int GetNumberOfPieces();
602
606 virtual int GetGhostLevel();
607
616 unsigned long GetActualMemorySize() override;
617
619
622 void ShallowCopy(vtkDataObject* src) override;
623 void DeepCopy(vtkDataObject* src) override;
625
633
635
641
660 enum
661 {
662 ERR_NO_SUCH_FIELD = -4,
663 ERR_INCORRECT_FIELD = -3,
664 ERR_NON_MANIFOLD_STAR = -2,
665 REGULAR_POINT = -1,
666 MINIMUM = 0,
667 SADDLE = 1,
668 MAXIMUM = 2
669 };
670
672 int GetScalarFieldCriticalIndex(vtkIdType pointId, int fieldId);
673 int GetScalarFieldCriticalIndex(vtkIdType pointId, const char* fieldName);
674
683
688
698 unsigned char GetCell(vtkIdType cellId, const vtkIdType*& pts);
699
700protected:
702 ~vtkPolyData() override;
703
706
707 vtkCellArray* GetCellArrayInternal(TaggedCellId tag);
708
709 // constant cell objects returned by GetCell called.
719
720 // points inherited
721 // point data (i.e., scalars, vectors, normals, tcoords) inherited
726
727 // supporting structures for more complex topological operations
728 // built only when necessary
731
733
734 // dummy static member below used as a trick to simplify traversal
735 static vtkPolyDataDummyContainter DummyContainer;
736
737 // Take into account only points that belong to at least one cell.
738 double CellsBounds[6];
739
741
742private:
743 void Cleanup();
744
745private:
746 vtkPolyData(const vtkPolyData&) = delete;
747 void operator=(const vtkPolyData&) = delete;
748};
749
750//------------------------------------------------------------------------------
751inline void vtkPolyData::GetPointCells(vtkIdType ptId, vtkIdType& ncells, vtkIdType*& cells)
752{
753 ncells = this->Links->GetNcells(ptId);
754 cells = this->Links->GetCells(ptId);
755}
756
757//------------------------------------------------------------------------------
759{
760 return (this->GetNumberOfVerts() + this->GetNumberOfLines() + this->GetNumberOfPolys() +
761 this->GetNumberOfStrips());
762}
763
764//------------------------------------------------------------------------------
766{
767 if (!this->Cells)
768 {
769 this->BuildCells();
770 }
771 return static_cast<int>(this->Cells->GetTag(cellId).GetCellType());
772}
773
774//------------------------------------------------------------------------------
776{
777 if (!this->Cells)
778 {
779 this->BuildCells();
780 }
781 switch (this->GetCellType(cellId))
782 {
783 case VTK_EMPTY_CELL:
784 return 0;
785 case VTK_VERTEX:
786 return 1;
787 case VTK_LINE:
788 return 2;
789 case VTK_TRIANGLE:
790 return 3;
791 case VTK_QUAD:
792 return 4;
793 case VTK_POLY_VERTEX:
794 return this->Verts ? this->Verts->GetCellSize(this->GetCellIdRelativeToCellArray(cellId)) : 0;
795 case VTK_POLY_LINE:
796 return this->Lines ? this->Lines->GetCellSize(this->GetCellIdRelativeToCellArray(cellId)) : 0;
797 case VTK_POLYGON:
798 return this->Polys ? this->Polys->GetCellSize(this->GetCellIdRelativeToCellArray(cellId)) : 0;
800 return this->Strips ? this->Strips->GetCellSize(this->GetCellIdRelativeToCellArray(cellId))
801 : 0;
802 }
803 vtkWarningMacro(<< "Cell type not supported.");
804 return 0;
805}
806
807//------------------------------------------------------------------------------
808inline int vtkPolyData::IsTriangle(int v1, int v2, int v3)
809{
810 vtkIdType n1;
811 int i, j, tVerts[3];
812 vtkIdType* cells;
813 const vtkIdType* tVerts2;
814 vtkIdType n2;
815
816 tVerts[0] = v1;
817 tVerts[1] = v2;
818 tVerts[2] = v3;
819
820 for (i = 0; i < 3; i++)
821 {
822 this->GetPointCells(tVerts[i], n1, cells);
823 for (j = 0; j < n1; j++)
824 {
825 this->GetCellPoints(cells[j], n2, tVerts2);
826 if ((tVerts[0] == tVerts2[0] || tVerts[0] == tVerts2[1] || tVerts[0] == tVerts2[2]) &&
827 (tVerts[1] == tVerts2[0] || tVerts[1] == tVerts2[1] || tVerts[1] == tVerts2[2]) &&
828 (tVerts[2] == tVerts2[0] || tVerts[2] == tVerts2[1] || tVerts[2] == tVerts2[2]))
829 {
830 return 1;
831 }
832 }
833 }
834 return 0;
835}
836
837//------------------------------------------------------------------------------
839{
840 vtkIdType npts;
841 const vtkIdType* pts;
842
843 this->GetCellPoints(cellId, npts, pts);
844 for (vtkIdType i = 0; i < npts; i++)
845 {
846 if (pts[i] == ptId)
847 {
848 return 1;
849 }
850 }
851
852 return 0;
853}
854
855//------------------------------------------------------------------------------
857{
858 this->Links->DeletePoint(ptId);
859}
860
861//------------------------------------------------------------------------------
863{
864 this->Cells->GetTag(cellId).MarkDeleted();
865}
866
867//------------------------------------------------------------------------------
869{
870 const vtkIdType* pts;
871 vtkIdType npts;
872
873 this->GetCellPoints(cellId, npts, pts);
874 for (vtkIdType i = 0; i < npts; i++)
875 {
876 this->Links->RemoveCellReference(cellId, pts[i]);
877 }
878}
879
880//------------------------------------------------------------------------------
882{
883 const vtkIdType* pts;
884 vtkIdType npts;
885
886 this->GetCellPoints(cellId, npts, pts);
887 for (vtkIdType i = 0; i < npts; i++)
888 {
889 this->Links->AddCellReference(cellId, pts[i]);
890 }
891}
892
893//------------------------------------------------------------------------------
894inline void vtkPolyData::ResizeCellList(vtkIdType ptId, int size)
895{
896 this->Links->ResizeCellList(ptId, size);
897}
898
899//------------------------------------------------------------------------------
901{
902 switch (tag.GetTarget())
903 {
905 return this->Verts;
907 return this->Lines;
909 return this->Polys;
911 return this->Strips;
912 }
913 return nullptr; // unreachable
914}
915
916//------------------------------------------------------------------------------
917inline void vtkPolyData::ReplaceCellPoint(vtkIdType cellId, vtkIdType oldPtId, vtkIdType newPtId)
918{
920 this->GetCellPoints(cellId, ids);
921 for (vtkIdType i = 0; i < ids->GetNumberOfIds(); i++)
922 {
923 if (ids->GetId(i) == oldPtId)
924 {
925 ids->SetId(i, newPtId);
926 break;
927 }
928 }
929 this->ReplaceCell(cellId, static_cast<int>(ids->GetNumberOfIds()), ids->GetPointer(0));
930}
931
932//------------------------------------------------------------------------------
933inline unsigned char vtkPolyData::GetCellPoints(
934 vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts)
935{
936 if (!this->Cells)
937 {
938 this->BuildCells();
939 }
940
941 const TaggedCellId tag = this->Cells->GetTag(cellId);
942 if (tag.IsDeleted())
943 {
944 npts = 0;
945 pts = nullptr;
946 return VTK_EMPTY_CELL;
947 }
948
949 vtkCellArray* cells = this->GetCellArrayInternal(tag);
950 cells->GetCellAtId(tag.GetCellId(), npts, pts);
951 return tag.GetCellType();
952}
953
954//------------------------------------------------------------------------------
956 vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts, vtkIdList* ptIds)
957{
958 if (!this->Cells)
959 {
960 this->BuildCells();
961 }
962
963 const TaggedCellId tag = this->Cells->GetTag(cellId);
964 if (tag.IsDeleted())
965 {
966 npts = 0;
967 pts = nullptr;
968 }
969
970 vtkCellArray* cells = this->GetCellArrayInternal(tag);
971 cells->GetCellAtId(tag.GetCellId(), npts, pts, ptIds);
972}
973
974#endif
object to represent cell connectivity
void GetCellAtId(vtkIdType cellId, vtkIdType &cellSize, vtkIdType const *&cellPoints)
Return the point ids for the cell at cellId.
vtkIdType GetCellSize(const vtkIdType cellId) const
Return the size of the cell at cellId.
abstract class to specify cell behavior
Definition vtkCell.h:58
abstract superclass for arrays of numeric data
general representation of visualization data
abstract class to specify dataset behavior
Definition vtkDataSet.h:57
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
provides thread-safe access to cells
list of point or cell ids
Definition vtkIdList.h:31
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:31
Allocate and hold a VTK object.
Definition vtkNew.h:56
T * GetPointer() const noexcept
Get a raw pointer to the contained object.
Definition vtkNew.h:145
concrete class for storing a set of points
Definition vtkPointSet.h:67
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:85
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.
Definition vtkPolyData.h:96
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:37
cell represents a set of 0D vertices
a cell that represents an n-sided polygon
Definition vtkPolygon.h:40
a cell that represents a 2D quadrilateral
Definition vtkQuad.h:36
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:36
a cell that represents a 3D point
Definition vtkVertex.h:31
unsigned char GetCellType() const noexcept
vtkIdType GetCellId() const noexcept
@ VTK_TRIANGLE_STRIP
Definition vtkCellType.h:52
@ VTK_POLY_LINE
Definition vtkCellType.h:50
@ VTK_TRIANGLE
Definition vtkCellType.h:51
@ VTK_POLYGON
Definition vtkCellType.h:53
@ VTK_EMPTY_CELL
Definition vtkCellType.h:46
@ VTK_LINE
Definition vtkCellType.h:49
@ VTK_QUAD
Definition vtkCellType.h:55
@ VTK_VERTEX
Definition vtkCellType.h:47
@ VTK_POLY_VERTEX
Definition vtkCellType.h:48
int vtkIdType
Definition vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287
#define VTK_POLY_DATA
Definition vtkType.h:77
#define VTK_SIZEHINT(...)