User Interface
- Last UpdatedNov 24, 2023
- 4 minute read
These python classes are of user interface type.
|
Class KcsButtonState.ButtonState |
||||
|
The class holds information about buttons states during interactive operations. It is used in interactive functions call that means, point2D_req in module kcs_ui. |
||||
|
Parameters and attributes: |
||||
|
LockEnabled |
integer |
Lock buttons state: 0 - disabled, 1 - enabled |
||
|
OptionsEnabled |
integer |
Options button state: 0 - disabled 1 - enabled |
||
|
LockChecked |
string |
State of lock buttons: None - no lock button checked ‘U’ - U lock checked ‘V’ - V lock checked |
||
|
Constructor: |
||||
|
ButtonState() |
This constructor will create instance of ButtonState class. By default all buttons are disabled/unchecked. |
|||
|
Class protocols: |
||||
|
__cmp__ |
Used to compare two ButtonState objects. |
|||
|
__repr__ |
Used to return string representation of ButtonState object. |
|||
|
|
||||
|
Example: import KcsButtonState import KcsPoint2D import kcs_ui point = KcsPoint2D.Point2D() buttons = KcsButtonState.ButtonState() buttons.LockEnabled = 1 buttons.OptionsEnabled = 1 buttons.LockChecked = 'U' kcs_ui.point2D_req('Select 2D point', point, buttons) |
||||
|
Class KcsCursorType.CursorType |
||||
|
The class holds information about cursor type used in kcs_ui.point2D_req function |
||||
|
Parameters and attributes: |
||||
|
__nType |
integer |
Type of cursor. This variable should not be accessed directly. |
||
|
__Arguments |
list |
Additional information for specified cursor type. This variable should not be accessed directly. |
||
|
Methods: |
||||
|
SetCrossHairs() |
This function will set cursor type to CrossHair cursor. |
|||
|
SetRubberBand(point) |
This function will set cursor type to RubberBand cursor. Point specifies first point position. |
|||
|
SetRubberRectangle(point) |
This function will set cursor type to RubberRectangle. Point specifies first corner position. |
|||
|
SetRubberCircle(point) |
This function will set cursor type to RubberCircle. Point will specify centre of circle. |
|||
|
GetCursorType() |
This function will return current cursor type. It can be:
|
|||
|
SetDragCursor(highlight, point) |
This function will set cursor type to DragCursor.
|
|||
|
Example: center = KcsPoint2D.Point2D(0, 0) Cursor = KcsCursorType.CursorType() Cursor.SetRubberCircle(point) print Cursor.GetCursorType() |
||||
|
Class KcsHighlightSet.HighlightSet |
||||
|
The class holds information defining drag cursor. |
||||
|
Parameters and attributes: |
||||
|
__Elements |
list |
List of elements defining highlight set. |
||
|
Methods: |
||||
|
AddGeometry2D( element, <linetype>) |
Adds graphical 2D element to highlight set.
|
|||
|
AddGeometry3D( element, <handle>, <linetype>) |
Adds graphical 2D element to highlight set.
|
|||
|
AddModel( model ) |
Adds model to highlight set.
|
|||
|
AddSubpicture( handle ) |
Adds subpicture to highlight set.
|
|||
|
Reset() |
Removes all elements from highlight set. |
|||
|
Example: highlight = KcsHighlightSet.HighlightSet() cursor = KcsCursorType.CursorType() highlight.AddSubpicture( handle ) cursor.SetDragCursor( highlight, refpoint ) see also: # Example: kcs_ex_ui1.py |
||||
|
Class KcsStat_point2D_req.Stat_point2D_req |
||||
|
The class holds information about point2D selection method. |
||||
|
Parameters and attributes: |
||||
|
__CursorType |
iCursorType |
Type of cursor. This variable should not be accessed directly. |
||
|
__Point2dDefMode |
integer |
Point definition mode. This variable should not be accessed directly. |
||
|
__HelpPoint |
Point2D |
Help point for ModeOffsetCurrent definition mode. This attribute is optional. |
||
|
__Scale |
Real |
Scale |
||
|
Methods: |
||||
|
SetDefMode(mode) |
This function will set definition mode. Argument mode is a string that specifies point definition mode:
These names are defined in KcsStat_point2D_req.Point2dDefModes dictionary. |
|||
|
GetDefMode() |
This function will return name of selected definition mode. Look at KcsStat_point2D_req.Point2dDefModes dictionary for definition modes names. |
|||
|
SetCursorType(CursorType) |
This function will set cursor type to specified by CursorType instance of KcsCursorType.CursorType class. |
|||
|
GetCursorType() |
This function will return current cursor type as instance of KcsCursorType.CursorType class. |
|||
|
SetHelpPoint(point) SetHelpPoint(None) |
This function will set help point for ModeOffsetCurrent point definition mode. Note: that user can select mode to ModeOffsetCurrent during selection so if this point will be None then mode will be greyed on point definition mode toolbar. Use SetHelpPoint(None) to delete existing help point. |
|||
|
GetHelpPoint() |
This function will return currently defined help point. If no point is defined it will return python None value. |
|||
|
SetScale(scale) SetScale(None) |
Set scale. If None scale will be fetched from current subpicture. |
|||
|
GetScale() |
Returns scale value. |
|||
|
Example: CursorType = KcsCursorType.CursorType() CursorType.SetRubberCircle(KcsPoint2D.Point2D(100, 100)) Status = KcsStat_point2D_req.Stat_point2D_req() Status.SetCursorType(CursorType) Status. SetDefMode('ModeOffsetCurrent') Status.SetHelpPoint(KcsPoint2D.Point2D(0, 0)) point = KcsPoint2D.Point2D(); kcs_ui.point2D_req('Select point', point, Status) print Status.GetDefMode() |
||||
|
Class KcsStat_point3D_req. Stat_point3D_req() |
||||
|
The class holds information about some initial status when defining a 3D point, using the point3D_req function. |
||||
|
Attributes: |
||||
|
Helpdef |
integer |
Help point defined? = 0 No (default) = 1 Yes |
||
|
Helppnt |
Point3D |
The help point (if defined) |
||
|
Lockstatic |
integer |
Initial lock protected? = 0 No (default) = 1 Yes |
||
|
Locktype |
integer |
Type of lock: = 0 No lock (default) =1 Lock plane = 2 Lock line |
||
|
Lockpnt |
Point3D |
A point through the plane/line (if lock) |
||
|
Lockvec |
Vector3D |
A vector perpendicular to the plane / |
||
|
parallel to the line (normalised) (if lock) |
||||
|
Initial3D |
integer |
The initial way of defining the 3D point: = 1 Pick line (by indicating in a view) = 2 Key in = 3 Indicate event point (default) = 4 Offset from current (the help point) |
||
|
Initial2D |
integer |
The initial way of defining a 2D point (used by Pick Line) = 1 Key in (2D) = 2 Cursor position (default) = 3 End or node point = 4 Existing point = 5 Symbol connection = 6 Auto point = 7 Point on arc at angle = 8 Arc centre = 9 Point at distance along = 10 Mid point = 13 Intersecting point = 20 Offset from current point = 21 Closest segment point = 22 Centre of gravity = 23 Event point (2D) |
||
|
Methods: |
||||
|
None |
||||
|
Examples (to enable lock line) : status = KcsStat_point3D_req.Stat_point3D_req() |
||||
|
status.Initial2D = 3 |
## Pick line |
|||
|
## End/node point |
||||