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=========================================================================*/
177#ifndef vtkPolyData_h
178#define vtkPolyData_h
179
180#include "vtkCommonDataModelModule.h" // For export macro
181#include "vtkPointSet.h"
182
183#include "vtkCellArray.h" // Needed for inline methods
184#include "vtkCellLinks.h" // Needed for inline methods
185#include "vtkPolyDataInternals.h" // Needed for inline methods
186
187class vtkVertex;
188class vtkPolyVertex;
189class vtkLine;
190class vtkPolyLine;
191class vtkTriangle;
192class vtkQuad;
193class vtkPolygon;
194class vtkTriangleStrip;
195class vtkEmptyCell;
196struct vtkPolyDataDummyContainter;
198
199class VTKCOMMONDATAMODEL_EXPORT vtkPolyData : public vtkPointSet
200{
201public:
202 static vtkPolyData* New();
204
205 vtkTypeMacro(vtkPolyData, vtkPointSet);
206 void PrintSelf(ostream& os, vtkIndent indent) override;
207
211 int GetDataObjectType() override { return VTK_POLY_DATA; }
212
216 void CopyStructure(vtkDataSet* ds) override;
217
219
222 vtkIdType GetNumberOfCells() override;
224 vtkCell* GetCell(vtkIdType cellId) override;
225 void GetCell(vtkIdType cellId, vtkGenericCell* cell) override;
226 int GetCellType(vtkIdType cellId) override;
227 vtkIdType GetCellSize(vtkIdType cellId) override;
228 void GetCellBounds(vtkIdType cellId, double bounds[6]) override;
229 void GetCellNeighbors(vtkIdType cellId, vtkIdList* ptIds, vtkIdList* cellIds) override;
231
239 void CopyCells(vtkPolyData* pd, vtkIdList* idList, vtkIncrementalPointLocator* locator = nullptr);
240
244 void GetCellPoints(vtkIdType cellId, vtkIdList* ptIds) override;
245
250 void GetPointCells(vtkIdType ptId, vtkIdList* cellIds) override;
251
271
277 void GetCellsBounds(double bounds[6]);
278
285 void Squeeze() override;
286
290 int GetMaxCellSize() override;
291
298
303
309
314
320
325
331
336
343
345
348 vtkIdType GetNumberOfVerts() { return (this->Verts ? this->Verts->GetNumberOfCells() : 0); }
349 vtkIdType GetNumberOfLines() { return (this->Lines ? this->Lines->GetNumberOfCells() : 0); }
350 vtkIdType GetNumberOfPolys() { return (this->Polys ? this->Polys->GetNumberOfCells() : 0); }
351 vtkIdType GetNumberOfStrips() { return (this->Strips ? this->Strips->GetNumberOfCells() : 0); }
353
363 bool AllocateEstimate(vtkIdType numCells, vtkIdType maxCellSize);
364
374 bool AllocateEstimate(vtkIdType numVerts, vtkIdType maxVertSize, vtkIdType numLines,
375 vtkIdType maxLineSize, vtkIdType numPolys, vtkIdType maxPolySize, vtkIdType numStrips,
376 vtkIdType maxStripSize);
377
387 bool AllocateExact(vtkIdType numCells, vtkIdType connectivitySize);
388
399 bool AllocateExact(vtkIdType numVerts, vtkIdType vertConnSize, vtkIdType numLines,
400 vtkIdType lineConnSize, vtkIdType numPolys, vtkIdType polyConnSize, vtkIdType numStrips,
401 vtkIdType stripConnSize);
402
412
422 bool AllocateProportional(vtkPolyData* pd, double ratio);
423
430 void Allocate(vtkIdType numCells = 1000, int vtkNotUsed(extSize) = 1000)
431 {
432 this->AllocateExact(numCells, numCells);
433 }
434
445 void Allocate(vtkPolyData* inPolyData, vtkIdType numCells = 1000, int vtkNotUsed(extSize) = 1000)
446 {
447 this->AllocateProportional(
448 inPolyData, static_cast<double>(numCells) / inPolyData->GetNumberOfCells());
449 }
450
458 vtkIdType InsertNextCell(int type, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
459
468
473 void Reset();
474
483
487 bool NeedToBuildCells() { return this->Cells == nullptr; }
488
495 void BuildLinks(int initialSize = 0);
496
498
503 virtual void SetLinks(vtkAbstractCellLinks* links);
506
513
518
520
524 void GetPointCells(vtkIdType ptId, vtkIdType& ncells, vtkIdType*& cells)
525 VTK_SIZEHINT(cells, ncells);
527
534
546 unsigned char GetCellPoints(vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts)
547 VTK_SIZEHINT(pts, npts);
548
563 void GetCellPoints(vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts, vtkIdList* ptIds)
564 VTK_SIZEHINT(pts, npts) override;
565
570 int IsTriangle(int v1, int v2, int v3);
571
580
585 int IsPointUsedByCell(vtkIdType ptId, vtkIdType cellId);
586
595 void ReplaceCell(vtkIdType cellId, vtkIdList* ids);
596 void ReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
603 void ReplaceCellPoint(vtkIdType cellId, vtkIdType oldPtId, vtkIdType newPtId);
604
609 void ReverseCell(vtkIdType cellId);
610
612
616 void DeletePoint(vtkIdType ptId);
617 void DeleteCell(vtkIdType cellId);
619
629
631
640 vtkIdType InsertNextLinkedPoint(double x[3], int numLinks);
642
649 vtkIdType InsertNextLinkedCell(int type, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
650
660 void ReplaceLinkedCell(vtkIdType cellId, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
661
669 void RemoveCellReference(vtkIdType cellId);
670
678 void AddCellReference(vtkIdType cellId);
679
688
697
703 void ResizeCellList(vtkIdType ptId, int size);
704
708 void Initialize() override;
709
711
714 virtual int GetPiece();
715 virtual int GetNumberOfPieces();
717
721 virtual int GetGhostLevel();
722
731 unsigned long GetActualMemorySize() override;
732
734
737 void ShallowCopy(vtkDataObject* src) override;
738 void DeepCopy(vtkDataObject* src) override;
740
748
750
756
775 enum
776 {
777 ERR_NO_SUCH_FIELD = -4,
778 ERR_INCORRECT_FIELD = -3,
779 ERR_NON_MANIFOLD_STAR = -2,
780 REGULAR_POINT = -1,
781 MINIMUM = 0,
782 SADDLE = 1,
783 MAXIMUM = 2
784 };
785
787 int GetScalarFieldCriticalIndex(vtkIdType pointId, int fieldId);
788 int GetScalarFieldCriticalIndex(vtkIdType pointId, const char* fieldName);
789
798
803
813 unsigned char GetCell(vtkIdType cellId, const vtkIdType*& pts);
814
815protected:
817 ~vtkPolyData() override;
818
821
822 vtkCellArray* GetCellArrayInternal(TaggedCellId tag);
823
824 // constant cell objects returned by GetCell called.
834
835 // points inherited
836 // point data (i.e., scalars, vectors, normals, tcoords) inherited
841
842 // supporting structures for more complex topological operations
843 // built only when necessary
846
848
849 // dummy static member below used as a trick to simplify traversal
850 static vtkPolyDataDummyContainter DummyContainer;
851
852 // Take into account only points that belong to at least one cell.
853 double CellsBounds[6];
854
856
857private:
858 void Cleanup();
859
860private:
861 vtkPolyData(const vtkPolyData&) = delete;
862 void operator=(const vtkPolyData&) = delete;
863};
864
865//------------------------------------------------------------------------------
866inline void vtkPolyData::GetPointCells(vtkIdType ptId, vtkIdType& ncells, vtkIdType*& cells)
867{
868 ncells = this->Links->GetNcells(ptId);
869 cells = this->Links->GetCells(ptId);
870}
871
872//------------------------------------------------------------------------------
874{
875 return (this->GetNumberOfVerts() + this->GetNumberOfLines() + this->GetNumberOfPolys() +
876 this->GetNumberOfStrips());
877}
878
879//------------------------------------------------------------------------------
881{
882 if (!this->Cells)
883 {
884 this->BuildCells();
885 }
886 return static_cast<int>(this->Cells->GetTag(cellId).GetCellType());
887}
888
889//------------------------------------------------------------------------------
891{
892 if (!this->Cells)
893 {
894 this->BuildCells();
895 }
896 switch (this->GetCellType(cellId))
897 {
898 case VTK_EMPTY_CELL:
899 return 0;
900 case VTK_VERTEX:
901 return 1;
902 case VTK_LINE:
903 return 2;
904 case VTK_TRIANGLE:
905 return 3;
906 case VTK_QUAD:
907 return 4;
908 case VTK_POLY_VERTEX:
909 return this->Verts ? this->Verts->GetCellSize(this->GetCellIdRelativeToCellArray(cellId)) : 0;
910 case VTK_POLY_LINE:
911 return this->Lines ? this->Lines->GetCellSize(this->GetCellIdRelativeToCellArray(cellId)) : 0;
912 case VTK_POLYGON:
913 return this->Polys ? this->Polys->GetCellSize(this->GetCellIdRelativeToCellArray(cellId)) : 0;
915 return this->Strips ? this->Strips->GetCellSize(this->GetCellIdRelativeToCellArray(cellId))
916 : 0;
917 }
918 vtkWarningMacro(<< "Cell type not supported.");
919 return 0;
920}
921
922//------------------------------------------------------------------------------
923inline int vtkPolyData::IsTriangle(int v1, int v2, int v3)
924{
925 vtkIdType n1;
926 int i, j, tVerts[3];
927 vtkIdType* cells;
928 const vtkIdType* tVerts2;
929 vtkIdType n2;
930
931 tVerts[0] = v1;
932 tVerts[1] = v2;
933 tVerts[2] = v3;
934
935 for (i = 0; i < 3; i++)
936 {
937 this->GetPointCells(tVerts[i], n1, cells);
938 for (j = 0; j < n1; j++)
939 {
940 this->GetCellPoints(cells[j], n2, tVerts2);
941 if ((tVerts[0] == tVerts2[0] || tVerts[0] == tVerts2[1] || tVerts[0] == tVerts2[2]) &&
942 (tVerts[1] == tVerts2[0] || tVerts[1] == tVerts2[1] || tVerts[1] == tVerts2[2]) &&
943 (tVerts[2] == tVerts2[0] || tVerts[2] == tVerts2[1] || tVerts[2] == tVerts2[2]))
944 {
945 return 1;
946 }
947 }
948 }
949 return 0;
950}
951
952//------------------------------------------------------------------------------
954{
955 vtkIdType npts;
956 const vtkIdType* pts;
957
958 this->GetCellPoints(cellId, npts, pts);
959 for (vtkIdType i = 0; i < npts; i++)
960 {
961 if (pts[i] == ptId)
962 {
963 return 1;
964 }
965 }
966
967 return 0;
968}
969
970//------------------------------------------------------------------------------
972{
973 this->Links->DeletePoint(ptId);
974}
975
976//------------------------------------------------------------------------------
978{
979 this->Cells->GetTag(cellId).MarkDeleted();
980}
981
982//------------------------------------------------------------------------------
984{
985 const vtkIdType* pts;
986 vtkIdType npts;
987
988 this->GetCellPoints(cellId, npts, pts);
989 for (vtkIdType i = 0; i < npts; i++)
990 {
991 this->Links->RemoveCellReference(cellId, pts[i]);
992 }
993}
994
995//------------------------------------------------------------------------------
997{
998 const vtkIdType* pts;
999 vtkIdType npts;
1000
1001 this->GetCellPoints(cellId, npts, pts);
1002 for (vtkIdType i = 0; i < npts; i++)
1003 {
1004 this->Links->AddCellReference(cellId, pts[i]);
1005 }
1006}
1007
1008//------------------------------------------------------------------------------
1010{
1011 this->Links->ResizeCellList(ptId, size);
1012}
1013
1014//------------------------------------------------------------------------------
1016{
1017 switch (tag.GetTarget())
1018 {
1020 return this->Verts;
1022 return this->Lines;
1024 return this->Polys;
1026 return this->Strips;
1027 }
1028 return nullptr; // unreachable
1029}
1030
1031//------------------------------------------------------------------------------
1032inline void vtkPolyData::ReplaceCellPoint(vtkIdType cellId, vtkIdType oldPtId, vtkIdType newPtId)
1033{
1035 this->GetCellPoints(cellId, ids);
1036 for (vtkIdType i = 0; i < ids->GetNumberOfIds(); i++)
1037 {
1038 if (ids->GetId(i) == oldPtId)
1039 {
1040 ids->SetId(i, newPtId);
1041 break;
1042 }
1043 }
1044 this->ReplaceCell(cellId, static_cast<int>(ids->GetNumberOfIds()), ids->GetPointer(0));
1045}
1046
1047//------------------------------------------------------------------------------
1048inline unsigned char vtkPolyData::GetCellPoints(
1049 vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts)
1050{
1051 if (!this->Cells)
1052 {
1053 this->BuildCells();
1054 }
1055
1056 const TaggedCellId tag = this->Cells->GetTag(cellId);
1057 if (tag.IsDeleted())
1058 {
1059 npts = 0;
1060 pts = nullptr;
1061 return VTK_EMPTY_CELL;
1062 }
1063
1064 vtkCellArray* cells = this->GetCellArrayInternal(tag);
1065 cells->GetCellAtId(tag.GetCellId(), npts, pts);
1066 return tag.GetCellType();
1067}
1068
1069//------------------------------------------------------------------------------
1071 vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts, vtkIdList* ptIds)
1072{
1073 if (!this->Cells)
1074 {
1075 this->BuildCells();
1076 }
1077
1078 const TaggedCellId tag = this->Cells->GetTag(cellId);
1079 if (tag.IsDeleted())
1080 {
1081 npts = 0;
1082 pts = nullptr;
1083 }
1084
1085 vtkCellArray* cells = this->GetCellArrayInternal(tag);
1086 cells->GetCellAtId(tag.GetCellId(), npts, pts, ptIds);
1087}
1088
1089#endif
object to represent cell connectivity
Definition: vtkCellArray.h:296
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:150
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:165
general representation of visualization data
abstract class to specify dataset behavior
Definition: vtkDataSet.h:172
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
Definition: vtkEmptyCell.h:33
provides thread-safe access to cells
list of point or cell ids
Definition: vtkIdList.h:143
vtkIdType GetNumberOfIds() const noexcept
Return the number of id's in the list.
Definition: vtkIdList.h:169
void SetId(const vtkIdType i, const vtkIdType vtkid)
Set the id at location i.
Definition: vtkIdList.h:201
vtkIdType GetId(const vtkIdType i)
Return the id at location i.
Definition: vtkIdList.h:174
vtkIdType * GetPointer(const vtkIdType i)
Get a pointer to a particular data index.
Definition: vtkIdList.h:238
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:119
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
cell represents a 1D line
Definition: vtkLine.h:143
concrete class for storing a set of points
Definition: vtkPointSet.h:109
void GetCellPoints(vtkIdType, vtkIdList *idList) override
This method resets parameter idList, as there is no cell in a vtkPointSet.
Definition: vtkPointSet.h:184
void GetPointCells(vtkIdType, vtkIdList *idList) override
This method resets parameter idList, as there is no cell in a vtkPointSet.
Definition: vtkPointSet.h:185
vtkIdType GetCellSize(vtkIdType) override
This method always returns 1, as all cells are point in a pure vtkPointSet.
Definition: vtkPointSet.h:203
vtkIdType GetNumberOfCells() override
This method always returns 0, as there are no cells in a vtkPointSet.
Definition: vtkPointSet.h:168
int GetCellType(vtkIdType) override
This method always returns VTK_EMPTY_CELL, as there is no cell in a vtkPointSet.
Definition: vtkPointSet.h:197
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:200
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
Definition: vtkPolyData.h:826
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.
Definition: vtkPolyData.h:487
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)
Definition: vtkPolyData.h:1015
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.
Definition: vtkPolyData.h:983
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.
Definition: vtkPolyData.h:349
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:923
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
Definition: vtkPolyData.h:845
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
Definition: vtkPolyData.h:847
int GetCellType(vtkIdType cellId) override
Standard vtkDataSet interface.
Definition: vtkPolyData.h:880
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
Definition: vtkPolyData.h:837
vtkSmartPointer< vtkPolyLine > PolyLine
Definition: vtkPolyData.h:828
vtkIdType GetNumberOfStrips()
Return the number of primitives of a particular type held.
Definition: vtkPolyData.h:351
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.
Definition: vtkPolyData.h:350
void ShallowCopy(vtkDataObject *src) override
Shallow and Deep copy.
vtkSmartPointer< vtkCellArray > Strips
Definition: vtkPolyData.h:840
vtkSmartPointer< vtkQuad > Quad
Definition: vtkPolyData.h:830
void DeleteCell(vtkIdType cellId)
Mark a point/cell as deleted from this vtkPolyData.
Definition: vtkPolyData.h:977
vtkSmartPointer< vtkPolygon > Polygon
Definition: vtkPolyData.h:831
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
Definition: vtkPolyData.h:827
void ResizeCellList(vtkIdType ptId, int size)
Resize the list of cells using a particular point.
Definition: vtkPolyData.h:1009
virtual int GetPiece()
Get the piece and the number of pieces.
vtkTimeStamp CellsBoundsTime
Definition: vtkPolyData.h:855
virtual void SetLinks(vtkAbstractCellLinks *links)
Set/Get the links that you created possibly without using BuildLinks.
vtkIdType GetNumberOfCells() override
Standard vtkDataSet interface.
Definition: vtkPolyData.h:873
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
Definition: vtkPolyData.h:839
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:850
vtkCellArray * GetPolys()
Get the cell array defining polygons.
void AddCellReference(vtkIdType cellId)
Add references to cell in cell structure.
Definition: vtkPolyData.h:996
int GetDataObjectType() override
Return what type of dataset this is.
Definition: vtkPolyData.h:211
vtkSmartPointer< vtkCellArray > Lines
Definition: vtkPolyData.h:838
void GetCellEdgeNeighbors(vtkIdType cellId, vtkIdType p1, vtkIdType p2, vtkIdList *cellIds)
Get the neighbors at an edge.
vtkSmartPointer< vtkEmptyCell > EmptyCell
Definition: vtkPolyData.h:833
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.
Definition: vtkPolyData.h:348
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
Definition: vtkPolyData.h:825
int IsPointUsedByCell(vtkIdType ptId, vtkIdType cellId)
Determine whether a point is used by a particular cell.
Definition: vtkPolyData.h:953
void ReplaceCellPoint(vtkIdType cellId, vtkIdType oldPtId, vtkIdType newPtId)
Replace a point in the cell connectivity list with a different point.
Definition: vtkPolyData.h:1032
vtkSmartPointer< CellMap > Cells
Definition: vtkPolyData.h:844
void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) override
Efficient method to obtain cells using a particular point.
vtkSmartPointer< vtkTriangle > Triangle
Definition: vtkPolyData.h:829
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:971
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.
Definition: vtkPolyData.h:430
void BuildLinks(int initialSize=0)
Create upward links from points to cells that use each point.
vtkIdType GetCellSize(vtkIdType cellId) override
Standard vtkDataSet interface.
Definition: vtkPolyData.h:890
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:445
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:832
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:149
cell represents a set of 0D vertices
Definition: vtkPolyVertex.h:75
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:152
a cell that represents a 2D quadrilateral
Definition: vtkQuad.h:98
record modification and/or execution time
Definition: vtkTimeStamp.h:55
a cell that represents a triangle strip
a cell that represents a triangle
Definition: vtkTriangle.h:148
a cell that represents a 3D point
Definition: vtkVertex.h:103
@ 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_TRIANGLE_STRIP
Definition: vtkCellType.h:91
@ VTK_POLY_LINE
Definition: vtkCellType.h:89
@ VTK_TRIANGLE
Definition: vtkCellType.h:90
@ VTK_POLYGON
Definition: vtkCellType.h:92
@ VTK_EMPTY_CELL
Definition: vtkCellType.h:85
@ VTK_LINE
Definition: vtkCellType.h:88
@ VTK_QUAD
Definition: vtkCellType.h:94
@ VTK_VERTEX
Definition: vtkCellType.h:86
@ VTK_POLY_VERTEX
Definition: vtkCellType.h:87
int vtkIdType
Definition: vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
#define VTK_POLY_DATA
Definition: vtkType.h:77
#define VTK_SIZEHINT(...)