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

PV3blockMeshReader - added display of curvedEdges

parent dfa52b08
vtkPV3FoamBlockMesh.C
vtkPV3FoamBlockMeshConvert.C
vtkPV3FoamBlockMeshUtils.C
LIB = $(FOAM_LIBBIN)/libvtkPV3FoamBlockMesh
......@@ -7,6 +7,6 @@ vtkPV3FoamMeshSet.C
vtkPV3FoamMeshVolume.C
vtkPV3FoamMeshZone.C
vtkPV3FoamUpdateInfo.C
vtkPV3FoamUtilities.C
vtkPV3FoamUtils.C
LIB = $(FOAM_LIBBIN)/libvtkPV3Foam
......@@ -45,7 +45,7 @@ SourceFiles
vtkPV3FoamPoints.H
vtkPV3FoamUpdateInfo.C
vtkPV3FoamUpdateInfoFields.H
vtkPV3FoamUtilities.C
vtkPV3FoamUtils.C
vtkPV3FoamVolFields.H
vtkPV3FoamAddToSelection.H
......@@ -315,7 +315,7 @@ class vtkPV3Foam
vtkDataSet* dataset,
const partInfo&,
const label datasetNo,
const string& datasetName
const std::string& datasetName
);
// Convenience method use to convert the readers from VTK 5
......
......@@ -77,7 +77,7 @@ void Foam::vtkPV3Foam::AddToBlock
vtkDataSet* dataset,
const partInfo& selector,
const label datasetNo,
const string& datasetName
const std::string& datasetName
)
{
const int blockNo = selector.block();
......
......@@ -2,7 +2,7 @@
cd ${0%/*} || exit 1 # run from this directory
set -x
rm -rf PV3FoamBlockMeshReader/Make
wclean libso vtkPV3FoamBlockMesh
rm -rf PV3blockMeshReader/Make
wclean libso vtkPV3blockMesh
# ----------------------------------------------------------------- end-of-file
......@@ -6,9 +6,9 @@ if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ]
then
case "$ParaView_VERSION" in
3*)
wmake libso vtkPV3FoamBlockMesh
wmake libso vtkPV3blockMesh
(
cd PV3FoamBlockMeshReader
cd PV3blockMeshReader
mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1
cd Make/$WM_OPTIONS
cmake ../..
......
......@@ -19,7 +19,7 @@ LINK_DIRECTORIES(
INCLUDE_DIRECTORIES(
$ENV{WM_PROJECT_DIR}/src/OpenFOAM/lnInclude
$ENV{WM_PROJECT_DIR}/src/meshing/blockMesh/lnInclude
${PROJECT_SOURCE_DIR}/../vtkPV3FoamBlockMesh
${PROJECT_SOURCE_DIR}/../vtkPV3blockMesh
)
ADD_DEFINITIONS(
......@@ -35,22 +35,22 @@ SET(
# Build the server-side plugin
ADD_PARAVIEW_PLUGIN(
PV3FoamBlockMeshReader_SM "1.0"
SERVER_MANAGER_XML PV3FoamBlockMeshReader_SM.xml
SERVER_MANAGER_SOURCES vtkPV3FoamBlockMeshReader.cxx
PV3blockMeshReader_SM "1.0"
SERVER_MANAGER_XML PV3blockMeshReader_SM.xml
SERVER_MANAGER_SOURCES vtkPV3blockMeshReader.cxx
)
# Build the client-side plugin
ADD_PARAVIEW_PLUGIN(
PV3FoamBlockMeshReader
PV3blockMeshReader
"1.0"
GUI_RESOURCES PV3FoamBlockMeshReader.qrc
GUI_RESOURCES PV3blockMeshReader.qrc
)
TARGET_LINK_LIBRARIES(
PV3FoamBlockMeshReader_SM
PV3blockMeshReader_SM
OpenFOAM
blockMesh
vtkPV3FoamBlockMesh
vtkPV3blockMesh
)
#-----------------------------------------------------------------------------
<RCC>
<qresource prefix="/ParaViewResources" >
<file>PV3FoamBlockMeshReader.xml</file>
<file>PV3blockMeshReader.xml</file>
</qresource>
</RCC>
<ParaViewReaders>
<Reader name="PV3FoamBlockMeshReader"
<Reader name="PV3blockMeshReader"
extensions="blockMesh"
file_description="OpenFOAM blockMesh reader">
</Reader>
......
<ServerManagerConfiguration>
<ProxyGroup name="sources">
<SourceProxy
name="PV3FoamBlockMeshReader"
class="vtkPV3FoamBlockMeshReader">
name="PV3blockMeshReader"
class="vtkPV3blockMeshReader">
<!-- File name - compulsory -->
<StringVectorProperty
......@@ -55,7 +55,7 @@
</StringVectorProperty>
<StringVectorProperty
name="PartStatus"
label="block numbers"
label="Blocks"
command="SetPartArrayStatus"
number_of_elements="0"
repeat_command="1"
......@@ -70,6 +70,29 @@
</ArraySelectionDomain>
</StringVectorProperty>
<!-- Available Parts (blocks) array -->
<StringVectorProperty
name="CurvedEdgesArrayInfo"
information_only="1">
<ArraySelectionInformationHelper attribute_name="CurvedEdges"/>
</StringVectorProperty>
<StringVectorProperty
name="CurvedEdgesStatus"
label="Curved Edges"
command="SetCurvedEdgesArrayStatus"
number_of_elements="0"
repeat_command="1"
number_of_elements_per_command="2"
element_types="2 0"
information_property="CurvedEdgesArrayInfo"
animateable="0">
<ArraySelectionDomain name="array_list">
<RequiredProperties>
<Property name="CurvedEdgesArrayInfo" function="ArrayList"/>
</RequiredProperties>
</ArraySelectionDomain>
</StringVectorProperty>
</SourceProxy>
</ProxyGroup>
</ServerManagerConfiguration>
/*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkPV3FoamBlockMeshReader.cxx,v $
Module: $RCSfile: vtkPV3blockMeshReader.cxx,v $
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
......@@ -13,7 +13,7 @@
=========================================================================*/
#include "vtkPV3FoamBlockMeshReader.h"
#include "vtkPV3blockMeshReader.h"
#include "pqApplicationCore.h"
#include "pqRenderView.h"
......@@ -31,12 +31,12 @@
#include "vtkStringArray.h"
// Foam includes
#include "vtkPV3FoamBlockMesh.H"
#include "vtkPV3blockMesh.H"
vtkCxxRevisionMacro(vtkPV3FoamBlockMeshReader, "$Revision: 1.5$");
vtkStandardNewMacro(vtkPV3FoamBlockMeshReader);
vtkCxxRevisionMacro(vtkPV3blockMeshReader, "$Revision: 1.5$");
vtkStandardNewMacro(vtkPV3blockMeshReader);
vtkPV3FoamBlockMeshReader::vtkPV3FoamBlockMeshReader()
vtkPV3blockMeshReader::vtkPV3blockMeshReader()
{
Debug = 0;
vtkDebugMacro(<<"Constructor");
......@@ -50,25 +50,33 @@ vtkPV3FoamBlockMeshReader::vtkPV3FoamBlockMeshReader()
UpdateGUI = 0;
PartSelection = vtkDataArraySelection::New();
CurvedEdgesSelection = vtkDataArraySelection::New();
// Setup the selection callback to modify this object when an array
// selection is changed.
SelectionObserver = vtkCallbackCommand::New();
SelectionObserver->SetCallback
(
&vtkPV3FoamBlockMeshReader::SelectionModifiedCallback
&vtkPV3blockMeshReader::SelectionModifiedCallback
);
SelectionObserver->SetClientData(this);
PartSelection->AddObserver
(
vtkCommand::ModifiedEvent,
this->SelectionObserver
);
CurvedEdgesSelection->AddObserver
(
vtkCommand::ModifiedEvent,
this->SelectionObserver
);
}
vtkPV3FoamBlockMeshReader::~vtkPV3FoamBlockMeshReader()
vtkPV3blockMeshReader::~vtkPV3blockMeshReader()
{
vtkDebugMacro(<<"Deconstructor");
......@@ -80,15 +88,15 @@ vtkPV3FoamBlockMeshReader::~vtkPV3FoamBlockMeshReader()
}
PartSelection->RemoveObserver(this->SelectionObserver);
CurvedEdgesSelection->RemoveObserver(this->SelectionObserver);
SelectionObserver->Delete();
PartSelection->Delete();
}
// Do everything except set the output info
int vtkPV3FoamBlockMeshReader::RequestInformation
int vtkPV3blockMeshReader::RequestInformation
(
vtkInformation* vtkNotUsed(request),
vtkInformationVector** vtkNotUsed(inputVector),
......@@ -97,7 +105,7 @@ int vtkPV3FoamBlockMeshReader::RequestInformation
{
vtkDebugMacro(<<"RequestInformation");
if (Foam::vtkPV3FoamBlockMesh::debug)
if (Foam::vtkPV3blockMesh::debug)
{
cout<<"REQUEST_INFORMATION\n";
}
......@@ -110,7 +118,7 @@ int vtkPV3FoamBlockMeshReader::RequestInformation
int nInfo = outputVector->GetNumberOfInformationObjects();
if (Foam::vtkPV3FoamBlockMesh::debug)
if (Foam::vtkPV3blockMesh::debug)
{
cout<<"RequestInformation with " << nInfo << " item(s)\n";
for (int infoI = 0; infoI < nInfo; ++infoI)
......@@ -121,7 +129,7 @@ int vtkPV3FoamBlockMeshReader::RequestInformation
if (!foamData_)
{
foamData_ = new Foam::vtkPV3FoamBlockMesh(FileName, this);
foamData_ = new Foam::vtkPV3blockMesh(FileName, this);
}
else
{
......@@ -145,7 +153,7 @@ int vtkPV3FoamBlockMeshReader::RequestInformation
// Set the output info
int vtkPV3FoamBlockMeshReader::RequestData
int vtkPV3blockMeshReader::RequestData
(
vtkInformation* vtkNotUsed(request),
vtkInformationVector** vtkNotUsed(inputVector),
......@@ -169,7 +177,7 @@ int vtkPV3FoamBlockMeshReader::RequestData
int nInfo = outputVector->GetNumberOfInformationObjects();
if (Foam::vtkPV3FoamBlockMesh::debug)
if (Foam::vtkPV3blockMesh::debug)
{
cout<<"RequestData with " << nInfo << " item(s)\n";
for (int infoI = 0; infoI < nInfo; ++infoI)
......@@ -186,7 +194,7 @@ int vtkPV3FoamBlockMeshReader::RequestData
)
);
if (Foam::vtkPV3FoamBlockMesh::debug)
if (Foam::vtkPV3blockMesh::debug)
{
cout<< "update output with "
<< output->GetNumberOfBlocks() << " blocks\n";
......@@ -203,7 +211,7 @@ int vtkPV3FoamBlockMeshReader::RequestData
}
void vtkPV3FoamBlockMeshReader::updatePointNumbersView(const bool show)
void vtkPV3blockMeshReader::updatePointNumbersView(const bool show)
{
pqApplicationCore* appCore = pqApplicationCore::instance();
......@@ -224,7 +232,7 @@ void vtkPV3FoamBlockMeshReader::updatePointNumbersView(const bool show)
}
void vtkPV3FoamBlockMeshReader::PrintSelf(ostream& os, vtkIndent indent)
void vtkPV3blockMeshReader::PrintSelf(ostream& os, vtkIndent indent)
{
vtkDebugMacro(<<"PrintSelf");
......@@ -239,35 +247,39 @@ void vtkPV3FoamBlockMeshReader::PrintSelf(ostream& os, vtkIndent indent)
// ----------------------------------------------------------------------
// Parts selection list control
vtkDataArraySelection* vtkPV3FoamBlockMeshReader::GetPartSelection()
vtkDataArraySelection* vtkPV3blockMeshReader::GetPartSelection()
{
vtkDebugMacro(<<"GetPartSelection");
return PartSelection;
}
int vtkPV3FoamBlockMeshReader::GetNumberOfPartArrays()
int vtkPV3blockMeshReader::GetNumberOfPartArrays()
{
vtkDebugMacro(<<"GetNumberOfPartArrays");
return PartSelection->GetNumberOfArrays();
}
const char* vtkPV3FoamBlockMeshReader::GetPartArrayName(int index)
const char* vtkPV3blockMeshReader::GetPartArrayName(int index)
{
vtkDebugMacro(<<"GetPartArrayName");
return PartSelection->GetArrayName(index);
}
int vtkPV3FoamBlockMeshReader::GetPartArrayStatus(const char* name)
int vtkPV3blockMeshReader::GetPartArrayStatus(const char* name)
{
vtkDebugMacro(<<"GetPartArrayStatus");
return PartSelection->ArrayIsEnabled(name);
}
void vtkPV3FoamBlockMeshReader::SetPartArrayStatus(const char* name, int status)
void vtkPV3blockMeshReader::SetPartArrayStatus
(
const char* name,
int status
)
{
vtkDebugMacro(<<"SetPartArrayStatus");
if (status)
......@@ -281,9 +293,58 @@ void vtkPV3FoamBlockMeshReader::SetPartArrayStatus(const char* name, int status)
}
// ----------------------------------------------------------------------
// CurvedEdges selection list control
vtkDataArraySelection* vtkPV3blockMeshReader::GetCurvedEdgesSelection()
{
vtkDebugMacro(<<"GetCurvedEdgesSelection");
return CurvedEdgesSelection;
}
int vtkPV3blockMeshReader::GetNumberOfCurvedEdgesArrays()
{
vtkDebugMacro(<<"GetNumberOfCurvedEdgesArrays");
return CurvedEdgesSelection->GetNumberOfArrays();
}
const char* vtkPV3blockMeshReader::GetCurvedEdgesArrayName(int index)
{
vtkDebugMacro(<<"GetCurvedEdgesArrayName");
return CurvedEdgesSelection->GetArrayName(index);
}
int vtkPV3blockMeshReader::GetCurvedEdgesArrayStatus(const char* name)
{
vtkDebugMacro(<<"GetCurvedEdgesArrayStatus");
return CurvedEdgesSelection->ArrayIsEnabled(name);
}
void vtkPV3blockMeshReader::SetCurvedEdgesArrayStatus
(
const char* name,
int status
)
{
vtkDebugMacro(<<"SetCurvedEdgesArrayStatus");
if (status)
{
CurvedEdgesSelection->EnableArray(name);
}
else
{
CurvedEdgesSelection->DisableArray(name);
}
}
// ----------------------------------------------------------------------
void vtkPV3FoamBlockMeshReader::SelectionModifiedCallback
void vtkPV3blockMeshReader::SelectionModifiedCallback
(
vtkObject*,
unsigned long,
......@@ -291,18 +352,18 @@ void vtkPV3FoamBlockMeshReader::SelectionModifiedCallback
void*
)
{
static_cast<vtkPV3FoamBlockMeshReader*>(clientdata)->SelectionModified();
static_cast<vtkPV3blockMeshReader*>(clientdata)->SelectionModified();
}
void vtkPV3FoamBlockMeshReader::SelectionModified()
void vtkPV3blockMeshReader::SelectionModified()
{
vtkDebugMacro(<<"SelectionModified");
Modified();
}
int vtkPV3FoamBlockMeshReader::FillOutputPortInformation
int vtkPV3blockMeshReader::FillOutputPortInformation
(
int port,
vtkInformation* info
......
/*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkPV3FoamBlockMeshReader.h,v $
Module: $RCSfile: vtkPV3blockMeshReader.h,v $
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
......@@ -12,18 +12,18 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkPV3FoamBlockMeshReader - reads a dataset in OpenFOAM bockMesh format
// .NAME vtkPV3blockMeshReader - reads a dataset in OpenFOAM bockMesh format
// .SECTION Description
// vtkPV3FoamBlockMeshReader creates an multiblock dataset.
// vtkPV3blockMeshReader creates an multiblock dataset.
// It uses the OpenFOAM infrastructure (blockMesh).
#ifndef __vtkPV3FoamBlockMeshReader_h
#define __vtkPV3FoamBlockMeshReader_h
#ifndef __vtkPV3blockMeshReader_h
#define __vtkPV3blockMeshReader_h
// Foam forward declarations
namespace Foam
{
class vtkPV3FoamBlockMesh;
class vtkPV3blockMesh;
}
// VTK includes
......@@ -34,15 +34,15 @@ class vtkDataArraySelection;
class vtkCallbackCommand;
class VTK_IO_EXPORT vtkPV3FoamBlockMeshReader
class VTK_IO_EXPORT vtkPV3blockMeshReader
:
public vtkMultiBlockDataSetAlgorithm
{
public:
vtkTypeRevisionMacro(vtkPV3FoamBlockMeshReader,vtkMultiBlockDataSetAlgorithm);
vtkTypeRevisionMacro(vtkPV3blockMeshReader,vtkMultiBlockDataSetAlgorithm);
void PrintSelf(ostream&, vtkIndent);
static vtkPV3FoamBlockMeshReader* New();
static vtkPV3blockMeshReader* New();
// Description:
// Set/Get the filename.
......@@ -63,10 +63,18 @@ public:
// Parts (blocks) selection list control
vtkDataArraySelection* GetPartSelection();
int GetNumberOfPartArrays();
int GetPartArrayStatus(const char* name);
void SetPartArrayStatus(const char* name, int status);
int GetPartArrayStatus(const char*);
void SetPartArrayStatus(const char*, int status);
const char* GetPartArrayName(int index);
// Description:
// Parts (blocks) selection list control
vtkDataArraySelection* GetCurvedEdgesSelection();
int GetNumberOfCurvedEdgesArrays();
int GetCurvedEdgesArrayStatus(const char*);
void SetCurvedEdgesArrayStatus(const char*, int status);
const char* GetCurvedEdgesArrayName(int index);
// Description:
// Callback registered with the SelectionObserver
// for all the selection lists
......@@ -84,10 +92,10 @@ public:
protected:
//- Construct null
vtkPV3FoamBlockMeshReader();
vtkPV3blockMeshReader();
//- Destructor
~vtkPV3FoamBlockMeshReader();
~vtkPV3blockMeshReader();
//- Return information about mesh, times, etc without loading anything
virtual int RequestInformation
......@@ -116,10 +124,10 @@ protected:
private:
//- Disallow default bitwise copy construct
vtkPV3FoamBlockMeshReader(const vtkPV3FoamBlockMeshReader&);
vtkPV3blockMeshReader(const vtkPV3blockMeshReader&);
//- Disallow default bitwise assignment
void operator=(const vtkPV3FoamBlockMeshReader&);
void operator=(const vtkPV3blockMeshReader&);
//- Add/remove point numbers to/from the view
void updatePointNumbersView(const bool show);
......@@ -131,8 +139,10 @@ private:
vtkDataArraySelection* PartSelection;
vtkDataArraySelection* CurvedEdgesSelection;
//BTX
Foam::vtkPV3FoamBlockMesh* foamData_;
Foam::vtkPV3blockMesh* foamData_;
//ETX
};
......
vtkPV3blockMesh.C
vtkPV3blockMeshConvert.C
vtkPV3blockMeshUtils.C
LIB = $(FOAM_LIBBIN)/libvtkPV3blockMesh
......@@ -7,7 +7,7 @@ EXE_INC = \
-I$(ParaView_INST_DIR)/VTK/Common \
-I$(ParaView_INST_DIR)/VTK/Filtering \
-I$(ParaView_INST_DIR)/VTK/Rendering \
-I../PV3FoamBlockMeshReader
-I../PV3blockMeshReader
LIB_LIBS = \
-lmeshTools \
......
......@@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
InClass
vtkPV3FoamBlockMesh
vtkPV3blockMesh
\*---------------------------------------------------------------------------*/
......