Commit 80dfb33d authored by hrchilds's avatar hrchilds

Update from September 22, 2005

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@544 18c085ea-50e0-402c-830e-de6fd14e8384
parent b7984114
......@@ -282,6 +282,7 @@ esac
# set list of tests/modes to skip
skipList="scalable,parallel:tests/databases/boxlib.py \
scalable,parallel:tests/hybrid/locus.py \
scalable,parallel:tests/rendering/saveformats.py \
dlb:tests/databases/global_node_ids.py \
dlb:tests/queries/pick.py \
optimized:tests/plots/tensor.py \
......
......@@ -5,6 +5,7 @@
#include <avtDatabase.h>
#include <visitstream.h>
#include <visit-config.h>
#include <stdio.h>
#include <Expression.h>
......@@ -1275,6 +1276,9 @@ avtDatabase::NumStagesForFetch(avtDataSpecification_p)
// Jeremy Meredith, Tue Aug 27 11:34:35 PDT 2002
// Moved from avtDatabaseFactory to avtDatabase.
//
// Brad Whitlock, Wed Sep 21 16:41:56 PST 2005
// Fixed for win32.
//
// ****************************************************************************
void
......@@ -1290,7 +1294,7 @@ avtDatabase::GetFileListFromTextFile(const char *textfile,
char dir[1024];
const char *p = textfile, *q = NULL;
while ((q = strstr(p, "/")) != NULL)
while ((q = strstr(p, SLASH_STRING)) != NULL)
{
p = q+1;
}
......@@ -1307,7 +1311,7 @@ avtDatabase::GetFileListFromTextFile(const char *textfile,
ifile.getline(str_auto, 1024, '\n');
if (str_auto[0] != '\0' && str_auto[0] != '#')
{
if (str_auto[0] == '/' || str_auto[0] == '!')
if (str_auto[0] == SLASH_CHAR || str_auto[0] == '!')
{
strcpy(str_with_dir, str_auto);
}
......
......@@ -31,6 +31,7 @@
#include <vector>
#include <string>
#include <visitstream.h>
#include <visit-config.h>
#include <ctype.h>
#include <stdlib.h>
......@@ -502,6 +503,9 @@ avtBoxlib2DFileFormat::GetMesh(int patch, const char *mesh_name)
// Have proc. 0 read the Header and then broadcast the info to the other
// procs.
//
// Brad Whitlock, Thu Sep 22 13:27:18 PST 2005
// Fixed on win32.
//
// ****************************************************************************
void
......@@ -518,7 +522,7 @@ avtBoxlib2DFileFormat::ReadHeader(void)
ifstream in;
string double_tmp;
string headerFilename = rootPath + timestepPath + "/Header";
string headerFilename = rootPath + timestepPath + SLASH_STRING + "Header";
if (iDoReading)
in.open(headerFilename.c_str());
......@@ -1116,6 +1120,10 @@ avtBoxlib2DFileFormat::GetVectorVar(int patch, const char *var_name)
// Programmer: Hank Childs
// Creation: December 10, 2003
//
// Modifications:
// Brad Whitlock, Thu Sep 22 13:28:58 PST 2005
// Fixed on win32.
//
// ****************************************************************************
VisMF *
......@@ -1123,11 +1131,20 @@ avtBoxlib2DFileFormat::GetVisMF(int index)
{
if (!mfReaders[index])
{
char filename[1024];
sprintf(filename, "%s%s/%s", rootPath.c_str(),
timestepPath.c_str(),
multifabFilenames[index].c_str());
mfReaders[index] = new VisMF(filename);
string filename(rootPath + timestepPath + SLASH_STRING +
multifabFilenames[index]);
#if defined(_WIN32)
// If we're on Windows then make some extra passes through the filename
// so all '\\' characters are changed to '/' or Boxlib will choke.
std::string::size_type idx;
while((idx = filename.find("/")) != string::npos)
filename.replace(idx, 1, "\\");
while((idx = filename.find("\\\\")) != string::npos)
filename.replace(idx, 2, "\\");
while((idx = filename.find("\\")) != string::npos)
filename.replace(idx, 1, "/");
#endif
mfReaders[index] = new VisMF(filename.c_str());
}
return mfReaders[index];
}
......@@ -1729,6 +1746,10 @@ avtBoxlib2DFileFormat::FreeUpResources()
// Programmer: Hank Childs
// Creation: December 10, 2003
//
// Modifications:
// Brad Whitlock, Thu Sep 22 13:26:45 PST 2005
// Fixed for win32.
//
// ****************************************************************************
string
......@@ -1738,12 +1759,12 @@ GetDirName(const char *path)
int len = strlen(path);
const char *last = path + (len-1);
while (*last != '/' && last > path)
while (*last != SLASH_CHAR && last > path)
{
last--;
}
if (*last != '/')
if (*last != SLASH_CHAR)
{
return "";
}
......
......@@ -32,6 +32,7 @@
#include <vector>
#include <string>
#include <visitstream.h>
#include <visit-config.h>
#include <ctype.h>
#include <stdlib.h>
......@@ -559,6 +560,9 @@ avtBoxlib3DFileFormat::GetMesh(int patch, const char *mesh_name)
// Have proc. 0 read the Header and then broadcast the info to the other
// procs.
//
// Brad Whitlock, Thu Sep 22 13:34:14 PST 2005
// Fixed on win32.
//
// ****************************************************************************
void
......@@ -575,7 +579,7 @@ avtBoxlib3DFileFormat::ReadHeader(void)
ifstream in;
string double_tmp;
string headerFilename = rootPath + timestepPath + "/Header";
string headerFilename = rootPath + timestepPath + SLASH_STRING + "Header";
if (iDoReading)
in.open(headerFilename.c_str());
......@@ -1227,10 +1231,12 @@ avtBoxlib3DFileFormat::GetVectorVar(int patch, const char *var_name)
// Creation: July 30, 2003
//
// Modifications:
//
// Hank Childs, Thu Nov 6 09:49:33 PST 2003
// Removed notion of time, since this is now a STMD.
//
// Brad Whitlock, Thu Sep 22 13:35:57 PST 2005
// Changed so it works on win32.
//
// ****************************************************************************
VisMF *
......@@ -1238,11 +1244,20 @@ avtBoxlib3DFileFormat::GetVisMF(int index)
{
if (!mfReaders[index])
{
char filename[1024];
sprintf(filename, "%s%s/%s", rootPath.c_str(),
timestepPath.c_str(),
multifabFilenames[index].c_str());
mfReaders[index] = new VisMF(filename);
string filename(rootPath + timestepPath + SLASH_STRING +
multifabFilenames[index]);
#if defined(_WIN32)
// If we're on Windows then make some extra passes through the filename
// so all '\\' characters are changed to '/' or Boxlib will choke.
std::string::size_type idx;
while((idx = filename.find("/")) != string::npos)
filename.replace(idx, 1, "\\");
while((idx = filename.find("\\\\")) != string::npos)
filename.replace(idx, 2, "\\");
while((idx = filename.find("\\")) != string::npos)
filename.replace(idx, 1, "/");
#endif
mfReaders[index] = new VisMF(filename.c_str());
}
return mfReaders[index];
}
......@@ -1881,6 +1896,10 @@ avtBoxlib3DFileFormat::FreeUpResources()
// Programmer: Jeremy Meredith
// Creation: April 7, 2003
//
// Modifications:
// Brad Whitlock, Thu Sep 22 13:36:39 PST 2005
// Changed for win32.
//
// ****************************************************************************
string
......@@ -1890,12 +1909,12 @@ GetDirName(const char *path)
int len = strlen(path);
const char *last = path + (len-1);
while (*last != '/' && last > path)
while (*last != SLASH_CHAR && last > path)
{
last--;
}
if (*last != '/')
if (*last != SLASH_CHAR)
{
return "";
}
......
......@@ -122,7 +122,7 @@ avtExodusFileFormat::ReadInFile(void)
numBlocks = rdr->GetNumberOfBlocks();
validBlock.resize(numBlocks);
blockId.resize(numBlocks);
for (int i = 0 ; i < numBlocks; i++)
for (i = 0 ; i < numBlocks; i++)
{
if (rdr->GetNumberOfElementsInBlock(i) != 0)
{
......
......@@ -69,13 +69,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef __vtkExodusReader_h
#define __vtkExodusReader_h
#include <database_exports.h>
#include <stdio.h>
#include "vtkUnstructuredGridSource.h"
#include "vtkIntArray.h"
class DATABASE_API VTK_EXPORT vtkExodusReader : public vtkUnstructuredGridSource
class vtkExodusReader : public vtkUnstructuredGridSource
{
public:
static vtkExodusReader *New();
......
......@@ -131,6 +131,8 @@ avtGDALFileFormat::GetDataset()
// Creation: Tue Sep 6 11:54:59 PDT 2005
//
// Modifications:
// Brad Whitlock, Thu Sep 22 16:38:54 PST 2005
// Fixed calls to log10 so it builds on win32.
//
// ****************************************************************************
......@@ -235,8 +237,10 @@ avtGDALFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
// Figure out a format string for when we need to add WxH.
//
char whFormat[20];
int ndigX = int(log10(xdims)) + 1;
int ndigY = int(log10(ydims)) + 1;
float lxd = log10((float)xdims);
float lyd = log10((float)ydims);
int ndigX = int(lxd) + 1;
int ndigY = int(lyd) + 1;
int ndigits = (ndigX > ndigY) ? ndigX : ndigY;
SNPRINTF(whFormat, 20, "%%s%%0%ddx%%0%dd", ndigits, ndigits);
......
......@@ -81,7 +81,7 @@ avtTimeVaryingExodusFileFormat::ReadInDataset(void)
numBlocks = rdr->GetNumberOfBlocks();
validBlock.resize(numBlocks);
blockId.resize(numBlocks);
for (int i = 0 ; i < numBlocks; i++)
for (i = 0 ; i < numBlocks; i++)
{
if (rdr->GetNumberOfElementsInBlock(i) != 0)
{
......
......@@ -61,13 +61,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef __vtkExodusReader_h
#define __vtkExodusReader_h
#include <database_exports.h>
#include <stdio.h>
#include "vtkUnstructuredGridSource.h"
#include "vtkIntArray.h"
class DATABASE_API VTK_EXPORT vtkExodusReader : public vtkUnstructuredGridSource
class vtkExodusReader : public vtkUnstructuredGridSource
{
public:
static vtkExodusReader *New();
......
......@@ -5,10 +5,12 @@
#include <avtOnionPeelFilter.h>
#include <vtkCellData.h>
#include <vtkDataSetRemoveGhostCells.h>
#include <vtkFieldData.h>
#include <vtkIntArray.h>
#include <vtkOnionPeelFilter.h>
#include <vtkDataSetRemoveGhostCells.h>
#include <vtkPolyData.h>
#include <vtkPolyDataOnionPeelFilter.h>
#include <vtkUnstructuredGrid.h>
#include <avtTerminatingSource.h>
......@@ -52,12 +54,15 @@ using std::vector;
// Kathleen Bonnell, Thu Aug 15 18:30:44 PDT 2002
// Added another bad seed category (ghost), and flag specifying groups.
//
// Kathleen Bonnell, Wed Sep 21 17:09:03 PDT 2005
// Add poly_opf, so that polydata input can be returned as polydata output.
//
// ****************************************************************************
avtOnionPeelFilter::avtOnionPeelFilter()
{
opf = vtkOnionPeelFilter::New();
opf->SetBadSeedCallback(avtOnionPeelFilter::BadSeedCallback, this);
opf = NULL;
poly_opf = NULL;
encounteredBadSeed = false;
encounteredGhostSeed = false;
......@@ -72,13 +77,23 @@ avtOnionPeelFilter::avtOnionPeelFilter()
// Creation: September 10, 2000
//
// Modifications:
// Kathleen Bonnell, Wed Sep 21 17:09:03 PDT 2005
// Add poly_opf.
//
// ****************************************************************************
avtOnionPeelFilter::~avtOnionPeelFilter()
{
opf->Delete();
opf = NULL;
if (opf)
{
opf->Delete();
opf = NULL;
}
if (poly_opf)
{
poly_opf->Delete();
poly_opf = NULL;
}
}
......@@ -201,6 +216,9 @@ avtOnionPeelFilter::Equivalent(const AttributeGroup *a)
// Kathleen Bonnell, Wed Jan 19 16:15:35 PST 2005
// Add support for nodal seedId.
//
// Kathleen Bonnell, Wed Sep 21 17:09:03 PDT 2005
// Add poly_opf, so that polydata input can be returned as polydata output.
//
// ****************************************************************************
vtkDataSet *
......@@ -210,7 +228,17 @@ avtOnionPeelFilter::ExecuteData(vtkDataSet *in_ds, int DOM, std::string)
{
return NULL;
}
if (in_ds->GetDataObjectType() != VTK_POLY_DATA)
{
opf = vtkOnionPeelFilter::New();
opf->SetBadSeedCallback(avtOnionPeelFilter::BadSeedCallback, this);
}
else
{
poly_opf = vtkPolyDataOnionPeelFilter::New();
poly_opf->SetBadSeedCallback(avtOnionPeelFilter::BadSeedCallback, this);
}
encounteredBadSeed = false;
encounteredGhostSeed = false;
......@@ -323,39 +351,62 @@ avtOnionPeelFilter::ExecuteData(vtkDataSet *in_ds, int DOM, std::string)
{
seed = 0;
}
opf->SetSeedId(seed);
if (opf)
opf->SetSeedId(seed);
else
poly_opf->SetSeedId(seed);
}
else
{
if (id.size() == 3)
opf->SetLogicalIndex(id[0], id[1], id[2]);
if (opf)
opf->SetLogicalIndex(id[0], id[1], id[2]);
else
poly_opf->SetLogicalIndex(id[0], id[1], id[2]);
else
opf->SetLogicalIndex(id[0], id[1]);
if (opf)
opf->SetLogicalIndex(id[0], id[1]);
else
poly_opf->SetLogicalIndex(id[0], id[1]);
}
vtkDataSet *outds;
if (opf)
{
opf->SetInput(ds);
opf->SetRequestedLayer(atts.GetRequestedLayer());
opf->SetAdjacencyType(atts.GetAdjacencyType());
opf->SetSeedIdIsForCell((int)
(atts.GetSeedType() == OnionPeelAttributes::SeedCell));
opf->SetReconstructOriginalCells((int)
!GetInput()->GetInfo().GetValidity().GetZonesPreserved());
outds = vtkUnstructuredGrid::New();
opf->SetOutput((vtkUnstructuredGrid*)outds);
outds->Delete();
outds->Update();
}
else
{
poly_opf->SetInput((vtkPolyData*)ds);
poly_opf->SetRequestedLayer(atts.GetRequestedLayer());
poly_opf->SetAdjacencyType(atts.GetAdjacencyType());
poly_opf->SetSeedIdIsForCell((int)
(atts.GetSeedType() == OnionPeelAttributes::SeedCell));
poly_opf->SetReconstructOriginalCells((int)
!GetInput()->GetInfo().GetValidity().GetZonesPreserved());
outds = vtkPolyData::New();
poly_opf->SetOutput((vtkPolyData*)outds);
outds->Delete();
outds->Update();
}
opf->SetInput(ds);
opf->SetRequestedLayer(atts.GetRequestedLayer());
opf->SetAdjacencyType(atts.GetAdjacencyType());
opf->SetSeedIdIsForCell((int)
(atts.GetSeedType() == OnionPeelAttributes::SeedCell));
opf->SetReconstructOriginalCells((int)
!GetInput()->GetInfo().GetValidity().GetZonesPreserved());
vtkUnstructuredGrid *out_ug = vtkUnstructuredGrid::New();
opf->SetOutput(out_ug);
out_ug->Delete();
//
// Update will check the modifed time and call Execute. We have no direct
// hooks into the Execute method.
//
opf->Update();
if (removeGhostCells != NULL)
{
removeGhostCells->Delete();
}
successfullyExecuted |= (!encounteredBadSeed && !encounteredGhostSeed);
return out_ug;
return outds;
}
// ****************************************************************************
......@@ -827,16 +878,29 @@ avtOnionPeelFilter::PreExecute()
// Hank Childs, Fri Mar 11 07:37:05 PST 2005
// Fix non-problem size leak introduced with last fix.
//
// Kathleen Bonnell, Wed Sep 21 17:09:03 PDT 2005
// Add poly_opf.
//
// ****************************************************************************
void
avtOnionPeelFilter::ReleaseData(void)
{
avtPluginStreamer::ReleaseData();
opf->SetInput(NULL);
vtkUnstructuredGrid *ug = vtkUnstructuredGrid::New();
opf->SetOutput(ug);
ug->Delete();
if (opf)
{
opf->SetInput(NULL);
vtkUnstructuredGrid *ug = vtkUnstructuredGrid::New();
opf->SetOutput(ug);
ug->Delete();
}
if (poly_opf)
{
poly_opf->SetInput(NULL);
vtkPolyData *pdata = vtkPolyData::New();
poly_opf->SetOutput(pdata);
pdata->Delete();
}
}
......@@ -10,8 +10,9 @@
#include <OnionPeelAttributes.h>
class vtkOnionPeelFilter;
class vtkDataSet;
class vtkOnionPeelFilter;
class vtkPolyDataOnionPeelFilter;
// ****************************************************************************
......@@ -78,6 +79,7 @@ class avtOnionPeelFilter : public avtPluginStreamer
protected:
OnionPeelAttributes atts;
vtkOnionPeelFilter *opf;
vtkPolyDataOnionPeelFilter *poly_opf;
int badSeed;
int maximumIds;
......
......@@ -251,6 +251,9 @@
# Kathleen Bonnell, Tue Aug 30 15:20:40 PDT 2005
# Added vtkVisItTensorGlyph.
#
# Kathleen Bonnell, Wed Sep 21 17:15:58 PDT 2005
# Added vtkPolyDataOnionPeelFilter.
#
##############################################################################
##
......@@ -276,6 +279,7 @@ SRC=InitVTK.C \
vtkOBJWriter.C \
vtkOnionPeelFilter.C \
vtkOSMesaRenderWindow.C \
vtkPolyDataOnionPeelFilter.C \
vtkPPMWriter.C \
vtkRGBWriter.C \
vtkRectilinearGridFacelistFilter.C \
......
......@@ -206,7 +206,8 @@ vtkOnionPeelFilter::Initialize(const int numIds)
}
}
// check for out-of-range error on seedcellId;
if (this->SeedId < 0 || this->SeedId >= numIds)
if (!this->ReconstructOriginalCells &&
(this->SeedId < 0 || this->SeedId >= numIds))
{
if (bsc_callback != NULL)
{
......
This diff is collapsed.
//========================================================================
//
// Program: VisIt
// Module: $RCSfile: vtkPolyDataOnionPeelFilter.h,v $
// Language: C++
// Date: $Date: 2000/09/20 18:11:07 $
// Version: $Revision: 1.24 $
//
//
//
//=========================================================================
// .NAME vtkPolyDataOnionPeelFilter - creates layers of cells around a given
// seed cell
// .SECTION Description
// vtkPolyDataOnionPeelFilter is a filter object that, given an initial seed
// cell in a rectilinear grid will create layers of "neighbor" cells around
// the seed cell. Neighbors are determined by either node adjacency (default)
// or face adjacency. Adjacency type can be controlled by the user.
//
// To use this filter you should specifiy a starting seed cell and the number
// of layers.
//
// Output is PolyData
//
// .SECTION See Also
//
// .SECTION Caveats
// First element in layerCellIds is always SeedCellId.
// Layer zero offset is always zero, so first element in layerOffsets
// will be the AdjacencyType (in case of updates to adjacency
// while PolyDataOnionPeelFilter is active)
//
//
#ifndef __vtkPolyDataOnionPeelFilter_h
#define __vtkPolyDataOnionPeelFilter_h
#include <visit_vtk_exports.h>
#include <vtkPolyDataToPolyDataFilter.h>
#include <vtkSetGet.h>
#define VTK_NODE_ADJACENCY 0
#define VTK_FACE_ADJACENCY 1
class vtkIdList;
//*****************************************************************************
// Modifications:
// Kathleen Bonnell, Thu Aug 15 18:37:59 PDT 2002
// Added a bool return for Intialize method. Changed SetSeedCell method
// from a Macro to a regular method. Added logicalIndex and its associated
// Set/Get methods, added useLogicalIndex.
//
// Kathleen Bonnell, Tue Jan 18 19:37:46 PST 2005
// Added bool 'ReconstructOriginalCells' and Set/Get methods. Added
// FindCellsCorrespondingToOriginal.
//
// Kathleen Bonnell, Wed Jan 19 15:54:38 PST 2005
// Took 'Cell' out of callback name, renamed 'SeedCellId' to 'SeedId'.
// Added 'SeedIdIsForCell'. Added 'FindNodesCorrespondingToOriginal'.
//
//*****************************************************************************
typedef void (*BadSeedCallback)(void *, int, int, bool);
class VISIT_VTK_API
vtkPolyDataOnionPeelFilter : public vtkPolyDataToPolyDataFilter
{
public:
static vtkPolyDataOnionPeelFilter *New();
vtkTypeMacro(vtkPolyDataOnionPeelFilter,vtkPolyDataToPolyDataFilter);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Set the current Seed value.
void SetSeedId(const int);
vtkGetMacro(SeedId, int);
// Description:
// Turn on/off scaling of source geometry.
vtkSetMacro(SeedIdIsForCell,int);
vtkBooleanMacro(SeedIdIsForCell,int);
vtkGetMacro(SeedIdIsForCell,int);
// Description:
// Set the current LogicalIndex value.
void SetLogicalIndex(const int, const int, const int k = 0);
int *GetLogicalIndex(void) { return logicalIndex; };
// Description:
// Set the current layer value.
vtkSetClampMacro(RequestedLayer,int, 0, VTK_LARGE_INTEGER);
vtkGetMacro(RequestedLayer,int);
// Description:
// Turn on/off scaling of source geometry.
vtkSetMacro(ReconstructOriginalCells,int);
vtkBooleanMacro(ReconstructOriginalCells,int);
vtkGetMacro(ReconstructOriginalCells,int);
// Description:
// Specify which type of adjacency to use when determining neighbor cells.
// There are two choices: Face Adjacency and Node Adjacency.
vtkSetClampMacro(AdjacencyType, int, VTK_NODE_ADJACENCY, VTK_FACE_ADJACENCY);
vtkGetMacro(AdjacencyType, int);
void SetAdjacencyTypeToFace()
{ this->SetAdjacencyType(VTK_FACE_ADJACENCY); };
void SetAdjacencyTypeToNode()
{ this->SetAdjacencyType(VTK_NODE_ADJACENCY); };
char *GetAdjacencyTypeAsString();
bool Initialize(const int = VTK_LARGE_INTEGER);
void SetBadSeedCallback(BadSeedCallback, void *);
protected:
// Protected Methods
vtkPolyDataOnionPeelFilter();
~vtkPolyDataOnionPeelFilter();
void Execute();
void Grow();
void GenerateOutputGrid();
void FindCellNeighborsByNodeAdjacency(vtkIdList *, vtkIdList*);
void FindCellNeighborsByFaceAdjacency(vtkIdList *, vtkIdList*);
void FindCellsCorrespondingToOriginal(int, vtkIdList*);
void FindCellsCorrespondingToOriginal(vtkIdList *, vtkIdList*);
void FindNodesCorrespondingToOriginal(int, vtkIdList*);
// Protected Data Members
vtkIdList *layerCellIds;
vtkIdList <