theFaceLocations->InsertNextValue(theFaces->GetMaxId() + 1);
// insert cell connectivity and faces stream
- vtkIdType nfaces = 0;
- vtkIdType* face = 0;
+ vtkIdType nfaces = 0;
+ const vtkIdType* face = 0;
vtkIdType realnpts;
theInput->GetFaceStream(theCellId, nfaces, face);
vtkUnstructuredGrid::DecomposeAPolyhedronCell(
aCellLocationsArray->SetNumberOfComponents(1);
aCellLocationsArray->SetNumberOfTuples(newNbElems);
aConnectivity->InitTraversal();
- for(vtkIdType i = 0, *pts, npts; aConnectivity->GetNextCell(npts,pts); i++){
+ vtkIdType const *pts(nullptr);
+ for(vtkIdType i = 0, npts; aConnectivity->GetNextCell(npts,pts); i++){
aCellLocationsArray->SetValue(i,aConnectivity->GetTraversalLocation(npts));
}
#if VTK_XVERSION > 50700
aCellLocationsArray->SetNumberOfComponents(1);
aCellLocationsArray->SetNumberOfTuples( newNbElems );
aConnectivity->InitTraversal();
- for(vtkIdType i = 0, *pts, npts; aConnectivity->GetNextCell(npts,pts); i++){
+ vtkIdType const *pts(nullptr);
+ for(vtkIdType i = 0, npts; aConnectivity->GetNextCell(npts,pts); i++){
aCellLocationsArray->SetValue(i,aConnectivity->GetTraversalLocation(npts));
}
#if VTK_XVERSION > 50700
static inline bool toShowEdge( vtkIdType id1, vtkIdType id2, vtkIdType cellId, vtkUnstructuredGrid* input )
{
// return true if the given cell is the 1st among cells including the edge
- vtkCellLinks * links = input->GetCellLinks();
+ vtkCellLinks * links = static_cast<vtkCellLinks *>(input->GetCellLinks());
if ( !links ) {
input->BuildLinks();
- links = input->GetCellLinks();
+ links = static_cast<vtkCellLinks *>(input->GetCellLinks());
}
if ( id1 < id2 )
std::swap( id1, id2 );
{
if ( cells[iCell] == cellId )
return true;
- input->GetCellPoints( cells[iCell], npts, cellPts );
+ vtkIdType const *tmp(nullptr);
+ input->GetCellPoints( cells[iCell], npts, tmp );
+ std::copy(tmp, tmp+npts, cellPts);
for ( vtkIdType i = 0; i < npts && !found; ++i )
found = ( cellPts[i] == id2 );
iCell += ( !found );
int i;
int allVisible;
vtkIdType npts = 0;
- vtkIdType *pts = 0;
+ vtkIdType const *pts = 0;
vtkPoints *p = input->GetPoints();
vtkIdType numCells=input->GetNumberOfCells();
vtkPointData *pd = input->GetPointData();
char *cellVis;
vtkIdType newCellId;
- int faceId, *faceVerts, *edgeVerts, numFacePts;
+ int faceId, numFacePts;
double *x;
vtkIdType PixelConvert[4];
// Change the type from int to vtkIdType in order to avoid compilation errors while using VTK
aCellType = VTK_LINE;
for ( int edgeID = 0; edgeID < 6; ++edgeID )
{
- edgeVerts = vtkTetra::GetEdgeArray( edgeID );
+ const int *edgeVerts = vtkTetra::GetEdgeArray( edgeID );
if ( toShowEdge( pts[edgeVerts[0]], pts[edgeVerts[1]], cellId, input ))
{
aNewPts[0] = pts[edgeVerts[0]];
for (faceId = 0; faceId < 4; faceId++)
{
faceIds->Reset();
- faceVerts = vtkTetra::GetFaceArray(faceId);
+ const int *faceVerts = vtkTetra::GetFaceArray(faceId);
faceIds->InsertNextId(pts[faceVerts[0]]);
faceIds->InsertNextId(pts[faceVerts[1]]);
faceIds->InsertNextId(pts[faceVerts[2]]);
aCellType = VTK_LINE;
for ( int edgeID = 0; edgeID < 12; ++edgeID )
{
- edgeVerts = vtkVoxel::GetEdgeArray( edgeID );
+ const int *edgeVerts = vtkVoxel::GetEdgeArray( edgeID );
if ( toShowEdge( pts[edgeVerts[0]], pts[edgeVerts[1]], cellId, input ))
{
aNewPts[0] = pts[edgeVerts[0]];
for (faceId = 0; faceId < 6; faceId++)
{
faceIds->Reset();
- faceVerts = vtkVoxel::GetFaceArray(faceId);
+ const int *faceVerts = vtkVoxel::GetFaceArray(faceId);
faceIds->InsertNextId(pts[faceVerts[0]]);
faceIds->InsertNextId(pts[faceVerts[1]]);
faceIds->InsertNextId(pts[faceVerts[2]]);
aCellType = VTK_LINE;
for ( int edgeID = 0; edgeID < 12; ++edgeID )
{
- edgeVerts = vtkHexahedron::GetEdgeArray( edgeID );
+ const int *edgeVerts = vtkHexahedron::GetEdgeArray( edgeID );
if ( toShowEdge( pts[edgeVerts[0]], pts[edgeVerts[1]], cellId, input ))
{
aNewPts[0] = pts[edgeVerts[0]];
for (faceId = 0; faceId < 6; faceId++)
{
faceIds->Reset();
- faceVerts = vtkHexahedron::GetFaceArray(faceId);
+ const int *faceVerts = vtkHexahedron::GetFaceArray(faceId);
faceIds->InsertNextId(pts[faceVerts[0]]);
faceIds->InsertNextId(pts[faceVerts[1]]);
faceIds->InsertNextId(pts[faceVerts[2]]);
aCellType = VTK_LINE;
for ( int edgeID = 0; edgeID < 9; ++edgeID )
{
- edgeVerts = vtkWedge::GetEdgeArray( edgeID );
+ const int *edgeVerts = vtkWedge::GetEdgeArray( edgeID );
if ( toShowEdge( pts[edgeVerts[0]], pts[edgeVerts[1]], cellId, input ))
{
aNewPts[0] = pts[edgeVerts[0]];
for (faceId = 0; faceId < 5; faceId++)
{
faceIds->Reset();
- faceVerts = vtkWedge::GetFaceArray(faceId);
+ const int *faceVerts = vtkWedge::GetFaceArray(faceId);
faceIds->InsertNextId(pts[faceVerts[0]]);
faceIds->InsertNextId(pts[faceVerts[1]]);
faceIds->InsertNextId(pts[faceVerts[2]]);
aCellType = VTK_LINE;
for ( int edgeID = 0; edgeID < 18; ++edgeID )
{
- edgeVerts = vtkHexagonalPrism::GetEdgeArray( edgeID );
+ const int *edgeVerts = vtkHexagonalPrism::GetEdgeArray( edgeID );
if ( toShowEdge( pts[edgeVerts[0]], pts[edgeVerts[1]], cellId, input ))
{
aNewPts[0] = pts[edgeVerts[0]];
#endif
for (faceId = 0; faceId < 8; faceId++)
{
- faceVerts = vtkHexagonalPrism::GetFaceArray(faceId);
+ const int *faceVerts = vtkHexagonalPrism::GetFaceArray(faceId);
faceIds->Reset();
faceIds->InsertNextId(pts[faceVerts[0]]);
faceIds->InsertNextId(pts[faceVerts[1]]);
aCellType = VTK_LINE;
for ( int edgeID = 0; edgeID < 8; ++edgeID )
{
- edgeVerts = vtkPyramid::GetEdgeArray( edgeID );
+ const int *edgeVerts = vtkPyramid::GetEdgeArray( edgeID );
if ( toShowEdge( pts[edgeVerts[0]], pts[edgeVerts[1]], cellId, input ))
{
aNewPts[0] = pts[edgeVerts[0]];
for (faceId = 0; faceId < 5; faceId++)
{
faceIds->Reset();
- faceVerts = vtkPyramid::GetFaceArray(faceId);
+ const int *faceVerts = vtkPyramid::GetFaceArray(faceId);
faceIds->InsertNextId(pts[faceVerts[0]]);
faceIds->InsertNextId(pts[faceVerts[1]]);
faceIds->InsertNextId(pts[faceVerts[2]]);
case VTK_POLYHEDRON:
{
vtkIdType nFaces = 0;
- vtkIdType* ptIds = 0;
+ const vtkIdType* ptIds = 0;
int idp = 0;
input->GetFaceStream(cellId, nFaces, ptIds);
#ifdef SHOW_COINCIDING_3D_PAL21924
if ( cell->GetCellDimension() == 1 ) {
vtkIdType arcResult = -1;
if(myIsBuildArc) {
- arcResult = Build1DArc(cellId, input, output, pts, myMaxArcAngle);
+ arcResult = Build1DArc(cellId, input, output, const_cast<vtkIdType *>(pts), myMaxArcAngle);
newCellId = arcResult;
}
switch(aCellType) {
case VTK_QUADRATIC_EDGE:
{
- vtkIdType arcResult =-1;
+ vtkIdType arcResult = -1;
if(myIsBuildArc) {
- arcResult = Build1DArc(cellId, input, output, pts,myMaxArcAngle);
- newCellId = arcResult;
+ arcResult = Build1DArc(cellId, input, output, const_cast<vtkIdType *>(pts), myMaxArcAngle);
+ newCellId = arcResult;
}
if(!myIsBuildArc || arcResult == -1) {
aCellType = VTK_POLY_LINE;