Hi,
I would be grateful if anyone with experience in using shp2vec and with a exposure to the (old) SBuilder interface could confirm what follows. Take this as an effort of me to make a plan before starting to write code.
Sbuilder interface is similar to what it was. We can make lines and polys by hand or we can import GIS data (SHP is a new supported format). We can place the right mouse over a line and get to properties page of that line. Then we can set the properties of the line to be, for example, "stream A", "road A", "road B" or else. Basically when the user picks one of these types, a GUID is chosen. For example, what I referred to as road B could be 698E20FC-1C69-4876-AF34-A6E9F531CCA5. I have not yet polish the interface but I will probably show the name "Asphalt 2 Lanes Divided Median" and, on the side, a texture (hiway_2_lane_asphalt_su.bmp on the case). Sbuilder will not read the Terrain.CFG but, as before, it will read a simple TXT file similar to LINES.TXT with the same information. Now I will describe the internal structure of a Line as you can see it when you export a project to a SBX file. An example is:
[Line.2]
Name=3_Points_Line
Selected=True
Type=RDX
Color=-16776961
Guid=698E20FC-1C69-4876-AF34-A6E9F531CCA5//0//0//
NoOfPoints=3
Lat1= 40.3364562988281
Lon1=-9.90804327748329
Alt1= 35
Lat2= 40.3501892089843
Lon2=-9.59961751750456
Alt2= 35
Lat3= 40.2540588378906
Lon3=-9.35215964031233
Alt3= 35
Let me comment.
[Line.2] means that it is the second line in the project. The UIID to pass on SHP2VEC will be 2.
Name=3_Points_Line. This is a label. When importing a SHAPE file SBuilder will show a small dialog which will allow to define that name is read from one of the existing fields in the shape database file. Otherwise SBuilder will create a name as "3_Points_Line".
Selected=True, This very internal to SBuilder. Shall I export it? It simply means the selected (or not selected) state of a line at the time of exporting.
Type=RDX This is the type of a line. It could be an empty string in which case the type of the line is shown as to "None". RDX means Roads. The other FSX types for lines will be FWX RRX HLX STX UTX. I kept the name Type as I do not know if I will porte to the new SBuilder some support for FS9. If that will be the case Type could be, for example ,Type=VTP//7//1033//
Color=-16776961 is the ARGB value of the color used by SBuilder to show the line in the SBuilder display
Guid=698E20FC-1C69-4876-AF34-A6E9F531CCA5//0//0// This is the texture GUID plus a 0 (zero) plus another 0 (zero) separated by "//". The //0//0// string at the end will never be used except in the case of Freeways in wich case they mean the Number of Lanes and the Traffic Direction. For Polygons I plan to use the same arrangment with the 2 extra parameters menaing SlopeX and SlopeY as required on, for example, water polygons.
NoOfPoints=3
Lat1= 40.3364562988281
Lon1=-9.90804327748329
Alt1= 35
These are self explanatory. Note that Z (altitude) will allways be present. I am giving up to store another point parameter (the M value that I refer to in my previous post).
I never generated a BGL with the SHP2VEC tool
Here is what I am thinking of. I will be greateful if someone has a nicer solution or detects any error in my thinking.
I will have a subfolder under SBuilder called SHAPE and another sub/subfolder called WORK. If SBuilder is in C:\ I am referring to:
C:\SBUILDER\SHAPE
C:\SBUILDER\SHAPE\WORK
Inside C:\SBUILDER\SHAPE I will place:
shp2vec.ex
RDX.xml
FWX.xml
RRX.xml
HLX.xml
STX.xml
UTX.xml
These XML files will be copies of the ones given in the SDK examples. For example RDX.xml will be equal to RDS7824.xml
Say that the SBuilder's project has the name my_Project and that the only Line selected is line.2 above. When the user press Compile the following actions will take place:
a) all files inside C:\SBUILDER\SHAPE\WORK are deleted
b) RDX.xml is copied (and renamed) to C:\SBUILDER\SHAPE\WORK with the name RDX_my_Project.xml
c) Sbuilder exports into C:\SBUILDER\SHAPE\WORK the files
RDX_my_Project.dbf
RDX_my_Project.shp
RDX_my_Project.shx
d) Sbuilder will issue the command:
c:\sbuilder\shape\shp2vec.exe .\work my_Project -ADDTOCELLS
e) The file cvxmy_Project.BGL is copied into the SCENERY Target folder
I am sorry about this long post. If someone reads it and detects a wrong idea please advise. After all I never tried shp2vec!
Luis