<!-- scan_result.dtd

DML: Dimensional Markup Language - Version 2.0

Description : This dtd file represent the scanning result, based maily on DMIS 04.0 and suggestion from Dave Braithwaite's <<DMIS scanning enhancements and the DML>>. It does not incorporate EDUG's proposal completely.
Usage : the root element of this file <scan_result_list> may be put under <feature_list> element in file "dml_feature_r1.dtd" file and import this file at the beginning of that file.
Date : Jan. 26th, 2002
-->
<!-- define an entity for the value -->
<!ENTITY % value "value CDATA #REQUIRED">
<!-- define a ram_vector used later to locate a probe. It represents the centerline of the DME ram (probe major axis) and the points toward the sensor mount. -->
<!ENTITY % ram_vector_att " ram_i CDATA #REQUIRED
ram_j CDATA #REQUIRED
ram_k CDATA #REQUIRED">

<!-- define a set of attributes for actual sensor
offset_x, offset_y, offset_z :offset of the sensor center from the sensor mount point in the sensor mount coordinate system.
sensor_size : effective size of the sensro.
artifact_size : represent the measured size of the artifact used for sensor calibration.
artifact_form : represent the measured form error of the artifact during sensor.
artifact_label : name of the artifact.
artifact_x, artifact_y, artifact_z : the cartesian coordinates of the calibration artifact in machine coordinates.
date : the data at completion of the last calibration of the sensor in the format YYYY/MM/DD
time : the time at completion of the last calibration of the sensor in the format HH:MM:SS.
-->
<!ENTITY % actual_sensor_att
" offset_x CDATA #REQUIRED
offset_y CDATA #REQUIRED
offset_z CDATA #REQUIRED
sensor_size CDATA #REQUIRED
artifact_size CDATA #REQUIRED
artifact_form CDATA #REQUIRED
artifact_label CDATA #IMPLIED
artifact_x CDATA #IMPLIED
artifact_y CDATA #IMPLIED
artifact_z CDATA #IMPLIED
date CDATA #IMPLIED
time CDATA #IMPLIED "
>
<!-- define the distance between two consecutive points. If axis is specified, then the distance between two consecutive points along the specified axis. -->
<!ELEMENT dist EMPTY>
<!ATTLIST dist
%value;
axis (x | y | z) #IMPLIED
>
<!-- define the max chordal deviation from the surface to the line linked between two consecutive points. If the max_dist is specified, the dist between these two points should not exceed that value( in case the surface is very straight). -->
<!ELEMENT chord EMPTY>
<!ATTLIST chord
%value;
max_dist CDATA #IMPLIED
>
<!-- define the interval of time (in second) to sample data. -->
<!ELEMENT time_interval EMPTY>
<!ATTLIST time_interval
%value;
>
<!-- define the interval of rotary table increament. -->
<!ELEMENT angle_interval EMPTY>
<!ATTLIST angle_interval
%value;
>
<!-- define one of the method to specify sample density -->
<!ELEMENT density (dist | chord | time_interval | angle_interval)>
<!-- define the max contact force between part and probe in DRAG mode -->
<!ELEMENT force EMPTY>
<!ATTLIST force
%value;
>
<!-- define the scanning method and sample rate for each method-->
<!ELEMENT scan_choice (peck | drag | non_contact)>
<!ELEMENT peck (density)>
<!ELEMENT drag (density, force)>
<!ELEMENT non_contact (density)>
<!--define sensor's moving velocity, it means measurement and position velocity for peck mode and scanning velocity for drag/non_contact mode.
MPM : meters per minute
MMPS : millimeters per second
IPM : inches per minute
IPS : inches per second
PCENT : percent of system max speed, should be between 0.01 ~ 1.0
system_max : system max speed
system-min : system minimum speed
-->
<!ELEMENT sensor_velocity EMPTY>
<!ATTLIST sensor_velocity
choice (MPM | MMPS | IPM | IPS | PCENT | system_max | system_min) #REQUIRED
%value;
>
<!-- define rotary table rotating velocity. It is applicable for all scanning modes.
RPM : round per minute.
PCENT : percent of system max speed, should be between 0.01 ~ 1.0
system_max : system max speed
system-min : system minimum speed

