Updated cloud io functionality - removed dependency from VTK legacy
This commit is contained in:
@@ -61,10 +61,22 @@ void cv::viz::vtkXYZWriter::WriteData()
|
||||
if (!input)
|
||||
return;
|
||||
|
||||
// OpenVTKFile() will report any errors that happen
|
||||
ostream *outfilep = this->OpenVTKFile();
|
||||
if (!outfilep)
|
||||
if (!this->FileName )
|
||||
{
|
||||
vtkErrorMacro(<< "No FileName specified! Can't write!");
|
||||
this->SetErrorCode(vtkErrorCode::NoFileNameError);
|
||||
return;
|
||||
}
|
||||
|
||||
vtkDebugMacro(<<"Opening vtk file for writing...");
|
||||
ostream *outfilep = new ofstream(this->FileName, ios::out);
|
||||
if (outfilep->fail())
|
||||
{
|
||||
vtkErrorMacro(<< "Unable to open file: "<< this->FileName);
|
||||
this->SetErrorCode(vtkErrorCode::CannotOpenFileError);
|
||||
delete outfilep;
|
||||
return;
|
||||
}
|
||||
|
||||
ostream &outfile = *outfilep;
|
||||
|
||||
@@ -76,7 +88,8 @@ void cv::viz::vtkXYZWriter::WriteData()
|
||||
}
|
||||
|
||||
// Close the file
|
||||
this->CloseVTKFile(outfilep);
|
||||
vtkDebugMacro(<<"Closing vtk file\n");
|
||||
delete outfilep;
|
||||
|
||||
// Delete the file if an error occurred
|
||||
if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError)
|
||||
@@ -86,8 +99,24 @@ void cv::viz::vtkXYZWriter::WriteData()
|
||||
}
|
||||
}
|
||||
|
||||
int cv::viz::vtkXYZWriter::FillInputPortInformation(int, vtkInformation *info)
|
||||
{
|
||||
info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkPolyData");
|
||||
return 1;
|
||||
}
|
||||
|
||||
void cv::viz::vtkXYZWriter::PrintSelf(ostream& os, vtkIndent indent)
|
||||
{
|
||||
this->Superclass::PrintSelf(os,indent);
|
||||
os << indent << "DecimalPrecision: " << this->DecimalPrecision << "\n";
|
||||
}
|
||||
|
||||
vtkPolyData* cv::viz::vtkXYZWriter::GetInput()
|
||||
{
|
||||
return vtkPolyData::SafeDownCast(this->Superclass::GetInput());
|
||||
}
|
||||
|
||||
vtkPolyData* cv::viz::vtkXYZWriter::GetInput(int port)
|
||||
{
|
||||
return vtkPolyData::SafeDownCast(this->Superclass::GetInput(port));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user