本文整理汇总了C++中Axis::getGeometry方法的典型用法代码示例。如果您正苦于以下问题:C++ Axis::getGeometry方法的具体用法?C++ Axis::getGeometry怎么用?C++ Axis::getGeometry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Axis
的用法示例。
在下文中一共展示了Axis::getGeometry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getMarginGeometry
int Graph::getMarginGeometry(Margin *marginPtr)
{
GraphOptions* ops = (GraphOptions*)ops_;
int isHoriz = !(marginPtr->site & 0x1); /* Even sites are horizontal */
// Count the visible axes.
unsigned int nVisible = 0;
unsigned int l =0;
int w =0;
int h =0;
marginPtr->maxTickWidth =0;
marginPtr->maxTickHeight =0;
if (ops->stackAxes) {
for (ChainLink* link = Chain_FirstLink(marginPtr->axes); link;
link = Chain_NextLink(link)) {
Axis* axisPtr = (Axis*)Chain_GetValue(link);
AxisOptions* ops = (AxisOptions*)axisPtr->ops();
if (!ops->hide && axisPtr->use_) {
nVisible++;
axisPtr->getGeometry();
if (isHoriz) {
if (h < axisPtr->height_)
h = axisPtr->height_;
}
else {
if (w < axisPtr->width_)
w = axisPtr->width_;
}
if (axisPtr->maxTickWidth_ > marginPtr->maxTickWidth)
marginPtr->maxTickWidth = axisPtr->maxTickWidth_;
if (axisPtr->maxTickHeight_ > marginPtr->maxTickHeight)
marginPtr->maxTickHeight = axisPtr->maxTickHeight_;
}
}
}
else {
for (ChainLink* link = Chain_FirstLink(marginPtr->axes); link;
link = Chain_NextLink(link)) {
Axis* axisPtr = (Axis*)Chain_GetValue(link);
AxisOptions* ops = (AxisOptions*)axisPtr->ops();
if (!ops->hide && axisPtr->use_) {
nVisible++;
axisPtr->getGeometry();
if ((ops->titleAlternate) && (l < axisPtr->titleWidth_))
l = axisPtr->titleWidth_;
if (isHoriz)
h += axisPtr->height_;
else
w += axisPtr->width_;
if (axisPtr->maxTickWidth_ > marginPtr->maxTickWidth)
marginPtr->maxTickWidth = axisPtr->maxTickWidth_;
if (axisPtr->maxTickHeight_ > marginPtr->maxTickHeight)
marginPtr->maxTickHeight = axisPtr->maxTickHeight_;
}
}
}
// Enforce a minimum size for margins.
if (w < 3)
w = 3;
if (h < 3)
h = 3;
marginPtr->nAxes = nVisible;
marginPtr->axesTitleLength = l;
marginPtr->width = w;
marginPtr->height = h;
marginPtr->axesOffset = (isHoriz) ? h : w;
return marginPtr->axesOffset;
}