Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugin/MEDLoaderForPV/MEDFileFieldRepresentationTree.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ vtkUnstructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInt
vtkNew<vtkCellArray> cells;
vtkNew<vtkIdTypeArray> cells2;
AssignDataPointerOther<vtkIdTypeArray,DataArrayIdType>(cells2,cellsSafe,cellsSafe->getNbOfElems());
cells->SetCells(nbOfCells,cells2);
cells->ImportLegacyFormat(cells2);
if(faceLocationsOffsetSafe.isNotNull())
{
vtkNew<vtkIdTypeArray> faceLocationsOffset;
Expand Down
6 changes: 3 additions & 3 deletions plugin/MEDReaderIO/vtkExtractCellType.cxx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "vtkExtractCellType.h"

#include "vtkCell.h"
#include "vtkCellTypes.h"
#include "vtkCellTypeUtilities.h"
#include "vtkCompositeDataSet.h"
#include "vtkCompositeDataIterator.h"
#include "vtkDataArraySelection.h"
Expand Down Expand Up @@ -29,7 +29,7 @@ void vtkExtractCellType::AppendToGeoTypes(vtkDataSet* dataset)
vtkCell* cell = dataset->GetCell(i);

// TODO use MEDCoupling CellType API
const char* cellType = vtkCellTypes::GetClassNameFromTypeId(cell->GetCellType());
const char* cellType = vtkCellTypeUtilities::GetClassNameFromTypeId(cell->GetCellType());
if (!this->FieldSelection->ArrayExists(cellType))
{
this->FieldSelection->AddArray(cellType, false);
Expand All @@ -45,7 +45,7 @@ void vtkExtractCellType::SelectIds(vtkDataSet* dataset, vtkIdTypeArray* selArr)
vtkCell* cell = dataset->GetCell(i);

// TODO use MEDCoupling CellType API
const char* cellType = vtkCellTypes::GetClassNameFromTypeId(cell->GetCellType());
const char* cellType = vtkCellTypeUtilities::GetClassNameFromTypeId(cell->GetCellType());

// Needed as append to geotypes may not have been done in request information
// when loading state
Expand Down
9 changes: 3 additions & 6 deletions plugin/MEDReaderIO/vtkUgSelectCellIds.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ int vtkUgSelectCellIds::RequestData(vtkInformation *vtkNotUsed(request), vtkInfo
vtkNew<vtkIdTypeArray> outNodalConn;
vtkNew<vtkUnsignedCharArray> outCellTypes;
outCellTypes->SetNumberOfComponents(1); outCellTypes->SetNumberOfTuples(outputNbCells);
vtkNew<vtkIdTypeArray> outCellLocations;
outCellLocations->SetNumberOfComponents(1); outCellLocations->SetNumberOfTuples(outputNbCells);
vtkIdType outConnLgth(0);
for( const vtkIdType *cellId = _ids->GetPointer(0) ; cellId != _ids->GetPointer(outputNbCells) ; ++cellId )
{
Expand All @@ -83,12 +81,11 @@ int vtkUgSelectCellIds::RequestData(vtkInformation *vtkNotUsed(request), vtkInfo
}
}
outNodalConn->SetNumberOfComponents(1); outNodalConn->SetNumberOfTuples(outConnLgth);
vtkIdType *outConnPt(outNodalConn->GetPointer(0)),*outCellLocPt(outCellLocations->GetPointer(0));
vtkIdType *outConnPt(outNodalConn->GetPointer(0));
vtkIdType outCurCellLoc = 0;
unsigned char *outCellTypePt(outCellTypes->GetPointer(0));
for( const vtkIdType *cellId = _ids->GetPointer(0) ; cellId != _ids->GetPointer(outputNbCells) ; ++cellId )
{
outCellLocPt[0] = outCurCellLoc;
vtkIdType npts;
const vtkIdType *pts;
ds->GetCellPoints(*cellId, npts, pts);
Expand Down Expand Up @@ -120,8 +117,8 @@ int vtkUgSelectCellIds::RequestData(vtkInformation *vtkNotUsed(request), vtkInfo
outPointData->AddArray(outArray);
}
//
outCellArray->SetCells(outputNbCells,outNodalConn);
output->SetCells(outCellTypes,outCellLocations,outCellArray);
outCellArray->ImportLegacyFormat(outNodalConn);
output->SetCells(outCellTypes,outCellArray);
//
return 1;
}