Commit 73df0ced authored by hrchilds's avatar hrchilds

Merge 2.0RC to trunk, picking up backwards compatibility changes for

Curve and Vector plots in Python.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@10272 18c085ea-50e0-402c-830e-de6fd14e8384
parent 8228d6e6
<?xml version="1.0"?>
<Plugin name="Curve" type="plot" label="Curve" version="1.0" enabled="true" mdspecificcode="false" onlyengine="false" noengine="false" vartype="curve" iconFile="Curve.xpm">
<Plugin name="Curve" type="plot" label="Curve" version="1.0" enabled="true" mdspecificcode="false" engspecificcode="false" onlyengine="false" noengine="false" vartype="curve" iconFile="Curve.xpm">
<Files components="V">
avtCurveFilter.C
avtCurveRenderer.C
......@@ -12,7 +12,7 @@
avtOpenGLCurveRenderer.C
avtMesaCurveRenderer.C
</Files>
<Attribute name="CurveAttributes" purpose="Attributes for the xy plot" persistent="true" exportAPI="" exportInclude="" codefile="CurveAttributes.code">
<Attribute name="CurveAttributes" purpose="Attributes for the xy plot" persistent="true" keyframe="true" exportAPI="" exportInclude="" codefile="CurveAttributes.code">
<Enum name="RenderMode">
RenderAsLines
RenderAsSymbols
......@@ -35,7 +35,7 @@
<Field name="lineWidth" label="Line Width" type="linewidth">
0
</Field>
<Field name="curveColor" label="Color" type="color">
<Field name="curveColor" label="Color" type="color" length="4">
0
0
0
......
Target: xml2python
Code: PyCurveAttributes_getattr
Prefix:
Postfix:
// Try and handle legacy fields in CurveAttributes
if(strcmp(name, "cycleColors") == 0)
{
CurveAttributesObject *curveObj = (CurveAttributesObject *)self;
bool cycleColors = curveObj->data->GetCurveColorSource() == CurveAttributes::Custom;
return PyInt_FromLong(cycleColors?1L:0L);
}
// Try and handle legacy fields in CurveAttributes
if(strcmp(name, "color") == 0)
{
return CurveAttributes_GetCurveColor(self, NULL);
}
Code: PyCurveAttributes_setattr
Prefix:
Postfix:
// Try and handle legacy fields in CurveAttributes
if(obj == NULL)
{
CurveAttributesObject *CurveObj = (CurveAttributesObject *)self;
if(strcmp(name, "color") == 0)
{
obj = CurveAttributes_SetCurveColor(self, tuple);
}
if(strcmp(name, "cycleColors") == 0)
{
int ival;
if(!PyArg_ParseTuple(tuple, "i", &ival))
{
Py_DECREF(tuple);
return -1;
}
if(ival == 0)
CurveObj->data->SetCurveColorSource(CurveAttributes::Custom);
else
CurveObj->data->SetCurveColorSource(CurveAttributes::Cycle);
Py_INCREF(Py_None);
obj = Py_None;
}
}
Target: xml2atts
Function: CopyAttributes
Declaration: virtual bool CopyAttributes(const AttributeGroup *);
Definition:
......@@ -201,8 +248,7 @@ CurveViewerPluginInfo::SetColor(AttributeSubject *atts)
}
}
Target: xml2info
Function: CurveViewerPluginInfo::PermitsCurveViewScaling
Function: CurveViewerPluginInfo::PermitsCurveViewScaling
Declaration: virtual bool PermitsCurveViewScaling() const;
Definition:
bool
......@@ -210,3 +256,4 @@ CurveViewerPluginInfo::PermitsCurveViewScaling() const
{
return true;
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2009, Lawrence Livermore National Security, LLC
* Copyright (c) 2000 - 2010, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400124
* All rights reserved.
......@@ -671,6 +671,18 @@ PyCurveAttributes_getattr(PyObject *self, char *name)
if(strcmp(name, "symbolDensity") == 0)
return CurveAttributes_GetSymbolDensity(self, NULL);
// Try and handle legacy fields in CurveAttributes
if(strcmp(name, "cycleColors") == 0)
{
CurveAttributesObject *curveObj = (CurveAttributesObject *)self;
bool cycleColors = curveObj->data->GetCurveColorSource() == CurveAttributes::Custom;
return PyInt_FromLong(cycleColors?1L:0L);
}
// Try and handle legacy fields in CurveAttributes
if(strcmp(name, "color") == 0)
{
return CurveAttributes_GetCurveColor(self, NULL);
}
return Py_FindMethod(PyCurveAttributes_methods, self, name);
}
......@@ -709,10 +721,37 @@ PyCurveAttributes_setattr(PyObject *self, char *name, PyObject *args)
else if(strcmp(name, "symbolDensity") == 0)
obj = CurveAttributes_SetSymbolDensity(self, tuple);
// Try and handle legacy fields in CurveAttributes
if(obj == NULL)
{
CurveAttributesObject *CurveObj = (CurveAttributesObject *)self;
if(strcmp(name, "color") == 0)
{
obj = CurveAttributes_SetCurveColor(self, tuple);
}
if(strcmp(name, "cycleColors") == 0)
{
int ival;
if(!PyArg_ParseTuple(tuple, "i", &ival))
{
Py_DECREF(tuple);
return -1;
}
if(ival == 0)
CurveObj->data->SetCurveColorSource(CurveAttributes::Custom);
else
CurveObj->data->SetCurveColorSource(CurveAttributes::Cycle);
Py_INCREF(Py_None);
obj = Py_None;
}
}
if(obj != NULL)
Py_DECREF(obj);
Py_DECREF(tuple);
if( obj == NULL)
PyErr_Format(PyExc_RuntimeError, "Unable to set unknown attribute: '%s'", name);
return (obj != NULL) ? 0 : -1;
}
......
/*****************************************************************************
*
* Copyright (c) 2000 - 2009, Lawrence Livermore National Security, LLC
* Copyright (c) 2000 - 2010, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400124
* All rights reserved.
......
/*****************************************************************************
*
* Copyright (c) 2000 - 2009, Lawrence Livermore National Security, LLC
* Copyright (c) 2000 - 2010, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400124
* All rights reserved.
......@@ -1032,6 +1032,13 @@ PyVectorAttributes_getattr(PyObject *self, char *name)
if(strcmp(name, "origOnly") == 0)
return VectorAttributes_GetOrigOnly(self, NULL);
// Try and handle legacy fields in VectorAttributes
if(strcmp(name, "highQuality") == 0)
{
VectorAttributesObject *vectorObj = (VectorAttributesObject *)self;
bool highQuality = vectorObj->data->GetGeometryQuality() == VectorAttributes::High;
return PyInt_FromLong(highQuality?1L:0L);
}
return Py_FindMethod(PyVectorAttributes_methods, self, name);
}
......@@ -1094,10 +1101,33 @@ PyVectorAttributes_setattr(PyObject *self, char *name, PyObject *args)
else if(strcmp(name, "origOnly") == 0)
obj = VectorAttributes_SetOrigOnly(self, tuple);
// Try and handle legacy fields in VectorAttributes
if(obj == NULL)
{
VectorAttributesObject *VectorObj = (VectorAttributesObject *)self;
if(strcmp(name, "highQuality") == 0)
{
int ival;
if(!PyArg_ParseTuple(tuple, "i", &ival))
{
Py_DECREF(tuple);
return -1;
}
if(ival == 0)
VectorObj->data->SetGeometryQuality(VectorAttributes::Fast);
else
VectorObj->data->SetGeometryQuality(VectorAttributes::High);
Py_INCREF(Py_None);
obj = Py_None;
}
}
if(obj != NULL)
Py_DECREF(obj);
Py_DECREF(tuple);
if( obj == NULL)
PyErr_Format(PyExc_RuntimeError, "Unable to set unknown attribute: '%s'", name);
return (obj != NULL) ? 0 : -1;
}
......
/*****************************************************************************
*
* Copyright (c) 2000 - 2009, Lawrence Livermore National Security, LLC
* Copyright (c) 2000 - 2010, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400124
* All rights reserved.
......
<?xml version="1.0"?>
<Plugin name="Vector" type="plot" label="Vector" version="1.0" enabled="true" vartype="vector" iconFile="Vector.xpm">
<Attribute name="VectorAttributes" purpose="Attributes for the vector plot" persistent="true" codefile="VectorAttributes.code">
<Plugin name="Vector" type="plot" label="Vector" version="1.0" enabled="true" mdspecificcode="false" engspecificcode="false" onlyengine="false" noengine="false" vartype="vector" iconFile="Vector.xpm">
<Attribute name="VectorAttributes" purpose="Attributes for the vector plot" persistent="true" keyframe="true" exportAPI="" exportInclude="" codefile="VectorAttributes.code">
<Enum name="Quality">
Fast
High
......@@ -50,7 +50,7 @@
<Field name="useLegend" label="Legend" type="bool">
true
</Field>
<Field name="vectorColor" label="color" type="color">
<Field name="vectorColor" label="color" type="color" length="4">
0
0
0
......
Target: xml2python
Code: PyVectorAttributes_getattr
Prefix:
Postfix:
// Try and handle legacy fields in VectorAttributes
if(strcmp(name, "highQuality") == 0)
{
VectorAttributesObject *vectorObj = (VectorAttributesObject *)self;
bool highQuality = vectorObj->data->GetGeometryQuality() == VectorAttributes::High;
return PyInt_FromLong(highQuality?1L:0L);
}
Code: PyVectorAttributes_setattr
Prefix:
Postfix:
// Try and handle legacy fields in VectorAttributes
if(obj == NULL)
{
VectorAttributesObject *VectorObj = (VectorAttributesObject *)self;
if(strcmp(name, "highQuality") == 0)
{
int ival;
if(!PyArg_ParseTuple(tuple, "i", &ival))
{
Py_DECREF(tuple);
return -1;
}
if(ival == 0)
VectorObj->data->SetGeometryQuality(VectorAttributes::Fast);
else
VectorObj->data->SetGeometryQuality(VectorAttributes::High);
Py_INCREF(Py_None);
obj = Py_None;
}
}
Target: xml2atts
Function: ChangesRequireRecalculation
Declaration: bool ChangesRequireRecalculation(const VectorAttributes &obj);
Definition:
......
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