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=========================================================================*/
67
68#ifndef vtkPolyData_h
69#define vtkPolyData_h
70
71#include "vtkCommonDataModelModule.h" // For export macro
72#include "vtkPointSet.h"
73
74#include "vtkCellArray.h" // Needed for inline methods
75#include "vtkCellLinks.h" // Needed for inline methods
76#include "vtkPolyDataInternals.h" // Needed for inline methods
77
78class vtkVertex;
79class vtkPolyVertex;
80class vtkLine;
81class vtkPolyLine;
82class vtkTriangle;
83class vtkQuad;
84class vtkPolygon;
86class vtkEmptyCell;
87struct vtkPolyDataDummyContainter;
89
90class VTKCOMMONDATAMODEL_EXPORT vtkPolyData : public vtkPointSet
91{
92public:
93 static vtkPolyData* New();
95
96 vtkTypeMacro(vtkPolyData, vtkPointSet);
97 void PrintSelf(ostream& os, vtkIndent indent) override;
98
102 int GetDataObjectType() override { return VTK_POLY_DATA; }
103
107 void CopyStructure(vtkDataSet* ds) override;
108
110
113 vtkIdType GetNumberOfCells() override;
115 vtkCell* GetCell(vtkIdType cellId) override;
116 void GetCell(vtkIdType cellId, vtkGenericCell* cell) override;
117 int GetCellType(vtkIdType cellId) override;
118 vtkIdType GetCellSize(vtkIdType cellId) override;
119 void GetCellBounds(vtkIdType cellId, double bounds[6]) override;
120 void GetCellNeighbors(vtkIdType cellId, vtkIdList* ptIds, vtkIdList* cellIds) override;
122
130 void CopyCells(vtkPolyData* pd, vtkIdList* idList, vtkIncrementalPointLocator* locator = nullptr);
131
135 void GetCellPoints(vtkIdType cellId, vtkIdList* ptIds) override;
136
141 void GetPointCells(vtkIdType ptId, vtkIdList* cellIds) override;
142
162
168 void GetCellsBounds(double bounds[6]);
169
176 void Squeeze() override;
177
181 int GetMaxCellSize() override;
182
189
194
200
205
211
216
222
227
234
236
239 vtkIdType GetNumberOfVerts() { return (this->Verts ? this->Verts->GetNumberOfCells() : 0); }
240 vtkIdType GetNumberOfLines() { return (this->Lines ? this->Lines->GetNumberOfCells() : 0); }
241 vtkIdType GetNumberOfPolys() { return (this->Polys ? this->Polys->GetNumberOfCells() : 0); }
242 vtkIdType GetNumberOfStrips() { return (this->Strips ? this->Strips->GetNumberOfCells() : 0); }
244
254 bool AllocateEstimate(vtkIdType numCells, vtkIdType maxCellSize);
255
265 bool AllocateEstimate(vtkIdType numVerts, vtkIdType maxVertSize, vtkIdType numLines,
266 vtkIdType maxLineSize, vtkIdType numPolys, vtkIdType maxPolySize, vtkIdType numStrips,
267 vtkIdType maxStripSize);
268
278 bool AllocateExact(vtkIdType numCells, vtkIdType connectivitySize);
279
290 bool AllocateExact(vtkIdType numVerts, vtkIdType vertConnSize, vtkIdType numLines,
291 vtkIdType lineConnSize, vtkIdType numPolys, vtkIdType polyConnSize, vtkIdType numStrips,
292 vtkIdType stripConnSize);
293
303
313 bool AllocateProportional(vtkPolyData* pd, double ratio);
314
321 void Allocate(vtkIdType numCells = 1000, int vtkNotUsed(extSize) = 1000)
322 {
323 this->AllocateExact(numCells, numCells);
324 }
325
336 void Allocate(vtkPolyData* inPolyData, vtkIdType numCells = 1000, int vtkNotUsed(extSize) = 1000)
337 {
339 inPolyData, static_cast<double>(numCells) / inPolyData->GetNumberOfCells());
340 }
341
349 vtkIdType InsertNextCell(int type, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
350
359
364 void Reset();
365
374
378 bool NeedToBuildCells() { return this->Cells == nullptr; }
379
386 void BuildLinks(int initialSize = 0);
387
389
394 virtual void SetLinks(vtkAbstractCellLinks* links);
397
404
409
411
415 void GetPointCells(vtkIdType ptId, vtkIdType& ncells, vtkIdType*& cells)
416 VTK_SIZEHINT(cells, ncells);
418
425
437 unsigned char GetCellPoints(vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts)
438 VTK_SIZEHINT(pts, npts);
439
454 void GetCellPoints(vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts, vtkIdList* ptIds)
455 VTK_SIZEHINT(pts, npts) override;
456
461 int IsTriangle(int v1, int v2, int v3);
462
471
476 int IsPointUsedByCell(vtkIdType ptId, vtkIdType cellId);
477
486 void ReplaceCell(vtkIdType cellId, vtkIdList* ids);
487 void ReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
489
494 void ReplaceCellPoint(vtkIdType cellId, vtkIdType oldPtId, vtkIdType newPtId);
495
500 void ReverseCell(vtkIdType cellId);
501
503
507 void DeletePoint(vtkIdType ptId);
508 void DeleteCell(vtkIdType cellId);
510
520
522
531 vtkIdType InsertNextLinkedPoint(double x[3], int numLinks);
533
540 vtkIdType InsertNextLinkedCell(int type, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
541
551 void ReplaceLinkedCell(vtkIdType cellId, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
552
560 void RemoveCellReference(vtkIdType cellId);
561
569 void AddCellReference(vtkIdType cellId);
570
579
588
594 void ResizeCellList(vtkIdType ptId, int size);
595
599 void Initialize() override;
600
602
605 virtual int GetPiece();
606 virtual int GetNumberOfPieces();
608
612 virtual int GetGhostLevel();
613
622 unsigned long GetActualMemorySize() override;
623
625
628 void ShallowCopy(vtkDataObject* src) override;
629 void DeepCopy(vtkDataObject* src) override;
631
639
641
647
666 enum
667 {
675 };
676
678 int GetScalarFieldCriticalIndex(vtkIdType pointId, int fieldId);
679 int GetScalarFieldCriticalIndex(vtkIdType pointId, const char* fieldName);
680
689
694
704 unsigned char GetCell(vtkIdType cellId, const vtkIdType*& pts);
705
706protected:
708 ~vtkPolyData() override;
709
712
714
715 // constant cell objects returned by GetCell called.
725
726 // points inherited
727 // point data (i.e., scalars, vectors, normals, tcoords) inherited
732
733 // supporting structures for more complex topological operations
734 // built only when necessary
737
739
740 // dummy static member below used as a trick to simplify traversal
741 static vtkPolyDataDummyContainter DummyContainer;
742
743 // Take into account only points that belong to at least one cell.
744 double CellsBounds[6];
745
747
748private:
749 void Cleanup();
750
751private:
752 vtkPolyData(const vtkPolyData&) = delete;
753 void operator=(const vtkPolyData&) = delete;
754};
755
756//------------------------------------------------------------------------------
757inline void vtkPolyData::GetPointCells(vtkIdType ptId, vtkIdType& ncells, vtkIdType*& cells)
758{
759 ncells = this->Links->GetNcells(ptId);
760 cells = this->Links->GetCells(ptId);
761}
762
763//------------------------------------------------------------------------------
765{
766 return (this->GetNumberOfVerts() + this->GetNumberOfLines() + this->GetNumberOfPolys() +
767 this->GetNumberOfStrips());
768}
769
770//------------------------------------------------------------------------------
772{
773 if (!this->Cells)
774 {
775 this->BuildCells();
776 }
777 return static_cast<int>(this->Cells->GetTag(cellId).GetCellType());
778}
779
780//------------------------------------------------------------------------------
782{
783 if (!this->Cells)
784 {
785 this->BuildCells();
786 }
787 switch (this->GetCellType(cellId))
788 {
789 case VTK_EMPTY_CELL:
790 return 0;
791 case VTK_VERTEX:
792 return 1;
793 case VTK_LINE:
794 return 2;
795 case VTK_TRIANGLE:
796 return 3;
797 case VTK_QUAD:
798 return 4;
799 case VTK_POLY_VERTEX:
800 return this->Verts ? this->Verts->GetCellSize(this->GetCellIdRelativeToCellArray(cellId)) : 0;
801 case VTK_POLY_LINE:
802 return this->Lines ? this->Lines->GetCellSize(this->GetCellIdRelativeToCellArray(cellId)) : 0;
803 case VTK_POLYGON:
804 return this->Polys ? this->Polys->GetCellSize(this->GetCellIdRelativeToCellArray(cellId)) : 0;
806 return this->Strips ? this->Strips->GetCellSize(this->GetCellIdRelativeToCellArray(cellId))
807 : 0;
808 }
809 vtkWarningMacro(<< "Cell type not supported.");
810 return 0;
811}
812
813//------------------------------------------------------------------------------
814inline int vtkPolyData::IsTriangle(int v1, int v2, int v3)
815{
816 vtkIdType n1;
817 int i, j, tVerts[3];
818 vtkIdType* cells;
819 const vtkIdType* tVerts2;
820 vtkIdType n2;
821
822 tVerts[0] = v1;
823 tVerts[1] = v2;
824 tVerts[2] = v3;
825
826 for (i = 0; i < 3; i++)
827 {
828 this->GetPointCells(tVerts[i], n1, cells);
829 for (j = 0; j < n1; j++)
830 {
831 this->GetCellPoints(cells[j], n2, tVerts2);
832 if ((tVerts[0] == tVerts2[0] || tVerts[0] == tVerts2[1] || tVerts[0] == tVerts2[2]) &&
833 (tVerts[1] == tVerts2[0] || tVerts[1] == tVerts2[1] || tVerts[1] == tVerts2[2]) &&
834 (tVerts[2] == tVerts2[0] || tVerts[2] == tVerts2[1] || tVerts[2] == tVerts2[2]))
835 {
836 return 1;
837 }
838 }
839 }
840 return 0;
841}
842
843//------------------------------------------------------------------------------
845{
846 vtkIdType npts;
847 const vtkIdType* pts;
848
849 this->GetCellPoints(cellId, npts, pts);
850 for (vtkIdType i = 0; i < npts; i++)
851 {
852 if (pts[i] == ptId)
853 {
854 return 1;
855 }
856 }
857
858 return 0;
859}
860
861//------------------------------------------------------------------------------
863{
864 this->Links->DeletePoint(ptId);
865}
866
867//------------------------------------------------------------------------------
869{
870 this->Cells->GetTag(cellId).MarkDeleted();
871}
872
873//------------------------------------------------------------------------------
875{
876 const vtkIdType* pts;
877 vtkIdType npts;
878
879 this->GetCellPoints(cellId, npts, pts);
880 for (vtkIdType i = 0; i < npts; i++)
881 {
882 this->Links->RemoveCellReference(cellId, pts[i]);
883 }
884}
885
886//------------------------------------------------------------------------------
888{
889 const vtkIdType* pts;
890 vtkIdType npts;
891
892 this->GetCellPoints(cellId, npts, pts);
893 for (vtkIdType i = 0; i < npts; i++)
894 {
895 this->Links->AddCellReference(cellId, pts[i]);
896 }
897}
898
899//------------------------------------------------------------------------------
900inline void vtkPolyData::ResizeCellList(vtkIdType ptId, int size)
901{
902 this->Links->ResizeCellList(ptId, size);
903}
904
905//------------------------------------------------------------------------------
907{
908 switch (tag.GetTarget())
909 {
911 return this->Verts;
913 return this->Lines;
915 return this->Polys;
917 return this->Strips;
918 }
919 return nullptr; // unreachable
920}
921
922//------------------------------------------------------------------------------
923inline void vtkPolyData::ReplaceCellPoint(vtkIdType cellId, vtkIdType oldPtId, vtkIdType newPtId)
924{
926 this->GetCellPoints(cellId, ids);
927 for (vtkIdType i = 0; i < ids->GetNumberOfIds(); i++)
928 {
929 if (ids->GetId(i) == oldPtId)
930 {
931 ids->SetId(i, newPtId);
932 break;
933 }
934 }
935 this->ReplaceCell(cellId, static_cast<int>(ids->GetNumberOfIds()), ids->GetPointer(0));
936}
937
938//------------------------------------------------------------------------------
939inline unsigned char vtkPolyData::GetCellPoints(
940 vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts)
941{
942 if (!this->Cells)
943 {
944 this->BuildCells();
945 }
946
947 const TaggedCellId tag = this->Cells->GetTag(cellId);
948 if (tag.IsDeleted())
949 {
950 npts = 0;
951 pts = nullptr;
952 return VTK_EMPTY_CELL;
953 }
954
955 vtkCellArray* cells = this->GetCellArrayInternal(tag);
956 cells->GetCellAtId(tag.GetCellId(), npts, pts);
957 return tag.GetCellType();
958}
959
960//------------------------------------------------------------------------------
962 vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts, vtkIdList* ptIds)
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 }
975
976 vtkCellArray* cells = this->GetCellArrayInternal(tag);
977 cells->GetCellAtId(tag.GetCellId(), npts, pts, ptIds);
978}
979
980#endif
object to represent cell connectivity
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:61
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:34
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
cell represents a 1D line
Definition vtkLine.h:34
Allocate and hold a VTK object.
Definition vtkNew.h:62
T * GetPointer() const noexcept
Get a raw pointer to the contained object.
Definition vtkNew.h:151
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.
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.
double CellsBounds[6]
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.
vtkPolyData_detail::TaggedCellId TaggedCellId
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.
@ ERR_NON_MANIFOLD_STAR
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.
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.
vtkPolyData_detail::CellMap CellMap
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:40
cell represents a set of 0D vertices
a cell that represents an n-sided polygon
Definition vtkPolygon.h:43
a cell that represents a 2D quadrilateral
Definition vtkQuad.h:39
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:39
a cell that represents a 3D point
Definition vtkVertex.h:34
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
#define vtkDataArray
int vtkIdType
Definition vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287
#define VTK_POLY_DATA
Definition vtkType.h:77
#define VTK_SIZEHINT(...)