com.ardor3d.scenegraph.Node.getName()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(215)

本文整理了Java中com.ardor3d.scenegraph.Node.getName()方法的一些代码示例,展示了Node.getName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getName()方法的具体详情如下:
包路径:com.ardor3d.scenegraph.Node
类名称:Node
方法名:getName

Node.getName介绍

暂无

代码示例

代码示例来源:origin: com.ardor3d/ardor3d-core

  1. protected Node clone(final Node original) {
  2. Node copy = null;
  3. try {
  4. copy = original.getClass().newInstance();
  5. } catch (final InstantiationException e) {
  6. logger.log(Level.SEVERE, "Could not access final constructor of class "
  7. + original.getClass().getCanonicalName(), e);
  8. throw new RuntimeException(e);
  9. } catch (final IllegalAccessException e) {
  10. logger.log(Level.SEVERE, "Could not access final constructor of class "
  11. + original.getClass().getCanonicalName(), e);
  12. throw new RuntimeException(e);
  13. }
  14. copy.setName(original.getName() + "_copy");
  15. copy.getSceneHints().set(original.getSceneHints());
  16. copy.setTransform(original.getTransform());
  17. for (final StateType type : StateType.values()) {
  18. final RenderState state = original.getLocalRenderState(type);
  19. if (state != null) {
  20. copy.setRenderState(state);
  21. }
  22. }
  23. return copy;
  24. }
  25. }

代码示例来源:origin: Renanse/Ardor3D

  1. protected Node clone(final Node original) {
  2. Node copy = null;
  3. try {
  4. copy = original.getClass().newInstance();
  5. } catch (final InstantiationException e) {
  6. logger.log(Level.SEVERE, "Could not access final constructor of class "
  7. + original.getClass().getCanonicalName(), e);
  8. throw new RuntimeException(e);
  9. } catch (final IllegalAccessException e) {
  10. logger.log(Level.SEVERE, "Could not access final constructor of class "
  11. + original.getClass().getCanonicalName(), e);
  12. throw new RuntimeException(e);
  13. }
  14. copy.setName(original.getName() + "_copy");
  15. copy.getSceneHints().set(original.getSceneHints());
  16. copy.setTransform(original.getTransform());
  17. for (final StateType type : StateType.values()) {
  18. final RenderState state = original.getLocalRenderState(type);
  19. if (state != null) {
  20. copy.setRenderState(state);
  21. }
  22. }
  23. return copy;
  24. }
  25. }

代码示例来源:origin: com.ardor3d/ardor3d-core

  1. /**
  2. *
  3. * <code>attachChildAt</code> attaches a child to this node at an index. This node becomes the child's parent. The
  4. * current number of children maintained is returned. <br>
  5. * If the child already had a parent it is detached from that former parent.
  6. *
  7. * @param child
  8. * the child to attach to this node.
  9. * @return the number of children maintained by this node.
  10. */
  11. public int attachChildAt(final Spatial child, final int index) {
  12. if (child != null) {
  13. if (child == this || (child instanceof Node && hasAncestor((Node) child))) {
  14. throw new IllegalArgumentException("Child is already part of this hierarchy.");
  15. }
  16. if (child.getParent() != this) {
  17. if (child.getParent() != null) {
  18. child.getParent().detachChild(child);
  19. }
  20. child.setParent(this);
  21. _children.add(index, child);
  22. child.markDirty(DirtyType.Attached);
  23. if (logger.isLoggable(Level.FINE)) {
  24. logger.fine("Child (" + child.getName() + ") attached to this" + " node (" + getName() + ")");
  25. }
  26. }
  27. }
  28. return _children.size();
  29. }

