MapWinGIS:Tin CreateNew

This is a back-up of the WIKI.
Not all links might work
We're working on a new wiki.

Main Page | Recent changes | View source | Page history | Log in / create account |

Printable version | Disclaimers | Privacy policy

CreateNew

Creates a new TIN object from the specified grid.
See also Grid and SplitMethod


VB.NET Usage

Function CreateNew(Grid As MapWinGIS.Grid, Deviation As Double, SplitTest As MapWinGIS.SplitMethod, STParam As Double, MeshDivisions As Integer, Optional MaximumTriangles As Integer, Optional cBack As MapWinGIS.ICallback) As Boolean

            Parameters

Grid

The grid to be used to create the new TIN.
Deviation If the distance between the grid elevation and the triangle surface elevation at any given point is greater than this value, the triangle will be split at this location. This value is in projected map coordinates.
SplitTest The method to use when splitting triangles.
STParam Split Test Parameter. This value depends on the SplitMethod specified. It will either be the smallest inscribed radius allowed measured in projected map coordinates, or it will be the smallest angle allowed measured in degrees.
MeshDivisions This is the number of dividers used to create an initial mesh for the algorithm. Each cell in the initial mesh is subdivided into smaller triangles depending on the deviation within the cell.
MaximumTriangles Optional. The maximum number of triangles allowed in the TIN. The default value is 1073741824.
cBack Optional. The ICallback object which will receive progress and error messages while the TIN is being created.
ReturnValue A boolean value representing the success or failure of creating the new TIN.

Sample Code

    Private Sub CreateTIN()
        Dim tin As New MapWinGIS.Tin()
        Dim grid As New MapWinGIS.Grid()
        Dim deviation As Double, stparam As Double
        Dim divisions As Integer, maxtriangles As Integer
        Dim success As Boolean
        'Set the maximum deviation between grid elevation and triangle elevation before triangle is split
        deviation = 100
        'Set the minimum allowed radius of an inscribed circle in a triangle in the TIN
        stparam = 300
        'Set the number of dividers to use to split the grid area in to an initial mesh for the TIN
        divisions = 5
        'Set the maximum number of triangles that can be created in the TIN
        maxtriangles = 1073741824
        'Open the grid to be used to create the TIN
        success = grid.Open("C:\test.bgd")
        'Create a new tin
        success = tin.CreateNew(grid, deviation, MapWinGIS.SplitMethod.InscribedRadius, stparam, divisions, maxtriangles, Me)
    End Sub
  

VB 6 Usage
Function CreateNew(Grid As Grid, Deviation As Double, SplitTest As SplitMethod, STParam As Double, MeshDivisions As Long, Optional MaximumTriangles As Long, Optional cBack As ICallback) As Boolean
            Parameters

Grid

The grid to be used to create the new TIN.
Deviation If the distance between the grid elevation and the triangle surface elevation at any given point is greater than this value, the triangle will be split at this location. This value is in projected map coordinates.
SplitTest The method to use when splitting triangles.
STParam Split Test Parameter. This value depends on the SplitMethod specified. It will either be the smallest inscribed radius allowed measured in projected map coordinates, or it will be the smallest angle allowed measured in degrees.
MeshDivisions This is the number of dividers used to create an initial mesh for the algorithm. Each cell in the initial mesh is subdivided into smaller triangles depending on the deviation within the cell.
MaximumTriangles Optional. The maximum number of triangles allowed in the TIN. The default value is 1073741824.
cBack Optional. The ICallback object which will receive progress and error messages while the TIN is being created.
ReturnValue A boolean value representing the success or failure of creating the new TIN.

Sample Code

    Private Sub CreateTIN()
        Dim tin As New MapWinGIS.tin
        Dim grid As New MapWinGIS.grid
        Dim deviation As Double, stparam As Double
        Dim divisions As Long, maxtriangles As Long
        Dim success As Boolean
        'Set the maximum deviation between grid elevation and triangle elevation before triangle is split
        deviation = 100
        'Set the minimum allowed radius of an inscribed circle in a triangle in the TIN
        stparam = 300
        'Set the number of dividers to use to split the grid area in to an initial mesh for the TIN
        divisions = 5
        'Set the maximum number of triangles that can be created in the TIN
        maxtriangles = 1073741824
        'Open the grid to be used to create the TIN
        success = grid.Open("C:\test.bgd")
        'Create a new tin
        success = tin.CreateNew(grid, deviation, MapWinGIS.SplitMethod.InscribedRadius, stparam, divisions, maxtriangles, Me)
    End Sub

Retrieved from "http://mapwindow.org/wiki/index.php/MapWinGIS:Tin_CreateNew"

This page has been accessed 1,684 times. This page was last modified on 9 November 2005, at 17:24.