Purpose

The module CSOFreehandProcessor module allows for a freehand generation of CSOs.

There are two major interaction modes available: one sets each single seed point by clicking into the image and the other sets seed points while dragging the mouse.

Usage

Connect this module to the inProcessor input field of a SoView2DCSOEditor module.

Details

This module offers seven presets for creating CSOs. Additionally, it offers the possibility of editing existing CSOs (only those which were created by this module). When editing an existing CSO, the module automatically chooses the same interpolation scheme as the CSO was created with.

The preset modes are: Point, Closed Polyline, Closed Spline, Closed Freehand, Closed Interpolation, Open Polyline, Open Spline and Open Freehand. As can be seen, the presets can be divided (besides the Point mode) into Open and Closed CSOs, and within those, into Polyline, Spline and Freehand modes.

Generating

If in Open mode, the CSO is left open on finishing it, if in Closed mode, the last set seed point is merged with the first seed point of the currently active CSO and closed.

The finishing depends on the chosen preset: in the Freehand modes, and the closed Spline and Polyline modes, a releasing of the active mouse button leads to a finishing if the Finishing Distance criterion is met. If this option is checked, the distance in pixels of the last mouse position to the first seed point must be equal or less than the according value. If unchecked, no distance is evaluated.

In the open Polyline and Spline modes, a double click needs to be performed in order to finish an active CSO.

The Polyline and the Spline modes require the user to perform a click in order to place a new seed point, while the Freehand modes require a pressing and holding of the active mouse button, while dragging.

Editing

If there are CSOs existing, the mouse cursor shows what the next action would be if the mouse button was clicked. A simple cross indicates that a new seed point would be inserted into the nearest path point at the current location of the mouse cursor, a little moving cross under the cursor indicates that the nearest seed point would be selected for moving, and all other mouse cursors indicate the starting of a new CSO.

Interaction

Clicking on an empty space in the image starts a new CSO. Depending on the preset mode, succeeding seed points can be added by either dragging the mouse or by clicking consecutively. Finishing a CSO also depends on the chosen preset mode.

Clicking near an existing seed point, this seed point is chosen and can be moved while dragging the mouse.

Clicking near an existing path, a new seed point is inserted into that and can be moved if dragging with the mouse.

In order to delete a selected seed point, press the according key on the keyboard (refer to the SoView2DCSOEditor’s keyboard setting, default is the DEL key).

Windows

Default Panel

../../../Modules/Inventor/SoCSO/mhelp/Images/Screenshots/CSOFreehandProcessor._default.png

Output Fields

outProcessorData

name: outProcessorData, type: CSOProcessorData(MLBase)

The output is used to establish a connection between this module and a SoView2DCSOEditor module.

Parameter Fields

Visible Fields

Is Processing

name: isProcessing, type: Bool, persistent: no

Shows whether the module is processing which is when the user interacts.

Creation Mode

name: creationMode, type: Enum, default: CreationModeClosedFreehand

Defines the module’s creation mode.

Values:

Title Name Description
Point CreationModePoint Creates a point at the clicked position.
Closed Polyline CreationModeClosedPolyline Creates a closed polyline, click to place a seed point.
Closed Spline CreationModeClosedSpline Creates a closed spline (interpolated spline), click to place a seed point.
Closed Freehand CreationModeClosedFreehand Creates a closed freehand contour that is smoothed by a spline approximation. Hold down the mouse button and drag to create a contour.
Closed Interpolation CreationModeClosedInterpolation Creates a closed contour that is generated by a spline interpolation of all set seed points. Set seed points by holding down the mouse button and dragging the mouse.
Open Polyline CreationModeOpenPolyline Creates an open polyline, click to place a seed point.
Open Spline CreationModeOpenSpline Creates an open spline, click to place a seed point.
Open Freehand CreationModeOpenFreehand Creates an open freehand contour, hold down the mouse button and drag the mouse.

Finishing Mode

name: finishingMode, type: Enum, default: FinishOnRelease

Defines the finishing mode. If the contour is actually really finished also depends on the Min. Num. Seed Points.

Values:

Title Name Description
Release FinishOnRelease Finishes a contour on releasing the mouse button.
Double Click FinishOnDoubleClick Finishes the contour on double-clicking.

Min. Num. Seed Points

name: minNumSeedPoints, type: Integer, default: 0

Sets the minimum number of seed points that are required before a contour can be finished.

Min. Seed Point Dist.

name: minSeedPointDistance, type: Float, default: 8

Sets the distance of the current seed point to the first seed point. If the distance is less than this value, the contour can be closed.

Use Finishing Distance

name: useFinishingDistance, type: Bool, default: TRUE

If checked, the Use finishing distance in pixel is considered when trying to finish a contour.

Use finishing distance

name: finishingDistance, type: Float, default: 24

Sets the finishing distance in pixel which is considered if Use Finishing Distance is checked.

Show interactive preview

name: showInteractivePreview, type: Bool, default: TRUE

If checked, some modes have a preview mode of how the CSO will look like if the user would press the mouse button to place a new seed point.

Hidden Fields

updateMode

name: updateMode, type: Enum, default: AutoClear

Values:

Title Name
Off Off
Auto Update AutoUpdate
Auto Clear AutoClear

autoApply

name: autoApply, type: Bool, default: FALSE

apply

name: apply, type: Trigger

done

name: done, type: Trigger, persistent: no

emptyGroupBeforeGeneration

name: emptyGroupBeforeGeneration, type: Bool, default: FALSE

addCSOToGroupMode

name: addCSOToGroupMode, type: Enum, default: AddToGroupByLabel

Values:

Title Name
None AddToGroupNone
By Label AddToGroupByLabel
By Id AddToGroupById

addCSOToGroupWithId

name: addCSOToGroupWithId, type: Integer, default: -1

interpolationMode

name: interpolationMode, type: Enum, default: InterpolationModeSplineApproximation

Values:

Title Name
Linear Interpolation InterpolationModeLinearInterpolation
Spline Interpolation InterpolationModeSplineInterpolation
Spline Approximation InterpolationModeSplineApproximation

seedPlacementPolicy

name: seedPlacementPolicy, type: Enum, default: PlaceSeedPointWhileDragging

Values:

Title Name
On Click PlaceSeedPointOnClick
While Dragging PlaceSeedPointWhileDragging

shouldCloseOnFinish

name: shouldCloseOnFinish, type: Bool, default: TRUE

numInterpolationSteps

name: numInterpolationSteps, type: Integer, default: 1