Sometimes you may want to add your own information to one of the standard reports in RealityCapture. In this article we are going to show you how to change a report, by adding a scale bar to the Selected Ortho Report.
The reports can be found in C:\Program Files\Capturing Reality\RealityCapture\Reports
Make a copy of the SelectedOrtho.html, and then open it up in a text editor, or an html editor if you have one. For this example we are using notepad++. It can also be a good idea to make a copy of the original, although you can overwrite any of the pre-defined reports by re-installing the application. For this reason it is also a good idea to make a copy of your changed version after over-writing the original.
The addition to the script is going to be part of the large image so it can be added here:
Here is the extra script we used:
$ExportOrthoProjection("$(orthoGuid)",
$Declare( "orthdeprecip", 1/orthoDepthInOrthoCoordUnits )
$Declare( "scaleFactor", 100 )
$Declare( "MorKm", 10 )
$If( orthoDepthInOrthoCoordUnits >= 110,
$Set ( "MorKm", 100 )
)
$If( orthoDepthInOrthoCoordUnits >= 1100,
$Set ( "MorKm", 1000 )
)
$If( orthoDepthInOrthoCoordUnits >= 11000,
$Set ( "MorKm", 10000 )
)
$If( orthoDepthInOrthoCoordUnits >= 110000,
$Set ( "MorKm", 100000 )
)
$Declare( "orthdepreciptimeswidth", orthdeprecip*scaleFactor*MorKm + 5 )
<line x1="5" y1="5" x2="$(orthdepreciptimeswidth:.6f)" y2="5" style="stroke:rgb(20,20,20);stroke-width:0.2" />
<line x1="5" y1="4" x2=5 y2="6" style="stroke:rgb(20,20,20);stroke-width:0.2" />
<line x1="$(orthdepreciptimeswidth:.6f)" y1="4" x2="$(orthdepreciptimeswidth:.6f)" y2="6" style="stroke:rgb(20,20,20);stroke-width:0.2" />
<text class="scaleText" x="7" y="7">$(MorKm) $(orthoCoordUnits)s</text>
)<!-- end of ExportOrthoProjection -->
There are some variables used in this code, that are needed to calculate the width of the scale bar, specifically orthoDepthInOrthoCoordUnits and orthoCoordUnits, and these variables needs to be declared in the function ExportOrthoProjection. You can find a list of all of the variables and functions that can be used in reports in the in-app help:
At the bottom of this section you can find tiles for the variables and functions for all of the different scopes:
The above script is nearly ready to go, except we have used a CSS class for the text of the scale bar:
so this needs to be added to svg.css, which can be found in C:\Program Files\Capturing Reality\RealityCapture\Reports\styles
Script here:
text.scaleText {
fill: black;
font-size: 2px;
}
Now all that is needed is to copy over the original SelectedOrtho.html, with your adjusted one (you will need to do this as an administrator), and you will now have a scale bar in your selected ortho report.
Comments
0 comments