Commit f55cd2ac authored by hrchilds's avatar hrchilds
Browse files

Fix problem with coloring streamlines by a variable (introduced in Streamline+Reflect change)

Fix problems with legend+Streamline


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@12449 18c085ea-50e0-402c-830e-de6fd14e8384
parent bcd2d9a1
......@@ -2121,6 +2121,9 @@ avtPICSFilter::CreateIntegralCurvesFromSeeds(std::vector<avtVector> &pts,
// Make sure that we tell upstream filters that we want continuous velocity
// fields ... this is important for the Reflect operator.
//
// Hank Childs, Tue Sep 7 23:29:40 PDT 2010
// Fix problem with previous change regarding removing the color variable.
//
// ****************************************************************************
avtContract_p
......@@ -2144,7 +2147,15 @@ avtPICSFilter::ModifyContract(avtContract_p in_contract)
// If we are part of a plot, the avtPICSPlot requested "colorVar", so remove that from the
// contract now.
avtDataRequest_p out_dr = new avtDataRequest(in_dr,in_dr->GetOriginalVariable());
bool removeColorVar = false;
if (integrationType == STREAMLINE_INTEGRATE_M3D_C1_INTEGRATOR ||
doPathlines)
removeColorVar = true;
avtDataRequest_p out_dr = NULL;
if (removeColorVar)
out_dr = new avtDataRequest(in_dr,in_dr->GetOriginalVariable());
else
out_dr = new avtDataRequest(in_dr);
out_dr->SetVelocityFieldMustBeContinuous(true);
if ( integrationType == STREAMLINE_INTEGRATE_M3D_C1_INTEGRATOR )
......@@ -2162,7 +2173,7 @@ avtPICSFilter::ModifyContract(avtContract_p in_contract)
out_dr->AddSecondaryVariable("hidden/header/bzero"); // /bzero
out_dr->AddSecondaryVariable("hidden/header/rzero"); // /rzero
// The mesh - N elememts x 7
// The mesh - N elements x 7
out_dr->AddSecondaryVariable("hidden/elements"); // /time_000/mesh/elements
// Variables on the mesh - N elements x 20
......
......@@ -387,6 +387,9 @@ avtStreamlinePlot::EnhanceSpecification(avtContract_p in_contract)
// Dave Pugmire, Thu Jun 10 10:44:02 EDT 2010
// New seed sources.
//
// Hank Childs, Tue Sep 7 23:29:40 PDT 2010
// Tell the legend what color table we're using.
//
// ****************************************************************************
void
......@@ -474,6 +477,7 @@ avtStreamlinePlot::SetAtts(const AttributeGroup *a)
UpdateMapperAndLegend();
SetColorTable(atts.GetColorTableName().c_str());
if (atts.GetLegendFlag())
{
varLegend->LegendOn();
......@@ -482,7 +486,6 @@ avtStreamlinePlot::SetAtts(const AttributeGroup *a)
else
varLegend->LegendOff();
if (atts.GetColoringMethod() == StreamlineAttributes::Solid)
avtLUT->SetLUTColors(atts.GetSingleColor().GetColor(), 1);
else
......@@ -560,7 +563,7 @@ avtStreamlinePlot::SetLighting(bool lightingOn)
}
// ****************************************************************************
// Method: avtStreamlinePlot::SetLegendRanges
// Method: avtStreamlinePlot::UpdateMapperAndLegend
//
// Purpose:
// Sets the range to use for the legend.
......@@ -585,6 +588,9 @@ avtStreamlinePlot::SetLighting(bool lightingOn)
// Hank Childs, Thu Feb 18 11:29:22 PST 2010
// Set up a reasonable range if there are no streamlines.
//
// Hank Childs, Tue Sep 7 23:29:40 PDT 2010
// Tell the legend what variable we're using.
//
// ****************************************************************************
void
......@@ -611,6 +617,30 @@ avtStreamlinePlot::UpdateMapperAndLegend()
varLegend->SetScaling(0);
varLegend->SetVarRange(min, max);
varLegend->SetRange(min, max);
switch (atts.GetColoringMethod())
{
case StreamlineAttributes::Solid:
varLegend->SetVarName("Solid");
break;
case StreamlineAttributes::ColorBySpeed:
varLegend->SetVarName("Speed");
break;
case StreamlineAttributes::ColorByVorticity:
varLegend->SetVarName("Vorticity magnitude");
break;
case StreamlineAttributes::ColorByLength:
varLegend->SetVarName("Arc length");
break;
case StreamlineAttributes::ColorByTime:
varLegend->SetVarName("Time");
break;
case StreamlineAttributes::ColorBySeedPointID:
varLegend->SetVarName("Seed point ID");
break;
case StreamlineAttributes::ColorByVariable:
varLegend->SetVarName(atts.GetColoringVariable().c_str());
break;
}
}
// ****************************************************************************
......
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