Commit 943fbc96 authored by bonnell's avatar bonnell

Fix pick bug displaying global id results

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23822 18c085ea-50e0-402c-830e-de6fd14e8384
parent 595e81d3
......@@ -134,6 +134,9 @@ avtPickByNodeQuery::~avtPickByNodeQuery()
// Kathleen Bonnell, Mon Oct 8 18:54:53 PDT 2007
// Completed support for node origin.
//
// Kathleen Biagas, Tue Jul 22 11:38:50 MST 2014
// Don't convert to Global ids unless user wants ids shown as global.
//
// ****************************************************************************
void
......@@ -219,7 +222,8 @@ avtPickByNodeQuery::Execute(vtkDataSet *ds, const int dom)
{
nodeid = GetCurrentNodeForOriginal(ds, pickAtts.GetElementNumber());
usernodeid = nodeid;
ConvertElNamesToGlobal();
if (pickAtts.GetShowGlobalIds())
ConvertElNamesToGlobal();
}
pickAtts.SetElementNumber(usernodeid + nodeOrigin);
if (pickAtts.GetMatSelected())
......
......@@ -127,6 +127,10 @@ avtPickByZoneQuery::~avtPickByZoneQuery()
// Kathleen Bonnell, Tue Jan 30 16:25:23 PST 2007
// Send zoneid to RetrieveVarInfo.
//
// Kathleen Biagas, Tue Jul 22 11:40:28 MST 2014
// Don't convert element names to global unless user requested them to be
// shown in global.
//
// ****************************************************************************
void
......@@ -136,7 +140,7 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom)
{
return;
}
int userZoneId = pickAtts.GetElementNumber();
if (!pickAtts.GetElementIsGlobal())
{
if (dom != pickAtts.GetDomain())
......@@ -153,6 +157,7 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom)
return;
}
int userZoneId = pickAtts.GetElementNumber();
int zoneid = userZoneId;
int maxEls = ds->GetNumberOfCells();
if (pickAtts.GetMatSelected() && !pickAtts.GetElementIsGlobal())
......@@ -213,7 +218,8 @@ avtPickByZoneQuery::Execute(vtkDataSet *ds, const int dom)
{
zoneid = GetCurrentZoneForOriginal(ds, pickAtts.GetElementNumber());
userZoneId = zoneid;
ConvertElNamesToGlobal();
if (pickAtts.GetShowGlobalIds())
ConvertElNamesToGlobal();
}
pickAtts.SetElementNumber(userZoneId+cellOrigin);
......
......@@ -1675,7 +1675,6 @@ void
avtPickQuery::ConvertElNamesToGlobal(void)
{
// var names were retrieved from DB, not global, so convert them.
size_t i;
char buff[24];
stringVector globalElName;
SNPRINTF(buff, 24, "(%d)", pickAtts.GetGlobalElement());
......@@ -1683,7 +1682,7 @@ avtPickQuery::ConvertElNamesToGlobal(void)
intVector globalIds = pickAtts.GetGlobalIncidentElements();
stringVector names;
for (i = 0; i < globalIds.size(); i++)
for (size_t i = 0; i < globalIds.size(); i++)
{
SNPRINTF(buff, 24, "(%d)", globalIds[i]);
names.push_back(buff);
......@@ -1692,7 +1691,7 @@ avtPickQuery::ConvertElNamesToGlobal(void)
bool zonePick = pickAtts.GetPickType() == PickAttributes::Zone ||
pickAtts.GetPickType() == PickAttributes::DomainZone;
for (i = 0; i < (size_t)pickAtts.GetNumVarInfos(); i++)
for (int i = 0; i < pickAtts.GetNumVarInfos(); i++)
{
if (zonePick)
{
......
......@@ -3394,6 +3394,9 @@ PickAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
// Kathleen Biagas, Wed Oct 26 13:31:50 PDT 2011
// Only print timeStep information if requested and not -1.
//
// Kathleen Biagas, Tue Jul 22 11:35:33 MST 2014
// Account for global ids.
//
// ****************************************************************************
void
PickAttributes::PrintSelf(ostream &os)
......@@ -3485,10 +3488,12 @@ PickAttributes::PrintSelf(ostream &os)
os << "Zone " ;
if (showZoneId)
{
if (!elementIsGhost)
os<< elementNumber << " ";
else
if (elementIsGhost)
os<< elementNumber << "(ghost) ";
else if (elementIsGlobal)
os<< elementNumber << "(global) ";
else
os<< elementNumber << " ";
}
if (showZoneDomainLogicalCoords && !dzoneCoords.empty())
{
......@@ -3505,10 +3510,12 @@ PickAttributes::PrintSelf(ostream &os)
os << "Node ";
if (showNodeId)
{
if (!elementIsGhost)
os << elementNumber << " ";
else
if (elementIsGhost)
os << elementNumber << "(ghost) ";
else if (elementIsGlobal)
os << elementNumber << "(global) ";
else
os << elementNumber << " ";
}
if (showNodePhysicalCoords && !pnodeCoords.empty())
{
......@@ -4539,6 +4546,8 @@ PickAttributes::SetRayPoint2(const doubleVector &_v)
// Creation: September 22, 2011
//
// Modifications:
// Kathleen Biagas, Tue Jul 22 11:35:33 MST 2014
// Account for showing global ids.
//
// ****************************************************************************
......@@ -4554,13 +4563,19 @@ PickAttributes::CreateOutputMapNode(MapNode &m, bool withLetter)
if (!fulfilled)
return;
if (pickType == Zone || pickType == DomainZone)
if ((pickType == Zone || pickType == DomainZone) && showZoneId)
{
m["zone_id"] = elementNumber;
if (globalElement == -1)
m["zone_id"] = elementNumber;
else
m["zone_id"] = globalElement;
}
else if (pickType == Node || pickType == DomainNode)
else if ((pickType == Node || pickType == DomainNode) && showNodeId)
{
m["node_id"] = elementNumber;
if (globalElement == -1)
m["node_id"] = elementNumber;
else
m["node_id"] = globalElement;
}
doubleVector p;
......@@ -4631,26 +4646,22 @@ PickAttributes::CreateOutputMapNode(MapNode &m, bool withLetter)
std::string ghostName;
if (pickType == Zone || pickType == DomainZone)
{
if (!showGlobal)
elName = "incident_nodes";
else
elName = "global_incident_nodes";
elName = "incident_nodes";
ghostName = "ghost_incident_nodes";
showId = showNodeId;
}
else if (pickType == Node || pickType == DomainNode)
{
if (!showGlobal)
elName = "incident_zones";
else
elName = "global_incident_zones";
elName = "incident_zones";
ghostName = "ghost_incident_zones";
showId = showZoneId;
}
if (showId)
{
m[elName] = incidentElements;
#if 0
if (showGlobal)
m[elName] = globalIncidentElements;
else
m[elName] = incidentElements;
intVector els, ghostEls;
for (size_t i = 0; i < incidentElements.size(); ++i)
{
......@@ -4664,7 +4675,6 @@ PickAttributes::CreateOutputMapNode(MapNode &m, bool withLetter)
m[elName] = els;
if (!ghostEls.empty())
m[ghostName] = ghostEls;
#endif
}
}
......
......@@ -52,6 +52,9 @@ Definition:
// Kathleen Biagas, Wed Oct 26 13:31:50 PDT 2011
// Only print timeStep information if requested and not -1.
//
// Kathleen Biagas, Tue Jul 22 11:35:33 MST 2014
// Account for global ids.
//
// ****************************************************************************
void
PickAttributes::PrintSelf(ostream &os)
......@@ -143,10 +146,12 @@ PickAttributes::PrintSelf(ostream &os)
os << "Zone " ;
if (showZoneId)
{
if (!elementIsGhost)
os<< elementNumber << " ";
else
if (elementIsGhost)
os<< elementNumber << "(ghost) ";
else if (elementIsGlobal)
os<< elementNumber << "(global) ";
else
os<< elementNumber << " ";
}
if (showZoneDomainLogicalCoords && !dzoneCoords.empty())
{
......@@ -163,10 +168,12 @@ PickAttributes::PrintSelf(ostream &os)
os << "Node ";
if (showNodeId)
{
if (!elementIsGhost)
os << elementNumber << " ";
else
if (elementIsGhost)
os << elementNumber << "(ghost) ";
else if (elementIsGlobal)
os << elementNumber << "(global) ";
else
os << elementNumber << " ";
}
if (showNodePhysicalCoords && !pnodeCoords.empty())
{
......@@ -1216,6 +1223,8 @@ Definition:
// Creation: September 22, 2011
//
// Modifications:
// Kathleen Biagas, Tue Jul 22 11:35:33 MST 2014
// Account for showing global ids.
//
// ****************************************************************************
......@@ -1231,13 +1240,19 @@ PickAttributes::CreateOutputMapNode(MapNode &m, bool withLetter)
if (!fulfilled)
return;
if (pickType == Zone || pickType == DomainZone)
if ((pickType == Zone || pickType == DomainZone) && showZoneId)
{
m["zone_id"] = elementNumber;
if (globalElement == -1)
m["zone_id"] = elementNumber;
else
m["zone_id"] = globalElement;
}
else if (pickType == Node || pickType == DomainNode)
else if ((pickType == Node || pickType == DomainNode) && showNodeId)
{
m["node_id"] = elementNumber;
if (globalElement == -1)
m["node_id"] = elementNumber;
else
m["node_id"] = globalElement;
}
doubleVector p;
......@@ -1308,26 +1323,22 @@ PickAttributes::CreateOutputMapNode(MapNode &m, bool withLetter)
std::string ghostName;
if (pickType == Zone || pickType == DomainZone)
{
if (!showGlobal)
elName = "incident_nodes";
else
elName = "global_incident_nodes";
elName = "incident_nodes";
ghostName = "ghost_incident_nodes";
showId = showNodeId;
}
else if (pickType == Node || pickType == DomainNode)
{
if (!showGlobal)
elName = "incident_zones";
else
elName = "global_incident_zones";
elName = "incident_zones";
ghostName = "ghost_incident_zones";
showId = showZoneId;
}
if (showId)
{
m[elName] = incidentElements;
#if 0
if (showGlobal)
m[elName] = globalIncidentElements;
else
m[elName] = incidentElements;
intVector els, ghostEls;
for (size_t i = 0; i < incidentElements.size(); ++i)
{
......@@ -1341,7 +1352,6 @@ PickAttributes::CreateOutputMapNode(MapNode &m, bool withLetter)
m[elName] = els;
if (!ghostEls.empty())
m[ghostName] = ghostEls;
#endif
}
}
......
......@@ -23,7 +23,7 @@ VISIT_OPTION_DEFAULT(VISIT_CXX_FLAGS " -m64 -fPIC -fvisibility=hidden" TYPE STRI
##
VISIT_OPTION_DEFAULT(VISIT_THREAD OFF TYPE BOOL)
VISIT_OPTION_DEFAULT(DEBUG_MEMORY_LEAKS true TYPE BOOL)
##VISIT_OPTION_DEFAULT(DEBUG_MEMORY_LEAKS true TYPE BOOL)
##############################################################
##
......@@ -161,11 +161,6 @@ VISIT_OPTION_DEFAULT(VISIT_XDMF_LIBDEP HDF5_LIBRARY_DIR hdf5 ${VISIT_VTK_DIR}/
##
VISIT_OPTION_DEFAULT(VISIT_PYSIDE_DIR ${VISITHOME}/pyside/1.1.1/${VISITARCH}/)
##
## MANTA
##
VISIT_OPTION_DEFAULT(VISIT_MANTA_DIR ${VISITHOME}/manta/2540/${VISITARCH})
##
## Mili
##
......
......@@ -107,6 +107,7 @@ enhancements and bug-fixes that were added to this release.</p>
<li>Fixed a memory leak in unstructured grid ghost cell generation based on global node ids.</li>
<li>Fixed a problem preventing ghost cells from being generated for 2D unstructured cell types. This fixes a bug where wireframe FilledBoundary plots were showing wireframes along domain boundaries.</li>
<li>Fixed a problem-sized memory leak in the Clip operator after processing domains that resulted in zero clipped geometry.</li>
<li>Fixed a pick bug where global ids would sometimes not be reported correctly.</li>
</ul>
<a name="Config_changes"></a>
......
......@@ -2759,6 +2759,10 @@ ViewerQueryManager::ComputePick(PICK_POINT_INFO *ppi, const int dom,
//
// Jonathan Byrd, Fri Feb 1 2013
// Add DDT pick support for domain & element
//
// Kathleen Biagas, Tue Jul 22 11:42:14 PDT 2014
// Don't create output string if output is suppressed.
//
// ****************************************************************************
void
......@@ -2839,33 +2843,35 @@ ViewerQueryManager::Pick(PICK_POINT_INFO *ppi, const int dom, const int el)
win->ValidateQuery(pickAtts, NULL);
} // else no valid position could be determined, data was transformed
//
// Send pick attributes to the client.
//
string msg;
pickAtts->CreateOutputString(msg);
if ( pickAtts->GetPickPoint()[0] == FLT_MAX &&
pickAtts->GetPickType() != PickAttributes::CurveNode &&
pickAtts->GetPickType() != PickAttributes::CurveZone)
// Create output string if messages are not suppressed
if (!suppressQueryOutput)
{
string append;
if (pickAtts->GetPickType() == PickAttributes::Zone ||
pickAtts->GetPickType() == PickAttributes::DomainZone)
{
append = "Mesh was transformed and chosen zone is not "
"part of transformed mesh.\nNo pick letter will "
"be displayed.";
}
else
string msg;
pickAtts->CreateOutputString(msg);
if ( pickAtts->GetPickPoint()[0] == FLT_MAX &&
pickAtts->GetPickType() != PickAttributes::CurveNode &&
pickAtts->GetPickType() != PickAttributes::CurveZone)
{
append = "Mesh was transformed and chosen node is not "
"part of transformed mesh.\nNo pick letter will "
"be displayed.";
string append;
if (pickAtts->GetPickType() == PickAttributes::Zone ||
pickAtts->GetPickType() == PickAttributes::DomainZone)
{
append = "Mesh was transformed and chosen zone is not "
"part of transformed mesh.\nNo pick letter will "
"be displayed.";
}
else
{
append = "Mesh was transformed and chosen node is not "
"part of transformed mesh.\nNo pick letter will "
"be displayed.";
}
msg += append;
}
msg += append;
}
if (!suppressQueryOutput)
Message(msg.c_str(), false);
}
// Send pick attributes to the client.
//
UpdatePickAtts();
//
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment