User Tools

Site Tools


smartsuite:smartsuite_update

SmartSuite Update

February 2019

As part of a significant update to the SmartDirt app on Android there were some improvements made to the functionality along with supporting updates to the user interface. The following is a summary of the updates

  • All surface notation was updated. The top surface is the Reference surface. The bottom surface is the Difference surface. An additional View Surface was added. This is the surface that the mesh is rendered on. It must be either the Reference or Difference Surface.
  • The information in the bottom of the main page was updated to have the caret point to the current view surface.

  • With the addition of the View Surface a mechanism was added to allow the user to select this surface. The surface selection dialog was updated with check boxes in the title lines “Reference Surface” and “Difference Surface”. This check box defaults to Reference Surface and allows the user to select either surface as the view surface. The cut/fill colors are still retrieved from the isopach but they are rendered on the selected view surface. Currently only the original reference surface in the isopach contains a trimesh. If the difference surface is selected as the view surface then the trimesh must be generated on the device. This is also true for any other surface that is loaded. This process can be time consuming. We need to revisit putting the trimesh for at least the difference surface back into the ADF file. It may make sense to put the trimesh for all surfaces in the ADF file. Additionally, the current selected Reference and Difference surfaces are checked in the form when it comes up. In the image below the Reference Surface is checked as the View Surface. The reference surface is set to “Subgrade” and the difference surface is set to “Stripped”.

  • The View Settings - View Controls section updated. The previous section was “Skip Cut/Fill model”, “Map Background”, “Color”. “Skip Cut/Fill Model” has been removed. This option dumped the isopach and it was decided there is no good reason to ever do that. The “Map Background” option changed to “Background” followed now by the “Color” option which changed to “Color Increment” The “Backgroup” options also updated. “Cut/Fill Color” is the default and displays the cut/fill colors from the isopach. A new option “Shaded” forces the color to yellow which is what happened before when the “Skip Cut/Fill Model” was checked. This new option uses the same rendering class as the cut/fill color but forces the color to yellow. It also continues to allow the user to get cut/fill data from the surface. Finally Image followed by None complete the list. These options have not changed. The “Color Increment” was tightened up and still allows the user to select the color increment just as before. If metric is set then the units will change to “m”. The default has auto checked but if this user overrides this the entered value is saved and used every time the app is used. If overridden then “Auto” becomes unchecked.

  • The other UI updates involve the strings. All labels are now title case. (First letters capitalized in all words). All occurrences of Cut/Fill are Cut/Fill not Cut/fill, Cut fill, Cut Fill etc…). All occurrences of CompareTo, Compare To etc are now Difference

One other visible change is a change to the package naming for the application. We introduced four types of builds: dev, alpha, beta and rel. The nightly build is now the dev build and the labeling for this build appears to the user on the About screen. Build Number: XXX now changes to Build: Dev-XXX where XXX is the build number. The Alpha and Beta build types are for internal and external testing purposes. The About screen will show Build: Alpha-XXX and Build: Beta-XXX where XXX is the build number. On Android the Alpha and Beta builds are generated out of a release branch and the Version: X.X.X is the name of the release version. Finally the rel build is shown on the About screen with Build: Release. No build number is used for the release build.

Under The Covers

In the Android code base there were a few different terms used to identify the Reference and Difference surfaces. These includes things like CompareTo, Design, Compare, View, Display etc… Most of these have been changed to Reference and Differences. An additional term which is View Surface is now used to identify the surface which the colored mesh is applied to. By default this surface starts as the Reference surface that is read from the Isopach.

The code was changed to load both surfaces that are identified in the isopach. Only the Reference surface was loaded in the past. The isopach also flushed the trimesh and line data from the bottom or Difference surface if it was loaded. This caused significant issues when switching the view surface since the device had to rebuild the trimesh from points and lines.

The cut/fill values are loaded from the isopach and these values are used to determine surface colors no matter which surface is the current view surface. As mentioned above an additional coloring is now available that is references to as “shaded”. When this is set the color is forced to “yellow” (i.e. middle of color table). The same diffusion code is used to get the proper shading on vertical surfaces. The isopach data is still available for proper measurements. The old code that rendered monochrome surfaces is no longer used. The mechanism for that code to be used was to check “Skip Cut/Fill”. The side effect of this was to dump the isopach. This caused measurements to stop working since the cut/fill data was gone. Also, the only way to get the isopach back was to have the device rebuild it.

Java has major memory and performance issues with Objects. This becomes especially apparent in objects that get replicated a lot, such as points or vertices. The Android code has objects for both 2D and 3D vertices (Vertex2D and Vertex3D). If these are created a lot it becomes a pretty significant performance issue. It also is a memory issue because Objects have pretty large overhead in Java. At the core of the memory improvement was removing ArrayLists of these objects in favor of arrays of primitives. There is still work left to do for lines and points. Both of these still use bloated Java Objects and Containers.

Updates were also made in the TriMesh C++ code. One significant update is the addition of a method to retrieve all the elevations at one time. The Java JNI interface to the C++ layer has significant performance issues when it is hit too often. This was the case when the elevations were retrieved for each vertex of each triangle. A significant performance improvement was made in the RenderCutFill code by getting all the elevations at the same time.

Also updated pushing triangles into the Trimesh C++ code. This change added a method to TriMesh.cpp, Surface.cpp and updating surfaceControl.cpp. The previous surfaceControl code looped through the triangles calling addtriangle in CSurface which in turn calls addtriangle in CTrimesh. The side effect of this is that memory must be allocated on the fly using Realloc. This slows things down. The new methods send the triangle vertices all the way to the CTrimesh class which allocates the required memory and adds the triangles. This improvement is general and should be used in all places this trimesh code is used.

smartsuite/smartsuite_update.txt · Last modified: 2019/04/03 14:55 by timm