Package javax.media.j3d

Examples of javax.media.j3d.Node


      pickCanvas.setShapeLocation(posX, posY);

      // TODO : don't do pick closest, loop on all results
      PickResult result = pickCanvas.pickClosest();
      if (result!=null) {
      Node node = result.getObject();
            Object o = node.getUserData();
            if (o instanceof ActiveNode) {
              ((ActiveNode)o).highlight(true,result);
                lastPickSelection.add(o);
                // pass full info to the active node so it can find which point is
                // picked if necessary
View Full Code Here


    public class AnimatorListSelection extends JDialog {
        Animator _an;
        public AnimatorListSelection(){
            super(_owner, "Animator selection"); // TODO i18n
            Animator anc=AnimatorFactory.create(_param);
            final Node n=_p.getHolder().getSceneGraphNode();
            AnimatorList list=new AnimatorList(AnimatorFactory.getCompatibleAnimators(anc, n));
            getContentPane().add(list, CENTER);
            JPanel pbutton=new JPanel();
            // TODO i18n
            JButton bcreate=new JButton("Create");
View Full Code Here

     * scene graph object
     * @return a clone of the tree node with a clone of the scene graph object in
     */
    public SceneGraphTreeNode cloneNode(boolean deepClone, AbstractNode parent){
        SceneGraphObject o=(SceneGraphObject)getGraphObject();
        Node n=getSceneGraphNode();
        AttachDetach ad=null;
        if(n!=null && n.isLive()){
            ad=new AttachDetach(n);
            ad.detach();
        }
        Object clone=null;
        if(o instanceof Group){
View Full Code Here

    }
   
    public boolean forceCapability(int bit){
        if(!((SceneGraphObject)getGraphObject()).getCapability(bit)){
            if(((SceneGraphObject)getGraphObject()).isLive()){
                Node n= getSceneGraphNode();
                if(_ad!=null){
                    throw new RuntimeException("Unexpected attach detach operation");
                }
                _ad=new AttachDetach(n);
                _ad.detach();
View Full Code Here

        _locale.removeBranchGraph(_branchGroup);
        _detachKey = key;
    }

    BranchGroup getRootGroup() {
        Node n = _n;
        while (n != null) {
            if (n instanceof BranchGroup) {
                BranchGroup bg = (BranchGroup) n;
                if (bg.getParent() == null) {
                    return bg;
                }
            }
            n = n.getParent();
        }
        return null;
    }
View Full Code Here

    }
   
    public boolean forceCapability(int bit){
        if(!getCapableObject().getCapability(bit)){
            if(getCapableObject().isLive()){
                Node n= null;
                if(getCapableObject() instanceof Node){
                    n=(Node)getCapableObject();
                }
                else{
                    n=_holder.getSceneGraphNode();
View Full Code Here

    }
   
    private static void getNodes(ArrayList<Node> res, Class<? extends Node> nodeClass, Group g){
        Enumeration<?> e=g.getAllChildren();
        while(e.hasMoreElements()){
            Node n=(Node)e.nextElement();
            if(nodeClass.isAssignableFrom(n.getClass())){
                res.add(n);
            }
            if(n instanceof Group){
                getNodes(res,nodeClass, (Group)n);
            }
View Full Code Here

        }
        if(o!=null && o!=n){
            path.add(n);
        }

        Node np = n.getParent();
        while (np != null) {
            path.add(np);
            np = np.getParent();
        }
        if (n.getLocale() == null) {
            return null; // detached
        }
        return (Universe) (n.getLocale().getVirtualUniverse());
View Full Code Here

        }
        clonedLink.setSharedGroup(clonedSharedGroup);
      }
      return clonedLink;
    } else {
      Node clonedNode = node.cloneNode(true);
      if (node instanceof Group) {
        Group group = (Group)node;
        Group clonedGroup = (Group)clonedNode;
        for (int i = 0, n = group.numChildren(); i < n; i++) {
          Node clonedChild = cloneNode(group.getChild(i), clonedSharedGroups);
          clonedGroup.addChild(clonedChild);
        }
      }
      return clonedNode;
    }
View Full Code Here

  /**
   * Sets the color and the texture applied to piece model.
   */
  private void updatePieceOfFurnitureColorAndTexture(boolean waitTextureLoadingEnd) {
    HomePieceOfFurniture piece = (HomePieceOfFurniture)getUserData();
    Node filledModelNode = getFilledModelNode();
    if (piece.getColor() != null) {
      setColorAndTexture(filledModelNode, piece.getColor(), null, piece.getShininess(),
          false, null, null, new HashSet<Appearance>());
    } else if (piece.getTexture() != null) {
      setColorAndTexture(filledModelNode, null, piece.getTexture(), piece.getShininess(),
View Full Code Here

TOP

Related Classes of javax.media.j3d.Node

Copyright © 2018 www.massapicom. 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.