本文整理汇总了C++中Axis::classId方法的典型用法代码示例。如果您正苦于以下问题:C++ Axis::classId方法的具体用法?C++ Axis::classId怎么用?C++ Axis::classId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Axis
的用法示例。
在下文中一共展示了Axis::classId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pickEntry
ClientData Graph::pickEntry(int xx, int yy, ClassId* classIdPtr)
{
if (flags & (LAYOUT | MAP_MARKERS)) {
*classIdPtr = CID_NONE;
return NULL;
}
// Sample coordinate is in one of the graph margins. Can only pick an axis.
Region2d exts;
extents(&exts);
if (xx>=exts.right || xx<exts.left || yy>=exts.bottom || yy<exts.top) {
Axis* axisPtr = nearestAxis(xx, yy);
if (axisPtr) {
*classIdPtr = axisPtr->classId();
return axisPtr;
}
}
// From top-to-bottom check:
// 1. markers drawn on top (-under false).
// 2. elements using its display list back to front.
// 3. markers drawn under element (-under true).
Marker* markerPtr = nearestMarker(xx, yy, 0);
if (markerPtr) {
*classIdPtr = markerPtr->classId();
return markerPtr;
}
GraphOptions* ops = (GraphOptions*)ops_;
ClosestSearch* searchPtr = &ops->search;
searchPtr->index = -1;
searchPtr->x = xx;
searchPtr->y = yy;
searchPtr->dist = (double)(searchPtr->halo + 1);
for (ChainLink* link = Chain_LastLink(elements_.displayList); link;
link = Chain_PrevLink(link)) {
Element* elemPtr = (Element*)Chain_GetValue(link);
ElementOptions* eops = (ElementOptions*)elemPtr->ops();
if (eops->hide)
continue;
elemPtr->closest();
}
// Found an element within the minimum halo distance.
if (searchPtr->dist <= (double)searchPtr->halo) {
*classIdPtr = searchPtr->elemPtr->classId();
return searchPtr->elemPtr;
}
markerPtr = nearestMarker(xx, yy, 1);
if (markerPtr) {
*classIdPtr = markerPtr->classId();
return markerPtr;
}
*classIdPtr = CID_NONE;
return NULL;
}