-->
<!ELEMENT table_velocity EMPTY>
<!ATTLIST table_velocity
choice (RPM | PCENT | system_max | system_min) #REQUIRED
%value;
>
<!-- define scanning velocity, it may specify the moving velocity of sensor and/or table -->
<!ELEMENT scan_velocity (sensor_velocity | table_velocity | (sensor_velocity, table_velocity))>
<!-- define the acceleration for sensor. It is used at peck mode.
MPMM : meters per minute per minute.
MMPSS : millimeters per second per second.
IPMM : inches per minute per minute.
IPSS : inches per second per second.
PCENT : percentage or system max acceleration.
system_max : system max acceleration.
system_min : system min acceleration.
-->
<!ELEMENT sensor_acceleration EMPTY>
<!ATTLIST sensor_acceleration
choice (MPMM | MMPSS | IPMM | IPSS | PCENT | system_max | system_min) #REQUIRED
%value;
>
<!-- define the acceleration for rotary_table. It is applicable to all scanning modes.
RPMM : round per minute per minute
PCENT : percentage or system max acceleration.
system_max : system max acceleration.
system_min : system min acceleration.
-->
<!ELEMENT table_acceleration EMPTY>
<!ATTLIST table_acceleration
choice (RPMM | PCENT | system_max | system_min) #REQUIRED
%value;
>
<!-- define scan_ acceleration, only applied to rotary_table currently based on DMIS 04.0. -->
<!ELEMENT scan_acceleration (sensor_acceleration | table_acceleration | (sensor_acceleration, table_acceleration))>
<!--define scanning plan -->
<!ELEMENT feature_ref EMPTY>
<!-- unclear with current featue defintion since feature's ID does not specify that feature is nominal or actual -->
<!ATTLIST feature_ref
represented_by IDREF #REQUIRED
>
<!ELEMENT scan_plane (normal | feature_ref)>
<!-- this element is used to locate a probe tip in cartisian sensor coordinate sys
dx, dy, dz :the distance in probe coordinates from the fixed sensor mount location for fixed probes, or the pivot/hinge point for indexable probes, to the probe tip center point. If using index and the probe tip center is offset from the sensor axis, dx, dy, dz define the orientation of the sensor in the indexable head.

-->
<!ELEMENT cart_location EMPTY>
<!ATTLIST cart_location
dx CDATA #REQUIRED
dy CDATA #REQUIRED
dz CDATA #REQUIRED
%ram_vector_att;
>
<!-- this element is used to locate a probe tip in polar sensor coordinate sys
tilt : the sensor's angle from the probe coordinate system's Z axis.
rot : is teh sensor's angle of rotation from the probe coordinate system's X axis in the XY plane of the probe coordinate system.
len : represent the length from the fixed sensor mount location for fixed probes, or the pivot/hinge point for the indexable probes, to the probe tip center point.

-->
<!ELEMENT polar_location EMPTY>
<!ATTLIST polar_location
tilt CDATA #REQUIRED
rot CDATA #REQUIRED
%ram_vector_att;
len CDATA #REQUIRED
>
<!-- this element is used to locate a probe tip in cartisian sensor coordinate sys
vector_att(i,j,k) : the dirction vector in probe coordinates from the fixed sensor mount location for fixed probes, or the pivot/hinge point for indeable probes, to the probe tip center point.
len : represent the length from the fixed sensor mount location for fixed probes, or the pivot/hinge point for the indexable probes, to the probe tip center point.

-->
<!ELEMENT vect_location EMPTY>
<!ATTLIST vect_location
%vector_att;
%ram_vector_att;
len CDATA #REQUIRED
>
<!-- this element is used to locate a probe tip in cartisian sensor coordinate sys relative to a previous defined probe.
rx, ry, rz : the relative distance from the master probe tip center to the probe tip center being defined in the same coordinate system as the master probe tip's coordinate system.

