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¶
OnAttributeModify (self, obj, attr, *args)
activateListener (self, obj)
castForGet (self, obj, value)
castForSet (self, obj, value)
create (self, obj)
createList (self, listAttr, obj)
createListList (self, listAttr, obj)
deactivateListener (self, obj)
disable (self, obj)
enable (self, obj)
getCoord (self, feature, point)
getCoordLocation (self, feature, coord, normalized=False)
getCreateArgs (self)
getDisplayName (self, obj)
getGuiValue (self, obj, component=None, **kwds)
getInCoreValue (self, obj)
getReferenceFrame (self, obj)
getUnits (self, obj)
getValueList (self, obj)
getValueListList (self, obj)
getWrt (self, obj)
initialize (self, objCls, name)
loadValue (self, obj, value)
setInCoreValue (self, obj, value)
setValue (self, obj, value)
setValueList (self, obj, value)
setValueListList (self, obj, value)
Method Details¶
- classmethod apply(cls, **kwds)¶
 
Context manager to specify Attribute constructor kwds Useful to avoid repeating kwds while defining a related group
- OnAttributeModify(self, obj, attr, *args)¶
 
Callback method when the reference object gets modified.
- activateListener(self, obj)¶
 
Listen to referenced object for any changes.
- 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
- create(self, obj)¶
 
Creates a triple attribute for the specified object.
- createList(self, listAttr, obj)¶
 
Creates an attribute that has list of values for the specified object.
- createListList(self, listAttr, obj)¶
 
Creates an attribute that has nested list of values for the specified object.
- deactivateListener(self, obj)¶
 
Stop listening to referenced objects.
- disable(self, obj)¶
 
Disables listener for the reference object.
- enable(self, obj)¶
 
Enables listener for the reference object.
- 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
- getCreateArgs(self)¶
 
Helper used in create methods
- getDisplayName(self, obj)¶
 
Returns the display name of the attribute.
Display name is used show the objects attribute name in the Property editor.
- getGuiValue(self, obj, component=None, **kwds)¶
 
Formats the triple value to display it in the Property Editor.
- param obj
 Object to get triple value from.
- type obj
 GeneralObject
- param component
 Specifies which component of the triple is needs formatting. Component can be ‘x’, ‘y’ or ‘z’.
- type component
 str
- returns
 Formatted triple value.
- rtype
 str
- getInCoreValue(self, obj)¶
 
Calls the incore get method (defined in C++) of the attribute.
- param obj
 Object this attribute belongs to.
- type obj
 GeneralObject
- param value
 Value of the attribute to get.
- type value
 Any
- returns
 Value returned by the incore get method.
- rtype
 Any
- getReferenceFrame(self, obj)¶
 
Get reference frames Matrix44 in base units.
- getUnits(self, obj)¶
 
Returns the units of the attribute.
- getValueList(self, obj)¶
 
Returns the list of values from the specified object.
- getValueListList(self, obj)¶
 
Returns the nested list of values from the specified object.
- getWrt(self, obj)¶
 
Get object this attribute is relative to.
- initialize(self, objCls, name)¶
 
Initializes the attribute.
- param objCls
 Object class this attribute belongs to.
- type objCls
 class
- param name
 Name of the attribute.
- type name
 str
- loadValue(self, obj, value)¶
 
Loads and sets the value, when a model is loaded
- setInCoreValue(self, obj, value)¶
 
Calls the incore set method (defined in C++) of the attribute.
- param obj
 Object this attribute belongs to.
- type obj
 GeneralObject
- param value
 Value of the attribute to set.
- type value
 Any
- setValue(self, obj, value)¶
 
Sets the specified value.
- setValueList(self, obj, value)¶
 
Sets the specified list of values for the attribute.
- setValueListList(self, obj, value)¶
 
Sets the specified nested list of values for the attribute.