UNPKG

@mlightcad/data-model

Version:

The data-model package provides the core classes for interacting with AutoCAD's database and entities. This package mimics AutoCAD ObjectARX's AcDb (Database) classes and implements the drawing database structure that AutoCAD developers are familiar with.

70 lines 2.65 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); import { AcGeArea2d, AcGePolyline2d } from '@mlightcad/geometry-engine'; import { AcDbRasterImage } from './AcDbRasterImage'; /** * Entity that creates a blank area in the drawing. * * The AcDbWipeout entity creates a blank area that covers other entities * in the drawing. It's commonly used to hide parts of the drawing or * create clean areas for annotations. The wipeout area is defined by * a boundary path and is rendered as a solid black fill. * * @example * ```typescript * const wipeout = new AcDbWipeout(); * // Set up boundary path and other properties * wipeout.draw(renderer); * ``` */ var AcDbWipeout = /** @class */ (function (_super) { __extends(AcDbWipeout, _super); function AcDbWipeout() { return _super !== null && _super.apply(this, arguments) || this; } /** * Draws the wipeout entity. * * This method creates a solid black area based on the boundary path * of the wipeout entity. The area covers all entities behind it, * effectively "wiping out" that portion of the drawing. * * @param renderer - The renderer to use for drawing * @returns The rendered entity or undefined if rendering fails * * @example * ```typescript * const wipeout = new AcDbWipeout(); * const renderedEntity = wipeout.draw(renderer); * ``` */ AcDbWipeout.prototype.draw = function (renderer) { var points = this.boundaryPath(); var area = new AcGeArea2d(); area.add(new AcGePolyline2d(points)); return renderer.area(area, { color: 0x000000, solidFill: true, patternAngle: 0, patternLines: [] }); }; /** The entity type name */ AcDbWipeout.typeName = 'Wipeout'; return AcDbWipeout; }(AcDbRasterImage)); export { AcDbWipeout }; //# sourceMappingURL=AcDbWipeout.js.map