Revision 3a6370bf39d14d68f194f1204ddf42fe2aa329d2 authored by Pierre Guillou on 11 October 2019, 13:16:44 UTC, committed by Pierre Guillou on 13 April 2022, 09:24:25 UTC
1 parent cdaa0c2
vtkSMCSVProxiesInitializationHelper.cxx
/*=========================================================================
Program: ParaView
Module: vtkSMCSVProxiesInitializationHelper.cxx
Copyright (c) Kitware, Inc.
All rights reserved.
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkSMCSVProxiesInitializationHelper.h"
#include "vtkObjectFactory.h"
#include "vtkSMProperty.h"
#include "vtkSMPropertyHelper.h"
#include "vtkSMProxy.h"
#include <cassert>
#include <vtksys/SystemTools.hxx>
vtkStandardNewMacro(vtkSMCSVProxiesInitializationHelper);
//----------------------------------------------------------------------------
vtkSMCSVProxiesInitializationHelper::vtkSMCSVProxiesInitializationHelper() = default;
//----------------------------------------------------------------------------
vtkSMCSVProxiesInitializationHelper::~vtkSMCSVProxiesInitializationHelper() = default;
//----------------------------------------------------------------------------
void vtkSMCSVProxiesInitializationHelper::PostInitializeProxy(
vtkSMProxy* proxy, vtkPVXMLElement*, vtkMTimeType)
{
std::string fileName = vtkSMPropertyHelper(proxy, "FileName").GetAsString();
if (vtksys::SystemTools::GetFilenameLastExtension(fileName) == ".tsv")
{
if (proxy->IsA("vtkSMWriterProxy"))
{ // exporter
vtkSMPropertyHelper(proxy, "FieldDelimiter").Set("\t");
}
else
{ // reader
vtkSMPropertyHelper(proxy, "AddTabFieldDelimiter").Set(1);
}
}
}
//----------------------------------------------------------------------------
void vtkSMCSVProxiesInitializationHelper::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}

Computing file changes ...