Method DrawLabels
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Rendering.dll
DrawLabels(CadDocument, CadRenderOptions, int[])
Draws a space of a drawing in flat ids and gives, for every pixel, the class of what is drawn on it and the entity that draws it: the picture Draw(CadDocument, CadRenderOptions) makes for the same options, as labels for training a vision model. It is the renderer of the canvas, drawing each item in the colour that is its id with no antialiasing, in the order the drawing draws them, so what is on top in the picture is on top in the labels; a pixel is of one entity and one class, exactly. A text under 5 pixels high is a bar, as in the picture; the paper of a layout, the frame of a viewport and raster images are not labelled. The classes are those of CadLabelClass. An INSERT's items are classed by what they are unless blocks are asked for, when all of them are class 5. The ground option has no effect: the ground is class 0.
public static CadRenderLabels DrawLabels(CadDocument document, CadRenderOptions options, int[] classes)
Parameters
documentCadDocumentThe drawing.
optionsCadRenderOptionsThe space, the part, the size; null for the defaults.
classesint[]The classes to label, from 1 to 5 (CadLabelClass); null for the first four, which leave blocks off. A pixel of a class not given is 0 in both arrays.
Returns
- CadRenderLabels
The labels.
Exceptions
- ArgumentNullException
Thrown when the document is null.
- ArgumentException
Thrown for the options Draw(CadDocument, CadRenderOptions) refuses, a class that is not 1 to 5, or a space of more than 2 097 151 entities.