Commit feb724e9 authored by mlarsen's avatar mlarsen
Browse files

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) ...@@ -972,4 +972,33 @@ FileFormatCloseFileCallback(void *ptr, int idx)
ff->CloseFileDescriptor(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; ...@@ -137,6 +137,9 @@ class avtVariableCache;
// Burlen Loring, Tue Sep 29 13:39:15 PDT 2015 // Burlen Loring, Tue Sep 29 13:39:15 PDT 2015
// Clean up some warnings // 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 class DATABASE_API avtFileFormat
...@@ -289,6 +292,9 @@ class DATABASE_API avtFileFormat ...@@ -289,6 +292,9 @@ class DATABASE_API avtFileFormat
const double * = NULL); const double * = NULL);
void AddTensorVarToMetaData(avtDatabaseMetaData *, std::string, void AddTensorVarToMetaData(avtDatabaseMetaData *, std::string,
std::string, avtCentering, int = 3); std::string, avtCentering, int = 3);
void AddLabelVarToMetaData(avtDatabaseMetaData *, std::string,
std::string, avtCentering, int = 3,
bool hideFromGUI = false);
void AddSymmetricTensorVarToMetaData(avtDatabaseMetaData *, void AddSymmetricTensorVarToMetaData(avtDatabaseMetaData *,
std::string, std::string, avtCentering, int = 3); std::string, std::string, avtCentering, int = 3);
void AddMaterialToMetaData(avtDatabaseMetaData *, std::string, void AddMaterialToMetaData(avtDatabaseMetaData *, std::string,
......
...@@ -39,11 +39,15 @@ ...@@ -39,11 +39,15 @@
#include <avtPickActor.h> #include <avtPickActor.h>
#include <vtkActor.h> #include <vtkActor.h>
#include <vtkActor2D.h>
#include <vtkCoordinate.h>
#include <vtkFollower.h> #include <vtkFollower.h>
#include <vtkLineSource.h> #include <vtkLineSource.h>
#include <vtkMultiLineSource.h> #include <vtkMultiLineSource.h>
#include <vtkPolyDataMapper.h> #include <vtkPolyDataMapper.h>
#include <vtkPolyDataMapper2D.h>
#include <vtkProperty.h> #include <vtkProperty.h>
#include <vtkProperty2D.h>
#include <vtkRenderer.h> #include <vtkRenderer.h>
#include <vtkVectorText.h> #include <vtkVectorText.h>
#include <vtkGlyphSource2D.h> #include <vtkGlyphSource2D.h>
...@@ -74,6 +78,9 @@ ...@@ -74,6 +78,9 @@
// //
// Matt Larsen, Mon September 19 08:34:22 PDT 2016 // Matt Larsen, Mon September 19 08:34:22 PDT 2016
// Changed glyph type to circle // 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() avtPickActor:: avtPickActor()
{ {
...@@ -91,6 +98,7 @@ avtPickActor:: avtPickActor() ...@@ -91,6 +98,7 @@ avtPickActor:: avtPickActor()
lineSource->SetResolution(1); // only need one line segment here lineSource->SetResolution(1); // only need one line segment here
lineMapper = vtkPolyDataMapper::New(); lineMapper = vtkPolyDataMapper::New();
lineMapper->SetInputConnection(lineSource->GetOutputPort()); lineMapper->SetInputConnection(lineSource->GetOutputPort());
lineActor = vtkActor::New(); lineActor = vtkActor::New();
lineActor->SetMapper(lineMapper); lineActor->SetMapper(lineMapper);
lineActor->PickableOff(); lineActor->PickableOff();
...@@ -98,6 +106,7 @@ avtPickActor:: avtPickActor() ...@@ -98,6 +106,7 @@ avtPickActor:: avtPickActor()
lineActor->GetProperty()->SetAmbient(1.); lineActor->GetProperty()->SetAmbient(1.);
lineActor->GetProperty()->SetDiffuse(0.); lineActor->GetProperty()->SetDiffuse(0.);
letterActor = vtkFollower::New(); letterActor = vtkFollower::New();
letterActor->GetProperty()->SetColor(0., 0., 0.); letterActor->GetProperty()->SetColor(0., 0., 0.);
letterActor->SetScale(0.5); letterActor->SetScale(0.5);
...@@ -143,6 +152,9 @@ avtPickActor:: avtPickActor() ...@@ -143,6 +152,9 @@ avtPickActor:: avtPickActor()
// Matt Larsen, Fri July 1 09:41:01 PDT 2016 // Matt Larsen, Fri July 1 09:41:01 PDT 2016
// Delete highlightActor, highlightSource,highlightMapper // Delete highlightActor, highlightSource,highlightMapper
// //
// Matt Larsen, Wed September 6 09:10:01 PDT 2017
// Changed highlights to overlay to show internal zones
//
// **************************************************************************** // ****************************************************************************
avtPickActor::~avtPickActor() avtPickActor::~avtPickActor()
...@@ -292,6 +304,12 @@ avtPickActor::Remove() ...@@ -292,6 +304,12 @@ avtPickActor::Remove()
// //
// Matt Larsen, Fri July 1 09:41:01 PDT 2016 // Matt Larsen, Fri July 1 09:41:01 PDT 2016
// Added highlightSource shift. // 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 void
...@@ -301,6 +319,9 @@ avtPickActor::Shift(const double vec[3]) ...@@ -301,6 +319,9 @@ avtPickActor::Shift(const double vec[3])
if (mode3D) if (mode3D)
{ {
shiftFactor = 3.; // completely arbitrary shift factor!!! 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[0] = attach[0] + vec[0] *shiftFactor;
newPos[1] = attach[1] + vec[1] *shiftFactor; newPos[1] = attach[1] + vec[1] *shiftFactor;
newPos[2] = attach[2] + vec[2] *shiftFactor; newPos[2] = attach[2] + vec[2] *shiftFactor;
...@@ -309,7 +330,6 @@ avtPickActor::Shift(const double vec[3]) ...@@ -309,7 +330,6 @@ avtPickActor::Shift(const double vec[3])
newGlyphPos[2] = attach[2] + vec[2] *0.25; newGlyphPos[2] = attach[2] + vec[2] *0.25;
glyphActor->SetPosition(newGlyphPos[0], newGlyphPos[1], newGlyphPos[2]); glyphActor->SetPosition(newGlyphPos[0], newGlyphPos[1], newGlyphPos[2]);
if(highlightSource != NULL) highlightSource->Shift3d(vec, .7);
} }
else else
{ {
...@@ -321,7 +341,6 @@ avtPickActor::Shift(const double vec[3]) ...@@ -321,7 +341,6 @@ avtPickActor::Shift(const double vec[3])
vec2[0] = 0.; vec2[0] = 0.;
vec2[1] = 0.; vec2[1] = 0.;
vec2[2] = vec[2]; vec2[2] = vec[2];
if(highlightSource != NULL) highlightSource->Shift2d(.1);
} }
lineSource->SetPoint2(newPos[0], newPos[1], newPos[2]); lineSource->SetPoint2(newPos[0], newPos[1], newPos[2]);
letterActor->SetPosition(newPos[0], newPos[1], newPos[2]); letterActor->SetPosition(newPos[0], newPos[1], newPos[2]);
...@@ -712,6 +731,9 @@ avtPickActor::GetLetterPosition() ...@@ -712,6 +731,9 @@ avtPickActor::GetLetterPosition()
// //
// Modifications: // Modifications:
// //
// Matt Larsen, Wed September 6 09:10:01 PDT 2017
// Changed highlights to overlay to show internal zones
//
// **************************************************************************** // ****************************************************************************
void void
...@@ -720,14 +742,19 @@ avtPickActor::AddLine(double p0[3], double p1[3]) ...@@ -720,14 +742,19 @@ avtPickActor::AddLine(double p0[3], double p1[3])
if(highlightSource == NULL) if(highlightSource == NULL)
{ {
highlightSource = vtkMultiLineSource::New(); highlightSource = vtkMultiLineSource::New();
highlightMapper = vtkPolyDataMapper::New();
highlightMapper = vtkPolyDataMapper2D::New();
highlightMapper->SetInputConnection(highlightSource->GetOutputPort()); 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->SetMapper(highlightMapper);
highlightActor->PickableOff(); highlightActor->PickableOff();
highlightActor->GetProperty()->SetColor(1., 0., 0.); highlightActor->GetProperty()->SetColor(1., 0., 0.);
highlightActor->GetProperty()->SetAmbient(1.);
highlightActor->GetProperty()->SetDiffuse(0.);
highlightActor->GetProperty()->SetLineWidth(3.); highlightActor->GetProperty()->SetLineWidth(3.);
} }
......
...@@ -43,10 +43,12 @@ ...@@ -43,10 +43,12 @@
#include <ref_ptr.h> #include <ref_ptr.h>
class vtkActor; class vtkActor;
class vtkActor2D;
class vtkFollower; class vtkFollower;
class vtkLineSource; class vtkLineSource;
class vtkMultiLineSource; class vtkMultiLineSource;
class vtkPolyDataMapper; class vtkPolyDataMapper;
class vtkPolyDataMapper2D;
class vtkRenderer; class vtkRenderer;
class vtkGlyphSource2D; class vtkGlyphSource2D;
...@@ -88,6 +90,9 @@ class vtkGlyphSource2D; ...@@ -88,6 +90,9 @@ class vtkGlyphSource2D;
// Added methods 'GetShowPickLetter' 'SetShowPickLetter' // Added methods 'GetShowPickLetter' 'SetShowPickLetter'
// Added member variable showPickLetter // 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 class PLOTTER_API avtPickActor
...@@ -136,9 +141,9 @@ class PLOTTER_API avtPickActor ...@@ -136,9 +141,9 @@ class PLOTTER_API avtPickActor
vtkGlyphSource2D *glyphSource; vtkGlyphSource2D *glyphSource;
vtkPolyDataMapper *glyphMapper; vtkPolyDataMapper *glyphMapper;
vtkMultiLineSource *highlightSource; vtkMultiLineSource *highlightSource;
vtkPolyDataMapper *highlightMapper; vtkPolyDataMapper2D *highlightMapper;
vtkActor *highlightActor; vtkActor2D *highlightActor;
vtkRenderer *renderer; vtkRenderer *renderer;
private: private:
......
...@@ -137,11 +137,16 @@ avtPickByNodeQuery::~avtPickByNodeQuery() ...@@ -137,11 +137,16 @@ avtPickByNodeQuery::~avtPickByNodeQuery()
// Kathleen Biagas, Tue Jul 22 11:38:50 MST 2014 // Kathleen Biagas, Tue Jul 22 11:38:50 MST 2014
// Don't convert to Global ids unless user wants ids shown as global. // 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 void
avtPickByNodeQuery::Execute(vtkDataSet *ds, const int dom) avtPickByNodeQuery::Execute(vtkDataSet *ds, const int dom)
{ {
bool pickByLabel = pickAtts.GetElementLabel() != "";
if (pickAtts.GetFulfilled() || ds == NULL) if (pickAtts.GetFulfilled() || ds == NULL)
{ {
return; return;
...@@ -152,7 +157,8 @@ avtPickByNodeQuery::Execute(vtkDataSet *ds, const int dom) ...@@ -152,7 +157,8 @@ avtPickByNodeQuery::Execute(vtkDataSet *ds, const int dom)
if (dom != pickAtts.GetDomain()) if (dom != pickAtts.GetDomain())
return; return;
} }
else if (ds->GetPointData()->GetArray("avtGlobalNodeNumbers") == NULL) else if (ds->GetPointData()->GetArray("avtGlobalNodeNumbers") == NULL &&
!pickByLabel)
{ {
pickAtts.SetDomain(-1); pickAtts.SetDomain(-1);
pickAtts.SetElementNumber(-1); pickAtts.SetElementNumber(-1);
...@@ -163,7 +169,40 @@ avtPickByNodeQuery::Execute(vtkDataSet *ds, const int dom) ...@@ -163,7 +169,40 @@ avtPickByNodeQuery::Execute(vtkDataSet *ds, const int dom)
return; 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 usernodeid = nodeid;
int maxEls = ds->GetNumberOfPoints(); int maxEls = ds->GetNumberOfPoints();
...@@ -176,7 +215,7 @@ avtPickByNodeQuery::Execute(vtkDataSet *ds, const int dom) ...@@ -176,7 +215,7 @@ avtPickByNodeQuery::Execute(vtkDataSet *ds, const int dom)
bool DBsuppliedNodeId = true; bool DBsuppliedNodeId = true;
if (!pickAtts.GetMatSelected() && ghostType != AVT_CREATED_GHOSTS) if (!pickAtts.GetMatSelected() && ghostType != AVT_CREATED_GHOSTS)
{ {
if (pickAtts.GetElementIsGlobal()) if (pickAtts.GetElementIsGlobal() && !pickByLabel)
{ {
usernodeid = vtkVisItUtility::GetLocalElementForGlobal(ds, usernodeid = vtkVisItUtility::GetLocalElementForGlobal(ds,
usernodeid, false); usernodeid, false);
......
...@@ -144,11 +144,16 @@ avtPickByZoneQuery::~avtPickByZoneQuery() ...@@ -144,11 +144,16 @@ avtPickByZoneQuery::~avtPickByZoneQuery()
// Fixed pick highlight issue with incorrect zone being hightlighted // Fixed pick highlight issue with incorrect zone being hightlighted
// in some cases. // in some cases.
// //
// Matt Larsen, July 19 08:29:l2 PDT 2017
// Added support for picking by label
//
// **************************************************************************** // ****************************************************************************
void void
avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom) avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom)
{ {
bool pickByLabel = pickAtts.GetElementLabel() != "";
if (pickAtts.GetFulfilled() || ds == NULL) if (pickAtts.GetFulfilled() || ds == NULL)
{ {
return; return;
...@@ -159,7 +164,8 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom) ...@@ -159,7 +164,8 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom)
if (dom != pickAtts.GetDomain()) if (dom != pickAtts.GetDomain())
return; return;
} }
else if (ds->GetCellData()->GetArray("avtGlobalZoneNumbers") == NULL) else if (ds->GetCellData()->GetArray("avtGlobalZoneNumbers") == NULL &&
!pickByLabel)
{ {
pickAtts.SetDomain(-1); pickAtts.SetDomain(-1);
pickAtts.SetElementNumber(-1); pickAtts.SetElementNumber(-1);
...@@ -169,7 +175,39 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom) ...@@ -169,7 +175,39 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom)
pickAtts.SetError(true); pickAtts.SetError(true);
return; 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 zoneid = userZoneId;
int origPick = zoneid; int origPick = zoneid;
int maxEls = ds->GetNumberOfCells(); int maxEls = ds->GetNumberOfCells();
...@@ -191,7 +229,7 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom) ...@@ -191,7 +229,7 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom)
bool DBsuppliedZoneId = true; bool DBsuppliedZoneId = true;
if (!pickAtts.GetMatSelected() && ghostType != AVT_CREATED_GHOSTS) if (!pickAtts.GetMatSelected() && ghostType != AVT_CREATED_GHOSTS)
{ {
if (pickAtts.GetElementIsGlobal()) if (pickAtts.GetElementIsGlobal() && !pickByLabel)
{ {
userZoneId = vtkVisItUtility::GetLocalElementForGlobal( userZoneId = vtkVisItUtility::GetLocalElementForGlobal(
ds, userZoneId, true); ds, userZoneId, true);
...@@ -219,7 +257,7 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom) ...@@ -219,7 +257,7 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom)
return; return;
} }
} }
if (pickAtts.GetElementIsGlobal()) if (pickAtts.GetElementIsGlobal()&& !pickByLabel)
pickAtts.SetDomain(dom); pickAtts.SetDomain(dom);
src->Query(&pickAtts); src->Query(&pickAtts);
...@@ -227,7 +265,7 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom) ...@@ -227,7 +265,7 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom)
if (!pickAtts.GetFulfilled()) if (!pickAtts.GetFulfilled())
return; return;
if (pickAtts.GetElementIsGlobal() && DBsuppliedZoneId) if (pickAtts.GetElementIsGlobal() && DBsuppliedZoneId && !pickByLabel)
{ {
zoneid = GetCurrentZoneForOriginal(ds, pickAtts.GetElementNumber()); zoneid = GetCurrentZoneForOriginal(ds, pickAtts.GetElementNumber());
userZoneId = zoneid; userZoneId = zoneid;
...@@ -236,7 +274,6 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom) ...@@ -236,7 +274,6 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom)
} }
pickAtts.SetElementNumber(userZoneId+cellOrigin); pickAtts.SetElementNumber(userZoneId+cellOrigin);
if (pickAtts.GetMatSelected()) if (pickAtts.GetMatSelected())
{ {
RetrieveVarInfo(ds, zoneid, pickAtts.GetIncidentElements()); RetrieveVarInfo(ds, zoneid, pickAtts.GetIncidentElements());
......
...@@ -53,8 +53,10 @@ ...@@ -53,8 +53,10 @@
#include <vtkIdList.h> #include <vtkIdList.h>
#include <vtkIntArray.h> #include <vtkIntArray.h>
#include <vtkMath.h> #include <vtkMath.h>
#include <vtkElementLabelArray.h>
#include <vtkPointData.h> #include <vtkPointData.h>
#include <vtkPoints.h> #include <vtkPoints.h>
#include <vtkSmartPointer.h>
#include <vtkUnsignedCharArray.h> #include <vtkUnsignedCharArray.h>
#include <vtkUnsignedIntArray.h> #include <vtkUnsignedIntArray.h>
#include <vtkVisItUtility.h> #include <vtkVisItUtility.h>
...@@ -1915,11 +1917,12 @@ avtPickQuery::ExtractZonePickHighlights(const int &zoneId, ...@@ -1915,11 +1917,12 @@ avtPickQuery::ExtractZonePickHighlights(const int &zoneId,
pickAtts.ClearLines(); pickAtts.ClearLines();
// Bail if highlights are not on // Bail if highlights are not on
if(!pickAtts.GetShowPickHighlight()) return; if(!pickAtts.GetShowPickHighlight()) return;
// Check to see if the cells were decomposed in some way // Check to see if the cells were decomposed in some way
vtkDataArray* origCellsArr = ds->GetCellData()-> vtkDataArray* origCellsArr = ds->GetCellData()->
GetArray("avtOriginalCellNumbers"); GetArray("avtOriginalCellNumbers");
if ( (!origCellsArr) || (origCellsArr->GetDataType() != VTK_UNSIGNED_INT) if ( (!origCellsArr) || (origCellsArr->GetDataType() != VTK_UNSIGNED_INT)
|| (origCellsArr->GetNumberOfComponents() != 2)) || (origCellsArr->GetNumberOfComponents() != 2 ))
{ {
// this is a normal cell or could not find the proper // this is a normal cell or could not find the proper
// original cell information. Just extract the lines from the edges // original cell information. Just extract the lines from the edges
...@@ -1953,12 +1956,15 @@ avtPickQuery::ExtractZonePickHighlights(const int &zoneId, ...@@ -1953,12 +1956,15 @@ avtPickQuery::ExtractZonePickHighlights(const int &zoneId,
{ {
if(origCell == origCellNums[i*2+1] && if(origCell == origCellNums[i*2+1] &&
origDom == origCellNums[i*2+0]) origDom == origCellNums[i*2+0])
{
relatedCells.push_back(i); relatedCells.push_back(i);
}
} }
// loop over related cells and eliminate duplicate egdes // loop over related cells and eliminate duplicate egdes
vtkEdgeTable *edgeTable = vtkEdgeTable::New(); vtkSmartPointer<vtkEdgeTable> edgeTable = vtkSmartPointer<vtkEdgeTable>::New();
const int numRelated = relatedCells.size(); const int numRelated = relatedCells.size();
for(int i = 0; i < numRelated; ++i) for(int i = 0; i < numRelated; ++i)
{ {
const int cellId = relatedCells[i]; const int cellId = relatedCells[i];
...@@ -1988,13 +1994,82 @@ avtPickQuery::ExtractZonePickHighlights(const int &zoneId, ...@@ -1988,13 +1994,82 @@ avtPickQuery::ExtractZonePickHighlights(const int &zoneId,
{ {
vtkIdType p1Id,p2Id; vtkIdType p1Id,p2Id;
edgeTable->GetNextEdge(p1Id,p2Id); edgeTable->GetNextEdge(p1Id,p2Id);
double p1[3],p2[2];