-->
<!ELEMENT relative_cart EMPTY>
<!ATTLIST relative_cart
relative_to IDREF #REQUIRED
rx CDATA #REQUIRED
ry CDATA #REQUIRED
rz CDATA #REQUIRED
>
<!-- this element is used to locate a probe with a vector relative to a previous defined probe.
ri, rj, rk : the relative direction vector from the master probe tip center to the probe tip center being defined in the same coordinate system as the master probe tip's coordinate system.
rlen : the relative length.

-->
<!ELEMENT relative_vect EMPTY>
<!ATTLIST relative_vect
relative_to IDREF #REQUIRED
ri CDATA #REQUIRED
rj CDATA #REQUIRED
rk CDATA #REQUIRED
rlen CDATA #REQUIRED
>
<!-- defines several ways to locate a probe, each one has a diameter attribute -->
<!ELEMENT probe_location (cart_location | polar_location | vect_location | relative_cart | relative_vect)>
<!ATTLIST probe_location
diameter CDATA #REQUIRED
>
<!-- define a sphere_type tip-->
<!ELEMENT sphere_type EMPTY>
<!-- define a cylinder_type tip
len : represents the length of the cylindrical portion of the probe, which will be used for measuring.
-->
<!ELEMENT cylinder_type EMPTY>
<!ATTLIST cylinder_type
len CDATA #REQUIRED
>
<!-- define a disk_type tip
thickness : represents the thickness of the disk probe.
-->
<!ELEMENT disk_type EMPTY>
<!ATTLIST disk_type
thickness CDATA #REQUIRED
>
<!ELEMENT tip_type (sphere_type | cylinder_type | disk_type)>
<!ELEMENT probe_nominal (probe_location, tip_type)>
<!ATTLIST probe_nominal
%reporting_transform;
name IDREF #REQUIRED
type (FIXED | INDEX) #REQUIRED
>
<!-- define an actual probe -->
<!ELEMENT probe_actual EMPTY>
<!ATTLIST probe_actual
%reporting_transform;
name ID #REQUIRED
%actual_sensor_att;
>

<!ELEMENT probe ((probe_nominal+ | probe_actual+ | (probe_nominal+, probe_actual+)))>
<!-- this element is used to locate a video sensor in polar sensor coordinate sys
tilt : the sensor's angle from the probe coordinate system's Z axis.
rot : is teh sensor's angle of rotation from the probe coordinate system's X axis in the XY plane of the probe coordinate system.

-->
<!ELEMENT polar_location_video EMPTY>
<!ATTLIST polar_location_video
tilt CDATA #REQUIRED
rot CDATA #REQUIRED
%ram_vector_att;
>
<!-- this element is used to locate video sensor in cartisian sensor coordinate sys
vector_att(i,j,k) : the dirction vector in probe coordinates from the fixed sensor mount location for fixed probes, or the pivot/hinge point for indeable probes, to the probe tip center point.

-->
<!ELEMENT vect_location_video EMPTY>
<!ATTLIST vect_location_video
%vector_att;
%ram_vector_att;
>
<!-- define several ways to locate the video sensor, the cart_location is the same as probe -->
<!ELEMENT video_location (cart_location | polar_location_video | vect_location_video)>

<!-- define a nominal video sensor
focal : focal distance in current system units.
magnification : magnificatio of the lens in decimal form.
aperture : aperture setting.
-->
<!ELEMENT video_nominal (video_location)>
<!ATTLIST video_nominal
%reporting_transform;
name ID #REQUIRED
type (FIXED | INDEX) #REQUIRED
focal CDATA #IMPLIED
magnification CDATA #IMPLIED
aperture CDATA #IMPLIED
>
<!-- define an actual video sensor -->
<!ELEMENT video_actual EMPTY>
<!ATTLIST video_actual
%reporting_transform;
name ID #REQUIRED
%actual_sensor_att;
>
<!ELEMENT video ((video_nominal | video_actual | (video_nominal, video_actual)))>

