Commit feb724e9 authored by mlarsen's avatar mlarsen

Pick infrastructure change to support picking by label for database readers...

Pick infrastructure change to support picking by label for database readers that support them. There are additional fixes for zone pick highlights and picking multiple elements at with a single call

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@31467 18c085ea-50e0-402c-830e-de6fd14e8384
parent f15a832c
......@@ -972,4 +972,33 @@ FileFormatCloseFileCallback(void *ptr, int idx)
ff->CloseFileDescriptor(idx);
}
// ****************************************************************************
// Function: AddLabelVarToMetaData
//
// Purpose:
// Function to assist for adding labeled elements (zone and node) meta
// data
//
// Arguments:
// md The meta-data object to add the scalar var to.
// name The name of the scalar variable.
// mesh The mesh the scalar var is defined on.
// cent The centering type - node vs cell.
//
// Programmer: Matt Larsen
// Creation: July 1, 2017
//
// ****************************************************************************
void
avtFileFormat::AddLabelVarToMetaData(avtDatabaseMetaData *md, string name,
string mesh, avtCentering cent, int dim,
bool hideFromGUI)
{
avtLabelMetaData *label = new avtLabelMetaData();
label->name = name;
label->meshName = mesh;
label->centering = cent;
label->hideFromGUI = hideFromGUI;
md->Add(label);
}
......@@ -137,6 +137,9 @@ class avtVariableCache;
// Burlen Loring, Tue Sep 29 13:39:15 PDT 2015
// Clean up some warnings
//
// Matt Larsen, Sat Jul 1 11:32:01 PDT 2017
// Adding helper function to add element label meta data
//
// ****************************************************************************
class DATABASE_API avtFileFormat
......@@ -289,6 +292,9 @@ class DATABASE_API avtFileFormat
const double * = NULL);
void AddTensorVarToMetaData(avtDatabaseMetaData *, std::string,
std::string, avtCentering, int = 3);
void AddLabelVarToMetaData(avtDatabaseMetaData *, std::string,
std::string, avtCentering, int = 3,
bool hideFromGUI = false);
void AddSymmetricTensorVarToMetaData(avtDatabaseMetaData *,
std::string, std::string, avtCentering, int = 3);
void AddMaterialToMetaData(avtDatabaseMetaData *, std::string,
......
......@@ -39,11 +39,15 @@
#include <avtPickActor.h>
#include <vtkActor.h>
#include <vtkActor2D.h>
#include <vtkCoordinate.h>
#include <vtkFollower.h>
#include <vtkLineSource.h>
#include <vtkMultiLineSource.h>
#include <vtkPolyDataMapper.h>
#include <vtkPolyDataMapper2D.h>
#include <vtkProperty.h>
#include <vtkProperty2D.h>
#include <vtkRenderer.h>
#include <vtkVectorText.h>
#include <vtkGlyphSource2D.h>
......@@ -74,6 +78,9 @@
//
// Matt Larsen, Mon September 19 08:34:22 PDT 2016
// Changed glyph type to circle
//
// Matt Larsen, Wed September 6 09:10:01 PDT 2017
// Changed highlights to overlay to show internal zones
// ****************************************************************************
avtPickActor:: avtPickActor()
{
......@@ -91,6 +98,7 @@ avtPickActor:: avtPickActor()
lineSource->SetResolution(1); // only need one line segment here
lineMapper = vtkPolyDataMapper::New();
lineMapper->SetInputConnection(lineSource->GetOutputPort());
lineActor = vtkActor::New();
lineActor->SetMapper(lineMapper);
lineActor->PickableOff();
......@@ -98,6 +106,7 @@ avtPickActor:: avtPickActor()
lineActor->GetProperty()->SetAmbient(1.);
lineActor->GetProperty()->SetDiffuse(0.);
letterActor = vtkFollower::New();
letterActor->GetProperty()->SetColor(0., 0., 0.);
letterActor->SetScale(0.5);
......@@ -143,6 +152,9 @@ avtPickActor:: avtPickActor()
// Matt Larsen, Fri July 1 09:41:01 PDT 2016
// Delete highlightActor, highlightSource,highlightMapper
//
// Matt Larsen, Wed September 6 09:10:01 PDT 2017
// Changed highlights to overlay to show internal zones
//
// ****************************************************************************
avtPickActor::~avtPickActor()
......@@ -292,6 +304,12 @@ avtPickActor::Remove()
//
// Matt Larsen, Fri July 1 09:41:01 PDT 2016
// Added highlightSource shift.
//
// Matt Larsen, Sat July 1 08:16:51 PDT 2017
// We now support using a element label as a pick designator,
// and the text sizes are larger than the typical pick letter that
// is one or two chars long. We now increase the shift factor for
// the glyph in porportion to its legnth.
// ****************************************************************************
void
......@@ -301,6 +319,9 @@ avtPickActor::Shift(const double vec[3])
if (mode3D)
{
shiftFactor = 3.; // completely arbitrary shift factor!!!
// setting large designators like labels need to be
// offset more than the standard amount
shiftFactor *= float(designator.size());
newPos[0] = attach[0] + vec[0] *shiftFactor;
newPos[1] = attach[1] + vec[1] *shiftFactor;
newPos[2] = attach[2] + vec[2] *shiftFactor;
......@@ -309,7 +330,6 @@ avtPickActor::Shift(const double vec[3])
newGlyphPos[2] = attach[2] + vec[2] *0.25;
glyphActor->SetPosition(newGlyphPos[0], newGlyphPos[1], newGlyphPos[2]);
if(highlightSource != NULL) highlightSource->Shift3d(vec, .7);
}
else
{
......@@ -321,7 +341,6 @@ avtPickActor::Shift(const double vec[3])
vec2[0] = 0.;
vec2[1] = 0.;
vec2[2] = vec[2];
if(highlightSource != NULL) highlightSource->Shift2d(.1);
}
lineSource->SetPoint2(newPos[0], newPos[1], newPos[2]);
letterActor->SetPosition(newPos[0], newPos[1], newPos[2]);
......@@ -712,6 +731,9 @@ avtPickActor::GetLetterPosition()
//
// Modifications:
//
// Matt Larsen, Wed September 6 09:10:01 PDT 2017
// Changed highlights to overlay to show internal zones
//
// ****************************************************************************
void
......@@ -720,14 +742,19 @@ avtPickActor::AddLine(double p0[3], double p1[3])
if(highlightSource == NULL)
{
highlightSource = vtkMultiLineSource::New();
highlightMapper = vtkPolyDataMapper::New();
highlightMapper = vtkPolyDataMapper2D::New();
highlightMapper->SetInputConnection(highlightSource->GetOutputPort());
highlightActor = vtkActor::New();
vtkCoordinate *coordinate = vtkCoordinate::New();
coordinate->SetCoordinateSystemToWorld();
highlightMapper->SetTransformCoordinate(coordinate);
highlightMapper->ScalarVisibilityOn();
highlightMapper->SetScalarModeToUsePointData();
highlightActor = vtkActor2D::New();
highlightActor->SetMapper(highlightMapper);
highlightActor->PickableOff();
highlightActor->GetProperty()->SetColor(1., 0., 0.);
highlightActor->GetProperty()->SetAmbient(1.);
highlightActor->GetProperty()->SetDiffuse(0.);
highlightActor->GetProperty()->SetLineWidth(3.);
}
......
......@@ -43,10 +43,12 @@
#include <ref_ptr.h>
class vtkActor;
class vtkActor2D;
class vtkFollower;
class vtkLineSource;
class vtkMultiLineSource;
class vtkPolyDataMapper;
class vtkPolyDataMapper2D;
class vtkRenderer;
class vtkGlyphSource2D;
......@@ -88,6 +90,9 @@ class vtkGlyphSource2D;
// Added methods 'GetShowPickLetter' 'SetShowPickLetter'
// Added member variable showPickLetter
//
// Matt Larsen, Wed September 6 09:10:01 PDT 2017
// Changed highlights to overlay(2D) to show internal zones
//
// ****************************************************************************
class PLOTTER_API avtPickActor
......@@ -136,9 +141,9 @@ class PLOTTER_API avtPickActor
vtkGlyphSource2D *glyphSource;
vtkPolyDataMapper *glyphMapper;
vtkMultiLineSource *highlightSource;
vtkPolyDataMapper *highlightMapper;
vtkActor *highlightActor;
vtkMultiLineSource *highlightSource;
vtkPolyDataMapper2D *highlightMapper;
vtkActor2D *highlightActor;
vtkRenderer *renderer;
private:
......
......@@ -137,11 +137,16 @@ avtPickByNodeQuery::~avtPickByNodeQuery()
// Kathleen Biagas, Tue Jul 22 11:38:50 MST 2014
// Don't convert to Global ids unless user wants ids shown as global.
//
// Matt Larsen, Mon Jul 3 07:15:55 PDT 2017
// Adding support for picking a node by label.
//
// ****************************************************************************
void
avtPickByNodeQuery::Execute(vtkDataSet *ds, const int dom)
{
bool pickByLabel = pickAtts.GetElementLabel() != "";
if (pickAtts.GetFulfilled() || ds == NULL)
{
return;
......@@ -152,7 +157,8 @@ avtPickByNodeQuery::Execute(vtkDataSet *ds, const int dom)
if (dom != pickAtts.GetDomain())
return;
}
else if (ds->GetPointData()->GetArray("avtGlobalNodeNumbers") == NULL)
else if (ds->GetPointData()->GetArray("avtGlobalNodeNumbers") == NULL &&
!pickByLabel)
{
pickAtts.SetDomain(-1);
pickAtts.SetElementNumber(-1);
......@@ -163,7 +169,40 @@ avtPickByNodeQuery::Execute(vtkDataSet *ds, const int dom)
return;
}
int nodeid = pickAtts.GetElementNumber();
int nodeid;
if(pickByLabel)
{
std::string nodeLabel = pickAtts.GetElementLabel();
bool isZone = false;
int id;
bool error = GetElementIdByLabel(nodeLabel, isZone, id, dom);
if(error)
{
pickAtts.SetDomain(-1);
pickAtts.SetElementNumber(-1);
pickAtts.SetErrorMessage("Pick could not be performed because a node "
"label was specified for Pick but the mesh "
"does not contain zone label information.");
pickAtts.SetError(true);
return;
}
if( id != -1 )
{
nodeid = id;
}
else
{
return;
}
}
else
{
nodeid = pickAtts.GetElementNumber();
}
int usernodeid = nodeid;
int maxEls = ds->GetNumberOfPoints();
......@@ -176,7 +215,7 @@ avtPickByNodeQuery::Execute(vtkDataSet *ds, const int dom)
bool DBsuppliedNodeId = true;
if (!pickAtts.GetMatSelected() && ghostType != AVT_CREATED_GHOSTS)
{
if (pickAtts.GetElementIsGlobal())
if (pickAtts.GetElementIsGlobal() && !pickByLabel)
{
usernodeid = vtkVisItUtility::GetLocalElementForGlobal(ds,
usernodeid, false);
......
......@@ -144,11 +144,16 @@ avtPickByZoneQuery::~avtPickByZoneQuery()
// Fixed pick highlight issue with incorrect zone being hightlighted
// in some cases.
//
// Matt Larsen, July 19 08:29:l2 PDT 2017
// Added support for picking by label
//
// ****************************************************************************
void
avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom)
{
bool pickByLabel = pickAtts.GetElementLabel() != "";
if (pickAtts.GetFulfilled() || ds == NULL)
{
return;
......@@ -159,7 +164,8 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom)
if (dom != pickAtts.GetDomain())
return;
}
else if (ds->GetCellData()->GetArray("avtGlobalZoneNumbers") == NULL)
else if (ds->GetCellData()->GetArray("avtGlobalZoneNumbers") == NULL &&
!pickByLabel)
{
pickAtts.SetDomain(-1);
pickAtts.SetElementNumber(-1);
......@@ -169,7 +175,39 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom)
pickAtts.SetError(true);
return;
}
int userZoneId = pickAtts.GetElementNumber();
int userZoneId = pickAtts.GetElementNumber();
if(pickByLabel)
{
std::string zoneLabel = pickAtts.GetElementLabel();
bool isZone = true;
int id;
bool error = GetElementIdByLabel(zoneLabel, isZone, id, dom);
if(error)
{
pickAtts.SetDomain(-1);
pickAtts.SetElementNumber(-1);
pickAtts.SetErrorMessage("Pick could not be performed because a zone "
"label was specified for Pick but the mesh "
"does not contain zone label information.");
pickAtts.SetError(true);
return;
}
if( id != -1 )
{
userZoneId = id;
}
else
{
return;
}
}
else
{
userZoneId = pickAtts.GetElementNumber();
}
int zoneid = userZoneId;
int origPick = zoneid;
int maxEls = ds->GetNumberOfCells();
......@@ -191,7 +229,7 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom)
bool DBsuppliedZoneId = true;
if (!pickAtts.GetMatSelected() && ghostType != AVT_CREATED_GHOSTS)
{
if (pickAtts.GetElementIsGlobal())
if (pickAtts.GetElementIsGlobal() && !pickByLabel)
{
userZoneId = vtkVisItUtility::GetLocalElementForGlobal(
ds, userZoneId, true);
......@@ -219,7 +257,7 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom)
return;
}
}
if (pickAtts.GetElementIsGlobal())
if (pickAtts.GetElementIsGlobal()&& !pickByLabel)
pickAtts.SetDomain(dom);
src->Query(&pickAtts);
......@@ -227,7 +265,7 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom)
if (!pickAtts.GetFulfilled())
return;
if (pickAtts.GetElementIsGlobal() && DBsuppliedZoneId)
if (pickAtts.GetElementIsGlobal() && DBsuppliedZoneId && !pickByLabel)
{
zoneid = GetCurrentZoneForOriginal(ds, pickAtts.GetElementNumber());
userZoneId = zoneid;
......@@ -236,7 +274,6 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom)
}
pickAtts.SetElementNumber(userZoneId+cellOrigin);
if (pickAtts.GetMatSelected())
{
RetrieveVarInfo(ds, zoneid, pickAtts.GetIncidentElements());
......
......@@ -53,8 +53,10 @@
#include <vtkIdList.h>
#include <vtkIntArray.h>
#include <vtkMath.h>
#include <vtkElementLabelArray.h>
#include <vtkPointData.h>
#include <vtkPoints.h>
#include <vtkSmartPointer.h>
#include <vtkUnsignedCharArray.h>
#include <vtkUnsignedIntArray.h>
#include <vtkVisItUtility.h>
......@@ -1915,11 +1917,12 @@ avtPickQuery::ExtractZonePickHighlights(const int &zoneId,
pickAtts.ClearLines();
// Bail if highlights are not on
if(!pickAtts.GetShowPickHighlight()) return;
// Check to see if the cells were decomposed in some way
vtkDataArray* origCellsArr = ds->GetCellData()->
GetArray("avtOriginalCellNumbers");
if ( (!origCellsArr) || (origCellsArr->GetDataType() != VTK_UNSIGNED_INT)
|| (origCellsArr->GetNumberOfComponents() != 2))
|| (origCellsArr->GetNumberOfComponents() != 2 ))
{
// this is a normal cell or could not find the proper
// original cell information. Just extract the lines from the edges
......@@ -1953,12 +1956,15 @@ avtPickQuery::ExtractZonePickHighlights(const int &zoneId,
{
if(origCell == origCellNums[i*2+1] &&
origDom == origCellNums[i*2+0])
{
relatedCells.push_back(i);
}
}
// loop over related cells and eliminate duplicate egdes
vtkEdgeTable *edgeTable = vtkEdgeTable::New();
vtkSmartPointer<vtkEdgeTable> edgeTable = vtkSmartPointer<vtkEdgeTable>::New();
const int numRelated = relatedCells.size();
for(int i = 0; i < numRelated; ++i)
{
const int cellId = relatedCells[i];
......@@ -1988,13 +1994,82 @@ avtPickQuery::ExtractZonePickHighlights(const int &zoneId,
{
vtkIdType p1Id,p2Id;
edgeTable->GetNextEdge(p1Id,p2Id);
double p1[3],p2[2];
double p1[3],p2[3];
ds->GetPoint(p1Id, p1);
ds->GetPoint(p2Id, p2);
pickAtts.AddLine(p1, p2,i);
}
// cleanup
edgeTable->Delete();
}
}
// ****************************************************************************
// Method: avtPickQuery::GetElementIdByLabel
//
// Purpose:
// This method translates between and element label and its actual element
// id so the rest of the pick can proceed normally
//
// Programmer: Matt Larsen
// Creation: May 4, 2017
//
// ****************************************************************************
bool
avtPickQuery::GetElementIdByLabel(const std::string &elementLabel,
bool isZone,
int &elementId,
int dom)
{
int timestep = 0;
int chunk = dom;
elementId = -1;
avtDataRequest_p labelRequest;
if(isZone)
{
labelRequest = new avtDataRequest("OriginalZoneLabels", timestep, chunk);
}
else
{
labelRequest = new avtDataRequest("OriginalNodeLabels", timestep, chunk);
}
int pipelineIndex = 0;
avtContract_p contract_p = new avtContract(labelRequest, pipelineIndex);
avtDataObject_p dataObject = this->GetInput();
VoidRefList result;
void * args = NULL;
const char * type ="AUXILIARY_DATA_IDENTIFIERS";
TRY
{
dataObject->GetOriginatingSource()->GetVariableAuxiliaryData(type, args, contract_p, result);
}
CATCH2(VisItException, e)
{
debug3<<"avtPickQuery: failed to find original zone/node labels";
debug3<<e.Message()<<"\n";
bool error = true;
return error;
}
ENDTRY
for(int i = 0; i < result.nList; ++i)
{
vtkElementLabelArray *labels = reinterpret_cast<vtkElementLabelArray*>(*result.list[i]);
if(labels == NULL)
{
continue;
}
bool success = labels->GetElementId(elementLabel, elementId);
if(success)
{
const char *raw_labels = reinterpret_cast<char *>(labels->GetVoidPointer(0));
int offset = labels->GetNumberOfComponents() * elementId;
const char *label = raw_labels + offset;
if(pickAtts.GetUseLabelAsPickLetter())
{
pickAtts.SetPickLetter(std::string(label));
}
}
}
bool error = false;
return error;
}
......@@ -148,6 +148,9 @@ class avtExpressionEvaluatorFilter;
// Kathleen Biagas, Wed Jun 28 15:35:59 PDT 2017
// Added invTransform data member.
//
// Matt Laren, Thur May 4 13:55:01 PDT 2017
// Added method to translate between element label and id
//
// ****************************************************************************
class QUERY_API avtPickQuery : public avtDatasetQuery
......@@ -199,7 +202,6 @@ class QUERY_API avtPickQuery : public avtDatasetQuery
bool DeterminePickedNode(vtkDataSet *, int &);
void GetNodeCoords(vtkDataSet *, const int);
void GetZoneCoords(vtkDataSet *, const int);
void RetrieveVarInfo(vtkDataSet *);
void RetrieveVarInfo(vtkDataSet *, const int);
void RetrieveVarInfo(vtkDataSet *, const int,
......@@ -207,6 +209,11 @@ class QUERY_API avtPickQuery : public avtDatasetQuery
bool RetrieveNodes(vtkDataSet *, int, bool = false);
bool RetrieveZones(vtkDataSet *, int, bool = false);
bool GetElementIdByLabel(const std::string &,
bool,
int &,
int);
int GetCurrentNodeForOriginal(vtkDataSet *,
const int);
int GetCurrentZoneForOriginal(vtkDataSet *,
......
......@@ -220,7 +220,6 @@ avtZonePickQuery::Execute(vtkDataSet *ds, const int dom)
pickAtts.SetElementNumber(pickedZone);
}
if (!pickAtts.GetMatSelected())
{
bool success = false;
......
This diff is collapsed.
......@@ -70,7 +70,9 @@ public:
CurveZone,
CurveNode,
DomainZone,
DomainNode
DomainNode,
ZoneLabel,
NodeLabel
};
enum CoordinateType
{
......@@ -135,6 +137,8 @@ public:
void SelectGroupPieceName();
void SelectGhosts();
void SelectGlobalIncidentElements();
void SelectRangeOutput();
void SelectElementLabel();
void SelectSubsetName();
void SelectFloatFormat();
void SelectTimeOptions();
......@@ -193,11 +197,15 @@ public:
void SetElementIsGhost(bool elementIsGhost_);
void SetRequiresGlyphPick(bool requiresGlyphPick_);
void SetLocationSuccessful(bool locationSuccessful_);
void SetUseLabelAsPickLetter(bool useLabelAsPickLetter_);
void SetShowGlobalIds(bool showGlobalIds_);
void SetGlobalElement(int globalElement_);
void SetGlobalIncidentElements(const intVector &globalIncidentElements_);
void SetElementIsGlobal(bool elementIsGlobal_);
void SetShowPickLetter(bool showPickLetter_);
void SetHasRangeOutput(bool hasRangeOutput_);
void SetRangeOutput(const MapNode &rangeOutput_);
void SetElementLabel(const std::string &elementLabel_);
void SetReusePickLetter(bool reusePickLetter_);
void SetGhostType(int ghostType_);
void SetHasMixedGhostTypes(int hasMixedGhostTypes_);
......@@ -293,12 +301,18 @@ public:
bool GetElementIsGhost() const;
bool GetRequiresGlyphPick() const;
bool GetLocationSuccessful() const;
bool GetUseLabelAsPickLetter() const;
bool GetShowGlobalIds() const;
int GetGlobalElement() const;
const intVector &GetGlobalIncidentElements() const;
intVector &GetGlobalIncidentElements();
bool GetElementIsGlobal() const;
bool GetShowPickLetter() const;
bool GetHasRangeOutput() const;
const MapNode &GetRangeOutput() const;
MapNode &GetRangeOutput();
const std::string &GetElementLabel() const;
std::string &GetElementLabel();
bool GetReusePickLetter() const;
int GetGhostType() const;
int GetHasMixedGhostTypes() const;
......@@ -426,11 +440,15 @@ public:
ID_elementIsGhost,
ID_requiresGlyphPick,
ID_locationSuccessful,
ID_useLabelAsPickLetter,
ID_showGlobalIds,
ID_globalElement,
ID_globalIncidentElements,
ID_elementIsGlobal,
ID_showPickLetter,
ID_hasRangeOutput,
ID_rangeOutput,
ID_elementLabel,
ID_reusePickLetter,
ID_ghostType,
ID_hasMixedGhostTypes,
......@@ -505,11 +523,15 @@ private:
bool elementIsGhost;
bool requiresGlyphPick;
bool locationSuccessful;
bool useLabelAsPickLetter;
bool showGlobalIds;
int globalElement;
intVector globalIncidentElements;
bool elementIsGlobal;
bool showPickLetter;
bool hasRangeOutput;
MapNode rangeOutput;
std::string elementLabel;
bool reusePickLetter;
int ghostType;
int hasMixedGhostTypes;
......@@ -530,6 +552,6 @@ private:
static const char *TypeMapFormatString;
static const private_tmfs_t TmfsStruct;
};
#define PICKATTRIBUTES_TMFS "s*bbbbbbbbbsbiiii*d*iissDDDd*DDsii*s*s*s*s*s*ba*s*bsbbbbbbssi*bbbbbii*bbbiibbbiibssbimm"
#define PICKATTRIBUTES_TMFS "s*bbbbbbbbbsbiiii*d*iissDDDd*DDsii*s*s*s*s*s*ba*s*bsbbbbbbssi*bbbbbbii*bbbmsbiibbbiibssbimm"
#endif
......@@ -7,6 +7,8 @@
CurveNode
DomainZone
DomainNode
ZoneLabel
NodeLabel
</Enum>
<Enum name="CoordinateType">
XY
......@@ -167,6 +169,9 @@
<Field name="locationSuccessful" label="locationSuccessful" type="bool" internal="true" persistent="false">
false
</Field>
<Field name="useLabelAsPickLetter" label="useLabelAsPickLetter" type="bool">
false
</Field>
<Field name="showGlobalIds" label="showGlobalIds" type="bool">
false
</Field>
......@@ -181,6 +186,13 @@
<Field name="showPickLetter" label="showPickLetter" type="bool">
true
</Field>
<Field name="hasRangeOutput" label="hasRangeOutput" internal="true" type="bool" persistant="false">
false
</Field>
<Field name="rangeOutput" label="rangeOutput" type="MapNode" internal="true" persistent="false">
</Field>
<Field name="elementLabel" label="elementLabel" type="string">
</Field>
<Field name="reusePickLetter" label="reusePickLetter" type="bool" persistent="false">
false
</Field>
......
This diff is collapsed.
......@@ -108,6 +108,9 @@ class vtkFloatArray;
// The reader now returns the cycles and times in the meta data and
// marks them as accurate so that they are used where needed.
//
// Matt Larsen, Wed May 31 08:15:42 PDT 2017
// Adding functions and data structures for node and zone labels
//
// ****************************************************************************
class avtMiliFileFormat : public avtMTMDFileFormat
......@@ -329,6 +332,27 @@ class avtMiliFileFormat : public avtMTMDFileFormat
void AddClassSubsets(char *meshname, avtDatabaseMetaData *md);
vtkFloatArray *GetClassSubsets();
struct Label_mapping
{
std::vector<int> label_ranges_begin;
std::vector<int> label_ranges_end;
std::vector<int> el_ids_begin;
std::vector<int> el_ids_end;
};
std::vector<int> max_zone_label_lengths;
std::vector<int> max_node_label_lengths;
std::vector<std::vector<std::string> > zoneLabels;
std::vector<std::vector<std::string> > nodeLabels;
std::vector<std::map<std::string,Label_mapping> > zone_label_mappings;
std::vector<std::map<std::string,Label_mapping> > node_label_mappings;
void PopulateNodeLabels(const int fam_id, const int mesh_id,
char *short_name, const int dom, int &num_nodes);
void PopulateZoneLabels(const int fam_id, const int mesh_id,
char *short_name, const int dom, int &num_zones,
const int elems_in_group);
};
......
......@@ -68,7 +68,8 @@ using std::string;
// Creation: June 9, 2011
//
// Modifications:
//
// Matt Larsen Wed May 31 09:32:11 PDT 2017
// Adding new pick options for node and zone labels
// ****************************************************************************