Commit b0db9544 authored by George Zagaris's avatar George Zagaris Committed by Marcus D. Hanwell
Browse files

ENH: Propagate GhostArray rename

This updates all the classes/tests that used vtkMeshPropertyEncoder
and vtkMeshProperty to use the vtkGhostArray which now consilidates
all of the previous functionality

Change-Id: I17a868aea27e53f7ad29cf516155fbc8ea950c53
parent 3934f6d1
......@@ -71,6 +71,7 @@ vtkGarbageCollector.cxx
vtkGarbageCollectorManager.cxx
vtkGaussianRandomSequence.cxx
vtkGeneralTransform.cxx
vtkGhostArray.cxx
vtkHeap.cxx
vtkHomogeneousTransform.cxx
vtkIOStream.cxx
......@@ -117,7 +118,6 @@ vtkMatrix3x3.cxx
vtkMatrix4x4.cxx
vtkMatrixToHomogeneousTransform.cxx
vtkMatrixToLinearTransform.cxx
vtkMeshPropertyEncoder.cxx
vtkMinimalStandardRandomSequence.cxx
vtkMultiThreader.cxx
vtkMutexLock.cxx
......
......@@ -11,13 +11,13 @@ CREATE_TEST_SOURCELIST(Tests ${KIT}CxxTests.cxx
TestArrayLookup.cxx
TestConditionVariable.cxx
TestGarbageCollector.cxx
TestGhostArray.cxx
TestDataArray.cxx
TestDataArrayComponentNames.cxx
TestDirectory.cxx
TestFastNumericConversion.cxx
TestMath.cxx
TestMatrix3x3.cxx
TestMeshPropertyEncoder.cxx
TestMinimalStandardRandomSequence.cxx
TestNew.cxx
TestObservers.cxx
......
/*=========================================================================
Program: Visualization Toolkit
Module: TestMeshPropertyEncoder.cxx
Module: TestGhostArray.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
......@@ -12,26 +12,25 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME TestMeshPropertyEncoder.cxx -- Tests vtkMeshPropertyEncoder
// .NAME TestGhostArray -- Tests vtkGhostArray
//
// .SECTION Description
// A simple test for the vtkMeshPropertyEncoder
// A simple test for the vtkGhostArray
#include "vtkMeshProperty.h"
#include "vtkMeshPropertyEncoder.h"
#include "vtkGhostArray.h"
int CheckSetAndUnsetProperty( unsigned char &u, const int p )
{
int rc = 0;
vtkMeshPropertyEncoder::SetProperty( u, p);
if( !vtkMeshPropertyEncoder::IsPropertySet( u, p) )
vtkGhostArray::SetProperty( u, p);
if( !vtkGhostArray::IsPropertySet( u, p) )
{
std::cerr << "Could not set property " << p << std::endl;
++rc;
}
vtkMeshPropertyEncoder::UnsetProperty( u, p);
if( vtkMeshPropertyEncoder::IsPropertySet( u, p) )
vtkGhostArray::UnsetProperty( u, p);
if( vtkGhostArray::IsPropertySet( u, p) )
{
std::cerr << "Could not unset property " << p << std::endl;
++rc;
......@@ -41,7 +40,7 @@ int CheckSetAndUnsetProperty( unsigned char &u, const int p )
}
//------------------------------------------------------------------------------
int TestMeshPropertyEncoder(int,char *[])
int TestGhostArray(int,char *[])
{
int rc = 0;
unsigned char propertyField;
......@@ -49,26 +48,26 @@ int TestMeshPropertyEncoder(int,char *[])
// Ensure all bits are set to 0
for( int i=0; i < 8; ++i )
{
if( vtkMeshPropertyEncoder::IsPropertySet( propertyField, i) )
if( vtkGhostArray::IsPropertySet( propertyField, i) )
++rc;
} // END for
// Try setting/unsetting some node properties
rc += CheckSetAndUnsetProperty( propertyField, VTKNodeProperties::INTERNAL );
rc += CheckSetAndUnsetProperty( propertyField, VTKNodeProperties::SHARED );
rc += CheckSetAndUnsetProperty( propertyField, VTKNodeProperties::GHOST );
rc += CheckSetAndUnsetProperty( propertyField, VTKNodeProperties::IGNORE );
rc += CheckSetAndUnsetProperty( propertyField, VTKNodeProperties::VOID );
rc += CheckSetAndUnsetProperty( propertyField, VTKNodeProperties::BOUNDARY );
rc += CheckSetAndUnsetProperty( propertyField, vtkGhostArray::INTERNAL );
rc += CheckSetAndUnsetProperty( propertyField, vtkGhostArray::SHARED );
rc += CheckSetAndUnsetProperty( propertyField, vtkGhostArray::GHOST );
rc += CheckSetAndUnsetProperty( propertyField, vtkGhostArray::IGNORE );
rc += CheckSetAndUnsetProperty( propertyField, vtkGhostArray::VOID );
rc += CheckSetAndUnsetProperty( propertyField, vtkGhostArray::BOUNDARY );
// Try setting/unsetting some cell properties
rc += CheckSetAndUnsetProperty( propertyField, VTKCellProperties::DUPLICATE );
rc += CheckSetAndUnsetProperty( propertyField, VTKCellProperties::EXTERNAL );
rc += CheckSetAndUnsetProperty( propertyField, vtkGhostArray::DUPLICATE );
rc += CheckSetAndUnsetProperty( propertyField, vtkGhostArray::EXTERNAL );
// Ensure all bits are set to 0
for( int i=0; i < 8; ++i )
{
if( vtkMeshPropertyEncoder::IsPropertySet( propertyField, i) )
if( vtkGhostArray::IsPropertySet( propertyField, i) )
++rc;
} // END for
return( rc );
......
......@@ -38,8 +38,7 @@
#include "vtkStructuredNeighbor.h"
#include "vtkUnsignedCharArray.h"
#include "vtkIntArray.h"
#include "vtkMeshPropertyEncoder.h"
#include "vtkMeshProperty.h"
#include "vtkGhostArray.h"
#include "vtkPointData.h"
#include "vtkCellData.h"
#include "vtkUniformGridPartitioner.h"
......@@ -217,8 +216,8 @@ int GetTotalNumberOfNodes( vtkMultiBlockDataSet *multiblock )
{
unsigned char nodeProperty =
*(grid->GetPointVisibilityArray()->GetPointer( pntIdx ));
if( !vtkMeshPropertyEncoder::IsPropertySet(
nodeProperty,VTKNodeProperties::IGNORE ) )
if( !vtkGhostArray::IsPropertySet(
nodeProperty,vtkGhostArray::IGNORE ) )
{
++numNodes;
}
......@@ -450,10 +449,12 @@ int SimpleMonolithicTest( int argc, char **argv )
for( ; pIdx < grid->GetNumberOfPoints(); ++pIdx )
{
unsigned char p = nodeProperty[ pIdx ];
if(!vtkMeshPropertyEncoder::IsPropertySet(p,VTKNodeProperties::IGNORE))
if(!vtkGhostArray::IsPropertySet(
p,vtkGhostArray::IGNORE))
{
++totalNumberOfNodes;
if(vtkMeshPropertyEncoder::IsPropertySet(p,VTKNodeProperties::BOUNDARY))
if(vtkGhostArray::IsPropertySet(
p,vtkGhostArray::BOUNDARY))
flags->SetValue( pIdx, 2 );
else
flags->SetValue( pIdx, 3);
......
......@@ -14,8 +14,7 @@
=========================================================================*/
#include "vtkStructuredGridConnectivity.h"
#include "vtkObjectFactory.h"
#include "vtkMeshProperty.h"
#include "vtkMeshPropertyEncoder.h"
#include "vtkGhostArray.h"
#include "vtkStructuredData.h"
#include "vtkStructuredExtent.h"
#include "vtkIdList.h"
......@@ -192,17 +191,19 @@ void vtkStructuredGridConnectivity::MarkNodeProperty(
const int gridID, const int i, const int j, const int k,
int ext[6], unsigned char &p )
{
vtkMeshPropertyEncoder::Reset( p );
vtkGhostArray::Reset( p );
if( this->IsNodeInterior( i, j, k, ext ) )
{
vtkMeshPropertyEncoder::SetProperty( p,VTKNodeProperties::INTERNAL );
vtkGhostArray::SetProperty(
p,vtkGhostArray::INTERNAL );
}
else
{
if( this->IsNodeOnBoundary(i,j,k) )
{
vtkMeshPropertyEncoder::SetProperty( p,VTKNodeProperties::BOUNDARY );
vtkGhostArray::SetProperty(
p,vtkGhostArray::BOUNDARY );
}
// Figure out if the point is shared and who owns the point
......@@ -211,7 +212,8 @@ void vtkStructuredGridConnectivity::MarkNodeProperty(
if( neiList->GetNumberOfIds() > 0 )
{
vtkMeshPropertyEncoder::SetProperty( p, VTKNodeProperties::SHARED );
vtkGhostArray::SetProperty(
p,vtkGhostArray::SHARED );
for( vtkIdType nei=0; nei < neiList->GetNumberOfIds(); ++nei )
{
......@@ -222,7 +224,8 @@ void vtkStructuredGridConnectivity::MarkNodeProperty(
// etc.
if( gridID > neiList->GetId( nei ) )
{
vtkMeshPropertyEncoder::SetProperty( p,VTKNodeProperties::IGNORE );
vtkGhostArray::SetProperty(
p,vtkGhostArray::IGNORE );
break;
}
} //END for all neis
......
......@@ -37,8 +37,7 @@
#include "vtkPStructuredGridConnectivity.h"
#include "vtkStructuredGridConnectivity.h"
#include "vtkStructuredNeighbor.h"
#include "vtkMeshPropertyEncoder.h"
#include "vtkMeshProperty.h"
#include "vtkGhostArray.h"
#include "vtkPointData.h"
#include "vtkCellData.h"
#include "vtkUniformGridPartitioner.h"
......@@ -81,8 +80,8 @@ int GetTotalNumberOfNodes( vtkMultiBlockDataSet *multiblock )
{
unsigned char nodeProperty =
*(grid->GetPointVisibilityArray()->GetPointer( pntIdx ));
if( !vtkMeshPropertyEncoder::IsPropertySet(
nodeProperty,VTKNodeProperties::IGNORE ) )
if( !vtkGhostArray::IsPropertySet(
nodeProperty,vtkGhostArray::IGNORE ) )
{
++numNodes;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment