01: /*
02: * $Header: /cvs/j3dfly/J3dEditor/src/org/jdesktop/j3dedit/scenegrapheditor/visualtools/PointHighlightShape3D.java,v 1.1 2005/04/20 22:21:30 paulby Exp $
03: *
04: * Sun Public License Notice
05: *
06: * The contents of this file are subject to the Sun Public License Version
07: * 1.0 (the "License"). You may not use this file except in compliance with
08: * the License. A copy of the License is available at http://www.sun.com/
09: *
10: * The Original Code is the Java 3D(tm) Scene Graph Editor.
11: * The Initial Developer of the Original Code is Paul Byrne.
12: * Portions created by Paul Byrne are Copyright (C) 2002.
13: * All Rights Reserved.
14: *
15: * Contributor(s): Paul Byrne.
16: *
17: **/
18: package org.jdesktop.j3dedit.scenegrapheditor.visualtools;
19:
20: import javax.media.j3d.Geometry;
21: import javax.media.j3d.Appearance;
22: import javax.media.j3d.Node;
23: import javax.media.j3d.SceneGraphPath;
24: import javax.vecmath.Point3f;
25:
26: /**
27: * A wrapper class for Shape3D
28: *
29: * @author paulby
30: * @version
31: */
32: public class PointHighlightShape3D extends
33: javax.media.j3d.OrientedShape3D {
34:
35: /** Creates new PointHighlightShape3D */
36: /*
37: public PointHighlightShape3D() {
38: super();
39: setConstantScaleEnable( true );
40: }
41: */
42:
43: /*
44: public PointHighlightShape3D( Geometry geom ) {
45: super( geom );
46: setConstantScaleEnable( true );
47: }
48: */
49:
50: public PointHighlightShape3D(Geometry geom, Appearance app) {
51: super (geom, app, ROTATE_NONE, new Point3f(), true, 1.0);
52: }
53:
54: /**
55: * Searches up the SceneGraphPath for the PointHighlight instance
56: */
57: public PointHighlightControl.PointHighlight getPointHighlight(
58: SceneGraphPath sgpath) {
59: PointHighlightControl.PointHighlight ret = null;
60: Node node;
61: for (int i = sgpath.nodeCount() - 1; ret == null; i--) {
62: node = sgpath.getNode(i);
63: if (node instanceof PointHighlightControl.PointHighlight)
64: ret = (PointHighlightControl.PointHighlight) node;
65: }
66:
67: return ret;
68: }
69:
70: }
|