当前位置: 首页>>代码示例>>Java>>正文


Java PPickPath.popTransform方法代码示例

本文整理汇总了Java中org.piccolo2d.util.PPickPath.popTransform方法的典型用法代码示例。如果您正苦于以下问题:Java PPickPath.popTransform方法的具体用法?Java PPickPath.popTransform怎么用?Java PPickPath.popTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.piccolo2d.util.PPickPath的用法示例。


在下文中一共展示了PPickPath.popTransform方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fullPick

import org.piccolo2d.util.PPickPath; //导入方法依赖的package包/类
/**
 * Return true if this node or any pickable descendants are picked. If a
 * pick occurs the pickPath is modified so that this node is always returned
 * as the picked node, event if it was a descendant node that initially
 * reported the pick.
 * 
 * @param pickPath the pick path to add the nodes to if they are picked
 * @return true if this node or one of its descendants was picked
 */
public boolean fullPick(final PPickPath pickPath) {
    if (super.fullPick(pickPath)) {
        PNode picked = pickPath.getPickedNode();

        // this code won't work with internal cameras, because it doesn't
        // pop the cameras view transform.
        while (picked != this) {
            pickPath.popTransform(picked.getTransformReference(false));
            pickPath.popNode(picked);
            picked = pickPath.getPickedNode();
        }

        return true;
    }
    return false;
}
 
开发者ID:piccolo2d,项目名称:piccolo2d.java,代码行数:26,代码来源:PComposite.java

示例2: fullPick

import org.piccolo2d.util.PPickPath; //导入方法依赖的package包/类
/**
 * Try to pick this node and all of its descendants if they are visible in
 * the clipping region.
 * 
 * @param pickPath the pick path to add the node to if its picked
 * @return true if this node or one of its descendants was picked.
 */
public boolean fullPick(final PPickPath pickPath) {
    if (getPickable() && fullIntersects(pickPath.getPickBounds())) {
        pickPath.pushNode(this);
        pickPath.pushTransform(getTransformReference(false));

        if (pick(pickPath)) {
            return true;
        }

        if (getChildrenPickable() && getPathReference().intersects(pickPath.getPickBounds())) {
            final int count = getChildrenCount();
            for (int i = count - 1; i >= 0; i--) {
                final PNode each = getChild(i);
                if (each.fullPick(pickPath)) {
                    return true;
                }
            }
        }

        if (pickAfterChildren(pickPath)) {
            return true;
        }

        pickPath.popTransform(getTransformReference(false));
        pickPath.popNode(this);
    }

    return false;
}
 
开发者ID:piccolo2d,项目名称:piccolo2d.java,代码行数:37,代码来源:PClip.java

示例3: detectOcclusions

import org.piccolo2d.util.PPickPath; //导入方法依赖的package包/类
/**
 * Traverse the pick path determining which parent nodes are occluded by
 * their children nodes. Note that this is only detecting a subset of
 * occlusions (parent, child), others such as overlapping siblings or
 * cousins are not detected.
 * 
 * @param node node from which to detect occlusions
 * @param pickPath Pick Path to traverse
 */
public void detectOcclusions(final PNode node, final PPickPath pickPath) {
    if (!node.fullIntersects(pickPath.getPickBounds())) {
        return;
    }

    pickPath.pushTransform(node.getTransformReference(false));

    final int count = node.getChildrenCount();
    for (int i = count - 1; i >= 0; i--) {
        final PNode each = node.getChild(i);
        if (node.getOccluded()) {
            // if n has been occluded by a previous descendant then
            // this child must also be occluded
            each.setOccluded(true);
        }
        else {
            // see if child each occludes n
            detectOcclusions(each, pickPath);
        }
    }

    if (nodeOccludesParents(node, pickPath)) {
        final PNode parent = node.getParent();
        while (parent != null && !parent.getOccluded()) {
            parent.setOccluded(true);
        }
    }

    pickPath.popTransform(node.getTransformReference(false));
}
 
开发者ID:piccolo2d,项目名称:piccolo2d.java,代码行数:40,代码来源:POcclusionDetection.java

示例4: pickAfterChildren

import org.piccolo2d.util.PPickPath; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 * 
 * <p>
 * After the direct children of this camera have been given a chance to be
 * picked all of the layers in the list of layers viewed by this camera are
 * given a chance to be picked.
 * </p>
 * 
 * @return true if any of the layers in the list of layers viewed by this
 *    camera were picked
 */
protected boolean pickAfterChildren(final PPickPath pickPath) {
    if (intersects(pickPath.getPickBounds())) {
        pickPath.pushTransform(viewTransform);

        if (pickCameraView(pickPath)) {
            return true;
        }

        pickPath.popTransform(viewTransform);
        return true;
    }
    return false;
}
 
开发者ID:piccolo2d,项目名称:piccolo2d.java,代码行数:26,代码来源:PCamera.java

示例5: fullPick

import org.piccolo2d.util.PPickPath; //导入方法依赖的package包/类
/**
 * Try to pick this node and all of its descendants. Most subclasses should
 * not need to override this method. Instead they should override
 * <code>pick</code> or <code>pickAfterChildren</code>.
 * 
 * @param pickPath the pick path to add the node to if its picked
 * @return true if this node or one of its descendants was picked.
 */
public boolean fullPick(final PPickPath pickPath) {
    if (getVisible() && (getPickable() || getChildrenPickable()) && fullIntersects(pickPath.getPickBounds())) {
        pickPath.pushNode(this);
        pickPath.pushTransform(transform);

        final boolean thisPickable = getPickable() && pickPath.acceptsNode(this);

        if (thisPickable && pick(pickPath)) {
            return true;
        }

        if (getChildrenPickable()) {
            final int count = getChildrenCount();
            for (int i = count - 1; i >= 0; i--) {
                final PNode each = (PNode) children.get(i);
                if (each.fullPick(pickPath)) {
                    return true;
                }
            }
        }

        if (thisPickable && pickAfterChildren(pickPath)) {
            return true;
        }

        pickPath.popTransform(transform);
        pickPath.popNode(this);
    }

    return false;
}
 
开发者ID:piccolo2d,项目名称:piccolo2d.java,代码行数:40,代码来源:PNode.java


注:本文中的org.piccolo2d.util.PPickPath.popTransform方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。