Commit 3e2f0682 authored by bonnell's avatar bonnell

Add 'honorOriginalMesh' option to onion peel. Add 'zonesWereSplit' to...

Add 'honorOriginalMesh' option to onion peel. Add 'zonesWereSplit' to avtMeshMetaData.  This fixes onion peel's operation with arbitrary polyhedral data.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23884 18c085ea-50e0-402c-830e-de6fd14e8384
parent ecab6a05
......@@ -5532,6 +5532,30 @@ avtDatabaseMetaData::SetContainsGlobalZoneIds(std::string name, bool val)
}
}
// ****************************************************************************
// Method: avtDatabaseMetaData::SetZonesWereSplit
//
// Purpose:
// Sets whether a particular mesh's zones were split
//
// Programmer: Kathleen Biagas
// Creation: July 23, 2014
//
// ****************************************************************************
void
avtDatabaseMetaData::SetZonesWereSplit(std::string name, bool val)
{
for (int i = 0 ; i < GetNumMeshes() ; i++)
{
if (GetMeshes(i).name == name)
{
GetMeshes(i).zonesWereSplit = val;
return;
}
}
}
// ****************************************************************************
// Method: avtDatabaseMetaData::AddGroupInformation
//
......
......@@ -1810,6 +1810,33 @@ avtDatabaseMetaData::SetContainsGlobalZoneIds(std::string name, bool val)
}
}
Function: SetZonesWereSplit
Declaration: void SetZonesWereSplit(std::string name, bool);
Definition:
// ****************************************************************************
// Method: avtDatabaseMetaData::SetZonesWereSplit
//
// Purpose:
// Sets whether a particular mesh's zones were split
//
// Programmer: Kathleen Biagas
// Creation: July 23, 2014
//
// ****************************************************************************
void
avtDatabaseMetaData::SetZonesWereSplit(std::string name, bool val)
{
for (int i = 0 ; i < GetNumMeshes() ; i++)
{
if (GetMeshes(i).name == name)
{
GetMeshes(i).zonesWereSplit = val;
return;
}
}
}
Function: AddGroupInformation
Declaration: void AddGroupInformation(int nGroups, int nBlocks, intVector &blockIds);
Definition:
......
......@@ -372,6 +372,7 @@ public:
void SetContainsOriginalNodes(std::string name, bool);
void SetContainsGlobalNodeIds(std::string name, bool);
void SetContainsGlobalZoneIds(std::string name, bool);
void SetZonesWereSplit(std::string name, bool);
void AddGroupInformation(int nGroups, int nBlocks, intVector &blockIds);
void SetExtents(std::string, const double *);
void UnsetExtents();
......
......@@ -190,6 +190,8 @@
</Function>
<Function name="SetContainsGlobalZoneIds" user="true" member="true">
</Function>
<Function name="SetZonesWereSplit" user="true" member="true">
</Function>
<Function name="AddGroupInformation" user="true" member="true">
</Function>
<Function name="SetExtents" user="true" member="true">
......
......@@ -129,6 +129,7 @@ void avtMeshMetaData::Init()
hideFromGUI = false;
LODs = 1;
presentGhostZoneTypes = 0;
zonesWereSplit = false;
avtMeshMetaData::SelectAll();
}
......@@ -218,6 +219,7 @@ void avtMeshMetaData::Copy(const avtMeshMetaData &obj)
hideFromGUI = obj.hideFromGUI;
LODs = obj.LODs;
presentGhostZoneTypes = obj.presentGhostZoneTypes;
zonesWereSplit = obj.zonesWereSplit;
avtMeshMetaData::SelectAll();
}
......@@ -455,7 +457,8 @@ avtMeshMetaData::operator == (const avtMeshMetaData &obj) const
(containsExteriorBoundaryGhosts == obj.containsExteriorBoundaryGhosts) &&
(hideFromGUI == obj.hideFromGUI) &&
(LODs == obj.LODs) &&
(presentGhostZoneTypes == obj.presentGhostZoneTypes));
(presentGhostZoneTypes == obj.presentGhostZoneTypes) &&
(zonesWereSplit == obj.zonesWereSplit));
}
// ****************************************************************************
......@@ -650,6 +653,7 @@ avtMeshMetaData::SelectAll()
Select(ID_hideFromGUI, (void *)&hideFromGUI);
Select(ID_LODs, (void *)&LODs);
Select(ID_presentGhostZoneTypes, (void *)&presentGhostZoneTypes);
Select(ID_zonesWereSplit, (void *)&zonesWereSplit);
}
///////////////////////////////////////////////////////////////////////////////
......@@ -735,6 +739,7 @@ avtMeshMetaData::GetFieldName(int index) const
case ID_hideFromGUI: return "hideFromGUI";
case ID_LODs: return "LODs";
case ID_presentGhostZoneTypes: return "presentGhostZoneTypes";
case ID_zonesWereSplit: return "zonesWereSplit";
default: return "invalid index";
}
}
......@@ -810,6 +815,7 @@ avtMeshMetaData::GetFieldType(int index) const
case ID_hideFromGUI: return FieldType_bool;
case ID_LODs: return FieldType_int;
case ID_presentGhostZoneTypes: return FieldType_int;
case ID_zonesWereSplit: return FieldType_bool;
default: return FieldType_unknown;
}
}
......@@ -885,6 +891,7 @@ avtMeshMetaData::GetFieldTypeName(int index) const
case ID_hideFromGUI: return "bool";
case ID_LODs: return "int";
case ID_presentGhostZoneTypes: return "int";
case ID_zonesWereSplit: return "bool";
default: return "invalid index";
}
}
......@@ -1196,6 +1203,11 @@ avtMeshMetaData::FieldsEqual(int index_, const AttributeGroup *rhs) const
retval = (presentGhostZoneTypes == obj.presentGhostZoneTypes);
}
break;
case ID_zonesWereSplit:
{ // new scope
retval = (zonesWereSplit == obj.zonesWereSplit);
}
break;
default: retval = false;
}
......
......@@ -161,6 +161,7 @@ public:
ID_hideFromGUI,
ID_LODs,
ID_presentGhostZoneTypes,
ID_zonesWereSplit,
ID__LAST
};
......@@ -216,12 +217,13 @@ public:
bool hideFromGUI;
int LODs;
int presentGhostZoneTypes;
bool zonesWereSplit;
private:
// Static class format string for type map.
static const char *TypeMapFormatString;
static const private_tmfs_t TmfsStruct;
};
#define AVTMESHMETADATA_TMFS "ssbiiiibIbiissssssbDDiisss*aiisss*i*i*bibbbbibFFbDibbii"
#define AVTMESHMETADATA_TMFS "ssbiiiibIbiissssssbDDiisss*aiisss*i*i*bibbbbibFFbDibbiib"
#endif
......@@ -175,6 +175,9 @@
<Field name="presentGhostZoneTypes" label="Present ghost zone types" type="int" access="public">
0
</Field>
<Field name="zonesWereSplit" label="Orignal zones were split" type="bool" access="public">
false
</Field>
<Function name="avtMeshMetaData2" user="true" member="true">
</Function>
<Function name="avtMeshMetaData3" user="true" member="true">
......
......@@ -804,6 +804,10 @@ avtDatabase::GetOutput(const char *var, int ts)
// Burlen Loring, Sun Apr 27 15:17:23 PDT 2014
// Cleanup -Wall warnings
//
// Kathleen Biagas, Wed Jul 23 16:45:34 PDT 2014
// Invalidate zones if meshmetadata reports the zones were split as can be
// the case for arbitrary polyhedral meshes.
//
// ****************************************************************************
void
......@@ -865,6 +869,10 @@ avtDatabase::PopulateDataObjectInformation(avtDataObject_p &dob,
validity.InvalidateZones();
validity.InvalidateNodes();
}
if (mmd->zonesWereSplit)
{
validity.InvalidateZones();
}
//
// Note that we are using the spatial extents as both the spatial
......
......@@ -11356,6 +11356,12 @@ avtSiloFileFormat::ReadInArbConnectivity(const char *meshname,
delete cellReMap;
}
}
else
{
// Let the rest of VisIt know that the mesh was split from its
// original form.
metadata->SetZonesWereSplit(meshname, true);
}
}
// ****************************************************************************
......
......@@ -1409,6 +1409,9 @@ CreateUnstructuredMeshGlobalNodeIds(visit_handle h)
// Brad Whitlock, Fri Jun 13 10:56:13 PDT 2014
// I added global nodes/cell support.
//
// Kathleen Biagas, Fri Jul 25 09:13:45 MST 2014
// Set a new mesh meta data flag when polyhdral zones are split.
//
// ****************************************************************************
vtkDataSet *
......@@ -1456,6 +1459,7 @@ avtSimV2FileFormat::GetMesh(int domain, const char *meshname)
cache->CacheVoidRef(meshname,
AUXILIARY_DATA_POLYHEDRAL_SPLIT,
timestep, domain, vr);
metadata->SetZonesWereSplit(meshname, true);
}
else
{
......
......@@ -58,7 +58,7 @@ import java.lang.Integer;
public class avtMeshMetaData extends AttributeSubject
{
private static int avtMeshMetaData_numAdditionalAtts = 51;
private static int avtMeshMetaData_numAdditionalAtts = 52;
public avtMeshMetaData()
{
......@@ -152,6 +152,7 @@ public class avtMeshMetaData extends AttributeSubject
hideFromGUI = false;
LODs = 1;
presentGhostZoneTypes = 0;
zonesWereSplit = false;
}
public avtMeshMetaData(int nMoreFields)
......@@ -246,6 +247,7 @@ public class avtMeshMetaData extends AttributeSubject
hideFromGUI = false;
LODs = 1;
presentGhostZoneTypes = 0;
zonesWereSplit = false;
}
public avtMeshMetaData(avtMeshMetaData obj)
......@@ -343,6 +345,7 @@ public class avtMeshMetaData extends AttributeSubject
hideFromGUI = obj.hideFromGUI;
LODs = obj.LODs;
presentGhostZoneTypes = obj.presentGhostZoneTypes;
zonesWereSplit = obj.zonesWereSplit;
SelectAll();
}
......@@ -478,7 +481,8 @@ public class avtMeshMetaData extends AttributeSubject
(containsExteriorBoundaryGhosts == obj.containsExteriorBoundaryGhosts) &&
(hideFromGUI == obj.hideFromGUI) &&
(LODs == obj.LODs) &&
(presentGhostZoneTypes == obj.presentGhostZoneTypes));
(presentGhostZoneTypes == obj.presentGhostZoneTypes) &&
(zonesWereSplit == obj.zonesWereSplit));
}
// Property setting methods
......@@ -830,6 +834,12 @@ public class avtMeshMetaData extends AttributeSubject
Select(50);
}
public void SetZonesWereSplit(boolean zonesWereSplit_)
{
zonesWereSplit = zonesWereSplit_;
Select(51);
}
// Property getting methods
public String GetName() { return name; }
public String GetOriginalName() { return originalName; }
......@@ -882,6 +892,7 @@ public class avtMeshMetaData extends AttributeSubject
public boolean GetHideFromGUI() { return hideFromGUI; }
public int GetLODs() { return LODs; }
public int GetPresentGhostZoneTypes() { return presentGhostZoneTypes; }
public boolean GetZonesWereSplit() { return zonesWereSplit; }
// Write and read methods.
public void WriteAtts(CommunicationBuffer buf)
......@@ -988,6 +999,8 @@ public class avtMeshMetaData extends AttributeSubject
buf.WriteInt(LODs);
if(WriteSelect(50, buf))
buf.WriteInt(presentGhostZoneTypes);
if(WriteSelect(51, buf))
buf.WriteBool(zonesWereSplit);
}
public void ReadAtts(int index, CommunicationBuffer buf)
......@@ -1148,6 +1161,9 @@ public class avtMeshMetaData extends AttributeSubject
case 50:
SetPresentGhostZoneTypes(buf.ReadInt());
break;
case 51:
SetZonesWereSplit(buf.ReadBool());
break;
}
}
......@@ -1205,6 +1221,7 @@ public class avtMeshMetaData extends AttributeSubject
str = str + boolToString("hideFromGUI", hideFromGUI, indent) + "\n";
str = str + intToString("LODs", LODs, indent) + "\n";
str = str + intToString("presentGhostZoneTypes", presentGhostZoneTypes, indent) + "\n";
str = str + boolToString("zonesWereSplit", zonesWereSplit, indent) + "\n";
return str;
}
......@@ -1261,5 +1278,6 @@ public class avtMeshMetaData extends AttributeSubject
private boolean hideFromGUI;
private int LODs;
private int presentGhostZoneTypes;
private boolean zonesWereSplit;
}
......@@ -33,6 +33,9 @@
<Field name="seedType" label="Seed Type" type="enum" subtype="SeedIdType">
SeedCell
</Field>
<Field name="honorOriginalMesh" label="honorOriginalMesh" type="bool">
true
</Field>
<Function name="OnionPeelViewerPluginInfo::InitializeOperatorAtts" user="false" member="true">
</Function>
</Attribute>
......
......@@ -138,6 +138,7 @@ void OnionPeelAttributes::Init()
logical = false;
requestedLayer = 0;
seedType = SeedCell;
honorOriginalMesh = true;
OnionPeelAttributes::SelectAll();
}
......@@ -167,6 +168,7 @@ void OnionPeelAttributes::Copy(const OnionPeelAttributes &obj)
logical = obj.logical;
requestedLayer = obj.requestedLayer;
seedType = obj.seedType;
honorOriginalMesh = obj.honorOriginalMesh;
OnionPeelAttributes::SelectAll();
}
......@@ -331,7 +333,8 @@ OnionPeelAttributes::operator == (const OnionPeelAttributes &obj) const
(index == obj.index) &&
(logical == obj.logical) &&
(requestedLayer == obj.requestedLayer) &&
(seedType == obj.seedType));
(seedType == obj.seedType) &&
(honorOriginalMesh == obj.honorOriginalMesh));
}
// ****************************************************************************
......@@ -475,14 +478,15 @@ OnionPeelAttributes::NewInstance(bool copy) const
void
OnionPeelAttributes::SelectAll()
{
Select(ID_adjacencyType, (void *)&adjacencyType);
Select(ID_useGlobalId, (void *)&useGlobalId);
Select(ID_categoryName, (void *)&categoryName);
Select(ID_subsetName, (void *)&subsetName);
Select(ID_index, (void *)&index);
Select(ID_logical, (void *)&logical);
Select(ID_requestedLayer, (void *)&requestedLayer);
Select(ID_seedType, (void *)&seedType);
Select(ID_adjacencyType, (void *)&adjacencyType);
Select(ID_useGlobalId, (void *)&useGlobalId);
Select(ID_categoryName, (void *)&categoryName);
Select(ID_subsetName, (void *)&subsetName);
Select(ID_index, (void *)&index);
Select(ID_logical, (void *)&logical);
Select(ID_requestedLayer, (void *)&requestedLayer);
Select(ID_seedType, (void *)&seedType);
Select(ID_honorOriginalMesh, (void *)&honorOriginalMesh);
}
///////////////////////////////////////////////////////////////////////////////
......@@ -563,6 +567,12 @@ OnionPeelAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool fo
node->AddNode(new DataNode("seedType", SeedIdType_ToString(seedType)));
}
if(completeSave || !FieldsEqual(ID_honorOriginalMesh, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("honorOriginalMesh", honorOriginalMesh));
}
// Add the node to the parent node.
if(addToParent || forceAdd)
......@@ -643,6 +653,8 @@ OnionPeelAttributes::SetFromNode(DataNode *parentNode)
SetSeedType(value);
}
}
if((node = searchNode->GetNode("honorOriginalMesh")) != 0)
SetHonorOriginalMesh(node->AsBool());
}
///////////////////////////////////////////////////////////////////////////////
......@@ -705,6 +717,13 @@ OnionPeelAttributes::SetSeedType(OnionPeelAttributes::SeedIdType seedType_)
Select(ID_seedType, (void *)&seedType);
}
void
OnionPeelAttributes::SetHonorOriginalMesh(bool honorOriginalMesh_)
{
honorOriginalMesh = honorOriginalMesh_;
Select(ID_honorOriginalMesh, (void *)&honorOriginalMesh);
}
///////////////////////////////////////////////////////////////////////////////
// Get property methods
///////////////////////////////////////////////////////////////////////////////
......@@ -775,6 +794,12 @@ OnionPeelAttributes::GetSeedType() const
return SeedIdType(seedType);
}
bool
OnionPeelAttributes::GetHonorOriginalMesh() const
{
return honorOriginalMesh;
}
///////////////////////////////////////////////////////////////////////////////
// Select property methods
///////////////////////////////////////////////////////////////////////////////
......@@ -821,14 +846,15 @@ OnionPeelAttributes::GetFieldName(int index) const
{
switch (index)
{
case ID_adjacencyType: return "adjacencyType";
case ID_useGlobalId: return "useGlobalId";
case ID_categoryName: return "categoryName";
case ID_subsetName: return "subsetName";
case ID_index: return "index";
case ID_logical: return "logical";
case ID_requestedLayer: return "requestedLayer";
case ID_seedType: return "seedType";
case ID_adjacencyType: return "adjacencyType";
case ID_useGlobalId: return "useGlobalId";
case ID_categoryName: return "categoryName";
case ID_subsetName: return "subsetName";
case ID_index: return "index";
case ID_logical: return "logical";
case ID_requestedLayer: return "requestedLayer";
case ID_seedType: return "seedType";
case ID_honorOriginalMesh: return "honorOriginalMesh";
default: return "invalid index";
}
}
......@@ -853,14 +879,15 @@ OnionPeelAttributes::GetFieldType(int index) const
{
switch (index)
{
case ID_adjacencyType: return FieldType_enum;
case ID_useGlobalId: return FieldType_bool;
case ID_categoryName: return FieldType_string;
case ID_subsetName: return FieldType_string;
case ID_index: return FieldType_intVector;
case ID_logical: return FieldType_bool;
case ID_requestedLayer: return FieldType_int;
case ID_seedType: return FieldType_enum;
case ID_adjacencyType: return FieldType_enum;
case ID_useGlobalId: return FieldType_bool;
case ID_categoryName: return FieldType_string;
case ID_subsetName: return FieldType_string;
case ID_index: return FieldType_intVector;
case ID_logical: return FieldType_bool;
case ID_requestedLayer: return FieldType_int;
case ID_seedType: return FieldType_enum;
case ID_honorOriginalMesh: return FieldType_bool;
default: return FieldType_unknown;
}
}
......@@ -885,14 +912,15 @@ OnionPeelAttributes::GetFieldTypeName(int index) const
{
switch (index)
{
case ID_adjacencyType: return "enum";
case ID_useGlobalId: return "bool";
case ID_categoryName: return "string";
case ID_subsetName: return "string";
case ID_index: return "intVector";
case ID_logical: return "bool";
case ID_requestedLayer: return "int";
case ID_seedType: return "enum";
case ID_adjacencyType: return "enum";
case ID_useGlobalId: return "bool";
case ID_categoryName: return "string";
case ID_subsetName: return "string";
case ID_index: return "intVector";
case ID_logical: return "bool";
case ID_requestedLayer: return "int";
case ID_seedType: return "enum";
case ID_honorOriginalMesh: return "bool";
default: return "invalid index";
}
}
......@@ -959,6 +987,11 @@ OnionPeelAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
retval = (seedType == obj.seedType);
}
break;
case ID_honorOriginalMesh:
{ // new scope
retval = (honorOriginalMesh == obj.honorOriginalMesh);
}
break;
default: retval = false;
}
......
......@@ -109,6 +109,7 @@ public:
void SetLogical(bool logical_);
void SetRequestedLayer(int requestedLayer_);
void SetSeedType(SeedIdType seedType_);
void SetHonorOriginalMesh(bool honorOriginalMesh_);
// Property getting methods
NodeFace GetAdjacencyType() const;
......@@ -122,6 +123,7 @@ public:
bool GetLogical() const;
int GetRequestedLayer() const;
SeedIdType GetSeedType() const;
bool GetHonorOriginalMesh() const;
// Persistence methods
virtual bool CreateNode(DataNode *node, bool completeSave, bool forceAdd);
......@@ -156,6 +158,7 @@ public:
ID_logical,
ID_requestedLayer,
ID_seedType,
ID_honorOriginalMesh,
ID__LAST
};
......@@ -168,11 +171,12 @@ private:
bool logical;
int requestedLayer;
int seedType;
bool honorOriginalMesh;
// Static class format string for type map.
static const char *TypeMapFormatString;
static const private_tmfs_t TmfsStruct;
};
#define ONIONPEELATTRIBUTES_TMFS "ibssi*bii"
#define ONIONPEELATTRIBUTES_TMFS "ibssi*biib"
#endif
......@@ -61,7 +61,7 @@ import java.util.Vector;
public class OnionPeelAttributes extends AttributeSubject implements Plugin
{
private static int OnionPeelAttributes_numAdditionalAtts = 8;
private static int OnionPeelAttributes_numAdditionalAtts = 9;
// Enum values
public final static int NODEFACE_NODE = 0;
......@@ -84,6 +84,7 @@ public class OnionPeelAttributes extends AttributeSubject implements Plugin
logical = false;
requestedLayer = 0;
seedType = SEEDIDTYPE_SEEDCELL;
honorOriginalMesh = true;
}
public OnionPeelAttributes(int nMoreFields)
......@@ -99,6 +100,7 @@ public class OnionPeelAttributes extends AttributeSubject implements Plugin
logical = false;
requestedLayer = 0;
seedType = SEEDIDTYPE_SEEDCELL;
honorOriginalMesh = true;
}
public OnionPeelAttributes(OnionPeelAttributes obj)
......@@ -120,6 +122,7 @@ public class OnionPeelAttributes extends AttributeSubject implements Plugin
logical = obj.logical;
requestedLayer = obj.requestedLayer;
seedType = obj.seedType;
honorOriginalMesh = obj.honorOriginalMesh;
SelectAll();
}
......@@ -155,7 +158,8 @@ public class OnionPeelAttributes extends AttributeSubject implements Plugin
index_equal &&
(logical == obj.logical) &&
(requestedLayer == obj.requestedLayer) &&
(seedType == obj.seedType));
(seedType == obj.seedType) &&
(honorOriginalMesh == obj.honorOriginalMesh));
}
public String GetName() { return "OnionPeel"; }
......@@ -210,6 +214,12 @@ public class OnionPeelAttributes extends AttributeSubject implements Plugin
Select(7);
}
public void SetHonorOriginalMesh(boolean honorOriginalMesh_)
{
honorOriginalMesh = honorOriginalMesh_;
Select(8);
}
// Property getting methods
public int GetAdjacencyType() { return adjacencyType; }
public boolean GetUseGlobalId() { return useGlobalId; }
......@@ -219,6 +229,7 @@ public class OnionPeelAttributes extends AttributeSubject implements Plugin
public boolean GetLogical() { return logical; }
public int GetRequestedLayer() { return requestedLayer; }
public int GetSeedType() { return seedType; }
public boolean GetHonorOriginalMesh() { return honorOriginalMesh; }
// Write and read methods.
public void WriteAtts(CommunicationBuffer buf)
......@@ -239,6 +250,8 @@ public class OnionPeelAttributes extends AttributeSubject implements Plugin
buf.WriteInt(requestedLayer);
if(WriteSelect(7, buf))
buf.WriteInt(seedType);
if(WriteSelect(8, buf))
buf.WriteBool(honorOriginalMesh);
}
public void ReadAtts(int index, CommunicationBuffer buf)
......@@ -269,6 +282,9 @@ public class OnionPeelAttributes extends AttributeSubject implements Plugin
case 7:
SetSeedType(buf.ReadInt());
break;
case 8:
SetHonorOriginalMesh(buf.ReadBool());
break;
}
}
......@@ -293,6 +309,7 @@ public class OnionPeelAttributes extends AttributeSubject implements Plugin
if(seedType == SEEDIDTYPE_SEEDNODE)
str = str + "SEEDIDTYPE_SEEDNODE";
str = str + "\n";
str = str + boolToString("honorOriginalMesh", honorOriginalMesh, indent) + "\n";
return str;
}
......@@ -306,5 +323,6 @@ public class OnionPeelAttributes extends AttributeSubject implements Plugin
private boolean logical;
private int requestedLayer;
private int seedType;
private boolean honorOriginalMesh;
}
......@@ -138,6 +138,11 @@ PyOnionPeelAttributes_ToString(const OnionPeelAttributes *atts, const char *pref
break;
}
if(atts->GetHonorOriginalMesh())
SNPRINTF(tmpStr, 1000, "%shonorOriginalMesh = 1\n", prefix);
else
SNPRINTF(tmpStr, 1000, "%shonorOriginalMesh = 0\n", prefix);
str += tmpStr;
return str;
}
......@@ -399,6 +404,30 @@ OnionPeelAttributes_GetSeedType(PyObject *self, PyObject *args)
return retval;
}
/*static*/ PyObject *
OnionPeelAttributes_SetHonorOriginalMesh(PyObject *self, PyObject *args)
{
OnionPeelAttributesObject *obj = (OnionPeelAttributesObject *)self;
int ival;
if(!PyArg_ParseTuple(args, "i", &ival))
return NULL;
// Set the honorOriginalMesh in the object.
obj->data->SetHonorOriginalMesh(ival != 0);
Py_INCREF(Py_None);
return Py_None;
}
/*static*/ PyObject *
OnionPeelAttributes_GetHonorOriginalMesh(PyObject *self, PyObject *args)
{
OnionPeelAttributesObject *obj = (OnionPeelAttributesObject *)self;
PyObject *retval = PyInt_FromLong(obj->data->GetHonorOriginalMesh()?1L:0L);
return retval;
}
PyMethodDef PyOnionPeelAttributes_methods[ONIONPEELATTRIBUTES_NMETH] = {
......@@ -419,6 +448,8 @@ PyMethodDef PyOnionPeelAttributes_methods[ONIONPEELATTRIBUTES_NMETH] = {
{"GetRequestedLayer", OnionPeelAttributes_GetRequestedLayer, METH_VARARGS},
{"SetSeedType", OnionPeelAttributes_SetSeedType, METH_VARARGS},
{"GetSeedType", OnionPeelAttributes_GetSeedType, METH_VARARGS},
{"SetHonorOriginalMesh", OnionPeelAttributes_SetHonorOriginalMesh, METH_VARARGS},
{"GetHonorOriginalMesh", OnionPeelAttributes_GetHonorOriginalMesh, METH_VARARGS},
{NULL, NULL}
};
......@@ -473,6 +504,8 @@ PyOnionPeelAttributes_getattr(PyObject *self, char *name)
if(strcmp(name, "SeedNode") == 0)
return PyInt_FromLong(long(OnionPeelAttributes::SeedNode));
if(strcmp(name, "honorOriginalMesh") == 0)
return OnionPeelAttributes_GetHonorOriginalMesh(self, NULL);
return Py_FindMethod(PyOnionPeelAttributes_methods, self, name);
}
......@@ -503,6 +536,8 @@ PyOnionPeelAttributes_setattr(PyObject *self, char *name, PyObject *args)
obj = OnionPeelAttributes_SetRequestedLayer(self, tuple);
else if(strcmp(name, "seedType") == 0)
obj = OnionPeelAttributes_SetSeedType(self, tuple);
else if(strcmp(name, "honorOriginalMesh") == 0)
obj = OnionPeelAttributes_SetHonorOriginalMesh(self, tuple);
if(obj != NULL)
Py_DECREF(obj);
......
......@@ -44,7 +44,7 @@
//
// Functions exposed to the VisIt module.
//
#define ONIONPEELATTRIBUTES_NMETH 18
#define ONIONPEELATTRIBUTES_NMETH 20