LineParams Table
The LineParams table contains properties used by the CMeasureLines class. This table is used to change properties using the class SetParams method.
The reference table below lists the line measurement properties and their update status. For each property in the top half of the table, there exists a corresponding update status flag in the lower half of the table. The name of the update status flag prefixes the property name with the word Set. For example, the property bCentroid has the update status flag bSetCentroid. Normally, the update status flag is set to false. But to change it using the LineParams table, you must the the status flag to true. Create a LineParams table containing only the properties you wish to change. Then call the class SetParams method with the LineParams table as its parameter.
Table Member |
Default |
Definition |
Property: |
|
|
sColor |
"255,0,0" |
The color of the line. See the nRasterOp property. |
nRasterOp |
13 |
Controls the way the line color and image color are combined for drawing. The default draws a solid line of color sColor. |
nLineThk |
1 |
Sets the thickness of the line, in pixels, drawn on the image. |
nMatchingTol |
3 |
Sets the tolerance, in pixels, for mouse click "hits" to the line. |
nCentroidRadius |
15 |
The centroid radius when the vertex is adjusted to the centroid coordinates. |
nTrackingSearchRadius |
15 |
Specifies the tracking radius when transferring line marker coordinates to the next image in the image set. |
bCentroid |
false |
Specifies whether the vertex coordinate is updated to centroid coordinates before drawing on the image. |
bCentroidPositive |
false |
Specifies whether the centroid calculation assumes the object has positive (true) or negative (false) values relative to the background. |
bCentroidEndpt |
false |
Specifies whether the end-point coordinates are updated to centroid coordinates before drawing on the image. |
bCentroidAfterMove |
false |
Specifies whether the vertex coordinate is updated to centroid coordinates before drawing on the image. |
bCentroidTrack |
false |
Specifies whether the centroid is computed for the vertex when transferring line markers from one image to the next. |
bCentroidTrackEndpt |
false |
Specifies whether the centroid is computed for transferring line markers from one image to the next. |
bUseDockingPane |
false |
Specifies whether to list line measurements (distance, baseline angle, etc.) in a docking pane (true) instead of a measurement window (false). |
Update Status: |
|
|
bSetColor |
false |
Enables changes to sColor. |
bSetRasterOp |
false |
Enables changes to nRasterOp. |
bSetLineThk |
false |
Enables changes to nLineThk. |
bSetMatchingTol |
false |
Enables changes to nMatchingTol. |
bSetCentroidRadius |
false |
Enables changes to nCentroidRadius. |
bSetTrackingSearchRadius |
false |
Enables changes to nTrackingSearchRadius. |
bSetCentroid |
false |
Enables changes to bCentroid. |
bSetCentroidPositive |
false |
Enables changes to bCentroidPositive. |
bSetCentroidEndpt |
false |
Enables changes to bCentroidEndpt. |
bSetCentroidAfterMove |
false |
Enables changes to bCentroidAfterMove. |
bSetCentroidTrack |
false |
Enables changes to bCentroidTrack. |
bSetCentroidTrackEndpt |
false |
Enables changes to bCentroidTrackEndpt. |
bSetUseDockingPane |
false |
Enables changes to bUseDockingPane. |
Suppose an image window exists on the Mira screen and you have a collection of approximate coordinates of objects for which you wish to compute the distance and baseline angle between several pairs of points. You wish to improve the approximate coordinates by computing the center at each vertex and at each endpoint. The script below enables centroid computation at both the vertex and each endpoint, and sets the drawing color and line thickness for drawing the lines.
|
-- attach an image window |
|
-- leave script if no image window |
|
|
|
-- get the top-most or only image |
|
-- leave script if no image |
|
|
|
-- create a CMeasureLines object |
|
-- setup an LineParams table |
|
-- use a comma after each "name=value" pair |
|
-- enable centroid for first point |
|
|
|
-- enable centroid for endpoint |
|
|
|
-- enable new marker color |
|
|
|
-- enable new line thickness |
|
|
|
|
|
-- set the new properties |
|
|
|
-- first point coordinates |
|
-- endpoint coordinates |
|
-- Add an line marker to the image |
CMeasureLines class, SetParams
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.