Commit ec1d00df authored by Joachim Pouderoux's avatar Joachim Pouderoux Committed by Cory Quammen
Browse files

Fix code formating & style to VTK coding-style rules.

Change-Id: Id5b760ed9b3842284daf45ea1551f2759301efb3
parent f4ec97b3
......@@ -41,7 +41,8 @@ vtkXMLPDataWriter::vtkXMLPDataWriter()
// Setup a callback for the internal writer to report progress.
this->ProgressObserver = vtkCallbackCommand::New();
this->ProgressObserver->SetCallback(&vtkXMLPDataWriter::ProgressCallbackFunction);
this->ProgressObserver->SetCallback(
&vtkXMLPDataWriter::ProgressCallbackFunction);
this->ProgressObserver->SetClientData(this);
this->Controller = 0;
......@@ -62,7 +63,7 @@ vtkXMLPDataWriter::~vtkXMLPDataWriter()
//----------------------------------------------------------------------------
void vtkXMLPDataWriter::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
this->Superclass::PrintSelf(os, indent);
os << indent << "NumberOfPieces: " << this->NumberOfPieces << "\n";
os << indent << "StartPiece: " << this->StartPiece << "\n";
os << indent << "EndPiece: " << this->EndPiece << "\n";
......@@ -75,7 +76,7 @@ void vtkXMLPDataWriter::SetWriteSummaryFile(int flag)
{
vtkDebugMacro(<< this->GetClassName() << " ("
<< this << "): setting WriteSummaryFile to " << flag);
if(this->WriteSummaryFile != flag)
if (this->WriteSummaryFile != flag)
{
this->WriteSummaryFile = flag;
this->Modified();
......@@ -97,7 +98,7 @@ int vtkXMLPDataWriter::WriteInternal()
// Decide whether to write the summary file.
int writeSummary = 0;
if(this->WriteSummaryFile)
if (this->WriteSummaryFile)
{
if (!this->Controller || this->Controller->GetLocalProcessId() == 0)
{
......@@ -106,14 +107,13 @@ int vtkXMLPDataWriter::WriteInternal()
}
// Write the summary file if requested.
if(result && writeSummary)
if (result && writeSummary)
{
if(!this->Superclass::WriteInternal())
if (!this->Superclass::WriteInternal())
{
int i;
vtkErrorMacro("Ran out of disk space; deleting file(s) already written");
for (i = this->StartPiece; i < this->EndPiece; i++)
for (int i = this->StartPiece; i < this->EndPiece; i++)
{
char* fileName = this->CreatePieceFileName(i, this->PathName);
this->DeleteAFile(fileName);
......@@ -163,8 +163,7 @@ int vtkXMLPDataWriter::WriteData()
}
// Write the elements referencing each piece and its file.
int i;
for(i=0;i < this->NumberOfPieces; ++i)
for (int i = 0; i < this->NumberOfPieces; ++i)
{
os << nextIndent << "<Piece";
this->WritePPieceAttributes(i);
......@@ -178,12 +177,7 @@ int vtkXMLPDataWriter::WriteData()
os << indent << "</" << this->GetDataSetName() << ">\n";
this->EndFile();
if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError)
{
return 0;
}
return 1;
return (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError) ? 0 : 1;
}
//----------------------------------------------------------------------------
......@@ -220,17 +214,30 @@ void vtkXMLPDataWriter::SplitFileName()
#if defined(_WIN32)
// Convert to UNIX-style slashes.
for(s=begin;s != end;++s) { if(*s == '\\') { *s = '/'; } }
for (s = begin; s != end; ++s)
{
if (*s == '\\')
{
*s = '/';
}
}
#endif
// Extract the path name up to the last '/'.
if(this->PathName) { delete [] this->PathName; this->PathName = 0; }
char* rbegin = end-1;
char* rend = begin-1;
for(s=rbegin;s != rend;--s) { if(*s == '/') { break; } }
if(s >= begin)
delete [] this->PathName;
this->PathName = 0;
char* rbegin = end - 1;
char* rend = begin - 1;
for (s = rbegin; s != rend; --s)
{
if(*s == '/')
{
break;
}
}
if (s >= begin)
{
length = (s-begin)+1;
length = (s-begin) + 1;
this->PathName = new char[length+1];
strncpy(this->PathName, this->FileName, length);
this->PathName[length] = '\0';
......@@ -239,20 +246,27 @@ void vtkXMLPDataWriter::SplitFileName()
// "begin" now points at the beginning of the file name.
// Look for the first "." to pull off the longest extension.
delete [] this->FileNameExtension; this->FileNameExtension = 0;
for(s=begin; s != end; ++s) { if(*s == '.') { break; } }
if(s < end)
delete [] this->FileNameExtension;
this->FileNameExtension = 0;
for (s = begin; s != end; ++s)
{
if (*s == '.')
{
break;
}
}
if (s < end)
{
length = end-s;
this->FileNameExtension = new char[length+1];
length = end - s;
this->FileNameExtension = new char[length + 1];
strncpy(this->FileNameExtension, s, length);
this->FileNameExtension[length] = '\0';
end = s;
}
// "end" now points to end of the file name.
if(this->FileNameBase) { delete [] this->FileNameBase; }
length = end-begin;
delete [] this->FileNameBase;
length = end - begin;
this->FileNameBase = new char[length+1];
strncpy(this->FileNameBase, begin, length);
this->FileNameBase[length] = '\0';
......@@ -264,17 +278,20 @@ void vtkXMLPDataWriter::SplitFileName()
//----------------------------------------------------------------------------
char* vtkXMLPDataWriter::CreatePieceFileName(int index, const char* path)
{
vtksys_ios::ostringstream fn_with_warning_C4701;
if(path) { fn_with_warning_C4701 << path; }
fn_with_warning_C4701 << this->FileNameBase << "_" << index;
if(this->PieceFileNameExtension)
{ fn_with_warning_C4701 << this->PieceFileNameExtension; }
//if(this->FileNameExtension)
//{ fn_with_warning_C4701 << this->FileNameExtension; }
size_t len = fn_with_warning_C4701.str().length();
vtksys_ios::ostringstream s;
if (path)
{
s << path;
}
s << this->FileNameBase << "_" << index;
if (this->PieceFileNameExtension)
{
s << this->PieceFileNameExtension;
}
size_t len = s.str().length();
char *buffer = new char[len + 1];
strncpy(buffer, fn_with_warning_C4701.str().c_str(), len);
strncpy(buffer, s.str().c_str(), len);
buffer[len] = '\0';
return buffer;
......@@ -285,22 +302,21 @@ int vtkXMLPDataWriter::WritePieces()
{
// Split progress range by piece. Just assume all pieces are the
// same size.
float progressRange[2] = {0,0};
float progressRange[2] = { 0.f, 0.f };
this->GetProgressRange(progressRange);
// Write each piece from StartPiece to EndPiece.
int i;
for(i=this->StartPiece; i <= this->EndPiece; ++i)
for(int i = this->StartPiece; i <= this->EndPiece; ++i)
{
this->SetProgressRange(progressRange, i-this->StartPiece,
this->EndPiece-this->StartPiece+1);
if(!this->WritePiece(i))
this->EndPiece-this->StartPiece + 1);
if (!this->WritePiece(i))
{
// Writing a piece failed. Delete files for previous pieces and
// abort.
// Writing a piece failed.
// Delete files for previous pieces and abort.
vtkErrorMacro("Ran out of disk space; deleting file(s) already written");
for(int j=this->StartPiece; j < i; ++j)
for (int j = this->StartPiece; j < i; ++j)
{
char* fileName = this->CreatePieceFileName(j, this->PathName);
this->DeleteAFile(fileName);
......
......@@ -35,7 +35,7 @@ vtkXMLPImageDataWriter::~vtkXMLPImageDataWriter()
//----------------------------------------------------------------------------
void vtkXMLPImageDataWriter::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
this->Superclass::PrintSelf(os, indent);
}
//----------------------------------------------------------------------------
......@@ -77,7 +77,7 @@ void vtkXMLPImageDataWriter::WritePrimaryElementAttributes(ostream &os, vtkInden
//----------------------------------------------------------------------------
vtkXMLStructuredDataWriter*
vtkXMLPImageDataWriter::CreateStructuredPieceWriter()
vtkXMLPImageDataWriter::CreateStructuredPieceWriter()
{
// Create the writer for the piece.
vtkXMLImageDataWriter* pWriter = vtkXMLImageDataWriter::New();
......
......@@ -34,7 +34,7 @@ vtkXMLPPolyDataWriter::~vtkXMLPPolyDataWriter()
//----------------------------------------------------------------------------
void vtkXMLPPolyDataWriter::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
this->Superclass::PrintSelf(os, indent);
}
//----------------------------------------------------------------------------
......@@ -67,7 +67,7 @@ vtkXMLPPolyDataWriter::CreateUnstructuredPieceWriter()
//----------------------------------------------------------------------------
int vtkXMLPPolyDataWriter::FillInputPortInformation(
int vtkNotUsed(port), vtkInformation* info)
int, vtkInformation* info)
{
info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkPolyData");
return 1;
......
......@@ -35,10 +35,9 @@ vtkXMLPStructuredGridWriter::~vtkXMLPStructuredGridWriter()
//----------------------------------------------------------------------------
void vtkXMLPStructuredGridWriter::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
this->Superclass::PrintSelf(os, indent);
}
//----------------------------------------------------------------------------
vtkStructuredGrid* vtkXMLPStructuredGridWriter::GetInput()
{
......@@ -59,7 +58,7 @@ const char* vtkXMLPStructuredGridWriter::GetDefaultFileExtension()
//----------------------------------------------------------------------------
vtkXMLStructuredDataWriter*
vtkXMLPStructuredGridWriter::CreateStructuredPieceWriter()
vtkXMLPStructuredGridWriter::CreateStructuredPieceWriter()
{
// Create the writer for the piece.
vtkXMLStructuredGridWriter* pWriter = vtkXMLStructuredGridWriter::New();
......@@ -79,8 +78,9 @@ void vtkXMLPStructuredGridWriter::WritePData(vtkIndent indent)
this->WritePPoints(input->GetPoints(), indent);
}
//----------------------------------------------------------------------------
int vtkXMLPStructuredGridWriter::FillInputPortInformation(
int vtkNotUsed(port), vtkInformation* info)
int, vtkInformation* info)
{
info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkStructuredGrid");
return 1;
......
......@@ -35,7 +35,7 @@ vtkXMLPUnstructuredDataWriter::~vtkXMLPUnstructuredDataWriter()
//----------------------------------------------------------------------------
void vtkXMLPUnstructuredDataWriter::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
this->Superclass::PrintSelf(os, indent);
}
//----------------------------------------------------------------------------
......@@ -50,7 +50,7 @@ int vtkXMLPUnstructuredDataWriter::ProcessRequest(
vtkInformationVector** inputVector,
vtkInformationVector* outputVector)
{
if(request->Has(vtkStreamingDemandDrivenPipeline::REQUEST_UPDATE_EXTENT()))
if (request->Has(vtkStreamingDemandDrivenPipeline::REQUEST_UPDATE_EXTENT()))
{
vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
inInfo->Set(
......
......@@ -34,7 +34,7 @@ vtkXMLPUnstructuredGridWriter::~vtkXMLPUnstructuredGridWriter()
//----------------------------------------------------------------------------
void vtkXMLPUnstructuredGridWriter::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
this->Superclass::PrintSelf(os, indent);
}
//----------------------------------------------------------------------------
......@@ -57,7 +57,7 @@ const char* vtkXMLPUnstructuredGridWriter::GetDefaultFileExtension()
//----------------------------------------------------------------------------
vtkXMLUnstructuredDataWriter*
vtkXMLPUnstructuredGridWriter::CreateUnstructuredPieceWriter()
vtkXMLPUnstructuredGridWriter::CreateUnstructuredPieceWriter()
{
// Create the writer for the piece.
vtkXMLUnstructuredGridWriter* pWriter = vtkXMLUnstructuredGridWriter::New();
......@@ -67,7 +67,7 @@ vtkXMLPUnstructuredGridWriter::CreateUnstructuredPieceWriter()
//----------------------------------------------------------------------------
int vtkXMLPUnstructuredGridWriter::FillInputPortInformation(
int vtkNotUsed(port), vtkInformation* info)
int, vtkInformation* info)
{
info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkUnstructuredGridBase");
return 1;
......
......@@ -235,7 +235,7 @@ void vtkXMLCompositeDataReader::ReadXMLData()
// specified as relative paths.
std::string filePath = this->FileName;
std::string::size_type pos = filePath.find_last_of("/\\");
if(pos != filePath.npos)
if (pos != filePath.npos)
{
filePath = filePath.substr(0, pos);
}
......@@ -317,17 +317,17 @@ vtkDataSet* vtkXMLCompositeDataReader::ReadDataset(vtkXMLDataElement* xmlElem,
const char* filePath)
{
// Construct the name of the internal file.
std::string fileName;
const char* file = xmlElem->GetAttribute("file");
if (!file)
{
return NULL;
return 0;
}
if(!(file[0] == '/' || file[1] == ':'))
std::string fileName;
if (!(file[0] == '/' || file[1] == ':'))
{
fileName = filePath;
if(fileName.length())
if (fileName.length())
{
fileName += "/";
}
......@@ -348,7 +348,7 @@ vtkDataSet* vtkXMLCompositeDataReader::ReadDataset(vtkXMLDataElement* xmlElem,
this->Internal->ReaderList;
!rname && readerEntry->extension; ++readerEntry)
{
if(ext == readerEntry->extension)
if (ext == readerEntry->extension)
{
rname = readerEntry->name;
}
......@@ -393,7 +393,7 @@ int vtkXMLCompositeDataReader::RequestInformation(
//----------------------------------------------------------------------------
const vtkXMLCompositeDataReaderEntry
vtkXMLCompositeDataReaderInternals::ReaderList[] =
vtkXMLCompositeDataReaderInternals::ReaderList[] =
{
{"vtp", "vtkXMLPolyDataReader"},
{"vtu", "vtkXMLUnstructuredGridReader"},
......
......@@ -105,11 +105,11 @@ int vtkXMLCompositeDataWriter::ProcessRequest(
vtkInformationVector** inputVector,
vtkInformationVector* outputVector)
{
if(request->Has(vtkStreamingDemandDrivenPipeline::REQUEST_UPDATE_EXTENT()))
if (request->Has(vtkStreamingDemandDrivenPipeline::REQUEST_UPDATE_EXTENT()))
{
return this->RequestUpdateExtent(request, inputVector, outputVector);
}
if(request->Has(vtkDemandDrivenPipeline::REQUEST_DATA()))
if (request->Has(vtkDemandDrivenPipeline::REQUEST_DATA()))
{
return this->RequestData(request, inputVector, outputVector);
}
......@@ -120,7 +120,7 @@ int vtkXMLCompositeDataWriter::ProcessRequest(
//----------------------------------------------------------------------------
void vtkXMLCompositeDataWriter::SetWriteMetaFile(int flag)
{
if(this->WriteMetaFile != flag)
if (this->WriteMetaFile != flag)
{
this->WriteMetaFile = flag;
this->Modified();
......@@ -164,7 +164,7 @@ int vtkXMLCompositeDataWriter::RequestData(vtkInformation*,
this->SetErrorCode(vtkErrorCode::NoError);
// Make sure we have a file to write.
if(!this->Stream && !this->FileName)
if (!this->Stream && !this->FileName)
{
vtkErrorMacro("Writer called with no FileName set.");
this->SetErrorCode(vtkErrorCode::NoFileNameError);
......@@ -178,13 +178,13 @@ int vtkXMLCompositeDataWriter::RequestData(vtkInformation*,
this->UpdateProgress(0);
// Initialize progress range to entire 0..1 range.
float wholeProgressRange[2] = {0,1};
float wholeProgressRange[2] = { 0.f, 1.f };
this->SetProgressRange(wholeProgressRange, 0, 1);
// Prepare file prefix for creation of internal file names.
this->SplitFileName();
float progressRange[2] = {0,0};
float progressRange[2] = { 0.f, 0.f};
this->GetProgressRange(progressRange);
// Create the subdirectory for the internal files.
......@@ -195,7 +195,7 @@ int vtkXMLCompositeDataWriter::RequestData(vtkInformation*,
this->Internal->Root = vtkSmartPointer<vtkXMLDataElement>::New();
this->Internal->Root->SetName(compositeData->GetClassName());
int writerIdx=0;
int writerIdx = 0;
if (!this->WriteComposite(compositeData, this->Internal->Root, writerIdx))
{
this->RemoveWrittenFiles(subdir.c_str());
......@@ -283,7 +283,6 @@ int vtkXMLCompositeDataWriter::WriteData()
this->StartFile();
vtkIndent indent = vtkIndent().GetNextIndent();
// Open the primary element.
ostream& os = *(this->Stream);
......@@ -298,7 +297,7 @@ int vtkXMLCompositeDataWriter::WriteData()
//----------------------------------------------------------------------------
int vtkXMLCompositeDataWriter::WriteMetaFileIfRequested()
{
if(this->WriteMetaFile)
if (this->WriteMetaFile)
{
if (!this->Superclass::WriteInternal())
{
......@@ -311,22 +310,22 @@ int vtkXMLCompositeDataWriter::WriteMetaFileIfRequested()
//----------------------------------------------------------------------------
void vtkXMLCompositeDataWriter::MakeDirectory(const char* name)
{
if( !vtksys::SystemTools::MakeDirectory(name) )
if (!vtksys::SystemTools::MakeDirectory(name))
{
vtkErrorMacro( << "Sorry unable to create directory: " << name
vtkErrorMacro(<< "Sorry unable to create directory: " << name
<< endl << "Last systen error was: "
<< vtksys::SystemTools::GetLastSystemError().c_str() );
<< vtksys::SystemTools::GetLastSystemError().c_str());
}
}
//----------------------------------------------------------------------------
void vtkXMLCompositeDataWriter::RemoveADirectory(const char* name)
{
if( !vtksys::SystemTools::RemoveADirectory(name) )
if (!vtksys::SystemTools::RemoveADirectory(name))
{
vtkErrorMacro( << "Sorry unable to remove a directory: " << name
vtkErrorMacro(<< "Sorry unable to remove a directory: " << name
<< endl << "Last system error was: "
<< vtksys::SystemTools::GetLastSystemError().c_str() );
<< vtksys::SystemTools::GetLastSystemError().c_str());
}
}
......@@ -358,7 +357,7 @@ void vtkXMLCompositeDataWriter::FillDataTypes(vtkCompositeDataSet* hdInput)
vtkSmartPointer<vtkCompositeDataIterator> iter;
iter.TakeReference(hdInput->NewIterator());
vtkDataObjectTreeIterator* treeIter = vtkDataObjectTreeIterator::SafeDownCast(iter);
if(treeIter)
if (treeIter)
{
treeIter->VisitOnlyLeavesOn();
treeIter->TraverseSubTreeOn();
......@@ -390,7 +389,7 @@ void vtkXMLCompositeDataWriter::CreateWriters(vtkCompositeDataSet* hdInput)
vtkSmartPointer<vtkCompositeDataIterator> iter;
iter.TakeReference(hdInput->NewIterator());
vtkDataObjectTreeIterator* treeIter = vtkDataObjectTreeIterator::SafeDownCast(iter);
if(treeIter)
if (treeIter)
{
treeIter->VisitOnlyLeavesOn();
treeIter->TraverseSubTreeOn();
......@@ -406,13 +405,13 @@ void vtkXMLCompositeDataWriter::CreateWriters(vtkCompositeDataSet* hdInput)
this->Internal->Writers[i] = NULL;
vtkDataSet* ds = vtkDataSet::SafeDownCast(
iter->GetCurrentDataObject());
if(ds)
if (ds)
{
// Create a writer based on the type of this input.
switch (this->Internal->DataTypes[i])
{
case VTK_POLY_DATA:
if(!this->Internal->Writers[i].GetPointer() ||
if (!this->Internal->Writers[i].GetPointer() ||
(strcmp(this->Internal->Writers[i]->GetClassName(),
"vtkXMLPolyDataWriter") != 0))
{
......@@ -426,7 +425,7 @@ void vtkXMLCompositeDataWriter::CreateWriters(vtkCompositeDataSet* hdInput)
case VTK_STRUCTURED_POINTS:
case VTK_IMAGE_DATA:
case VTK_UNIFORM_GRID:
if(!this->Internal->Writers[i].GetPointer() ||
if (!this->Internal->Writers[i].GetPointer() ||
(strcmp(this->Internal->Writers[i]->GetClassName(),
"vtkXMLImageDataWriter") != 0))
{
......@@ -438,7 +437,7 @@ void vtkXMLCompositeDataWriter::CreateWriters(vtkCompositeDataSet* hdInput)
->SetInputData(ds);
break;
case VTK_UNSTRUCTURED_GRID:
if(!this->Internal->Writers[i].GetPointer() ||
if (!this->Internal->Writers[i].GetPointer() ||
(strcmp(this->Internal->Writers[i]->GetClassName(),
"vtkXMLUnstructuredGridWriter") != 0))
{
......@@ -450,7 +449,7 @@ void vtkXMLCompositeDataWriter::CreateWriters(vtkCompositeDataSet* hdInput)
this->Internal->Writers[i].GetPointer())->SetInputData(ds);
break;
case VTK_STRUCTURED_GRID:
if(!this->Internal->Writers[i].GetPointer() ||
if (!this->Internal->Writers[i].GetPointer() ||
(strcmp(this->Internal->Writers[i]->GetClassName(),
"vtkXMLStructuredGridWriter") != 0))
{
......@@ -462,7 +461,7 @@ void vtkXMLCompositeDataWriter::CreateWriters(vtkCompositeDataSet* hdInput)
this->Internal->Writers[i].GetPointer())->SetInputData(ds);
break;
case VTK_RECTILINEAR_GRID:
if(!this->Internal->Writers[i].GetPointer() ||
if (!this->Internal->Writers[i].GetPointer() ||
(strcmp(this->Internal->Writers[i]->GetClassName(),
"vtkXMLRectilinearGridWriter") != 0))
{
......@@ -478,7 +477,7 @@ void vtkXMLCompositeDataWriter::CreateWriters(vtkCompositeDataSet* hdInput)
}
// Copy settings to the writer.
if(vtkXMLWriter* w = this->Internal->Writers[i].GetPointer())
if (vtkXMLWriter* w = this->Internal->Writers[i].GetPointer())
{
w->SetDebug(this->GetDebug());
w->SetByteOrder(this->GetByteOrder());
......@@ -497,7 +496,7 @@ void vtkXMLCompositeDataWriter::CreateWriters(vtkCompositeDataSet* hdInput)
vtkXMLWriter* vtkXMLCompositeDataWriter::GetWriter(int index)
{
int size = static_cast<int>(this->Internal->Writers.size());
if(index >= 0 && index < size)
if (index >= 0 && index < size)
{
return this->Internal->Writers[index].GetPointer();
}
......@@ -512,7 +511,7 @@ void vtkXMLCompositeDataWriter::SplitFileName()
// Split the file name and extension from the path.
std::string::size_type pos = fileName.find_last_of("/\\");
if(pos != fileName.npos)
if (pos != fileName.npos)
{
// Keep the slash in the file path.
this->Internal->FilePath = fileName.substr(0, pos+1);
......@@ -526,7 +525,7 @@ void vtkXMLCompositeDataWriter::SplitFileName()
// Split the extension from the file name.
pos = name.find_last_of(".");
if(pos != name.npos)
if (pos != name.npos)
{
this->Internal->FilePrefix = name.substr(0, pos);
}
......@@ -559,7 +558,7 @@ void vtkXMLCompositeDataWriter::ProgressCallbackFunction(vtkObject* caller,
void*)
{
vtkAlgorithm* w = vtkAlgorithm::SafeDownCast(caller);
if(w)
if (w)
{
reinterpret_cast<vtkXMLCompositeDataWriter*>(clientdata)->ProgressCallback(w);
}
......@@ -568,11 +567,11 @@ void vtkXMLCompositeDataWriter::ProgressCallbackFunction(vtkObject* caller,
//----------------------------------------------------------------------------
void vtkXMLCompositeDataWriter::ProgressCallback(vtkAlgorithm* w)
{
float width = this->ProgressRange[1]-this->ProgressRange[0];
float width = this->ProgressRange[1] - this->ProgressRange[0];
float internalProgress = w->GetProgress();
float progress = this->ProgressRange[0] + internalProgress*width;
this->UpdateProgressDiscrete(progress);
if(this->AbortExecute)
if (this->AbortExecute)
{
w->SetAbortExecute(1);
}
......@@ -582,10 +581,9 @@ void vtkXMLCompositeDataWriter::ProgressCallback(vtkAlgorithm* w)
vtkStdString vtkXMLCompositeDataWriter::CreatePieceFileName(
int piece)
{
std::string fname;
if(this->Internal->DataTypes[piece] < 0)