MeasurementOptionsFactory Class

Factory for create measurement options which are used to create a measurement. We need the measurement options object to create a measurement.

Definition

Namespace: StreetSmart.Common.Factories
Assembly: StreetSmart.WinForms (in StreetSmart.WinForms.dll) Version: 24.7.0.0+cc0a01953d1235087ce28d3e921f5bb47d3c0460
C#
public static class MeasurementOptionsFactory
Inheritance
Object    MeasurementOptionsFactory

Example

This sample uses the MeasurementOptionsFactory, to show how you can start a line measurement in a cyclorama.
C#
using System.Collections.Generic;
using StreetSmart.Common.Factories;
using StreetSmart.Common.Interfaces;

namespace Demo
{
  public class Example
  {
    private IStreetSmartAPI _api;
    // Todo: Add a function to initialize the api.

    private async void OpenImageAndStartMeasurement()
    {
      // The open viewer options for open a new panorama viewer in EPSG:28992.
      IViewerOptions viewerOpt = ViewerOptionsFactory.Create(new List<ViewerType> { ViewerType.Panorama }, "EPSG:28992");

      // open a panorama viewer
      IList<IViewer> viewers = await _api.Open("Boschdijk 7, Eindhoven", viewerOpt);

      if (viewers.Count == 1)
      {
        // Get the panorama viewer object
        IPanoramaViewer viewer = (IPanoramaViewer)viewers[0];

        // The geometry type of the measurement
        MeasurementGeometryType geometryType = MeasurementGeometryType.LineString;

        // Create a measurement options object
        IMeasurementOptions measurementOptions = MeasurementOptionsFactory.Create(geometryType);

        // Start line measurement in the opened viewer
        _api.StartMeasurementMode(viewer, measurementOptions);
      }
    }
  }
}

Methods

Create Create a default measurement options object.
Create(Boolean) Create a measurement object and show the save measurement button during the measurement.
Create(MeasurementGeometryType) Create a measurement options object with a specific geometry type.
Create(MeasureMethods) Create a measurement options object with a specific measure method.
Create(MeasurementGeometryType, MeasureMethods) Create a measurement options object with a specific geometry type and a specific measure method
Create(MeasurementGeometryType, MeasureMethods, NullableBoolean) Create a measurement options object with a specific geometry type and a specific measure method

Version Information

Supported in: 18.7

See Also