Commit a209fbeb authored by hrchilds's avatar hrchilds

Update from July 14, 2005

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@501 18c085ea-50e0-402c-830e-de6fd14e8384
parent 6e07fdf5
This diff is collapsed.
......@@ -723,6 +723,7 @@ if ($ver eq "")
$visitarchdir = "$visitdir";
$visitbindir = "$visitdir/exe";
$visitscriptdir = "$visitdir/bin";
$visitlauncher = "$visitdir/bin/visit";
if($os eq "darwin" and ($exe_name eq "gui" or $exe_name eq "viewer" or $exe_name eq "xmledit" or $exe_name eq "silex"))
{
$visitbindir = "$visitbindir/$exe_name.app/Contents/MacOS";
......@@ -763,6 +764,7 @@ else # We're running a public version.
$visitarchdir = "$visitdir/$archdir";
$visitbindir = "$visitdir/$archdir/bin";
$visitscriptdir = "$visitdir/$archdir/bin";
$visitlauncher = "$visitdir/../bin/visit";
if($os eq "darwin" and ($exe_name eq "gui" or $exe_name eq "viewer" or $exe_name eq "xmledit" or $exe_name eq "silex"))
{
$visitbindir = "$visitbindir/$exe_name.app/Contents/MacOS";
......@@ -1136,8 +1138,8 @@ else
print GDBFILE "set environment TRAP_FPE=$ENV{TRAP_FPE}\n";
}
print GDBFILE "set environment MESA_GLX_FX=$ENV{MESA_GLX_FX}\n";
print GDBFILE "path $ENV{VISITHOME}/exe\n";
print GDBFILE "file $ENV{VISITHOME}/exe/$real_exe\n";
print GDBFILE "path $visitbindir\n";
print GDBFILE "file $visitbindir/$real_exe\n";
print GDBFILE "directory $ENV{VISITHOME}/common/Exceptions/Database\n";
print GDBFILE "directory $ENV{VISITHOME}/common/Exceptions/Pipeline\n";
print GDBFILE "directory $ENV{VISITHOME}/common/Exceptions/VisWindow\n";
......@@ -1264,14 +1266,49 @@ else
print STDERR "Running: @printcmd\n";
if ($security_key_set) { push @visitcmd, "-key", $security_key; }
$launched = 0;
if($use_new_console)
{
@tmpcmd = @visitcmd;
@visitcmd = ("xterm", "-title", "VisIt $exe_name$ver", "-fn", "fixed", "-e");
push @visitcmd, @tmpcmd;
if($os eq "darwin")
{
if($ENV{TERM_PROGRAM} eq "Apple_Terminal")
{
push @newcmd, $visitlauncher;
push @newcmd, "-$exe_name";
splice @visitcmd, 0, 1, @newcmd;
open(OSAHANDLE, "| osascript");
print OSAHANDLE "tell application \"Terminal\"\n";
print OSAHANDLE "activate\n";
print OSAHANDLE "do script with command \"cd $ENV{PWD};@visitcmd; exit\"\n";
print OSAHANDLE "end tell\n";
close OSAHANDLE;
$launched = 1;
}
elsif($ENV{TERM} eq "xterm")
{
@tmpcmd = @visitcmd;
@visitcmd = ("xterm", "-title", "VisIt $exe_name$ver", "-fn", "fixed", "-e");
push @visitcmd, @tmpcmd;
}
else
{
print STDERR "VisIt does not recognize your terminal application so it will ignore the -newconsole argument.\n";
}
}
else
{
@tmpcmd = @visitcmd;
@visitcmd = ("xterm", "-title", "VisIt $exe_name$ver", "-fn", "fixed", "-e");
push @visitcmd, @tmpcmd;
}
}
exec @visitcmd or die "Can't execute visit: $!\n";
if(!$launched)
{
exec @visitcmd or die "Can't execute visit: $!\n";
}
}
}
......
......@@ -49,7 +49,7 @@ FloatConstExpr::~FloatConstExpr()
void
StringConstExpr::PrintNode(ostream &o)
{
o << "StringConstant: "<<value << endl;
o << "StringConstant: "<<value.c_str() << endl;
}
StringConstExpr::~StringConstExpr()
......@@ -207,7 +207,7 @@ ArgExpr::PrintNode(ostream &o)
{
if (identifier != "")
{
o << "name='" << identifier << "':";
o << "name='" << identifier.c_str() << "':";
}
o << endl;
expr->Print(o);
......@@ -250,7 +250,7 @@ ArgsExpr::PrintNode(ostream &o)
void
FunctionExpr::PrintNode(ostream &o)
{
o << "Function '" << name << "' with ";
o << "Function '" << name.c_str() << "' with ";
if (args)
args->PrintNode(o);
else
......@@ -312,7 +312,7 @@ PathExpr::PrintNode(ostream &o)
void
MachExpr::PrintNode(ostream &o)
{
o << "Machine="<<host<<endl;
o << "Machine="<<host.c_str()<<endl;
}
void
......
......@@ -403,7 +403,7 @@ Grammar::WriteStateInitialization(const string &name, ostream &o)
o << "// Automatically generated!!! Use 'make init' to rebuild." << endl;
o << "//" << endl;
o << endl;
o << "#include \""<<name<<".h\"" << endl;
o << "#include \""<<name.c_str()<<".h\"" << endl;
o << endl;
o << "" << endl;
o << "static void SetShiftState(State &s, int next, const Symbol *sym)" << endl;
......@@ -438,7 +438,7 @@ Grammar::WriteStateInitialization(const string &name, ostream &o)
o << " SetShiftState(s,"<<str<<", d.Get(";
if (s->IsNonTerminal())
o << "\"" << s->GetDisplayString() << "\"";
o << "\"" << s->GetDisplayString().c_str() << "\"";
else
if (tt < 256)
o << "'" << char(tt) << "'";
......@@ -479,7 +479,7 @@ Grammar::WriteStateInitialization(const string &name, ostream &o)
o << " SetReduceRule(s,"<<str<<", d.Get(";
if (s->IsNonTerminal())
o << "\"" << s->GetDisplayString() << "\"";
o << "\"" << s->GetDisplayString().c_str() << "\"";
else
if (tt < 256)
o << "'" << char(tt) << "'";
......@@ -491,7 +491,7 @@ Grammar::WriteStateInitialization(const string &name, ostream &o)
o << "}" << endl;
o << endl;
}
o << "bool " << name << "::Initialize()" << endl;
o << "bool " << name.c_str() << "::Initialize" << endl;
o << "{" << endl;
o << " states.resize(" << states.size() << ");" << endl;
o << endl;
......
......@@ -80,16 +80,16 @@ Sequence::Print(ostream &o, int pos) const
{
o << "e ";
if (pos == 0)
o << dot << " ";
o << dot.c_str() << " ";
}
else
{
for (int i=0; i<symbols.size(); i++)
{
if (pos == i) o << dot << " ";
if (pos == i) o << dot.c_str() << " ";
o << *(symbols[i]) << " ";
}
if (pos == symbols.size()) o << dot << " ";
if (pos == symbols.size()) o << dot.c_str() << " ";
}
}
......
......@@ -95,7 +95,7 @@ Symbol::operator==(const Symbol &rhs) const
// ****************************************************************************
ostream &operator<<(ostream &o, const Symbol &s)
{
o << s.displaystring;
o << s.displaystring.c_str();
return o;
}
......
......@@ -68,6 +68,9 @@
# Hank Childs, Mon May 23 17:21:33 PDT 2005
# Add database plugins.
#
# Brad Whitlock, Wed Jul 13 10:42:09 PDT 2005
# Updated LIBS.
#
##############################################################################
##
......@@ -91,7 +94,7 @@ SRC=PluginManager.C DatabasePluginManager.C \
OBJ=$(SRC:.C=.o)
LIB=libplugin
LIBS=-lmisc
LIBS=-lstate -lcomm -lutility -lmisc
##
## Standard targets...
......
......@@ -500,7 +500,7 @@ DatabaseCorrelation::GetInverseCorrelatedTimeState(const std::string &db,
}
Function: OutputOperator
Declaration: ostream& operator << (ostream &os, const DatabaseCorrelation &);
Declaration: STATE_API ostream& operator << (ostream &os, const DatabaseCorrelation &);
Definition:
// ****************************************************************************
// Method: operator <<
......
......@@ -130,5 +130,5 @@ private:
};
// User-defined functions
ostream& operator << (ostream &os, const DatabaseCorrelation &);
STATE_API ostream& operator << (ostream &os, const DatabaseCorrelation &);
#endif
......@@ -26,6 +26,11 @@ using std::vector;
#include <pwd.h>
#endif
//
// Static vars.
//
static bool isDevelopmentVersion = false;
// ****************************************************************************
// Function: LongestCommonPrefixLength
//
......@@ -974,6 +979,9 @@ ConfigStateGetRunCount(ConfigStateEnum &code)
// Brad Whitlock, Mon Mar 7 11:31:35 PDT 2005
// Changed the Win32 logic.
//
// Brad Whitlock, Mon Jul 11 09:58:13 PDT 2005
// I fixed a win32 coding problem.
//
// ****************************************************************************
void
......@@ -990,7 +998,7 @@ ConfigStateIncrementRunCount(ConfigStateEnum &code)
}
else if(code2 == CONFIGSTATE_SUCCESS)
{
firstTime == (nStartups == 0);
firstTime = (nStartups == 0);
}
char keyval[100];
......@@ -1111,6 +1119,44 @@ ExpandUserPath(const std::string &path)
return newPath;
}
// ****************************************************************************
// Method: SetIsDevelopmentVersion
//
// Purpose:
// Sets whether the version of VisIt is a development version.
//
// Programmer: Brad Whitlock
// Creation: Thu Jul 14 10:51:30 PDT 2005
//
// Modifications:
//
// ****************************************************************************
void
SetIsDevelopmentVersion(bool val)
{
isDevelopmentVersion = val;
}
// ****************************************************************************
// Method: GetIsDevelopmentVersion
//
// Purpose:
// Returns whether VisIt is a development version of VisIt.
//
// Programmer: Brad Whitlock
// Creation: Thu Jul 14 10:50:35 PDT 2005
//
// Modifications:
//
// ****************************************************************************
bool
GetIsDevelopmentVersion()
{
return isDevelopmentVersion;
}
// ****************************************************************************
// Method: GetVisItInstallationDirectory
//
......@@ -1135,6 +1181,9 @@ ExpandUserPath(const std::string &path)
// I prevented it from stripping the last directory off if we're in a
// development directory.
//
// Brad Whitlock, Thu Jul 14 10:49:42 PDT 2005
// I made it use the isDevelopmentDir library variable.
//
// ****************************************************************************
std::string
......@@ -1165,7 +1214,9 @@ GetVisItInstallationDirectory(const char *version)
{
// The directory often has a "/bin" on the end. Strip it off.
std::string home(idir);
if(home.substr(0, 11) != "/data_vobs/")
if(isDevelopmentVersion)
installDir = idir;
else
{
int lastSlash = home.rfind("/");
if(lastSlash != -1)
......@@ -1173,8 +1224,6 @@ GetVisItInstallationDirectory(const char *version)
else
installDir = idir;
}
else
installDir = idir;
}
return installDir;
#endif
......@@ -1200,7 +1249,9 @@ GetVisItInstallationDirectory(const char *version)
// Creation: Fri Jun 24 11:33:07 PDT 2005
//
// Modifications:
//
// Brad Whitlock, Mon Jul 11 10:08:30 PDT 2005
// Made it work for the non-installed case on Windows.
//
// ****************************************************************************
std::string
......@@ -1221,6 +1272,25 @@ GetVisItArchitectureDirectory(const char *version)
archDir = visitHome;
delete [] visitHome;
}
else
{
// Use the VISITDEVDIR environment var.
std::string visitdev;
char *devdir = getenv("VISITDEVDIR");
if(devdir == 0)
visitdev = std::string("C:\\VisItDev") + std::string(version);
else
visitdev = std::string(devdir);
#ifdef USING_MSVC6
#ifdef _DEBUG
archDir = visitdev + "\\bin\\Debug";
#else
archDir = visitdev + "\\bin\\Release";
#endif
#else
archDir = visitdev + "\\MSVC7.Net\\bin\\Release";
#endif
}
return archDir;
#else
// Get the installation dir for the version that's running. They all use
......@@ -1232,3 +1302,28 @@ GetVisItArchitectureDirectory(const char *version)
return archDir;
#endif
}
// ****************************************************************************
// Method: GetVisItLauncher
//
// Purpose:
// Returns the name of the VisIt launch program, wherever it is found.
//
// Returns: The full name of the VisIt launcher.
//
// Programmer: Brad Whitlock
// Creation: Thu Jul 14 10:54:33 PDT 2005
//
// Modifications:
//
// ****************************************************************************
std::string
GetVisItLauncher()
{
#if defined(_WIN32)
return std::string(GetVisItInstallationDirectory() + "\\visit.exe");
#else
return std::string(GetVisItInstallationDirectory() + "/bin/visit");
#endif
}
......@@ -41,6 +41,9 @@ std::string UTILITY_API GetVisItInstallationDirectory();
std::string UTILITY_API GetVisItInstallationDirectory(const char *version);
std::string UTILITY_API GetVisItArchitectureDirectory();
std::string UTILITY_API GetVisItArchitectureDirectory(const char *version);
std::string UTILITY_API GetVisItLauncher();
void UTILITY_API SetIsDevelopmentVersion(bool val);
bool UTILITY_API GetIsDevelopmentVersion();
std::string UTILITY_API GetUserVisItDirectory();
UTILITY_API char * GetDefaultConfigFile(const char *filename = 0, const char *home = 0);
......
......@@ -304,16 +304,22 @@ avtFileFormat::AddMeshToMetaData(avtDatabaseMetaData *md, string name,
// mesh The mesh the scalar var is defined on.
// cent The centering type - node vs cell.
// extents The extents of the scalar var. (optional)
// treatAsASCII Whether the var is 'ascii' (optional)
//
// Programmer: Hank Childs
// Creation: February 23, 2001
//
// Modifications:
// Kathleen Bonnell, Wed Jul 13 18:28:51 PDT 2005
// Add optional bool 'treatAsASCII' arg.
//
// ****************************************************************************
void
avtFileFormat::AddScalarVarToMetaData(avtDatabaseMetaData *md, string name,
string mesh, avtCentering cent,
const float *extents)
const float *extents,
const bool treatAsASCII)
{
avtScalarMetaData *scalar = new avtScalarMetaData();
scalar->name = name;
......@@ -328,6 +334,7 @@ avtFileFormat::AddScalarVarToMetaData(avtDatabaseMetaData *md, string name,
{
scalar->hasDataExtents = false;
}
scalar->treatAsASCII = treatAsASCII;
md->Add(scalar);
}
......
......@@ -63,6 +63,10 @@ class avtVariableCache;
// Added const members for invalid cycles/times. Changed class to use
// these symbols instead of -INT_MAX and -DBL_MAX
//
// Kathleen Bonnell, Wed Jul 13 18:28:51 PDT 2005
// Added bool to AddScalarVarToMetaData, in order to specify whether
// the var should be treated as ascii (default -- false).
//
// ****************************************************************************
class DATABASE_API avtFileFormat
......@@ -186,7 +190,8 @@ class DATABASE_API avtFileFormat
int = 0, int = 3, int = 3);
void AddScalarVarToMetaData(avtDatabaseMetaData *, std::string,
std::string, avtCentering,
const float * = NULL);
const float * = NULL,
const bool = false);
void AddVectorVarToMetaData(avtDatabaseMetaData *, std::string,
std::string, avtCentering, int = 3,
const float * = NULL);
......
......@@ -426,7 +426,7 @@ avtMTSDFileFormatInterface::SetDatabaseMetaData(avtDatabaseMetaData *md,
// that with the true number of domains.
//
int nm = md->GetNumMeshes();
for (int j = 0 ; j < nm ; j++)
for (j = 0 ; j < nm ; j++)
{
md->SetBlocksForMesh(j, nDomains);
}
......
......@@ -235,7 +235,7 @@ avtExternallyRenderedImagesActor::PrepareForRender(void)
bool
avtExternallyRenderedImagesActor::SaveVisibility(void *objptr, const bool mode)
{
map<void*,bool>::iterator it = savedVisibilityMap.find(objptr);
std::map<void*,bool>::iterator it = savedVisibilityMap.find(objptr);
if (it != savedVisibilityMap.end())
{
......@@ -262,7 +262,7 @@ avtExternallyRenderedImagesActor::SaveVisibility(void *objptr, const bool mode)
bool
avtExternallyRenderedImagesActor::RestoreVisibility(void *objptr)
{
map<void*,bool>::iterator it = savedVisibilityMap.find(objptr);
std::map<void*,bool>::iterator it = savedVisibilityMap.find(objptr);
if (it == savedVisibilityMap.end())
{
......
......@@ -98,6 +98,9 @@
# Hank Childs, Wed May 18 16:11:57 PDT 2005
# Added moment of inertia query.
#
# Hank Childs, Thu Jul 14 14:13:41 PDT 2005
# Added Spherical Compactness Factor.
#
##############################################################################
@SET_MAKE@
......@@ -153,6 +156,7 @@ Queries_src= \
Queries/avtOriginalDataMinMaxQuery.C \
Queries/avtOriginalDataNumNodesQuery.C \
Queries/avtOriginalDataNumZonesQuery.C \
Queries/avtSphericalCompactnessFactorQuery.C \
Queries/avtSummationQuery.C \
Queries/avtTimeQuery.C \
Queries/avtTotalRevolvedSurfaceAreaQuery.C \
......
......@@ -19,6 +19,7 @@
#include <avtOriginalDataMinMaxQuery.h>
#include <avtOriginalDataNumNodesQuery.h>
#include <avtOriginalDataNumZonesQuery.h>
#include <avtSphericalCompactnessFactorQuery.h>
#include <avtTimeQuery.h>
#include <avtTotalRevolvedSurfaceAreaQuery.h>
#include <avtTotalRevolvedVolumeQuery.h>
......@@ -133,6 +134,9 @@ avtQueryFactory::Instance()
// Hank Childs, Wed May 18 16:14:23 PDT 2005
// Added Moment of Inertia, Centroid queries.
//
// Hank Childs, Thu Jul 14 14:12:12 PDT 2005
// Add Spherical Compactness Factor.
//
// ****************************************************************************
......@@ -208,6 +212,10 @@ avtQueryFactory::CreateQuery(const QueryAttributes *qa)
{
query = new avtMomentOfInertiaQuery();
}
else if (qname == "Spherical Compactness Factor")
{
query = new avtSphericalCompactnessFactorQuery();
}
else if (qname == "Weighted Variable Sum")
{
query = new avtWeightedVariableSummationQuery();
......
// ************************************************************************* //
// avtCentroidQuery.C //
// avtCentroidQuery.C //
// ************************************************************************* //
#include <avtCentroidQuery.h>
......@@ -63,7 +63,7 @@ avtCentroidQuery::avtCentroidQuery()
// because it causes problems for certain compilers.
//
// Programmer: Hank Childs
// Creation: May 19, 2004
// Creation: May 19, 2005
//
// ****************************************************************************
......
......@@ -811,7 +811,9 @@ avtMinMaxQuery::InfoToString(const MinMaxInfo &info)
}
os << ">)" << ends;
string str(os.str());
#if !defined(_WIN32)
os.freeze(false);
#endif
return str;
}
......
// ************************************************************************* //
// avtSphericalCompactnessFactorQuery.C //
// ************************************************************************* //
#include <avtSphericalCompactnessFactorQuery.h>
#include <vtkCell.h>
#ifdef PARALLEL
#include <mpi.h>
#endif
#include <vtkCellData.h>
#include <vtkDataArray.h>
#include <vtkDataSet.h>
#include <vtkVisItUtility.h>
#include <avtCallback.h>
#include <avtParallel.h>
#include <avtRevolvedVolume.h>
#include <avtSourceFromAVTDataset.h>
#include <avtVMetricVolume.h>
#include <DebugStream.h>
#include <ImproperUseException.h>
#include <InvalidVariableException.h>
#include <InvalidDimensionsException.h>
#include <NonQueryableInputException.h>
#include <snprintf.h>
#include <float.h>
#include <math.h>
using std::string;
using std::vector;
#if !defined(M_PI)
#define M_PI 3.14159265358979323846
#endif
// ****************************************************************************
// Method: avtSphericalCompactnessFactorQuery constructor
//
// Programmer: Hank Childs
// Creation: July 14, 2005
//
// ****************************************************************************
avtSphericalCompactnessFactorQuery::avtSphericalCompactnessFactorQuery()
{
rev_volume = new avtRevolvedVolume;
volume = new avtVMetricVolume;
}
// ****************************************************************************
// Method: avtSphericalCompactnessFactorQuery destructor
//
// Purpose:
// Defines the destructor. Note: this should not be inlined in the header
// because it causes problems for certain compilers.
//
// Programmer: Hank Childs
// Creation: July 14, 2005
//
// ****************************************************************************
avtSphericalCompactnessFactorQuery::~avtSphericalCompactnessFactorQuery()
{
delete volume;
delete rev_volume;
}
// ****************************************************************************
// Method: avtSphericalCompactnessFactorQuery::PreExecute
//
// Purpose:
// This is called before all of the domains are executed.
//
// Programmer: Hank Childs
// Creation: July 14, 2005
//
// ****************************************************************************
void
avtSphericalCompactnessFactorQuery::PreExecute(void)
{
for (int i = 0 ; i < 3 ; i++)
centroid[i] = 0.;
total_volume = 0.;
}
// ****************************************************************************
// Method: avtSphericalCompactnessFactorQuery::MidExecute
//
// Purpose:
// This is called after Execute1 and before Execute2.
//
// Programmer: Hank Childs
// Creation: July 14, 2005
//
// ****************************************************************************
void
avtSphericalCompactnessFactorQuery::MidExecute(void)
{
SumDoubleAcrossAllProcessors(total_volume);
double C_tmp[3] = { 0, 0, 0 };
SumDoubleArrayAcrossAllProcessors(centroid, C_tmp, 3);
if (total_volume != 0.)
{
C_tmp[0] /= total_volume;
C_tmp[1] /= total_volume;
C_tmp[2] /= total_volume;
}
centroid[0] = C_tmp[0];
centroid[1] = C_tmp[1];
centroid[2] = C_tmp[2];
volume_inside = 0.;
radius = pow(total_volume*0.75/M_PI, 0.3333333);
if (is2D)
{
sphere_center[0] = centroid[0];
sphere_center[1] = 0.;
sphere_center[2] = 0.;
}
else
{
sphere_center[0] = centroid[0];