Examples of PathNode


Examples of ca.eandb.jmist.framework.path.PathNode

      Color sample    = colorModel.sample(seq);
      seq.mark();

      PathInfo pi      = new PathInfo(scene, sample.getWavelengthPacket());
      Lens lens      = scene.getLens();
      PathNode eyeTail  = strategy.traceEyePath(lens, p,
                    pi, seq);
      seq.mark();

      Light light      = scene.getLight();
      PathNode lightTail  = strategy.traceLightPath(
                    light, pi, seq);
      seq.mark();

      return new Path(lightTail, eyeTail);
    }
View Full Code Here

Examples of com.bergerkiller.bukkit.tc.pathfinding.PathNode

    final String lastName = prop.getDestination();
    if (LogicUtil.nullOrEmpty(lastName)) {
      msg.append(" is not trying to reach a destination.");
    } else {
      msg.append(" is trying to reach ").green(lastName).newLine();
      final PathNode first = PathNode.get(prop.getLastPathNode());
      if (first == null) {
        msg.yellow("It has not yet visited a routing node, so no route is available yet.");
      } else {
        PathNode last = PathNode.get(lastName);
        if (last == null) {
          msg.red("The destination position to reach can not be found!");
        } else {
          // Calculate the exact route taken from first to last
          PathNode[] route = first.findRoute(last);
          msg.yellow("Route: ");
          if (route.length == 0) {
            msg.red(first.getDisplayName() + " /=/ " + last.getDisplayName() + " (not found)");
          } else {
            msg.setSeparator(ChatColor.YELLOW, " -> ");
            for (PathNode node : route) {
              msg.green(node.getDisplayName());
            }
View Full Code Here

Examples of com.bergerkiller.bukkit.tc.pathfinding.PathNode

      }
    }

    // Handle destination alternatively
    if (info.isAction(SignActionType.MEMBER_ENTER, SignActionType.GROUP_ENTER) && (facing || !info.isWatchedDirectionsDefined())) {
      PathNode node = PathNode.getOrCreate(info);
      if (node != null) {
        String destination = null;
        IProperties prop = null;
        if (doCart && info.hasMember()) {
          prop = info.getMember().getProperties();
        } else if (doTrain && info.hasGroup()) {
          prop = info.getGroup().getProperties();
        }
        if (prop != null) {
          destination = prop.getDestination();
          prop.setLastPathNode(node.getName());
        }
        // Continue with path finding if a valid destination is specified
        // If the current node denotes the destination - don't switch!
        if (!LogicUtil.nullOrEmpty(destination) && !node.containsName(destination)) {
          if (PathProvider.isProcessing()) {
            double currentForce = info.getGroup().getAverageForce();
            // Add an action to let the train wait until the node IS explored
            info.getGroup().getActions().addAction(new GroupActionWaitPathFinding(info, node, destination));
            info.getMember().getActions().addActionLaunch(info.getMember().getDirectionFrom(), 1.0, currentForce);
            info.getGroup().stop();
          } else {
            // Switch the rails to the right direction
            PathConnection conn = node.findConnection(destination);
            if (conn != null) {
              info.setRailsTo(conn.direction);
            }
          }
        }
View Full Code Here

Examples of com.bergerkiller.bukkit.tc.pathfinding.PathNode

  @Override
  public void destroy(SignActionEvent event) {
    // Remove the switcher name (location toString) from the available node names
    Block rails = event.getRails();
    if (rails != null) {
      PathNode node = PathNode.get(rails);
      if (node != null) {
        node.removeName(node.location.toString());
      }
    }
  }
View Full Code Here

Examples of com.bergerkiller.bukkit.tc.pathfinding.PathNode

      succ = handleBuild(event, Permission.BUILD_DESTINATION, "cart destination", "set a cart destination and the next destination to set once it is reached");
    } else if (event.isRCSign()) {
      succ = handleBuild(event, Permission.BUILD_DESTINATION, "train destination", "set the destination on a remote train");
    }
    if (succ && !event.getLine(2).isEmpty()) {
      PathNode node = PathNode.get(event.getLine(2));
      if (node != null) {
        Player p = event.getPlayer();
        p.sendMessage(ChatColor.RED + "Another destination with the same name already exists!");
        p.sendMessage(ChatColor.RED + "Please remove either sign and use /train reroute to fix");
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.element.path.PathNode

            }
        }

        if (nextPossibleLeafs.size() == 0) {
            LeafElementType elementType = (LeafElementType) element.getElementType();
            PathNode pathNode = new ASTPathNode(element.getNode());
            for (LeafElementType leafElementType : elementType.getNextPossibleLeafs(pathNode, filterSettings)) {
                String leafUniqueKey = getLeafUniqueKey(leafElementType);
                if (leafUniqueKey != null) {
                    nextPossibleLeafs.put(leafUniqueKey, leafElementType);   
                }
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.element.path.PathNode

import com.dci.intellij.dbn.language.common.element.NamedElementType;
import com.dci.intellij.dbn.language.common.element.path.PathNode;

public class ElementTypeUtil {
    public static ElementType getEnclosingElementType(PathNode pathNode, ElementTypeAttribute elementTypeAttribute) {
        PathNode parentNode = pathNode.getParent();
        while (parentNode != null) {
            ElementType elementType = parentNode.getElementType();
            if (elementType.is(elementTypeAttribute)) return elementType;
            parentNode = parentNode.getParent();
        }
        return null;
    }
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.element.path.PathNode

        }
        return null;
    }

    public static NamedElementType getEnclosingNamedElementType(PathNode pathNode) {
        PathNode parentNode = pathNode.getParent();
        while (parentNode != null) {
            ElementType elementType = parentNode.getElementType();
            if (elementType instanceof NamedElementType) return (NamedElementType) elementType;
            parentNode = parentNode.getParent();
        }
        return null;
    }
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.element.path.PathNode

        }
        return false;
    }

    private boolean isFollowedByToken(TokenType tokenType, PathNode node) {
        PathNode parent = node;
        while (parent != null) {
            if (parent.getElementType() instanceof SequenceElementType) {
                SequenceElementType sequenceElementType = (SequenceElementType) parent.getElementType();
                if (sequenceElementType.isPossibleTokenFromIndex(tokenType, parent.getCurrentSiblingIndex() + 1)) {
                    return true;
                }
            }
            // break when statement boundary found
            /*if (parent.getElementType().is(ElementTypeAttribute.STATEMENT)) {
                return false;
            }*/
            parent = parent.getParent();
        }
        return false;
    }
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.element.path.PathNode

        return iterations == 0;
        //return false;
    }

    private int countRecurences(PathNode node) {
        PathNode parent = node;
        int count = 0;
        while(parent != null) {
            if (parent.getElementType() == getElementType()) {
                count++;
            }
            parent = parent.getParent();
        }
        return count;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.