Skip to content

set_line_approxSetLineApproxSetLineApproxset_line_approxT_set_line_approx🔗

Short description🔗

set_line_approxSetLineApproxSetLineApproxset_line_approxT_set_line_approx — Define the approximation error for contour display.

Warning🔗

set_line_approxSetLineApprox is obsolete and is only provided for reasons of backward compatibility.

Signature🔗

set_line_approx( window WindowHandle, integer Approximation )void SetLineApprox( const HTuple& WindowHandle, const HTuple& Approximation )static void HOperatorSet.SetLineApprox( HTuple windowHandle, HTuple approximation )def set_line_approx( window_handle: HHandle, approximation: int ) -> None

Herror T_set_line_approx( const Htuple WindowHandle, const Htuple Approximation )

void HWindow::SetLineApprox( Hlong Approximation ) const

void HWindow.SetLineApprox( int approximation )

Description🔗

set_line_approxSetLineApprox defines the approximation error for region and xld contour display in the window WindowHandlewindowHandlewindow_handle. Approximationapproximationapproximation values greater than zero cause an approximation of line strokes using less points. This may enable faster and in some cases smoother visualization. The parameter describes the maximal deviation in pixels of the approximated contour from the original contour (Ramer-Douglas-Peucker algorithm).

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

WindowHandlewindowHandlewindow_handle (input_control) window → (handle)HTuple (HHandle)HWindow, HTuple (IntPtr)HHandleHtuple (handle)

Window handle.

Approximationapproximationapproximation (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Maximum deviation from the original contour.

Default: 00
Value range: 0 ≤ Approximation

Example🔗

(HDevelop)

* Calling...
set_line_approx(WindowHandle,Approximation)
set_draw(WindowHandle,'margin')
disp_region(Obj,WindowHandle)

* ...corresponds with
get_region_polygon(Obj,Approximation,Row,Col)
disp_polygon(WindowHandle,Row,Col)
(C)
/* Calling... */
T_set_line_approx(WindowHandle,Approximation)\;
create_tuple_s(mode,"margin")\;
T_set_draw(WindowHandle, mode)\;
destroy_tuple(mode)\;
T_disp_region(Obj,WindowHandle)\;

/* ...corresponds with */
create_tuple_i(&approximation,0)\;
create_tuple(&row,0)\;
create_tuple(&col,0)\;
T_get_region_polygon(Obj,approximation,&row,&col)\;
destroy_tuple(approximation)\;
T_disp_polygon(WindowHandle,row,col)\;
destroy_tuple(row)\; destroy_tuple(col)\;

Result🔗

set_line_approxSetLineApprox returns 2 (H_MSG_TRUE) if the parameter is correct and the window is valid. Otherwise an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

get_line_approxGetLineApprox

Possible successors

disp_regionDispRegion

Alternatives

get_region_polygonGetRegionPolygon, disp_polygonDispPolygon

See also

get_line_approxGetLineApprox, set_line_styleSetLineStyle, set_drawSetDraw, disp_regionDispRegion, disp_polygonDispPolygon

Module🔗

Foundation