Commit eee83353 authored by hrchilds's avatar hrchilds
Browse files

Change two default Streamline settings:

#1: Default color by is now color by time, not color by speed
#2: Rename opacity option "None" to be the more correct "FullyOpaque"


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@12647 18c085ea-50e0-402c-830e-de6fd14e8384
parent 7dba02cc
......@@ -502,11 +502,11 @@ PyStreamlineAttributes_ToString(const StreamlineAttributes *atts, const char *pr
str += tmpStr;
SNPRINTF(tmpStr, 1000, "%sheadDisplayHeight = %g\n", prefix, atts->GetHeadDisplayHeight());
str += tmpStr;
const char *opacityType_names = "None, Constant, Ramp, VariableRange";
const char *opacityType_names = "FullyOpaque, Constant, Ramp, VariableRange";
switch (atts->GetOpacityType())
{
case StreamlineAttributes::None:
SNPRINTF(tmpStr, 1000, "%sopacityType = %sNone # %s\n", prefix, prefix, opacityType_names);
case StreamlineAttributes::FullyOpaque:
SNPRINTF(tmpStr, 1000, "%sopacityType = %sFullyOpaque # %s\n", prefix, prefix, opacityType_names);
str += tmpStr;
break;
case StreamlineAttributes::Constant:
......@@ -2252,7 +2252,7 @@ StreamlineAttributes_SetOpacityType(PyObject *self, PyObject *args)
fprintf(stderr, "An invalid opacityType value was given. "
"Valid values are in the range of [0,3]. "
"You can also use the following names: "
"None, Constant, Ramp, VariableRange.");
"FullyOpaque, Constant, Ramp, VariableRange.");
return NULL;
}
......@@ -3003,8 +3003,8 @@ PyStreamlineAttributes_getattr(PyObject *self, char *name)
return StreamlineAttributes_GetHeadDisplayHeight(self, NULL);
if(strcmp(name, "opacityType") == 0)
return StreamlineAttributes_GetOpacityType(self, NULL);
if(strcmp(name, "None") == 0)
return PyInt_FromLong(long(StreamlineAttributes::None));
if(strcmp(name, "FullyOpaque") == 0)
return PyInt_FromLong(long(StreamlineAttributes::FullyOpaque));
if(strcmp(name, "Constant") == 0)
return PyInt_FromLong(long(StreamlineAttributes::Constant));
if(strcmp(name, "Ramp") == 0)
......
......@@ -580,6 +580,9 @@ QvisStreamlinePlotWindow::CreateWindowContents()
// Dave Pugmire, Tue Apr 6 08:15:33 EDT 2010
// Rearrange the color by variable widgets.
//
// Hank Childs, Wed Sep 29 19:12:39 PDT 2010
// Rename None to FullyOpaque.
//
// ****************************************************************************
void
......@@ -854,7 +857,7 @@ QvisStreamlinePlotWindow::CreateAppearanceTab(QWidget *pageAppearance)
// Create the opacity widgets.
opacityType = new QComboBox(colorGrp);
opacityType->addItem(tr("None"),0);
opacityType->addItem(tr("Fully Opaque"),0);
opacityType->addItem(tr("Constant"),1);
opacityType->addItem(tr("Ramp"),2);
opacityType->addItem(tr("Variable Range"),3);
......@@ -1071,6 +1074,9 @@ QvisStreamlinePlotWindow::ProcessOldVersions(DataNode *parentNode,
// Dave Pugmire, Tue Dec 29 14:37:53 EST 2009
// Add custom renderer and lots of appearance options to the streamlines plots.
//
// Hank Childs, Wed Sep 29 19:12:39 PDT 2010
// Rename None to FullyOpaque.
//
// ****************************************************************************
void
......@@ -1532,7 +1538,7 @@ QvisStreamlinePlotWindow::UpdateWindow(bool doAll)
break;
case StreamlineAttributes::ID_opacityType:
if (streamAtts->GetOpacityType() == StreamlineAttributes::None)
if (streamAtts->GetOpacityType() == StreamlineAttributes::FullyOpaque)
{
opacitySlider->hide();
opacityVar->hide();
......
......@@ -69,7 +69,7 @@
M3DC1Integrator
</Enum>
<Enum name="OpacityType">
None
FullyOpaque
Constant
Ramp
VariableRange
......@@ -181,7 +181,7 @@
2
</Field>
<Field name="coloringMethod" label="Coloring method" type="enum" subtype="ColoringMethod">
ColorBySpeed
ColorByTime
</Field>
<Field name="colorTableName" label="Color table" type="colortable">
Default
......@@ -267,7 +267,7 @@
0.500000
</Field>
<Field name="opacityType" label="opacityType" type="enum" subtype="OpacityType">
None
FullyOpaque
</Field>
<Field name="opacityVariable" label="opacityVariable" type="string">
</Field>
......
......@@ -319,7 +319,7 @@ StreamlineAttributes::IntegrationType_FromString(const std::string &s, Streamlin
//
static const char *OpacityType_strings[] = {
"None", "Constant", "Ramp",
"FullyOpaque", "Constant", "Ramp",
"VariableRange"};
std::string
......@@ -340,7 +340,7 @@ StreamlineAttributes::OpacityType_ToString(int t)
bool
StreamlineAttributes::OpacityType_FromString(const std::string &s, StreamlineAttributes::OpacityType &val)
{
val = StreamlineAttributes::None;
val = StreamlineAttributes::FullyOpaque;
for(int i = 0; i < 4; ++i)
{
if(s == OpacityType_strings[i])
......@@ -494,7 +494,7 @@ void StreamlineAttributes::Init()
tubeRadius = 0.125;
ribbonWidth = 0.125;
lineWidth = 2;
coloringMethod = ColorBySpeed;
coloringMethod = ColorByTime;
legendFlag = true;
lightingFlag = true;
streamlineDirection = Forward;
......@@ -519,7 +519,7 @@ void StreamlineAttributes::Init()
headDisplayType = Sphere;
headDisplayRadius = 0.25;
headDisplayHeight = 0.5;
opacityType = None;
opacityType = FullyOpaque;
opacity = 1;
opacityVarMin = 0;
opacityVarMax = 1;
......
......@@ -113,7 +113,7 @@ public:
};
enum OpacityType
{
None,
FullyOpaque,
Constant,
Ramp,
VariableRange
......
......@@ -101,7 +101,7 @@ public class StreamlineAttributes extends AttributeSubject implements Plugin
public final static int INTEGRATIONTYPE_ADAMSBASHFORTH = 1;
public final static int INTEGRATIONTYPE_M3DC1INTEGRATOR = 2;
public final static int OPACITYTYPE_NONE = 0;
public final static int OPACITYTYPE_FULLYOPAQUE = 0;
public final static int OPACITYTYPE_CONSTANT = 1;
public final static int OPACITYTYPE_RAMP = 2;
public final static int OPACITYTYPE_VARIABLERANGE = 3;
......@@ -178,7 +178,7 @@ public class StreamlineAttributes extends AttributeSubject implements Plugin
tubeRadius = 0.125;
ribbonWidth = 0.125;
lineWidth = 2;
coloringMethod = COLORINGMETHOD_COLORBYSPEED;
coloringMethod = COLORINGMETHOD_COLORBYTIME;
colorTableName = new String("Default");
singleColor = new ColorAttribute(0, 0, 0);
legendFlag = true;
......@@ -206,7 +206,7 @@ public class StreamlineAttributes extends AttributeSubject implements Plugin
headDisplayType = GEOMDISPLAYTYPE_SPHERE;
headDisplayRadius = 0.25;
headDisplayHeight = 0.5;
opacityType = OPACITYTYPE_NONE;
opacityType = OPACITYTYPE_FULLYOPAQUE;
opacityVariable = new String("");
opacity = 1;
opacityVarMin = 0;
......@@ -288,7 +288,7 @@ public class StreamlineAttributes extends AttributeSubject implements Plugin
tubeRadius = 0.125;
ribbonWidth = 0.125;
lineWidth = 2;
coloringMethod = COLORINGMETHOD_COLORBYSPEED;
coloringMethod = COLORINGMETHOD_COLORBYTIME;
colorTableName = new String("Default");
singleColor = new ColorAttribute(0, 0, 0);
legendFlag = true;
......@@ -316,7 +316,7 @@ public class StreamlineAttributes extends AttributeSubject implements Plugin
headDisplayType = GEOMDISPLAYTYPE_SPHERE;
headDisplayRadius = 0.25;
headDisplayHeight = 0.5;
opacityType = OPACITYTYPE_NONE;
opacityType = OPACITYTYPE_FULLYOPAQUE;
opacityVariable = new String("");
opacity = 1;
opacityVarMin = 0;
......@@ -1615,8 +1615,8 @@ public class StreamlineAttributes extends AttributeSubject implements Plugin
str = str + doubleToString("headDisplayRadius", headDisplayRadius, indent) + "\n";
str = str + doubleToString("headDisplayHeight", headDisplayHeight, indent) + "\n";
str = str + indent + "opacityType = ";
if(opacityType == OPACITYTYPE_NONE)
str = str + "OPACITYTYPE_NONE";
if(opacityType == OPACITYTYPE_FULLYOPAQUE)
str = str + "OPACITYTYPE_FULLYOPAQUE";
if(opacityType == OPACITYTYPE_CONSTANT)
str = str + "OPACITYTYPE_CONSTANT";
if(opacityType == OPACITYTYPE_RAMP)
......
......@@ -384,15 +384,18 @@ avtOpenGLStreamlineRenderer::Render(vtkPolyData *data,
// Dave Pugmire, Wed Jan 20 09:28:59 EST 2010
// Add drawHead geom.
//
// Dave Pugmire, Fri Feb 12 14:02:57 EST 2010
// Support for transparency sorting.
// Dave Pugmire, Fri Feb 12 14:02:57 EST 2010
// Support for transparency sorting.
//
// Hank Childs, Wed Sep 29 19:12:39 PDT 2010
// Rename None to FullyOpaque.
//
// ****************************************************************************
void
avtOpenGLStreamlineRenderer::DrawStreamlines(vtkPolyData *data)
{
if (atts.GetOpacityType() != StreamlineAttributes::None)
if (atts.GetOpacityType() != StreamlineAttributes::FullyOpaque)
appendForTranspPolys = vtkAppendPolyData::New();
if (atts.GetOpacityType() == StreamlineAttributes::VariableRange)
InitVarOpacity(data);
......@@ -1349,6 +1352,9 @@ avtOpenGLStreamlineRenderer::SetColor(const float &scalar,
//
// Modifications:
//
// Hank Childs, Wed Sep 29 19:12:39 PDT 2010
// Rename None to FullyOpaque.
//
// ****************************************************************************
void
......@@ -1359,7 +1365,7 @@ avtOpenGLStreamlineRenderer::InitColors()
unsigned char rgba[4];
memcpy(rgba, atts.GetSingleColor().GetColor(), 4);
if (atts.GetOpacityType() == StreamlineAttributes::None)
if (atts.GetOpacityType() == StreamlineAttributes::FullyOpaque)
rgba[3] = (unsigned char)255;
else if (atts.GetOpacityType() == StreamlineAttributes::Constant)
rgba[3] = (unsigned char)(atts.GetOpacity()*255.0f);
......
......@@ -282,6 +282,9 @@ avtStreamlinePlot::ApplyRenderingTransformation(avtDataObject_p input)
// Dave Pugmire, Tue Dec 29 14:37:53 EST 2009
// Add custom renderer and lots of appearance options to the streamlines plots.
//
// Hank Childs, Wed Sep 29 19:11:51 PDT 2010
// Rename "None" to "FullyOpaque".
//
// ****************************************************************************
void
......@@ -289,7 +292,7 @@ avtStreamlinePlot::CustomizeBehavior(void)
{
UpdateMapperAndLegend();
if (atts.GetOpacityType() != StreamlineAttributes::None)
if (atts.GetOpacityType() != StreamlineAttributes::FullyOpaque)
{
behavior->SetRenderOrder(MUST_GO_LAST);
behavior->SetAntialiasedRenderOrder(MUST_GO_LAST);
......
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