ShapeViewer scene files make it possible to save and restore a collection of files, as seen from a particlar viewpoint.
The file colors are also stored.
Scene File Version 0.9
The following notes apply to
ShapeViewer scene file versions 0.9
Saved Properties
The following properties are commonly stored in a scene file. The full set of supported properties are defined in the XML schema that follows.
- Properties that affect all files mentioned in the scene file
- A Global transform: a 4x4 transform that is applied to the files before being displayed. This effectively stores the rotation and zoom of the file, as displayed in the Shape Viewer.
- The name of the scene (optional)
- The rotation point : this is the point around which the scene is rotated, before being displayed.
- Properties affecting individual files:
- The file system path to the file to be loaded
- The index number, used within the ShapeViewer, of the file to be loaded.
- A color to be applied to each vertex of the file. This is an RGBA color, encoded as a single integer. See ShapeViewer source (SceneHelper.java) for details on the color encoding schema.
- griducf value : If the file to be loaded is a LONI Ucf file, it can be interpreted as either a set of contours, or as a connected surface mesh. In this case, if the value of griducf is "true" the file is loaded as a surface, if not, it is treated as an unconnected set of contours.
-
Scene file names
Scene files are identified by file extension. The file name may end in either ".scene", or in ".xml", to be recognized by the
ShapeViewer.
Scene file note
Example Scene File
<scene version="0.9" rotationpoint="113.74275 72.14185 134.6315">
<transform>
0.0010364403 -0.0060379016 -0.0019814314 0.0 3.3884097E-4 -0.0019522473 0.0061262106 0.0 -0.006345669 -0.001090417 3.4946288E-6 0.4 0.0 0.0 0.0 1.0 </transform>
<shape index="0" griducf="false" colorrgb="-3355444"
filename="101_QEM_SubDiv.dx">
</shape>
<shape index="1" griducf="false" colorrgb="-6710785"
filename="102_QEM_SubDiv.dx">
</shape>
<shape index="2" griducf="false" colorrgb="-26215"
filename="121_QEM_SubDiv.dx">
</shape>
<shape index="3" griducf="false" colorrgb="-13159"
filename="122_QEM_SubDiv.dx">
</shape>
<shape index="4" griducf="false" colorrgb="-103"
filename="161_QEM_SubDiv.dx">
</shape>
<shape index="5" griducf="false" colorrgb="-3342439"
filename="162_QEM_SubDiv.dx">
</shape>
<shape index="6" griducf="false" colorrgb="-6684775"
filename="163_QEM_SubDiv.dx">
</shape>
<shape index="7" griducf="false" colorrgb="-6684775"
filename="164_QEM_SubDiv.dx">
</shape>
<shape index="8" griducf="false" colorrgb="-6684724"
filename="165_QEM_SubDiv.dx">
</shape>
<shape index="9" griducf="false" colorrgb="-6710887"
filename="166_QEM_SubDiv.dx">
</shape>
<shape index="10" griducf="false" colorrgb="946274303"
filename="181_QEM_SubDiv.dx">
</shape>
</scene>
Scene file XML format definition
<!ELEMENT scene (transform?, shape+,colormap*) >
<!ELEMENT shape (attribute*) >
<!ELEMENT transform (#PCDATA)>
<!ELEMENT colormap (controlpoint*) >
<!ATTLIST controlpoint type (RED|BLUE|GREEN
h CDATA
v CDATA >
<!ATTLIST colormap name CDATA
min CDATA
max CDATA >
<!ATTLIST attribute name CDATA
colormap CDATA >
<!ATTLIST scene name CDATA
version CDATA
rotationPoint CDATA >
<!ATTLIST shape index CDATA
colorrgb CDATA
filename CDATA #REQUIRED>
****************************************************************************
<scene name="name">
<transform3D>
m01, m02, m03, m04
m01, m02, m03, m04
m21, m22, m23, m24
</transform3D>
<shape index= "0" filename="filename" color="-1">
</shape>
</scene>