代码示例来源:origin: Renanse/Ardor3D

  1. /**
  2. *
  3. * <code>attachChild</code> attaches a child to this node. This node becomes the child's parent. The current number
  4. * of children maintained is returned. <br>
  5. * If the child already had a parent it is detached from that former parent.
  6. *
  7. * @param child
  8. * the child to attach to this node.
  9. * @return the number of children maintained by this node.
  10. */
  11. public int attachChild(final Spatial child) {
  12. if (child != null) {
  13. if (child == this || (child instanceof Node && hasAncestor((Node) child))) {
  14. throw new IllegalArgumentException("Child is already part of this hierarchy.");
  15. }
  16. if (child.getParent() != this) {
  17. if (child.getParent() != null) {
  18. child.getParent().detachChild(child);
  19. }
  20. child.setParent(this);
  21. _children.add(child);
  22. child.markDirty(DirtyType.Attached);
  23. if (logger.isLoggable(Level.FINE)) {
  24. logger.fine("Child (" + child.getName() + ") attached to this" + " node (" + getName() + ")");
  25. }
  26. }
  27. }
  28. return _children.size();
  29. }

代码示例来源:origin: com.ardor3d/ardor3d-core

  1. /**
  2. *
  3. * <code>attachChild</code> attaches a child to this node. This node becomes the child's parent. The current number
  4. * of children maintained is returned. <br>
  5. * If the child already had a parent it is detached from that former parent.
  6. *
  7. * @param child
  8. * the child to attach to this node.
  9. * @return the number of children maintained by this node.
  10. */
  11. public int attachChild(final Spatial child) {
  12. if (child != null) {
  13. if (child == this || (child instanceof Node && hasAncestor((Node) child))) {
  14. throw new IllegalArgumentException("Child is already part of this hierarchy.");
  15. }
  16. if (child.getParent() != this) {
  17. if (child.getParent() != null) {
  18. child.getParent().detachChild(child);
  19. }
  20. child.setParent(this);
  21. _children.add(child);
  22. child.markDirty(DirtyType.Attached);
  23. if (logger.isLoggable(Level.FINE)) {
  24. logger.fine("Child (" + child.getName() + ") attached to this" + " node (" + getName() + ")");
  25. }
  26. }
  27. }
  28. return _children.size();
  29. }

代码示例来源:origin: Renanse/Ardor3D

  1. /**
  2. *
  3. * <code>attachChildAt</code> attaches a child to this node at an index. This node becomes the child's parent. The
  4. * current number of children maintained is returned. <br>
  5. * If the child already had a parent it is detached from that former parent.
  6. *
  7. * @param child
  8. * the child to attach to this node.
  9. * @return the number of children maintained by this node.
  10. */
  11. public int attachChildAt(final Spatial child, final int index) {
  12. if (child != null) {
  13. if (child == this || (child instanceof Node && hasAncestor((Node) child))) {
  14. throw new IllegalArgumentException("Child is already part of this hierarchy.");
  15. }
  16. if (child.getParent() != this) {
  17. if (child.getParent() != null) {
  18. child.getParent().detachChild(child);
  19. }
  20. child.setParent(this);
  21. _children.add(index, child);
  22. child.markDirty(DirtyType.Attached);
  23. if (logger.isLoggable(Level.FINE)) {
  24. logger.fine("Child (" + child.getName() + ") attached to this" + " node (" + getName() + ")");
  25. }
  26. }
  27. }
  28. return _children.size();
  29. }

代码示例来源:origin: Renanse/Ardor3D

  1. protected void createJointAttachment(final JointNode jointChildNode, final Node node, final Node subNode) {
  2. final AttachmentPoint attach = new AttachmentPoint("attach-" + node.getName(), (short) 0, subNode,
  3. new Transform(subNode.getTransform()));
  4. _dataCache.addAttachmentPoint(jointChildNode.getJoint(), attach);
  5. // we will attach to scene instead.
  6. subNode.removeFromParent();
  7. }

代码示例来源:origin: Renanse/Ardor3D

  1. if (child != null) {
  2. if (child.getName() == null) {
  3. child.setName(meshNode.getName() + "_polygons");
  4. if (child != null) {
  5. if (child.getName() == null) {
  6. child.setName(meshNode.getName() + "_polylist");
  7. if (child != null) {
  8. if (child.getName() == null) {
  9. child.setName(meshNode.getName() + "_triangles");
  10. if (child != null) {
  11. if (child.getName() == null) {
  12. child.setName(meshNode.getName() + "_lines");
  13. if (points != null) {
  14. if (points.getName() == null) {
  15. points.setName(meshNode.getName() + "_points");

代码示例来源:origin: Renanse/Ardor3D

  1. final Node skinNode = new Node(meshNode.getName());

相关文章