org.jcae.viewer3d.cad
Class ViewableCAD

java.lang.Object
  extended by org.jcae.viewer3d.ViewableAdaptor
      extended by org.jcae.viewer3d.cad.ViewableCAD
All Implemented Interfaces:
Viewable
Direct Known Subclasses:
TextureFitter.PickViewableCAD

public class ViewableCAD
extends ViewableAdaptor

A Viewable specilized to display CAD scenes. The selected elements are highlighted.


Nested Class Summary
protected static interface ViewableCAD.CADPickingInfo
           
protected static class ViewableCAD.EdgePickingInfo
           
protected static class ViewableCAD.FacePickingInfo
           
protected static class ViewableCAD.VertexPickingInfo
           
 
Field Summary
static short DOMAIN_SELECTION
           
static short EDGE_SELECTION
           
static short FACE_SELECTION
           
static short MULTI_SELECTION
           
static short NONE_SELECTION
           
static javax.media.j3d.PolygonAttributes polygonAttrBack
           
static javax.media.j3d.PolygonAttributes polygonAttrFront
           
static javax.media.j3d.PolygonAttributes polygonAttrNone
           
static short VERTEX_SELECTION
           
 
Constructor Summary
ViewableCAD(CADProvider provider)
           
 
Method Summary
 void addSelectionListener(CADSelectionListener listener)
          Add a selectionListener to this viewable As an optimisation, when there is no listener, the picking should be disabled on this viewable
 void addSelectionListener(SelectionListener listener)
           
 void domainsChangedPerform(int[] domainId)
           
protected  void fireSelectionChanged()
           
 DomainProvider getDomainProvider()
          Return the domain provider of this viewable
 javax.media.j3d.Node getJ3DNode()
          Return the Java3D Node associated to this Viewable
protected static java.lang.Object getPickUserData(PickViewable result)
           
 CADSelection[] getSelection()
           
 void highlightEdge(int edgeID, boolean status)
           
 void highlightEdge(int edgeID, boolean status, boolean fireListeners)
           
 void highlightFace(int faceID, boolean status)
           
 void highlightFace(int faceID, boolean status, boolean fireListeners)
           
 void highlightVertex(int vertexID, boolean status)
           
 void highlightVertex(int vertexID, boolean status, boolean fireListeners)
           
 void pick(PickViewable result)
           
 void removeSelectionListener(CADSelectionListener listener)
          Remove a selectionListener from this viewable.
 void removeSelectionListener(SelectionListener listener)
           
 void setDomainVisible(java.util.Map<java.lang.Integer,java.lang.Boolean> map)
           
 void setLineWidth(float lineWidth)
           
 void setName(java.lang.String name)
           
 void setSelectionMode(short mode)
          Set the picking mode of this viewable.
 void setSelectionMode(short mode, boolean unselectAll)
           
 java.lang.String toString()
           
 void unselectAll()
           
 
Methods inherited from class org.jcae.viewer3d.ViewableAdaptor
domainsChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

polygonAttrFront

public static final javax.media.j3d.PolygonAttributes polygonAttrFront

polygonAttrBack

public static final javax.media.j3d.PolygonAttributes polygonAttrBack

polygonAttrNone

public static final javax.media.j3d.PolygonAttributes polygonAttrNone

NONE_SELECTION

public static final short NONE_SELECTION
See Also:
Constant Field Values

DOMAIN_SELECTION

public static final short DOMAIN_SELECTION
See Also:
Constant Field Values

FACE_SELECTION

public static final short FACE_SELECTION
See Also:
Constant Field Values

EDGE_SELECTION

public static final short EDGE_SELECTION
See Also:
Constant Field Values

VERTEX_SELECTION

public static final short VERTEX_SELECTION
See Also:
Constant Field Values

MULTI_SELECTION

public static final short MULTI_SELECTION
See Also:
Constant Field Values
Constructor Detail

ViewableCAD

public ViewableCAD(CADProvider provider)
Method Detail

domainsChangedPerform

public void domainsChangedPerform(int[] domainId)
Specified by:
domainsChangedPerform in class ViewableAdaptor
Parameters:
domainId - The ids (Integer) of domains that changed or null to specify that even ids may have change

getDomainProvider

public DomainProvider getDomainProvider()
Description copied from interface: Viewable
Return the domain provider of this viewable

Specified by:
getDomainProvider in interface Viewable
Specified by:
getDomainProvider in class ViewableAdaptor
Returns:

setDomainVisible

public void setDomainVisible(java.util.Map<java.lang.Integer,java.lang.Boolean> map)
Specified by:
setDomainVisible in interface Viewable
Specified by:
setDomainVisible in class ViewableAdaptor
Parameters:
map - map domain id (Integer) to visible state (Boolean)

setSelectionMode

public void setSelectionMode(short mode)
Set the picking mode of this viewable. Allowed values are:

Parameters:
mode -

setSelectionMode

public void setSelectionMode(short mode,
                             boolean unselectAll)

addSelectionListener

public void addSelectionListener(CADSelectionListener listener)
Add a selectionListener to this viewable As an optimisation, when there is no listener, the picking should be disabled on this viewable. * @param listener


removeSelectionListener

public void removeSelectionListener(CADSelectionListener listener)
Remove a selectionListener from this viewable. As an optimisation, when there is no listener, the picking should be disabled on this viewable.

Parameters:
listener -

pick

public void pick(PickViewable result)
Specified by:
pick in interface Viewable
Specified by:
pick in class ViewableAdaptor

getPickUserData

protected static java.lang.Object getPickUserData(PickViewable result)

highlightFace

public void highlightFace(int faceID,
                          boolean status)
Parameters:
faceID -
status -

highlightFace

public void highlightFace(int faceID,
                          boolean status,
                          boolean fireListeners)
Parameters:
faceID -
status -
fireListeners -

highlightEdge

public void highlightEdge(int edgeID,
                          boolean status)
Parameters:
edgeID -
status -

highlightEdge

public void highlightEdge(int edgeID,
                          boolean status,
                          boolean fireListeners)
Parameters:
edgeID -
status -
fireListeners -

highlightVertex

public void highlightVertex(int vertexID,
                            boolean status)

highlightVertex

public void highlightVertex(int vertexID,
                            boolean status,
                            boolean fireListeners)

fireSelectionChanged

protected void fireSelectionChanged()
Overrides:
fireSelectionChanged in class ViewableAdaptor

getSelection

public CADSelection[] getSelection()

getJ3DNode

public javax.media.j3d.Node getJ3DNode()
Description copied from interface: Viewable
Return the Java3D Node associated to this Viewable

Specified by:
getJ3DNode in interface Viewable
Specified by:
getJ3DNode in class ViewableAdaptor

unselectAll

public void unselectAll()
Specified by:
unselectAll in interface Viewable
Specified by:
unselectAll in class ViewableAdaptor

setName

public void setName(java.lang.String name)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

addSelectionListener

public void addSelectionListener(SelectionListener listener)
Specified by:
addSelectionListener in interface Viewable
Overrides:
addSelectionListener in class ViewableAdaptor

removeSelectionListener

public void removeSelectionListener(SelectionListener listener)
Specified by:
removeSelectionListener in interface Viewable
Overrides:
removeSelectionListener in class ViewableAdaptor

setLineWidth

public void setLineWidth(float lineWidth)