Commit c315161f authored by bonnell's avatar bonnell

From John Schmidt at U. Utah, Allow point glyphs to be scaled by a tensor variable

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@19600 18c085ea-50e0-402c-830e-de6fd14e8384
parent dda78a34
......@@ -691,6 +691,9 @@ avtPointGlypher::DataScalingOff(void)
// Added varDim argument so that data scaling can be done by other
// than just scalar vars.
//
// John Schmidt, Thu Nov 15 13:08:21 MST 2012
// Added capability to scale by a 3x3 tensor.
//
// ****************************************************************************
......@@ -716,6 +719,11 @@ avtPointGlypher::DataScalingOn(const string &sname, int varDim)
glyphFilter[i]->SetScaleModeToScaleByVector();
glyphFilter[i]->SelectVectorsForScaling(scalingVarName.c_str());
}
else if (scalingVarDim == 9)
{
glyphFilter[i]->SetScaleModeToScaleByTensor();
glyphFilter[i]->SelectTensorsForScaling(scalingVarName.c_str());
}
else
{
// will use the first three components to scale each
......
#/home/biagas2/visit/thirdparty/cmake/2.8.8/linux-x86_64_gcc-4.4/bin/cmake
#/home/biagas2/visit/thirdparty_2_6_0/cmake/2.8.8/linux-x86_64_gcc-4.4/bin/cmake
##
## ./build_visit generated host.cmake
## created: Mon Oct 15 13:12:26 PDT 2012
## ./build_visit2_6_0 generated host.cmake
## created: Mon Nov 12 15:49:44 PST 2012
## system: Linux beetlehunter 2.6.32-279.2.1.el6.x86_64 #1 SMP Thu Jul 5 21:08:58 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
## by: biagas2
##
## Setup VISITHOME & VISITARCH variables.
##
SET(VISITHOME /home/biagas2/visit/thirdparty)
SET(VISITHOME /home/biagas2/visit/thirdparty_2_6_0)
SET(VISITARCH linux-x86_64_gcc-4.4)
## Compiler flags.
......@@ -34,7 +34,7 @@ VISIT_OPTION_DEFAULT(VISIT_CXX_FLAGS " -m64 -fPIC -fvisibility=hidden" TYPE STRI
##
## Python
##
VISIT_OPTION_DEFAULT(VISIT_PYTHON_DIR /home/biagas2/visit/thirdparty/python/2.6.4/linux-x86_64_gcc-4.4)
VISIT_OPTION_DEFAULT(VISIT_PYTHON_DIR ${VISITHOME}/python/2.6.4/linux-x86_64_gcc-4.4)
##
## Mesa
......@@ -45,7 +45,7 @@ VISIT_OPTION_DEFAULT(VISIT_MESA_DIR ${VISITHOME}/mesa/7.8.2/${VISITARCH})
##
## VTK
##
VISIT_OPTION_DEFAULT(VISIT_VTK_DIR ${VISITHOME}/vtk/5.8.0/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_VTK_DIR ${VISITHOME}/vtk/5.8.0.a/${VISITARCH})
##
## Qt
......@@ -67,7 +67,7 @@ VISIT_OPTION_DEFAULT(VISIT_HDF5_LIBDEP ${VISITHOME}/szip/2.1/${VISITARCH}/lib sz
## HDF4
##
VISIT_OPTION_DEFAULT(VISIT_HDF4_DIR ${VISITHOME}/hdf4/4.2.5/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_HDF4_LIBDEP ${VISITHOME}/szip/2.1/${VISITARCH}/lib sz ${VISITHOME}/vtk/5.8.0/${VISITARCH}/lib vtkjpeg TYPE STRING)
VISIT_OPTION_DEFAULT(VISIT_HDF4_LIBDEP ${VISITHOME}/szip/2.1/${VISITARCH}/lib sz ${VISITHOME}/vtk/5.8.0.a/${VISITARCH}/lib vtkjpeg TYPE STRING)
##
## NetCDF
......@@ -95,7 +95,7 @@ VISIT_OPTION_DEFAULT(VISIT_EXODUSII_LIBDEP NETCDF_LIBRARY_DIR netcdf ${VISIT_NET
##
## Boxlib
##
VISIT_OPTION_DEFAULT(VISIT_BOXLIB_DIR ${VISITHOME}/boxlib/0.1.8/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_BOXLIB_DIR ${VISITHOME}/boxlib/1.0.7/${VISITARCH})
##
## CFITSIO
......@@ -160,3 +160,7 @@ VISIT_OPTION_DEFAULT(VISIT_XDMF_LIBDEP HDF5_LIBRARY_DIR hdf5 VTK_LIBRARY_DIRS
##
VISIT_OPTION_DEFAULT(VISIT_PYSIDE_DIR ${VISITHOME}/pyside/1.1.1/${VISITARCH}/)
##
## MANTA
##
VISIT_OPTION_DEFAULT(VISIT_MANTA_DIR ${VISITHOME}/manta/2540/${VISITARCH})
......@@ -77,6 +77,9 @@
// Allen Sanderson, Mon Mar 8 19:57:29 PST 2010
// Reorganize layout of widget.
//
// John Schmidt, Thu Nov 15 13:08:21 MST 2012
// Added Tensor quantities to the scaling toggle box.
//
// ****************************************************************************
QvisPointControl::QvisPointControl(QWidget *parent,
......@@ -122,8 +125,8 @@ QvisPointControl::QvisPointControl(QWidget *parent,
connect(sizeVarToggle, SIGNAL(toggled(bool)),
this, SLOT(sizeVarToggled(bool)));
topLayout->addWidget(sizeVarToggle, 1, 0, 1, 2);
sizeVarButton = new QvisVariableButton(true, true, true,
QvisVariableButton::Scalars, this);
int query_types = QvisVariableButton::Scalars | QvisVariableButton::Tensors;
sizeVarButton = new QvisVariableButton(true, true, true,query_types, this);
sizeVarButton->setEnabled(false);
connect(sizeVarButton, SIGNAL(activated(const QString &)),
this, SLOT(sizeVarChanged(const QString &)));
......
......@@ -120,6 +120,9 @@ enhancements and bug-fixes that were added to this release.</p>
<a name="Plot_changes"></a>
<p><b><font size="4">Changes to VisIt's plots in version 2.6</font></b></p>
<ul>
<li>Plots of point variables using a Box, Icoscahedron or Axis glyphs can now be scaled by a Tensor. Thanks John Schmidt! </li>
</ul>
<a name="Expression_changes"></a>
<p><b><font size="4">Changes to VisIt's expression language in version 2.6</font></b></p>
......
......@@ -63,6 +63,7 @@ vtkVisItGlyph3D::vtkVisItGlyph3D()
this->ScalarsForScaling = NULL;
this->VectorsForColoring = NULL;
this->VectorsForScaling = NULL;
this->TensorsForScaling = NULL;
this->UseFullFrameScaling = 0;
this->FullFrameScaling[0] = 1.;
......@@ -84,6 +85,7 @@ vtkVisItGlyph3D::~vtkVisItGlyph3D()
this->SetScalarsForScaling(NULL);
this->SetVectorsForColoring(NULL);
this->SetVectorsForScaling(NULL);
this->SetTensorsForScaling(NULL);
}
//*****************************************************************************
......@@ -113,6 +115,10 @@ vtkVisItGlyph3D::~vtkVisItGlyph3D()
// Only glyph points that have VTK_VERTEXs. Also pass edges, quads, etc
// through the filter.
//
// John Schmidt, Thu Nov 15 13:08:21 MST 2012
// Added capability to scale by a 3x3 tensor. Use in scaling the Box
// glyph.
//
//*****************************************************************************
void vtkVisItGlyph3D::Execute()
{
......@@ -124,6 +130,7 @@ void vtkVisItGlyph3D::Execute()
vtkDataArray *inVectors = NULL;
vtkDataArray *inVectors_forColoring = NULL;
vtkDataArray *inVectors_forScaling = NULL;
vtkDataArray *inTensors_forScaling = NULL;
int requestedGhostLevel;
unsigned char* inGhostLevels=0;
vtkDataArray *inNormals = NULL, *sourceNormals = NULL;
......@@ -137,6 +144,7 @@ void vtkVisItGlyph3D::Execute()
double x[3], v[3];
double vNew[3], s = 0.0, vMag = 0.0, value;
vtkTransform *trans = vtkTransform::New();
vtkMatrix4x4 *def_mat = vtkMatrix4x4::New();
vtkCell *cell;
vtkIdList *cellPts;
int npts;
......@@ -178,6 +186,7 @@ void vtkVisItGlyph3D::Execute()
inScalars_forScaling = pd->GetArray(this->ScalarsForScaling);
inVectors_forColoring = pd->GetArray(this->VectorsForColoring);
inVectors_forScaling = pd->GetArray(this->VectorsForScaling);
inTensors_forScaling = pd->GetArray(this->TensorsForScaling);
inOrigNodes = pd->GetArray("avtOriginalNodeNumbers");
inOrigCells = pd->GetArray("avtOriginalCellNumbers");
......@@ -245,6 +254,7 @@ void vtkVisItGlyph3D::Execute()
vtkErrorMacro(<<"Indexing on but don't have data to index with");
pts->Delete();
trans->Delete();
def_mat->Delete();
return;
}
else
......@@ -450,7 +460,26 @@ void vtkVisItGlyph3D::Execute()
}
// Get the scalar and vector data
if ( inScalars_forScaling )
if ( inTensors_forScaling )
{
if (this->ScaleMode == VTK_SCALE_BY_TENSOR)
{
// def_mat is Identity at its creation, only change needed elements.
double* tensor = inScalars_forScaling->GetTuple9(inPtId);
def_mat->SetElement(0,0,tensor[0]);
def_mat->SetElement(0,1,tensor[1]);
def_mat->SetElement(0,2,tensor[2]);
def_mat->SetElement(1,0,tensor[3]);
def_mat->SetElement(1,1,tensor[4]);
def_mat->SetElement(1,2,tensor[5]);
def_mat->SetElement(2,0,tensor[6]);
def_mat->SetElement(2,1,tensor[7]);
def_mat->SetElement(2,2,tensor[8]);
}
}
else if ( inScalars_forScaling )
{
s = inScalars_forScaling->GetComponent(inPtId, 0);
if ( this->ScaleMode == VTK_SCALE_BY_SCALAR ||
......@@ -608,6 +637,9 @@ void vtkVisItGlyph3D::Execute()
// translate Source to Input point
input->GetPoint(inPtId, x);
trans->Translate(x[0], x[1], x[2]);
// Transform Source by Tensor
trans->Concatenate(def_mat);
if ( haveVectors )
{
......@@ -784,6 +816,7 @@ void vtkVisItGlyph3D::Execute()
output->Squeeze();
trans->Delete();
def_mat->Delete();
pts->Delete();
if (connSize > 0 && (input->GetDataObjectType() == VTK_POLY_DATA ||
......
......@@ -75,8 +75,9 @@
#define VTK_SCALE_BY_SCALAR 0
#define VTK_SCALE_BY_VECTOR 1
#define VTK_SCALE_BY_VECTORCOMPONENTS 2
#define VTK_DATA_SCALING_OFF 3
#define VTK_SCALE_BY_TENSOR 2
#define VTK_SCALE_BY_VECTORCOMPONENTS 3
#define VTK_DATA_SCALING_OFF 4
#define VTK_COLOR_BY_SCALE 0
#define VTK_COLOR_BY_SCALAR 1
......@@ -137,6 +138,8 @@ public:
{this->SetScaleMode(VTK_SCALE_BY_SCALAR);};
void SetScaleModeToScaleByVector()
{this->SetScaleMode(VTK_SCALE_BY_VECTOR);};
void SetScaleModeToScaleByTensor()
{this->SetScaleMode(VTK_SCALE_BY_TENSOR);};
void SetScaleModeToScaleByVectorComponents()
{this->SetScaleMode(VTK_SCALE_BY_VECTORCOMPONENTS);};
void SetScaleModeToDataScalingOff()
......@@ -259,6 +262,10 @@ public:
void SelectVectorsForScaling(const char *fieldName)
{this->SetVectorsForScaling(fieldName);}
vtkGetStringMacro(TensorsForScaling);
void SelectTensorsForScaling(const char *fieldName)
{this->SetTensorsForScaling(fieldName);}
int SetFullFrameScaling(int useIt, const double *s);
......@@ -296,11 +303,13 @@ protected:
char *ScalarsForScaling;
char *VectorsForColoring;
char *VectorsForScaling;
char *TensorsForScaling;
vtkSetStringMacro(ScalarsForColoring);
vtkSetStringMacro(ScalarsForScaling);
vtkSetStringMacro(VectorsForColoring);
vtkSetStringMacro(VectorsForScaling);
vtkSetStringMacro(TensorsForScaling);
int UseFullFrameScaling;
double FullFrameScaling[3];
......@@ -322,6 +331,10 @@ inline const char *vtkVisItGlyph3D::GetScaleModeAsString(void)
{
return "ScaleByVector";
}
else if ( this->ScaleMode == VTK_SCALE_BY_TENSOR )
{
return "ScaleByTensor";
}
else
{
return "DataScalingOff";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment