Commit 5240de4c authored by allens's avatar allens
Browse files

added shift code as well added warning to the user that the sihifting will occur

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@11535 18c085ea-50e0-402c-830e-de6fd14e8384
parent ec2243bd
......@@ -43,6 +43,7 @@
#include <avtPoincarePlot.h>
#include <avtPoincareFilter.h>
#include <avtShiftCenteringFilter.h>
#include <avtLookupTable.h>
#include <avtVariableLegend.h>
#include <avtVariableMapper.h>
......@@ -50,6 +51,8 @@
#include <InvalidLimitsException.h>
#include <vtkPlane.h>
#include <avtCallback.h>
// ****************************************************************************
// Method: avtPoincarePlot constructor
//
......@@ -68,7 +71,9 @@ avtPoincarePlot::avtPoincarePlot()
#ifdef ENGINE
poincareFilter = new avtPoincareFilter;
#endif
avtLUT = new avtLookupTable;
shiftCenteringFilter = NULL;
avtLUT = new avtLookupTable;
varMapper = new avtVariableMapper;
varMapper->SetLookupTable(avtLUT->GetLookupTable());
......@@ -180,10 +185,31 @@ avtDataObject_p
avtPoincarePlot::ApplyOperators(avtDataObject_p input)
{
#ifdef ENGINE
avtDataObject_p dob = input;
poincareFilter->SetInput(input);
// Try to determine the centering. If we have an expression, we won't
// be able to. So be conservative and assume the worst.
avtCentering centering = AVT_ZONECENT;
if (input->GetInfo().GetAttributes().ValidVariable(varname))
centering = input->GetInfo().GetAttributes().GetCentering(varname);
// If the variable centering is zonal, convert it to nodal or the
// streamline filter will not play with it.
if(centering == AVT_ZONECENT)
{
avtCallback::IssueWarning("The vector field being used to generate the streamline(s) is zone (cell) centered. Streamline requires nodal data, moving data from from zones to the nodes. This change in centering may have unintended consequences." );
avtDataObject_p dob = poincareFilter->GetOutput();
if(shiftCenteringFilter != NULL)
delete shiftCenteringFilter;
shiftCenteringFilter = new avtShiftCenteringFilter(AVT_NODECENT);
shiftCenteringFilter->SetInput(input);
dob = shiftCenteringFilter->GetOutput();
}
// Add the Poincare filter.
poincareFilter->SetInput(input);
dob = poincareFilter->GetOutput();
return dob;
#else
return input;
......
......@@ -50,6 +50,8 @@
#include <avtVariableMapper.h>
#include <avtLookupTable.h>
#include <avtCallback.h>
#include <StreamlineAttributes.h>
// ****************************************************************************
......@@ -221,6 +223,8 @@ avtStreamlinePlot::ApplyOperators(avtDataObject_p input)
// streamline filter will not play with it.
if(centering == AVT_ZONECENT)
{
avtCallback::IssueWarning("The vector field being used to generate the streamline(s) is zone (cell) centered. Streamline requires nodal data, moving data from from zones to the nodes. This change in centering may have unintended consequences." );
if(shiftCenteringFilter != NULL)
delete shiftCenteringFilter;
shiftCenteringFilter = new avtShiftCenteringFilter(AVT_NODECENT);
......
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