AngleParams Table


The AngleParams table contains properties used by the CMeasureAngles class. This table is used to change properties using the class SetParams method.

The reference table below lists the angle 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 AngleParams table, you must the the status flag to true. Create an AngleParams table containing only the properties you wish to change. Then call the class SetParams method with the AngleParams 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.

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 angle 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 angle markers from one image to the next.

bCentroidTrackEndpt

false

Specifies whether the centroid is computed for transferring angle markers from one image to the next.

bUseDockingPane

false

Specifies whether to list angle measurements (the included 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.

Example

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 distances and angles between them. 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 before drawing the angles on the image.

V = attachlist_imageview()

-- attach an image window

Assert( V, "No image window")

-- leave script if no image window

 

 

I = V:GetImage()

-- get the top-most or only image

Assert( I, "No image selected")

-- leave script if no image

 

 

A = new_measureangles()

-- create a CMeasureAngles object

Params =

-- setup an AngleParams table

{

-- use a comma after each "name=value" pair

  bSetCentroid = true,

-- enable centroid for vertex

  bCentroid = true,

 

  bSetCentroidEndpt = true,

-- enable centroid for endpoints

  bCentroidEndpt = true,

 

  bSetColor = true,

-- enable new marker color

  sColor = "0,255,0",

 

  bSetLineThk = true,

-- enable new line thickness

  nLineThk = 2,

 

}

 

A:SetParams(Params)

-- set the new properties

 

 

xv = 40; yv = 210

-- vertex coordinates

x1 = 300; y1 = 7500

-- first endpoint coordinates

x2 = 250; y2 = 600

-- second endpoint coordinates

A:Add(I, xv, yv, x1, y1, x2, y2)

-- Add an angle marker to the image

Related Topics

CMeasureAngles class

SetParams


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.