Commit c8818030 authored by hrchilds's avatar hrchilds

Update from January 10, 2006

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@595 18c085ea-50e0-402c-830e-de6fd14e8384
parent 5378c9d8
/* XPM */
static const char * macroexec_xpm[] = {
"32 32 10 1",
". c None",
"+ c #8B8BE0",
"@ c #0000FF",
"# c #1616F9",
"$ c #7373E5",
"% c #B9B9D6",
"& c #5C5CEA",
"* c #A2A2DB",
"= c #2D2DF4",
"- c #4545EF",
"................................",
"................................",
"................................",
"................................",
"................................",
".....+..........................",
".....@#$%.......................",
".....@@@@&*.....................",
".....@@@@@@=*...................",
".....@@@@@@@@#$.................",
".....@@@@@@@@@@@&%..............",
".....@@@@@@@@@@@@@=*............",
".....@@@@@@@@@@@@@@@=$..........",
".....@@@@@@@@@@@@@@@@@#&%.......",
".....@@@@@@@@@@@@@@@@@@@@-*.....",
".....@@@@@@@@@@@@@@@@@@@@=*.....",
".....@@@@@@@@@@@@@@@@@@-*.......",
".....@@@@@@@@@@@@@@@@&%.........",
".....@@@@@@@@@@@@@@&%...........",
".....@@@@@@@@@@@@&%.............",
".....@@@@@@@@@#$%...............",
".....@@@@@@@#$..................",
".....@@@@@#$....................",
".....@@@#$......................",
".....@=+........................",
".....*..........................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................"};
/* XPM */
static const char * macropause_xpm[] = {
"32 32 10 1",
"- c None",
". c #0202FE",
"+ c #1616FA",
"@ c #2626F6",
"# c #3636F2",
"$ c #4646EE",
"% c #7A7AE4",
"& c #8A8AE2",
"* c #8E8EDE",
"= c #9696DE",
"--------------------------------",
"--------------------------------",
"--------------------------------",
"--------------------------------",
"--------------------------------",
"--------------------------------",
"--------------------------------",
"--------------------------------",
"-....--....-------&$+..+$&------",
"-....--....-----=@........@=----",
"-....--....----%............%---",
"-....--....---*..............*--",
"-....--....---+..............+--",
"-....--....--%................%-",
"-....--....--#................#-",
"-....--....--+................+-",
"-....--....--..................-",
"-....--....--+................+-",
"-....--....--#................#-",
"-....--....--%................%-",
"-....--....---+..............+--",
"-....--....---*..............*--",
"-....--....----%............%---",
"-....--....-----=@........@=----",
"-....--....-------&$+..+$&------",
"--------------------------------",
"--------------------------------",
"--------------------------------",
"--------------------------------",
"--------------------------------",
"--------------------------------",
"--------------------------------"};
/* XPM */
static const char * macrorecord_xpm[] = {
"32 32 10 1",
"- c None",
". c #0202FE",
"+ c #1616FA",
"@ c #2626F6",
"# c #3636F2",
"$ c #4646EE",
"% c #7A7AE4",
"& c #8A8AE2",
"* c #8E8EDE",
"= c #9696DE",
"--------------------------------",
"--------------------------------",
"--------------------------------",
"--------------------------------",
"--------------------------------",
"--------------------------------",
"--------------------------------",
"------------&$+..+$&------------",
"----------=@........@=----------",
"---------%............%---------",
"--------*..............*--------",
"--------+..............+--------",
"-------%................%-------",
"-------#................#-------",
"-------+................+-------",
"-------..................-------",
"-------+................+-------",
"-------#................#-------",
"-------%................%-------",
"--------+..............+--------",
"--------*..............*--------",
"---------%............%---------",
"----------=@........@=----------",
"------------&$+..+$&------------",
"--------------------------------",
"--------------------------------",
"--------------------------------",
"--------------------------------",
"--------------------------------",
"--------------------------------",
"--------------------------------",
"--------------------------------"};
/* XPM */
static const char * macrostop_xpm[] = {
"32 32 2 1",
". c None",
"+ c #0000FF",
"................................",
"................................",
"................................",
"................................",
"................................",
".....++++++++++++++++++++++.....",
".....++++++++++++++++++++++.....",
".....++++++++++++++++++++++.....",
".....++++++++++++++++++++++.....",
".....++++++++++++++++++++++.....",
".....++++++++++++++++++++++.....",
".....++++++++++++++++++++++.....",
".....++++++++++++++++++++++.....",
".....++++++++++++++++++++++.....",
".....++++++++++++++++++++++.....",
".....++++++++++++++++++++++.....",
".....++++++++++++++++++++++.....",
".....++++++++++++++++++++++.....",
".....++++++++++++++++++++++.....",
".....++++++++++++++++++++++.....",
".....++++++++++++++++++++++.....",
".....++++++++++++++++++++++.....",
".....++++++++++++++++++++++.....",
".....++++++++++++++++++++++.....",
".....++++++++++++++++++++++.....",
".....++++++++++++++++++++++.....",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................"};
......@@ -55,6 +55,9 @@ class ViewerPlot;
// Hank Childs, Tue Mar 22 16:06:15 PST 2005
// Made destructor virtual.
//
// Brad Whitlock, Thu Jan 5 14:40:42 PST 2006
// I removed explicit support for logging from the scripting plugins.
//
// ****************************************************************************
class PLUGIN_API GeneralOperatorPluginInfo
......@@ -115,10 +118,10 @@ class PLUGIN_API EngineOperatorPluginInfo : public virtual CommonOperatorPluginI
class PLUGIN_API ScriptingOperatorPluginInfo : public virtual CommonOperatorPluginInfo
{
public:
virtual void InitializePlugin(AttributeSubject *subj, FILE *logFile) = 0;
virtual void InitializePlugin(AttributeSubject *subj, void *data) = 0;
virtual void *GetMethodTable(int *nMethods) = 0;
virtual char *GetLogString() = 0;
virtual bool TypesMatch(void *pyobject) { return false; }
virtual void SetLogging(bool val) = 0;
virtual void SetDefaults(const AttributeSubject *) = 0;
};
......
......@@ -91,6 +91,9 @@ class avtPlot;
// Hank Childs, Tue Jul 19 14:23:56 PDT 2005
// Added VAR_CATEGORY_ARRAY.
//
// Brad Whitlock, Thu Jan 5 14:40:42 PST 2006
// I removed explicit support for logging from the scripting plugins.
//
// ****************************************************************************
class PLUGIN_API GeneralPlotPluginInfo
......@@ -161,10 +164,10 @@ class PLUGIN_API EnginePlotPluginInfo : public virtual CommonPlotPluginInfo
class PLUGIN_API ScriptingPlotPluginInfo : public virtual CommonPlotPluginInfo
{
public:
virtual void InitializePlugin(AttributeSubject *subj, FILE *logFile) = 0;
virtual void InitializePlugin(AttributeSubject *subj, void *data) = 0;
virtual void *GetMethodTable(int *nMethods) = 0;
virtual char *GetLogString() = 0;
virtual bool TypesMatch(void *) { return false; }
virtual void SetLogging(bool val) = 0;
virtual void SetDefaults(const AttributeSubject *) = 0;
};
......
Constant: DEFAULT_FULL_FRAME_AUTO_THRESHOLD
Declaration: static const double DEFAULT_FULL_FRAME_AUTO_THRESHOLD;
Definition: const double View2DAttributes::DEFAULT_FULL_FRAME_AUTO_THRESHOLD = 100.0;
Function: GetUseFullFrame
Declaration: bool GetUseFullFrame(const double *limits=0) const;
Definition:
// ****************************************************************************
// Method: View2DAttributes::GetUseFullFrame
//
// Purpose: Together with the full frame activation mode and, optionally,
// limits, this method determines if full frame mode should be used.
//
// Programmer: Mark C. Miller
// Creation: July 20, 2005
//
// ****************************************************************************
bool
View2DAttributes::GetUseFullFrame(const double *limits) const
{
if (fullFrameActivationMode == Off)
return false;
if (fullFrameActivationMode == On)
return true;
if (limits == 0)
return true;
double dlimit1 = limits[1] - limits[0];
double dlimit2 = limits[3] - limits[2];
double aspect;
if (dlimit1 > dlimit2)
{
if (dlimit2 != 0)
aspect = dlimit1 / dlimit2;
else
aspect = fullFrameAutoThreshold;
}
else
{
if (dlimit1 != 0)
aspect = dlimit2 / dlimit1;
else
aspect = fullFrameAutoThreshold;
}
if (aspect >= fullFrameAutoThreshold)
return true;
else
return false;
}
Function: SetUseFullFrame
Declaration: void SetUseFullFrame(bool ff);
Definition:
// ****************************************************************************
// Method: View2DAttributes::SetUseFullFrame
//
// Purpose: Sets full frame activation mode to On/Off if it is not currently
// in Auto mode. Otherwise, it does not change the mode.
//
// Programmer: Mark C. Miller
// Creation: July 20, 2005
//
// ****************************************************************************
void
View2DAttributes::SetUseFullFrame(bool ff)
{
if (fullFrameActivationMode == Auto)
return;
if (ff)
fullFrameActivationMode = On;
else
fullFrameActivationMode = Off;
}
......@@ -43,11 +43,15 @@
// Hank Childs, Fri Sep 9 10:46:17 PDT 2005
// Initialized varDim.
//
// Hank Childs, Thu Jan 5 15:36:14 PST 2006
// Initialized isNodal.
//
// ****************************************************************************
avtCMFEExpression::avtCMFEExpression()
{
varDim = 1;;
isNodal = false;
}
......@@ -69,6 +73,25 @@ avtCMFEExpression::~avtCMFEExpression()
}
// ****************************************************************************
// Method: avtCMFEExpression::AddInputVariableName
//
// Purpose:
// Adds an input variable's name.
//
// Programmer: Hank Childs
// Creation: January 5, 2006
//
// ****************************************************************************
void
avtCMFEExpression::AddInputVariableName(const char *vname)
{
avtExpressionFilter::AddInputVariableName(vname);
varnames.push_back(vname);
}
// ****************************************************************************
// Method: avtCMFEExpression::PreExecute
//
......@@ -106,6 +129,9 @@ avtCMFEExpression::PreExecute(void)
// Hank Childs, Fri Oct 7 08:31:30 PDT 2005
// Add support for implied database names.
//
// Hank Childs, Thu Jan 5 16:33:39 PST 2006
// Add support for a third variable to set up default values.
//
// ****************************************************************************
void
......@@ -116,22 +142,31 @@ avtCMFEExpression::ProcessArguments(ArgsExpr *args,
std::vector<ArgExpr*> *arguments = args->GetArgs();
int nargs = arguments->size();
int targetArgs = 2;
const char *mismatchMsg =
"The database comparison expression expects two "
"arguments: the database variable and a mesh to sample "
"onto.";
if (HasDefaultVariable())
{
targetArgs = 3;
mismatchMsg =
"The database comparison expression expects three "
"arguments: the database variable, a mesh to sample "
"onto, and a value or constant to assign to parts of"
" the mesh that are not overlapping.";
}
// Check if there's a second argument.
if (nargs < 2)
if (nargs < targetArgs)
{
EXCEPTION1(ExpressionException,
"The database comparison expression only expects two "
"arguments: the database variable and a mesh to sample "
"onto.");
EXCEPTION1(ExpressionException, mismatchMsg);
}
// See if there are other arguments.
if (nargs > 2)
if (nargs > targetArgs)
{
EXCEPTION1(ExpressionException,
"The database comparison expression only expects two "
"arguments. To specify more than one database, please "
"use several cmfe expressions.");
EXCEPTION1(ExpressionException, mismatchMsg);
}
// Tell the second argument (the mesh) to create its filters.
......@@ -139,6 +174,14 @@ avtCMFEExpression::ProcessArguments(ArgsExpr *args,
avtExprNode *secondTree = dynamic_cast<avtExprNode*>(secondarg->GetExpr());
secondTree->CreateFilters(state);
if (targetArgs == 3)
{
// Tell the third argument (the default var) to create its filters.
ArgExpr *thirdarg = (*arguments)[2];
avtExprNode *thirdTree=dynamic_cast<avtExprNode*>(thirdarg->GetExpr());
thirdTree->CreateFilters(state);
}
// Pull off the first argument and see if it's a string or a list.
ArgExpr *firstarg = (*arguments)[0];
argument_expression = firstarg->GetText();
......@@ -267,6 +310,9 @@ avtCMFEExpression::ProcessArguments(ArgsExpr *args,
// Add support for implied database names. Also use the same SIL
// restriction if the derived type thinks we should.
//
// Hank Childs, Thu Jan 5 15:36:14 PST 2006
// Add better support for variable centering.
//
// ****************************************************************************
void
......@@ -290,7 +336,6 @@ avtCMFEExpression::Execute()
// argument. See extended comment below in section #2.
std::string expr_var = "_avt_cmfe_expression_";
// HACK. This will only work for conn_cmfe.
avtDataSpecification_p ds = new avtDataSpecification(
dob->GetTerminatingSource()
->GetGeneralPipelineSpecification()
......@@ -300,6 +345,7 @@ avtCMFEExpression::Execute()
new avtPipelineSpecification(ds, 1);
if (UseIdenticalSIL())
{
// This will only work for conn_cmfe.
ds = new avtDataSpecification(ds, firstDBSIL);
spec = new avtPipelineSpecification(spec, ds);
}
......@@ -370,6 +416,8 @@ avtCMFEExpression::Execute()
CopyTo(dsp, dob);
varDim =
dsp->GetInfo().GetAttributes().GetVariableDimension(expr_var.c_str());
isNodal = (dsp->GetInfo().GetAttributes().GetCentering(expr_var.c_str())
== AVT_NODECENT);
avtDataTree_p output = PerformCMFE(GetInputDataTree(), dsp->GetDataTree(),
expr_var, outputVariableName);
......
......@@ -30,6 +30,11 @@ class avtDatabase;
// Add support for expressions. Also add GetVariableDimension, which is
// necessary for non-scalars.
//
// Hank Childs, Thu Jan 5 15:34:17 PST 2006
// Do a better job of getting centering of input variable. Also add
// support for a "default" variable for when we are sampling onto
// non-overlapping meshes.
//
// ****************************************************************************
class EXPRESSION_API avtCMFEExpression : public avtExpressionFilter
......@@ -44,6 +49,8 @@ class EXPRESSION_API avtCMFEExpression : public avtExpressionFilter
virtual void ProcessArguments(ArgsExpr*, ExprPipelineState *);
virtual int NumVariableArguments() { return 1; };
virtual int GetVariableDimension() { return varDim; };
virtual bool IsPointVariable(void) { return isNodal; };
virtual void AddInputVariableName(const char *);
protected:
bool issuedWarning;
......@@ -58,6 +65,8 @@ class EXPRESSION_API avtCMFEExpression : public avtExpressionFilter
avtSILRestriction_p firstDBSIL;
std::string argument_expression;
int varDim;
bool isNodal;
std::vector<std::string> varnames;
virtual void PreExecute(void);
virtual void Execute(void);
......@@ -67,6 +76,7 @@ class EXPRESSION_API avtCMFEExpression : public avtExpressionFilter
const std::string &) = 0;
virtual void ExamineSpecification(avtPipelineSpecification_p);
virtual bool UseIdenticalSIL(void) { return false; };
virtual bool HasDefaultVariable(void) { return false; };
int GetTimestate(ref_ptr<avtDatabase>);
};
......
......@@ -21,6 +21,12 @@ class ConstExpr;
// Programmer: Hank Childs
// Creation: August 26, 2005
//
// Modifications:
//
// Hank Childs, Mon Oct 10 17:08:05 PDT 2005
// Remove virtual designation from ExecuteTree, since its not really
// intended to be a virtual method.
//
// ****************************************************************************
class EXPRESSION_API avtConnCMFEExpression : public avtCMFEExpression
......@@ -36,7 +42,7 @@ class EXPRESSION_API avtConnCMFEExpression : public avtCMFEExpression
virtual avtDataTree_p PerformCMFE(avtDataTree_p, avtDataTree_p,
const std::string &,
const std::string &);
virtual avtDataTree_p ExecuteTree(avtDataTree_p, avtDataTree_p,
avtDataTree_p ExecuteTree(avtDataTree_p, avtDataTree_p,
const std::string &,
const std::string &);
virtual bool UseIdenticalSIL(void) { return true; };
......
This diff is collapsed.
// ************************************************************************* //
// avtPosCMFEExpression.h //
// ************************************************************************* //
#ifndef AVT_POS_CMFE_EXPRESSION_H
#define AVT_POS_CMFE_EXPRESSION_H
#include <avtCMFEExpression.h>
#include <avtIntervalTree.h>
class vtkCell;
class vtkDataArray;
class ArgsExpr;
class ExprPipelineState;
class ConstExpr;
// ****************************************************************************
// Class: avtPosCMFEExpression
//
// Purpose:
// Does a position based cross-mesh field evaluation.
//
// Programmer: Hank Childs
// Creation: October 10, 2005
//
// ****************************************************************************
class EXPRESSION_API avtPosCMFEExpression : public avtCMFEExpression
{
public:
avtPosCMFEExpression();
virtual ~avtPosCMFEExpression();
virtual const char *GetType(void){ return "avtPosCMFEExpression"; };
virtual const char *GetDescription(void)
{return "Evaluating field";};
protected:
virtual avtDataTree_p PerformCMFE(avtDataTree_p, avtDataTree_p,
const std::string &,
const std::string &);
virtual bool UseIdenticalSIL(void) { return false; };
virtual bool HasDefaultVariable(void) { return true; };
class SpatialPartition;
class DesiredPoints
{
public:
DesiredPoints(bool, int);
virtual ~DesiredPoints();
void AddDataset(vtkDataSet *);
void Finalize();
int GetNumberOfPoints() {return total_nvals;};
void GetPoint(int, float *) const;
void SetValue(int, float *);
const float *GetValue(int, int) const;
void RelocatePointsUsingPartition(SpatialPartition &);
void UnRelocatePoints(SpatialPartition &);
private:
bool isNodal;
int nComps;
int total_nvals;