Location (hwx.inspire.core)

Store a location relative to another entity.

Locations are get or set in global coordinates.

Locations relative to Features have special code to stay at the same point on the feature after feature modifications like push/pull.

Public Methods

castForGet (self, obj, value)
castForSet (self, obj, value)
getCoord (self, feature, point)
getCoordLocation (self, feature, coord, normalized=False)
getValue (self, obj)

Method Details

castForGet(self, obj, value)

Converts and returns the location value to gui units.

castForSet(self, obj, value)

Converts and validates the location value before setting it.

param obj:Object this attribute belongs to.
type obj:GeneralObject
param value:Value of the attribute to set.
type value:List[float]
returns:Validated and converted value.
rtype:Location
getCoord(self, feature, point)

Converts the location on the feature into UV coordinates.

None is returned if point is not touching feature

param feature:Feature from which coordinates are extracted from.
type feature:Feature
param point:Point on the feature for which UV coordinates are derived.
type point:Point
returns:Coordinates from the converted location.
rtype:UV Coordinates
getCoordLocation(self, feature, coord, normalized=False)

Convert coordinates to location from the specified feature.

param feature:Feature on which location is extracted.
type feature:Feature
param coord:Coordinates from which the location is derived.
type coord:List[Point]
param normalized:
 If True normalize the locations, defaults to False.
type normalized:
 bool
returns:Converted UV coordinates to location value.
rtype:Location
getValue(self, obj)

Returns the location value from the specified object.