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) ...@@ -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 // Method: avtDatabaseMetaData::AddGroupInformation
// //
......
...@@ -1810,6 +1810,33 @@ avtDatabaseMetaData::SetContainsGlobalZoneIds(std::string name, bool val) ...@@ -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 Function: AddGroupInformation
Declaration: void AddGroupInformation(int nGroups, int nBlocks, intVector &blockIds); Declaration: void AddGroupInformation(int nGroups, int nBlocks, intVector &blockIds);
Definition: Definition:
......
...@@ -372,6 +372,7 @@ public: ...@@ -372,6 +372,7 @@ public:
void SetContainsOriginalNodes(std::string name, bool); void SetContainsOriginalNodes(std::string name, bool);
void SetContainsGlobalNodeIds(std::string name, bool); void SetContainsGlobalNodeIds(std::string name, bool);
void SetContainsGlobalZoneIds(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 AddGroupInformation(int nGroups, int nBlocks, intVector &blockIds);
void SetExtents(std::string, const double *); void SetExtents(std::string, const double *);
void UnsetExtents(); void UnsetExtents();
......
...@@ -190,6 +190,8 @@ ...@@ -190,6 +190,8 @@
</Function> </Function>
<Function name="SetContainsGlobalZoneIds" user="true" member="true"> <Function name="SetContainsGlobalZoneIds" user="true" member="true">
</Function> </Function>
<Function name="SetZonesWereSplit" user="true" member="true">
</Function>
<Function name="AddGroupInformation" user="true" member="true"> <Function name="AddGroupInformation" user="true" member="true">
</Function> </Function>
<Function name="SetExtents" user="true" member="true"> <Function name="SetExtents" user="true" member="true">
......
...@@ -129,6 +129,7 @@ void avtMeshMetaData::Init() ...@@ -129,6 +129,7 @@ void avtMeshMetaData::Init()
hideFromGUI = false; hideFromGUI = false;
LODs = 1; LODs = 1;
presentGhostZoneTypes = 0; presentGhostZoneTypes = 0;
zonesWereSplit = false;
avtMeshMetaData::SelectAll(); avtMeshMetaData::SelectAll();
} }
...@@ -218,6 +219,7 @@ void avtMeshMetaData::Copy(const avtMeshMetaData &obj) ...@@ -218,6 +219,7 @@ void avtMeshMetaData::Copy(const avtMeshMetaData &obj)
hideFromGUI = obj.hideFromGUI; hideFromGUI = obj.hideFromGUI;
LODs = obj.LODs; LODs = obj.LODs;
presentGhostZoneTypes = obj.presentGhostZoneTypes; presentGhostZoneTypes = obj.presentGhostZoneTypes;
zonesWereSplit = obj.zonesWereSplit;
avtMeshMetaData::SelectAll(); avtMeshMetaData::SelectAll();
} }
...@@ -455,7 +457,8 @@ avtMeshMetaData::operator == (const avtMeshMetaData &obj) const ...@@ -455,7 +457,8 @@ avtMeshMetaData::operator == (const avtMeshMetaData &obj) const
(containsExteriorBoundaryGhosts == obj.containsExteriorBoundaryGhosts) && (containsExteriorBoundaryGhosts == obj.containsExteriorBoundaryGhosts) &&
(hideFromGUI == obj.hideFromGUI) && (hideFromGUI == obj.hideFromGUI) &&
(LODs == obj.LODs) && (LODs == obj.LODs) &&
(presentGhostZoneTypes == obj.presentGhostZoneTypes)); (presentGhostZoneTypes == obj.presentGhostZoneTypes) &&
(zonesWereSplit == obj.zonesWereSplit));
} }
// **************************************************************************** // ****************************************************************************
...@@ -650,6 +653,7 @@ avtMeshMetaData::SelectAll() ...@@ -650,6 +653,7 @@ avtMeshMetaData::SelectAll()
Select(ID_hideFromGUI, (void *)&hideFromGUI); Select(ID_hideFromGUI, (void *)&hideFromGUI);
Select(ID_LODs, (void *)&LODs); Select(ID_LODs, (void *)&LODs);
Select(ID_presentGhostZoneTypes, (void *)&presentGhostZoneTypes); Select(ID_presentGhostZoneTypes, (void *)&presentGhostZoneTypes);
Select(ID_zonesWereSplit, (void *)&zonesWereSplit);
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
...@@ -735,6 +739,7 @@ avtMeshMetaData::GetFieldName(int index) const ...@@ -735,6 +739,7 @@ avtMeshMetaData::GetFieldName(int index) const
case ID_hideFromGUI: return "hideFromGUI"; case ID_hideFromGUI: return "hideFromGUI";
case ID_LODs: return "LODs"; case ID_LODs: return "LODs";
case ID_presentGhostZoneTypes: return "presentGhostZoneTypes"; case ID_presentGhostZoneTypes: return "presentGhostZoneTypes";
case ID_zonesWereSplit: return "zonesWereSplit";
default: return "invalid index"; default: return "invalid index";
} }
} }
...@@ -810,6 +815,7 @@ avtMeshMetaData::GetFieldType(int index) const ...@@ -810,6 +815,7 @@ avtMeshMetaData::GetFieldType(int index) const
case ID_hideFromGUI: return FieldType_bool; case ID_hideFromGUI: return FieldType_bool;
case ID_LODs: return FieldType_int; case ID_LODs: return FieldType_int;
case ID_presentGhostZoneTypes: return FieldType_int; case ID_presentGhostZoneTypes: return FieldType_int;
case ID_zonesWereSplit: return FieldType_bool;
default: return FieldType_unknown; default: return FieldType_unknown;
} }
} }
...@@ -885,6 +891,7 @@ avtMeshMetaData::GetFieldTypeName(int index) const ...@@ -885,6 +891,7 @@ avtMeshMetaData::GetFieldTypeName(int index) const
case ID_hideFromGUI: return "bool"; case ID_hideFromGUI: return "bool";
case ID_LODs: return "int"; case ID_LODs: return "int";
case ID_presentGhostZoneTypes: return "int"; case ID_presentGhostZoneTypes: return "int";
case ID_zonesWereSplit: return "bool";
default: return "invalid index"; default: return "invalid index";
} }
} }
...@@ -1196,6 +1203,11 @@ avtMeshMetaData::FieldsEqual(int index_, const AttributeGroup *rhs) const ...@@ -1196,6 +1203,11 @@ avtMeshMetaData::FieldsEqual(int index_, const AttributeGroup *rhs) const
retval = (presentGhostZoneTypes == obj.presentGhostZoneTypes); retval = (presentGhostZoneTypes == obj.presentGhostZoneTypes);
} }
break; break;
case ID_zonesWereSplit:
{ // new scope
retval = (zonesWereSplit == obj.zonesWereSplit);
}
break;
default: retval = false; default: retval = false;
} }
......
...@@ -161,6 +161,7 @@ public: ...@@ -161,6 +161,7 @@ public:
ID_hideFromGUI, ID_hideFromGUI,
ID_LODs, ID_LODs,
ID_presentGhostZoneTypes, ID_presentGhostZoneTypes,
ID_zonesWereSplit,
ID__LAST ID__LAST
}; };
...@@ -216,12 +217,13 @@ public: ...@@ -216,12 +217,13 @@ public:
bool hideFromGUI; bool hideFromGUI;
int LODs; int LODs;
int presentGhostZoneTypes; int presentGhostZoneTypes;
bool zonesWereSplit;
private: private:
// Static class format string for type map. // Static class format string for type map.
static const char *TypeMapFormatString; static const char *TypeMapFormatString;
static const private_tmfs_t TmfsStruct; static const private_tmfs_t TmfsStruct;
}; };
#define AVTMESHMETADATA_TMFS "ssbiiiibIbiissssssbDDiisss*aiisss*i*i*bibbbbibFFbDibbii" #define AVTMESHMETADATA_TMFS "ssbiiiibIbiissssssbDDiisss*aiisss*i*i*bibbbbibFFbDibbiib"
#endif #endif
...@@ -175,6 +175,9 @@ ...@@ -175,6 +175,9 @@
<Field name="presentGhostZoneTypes" label="Present ghost zone types" type="int" access="public"> <Field name="presentGhostZoneTypes" label="Present ghost zone types" type="int" access="public">
0 0
</Field> </Field>
<Field name="zonesWereSplit" label="Orignal zones were split" type="bool" access="public">
false
</Field>
<Function name="avtMeshMetaData2" user="true" member="true"> <Function name="avtMeshMetaData2" user="true" member="true">
</Function> </Function>
<Function name="avtMeshMetaData3" user="true" member="true"> <Function name="avtMeshMetaData3" user="true" member="true">
......
...@@ -804,6 +804,10 @@ avtDatabase::GetOutput(const char *var, int ts) ...@@ -804,6 +804,10 @@ avtDatabase::GetOutput(const char *var, int ts)
// Burlen Loring, Sun Apr 27 15:17:23 PDT 2014 // Burlen Loring, Sun Apr 27 15:17:23 PDT 2014
// Cleanup -Wall warnings // 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 void
...@@ -865,6 +869,10 @@ avtDatabase::PopulateDataObjectInformation(avtDataObject_p &dob, ...@@ -865,6 +869,10 @@ avtDatabase::PopulateDataObjectInformation(avtDataObject_p &dob,
validity.InvalidateZones(); validity.InvalidateZones();
validity.InvalidateNodes(); validity.InvalidateNodes();
} }
if (mmd->zonesWereSplit)
{
validity.InvalidateZones();
}
// //
// Note that we are using the spatial extents as both the spatial // Note that we are using the spatial extents as both the spatial
......
...@@ -11356,6 +11356,12 @@ avtSiloFileFormat::ReadInArbConnectivity(const char *meshname, ...@@ -11356,6 +11356,12 @@ avtSiloFileFormat::ReadInArbConnectivity(const char *meshname,
delete cellReMap; 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) ...@@ -1409,6 +1409,9 @@ CreateUnstructuredMeshGlobalNodeIds(visit_handle h)
// Brad Whitlock, Fri Jun 13 10:56:13 PDT 2014 // Brad Whitlock, Fri Jun 13 10:56:13 PDT 2014
// I added global nodes/cell support. // 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 * vtkDataSet *
...@@ -1456,6 +1459,7 @@ avtSimV2FileFormat::GetMesh(int domain, const char *meshname) ...@@ -1456,6 +1459,7 @@ avtSimV2FileFormat::GetMesh(int domain, const char *meshname)
cache->CacheVoidRef(meshname, cache->CacheVoidRef(meshname,
AUXILIARY_DATA_POLYHEDRAL_SPLIT, AUXILIARY_DATA_POLYHEDRAL_SPLIT,
timestep, domain, vr); timestep, domain, vr);
metadata->SetZonesWereSplit(meshname, true);
} }
else else
{ {
......
...@@ -58,7 +58,7 @@ import java.lang.Integer; ...@@ -58,7 +58,7 @@ import java.lang.Integer;
public class avtMeshMetaData extends AttributeSubject public class avtMeshMetaData extends AttributeSubject
{ {
private static int avtMeshMetaData_numAdditionalAtts = 51; private static int avtMeshMetaData_numAdditionalAtts = 52;
public avtMeshMetaData() public avtMeshMetaData()
{ {
...@@ -152,6 +152,7 @@ public class avtMeshMetaData extends AttributeSubject ...@@ -152,6 +152,7 @@ public class avtMeshMetaData extends AttributeSubject
hideFromGUI = false; hideFromGUI = false;
LODs = 1; LODs = 1;
presentGhostZoneTypes = 0; presentGhostZoneTypes = 0;
zonesWereSplit = false;
} }
public avtMeshMetaData(int nMoreFields) public avtMeshMetaData(int nMoreFields)
...@@ -246,6 +247,7 @@ public class avtMeshMetaData extends AttributeSubject ...@@ -246,6 +247,7 @@ public class avtMeshMetaData extends AttributeSubject
hideFromGUI = false; hideFromGUI = false;
LODs = 1; LODs = 1;
presentGhostZoneTypes = 0; presentGhostZoneTypes = 0;
zonesWereSplit = false;
} }
public avtMeshMetaData(avtMeshMetaData obj) public avtMeshMetaData(avtMeshMetaData obj)
...@@ -343,6 +345,7 @@ public class avtMeshMetaData extends AttributeSubject ...@@ -343,6 +345,7 @@ public class avtMeshMetaData extends AttributeSubject
hideFromGUI = obj.hideFromGUI; hideFromGUI = obj.hideFromGUI;
LODs = obj.LODs; LODs = obj.LODs;
presentGhostZoneTypes = obj.presentGhostZoneTypes; presentGhostZoneTypes = obj.presentGhostZoneTypes;
zonesWereSplit = obj.zonesWereSplit;
SelectAll(); SelectAll();
} }
...@@ -478,7 +481,8 @@ public class avtMeshMetaData extends AttributeSubject ...@@ -478,7 +481,8 @@ public class avtMeshMetaData extends AttributeSubject
(containsExteriorBoundaryGhosts == obj.containsExteriorBoundaryGhosts) && (containsExteriorBoundaryGhosts == obj.containsExteriorBoundaryGhosts) &&
(hideFromGUI == obj.hideFromGUI) && (hideFromGUI == obj.hideFromGUI) &&
(LODs == obj.LODs) && (LODs == obj.LODs) &&
(presentGhostZoneTypes == obj.presentGhostZoneTypes)); (presentGhostZoneTypes == obj.presentGhostZoneTypes) &&
(zonesWereSplit == obj.zonesWereSplit));
} }
// Property setting methods // Property setting methods
...@@ -830,6 +834,12 @@ public class avtMeshMetaData extends AttributeSubject ...@@ -830,6 +834,12 @@ public class avtMeshMetaData extends AttributeSubject
Select(50); Select(50);
} }
public void SetZonesWereSplit(boolean zonesWereSplit_)
{
zonesWereSplit = zonesWereSplit_;
Select(51);
}
// Property getting methods // Property getting methods
public String GetName() { return name; } public String GetName() { return name; }
public String GetOriginalName() { return originalName; } public String GetOriginalName() { return originalName; }
...@@ -882,6 +892,7 @@ public class avtMeshMetaData extends AttributeSubject ...@@ -882,6 +892,7 @@ public class avtMeshMetaData extends AttributeSubject
public boolean GetHideFromGUI() { return hideFromGUI; } public boolean GetHideFromGUI() { return hideFromGUI; }
public int GetLODs() { return LODs; } public int GetLODs() { return LODs; }
public int GetPresentGhostZoneTypes() { return presentGhostZoneTypes; } public int GetPresentGhostZoneTypes() { return presentGhostZoneTypes; }
public boolean GetZonesWereSplit() { return zonesWereSplit; }
// Write and read methods. // Write and read methods.
public void WriteAtts(CommunicationBuffer buf) public void WriteAtts(CommunicationBuffer buf)
...@@ -988,6 +999,8 @@ public class avtMeshMetaData extends AttributeSubject ...@@ -988,6 +999,8 @@ public class avtMeshMetaData extends AttributeSubject
buf.WriteInt(LODs); buf.WriteInt(LODs);
if(WriteSelect(50, buf)) if(WriteSelect(50, buf))
buf.WriteInt(presentGhostZoneTypes); buf.WriteInt(presentGhostZoneTypes);
if(WriteSelect(51, buf))
buf.WriteBool(zonesWereSplit);
} }
public void ReadAtts(int index, CommunicationBuffer buf) public void ReadAtts(int index, CommunicationBuffer buf)
...@@ -1148,6 +1161,9 @@ public class avtMeshMetaData extends AttributeSubject ...@@ -1148,6 +1161,9 @@ public class avtMeshMetaData extends AttributeSubject
case 50: case 50:
SetPresentGhostZoneTypes(buf.ReadInt()); SetPresentGhostZoneTypes(buf.ReadInt());
break; break;
case 51:
SetZonesWereSplit(buf.ReadBool());
break;
} }
} }
...@@ -1205,6 +1221,7 @@ public class avtMeshMetaData extends AttributeSubject ...@@ -1205,6 +1221,7 @@ public class avtMeshMetaData extends AttributeSubject
str = str + boolToString("hideFromGUI", hideFromGUI, indent) + "\n"; str = str + boolToString("hideFromGUI", hideFromGUI, indent) + "\n";
str = str + intToString("LODs", LODs, indent) + "\n"; str = str + intToString("LODs", LODs, indent) + "\n";
str = str + intToString("presentGhostZoneTypes", presentGhostZoneTypes, indent) + "\n"; str = str + intToString("presentGhostZoneTypes", presentGhostZoneTypes, indent) + "\n";
str = str + boolToString("zonesWereSplit", zonesWereSplit, indent) + "\n";
return str; return str;
} }
...@@ -1261,5 +1278,6 @@ public class avtMeshMetaData extends AttributeSubject ...@@ -1261,5 +1278,6 @@ public class avtMeshMetaData extends AttributeSubject
private boolean hideFromGUI; private boolean hideFromGUI;
private int LODs; private int LODs;
private int presentGhostZoneTypes; private int presentGhostZoneTypes;
private boolean zonesWereSplit;
} }
...@@ -33,6 +33,9 @@ ...@@ -33,6 +33,9 @@
<Field name="seedType" label="Seed Type" type="enum" subtype="SeedIdType"> <Field name="seedType" label="Seed Type" type="enum" subtype="SeedIdType">
SeedCell SeedCell
</Field> </Field>
<Field name="honorOriginalMesh" label="honorOriginalMesh" type="bool">
true
</Field>
<Function name="OnionPeelViewerPluginInfo::InitializeOperatorAtts" user="false" member="true"> <Function name="OnionPeelViewerPluginInfo::InitializeOperatorAtts" user="false" member="true">
</Function> </Function>
</Attribute> </Attribute>
......
...@@ -138,6 +138,7 @@ void OnionPeelAttributes::Init() ...@@ -138,6 +138,7 @@ void OnionPeelAttributes::Init()
logical = false; logical = false;
requestedLayer = 0; requestedLayer = 0;
seedType = SeedCell; seedType = SeedCell;
honorOriginalMesh = true;
OnionPeelAttributes::SelectAll(); OnionPeelAttributes::SelectAll();
} }
...@@ -167,6 +168,7 @@ void OnionPeelAttributes::Copy(const OnionPeelAttributes &obj) ...@@ -167,6 +168,7 @@ void OnionPeelAttributes::Copy(const OnionPeelAttributes &obj)
logical = obj.logical; logical = obj.logical;
requestedLayer = obj.requestedLayer; requestedLayer = obj.requestedLayer;
seedType = obj.seedType; seedType = obj.seedType;
honorOriginalMesh = obj.honorOriginalMesh;
OnionPeelAttributes::SelectAll(); OnionPeelAttributes::SelectAll();
} }
...@@ -331,7 +333,8 @@ OnionPeelAttributes::operator == (const OnionPeelAttributes &obj) const ...@@ -331,7 +333,8 @@ OnionPeelAttributes::operator == (const OnionPeelAttributes &obj) const
(index == obj.index) && (index == obj.index) &&
(logical == obj.logical) && (logical == obj.logical) &&
(requestedLayer == obj.requestedLayer) && (requestedLayer == obj.requestedLayer) &&
(seedType == obj.seedType)); (seedType == obj.seedType) &&
(honorOriginalMesh == obj.honorOriginalMesh));
} }
// **************************************************************************** // ****************************************************************************
...@@ -475,14 +478,15 @@ OnionPeelAttributes::NewInstance(bool copy) const ...@@ -475,14 +478,15 @@ OnionPeelAttributes::NewInstance(bool copy) const
void void
OnionPeelAttributes::SelectAll() OnionPeelAttributes::SelectAll()
{ {
Select(ID_adjacencyType, (void *)&adjacencyType); Select(ID_adjacencyType, (void *)&adjacencyType);
Select(ID_useGlobalId, (void *)&useGlobalId); Select(ID_useGlobalId, (void *)&useGlobalId);
Select(ID_categoryName, (void *)&categoryName); Select(ID_categoryName, (void *)&categoryName);
Select(ID_subsetName, (void *)&subsetName); Select(ID_subsetName, (void *)&subsetName);
Select(ID_index, (void *)&index); Select(ID_index, (void *)&index);
Select(ID_logical, (void *)&logical); Select(ID_logical, (void *)&logical);
Select(ID_requestedLayer, (void *)&requestedLayer); Select(ID_requestedLayer, (void *)&requestedLayer);
Select(ID_seedType, (void *)&seedType); Select(ID_seedType, (void *)&seedType);
Select(ID_honorOriginalMesh, (void *)&honorOriginalMesh);
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
...@@ -563,6 +567,12 @@ OnionPeelAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool fo ...@@ -563,6 +567,12 @@ OnionPeelAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool fo
node->AddNode(new DataNode("seedType", SeedIdType_ToString(seedType))); 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. // Add the node to the parent node.
if(addToParent || forceAdd) if(addToParent || forceAdd)
...@@ -643,6 +653,8 @@ OnionPeelAttributes::SetFromNode(DataNode *parentNode) ...@@ -643,6 +653,8 @@ OnionPeelAttributes::SetFromNode(DataNode *parentNode)
SetSeedType(value); SetSeedType(value);
} }
} }
if((node = searchNode->GetNode("honorOriginalMesh")) != 0)
SetHonorOriginalMesh(node->AsBool());
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
...@@ -705,6 +717,13 @@ OnionPeelAttributes::SetSeedType(OnionPeelAttributes::SeedIdType seedType_) ...@@ -705,6 +717,13 @@ OnionPeelAttributes::SetSeedType(OnionPeelAttributes::SeedIdType seedType_)
Select(ID_seedType, (void *)&seedType); Select(ID_seedType, (void *)&seedType);
} }
void
OnionPeelAttributes::SetHonorOriginalMesh(bool honorOriginalMesh_)
{
honorOriginalMesh = honorOriginalMesh_;
Select(ID_honorOriginalMesh, (void *)&honorOriginalMesh);
}
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Get property methods // Get property methods
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
...@@ -775,6 +794,12 @@ OnionPeelAttributes::GetSeedType() const ...@@ -775,6 +794,12 @@ OnionPeelAttributes::GetSeedType() const
return SeedIdType(seedType); return SeedIdType(seedType);
} }
bool
OnionPeelAttributes::GetHonorOriginalMesh() const
{
return honorOriginalMesh;
}
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Select property methods // Select property methods
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
...@@ -821,14 +846,15 @@ OnionPeelAttributes::GetFieldName(int index) const ...@@ -821,14 +846,15 @@ OnionPeelAttributes::GetFieldName(int index) const
{ {
switch (index) switch (index)
{ {
case ID_adjacencyType: return "adjacencyType"; case ID_adjacencyType: return "adjacencyType";
case ID_useGlobalId: return "useGlobalId"; case ID_useGlobalId: return "useGlobalId";
case ID_categoryName: return "categoryName"; case ID_categoryName: return "categoryName";
case ID_subsetName: return "subsetName"; case ID_subsetName: return "subsetName";
case ID_index: return "index"; case ID_index: return "index";
case ID_logical: return "logical"; case ID_logical: return "logical";
case ID_requestedLayer: return "requestedLayer"; case ID_requestedLayer: return "requestedLayer";
case ID_seedType: return "seedType"; case ID_seedType: return "seedType";
case ID_honorOriginalMesh: return "honorOriginalMesh";
default: return "invalid index"; default: return "invalid index";
} }
} }
...@@ -853,14 +879,15 @@ OnionPeelAttributes::GetFieldType(int index) const ...@@ -853,14 +879,15 @@ OnionPeelAttributes::GetFieldType(int index) const
{ {
switch (index) switch (index)
{ {
case ID_adjacencyType: return FieldType_enum; case ID_adjacencyType: return FieldType_enum;
case ID_useGlobalId: return FieldType_bool; case ID_useGlobalId: return FieldType_bool;
case ID_categoryName: return FieldType_string; case ID_categoryName: return FieldType_string;
case ID_subsetName: return FieldType_string; case ID_subsetName: return FieldType_string;
case ID_index: return FieldType_intVector; case ID_index: return FieldType_intVector;
case ID_logical: return FieldType_bool; case ID_logical: return FieldType_bool;
case ID_requestedLayer: return FieldType_int; case ID_requestedLayer: return FieldType_int;
case ID_seedType: return FieldType_enum; case ID_seedType: return FieldType_enum;
case ID_honorOriginalMesh: return FieldType_bool;
default: return FieldType_unknown; default: return FieldType_unknown;
} }
} }
...@@ -885,14 +912,15 @@ OnionPeelAttributes::GetFieldTypeName(int index) const ...@@ -885,14 +912,15 @@ OnionPeelAttributes::GetFieldTypeName(int index) const
{ {
switch (index) switch (index)
{ {
case ID_adjacencyType: return "enum"; case ID_adjacencyType: return "enum";
case ID_useGlobalId: return "bool"; case ID_useGlobalId: return "bool";
case ID_categoryName: return "string"; case ID_categoryName: return "string";
case ID_subsetName: return "string"; case ID_subsetName: return "string";
case ID_index: return "intVector"; case ID_index: return "intVector";
case ID_logical: return "bool"; case ID_logical: return "bool";
case ID_requestedLayer: return "int"; case ID_requestedLayer: return "int";
case ID_seedType: return "enum"; case ID_seedType: return "enum";
case ID_honorOriginalMesh: return "bool";
default: return "invalid index"; default: return "invalid index";
} }
} }
...@@ -959,6 +987,11 @@ OnionPeelAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const ...@@ -959,6 +987,11 @@ OnionPeelAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
retval = (seedType == obj.seedType); retval = (seedType == obj.seedType);
} }
break; break;
case ID_honorOriginalMesh:
{ // new scope
retval = (honorOriginalMesh == obj.honorOriginalMesh);
}
break;