int tsmWriteAllTrees ( TsmConnection oiConn, TsmConnection demConn, TsmConnectionParams params ) Creates a pyramid VRML tree and geotile files
Creates a pyramid VRML tree and geotile files.Create a hierarchy of VRML tree files. Tree files are used to control the level of detail (LOD) structure of a multi-resolution dataset. They are the glue that hold the vtiles together.
This function controls the generation of an entire hierarchy of VRML tree files from a TerraVision pyramid. It will open a connection to the dataset to get the tspec metadata, then it will create all of the relevant tree files and directories for that dataset.
The function will also generate an index.html redirect file that will send a web browser to the root tree file of the dataset.
The TsmConnectionParams structure lets you specify a number of parameters to control this process. Currently, the following settings are supported:
- TSM_PARAMS_VRML_DIR: The tree file will be written to the vtile directory inside this localdisk directory. This parameter is required - you should always set this with before calling this function.
- TSM_PARAMS_VRML_URL: By default, all of the URLs that are inserted into the VRML files will be relative. However, you can specify an absolute URL for all trees to use (i.e. for the vtile URL) by setting this parameter. The URL should be for the root directory of the dataset, e.g. http://www.ai.sri.com/VRMLSets/Yosemite.
- TSM_PARAMS_TREE_TYPE: If this is set to TSM_TREE_TYPE_QUADLOD, then the function will generate tree files using the custom Java-implemented QuadLOD node. If this value is set to TSM_TREE_TYPE_ANCHOR, then the function will generate tree files containing a sub-hierarchy of the terrain using standard VRML LOD and Anchor nodes. TSM_TREE_TYPE_LOD, then the function will generate tree files containing a sub-hierarchy of the terrain using standard VRML LOD node with NO Anchor nodes, just inlines.
- TSM_PARAMS_TEXEL_SCALE: This setting influences the level of detail (LOD) switching range for the multi-resolution terrain. This value is essentially an approximate screen-space error value. The default of 1 means switch LOD when the screen error between texels in adjacent LODs for a tile is >= 1. Therefore, using values greater than 1 will effectively make the LOD switching happen closer to the viewpoint.
- TSM_PARAMS_GEOTILES: When this setting is defined, for every tree file we generate a geotile file. The geotile file is inserted between the tree and vtile files and enables the specification of multiple terrain imageries as well as arbitary cultural features such as buildings, roads, etc.
- TSM_PARAMS_ROOT_LEVEL: When generating QuadLOD trees (see TSM_PARAMS_TREE_TYPE), there is a particular entry tree file which should be the file that you initially direct the web browser to. By default this will be the tree/2/p0p0.wrl file. However, if you set this value to 3, then then the root tree file becomes tree/3/p0p0.wrl. Additional nodes are inserted into the QuadLOD root file, and also the index.html file will be generated to point to this root file.
- TSM_PARAMS_NUM_POLYS: This setting specifies the number of polygons on one side of a tile. This value should be the same as the value you used to create the vtiles that this tree will be pointing to. It is used to correctly calculate the bounding box for the vtile file.
- TSM_PARAMS_GAUSSIAN: Use gaussian interpolation instead of linear when interpolating the elevation data. This value should be the same as the value you used to create the vtiles that this tree will be pointing to. It is used to correctly calculate the bounding box for the vtile file.
- TSM_PARAMS_FLAT: By default, all coordinates will be projected into geocentric coordinates i.e. an (x,y,z) offset from the center of the earth. This will take into account the earth's curvature. If you just want to produce a flat dataset where all elevations are relative to a plane, then use this option. N.B. in flat worlds, all coordinates are specified in a Z-up coordinate system with embedded Transform nodes to convert these into VRML's Y-up coordinate system. This value should be the same as the value you used to create the vtiles that this tree will be pointing to. It is used to correctly calculate the bounding box for the vtile file.
- TSM_PARAMS_FAST_BBOXES: By default, all bounding boxes will be calculated by taking the min and max of all coordinates in a tile. This can be a time consuming process and so we offer this alternative method which produces an approximation to a tile's bounding box but works much faster.
- TSM_PARAMS_WORLD_SCALE: Every coordinate that is sent to the vtile file will be scaled (divided) by this value. A value of 1.0 means no scaling. This facility is useful because geocentric coordinates can be very large and some VRML browsers have problems with these large coordinates. Scaling the coordinates down to the 10-100 m range gives good results. This value should be the same as the value you used to create the vtiles that this tree will be pointing to. It is used to correctly calculate the bounding box for the vtile file.
- TSM_PARAMS_ELEV_SCALE: Every elevation value will be multiplied by this value before projecting into the display coordinate system (e.g. geocentric). This allows you to introduce a vertical exaggeration into your models. A value of 1.0 means no vertical exaggeration. This value should be the same as the value you used to create the vtiles that this tree will be pointing to. It is used to correctly calculate the bounding box for the vtile file.