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.

157 lines 7.05 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 { AcGeBox3d, AcGePoint3d } from '@mlightcad/geometry-engine'; import { AcDbDimension } from './AcDbDimension'; /** * Represents a three-point angular dimension entity in AutoCAD. * * This dimension type measures the angle between two lines or edges by defining three points: * a center point and two points that define the lines or edges being measured. The dimension * displays the angle value and typically includes extension lines, dimension lines, and arrows. * * Three-point angular dimensions are commonly used to measure angles between non-parallel lines, * angles of arcs, or any angular measurement that requires three reference points. */ var AcDb3PointAngularDimension = /** @class */ (function (_super) { __extends(AcDb3PointAngularDimension, _super); /** * Creates a new three-point angular dimension. * * @param centerPoint - The center point of the angle being measured. This is typically * the vertex where the two lines or edges meet * @param xLine1Point - The first extension line end point. This defines one of the * lines or edges being measured * @param xLine2Point - The second extension line end point. This defines the other * line or edge being measured * @param arcPoint - A point on the arc that represents the angle being measured. * This point helps determine the direction and extent of the angle * @param dimText - Optional custom dimension text to display instead of the calculated * angle value. If null, the calculated angle will be displayed * @param dimStyle - Optional name of the dimension style table record to use for * formatting. If null, the current default style will be used */ function AcDb3PointAngularDimension(centerPoint, xLine1Point, xLine2Point, arcPoint, dimText, dimStyle) { if (dimText === void 0) { dimText = null; } if (dimStyle === void 0) { dimStyle = null; } var _this = _super.call(this) || this; _this._centerPoint = new AcGePoint3d().copy(centerPoint); _this._xLine1Point = new AcGePoint3d().copy(xLine1Point); _this._xLine2Point = new AcGePoint3d().copy(xLine2Point); _this._arcPoint = new AcGePoint3d().copy(arcPoint); _this.dimensionText = dimText; // TODO: Set it to the current default dimStyle within the AutoCAD editor if dimStyle is null _this.dimensionStyleName = dimStyle; return _this; } Object.defineProperty(AcDb3PointAngularDimension.prototype, "arcPoint", { /** * Gets or sets a point on the arc that represents the angle being measured. * * This point is used to determine the direction and extent of the angle measurement. * It helps define which side of the angle should be measured and how the dimension * arc should be drawn. * * @returns The arc point that defines the angle measurement */ get: function () { return this._arcPoint; }, set: function (value) { this._arcPoint.copy(value); }, enumerable: false, configurable: true }); Object.defineProperty(AcDb3PointAngularDimension.prototype, "centerPoint", { /** * Gets or sets the center point of the angle being measured. * * The center point is the vertex where the two lines or edges meet. This point * serves as the reference for measuring the angle between the two extension lines. * * @returns The center point of the angle */ get: function () { return this._centerPoint; }, set: function (value) { this._centerPoint.copy(value); }, enumerable: false, configurable: true }); Object.defineProperty(AcDb3PointAngularDimension.prototype, "xLine1Point", { /** * Gets or sets the first extension line end point. * * This point defines one of the lines or edges being measured. The extension line * extends from this point to the center point, helping to clearly identify the * first reference line for the angle measurement. * * @returns The first extension line end point */ get: function () { return this._xLine1Point; }, set: function (value) { this._xLine1Point.copy(value); }, enumerable: false, configurable: true }); Object.defineProperty(AcDb3PointAngularDimension.prototype, "xLine2Point", { /** * Gets or sets the second extension line end point. * * This point defines the other line or edge being measured. The extension line * extends from this point to the center point, helping to clearly identify the * second reference line for the angle measurement. * * @returns The second extension line end point */ get: function () { return this._xLine2Point; }, set: function (value) { this._xLine2Point.copy(value); }, enumerable: false, configurable: true }); Object.defineProperty(AcDb3PointAngularDimension.prototype, "geometricExtents", { /** * Gets the geometric extents (bounding box) of this dimension entity. * * The geometric extents define the minimum bounding box that completely contains * the dimension entity, including all its components like extension lines, * dimension lines, arrows, and text. * * @returns A 3D bounding box containing the dimension entity * @inheritdoc */ get: function () { // TODO: Finish it return new AcGeBox3d(); }, enumerable: false, configurable: true }); /** The entity type name */ AcDb3PointAngularDimension.typeName = '3PointAngularDimension'; return AcDb3PointAngularDimension; }(AcDbDimension)); export { AcDb3PointAngularDimension }; //# sourceMappingURL=AcDb3PointAngularDimension.js.map