Commit c96474ac authored by hrchilds's avatar hrchilds

Update from November 16, 2005

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@571 18c085ea-50e0-402c-830e-de6fd14e8384
parent 91595823
......@@ -218,7 +218,8 @@ cd VTK
../cmake-1.8.1/bin/cmake .
#
# Edit CMakeCache.txt. Turn BUILD_SHARED_LIBS, VTK_USE_HYBRID,
# VTK_USE_MANGLED_MESA, and VTK_USE_ANSI_STDLIB on, Turn BUILD_TESTING off.
# VTK_USE_MANGLED_MESA, VTK_USE_ANSI_STDLIB, and CMAKE_SKIP_RPATH on,
# Turn BUILD_TESTING off.
#
# If you want to change the compilers you should modify CMAKE_CXX_COMPILER
# and CMAKE_C_COMPILER. If you want to change the compiler flags you should
......@@ -257,16 +258,6 @@ cd VTK
#
../cmake-1.8.1/bin/cmake .
#
# On linux systems the link line generated for the Hybrid and Rendering
# libraries will have the X11 library directory listed before the mesa
# library directory which may cause the library to be linked against the
# osmesa library in the X11 directory instead of the one that comes with
# our version of mangled mesa. To correct this problem you will need to
# edit the Makefiles in the Hybrid and Rendering directories to swap the
# order of the X11 library directory and the mesa library directory.
#
#
# On tru64 systems using g++ 3.0.4, several files in the Imaging directory
# will not compile because of an internal compiler error. You will need to
......@@ -295,26 +286,28 @@ mkdir $VISITDIR/vtk
mkdir $VISITDIR/vtk/2003.10.28
mkdir $VISITDIR/vtk/2003.10.28/$VISITARCH
mkdir $VISITDIR/vtk/2003.10.28/$VISITARCH/{Common,Filtering,Graphics,Hybrid,IO,Imaging,Rendering,MangleMesaInclude,lib}
cp vtkConfigure.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp vtkToolkits.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp vtk*Instantiator.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp Utilities/zlib/zlib.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp Utilities/zlib/zconf.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp Utilities/zlib/zlibDllConfig.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp Utilities/tiff/tiffio.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp Utilities/tiff/tiff.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp Utilities/tiff/tiffvers.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp Utilities/tiff/tconf.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp Utilities/tiff/tiffDllConfig.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp Common/*.h $VISITDIR/vtk/2003.10.28/$VISITARCH/Common
cp Filtering/*.h $VISITDIR/vtk/2003.10.28/$VISITARCH/Filtering
cp Graphics/*.h $VISITDIR/vtk/2003.10.28/$VISITARCH/Graphics
cp Hybrid/*.h $VISITDIR/vtk/2003.10.28/$VISITARCH/Hybrid
cp IO/*.h $VISITDIR/vtk/2003.10.28/$VISITARCH/IO
cp Imaging/*.h $VISITDIR/vtk/2003.10.28/$VISITARCH/Imaging
cp Rendering/*.h $VISITDIR/vtk/2003.10.28/$VISITARCH/Rendering
cp MangleMesaInclude/*.h $VISITDIR/vtk/2003.10.28/$VISITARCH/MangleMesaInclude
cp bin/*.so $VISITDIR/vtk/2003.10.28/$VISITARCH/lib
cp vtkConfigure.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp vtkToolkits.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp vtk*Instantiator.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp Utilities/expat/expat.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp Utilities/expat/expatDLLConfig.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp Utilities/zlib/zlib.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp Utilities/zlib/zconf.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp Utilities/zlib/zlibDllConfig.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp Utilities/tiff/tiffio.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp Utilities/tiff/tiff.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp Utilities/tiff/tiffvers.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp Utilities/tiff/tconf.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp Utilities/tiff/tiffDllConfig.h $VISITDIR/vtk/2003.10.28/$VISITARCH
cp Common/*.h $VISITDIR/vtk/2003.10.28/$VISITARCH/Common
cp Filtering/*.h $VISITDIR/vtk/2003.10.28/$VISITARCH/Filtering
cp Graphics/*.h $VISITDIR/vtk/2003.10.28/$VISITARCH/Graphics
cp Hybrid/*.h $VISITDIR/vtk/2003.10.28/$VISITARCH/Hybrid
cp IO/*.h $VISITDIR/vtk/2003.10.28/$VISITARCH/IO
cp Imaging/*.h $VISITDIR/vtk/2003.10.28/$VISITARCH/Imaging
cp Rendering/*.h $VISITDIR/vtk/2003.10.28/$VISITARCH/Rendering
cp MangleMesaInclude/*.h $VISITDIR/vtk/2003.10.28/$VISITARCH/MangleMesaInclude
cp bin/*.so $VISITDIR/vtk/2003.10.28/$VISITARCH/lib
cd ..
#
......
......@@ -89,6 +89,9 @@
# Mark C. Miller, Mon Apr 19 12:00:52 PDT 2004
# Added PlotterException base class
#
# Mark C. Miller, Wed Nov 16 10:46:36 PST 2005
# Added LibPipelineStubs
#
##############################################################################
@SET_MAKE@
......@@ -131,6 +134,7 @@ Pipeline_src= \
Pipeline/NoDefaultVariableException.C \
Pipeline/NoInputException.C \
Pipeline/NonQueryableInputException.C \
Pipeline/StubReferencedException.C \
Pipeline/UnexpectedValueException.C
Plotter_src= \
......
// ************************************************************************* //
// StubReferencedException.C //
// ************************************************************************* //
#include <StubReferencedException.h>
// ****************************************************************************
// Method: StubReferencedException constructor
//
// Purpose: handle stub reference exception
//
// Programmer: Mark C. Miller
// Creation: October 25, 2005
//
// ****************************************************************************
StubReferencedException::StubReferencedException(const char *stubName)
{
msg = stubName;
}
// ************************************************************************* //
// StubReferencedException.h //
// ************************************************************************* //
#ifndef STUB_REFERENCED_EXCEPTION_H
#define STUB_REFERENCED_EXCEPTION_H
#include <avtexception_exports.h>
#include <PipelineException.h>
// ****************************************************************************
// Class: UnexpectedValueException
//
// Purpose: The exception that all pipeline stub functions should throw
//
// Programmer: Mark C. Miller
// Creation: October 25, 2005
//
// ****************************************************************************
class AVTEXCEPTION_API StubReferencedException: public PipelineException
{
public:
StubReferencedException(const char*);
virtual ~StubReferencedException() VISIT_THROW_NOTHING {;};
};
#endif
......@@ -264,6 +264,7 @@ static const exception_info exception_tree[] =
{"PlotDimensionalityException", "VisWindowException"},
{"RecursiveExpressionException", "VisItException"},
{"SiloException", "DatabaseException"},
{"StubReferencedException", "PipelineException"},
{"UnexpectedValueException", "PipelineException"},
{"VisItException", NULL},
{"VisWindowException", "VisItException"}
......
......@@ -244,6 +244,9 @@
# Hank Childs, Mon May 23 11:50:39 PDT 2005
# Added DBOptionsAttributes, DBPluginInfoAttributes.
#
# Mark C. Miller, Wed Nov 16 10:46:36 PST 2005
# Added MeshManagementAttributes
#
##############################################################################
##
......@@ -302,6 +305,7 @@ SRC= AnimationAttributes.C \
LightList.C \
Line.C \
MaterialAttributes.C \
MeshManagementAttributes.C \
MessageAttributes.C \
MovieAttributes.C \
NamespaceAttributes.C \
......
This diff is collapsed.
#ifndef MESHMANAGEMENTATTRIBUTES_H
#define MESHMANAGEMENTATTRIBUTES_H
#include <state_exports.h>
#include <string>
#include <AttributeSubject.h>
// ****************************************************************************
// Class: MeshManagementAttributes
//
// Purpose:
// Global variables controlling reading and conversion of non-standard meshes
//
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Nov 16 07:56:44 PDT 2005
//
// Modifications:
//
// ****************************************************************************
class STATE_API MeshManagementAttributes : public AttributeSubject
{
public:
enum DiscretizationModes
{
Uniform,
Adaptive
};
MeshManagementAttributes();
MeshManagementAttributes(const MeshManagementAttributes &obj);
virtual ~MeshManagementAttributes();
virtual MeshManagementAttributes& operator = (const MeshManagementAttributes &obj);
virtual bool operator == (const MeshManagementAttributes &obj) const;
virtual bool operator != (const MeshManagementAttributes &obj) const;
virtual const std::string TypeName() const;
virtual bool CopyAttributes(const AttributeGroup *);
virtual AttributeSubject *CreateCompatible(const std::string &) const;
virtual AttributeSubject *NewInstance(bool) const;
// Property selection methods
virtual void SelectAll();
void SelectDiscretizationTolerance();
void SelectDiscretizationToleranceX();
void SelectDiscretizationToleranceY();
void SelectDiscretizationToleranceZ();
// Property setting methods
void SetDiscretizationTolerance(const doubleVector &discretizationTolerance_);
void SetDiscretizationToleranceX(const doubleVector &discretizationToleranceX_);
void SetDiscretizationToleranceY(const doubleVector &discretizationToleranceY_);
void SetDiscretizationToleranceZ(const doubleVector &discretizationToleranceZ_);
void SetDiscretizationMode(DiscretizationModes discretizationMode_);
void SetDiscretizeBoundaryOnly(bool discretizeBoundaryOnly_);
void SetPassNativeCSG(bool passNativeCSG_);
// Property getting methods
const doubleVector &GetDiscretizationTolerance() const;
doubleVector &GetDiscretizationTolerance();
const doubleVector &GetDiscretizationToleranceX() const;
doubleVector &GetDiscretizationToleranceX();
const doubleVector &GetDiscretizationToleranceY() const;
doubleVector &GetDiscretizationToleranceY();
const doubleVector &GetDiscretizationToleranceZ() const;
doubleVector &GetDiscretizationToleranceZ();
DiscretizationModes GetDiscretizationMode() const;
bool GetDiscretizeBoundaryOnly() const;
bool GetPassNativeCSG() const;
// Persistence methods
virtual bool CreateNode(DataNode *node, bool completeSave, bool forceAdd);
virtual void SetFromNode(DataNode *node);
// Enum conversion functions
static std::string DiscretizationModes_ToString(DiscretizationModes);
static bool DiscretizationModes_FromString(const std::string &, DiscretizationModes &);
protected:
static std::string DiscretizationModes_ToString(int);
public:
// Keyframing methods
virtual std::string GetFieldName(int index) const;
virtual AttributeGroup::FieldType GetFieldType(int index) const;
virtual std::string GetFieldTypeName(int index) const;
virtual bool FieldsEqual(int index, const AttributeGroup *rhs) const;
private:
doubleVector discretizationTolerance;
doubleVector discretizationToleranceX;
doubleVector discretizationToleranceY;
doubleVector discretizationToleranceZ;
int discretizationMode;
bool discretizeBoundaryOnly;
bool passNativeCSG;
};
#endif
<?xml version="1.0"?>
<Attribute name="MeshManagementAttributes" purpose="Global variables controlling reading and conversion of non-standard meshes" persistent="true" exportAPI="STATE_API" exportInclude="state_exports.h">
<Enum name="DiscretizationModes">
Uniform
Adaptive
</Enum>
<Field name="discretizationTolerance" label="discretizationTolerance" type="doubleVector">
0.010000
0.025000
0.050000
</Field>
<Field name="discretizationToleranceX" label="discretizationToleranceX" type="doubleVector">
</Field>
<Field name="discretizationToleranceY" label="discretizationToleranceY" type="doubleVector">
</Field>
<Field name="discretizationToleranceZ" label="discretizationToleranceZ" type="doubleVector">
</Field>
<Field name="discretizationMode" label="discretizationMode" type="enum" subtype="DiscretizationModes">
Adaptive
</Field>
<Field name="discretizeBoundaryOnly" label="discretizeBoundaryOnly" type="bool">
false
</Field>
<Field name="passNativeCSG" label="passNativeCSG" type="bool">
false
</Field>
</Attribute>
......@@ -104,10 +104,12 @@ VariableNamesEqual(const std::string &v1, const std::string &v2)
// Jeremy Meredith, Thu Aug 25 09:42:22 PDT 2005
// Added group origin.
//
// Mark C. Miller, Wed Nov 16 10:46:36 PST 2005
// Added loadBalanceScheme
// ****************************************************************************
avtMeshMetaData::avtMeshMetaData()
: AttributeSubject("sssiiiiiibFFs*ii*ssbssssssibbbbbsi")
: AttributeSubject("sssiiiiiibFFs*ii*ssbssssssibbbbbsii")
{
blockTitle = "domains";
blockPieceName = "domain";
......@@ -132,6 +134,7 @@ avtMeshMetaData::avtMeshMetaData()
xLabel = "X-Axis";
yLabel = "Y-Axis";
zLabel = "Z-Axis";
loadBalanceScheme = LOAD_BALANCE_UNKNOWN;
}
// ****************************************************************************
......@@ -190,12 +193,14 @@ avtMeshMetaData::avtMeshMetaData()
// Jeremy Meredith, Thu Aug 25 09:42:33 PDT 2005
// Added group origin.
//
// Mark C. Miller, Wed Nov 16 10:46:36 PST 2005
// Added loadBalanceScheme
// ****************************************************************************
avtMeshMetaData::avtMeshMetaData(const float *extents, std::string s, int nb,
int bo, int co, int go, int sd, int td,
avtMeshType mt)
: AttributeSubject("sssiiiiiibFFs*ii*ssbssssssibbbbbsi")
: AttributeSubject("sssiiiiiibFFs*ii*ssbssssssibbbbbsii")
{
name = s;
originalName = name;
......@@ -222,6 +227,7 @@ avtMeshMetaData::avtMeshMetaData(const float *extents, std::string s, int nb,
xLabel = "X-Axis";
yLabel = "Y-Axis";
zLabel = "Z-Axis";
loadBalanceScheme = LOAD_BALANCE_UNKNOWN;
}
......@@ -280,11 +286,13 @@ avtMeshMetaData::avtMeshMetaData(const float *extents, std::string s, int nb,
// Jeremy Meredith, Thu Aug 25 09:42:37 PDT 2005
// Added group origin.
//
// Mark C. Miller, Wed Nov 16 10:46:36 PST 2005
// Added loadBalanceScheme
// ****************************************************************************
avtMeshMetaData::avtMeshMetaData(std::string s, int nb, int bo, int co, int go,
int sd, int td, avtMeshType mt)
: AttributeSubject("sssiiiiiibFFs*ii*ssbssssssibbbbbsi")
: AttributeSubject("sssiiiiiibFFs*ii*ssbssssssibbbbbsii")
{
name = s;
originalName = name;
......@@ -313,6 +321,8 @@ avtMeshMetaData::avtMeshMetaData(std::string s, int nb, int bo, int co, int go,
xLabel = "X-Axis";
yLabel = "Y-Axis";
zLabel = "Z-Axis";
loadBalanceScheme = LOAD_BALANCE_UNKNOWN;
}
......@@ -372,10 +382,12 @@ avtMeshMetaData::avtMeshMetaData(std::string s, int nb, int bo, int co, int go,
// Jeremy Meredith, Thu Aug 25 09:42:38 PDT 2005
// Added group origin.
//
// Mark C. Miller, Wed Nov 16 10:46:36 PST 2005
// Added loadBalanceScheme
// ****************************************************************************
avtMeshMetaData::avtMeshMetaData(const avtMeshMetaData &rhs)
: AttributeSubject("sssiiiiiibFFs*ii*ssbssssssibbbbbsi")
: AttributeSubject("sssiiiiiibFFs*ii*ssbssssssibbbbbsii")
{
name = rhs.name;
originalName = rhs.originalName;
......@@ -412,6 +424,7 @@ avtMeshMetaData::avtMeshMetaData(const avtMeshMetaData &rhs)
yLabel = rhs.yLabel;
zLabel = rhs.zLabel;
validVariable = rhs.validVariable;
loadBalanceScheme = rhs.loadBalanceScheme;
}
......@@ -485,6 +498,8 @@ avtMeshMetaData::~avtMeshMetaData()
// Jeremy Meredith, Thu Aug 25 09:42:42 PDT 2005
// Added group origin.
//
// Mark C. Miller, Wed Nov 16 10:46:36 PST 2005
// Added loadBalanceScheme
// ****************************************************************************
const avtMeshMetaData &
......@@ -525,6 +540,7 @@ avtMeshMetaData::operator=(const avtMeshMetaData &rhs)
yLabel = rhs.yLabel;
zLabel = rhs.zLabel;
validVariable = rhs.validVariable;
loadBalanceScheme = rhs.loadBalanceScheme;
return *this;
}
......@@ -617,6 +633,7 @@ avtMeshMetaData::SelectAll()
Select(29, (void*)&containsGlobalZoneIds);
Select(30, (void*)&originalName);
Select(31, (void*)&groupOrigin);
Select(32, (void*)&loadBalanceScheme);
}
......@@ -715,6 +732,8 @@ avtMeshMetaData::SetExtents(const float *extents)
// Jeremy Meredith, Thu Aug 25 09:42:47 PDT 2005
// Added group origin.
//
// Mark C. Miller, Wed Nov 16 10:46:36 PST 2005
// Added loadBalanceScheme
// ****************************************************************************
void
......@@ -856,6 +875,13 @@ avtMeshMetaData::Print(ostream &out, int indent) const
Indent(out, indent);
out << "THIS IS NOT A VALID VARIABLE." << endl;
}
if (loadBalanceScheme != LOAD_BALANCE_UNKNOWN)
{
Indent(out, indent);
out << "HAS A SPECIFIC LOAD BALANCE SCHEME = "
<< loadBalanceScheme << endl;
}
}
......
......@@ -29,6 +29,8 @@ class avtSimulationInformation;
// Jeremy Meredith, Thu Aug 25 09:28:10 PDT 2005
// Added origin for groups.
//
// Mark C. Miller, Wed Nov 16 10:46:36 PST 2005
// Added loadBalanceScheme
//----------------------------------------------------------------------------
struct DBATTS_API avtMeshMetaData : public AttributeSubject
{
......@@ -70,6 +72,7 @@ struct DBATTS_API avtMeshMetaData : public AttributeSubject
std::string zLabel;
bool validVariable;
LoadBalanceScheme loadBalanceScheme;
public:
avtMeshMetaData();
......
......@@ -161,3 +161,26 @@ GuessVarTypeFromNumDimsAndComps(int numSpatialDims, int componentCount)
return retval;
}
std::string
LoadBalanceSchemeToString(LoadBalanceScheme s)
{
switch (s)
{
case LOAD_BALANCE_CONTIGUOUS_BLOCKS_TOGETHER:
return "contiguous blocks together";
case LOAD_BALANCE_STRIDE_ACROSS_BLOCKS:
return "stride across blocks";
case LOAD_BALANCE_RANDOM_ASSIGNMENT:
return "random assignment";
case LOAD_BALANCE_DBPLUGIN_DYNAMIC:
return "dbplugin dynamic";
case LOAD_BALANCE_RESTRICTED:
return "restricted";
case LOAD_BALANCE_ABSOLUTE:
return "absolute";
case LOAD_BALANCE_UNKNOWN:
default:
return "unknown";
}
}
......@@ -82,6 +82,18 @@ enum SetState
AllUsedOtherProc /* 3 */
};
enum LoadBalanceScheme
{
LOAD_BALANCE_UNKNOWN =-1,
LOAD_BALANCE_CONTIGUOUS_BLOCKS_TOGETHER = 0,
LOAD_BALANCE_STRIDE_ACROSS_BLOCKS, /* 1 */
LOAD_BALANCE_RANDOM_ASSIGNMENT, /* 2 */
LOAD_BALANCE_DBPLUGIN_DYNAMIC, /* 3 */
LOAD_BALANCE_RESTRICTED, /* 4 */
LOAD_BALANCE_ABSOLUTE /* 5 */
};
typedef std::vector<std::string> MaterialList;
DBATTS_API extern const char * AUXILIARY_DATA_DATA_EXTENTS;
......@@ -101,6 +113,8 @@ DBATTS_API bool avtExtentType_FromString(const std::string &, avtExtentType &);
DBATTS_API std::string avtVarTypeToString(avtVarType);
DBATTS_API std::string LoadBalanceSchemeToString(LoadBalanceScheme);
DBATTS_API avtVarType GuessVarTypeFromNumDimsAndComps(int numSpatialDims,
int componentCount);
#endif
......
......@@ -252,6 +252,8 @@ class PickVarInfo;
// Jeremy Meredith, Thu Aug 18 16:39:54 PDT 2005
// Added a new isovolume MIR algorithm, and a VF cutoff for it.
//
// Mark C. Miller, Wed Nov 16 10:46:36 PST 2005
// Replaced type conversion args on many Get functions to data spec
// ****************************************************************************
class DATABASE_API avtGenericDatabase : public avtDatasetDatabase
......@@ -304,48 +306,45 @@ class DATABASE_API avtGenericDatabase : public avtDatasetDatabase
avtSourceFromDatabase *);
vtkDataSet *GetScalarVarDataset(const char *, int, int,
const char *,
const bool, const vector<int>&);
const avtDataSpecification_p);
vtkDataSet *GetMeshDataset(const char *, int, int,
const char *, const bool,
const vector<int>&);
const char *, const avtDataSpecification_p);
vtkDataSet *GetVectorVarDataset(const char *, int, int,
const char *,
const bool, const vector<int>&);
const avtDataSpecification_p);
vtkDataSet *GetSymmetricTensorVarDataset(const char *, int,
int, const char *,
const bool,
const vector<int>&);
const avtDataSpecification_p);
vtkDataSet *GetTensorVarDataset(const char *, int, int,
const char *,
const bool, const vector<int>&);
const avtDataSpecification_p);
vtkDataSet *GetArrayVarDataset(const char *, int, int,
const char *,
const bool, const vector<int>&);
const avtDataSpecification_p);
vtkDataSet *GetMaterialDataset(const char *, int, int,
const char *, const bool,
const vector<int>&);
const char *,
const avtDataSpecification_p);
vtkDataSet *GetSpeciesDataset(const char *, int, int,
const char *, const bool,
const vector<int>&);
const char *,
const avtDataSpecification_p);
vtkDataSet *GetLabelVarDataset(const char *, int, int,
const char *, const bool,
const vector<int>&);
const char *,
const avtDataSpecification_p);
vtkDataArray *GetScalarVariable(const char *, int, int,
const char *,
const bool, const vector<int>&);
const avtDataSpecification_p);
vtkDataArray *GetVectorVariable(const char *, int, int,
const char *,
const bool, const vector<int>&);
const avtDataSpecification_p);
vtkDataArray *GetSymmetricTensorVariable(const char *,int,int,
const char *,
const bool,
const vector<int>&);
const avtDataSpecification_p);
vtkDataArray *GetTensorVariable(const char *, int, int,
const char *,
const bool, const vector<int>&);
const avtDataSpecification_p);
vtkDataArray *GetArrayVariable(const char *, int, int,
const char *,
const bool, const vector<int>&);
const avtDataSpecification_p);
vtkDataArray *GetSpeciesVariable(const char *, int, int,
const char *, int);
vtkDataArray *GetLabelVariable(const char *, int, int,
......@@ -355,9 +354,9 @@ class DATABASE_API avtGenericDatabase : public avtDatasetDatabase
void AddSecondaryVariables(vtkDataSet *, int, int,
const char *,
const std::vector<CharStrRef> &,
const bool, const vector<int>&);
const avtDataSpecification_p);
vtkDataSet *GetMesh(const char *, int, int, const char *,
const bool, const vector<int>&);
avtDataSpecification_p);
void AddOriginalCellsArray(vtkDataSet *, const int);
void AddOriginalNodesArray(vtkDataSet *, const int);
......
// ************************************************************************* //
// avtCommonDataFunctions.C //
// ************************************************************************* //
#include <visit-config.h>
#include <avtCommonDataFunctions.h>
......@@ -28,6 +29,11 @@
#include <NoInputException.h>
#include <DebugStream.h>
#ifdef HAVE_LIBBZ2
#include <bzlib.h>
#include <TimingsManager.h>
#endif
using std::vector;
using std::string;
......@@ -1933,3 +1939,165 @@ MajorEigenvalue(double *vals)
vtkMath::Jacobi(input, eigenvals, eigenvecs);
return eigenvals[0];
}
// ****************************************************************************
// Function: CMaybeCompressedDataString
//
// Purpose: Check a data string for leading characters indicating it *might*
// be a BZ2 compressed string.
//
// Programmer: Mark C. Miller
// Creation: November 15, 2005
//
// ****************************************************************************
bool
CMaybeCompressedDataString(const unsigned char *dstr)
{
if (dstr[0] == 'B' && dstr[1] == 'Z' && dstr[2] == 'h')
return true;
return false;
}
// ****************************************************************************
// Function: CCompressDataString
//
// Purpose: Attempts to compress a data string to a size no larger than a
// specified size. The maximum specified size is read from *newlen
// on entrance. If *newlen is zero, then it will default to using
// a maximum specified size of 1/2 of the input string's size.
// If it is able to compress into the specified size, the compressed
// string and its size is returned in the new args and a value of
// true is returned for the function. If it is unable to compress
// into the specified size, the new args are unchanged and a value
// of false is returned for the function.
//
// Notes: Information about the compression is tacked onto the end of the
// returned string.
//
// Programmer: Mark C. Miller
// Creation: November 15, 2005
//
// ****************************************************************************
bool CCompressDataString(const unsigned char *dstr, int len,
unsigned char **newdstr, int *newlen,
float *timec, float *ratioc)
{
#ifdef HAVE_LIBBZ2
unsigned int lenBZ2 = *newlen == 0 ? len / 2 : *newlen;
unsigned char *dstrBZ2 = new unsigned char [lenBZ2+20];
int startCompress = visitTimer->StartTimer(true);
if (BZ2_bzBuffToBuffCompress((char*)dstrBZ2, &lenBZ2, (char*) dstr, len,
1, 0, 250) != BZ_OK)
{
double dummy =
visitTimer->StopTimer(startCompress,
"Failed attempt to compress data", true);
delete [] dstrBZ2;
return false;
}
else