本文整理汇总了C++中ZIntPoint::shiftSliceAxis方法的典型用法代码示例。如果您正苦于以下问题:C++ ZIntPoint::shiftSliceAxis方法的具体用法?C++ ZIntPoint::shiftSliceAxis怎么用?C++ ZIntPoint::shiftSliceAxis使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZIntPoint
的用法示例。
在下文中一共展示了ZIntPoint::shiftSliceAxis方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: display
void ZDvidSynapse::display(ZPainter &painter, int slice, EDisplayStyle option,
neutube::EAxis sliceAxis) const
{
bool visible = true;
int z = painter.getZ(slice);
if (slice < 0) {
visible = isProjectionVisible();
} else {
visible = isSliceVisible(z, sliceAxis);
}
double radius = getRadius(z, sliceAxis);
ZIntPoint center = m_position;
center.shiftSliceAxis(sliceAxis);
bool isFocused = (z == center.getZ());
if (visible) {
QPen pen;
QColor color = getColor();
double alpha = 1.0;
if (option == SKELETON) {
alpha = 0.1;
}
if (!isFocused) {
alpha *= radius / m_radius;
alpha *= alpha * 0.5;
alpha += 0.1;
}
color.setAlphaF(alpha * color.alphaF());
pen.setColor(color);
painter.setPen(pen);
painter.setBrush(Qt::NoBrush);
if (isFocused) {
int x = center.getX();
int y = center.getY();
painter.drawLine(QPointF(x - 1, y), QPointF(x + 1, y));
painter.drawLine(QPointF(x, y - 1), QPointF(x, y + 1));
if (getStatus() == STATUS_DUPLICATED) {
painter.drawEllipse(
QPointF(center.getX(), center.getY()), 1, 1);
}
}
if (radius > 0.0) {
double oldWidth = pen.widthF();
QColor oldColor = pen.color();
if (getKind() == EKind::KIND_POST_SYN) {
if (option != SKELETON) {
pen.setWidthF(oldWidth + 1.0);
}
if (isSelected()) {
pen.setColor(QColor(255, 0, 255, oldColor.alpha()));
}
} else {
if (isSelected()) {
pen.setWidthF(pen.widthF() + 1.0);
}
}
painter.setPen(pen);
painter.drawEllipse(QPointF(center.getX(), center.getY()),
radius, radius);
pen.setWidthF(oldWidth);
pen.setColor(oldColor);
}
// QString decorationText;
if (isVerified()) {
// decorationText = "U";
color.setRgb(0, 0, 0);
if (isSelected()) {
if (getKind() == EKind::KIND_PRE_SYN) {
color.setRgb(0, 255, 0);
size_t index = 0;
for (std::vector<bool>::const_iterator iter = m_isPartnerVerified.begin();
iter != m_isPartnerVerified.end(); ++iter, ++index) {
bool verified = *iter;
if (m_partnerKind[index] == EKind::KIND_POST_SYN) {
if (!verified) {
color.setRgb(0, 0, 0);
break;
}
}
}
}
}
color.setAlphaF(alpha);
pen.setColor(color);
//.........这里部分代码省略.........