LuciadCPillar 2023.1.04
luciad::ObservablePolylineUtil Class Referencefinal

This class provides utility methods for Observable instance for Polyline. More...

#include <luciad/geometries/observable/ObservablePolylineUtil.h>

Public Member Functions

 ObservablePolylineUtil ()=delete
 

Static Public Member Functions

static std::shared_ptr< Observable< std::shared_ptr< Point > > > derivePointAtEnd (const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &observablePolyline)
 Derives an Observable Point from the given observable polyline that represents the end point of the polyline (regardless of the point count). More...
 
static std::shared_ptr< Observable< std::shared_ptr< Point > > > derivePointAtIndex (const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &observablePolyline, size_t index)
 Derives an Observable Point from the given observable polyline that represents the point at the given index. More...
 
static std::shared_ptr< Observable< std::shared_ptr< Point > > > derivePointAtStart (const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &observablePolyline)
 Derives an Observable Point from the given observable polyline that represents the start point. More...
 
static std::shared_ptr< Observable< std::shared_ptr< Point > > > derivePointOnSegment (const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &observablePolyline, size_t segmentIndex, double parameter)
 Derives an Observable Point from the given observable polyline that represents a point on a segment of the polyline. More...
 

Detailed Description

This class provides utility methods for Observable instance for Polyline.

Since
2020.1

Constructor & Destructor Documentation

◆ ObservablePolylineUtil()

luciad::ObservablePolylineUtil::ObservablePolylineUtil ( )
delete

Member Function Documentation

◆ derivePointAtEnd()

static std::shared_ptr< Observable< std::shared_ptr< Point > > > luciad::ObservablePolylineUtil::derivePointAtEnd ( const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &  observablePolyline)
static

Derives an Observable Point from the given observable polyline that represents the end point of the polyline (regardless of the point count).

This observable point will be updated when the given observable polyline changes.

Notes:

  • When the observable polyline contains a nullptr value, the observable point instance will contain a nullptr value too.
  • Observable::setValue will throw an exception for derived instances.
Parameters
observablePolylinean observable polyline from which to derive the point
Returns
a derived Observable

◆ derivePointAtIndex()

static std::shared_ptr< Observable< std::shared_ptr< Point > > > luciad::ObservablePolylineUtil::derivePointAtIndex ( const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &  observablePolyline,
size_t  index 
)
static

Derives an Observable Point from the given observable polyline that represents the point at the given index.

This observable point will be updated when the given observable polyline changes.

Notes:

  • When the observable polyline contains a nullptr value, the observable point instance will contain a nullptr value too.
  • When the given index >= point count, the observable point instance will contain a nullptr value.
  • Observable::setValue will throw an exception for derived instances.
Parameters
observablePolylinean observable polyline from which to derive the point
indexthe point index
Returns
a derived Observable

◆ derivePointAtStart()

static std::shared_ptr< Observable< std::shared_ptr< Point > > > luciad::ObservablePolylineUtil::derivePointAtStart ( const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &  observablePolyline)
static

Derives an Observable Point from the given observable polyline that represents the start point.

This observable point will be updated when the given observable polyline changes.

Notes:

  • When the observable polyline contains a nullptr value, the observable point instance will contain a nullptr value too.
  • Observable::setValue will throw an exception for derived instances.
Parameters
observablePolylinean observable polyline from which to derive the point
Returns
a derived Observable

◆ derivePointOnSegment()

static std::shared_ptr< Observable< std::shared_ptr< Point > > > luciad::ObservablePolylineUtil::derivePointOnSegment ( const std::shared_ptr< Observable< std::shared_ptr< Polyline > > > &  observablePolyline,
size_t  segmentIndex,
double  parameter 
)
static

Derives an Observable Point from the given observable polyline that represents a point on a segment of the polyline.

This observable point will be updated when the given observable polyline changes.

Notes:

  • When the observable polyline contains a nullptr value, the observable point instance will contain a nullptr value too.
  • When the given segmentIndex >= point count - 1, the observable point instance will contain a nullptr value.
  • Observable::setValue will throw an exception for derived instances.
Parameters
observablePolylinean observable polyline from which to derive the point
segmentIndexa segment index: a value between [0, pointCount - 2]. For example: segment index 0 corresponds with the segment between the points with index 0 and 1.
parametera parameter value between [0, 1] that determines which point of the segment is chosen. This can for example be 0.5, to get the middle of the segment
Returns
a derived Observable