Skip to content

jsl/symbols/SymbolParams

Package name: jsl/symbols/SymbolParams

Summary

Data Types

SymbolLabelParams

Symbol Label COnfiguration Parameters

Constructors

Function Description
SymbolLabelParams (+ 1) Constructor for defstruct SymbolLabelParams

Multis

Function Description
get-label-params

Functions

Function Description
get-default-symbol-label-params
set-default-symbol-label-params
build-labels Build Label Text in the SymbolNode scene graph

LabelPosition

Utility Class for Specifying the label position

Constructors

Function Description
LabelPosition (+ 1) Constructor for defstruct LabelPosition

Functions

Function Description
build-labels Build Label Text in the SymbolNode scene graph

SymbolParams

Base type for Symbol Parameterizations

Constructors

Function Description
SymbolParams (+ 1) Constructor for defstruct SymbolParams

Multis

Function Description
get-label-params

Functions

Function Description
compute-label-positions Compute the Designator and Value Label Positions

General Definitions

Variable Description
DEF_SYMB_REF_SIZE
DEF_SYMB_LABEL_SIZE

Definitions

SymbolLabelParams

Symbol Label COnfiguration Parameters

public defstruct SymbolLabelParams <: Equalable
    ref-label-size: Double
    value-label-size: Maybe<Double>

  • ref-label-size: Double - Dimension of the Reference Designator label This value is in schematic symbol grid units.

  • value-label-size: Maybe<Double> - Dimension of the Value Label This value is in schematic symbol grid units If None() - then no value label is created.

This object provides settings for configuring the reference designator and value labels.

Constructors

SymbolLabelParams

Constructor for defstruct SymbolLabelParams

public defn SymbolLabelParams (ref-label-size:Double, value-label-size:Maybe<Double> = ?)

SymbolLabelParams

Constructor for defstruct SymbolLabelParams

public defn SymbolLabelParams ( -- ref-label-size:Double = ?, value-label-size:Maybe<Double> = ?)

Multis

get-label-params

public defmulti get-label-params (x:SymbolParams) -> SymbolLabelParams

  • Returns SymbolLabelParams

Functions

get-default-symbol-label-params

public defn get-default-symbol-label-params () -> SymbolLabelParams

  • Returns SymbolLabelParams

set-default-symbol-label-params

public defn set-default-symbol-label-params (v:SymbolLabelParams) -> False

  • Returns False

build-labels

Build Label Text in the SymbolNode scene graph

public defn build-labels (p:SymbolLabelParams, sn:SymbolNode, ref-lab:LabelPosition, val-lab:LabelPosition)

  • p: SymbolLabelParams - Label Parameters Object
  • sn: SymbolNode - SymbolNode scene graph
  • ref-lab: LabelPosition - Position for the Reference Designator Label
  • val-lab: LabelPosition - Position for the Value Label

LabelPosition

Utility Class for Specifying the label position

public defstruct LabelPosition
    anchor: Anchor
    pos: Pose|Point|[Double, Double]

  • anchor: Anchor - Anchor Position for the Label This places the start or end of the text depending on where the anchor is set.

  • pos: Pose|Point|[Double, Double] - Position of the label If Point or [Double, Double] - then no rotation is applied.

Constructors

LabelPosition

Constructor for defstruct LabelPosition

public defn LabelPosition (pos:Pose|Point|[Double, Double], anchor:Anchor)

LabelPosition

Constructor for defstruct LabelPosition

public defn LabelPosition ( -- pos:Pose|Point|[Double, Double], anchor:Anchor)

Functions

build-labels

Build Label Text in the SymbolNode scene graph

public defn build-labels (p:SymbolLabelParams, sn:SymbolNode, ref-lab:LabelPosition, val-lab:LabelPosition)

  • p: SymbolLabelParams - Label Parameters Object
  • sn: SymbolNode - SymbolNode scene graph
  • ref-lab: LabelPosition - Position for the Reference Designator Label
  • val-lab: LabelPosition - Position for the Value Label

SymbolParams

Base type for Symbol Parameterizations

public defstruct SymbolParams <: Equalable
    label-params?: Maybe<SymbolLabelParams>

  • label-params?: Maybe<SymbolLabelParams> - Optional Label Parameter Overrides This field is optional and if left as None() then the default label parameters will be queried from get-default-symbol-label-params. Alternatively, the user may override this default behavior by providing a SymbolLabelParams instance.

Each symbol can create a derived type that defines the unique parameters for that symbol. This type defines the base parameterizations that all symbols must have.

Constructors

SymbolParams

Constructor for defstruct SymbolParams

public defn SymbolParams (label-params?:Maybe<SymbolLabelParams>)

SymbolParams

Constructor for defstruct SymbolParams

public defn SymbolParams ( -- label-params?:Maybe<SymbolLabelParams> = ?)

Multis

get-label-params

public defmulti get-label-params (x:SymbolParams) -> SymbolLabelParams

  • Returns SymbolLabelParams

Functions

compute-label-positions

Compute the Designator and Value Label Positions

public defn compute-label-positions (p:SymbolParams, anchor:Anchor, margin:Percentage = ?) -> [Point, Point]

  • p: SymbolParams - Symbol Parameters object for the symbol
  • anchor: Anchor - Sets where the origin position of the stacked labels is. This function only accepts N and S as anchor positions. If passed S - then this function will put the value label at the origin and the ref des label above it (+Y). If the value label is not active - then the ref des label is placed at the origin. If passed N - then this function will put the ref label at the origin and then value label below it (-Y).
  • margin: Percentage - Distance between labels as a ratio of the label height. Default is 20%.
  • Returns [Point, Point] - Tuple of the Ref Des Label Position and then the Value Label Position.
  • Throws ArgumentError - If anchor is anything other than N or S.

This function assumes that you want to place the stacked on top of each other. Typically you would do this above or below the symbol - hence the need for the anchor.

General Definitions

DEF_SYMB_REF_SIZE

public val DEF_SYMB_REF_SIZE

DEF_SYMB_LABEL_SIZE

public val DEF_SYMB_LABEL_SIZE

Related Packages

Forwarded by packages: jsl/symbols/SymbolDefn, jsl/symbols/framework, jsl/symbols