Commit 00546098 authored by Mark Olesen's avatar Mark Olesen
Browse files

PV3FoamReader - remove old time-selection arrays

parent adb63eaa
#!/bin/sh
set -x
rm -r PV3FoamReader/Make
rm -rf PV3FoamReader/Make
wclean libso vtkPV3Foam
......@@ -31,26 +31,6 @@
<TimeRangeInformationHelper/>
</DoubleVectorProperty>
<!-- Update GUI check box -->
<IntVectorProperty
name="UpdateGUI"
command="SetUpdateGUI"
number_of_elements="1"
default_values="0">
<BooleanDomain
name="bool"/>
</IntVectorProperty>
<!-- Cache mesh check box -->
<IntVectorProperty
name="CacheMesh"
command="SetCacheMesh"
number_of_elements="1"
default_values="1">
<BooleanDomain
name="bool"/>
</IntVectorProperty>
<!-- ExtrapolateWalls check box -->
<IntVectorProperty
name="ExtrapolateWalls"
......@@ -186,34 +166,25 @@
</ArraySelectionDomain>
</StringVectorProperty>
<!-- Available times array -->
<!-- PV3FOAM_TIMESELECTION must be defined when compiling vtkPV3Foam
might discard this in the future
<StringVectorProperty
name="TimeArrayInfo"
information_only="1">
<ArraySelectionInformationHelper
attribute_name="Time"/>
</StringVectorProperty>
<StringVectorProperty
name="TimeStatus"
command="SetTimeArrayStatus"
number_of_elements="0"
repeat_command="1"
number_of_elements_per_command="2"
element_types="2 0"
information_property="TimeArrayInfo">
<ArraySelectionDomain
name="array_list">
<RequiredProperties>
<Property name="TimeArrayInfo"
function="ArrayList"/>
</RequiredProperties>
</ArraySelectionDomain>
</StringVectorProperty>
<!-- Cache mesh check box -->
<IntVectorProperty
name="CacheMesh"
command="SetCacheMesh"
number_of_elements="1"
default_values="1">
<BooleanDomain
name="bool"/>
</IntVectorProperty>
PV3FOAM_TIMESELECTION
-->
<!-- Update GUI check box -->
<IntVectorProperty
name="UpdateGUI"
command="SetUpdateGUI"
number_of_elements="1"
default_values="0">
<BooleanDomain
name="bool"/>
</IntVectorProperty>
</SourceProxy>
</ProxyGroup>
......
......@@ -21,32 +21,19 @@
// VTK includes
#include "vtkCallbackCommand.h"
#include "vtkCellArray.h"
#include "vtkCellData.h"
#include "vtkDataArraySelection.h"
#include "vtkDirectory.h"
#include "vtkDoubleArray.h"
#include "vtkErrorCode.h"
#include "vtkFloatArray.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkIntArray.h"
#include "vtkMultiBlockDataSet.h"
#include "vtkObjectFactory.h"
#include "vtkPoints.h"
#include "vtkRenderer.h"
#include "vtkSMRenderViewProxy.h"
#include "vtkStreamingDemandDrivenPipeline.h"
#include "vtkStringArray.h"
#include "vtkUnstructuredGrid.h"
#include "vtkUnstructuredGridAlgorithm.h"
#include "vtkAlgorithmOutput.h"
#include "vtkMultiBlockDataSet.h"
// Foam includes
#include "vtkPV3Foam.H"
vtkCxxRevisionMacro(vtkPV3FoamReader, "$Revision: 1.2$");
vtkCxxRevisionMacro(vtkPV3FoamReader, "$Revision: 1.5$");
vtkStandardNewMacro(vtkPV3FoamReader);
......@@ -60,17 +47,21 @@ vtkPV3FoamReader::vtkPV3FoamReader()
FileName = NULL;
foamData_ = NULL;
CacheMesh = 0;
UpdateGUI = 1;
UpdateGUIOld = 1;
TimeStep = 0;
TimeStepRange[0] = 0;
TimeStepRange[1] = 0;
CacheMesh = 0;
ExtrapolateWalls = 0;
IncludeSets = 0;
IncludeZones = 0;
ShowPatchNames = 0;
TimeSelection = vtkDataArraySelection::New();
UpdateGUI = 1;
UpdateGUIOld = 1;
RegionSelection = vtkDataArraySelection::New();
VolFieldSelection = vtkDataArraySelection::New();
PointFieldSelection = vtkDataArraySelection::New();
......@@ -85,11 +76,6 @@ vtkPV3FoamReader::vtkPV3FoamReader()
);
SelectionObserver->SetClientData(this);
TimeSelection->AddObserver
(
vtkCommand::ModifiedEvent,
this->SelectionObserver
);
RegionSelection->AddObserver
(
vtkCommand::ModifiedEvent,
......@@ -112,6 +98,7 @@ vtkPV3FoamReader::vtkPV3FoamReader()
);
}
vtkPV3FoamReader::~vtkPV3FoamReader()
{
vtkDebugMacro(<<"Deconstructor");
......@@ -126,7 +113,6 @@ vtkPV3FoamReader::~vtkPV3FoamReader()
delete [] FileName;
}
TimeSelection->RemoveObserver(this->SelectionObserver);
RegionSelection->RemoveObserver(this->SelectionObserver);
VolFieldSelection->RemoveObserver(this->SelectionObserver);
PointFieldSelection->RemoveObserver(this->SelectionObserver);
......@@ -134,7 +120,6 @@ vtkPV3FoamReader::~vtkPV3FoamReader()
SelectionObserver->Delete();
TimeSelection->Delete();
RegionSelection->Delete();
VolFieldSelection->Delete();
PointFieldSelection->Delete();
......@@ -152,7 +137,6 @@ int vtkPV3FoamReader::RequestInformation
{
vtkDebugMacro(<<"RequestInformation");
if (Foam::vtkPV3Foam::debug)
{
cout<<"REQUEST_INFORMATION\n";
......@@ -180,7 +164,7 @@ int vtkPV3FoamReader::RequestInformation
}
else
{
cout << "no output\n";
cout<< "no output\n";
}
this->GetExecutive()->GetOutputInformation(0)->Print(cout);
......@@ -189,7 +173,7 @@ int vtkPV3FoamReader::RequestInformation
cout<< "requestInfo with " << nInfo << " items:\n";
for (int i=0; i<nInfo; i++)
for (int i = 0; i < nInfo; ++i)
{
vtkInformation *info = outputVector->GetInformationObject(i);
info->Print(cout);
......@@ -230,7 +214,7 @@ int vtkPV3FoamReader::RequestInformation
timeRange[0] = timeSteps[0];
timeRange[1] = timeSteps[nTimeSteps-1];
if (Foam::vtkPV3Foam::debug)
if (Foam::vtkPV3Foam::debug > 1)
{
cout<<"nTimeSteps " << nTimeSteps << "\n";
cout<<"timeRange " << timeRange[0] << " to " << timeRange[1] << "\n";
......@@ -271,20 +255,15 @@ int vtkPV3FoamReader::RequestData
return 0;
}
if (Foam::vtkPV3Foam::debug)
{
int nInfo = outputVector->GetNumberOfInformationObjects();
if (Foam::vtkPV3Foam::debug)
{
cout<<"requestData with " << nInfo << " items\n";
}
for (int i=0; i<nInfo; i++)
cout<<"requestData with " << nInfo << " items\n";
for (int i = 0; i < nInfo; ++i)
{
vtkInformation *info = outputVector->GetInformationObject(i);
if (Foam::vtkPV3Foam::debug)
{
info->Print(cout);
}
info->Print(cout);
}
}
......@@ -330,7 +309,7 @@ int vtkPV3FoamReader::RequestData
}
else
{
cout << "no data_object\n";
cout<< "no data_object\n";
}
}
......@@ -447,67 +426,12 @@ void vtkPV3FoamReader::PrintSelf
}
vtkDataArraySelection* vtkPV3FoamReader::GetTimeSelection()
{
vtkDebugMacro(<<"GetTimeSelection");
return TimeSelection;
}
int vtkPV3FoamReader::GetNumberOfTimeArrays()
{
vtkDebugMacro(<<"GetNumberOf TimeArrays");
return TimeSelection->GetNumberOfArrays();
}
const char* vtkPV3FoamReader::GetTimeArrayName
(
int index
)
{
vtkDebugMacro(<<"GetTimeArrayName");
return TimeSelection->GetArrayName(index);
}
int vtkPV3FoamReader::GetTimeArrayStatus
(
const char* name
)
{
vtkDebugMacro(<<"GetTimeArrayStatus");
return TimeSelection->ArrayIsEnabled(name);
}
void vtkPV3FoamReader::SetTimeArrayStatus
(
const char* name,
int status
)
{
vtkDebugMacro(<<"SetTimeArrayStatus");
if (status)
{
TimeSelection->EnableArray(name);
}
else
{
TimeSelection->DisableArray(name);
}
}
// ----------------------------------------------------------------------
// Region selection list control
vtkDataArraySelection* vtkPV3FoamReader::GetRegionSelection()
{
vtkDebugMacro(<<"GetRegionSelection");
return RegionSelection;
}
......@@ -515,42 +439,29 @@ vtkDataArraySelection* vtkPV3FoamReader::GetRegionSelection()
int vtkPV3FoamReader::GetNumberOfRegionArrays()
{
vtkDebugMacro(<<"GetNumberOfRegionArrays");
return RegionSelection->GetNumberOfArrays();
}
const char* vtkPV3FoamReader::GetRegionArrayName
(
int index
)
const char* vtkPV3FoamReader::GetRegionArrayName(int index)
{
vtkDebugMacro(<<"GetRegionArrayName");
return RegionSelection->GetArrayName(index);
}
int vtkPV3FoamReader::GetRegionArrayStatus
(
const char* name
)
int vtkPV3FoamReader::GetRegionArrayStatus(const char* name)
{
vtkDebugMacro(<<"GetRegionArrayStatus");
return RegionSelection->ArrayIsEnabled(name);
}
void vtkPV3FoamReader::SetRegionArrayStatus
(
const char* name,
int status
)
void vtkPV3FoamReader::SetRegionArrayStatus(const char* name, int status)
{
vtkDebugMacro(<<"SetRegionArrayStatus");
if(status)
if (status)
{
RegionSelection->EnableArray(name);
}
......@@ -561,6 +472,9 @@ void vtkPV3FoamReader::SetRegionArrayStatus
}
// ----------------------------------------------------------------------
// volField selection list control
vtkDataArraySelection* vtkPV3FoamReader::GetVolFieldSelection()
{
vtkDebugMacro(<<"GetVolFieldSelection");
......@@ -577,10 +491,7 @@ int vtkPV3FoamReader::GetNumberOfVolFieldArrays()
}
const char* vtkPV3FoamReader::GetVolFieldArrayName
(
int index
)
const char* vtkPV3FoamReader::GetVolFieldArrayName(int index)
{
vtkDebugMacro(<<"GetVolFieldArrayName");
......@@ -588,10 +499,7 @@ const char* vtkPV3FoamReader::GetVolFieldArrayName
}
int vtkPV3FoamReader::GetVolFieldArrayStatus
(
const char* name
)
int vtkPV3FoamReader::GetVolFieldArrayStatus(const char* name)
{
vtkDebugMacro(<<"GetVolFieldArrayStatus");
......@@ -599,11 +507,7 @@ int vtkPV3FoamReader::GetVolFieldArrayStatus
}
void vtkPV3FoamReader::SetVolFieldArrayStatus
(
const char* name,
int status
)
void vtkPV3FoamReader::SetVolFieldArrayStatus(const char* name, int status)
{
vtkDebugMacro(<<"SetVolFieldArrayStatus");
......@@ -618,6 +522,9 @@ void vtkPV3FoamReader::SetVolFieldArrayStatus
}
// ----------------------------------------------------------------------
// pointField selection list control
vtkDataArraySelection* vtkPV3FoamReader::GetPointFieldSelection()
{
vtkDebugMacro(<<"GetPointFieldSelection");
......@@ -634,10 +541,7 @@ int vtkPV3FoamReader::GetNumberOfPointFieldArrays()
}
const char* vtkPV3FoamReader::GetPointFieldArrayName
(
int index
)
const char* vtkPV3FoamReader::GetPointFieldArrayName(int index)
{
vtkDebugMacro(<<"GetPointFieldArrayName");
......@@ -645,10 +549,7 @@ const char* vtkPV3FoamReader::GetPointFieldArrayName
}
int vtkPV3FoamReader::GetPointFieldArrayStatus
(
const char* name
)
int vtkPV3FoamReader::GetPointFieldArrayStatus(const char* name)
{
vtkDebugMacro(<<"GetPointFieldArrayStatus");
......@@ -656,11 +557,7 @@ int vtkPV3FoamReader::GetPointFieldArrayStatus
}
void vtkPV3FoamReader::SetPointFieldArrayStatus
(
const char* name,
int status
)
void vtkPV3FoamReader::SetPointFieldArrayStatus(const char* name, int status)
{
vtkDebugMacro(<<"SetPointFieldArrayStatus");
......@@ -675,6 +572,9 @@ void vtkPV3FoamReader::SetPointFieldArrayStatus
}
// ----------------------------------------------------------------------
// lagrangianField selection list control
vtkDataArraySelection* vtkPV3FoamReader::GetLagrangianFieldSelection()
{
vtkDebugMacro(<<"GetLagrangianFieldSelection");
......@@ -691,10 +591,7 @@ int vtkPV3FoamReader::GetNumberOfLagrangianFieldArrays()
}
const char* vtkPV3FoamReader::GetLagrangianFieldArrayName
(
int index
)
const char* vtkPV3FoamReader::GetLagrangianFieldArrayName(int index)
{
vtkDebugMacro(<<"GetLagrangianFieldArrayName");
......@@ -702,10 +599,7 @@ const char* vtkPV3FoamReader::GetLagrangianFieldArrayName
}
int vtkPV3FoamReader::GetLagrangianFieldArrayStatus
(
const char* name
)
int vtkPV3FoamReader::GetLagrangianFieldArrayStatus(const char* name)
{
vtkDebugMacro(<<"GetLagrangianFieldArrayStatus");
......@@ -731,6 +625,7 @@ void vtkPV3FoamReader::SetLagrangianFieldArrayStatus
}
}
// ----------------------------------------------------------------------
void vtkPV3FoamReader::SelectionModifiedCallback
(
......@@ -751,3 +646,4 @@ void vtkPV3FoamReader::SelectionModified()
Modified();
}
// ************************************************************************* //
......@@ -14,11 +14,9 @@
=========================================================================*/
// .NAME vtkPV3FoamReader - reads a dataset in OpenFOAM format
// .SECTION Description
// vtkPV3FoamReader creates an multiblock dataset. It reads a controlDict
// file, mesh information, and time dependent data. The controlDict file
// contains timestep information. The polyMesh folders contain mesh information
// The time folders contain transient data for the cells Each folder can
// contain any number of data files.
// vtkPV3FoamReader creates an multiblock dataset.
// It uses the OpenFOAM infrastructure (fvMesh, etc) to
// handle mesh and field data.
#ifndef __vtkPV3FoamReader_h
#define __vtkPV3FoamReader_h
......@@ -66,6 +64,13 @@ public:
vtkSetStringMacro(FileName);
vtkGetStringMacro(FileName);
// Time control
// Set/Get the timestep and the timestep range
vtkSetMacro(TimeStep, int);
vtkGetMacro(TimeStep, int);
vtkSetVector2Macro(TimeStepRange, int);
vtkGetVector2Macro(TimeStepRange, int);
// GUI update control
vtkSetMacro(UpdateGUI, int);
vtkGetMacro(UpdateGUI, int);
......@@ -86,24 +91,10 @@ public:
vtkSetMacro(IncludeZones, int);
vtkGetMacro(IncludeZones, int);
// FOAM patch names control
// FOAM display patch names control
vtkSetMacro(ShowPatchNames, int);
vtkGetMacro(ShowPatchNames, int);
// Time-step slider control
vtkSetMacro(TimeStep, int);
vtkGetMacro(TimeStep, int);
vtkSetVector2Macro(TimeStepRange, int);
vtkGetVector2Macro(TimeStepRange, int);
// Time selection list control
vtkDataArraySelection* GetTimeSelection();
int GetNumberOfTimeArrays();
const char* GetTimeArrayName(int index);
int GetTimeArrayStatus(const char* name);
void SetTimeArrayStatus(const char* name, int status);
// Region selection list control
vtkDataArraySelection* GetRegionSelection();
int GetNumberOfRegionArrays();
......@@ -121,16 +112,16 @@ public:
// pointField selection list control
vtkDataArraySelection* GetPointFieldSelection();
int GetNumberOfPointFieldArrays();
const char* GetPointFieldArrayName(int index);
int GetPointFieldArrayStatus(const char* name);
void SetPointFieldArrayStatus(const char* name, int status);
const char* GetPointFieldArrayName(int index);
// lagrangianField selection list control
vtkDataArraySelection* GetLagrangianFieldSelection();
int GetNumberOfLagrangianFieldArrays();
const char* GetLagrangianFieldArrayName(int index);
int GetLagrangianFieldArrayStatus(const char* name);
void SetLagrangianFieldArrayStatus(const char* name, int status);
const char* GetLagrangianFieldArrayName(int index);
// Callback registered with the SelectionObserver
// for all the selection lists
......@@ -182,7 +173,11 @@ private:
//- Remove patch names from the view
void removePatchNamesFromView();
int TimeStep;
int TimeStepRange[2];
int CacheMesh;
int ExtrapolateWalls;
int IncludeSets;
int IncludeZones;
......@@ -190,10 +185,7 @@ private:
int UpdateGUI;
int UpdateGUIOld;
int TimeStep;
int TimeStepRange[2];
vtkDataArraySelection* TimeSelection;
vtkDataArraySelection* RegionSelection;
vtkDataArraySelection* VolFieldSelection;
vtkDataArraySelection* PointFieldSelection;
......@@ -204,4 +196,8 @@ private:
//ETX
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
EXE_INC = \
/* -DPV3FOAM_TIMESELECTION */ \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
......