<!-- there are several types of probes supported by DMIS 04.0 : PROBE, MULTI_PROBE, VIDEO, LASER, INFRARED, NONCONTACT, X_RAY, POINT, LINE, AREA. Hhere, only give probe(for peck or drag) and video(for non_contact) as example -->
<!ELEMENT sensor_used (probe | video)>
<!-- this element defines the clearance distance away from the reference feature for path-directed moves. The refered feature migh be a feature_nominal, feature_actual or datum. -->
<!ELEMENT clearance_from EMPTY>
<!ATTLIST clearance_from
refer_to IDREF #REQUIRED
%value;
>
<!--this element specify the distance that probe will penetrate into the feature along the feature's orientation vector relative to another defined feature. The refered featur might be a feature_nominal, feature_actual or datum. -->
<!ELEMENT depth_from EMPTY>
<!ATTLIST clearance_from
refer_to IDREF #REQUIRED
%value;
>
<!-- define DME_related information, may have several algorithms used for the inspection or evaluation process(particulary video device). Also, it may have other attributes -->
<!ELEMENT dme_algdef EMPTY>
<!ATTLIST dme_algdef
type (ALG | FILTER | VIDEO_LIGHT | VIDEO_WINDOW | OPTIMIZATION | ANY) #REQUIRED
name CDATA #IMPLIED
value CDATA #IMPLIED
>
<!--Current sensor_setting element is for general use, not defined to a specific sensor. One sensor_setting for each different kind of sensors might be better.-->
<!ELEMENT sensor_setting (clearance_from?, depth_from?, dme_algdef*)>
<!ATTLIST sensor_setting
approach_dist CDATA #IMPLIED
retract_dist CDATA #IMPLIED
search_dist CDATA #IMPLIED
clearance_dist CDATA #IMPLIED
depth CDATA #IMPLIED
automatic_focus (OFF | ON) #IMPLIED
scale_x CDATA #IMPLIED
scale_y CDATA #IMPLIED
minimum_confidence CDATA #IMPLIED
>
<!-- define info for rotary table
x_dist ,y_dist, z_dist : the coordinates from the DME's zero position with respect to the rotary table's center point.
refer_to : refer to another rotary_table.
%vector_att(i, j, k) : unit vector for the rotary table's axis of rotation in a direction away from the rotary table's workpiece locating surface.

-->
<!ELEMENT rotary_table EMPTY>
<!ATTLIST rotary_table
name ID #REQUIRED
refer_to IDREF #IMPLIED
x_dist CDATA #REQUIRED
y_dist CDATA #REQUIRED
z_dist CDATA #REQUIRED
%vector_att;
>
<!ELEMENT default_scan_setting (scan_choice, scan_velocity, scan_acceleration, scan_plane, sensor_used, sensor_setting, rotary_table*)>
<!ELEMENT scan_setting (scan_choice?, scan_velocity?, scan_acceleration?, scan_plane?, sensor_used?, sensor_setting, rotary_table*)>
<!-- add filtered_point element for point_data in file basic_geometry file, same as measured_data. It is used to define an filtered data, also, it has one attribute to define if it is compensated or not

<!ELEMENT filtered_point (point, normal?, ball_radius?)>
<!ATTLIST filtered_point
compensated (YES | NO) #IMPLIED

>
point_list may include nominal_point, measured_point or filtered_point.
A further suggestion here is to assign an ID type attribute for those point and assign an IDREF type attribute for measured_point and filtered_point which refer to a nominal_point? Also, rename to point_nominal, point_actual, point_filtered.
-->
<!ELEMENT scan_result (scan_setting?, path+, point_list?)>
<!ATTLIST scan_result
name ID #REQUIRED
>
<!-- add start_point and end_point element in basic_geometry file
<!ELEMENT start_point EMPTY>
<!ATTLIST point
%point_att;
>
<!ELEMENT end_point EMPTY>
<!ATTLIST point
%point_att;
>

-->
<!ELEMENT path (scan_setting?, start_point, end_point, start_vector, feature+, point_list?)>
<!ATTLIST path
name ID #REQUIRED
scan_order CDATA #REQUIRED
continuous_from_previous (YES | NO) "YES"
>
<!ELEMENT scan_result_list (default_scan_setting, scan_result+)>