- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
const int DD_GOOD = 1;
const int DD_BAD = 2;
const int DD_BAD_VERT = 3;
auto segStatus = [&DD_GOOD, &DD_BAD, &DD_BAD_VERT](SomeClass* seg, EXTR ext, coord pickPt, double pickElev) -> int
{
Pt& pt = seg->ExtremePt(ext);
Line& line = seg->ExtremeLn(ext);
coord btPt = seg->GetExtremeWallPos(ext);
if (pt.GetCoord() != pickPt && btPt != pickPt)
{
return DD_BAD;
}
if (pt.pairGuid == GUID_NULL && EQ(pt.GetHeight(), pickElev))
{
return DD_GOOD;
}
if (!line.IsNonVert())
{
return DD_BAD;
}
double e1 = line.m_startPt.GetHeight();
double e2 = line.m_endPt.GetHeight();
if (e1 < e2 && e1 < pickElev && pickElev < e2)
{
return DD_GOOD;
}
if (e2 < e1 && e2 < pickElev && pickElev < e1)
{
return DD_GOOD;
}
return DD_BAD_VERT;
};