com.steptools.view238
Class StepNcModel

java.lang.Object
  extended by com.steptools.view238.StepNcModel

public class StepNcModel
extends java.lang.Object

AP238 Processing class. An instance of this class provides read access to the data in an AP238 (P28/XML) file. This includes functionality to find and access the toolpath objects in the design


Nested Class Summary
 class StepNcModel.Arc
          A single arc in a ToolPath
 class StepNcModel.Curve
          Abstract base type for a ToolPath
 class StepNcModel.LineSegment
          A single line segment in a ToolPath
 class StepNcModel.ToolPath
          A single tool path.
 
Constructor Summary
StepNcModel(java.io.File ap238)
          Create a model given a AP238 XML file
 
Method Summary
 void dump(java.io.PrintStream out, StepNcModel.ToolPath tp)
          Display a toolpath for debugging
 java.lang.String getAttribute(java.lang.String obj, java.lang.String prop)
          Get the value of a STEP attribute in a specified object.
 java.lang.String[] getAttributeCollection(java.lang.String obj, java.lang.String prop)
          Get the value of a STEP aggregate-typed attribute in a specified object.
 java.lang.String getChildRef(org.w3c.dom.Element el)
          Get the value of a STEP attribute that is written as a contained element.
 java.lang.String getType(java.lang.String id)
          Get the STEP entity type on an object
static void main(java.lang.String[] argv)
          Sample driver program to display the AP238 data in a file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StepNcModel

public StepNcModel(java.io.File ap238)
            throws java.io.IOException,
                   StepNcException
Create a model given a AP238 XML file

Parameters:
ap238 - the file to read.
Throws:
java.io.IOException - when there is an IO exception processing the file.
StepNcException - general problem processing the data.
Method Detail

getChildRef

public java.lang.String getChildRef(org.w3c.dom.Element el)
Get the value of a STEP attribute that is written as a contained element. This encoding scheme is used for SELECTs and aggregates (although the aggregates could have multiple values, so this is of dubious value in that case.

Parameters:
el - The DOM element to search for a child value in.
Returns:
The value of the ref attribute.

getAttribute

public java.lang.String getAttribute(java.lang.String obj,
                                     java.lang.String prop)
Get the value of a STEP attribute in a specified object.

Parameters:
obj - the ID for the object being queried.
prop - the name of the property to obtain.
Returns:
the value of the property as a string. For STEP objects, this is an ID for the value.

getAttributeCollection

public java.lang.String[] getAttributeCollection(java.lang.String obj,
                                                 java.lang.String prop)
Get the value of a STEP aggregate-typed attribute in a specified object.

Parameters:
obj - the ID for the object being queried.
prop - the name of the property to obtain.
Returns:
an array of values for value of the property. For STEP objects, this is an ID for the value.

getType

public java.lang.String getType(java.lang.String id)
Get the STEP entity type on an object


dump

public void dump(java.io.PrintStream out,
                 StepNcModel.ToolPath tp)
Display a toolpath for debugging


main

public static void main(java.lang.String[] argv)
                 throws java.io.IOException,
                        StepNcException
Sample driver program to display the AP238 data in a file

Throws:
java.io.IOException
StepNcException