Commit 9b615be6 authored by hrchilds's avatar hrchilds

Update from January 23, 2006

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@604 18c085ea-50e0-402c-830e-de6fd14e8384
parent 112077a5
......@@ -89,7 +89,7 @@ SaveWindowAttributes::CompressionType_FromString(const std::string &s, SaveWindo
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Aug 12 11:41:11 PDT 2004
// Creation: Sun Jan 22 19:51:42 PST 2006
//
// Modifications:
//
......@@ -117,7 +117,7 @@ SaveWindowAttributes::SaveWindowAttributes() : AttributeSubject("bssbibiibbibbsb
maintainAspect = true;
width = 1024;
height = 1024;
screenCapture = true;
screenCapture = false;
saveTiled = false;
quality = 80;
progressive = false;
......@@ -135,7 +135,7 @@ SaveWindowAttributes::SaveWindowAttributes() : AttributeSubject("bssbibiibbibbsb
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Aug 12 11:41:11 PDT 2004
// Creation: Sun Jan 22 19:51:42 PST 2006
//
// Modifications:
//
......@@ -172,7 +172,7 @@ SaveWindowAttributes::SaveWindowAttributes(const SaveWindowAttributes &obj) : At
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Aug 12 11:41:11 PDT 2004
// Creation: Sun Jan 22 19:51:42 PST 2006
//
// Modifications:
//
......@@ -192,15 +192,16 @@ SaveWindowAttributes::~SaveWindowAttributes()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Aug 12 11:41:11 PDT 2004
// Creation: Sun Jan 22 19:51:42 PST 2006
//
// Modifications:
//
// ****************************************************************************
void
SaveWindowAttributes&
SaveWindowAttributes::operator = (const SaveWindowAttributes &obj)
{
if (this == &obj) return *this;
outputToCurrentDirectory = obj.outputToCurrentDirectory;
outputDirectory = obj.outputDirectory;
fileName = obj.fileName;
......@@ -219,6 +220,7 @@ SaveWindowAttributes::operator = (const SaveWindowAttributes &obj)
compression = obj.compression;
SelectAll();
return *this;
}
// ****************************************************************************
......@@ -230,7 +232,7 @@ SaveWindowAttributes::operator = (const SaveWindowAttributes &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Aug 12 11:41:11 PDT 2004
// Creation: Sun Jan 22 19:51:42 PST 2006
//
// Modifications:
//
......@@ -267,7 +269,7 @@ SaveWindowAttributes::operator == (const SaveWindowAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Aug 12 11:41:11 PDT 2004
// Creation: Sun Jan 22 19:51:42 PST 2006
//
// Modifications:
//
......@@ -288,7 +290,7 @@ SaveWindowAttributes::operator != (const SaveWindowAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Aug 12 11:41:11 PDT 2004
// Creation: Sun Jan 22 19:51:42 PST 2006
//
// Modifications:
//
......@@ -309,7 +311,7 @@ SaveWindowAttributes::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Aug 12 11:41:11 PDT 2004
// Creation: Sun Jan 22 19:51:42 PST 2006
//
// Modifications:
//
......@@ -337,7 +339,7 @@ SaveWindowAttributes::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Aug 12 11:41:11 PDT 2004
// Creation: Sun Jan 22 19:51:42 PST 2006
//
// Modifications:
//
......@@ -363,7 +365,7 @@ SaveWindowAttributes::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Aug 12 11:41:11 PDT 2004
// Creation: Sun Jan 22 19:51:42 PST 2006
//
// Modifications:
//
......@@ -390,7 +392,7 @@ SaveWindowAttributes::NewInstance(bool copy) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Aug 12 11:41:11 PDT 2004
// Creation: Sun Jan 22 19:51:42 PST 2006
//
// Modifications:
//
......@@ -430,7 +432,7 @@ SaveWindowAttributes::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Aug 12 11:41:11 PDT 2004
// Creation: Sun Jan 22 19:51:42 PST 2006
//
// Modifications:
//
......@@ -562,7 +564,7 @@ SaveWindowAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool f
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Aug 12 11:41:11 PDT 2004
// Creation: Sun Jan 22 19:51:42 PST 2006
//
// Modifications:
//
......@@ -911,7 +913,7 @@ SaveWindowAttributes::SelectLastRealFilename()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Aug 12 11:41:11 PDT 2004
// Creation: Sun Jan 22 19:51:42 PST 2006
//
// Modifications:
//
......@@ -951,7 +953,7 @@ SaveWindowAttributes::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Aug 12 11:41:11 PDT 2004
// Creation: Sun Jan 22 19:51:42 PST 2006
//
// Modifications:
//
......@@ -991,7 +993,7 @@ SaveWindowAttributes::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Aug 12 11:41:11 PDT 2004
// Creation: Sun Jan 22 19:51:42 PST 2006
//
// Modifications:
//
......@@ -1031,7 +1033,7 @@ SaveWindowAttributes::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Aug 12 11:41:11 PDT 2004
// Creation: Sun Jan 22 19:51:42 PST 2006
//
// Modifications:
//
......
......@@ -13,7 +13,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Aug 12 11:41:11 PDT 2004
// Creation: Sun Jan 22 19:51:42 PST 2006
//
// Modifications:
//
......@@ -49,7 +49,7 @@ public:
SaveWindowAttributes(const SaveWindowAttributes &obj);
virtual ~SaveWindowAttributes();
virtual void operator = (const SaveWindowAttributes &obj);
virtual SaveWindowAttributes& operator = (const SaveWindowAttributes &obj);
virtual bool operator == (const SaveWindowAttributes &obj) const;
virtual bool operator != (const SaveWindowAttributes &obj) const;
......
......@@ -45,7 +45,7 @@
1024
</Field>
<Field name="screenCapture" label="screenCapture" type="bool">
true
false
</Field>
<Field name="saveTiled" label="saveTiled" type="bool">
false
......
......@@ -74,6 +74,11 @@ avtExpressionFilter::~avtExpressionFilter()
// Hank Childs, Sat Jan 1 11:11:17 PST 2005
// Do not assume that there are arguments (which leads to a crash).
//
// Hank Childs, Sun Jan 22 12:31:17 PST 2006
// Don't do further processing for lists and other constructs that aren't
// actually avtExprNodes. This can happen when processing macro
// expressions.
//
// ****************************************************************************
void
......@@ -88,7 +93,17 @@ avtExpressionFilter::ProcessArguments(ArgsExpr *args, ExprPipelineState *state)
std::vector<ArgExpr*> *arguments = args->GetArgs();
std::vector<ArgExpr*>::iterator i;
for (i=arguments->begin(); i != arguments->end(); i++)
dynamic_cast<avtExprNode*>((*i)->GetExpr())->CreateFilters(state);
{
ExprParseTreeNode *n = (*i)->GetExpr();
avtExprNode *expr_node = dynamic_cast<avtExprNode*>((*i)->GetExpr());
if (expr_node == NULL)
{
// Probably a list or some other construct that doesn't need
// to create filters.
continue;
}
expr_node->CreateFilters(state);
}
}
......@@ -141,7 +156,7 @@ avtExpressionFilter::SetOutputVariableName(const char *name)
// DataExents now always have only 2 components.
//
// Hank Childs, Mon Dec 27 10:28:51 PST 2004
// Call avtDatasetToDatasetFilter's PostExecute, since that is now the base
// Call avtDatasetToDatasetFilter's PreExecute, since that is now the base
// class.
//
// ****************************************************************************
......@@ -438,7 +453,7 @@ avtExpressionFilter::PerformRestriction(avtPipelineSpecification_p spec)
// ****************************************************************************
bool
avtExpressionFilter::IsPointVariable()
avtExpressionFilter::IsPointVariable(void)
{
avtDataAttributes &atts = GetInput()->GetInfo().GetAttributes();
if (atts.ValidActiveVariable())
......@@ -450,6 +465,30 @@ avtExpressionFilter::IsPointVariable()
}
// ****************************************************************************
// Method: avtExpressionFilter::GetVariableDimension
//
// Purpose:
// Determines the variable dimension.
//
// Returns: The variable dimension.
//
// Programmer: Hank Childs
// Creation: January 21, 2006
//
// ****************************************************************************
int
avtExpressionFilter::GetVariableDimension(void)
{
avtDataAttributes &atts = GetInput()->GetInfo().GetAttributes();
if (atts.ValidActiveVariable())
return atts.GetVariableDimension();
return 1;
}
// ****************************************************************************
// Method: avtExpressionFilter::Recenter
//
......
......@@ -57,6 +57,10 @@ class ExprPipelineState;
// Hank Childs, Mon Aug 29 14:44:20 PDT 2005
// Added SetExpressionAtts.
//
// Hank Childs, Sun Jan 22 12:38:57 PST 2006
// Made Recenter be a static, public function. Also improved implementation
// of GetVariableDimension.
//
// ****************************************************************************
class EXPRESSION_API avtExpressionFilter : virtual public
......@@ -74,6 +78,7 @@ class EXPRESSION_API avtExpressionFilter : virtual public
virtual void ProcessArguments(ArgsExpr *, ExprPipelineState *);
virtual int NumVariableArguments() = 0;
static vtkDataArray *Recenter(vtkDataSet*, vtkDataArray*,avtCentering);
protected:
char *outputVariableName;
......@@ -90,10 +95,9 @@ class EXPRESSION_API avtExpressionFilter : virtual public
PerformRestriction(avtPipelineSpecification_p);
virtual void ExamineSpecification(avtPipelineSpecification_p);
virtual int GetVariableDimension() { return 1; };
virtual int GetVariableDimension();
virtual avtVarType GetVariableType() { return AVT_UNKNOWN_TYPE; };
vtkDataArray *Recenter(vtkDataSet*, vtkDataArray*,avtCentering);
void UpdateExtents(avtDataTree_p);
};
......
// ************************************************************************* //
// avtEvalPlaneExpression.h //
// ************************************************************************* //
#include <avtEvalPlaneExpression.h>
#include <vtkMatrix4x4.h>
#include <avtCustomTransform.h>
#include <avtSourceFromAVTDataset.h>
#include <ExpressionException.h>
// ****************************************************************************
// Method: avtEvalPlaneExpression constructor
//
// Purpose:
// Defines the constructor. Note: this should not be inlined in the
// header because it causes problems for certain compilers.
//
// Programmer: Hank Childs
// Creation: January 21, 2006
//
// ****************************************************************************
avtEvalPlaneExpression::avtEvalPlaneExpression()
{
}
// ****************************************************************************
// Method: avtEvalPlaneExpression 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: January 21, 2006
//
// ****************************************************************************
avtEvalPlaneExpression::~avtEvalPlaneExpression()
{
}
// ****************************************************************************
// Method: avtEvalPlaneExpression::TransformData
//
// Purpose:
// Transforms the data based on the input parameters.
//
// Programmer: Hank Childs
// Creation: January 21, 2006
//
// ****************************************************************************
avtDataObject_p
avtEvalPlaneExpression::TransformData(avtDataObject_p input)
{
//
// Gameplan: For each point (X,Y,Z), the distance to the plane is:
// DIST = (A*X + B*Y + C*Z + D) / sqrt(A^2 + B^2 + C^2).
// So the reflection would be a translation along (A,B,C) by a distance
// of 2*DIST. So set up a matrix that reflects this.
//
float A = inputParameters[0];
float B = inputParameters[1];
float C = inputParameters[2];
//
// Start off by normalizing the plane.
//
float mag = sqrt(A*A + B*B + C*C);
if (mag == 0.)
{
EXCEPTION1(ExpressionException, "The plane has a degenerate normal.");
}
A /= mag;
B /= mag;
C /= mag;
float Ox = inputParameters[3];
float Oy = inputParameters[4];
float Oz = inputParameters[5];
float D = -(A*Ox + B*Oy + C*Oz);
vtkMatrix4x4 *mat = vtkMatrix4x4::New();
mat->SetElement(0, 0, -2*A*A + 1);
mat->SetElement(0, 1, -2*A*B);
mat->SetElement(0, 2, -2*A*C);
mat->SetElement(0, 3, -2*A*D);
mat->SetElement(1, 0, -2*B*A);
mat->SetElement(1, 1, -2*B*B + 1);
mat->SetElement(1, 2, -2*B*C);
mat->SetElement(1, 3, -2*B*D);
mat->SetElement(2, 0, -2*C*A);
mat->SetElement(2, 1, -2*C*B);
mat->SetElement(2, 2, -2*C*C + 1);
mat->SetElement(2, 3, -2*C*D);
avtDataset_p ds;
CopyTo(ds, input);
avtSourceFromAVTDataset termsrc(ds);
avtCustomTransform transform;
transform.SetMatrix(mat);
transform.SetInput(termsrc.GetOutput());
avtDataObject_p output = transform.GetOutput();
output->Update(GetGeneralPipelineSpecification());
mat->Delete();
return output;
}
// ************************************************************************* //
// avtEvalPlaneExpression.h //
// ************************************************************************* //
#ifndef AVT_EVAL_PLANE_EXPRESSION_H
#define AVT_EVAL_PLANE_EXPRESSION_H
#include <avtSymmEvalExpression.h>
// ****************************************************************************
// Class: avtEvalPlaneExpression
//
// Purpose:
// Creates an expression that evaluates values after a transformation.
//
// Programmer: Hank Childs
// Creation: January 21, 2006
//
// ****************************************************************************
class EXPRESSION_API avtEvalPlaneExpression : public avtSymmEvalExpression
{
public:
avtEvalPlaneExpression();
virtual ~avtEvalPlaneExpression();
protected:
virtual int GetNumberOfInputParameters(void) { return 6; };
virtual avtDataObject_p TransformData(avtDataObject_p);
};
#endif
// ************************************************************************* //
// avtEvalTransformExpression.h //
// ************************************************************************* //
#include <avtEvalTransformExpression.h>
#include <vtkMatrix4x4.h>
#include <avtCustomTransform.h>
#include <avtSourceFromAVTDataset.h>
// ****************************************************************************
// Method: avtEvalTransformExpression constructor
//
// Purpose:
// Defines the constructor. Note: this should not be inlined in the
// header because it causes problems for certain compilers.
//
// Programmer: Hank Childs
// Creation: January 21, 2006
//
// ****************************************************************************
avtEvalTransformExpression::avtEvalTransformExpression()
{
}
// ****************************************************************************
// Method: avtEvalTransformExpression 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: January 21, 2006
//
// ****************************************************************************
avtEvalTransformExpression::~avtEvalTransformExpression()
{
}
// ****************************************************************************
// Method: avtEvalTransformExpression::TransformData
//
// Purpose:
// Transforms the data based on the input parameters.
//
// Programmer: Hank Childs
// Creation: January 21, 2006
//
// ****************************************************************************
avtDataObject_p
avtEvalTransformExpression::TransformData(avtDataObject_p input)
{
vtkMatrix4x4 *mat = vtkMatrix4x4::New();
mat->SetElement(0, 0, inputParameters[0]);
mat->SetElement(0, 1, inputParameters[1]);
mat->SetElement(0, 2, inputParameters[2]);
mat->SetElement(1, 0, inputParameters[3]);
mat->SetElement(1, 1, inputParameters[4]);
mat->SetElement(1, 2, inputParameters[5]);
mat->SetElement(2, 0, inputParameters[6]);
mat->SetElement(2, 1, inputParameters[7]);
mat->SetElement(2, 2, inputParameters[8]);
avtDataset_p ds;
CopyTo(ds, input);
avtSourceFromAVTDataset termsrc(ds);
avtCustomTransform transform;
transform.SetMatrix(mat);
transform.SetInput(termsrc.GetOutput());
avtDataObject_p output = transform.GetOutput();
output->Update(GetGeneralPipelineSpecification());
mat->Delete();
return output;
}
// ************************************************************************* //
// avtEvalTransformExpression.h //
// ************************************************************************* //
#ifndef AVT_EVAL_TRANSFORM_EXPRESSION_H
#define AVT_EVAL_TRANSFORM_EXPRESSION_H
#include <avtSymmEvalExpression.h>
// ****************************************************************************
// Class: avtEvalTransformExpression
//
// Purpose:
// Creates an expression that evaluates values after a transformation.
//
// Programmer: Hank Childs
// Creation: January 21, 2006
//
// ****************************************************************************
class EXPRESSION_API avtEvalTransformExpression : public avtSymmEvalExpression
{
public:
avtEvalTransformExpression();
virtual ~avtEvalTransformExpression();
protected:
virtual int GetNumberOfInputParameters(void) { return 9; };
virtual avtDataObject_p TransformData(avtDataObject_p);
};
#endif
This diff is collapsed.
// ************************************************************************* //
// avtPosCMFEAlgorithm.h //
// ************************************************************************* //
#ifndef AVT_POS_CMFE_ALGORITHM_H
#define AVT_POS_CMFE_ALGORITHM_H
#include <expression_exports.h>
#include <avtDataTree.h>
#include <avtIntervalTree.h>
class vtkCell;
class vtkDataArray;
class vtkDataSet;
// ****************************************************************************
// Class: avtPosCMFEAlgorithm
//
// Purpose:
// Takes in two data sets and evaluates the field from one onto the mesh
// from another.
//
// Programmer: Hank Childs
// Creation: January 21, 2006 (originally in avtPosCMFEExpression)
//
// ****************************************************************************
class EXPRESSION_API avtPosCMFEAlgorithm
{
public:
static avtDataTree_p PerformCMFE(avtDataTree_p, avtDataTree_p,
const std::string &,
const std::string &,
const std::string &);
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;
int num_datasets;
vector<float *> pt_list;
vector<int> pt_list_size;
int *map_to_ds;
int *ds_start;
float *vals;
vector<float *> orig_pt_list;
vector<int> orig_pt_list_size;
vector<int> num_return_to_proc;
};
class FastLookupGrouping
{
public:
FastLookupGrouping(std::string varname, bool);
virtual ~FastLookupGrouping();
void AddMesh(vtkDataSet *);
vector<vtkDataSet *> GetMeshes(void) { return meshes; };
void ClearAllInputMeshes(void);
void Finalize();
void RelocateDataUsingPartition(SpatialPartition &);
bool GetValue(const float *, float *);
protected:
std::string varname;
bool isNodal;
int nZones;
vector<vtkDataSet *> meshes;
avtIntervalTree *itree;
int *map_to_ds;
int *ds_start;
};
class SpatialPartition
{
public:
SpatialPartition();
virtual ~SpatialPartition();
void CreatePartition(
avtPosCMFEAlgorithm::DesiredPoints &,
avtPosCMFEAlgorithm::FastLookupGrouping &,
double *);
int GetProcessor(float *);
int GetProcessor(vtkCell *);
void GetProcessorList(vtkCell *, std::vector<int> &);
protected:
avtIntervalTree *itree;
};
};