You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24191 lines
652 KiB

4 weeks ago
// Generated by dts-bundle-generator v6.13.0
import { DetailedResult, DynamicInputType, McEdGetPointWorldDrawObject, MrxDbgUiPrBaseReturn, MrxDbgUiPrPoint, MxCursorType, MxDbEntity, MxDrawObject } from 'mxdraw';
import * as THREE from 'three';
/**
* Base64
* @param str
* @return Base64
*/
export declare function b64Encode(str: string): string;
/**
* Base64
* @param str Base64
* @returns
*/
export declare function b64Decode(str: string): string;
export type FileTypes = {
description?: string;
accept: {
[type: string]: string[];
};
}[];
/**
* Chrome86 Edge 86 Opera 72 iE10等较低版本的浏览器
*/
export declare function saveAsFileDialog({ blob, filename, types }: {
blob: Blob;
filename?: string;
types?: FileTypes;
}): Promise<(FileSystemFileHandle & {
createWritable: () => Promise<WritableStreamDefaultWriter<any>>;
}) | undefined>;
/**
*
* @param blob Blob
* @param filename
*/
export declare function downloadFile(blob: any, filename: string): void;
/**
* URL
* @param url URL
* @param filename
*/
export declare function downloadFileFromUrl(url: string, filename: string): void;
/**
* URL中获取文件json字符串
* @param url URL
* @returns json字符串
*/
export declare const getJsonFromUrl: (url: string) => Promise<any>;
/**
* URL中获取文件
* @param url URL
* @returns
*/
export declare const getFileFromUrl: (url: string) => Promise<Response | undefined>;
/**
* @param strId ID ID名称
* @param str
* */
export declare function _ML_String(strId: string, str: string): string;
/**
*
* @param val
* @returns
*/
export declare function IsZero(val: number): boolean;
/**
* URL
* @param memoryData
* @param url URL
* @param filename
* @param retCall
* @param param
*/
export declare function postMemoryFile(memoryData: any, url: string, filename: string, retCall: (code: number, message: string) => void, param?: any): void;
/**
* IndexedDBIndexed Database URL
* @param filekey IndexedDB key
* @param url URL
* @param retCall
* @param param
*/
export declare function postEmscriptenIndexedDBFile(filekey: string, url: string, retCall: (code: number, message: string) => void, param?: any): void;
export declare function createCursor(cursorSize?: number, targetFrameSize?: number, color?: string): any;
export declare const MxTools: {
b64Encode: typeof b64Encode;
b64Decode: typeof b64Decode;
saveAsFileDialog: typeof saveAsFileDialog;
downloadFile: typeof downloadFile;
downloadFileFromUrl: typeof downloadFileFromUrl;
getJsonFromUrl: (url: string) => Promise<any>;
getFileFromUrl: (url: string) => Promise<Response | undefined>;
_ML_String: typeof _ML_String;
IsZero: typeof IsZero;
postEmscriptenIndexedDBFile: typeof postEmscriptenIndexedDBFile;
postMemoryFile: typeof postMemoryFile;
createCursor: typeof createCursor;
};
/**
* Rx
*/
export declare class McRxObject {
/**
*
*/
imp: any;
/**
*
* @param imp
* @example
* ```ts
* import { McRxObject } from "mxcad"
*
let obj = new McRxObject();
* ```
*/
constructor(imp?: any);
/**
*
* @param imp
*/
protected constructor_MxCADResbuf(imp: any): void;
/**
*
* @returns
* @example
* ```ts
* import { McRxObject } from 'mxcad';
*
* let obj = new McRxObject();
* let imp = obj.getImp();
* ```
*/
getImp(): any;
/**
*
* @param imp
* @example
* ```ts
* import { McRxObject } from 'mxcad';
*
* let obj = new McRxObject();
* obj.initTempObject()
* ```
*/
initTempObject(imp: any): void;
/**
*
* @returns
* @example
* ```ts
* import { McRxObject } from 'mxcad';
*
* let obj = new McRxObject();
* console.log(obj.objectName);
* ```
*/
get objectName(): string;
/**
* DXF组码的类型名AutoCAD中的DXF组码是一样
* 线McDbLineDXF0组码值: LINE,DXF0组码值可以用来构造集时的类型过滤
*/
get dxf0(): string;
/**
* JSON
* @returns JSON
* @example
* ```ts
* import { McRxObject } from 'mxcad';
*
* let obj = new McRxObject();
* const json = obj.getJson()
* ```
*/
getJson(): string;
/**
* JSON
* @param str JSON
* @returns
* @example
* ```ts
* import { McRxObject } from 'mxcad';
*
* let obj = new McRxObject();
* const res = obj.setJson('{"key": "value"}');
* console.log(res)
* ```
*/
setJson(str: string): boolean;
/**
* @param sObjectName
* @returns
* @example
* ```ts
* import { McRxObject } from 'mxcad';
*
* let obj = new McRxObject();
* let isKind = obj.isKindOf('SomeObjectType');
* console.log(isKind); // 输出: true 或 false
* ```
*/
isKindOf(sObjectName: string): boolean;
/**
*
* @example
* ```ts
* import { McRxObject } from 'mxcad';
*
* let obj = new McRxObject();
* console.log(obj.isNull()); // 输出: true 或 false
* ```
* */
isNull(): any;
}
/**
* McObjectIdType
*
* @remarks
* - kMxCAD CAD
* - kMxDraw
* - kInvalid
*/
export declare enum McObjectIdType {
/** CAD 对象 */
kMxCAD = 0,
/** 绘图对象 */
kMxDraw = 1,
/** 无效对象 */
kInvalid = 2
}
/**
* McObjectId类表示一个模型对象的唯一标识符
*/
export declare class McObjectId {
/** 对象ID */
id: number;
/** 对象类型 */
type: McObjectIdType;
/**
* McObjectId实例
* @param id
* @param type
*/
constructor(id?: number, type?: McObjectIdType);
/**
* id是否有效.
* @returns
* @example
* ```ts
* // 假设objectId为一个模型对象id
* const res = objectId.isValid();
* console.log(res)
* ```
*/
isValid(): boolean;
/**
* id是否为NULL.
* @return
* @example
* ```ts
* // 假设objectId为一个模型对象id
* const res = objectId.isNull();
* console.log(res)
* ```
*/
isNull(): boolean;
/**
* id是指向的对像.
* @return
* @example
* ```ts
* // 假设objectId为一个模型对象id
* const res = objectId.isErase();
* console.log(res)
* ```
*/
isErase(): boolean;
/**
*
* @param isErase
* @example
* ```ts
* // 假设objectId为一个模型对象id
* objectId.erase();
* ```
*/
erase(isErase?: boolean): void;
/**
* MxCAD McDbObject对象
* @returns
* @example
* ```ts
* // 假设objectId为一个模型对象id
* const obj = objectId.getMcDbObject();
* ```
*/
getMcDbObject(): McDbObject | null;
/**
*
* @param className
* @example
* ```ts
* import { McDbLine, McGePoint3d, MxCpp } from 'mxcad';
*
* const line = new McDbLine(new McGePoint3d(0,0,0),new McGePoint3d(20,20,0) );
* const objectId = MxCpp.getCurrentCAD().drawEntity(line);
* console.log(objectId.isKindOf('McDbLine'))
* ```
*/
isKindOf(className: string): boolean;
/**
* MxCAD McDbEntity
* @example
* ```ts
* // 假设objectId为一个图形对象id
* const ent = objectId.getMcDbEntity();
* ```
*/
getMcDbEntity(): McDbEntity | null;
/**
* MxCAD McDbCurve
* @example
* ```ts
* // 假设objectId为一个曲线对象id
* const curve = objectId.getMcDbCurve();
* ```
*/
getMcDbCurve(): McDbCurve | null;
/**
* MxCAD
* @example
* ```ts
* // 假设objectId为一个块对象id
* const blkRecord = objectId.getMcDbBlockTableRecord();
* ```
*/
getMcDbBlockTableRecord(): McDbBlockTableRecord | null;
/**
* MxCAD
* @example
* ```ts
* // 假设objectId为一个图层对象id
* const layerRecord = objectId.getMcDbLayerTableRecord();
* ```
*/
getMcDbLayerTableRecord(): McDbLayerTableRecord | null;
/**
* MxCAD
* @example
* ```ts
* ```
*/
getMcDbDimStyleTableRecord(): McDbDimStyleTableRecord | null;
/**
* MxCAD 线
* @example
* ```ts
* // 假设objectId为一个线型对象id
* const lineTypeRecord = objectId.getMcDbLinetypeTableRecord();
* ```
*/
getMcDbLinetypeTableRecord(): McDbLinetypeTableRecord | null;
/**
* MxCAD
* @example
* ```ts
* // 假设objectId为一个文字样式id
* const textStyleRecord = objectId.getMcDbTextStyleTableRecord();
* ```
*/
getMcDbTextStyleTableRecord(): McDbTextStyleTableRecord | null;
/**
* MxCAD McDbDimension
* @example
* ```ts
* // 假设objectId为一个标注id
* const dim = objectId.getMcDbDimension();
* ```
*/
getMcDbDimension(): McDbDimension | null;
/**
*
* @example
* ```ts
* // 假设objectId为一个自定义实体id
* const customEnt = objectId.getMcDbCustomEntity();
* ```
*/
getMcDbCustomEntity(): McDbCustomEntity | null;
/**
*
* @returns
* @example
* ```ts
* // 假设objectId为一个对象id
* const obj_clone = objectId.clone();
* ```
*/
clone(): McDbObject | null;
/**
* id指向的对象名称.
* @example
* ```ts
* // 假设objectId为一个对象id
* const obj_name = objectId.getObjectName();
* ```
*/
getObjectName(): string;
/**
* MxDraw对象
* @example
* ```ts
* // 假设objectId为一个对象id
* const mx_obj = objectId.getMxDbEntity();
* ```
*/
getMxDbEntity(): MxDbEntity | null;
/**
*
* @example
* ```ts
* // 假设objectId为一个对象id
* const def = objectId.getMcDbRasterImageDef();
* ```
*/
getMcDbRasterImageDef(): McDbRasterImageDef | null;
/**
*
* @example
* ```ts
* // 假设objectId为一个对象id
* const dic = objectId.getMcDbDictionary();
* ```
*/
getMcDbDictionary(): McDbDictionary | null;
/**
*
* @example
* ```ts
* // 假设objectId为一个对象id
* const Xrecord = objectId.getMcDbXrecord();
* ```
*/
getMcDbXrecord(): McDbXrecord | null;
}
/**
* Id
*/
export declare class McDbObject extends McRxObject {
/**
*
* @param imp
* @example
* ```ts
* import { McDbObject } from "mxcad";
*
* const obj = new McDbObject()
* ```
*/
constructor(imp?: any);
/**
* ID
* @returns ID
* @example
* ```ts
* import { McDbObject } from "mxcad";
* const id = obj.getObjectID();
* ```
*/
getObjectID(): McObjectId;
/**
*
* @returns
* @example
* ```ts
* //假设obj为一个数据库对象
* const res = obj.erase();
* console.log(res);
* ```
*/
erase(): boolean;
/**
*
* @example
* ```ts
* //假设obj为一个数据库对象
* const res = obj.isErased();
* console.log(res);
* ```
*/
isErased(): boolean;
/**
*
* @example
* ```ts
* //假设obj为一个数据库对象
* const res = obj.unErase();
* console.log(res);
* ```
*/
unErase(): boolean;
/**
*
* @returns
* @example
* ```ts
* //假设obj为一个数据库对象
* const obj_clone = obj.clone();
* ```
*/
clone(): McDbObject | null;
/**
*
* @return
* @example
* ```ts
* //假设obj为一个数据库对象
* const handle = obj.getHandle();
* ```
*/
getHandle(): string;
/**
*
* @return
* @example
* ```ts
* //假设obj为一个数据库对象
* const data = obj.getDatabase();
* ```
*/
getDatabase(): McDbDatabase;
/**
* id
* @example
* ```ts
* //假设obj为一个数据库对象
* const id = obj.getOwnerID();
* ```
*/
getOwnerID(): number;
/**
* .
* @return
* @example
* ```ts
* //假设obj为一个数据库对象
* const id = obj.getOwnerID();
* ```
*/
getExtensionDictionary(): McDbDictionary;
/**
* .
* @example
* ```ts
* //假设obj为一个数据库对象
* const res = obj.isHaveExtensionDictionary();
* ```
*/
isHaveExtensionDictionary(): boolean;
/**
* .
* @example
* ```ts
* //假设obj为一个数据库对象
* const res = obj.createExtensionDictionary();
* ```
*/
createExtensionDictionary(): boolean;
/**
* ID
* @example
* ```ts
* //假设obj为一个数据库对象
* const id = obj.getDatabaseIndexId();
* ```
*/
getDatabaseIndexId(): number;
/**
* @param iIndex
* @param dXOffset X轴偏移量
* @param dYOffset Y轴偏移量
* @param dZOffset Z轴偏移量
* @example
* ```ts
* //假设obj为一个数据库对象
* obj.moveGripPointsAt(1,10,10,10);
* ```
*/
moveGripPointsAt(iIndex: number, dXOffset: number, dYOffset: number, dZOffset: number): any;
/**
*
* @example
* ```ts
* //假设obj为一个数据库对象
* const ptArr = obj.getGripPoints();
* ```
*/
getGripPoints(): McGePoint3dArray;
/**
* @internal
* MxCAD辅助,使
* ```
*/
tempRelationObject(): number;
/**
* @internal
* MxCAD辅助,使
* ```
*/
freeTempRelationObject(): void;
/**
*
*
* @example
* ```ts
* //假设obj为一个数据库对象
* obj.assertObjectModification()
* ```
*/
assertObjectModification(autoUndo?: boolean): number;
}
/** McDbObject 的一个数组,该数组存储了多个 McDbObject 对象的引用。 */
export declare class McDbObjectArray {
/** 对象数组 */
aryVal: McDbObject[];
/**
*
* @param imp
* @example
* ```ts
import { McDbObjectArray } from "mxcad";
// 创建一个 McDbObjectArray 实例
const objectArray = new McDbObjectArray();
* ```
*/
constructor(imp?: any);
/**
*
* @example
* ```ts
import { McDbObjectArray } from "mxcad";
// 创建一个 McDbObjectArray 实例
const objectArray = new McDbObjectArray();
objectArray.forEach((val: McDbObject, index: number) => {
console.log(`Object at index ${index}:`, val);
});
* ```
*/
forEach(call: (val: McDbObject, index: number) => void): void;
/**
*
* @example
* ```ts
import { McDbObjectArray } from "mxcad";
// 创建一个 McDbObjectArray 实例
const objectArray = new McDbObjectArray();
const length = objectArray.length();
console.log("Length of the array:", length);
* ```
*/
length(): number;
/**
*
* @example
* ```ts
import { McDbObjectArray } from "mxcad";
// 创建一个 McDbObjectArray 实例
const objectArray = new McDbObjectArray();
const isEmpty = objectArray.empty();
console.log("Is the array empty?", isEmpty);
* ```
*/
empty(): boolean;
}
/**
*
*/
export declare class McGePoint3d {
/**
*
* @example
* ```ts
* const origin = McGePoint3d.kOrigin;
* ```
* */
static kOrigin: McGePoint3d;
/** 内部实现对象 */
imp: any;
/**
*
* @param dX X
* @param dY Y
* @param dZ Z
* @example
* ```ts
* import { McGePoint3d } from 'mxcad'
*
* const point = new McGePoint3d(20,10,0);
* ```
*/
constructor(dX?: number | object, dY?: number, dZ?: number);
/**
* THREE.Vector3
* @return THREE.Vector3实例对象
* @example
* ```ts
* import { McGePoint3d } from "mxcad";
* const pt = new McGePoint3d(20,10,0);
* const pt_vec = pt.toVector3();
* ```
*/
toVector3(): THREE.Vector3;
/** three.js
* @example
* ```ts
* import { McGePoint3d } from "mxcad";
* import THREE from "three";
*
* const pt_vec = new THREE.Vector3(20,50,0);
* const pt = pt_vec.setFromVector3();
* ```
*/
setFromVector3(val: THREE.Vector3): this;
/**
*
* @param val
* @return
* @example
* ```ts
* import { McGePoint3d } from "mxcad"
*
* const point1 = new McGePoint3d(20,10,0);
* const point2 = new McGePoint3d();
* point2.copy(point1);
* ```
*/
copy(val: McGePoint3d): this;
/**
* 使
* @param leftSide
* @returns
* @example
* ```ts
* import { McGePoint3d, McGeVector3d, McGeMatrix3d } from "mxcad"
*
* const point = new McGePoint3d(20,10,0);
let matrix = new McGeMatrix3d();
matrix.setToTranslation(new McGeVector3d(10,10,0));//平移
point.transformBy(matrix);
* ```
*/
transformBy(leftSide: McGeMatrix3d): this;
/**
*
* @param vec
* @return
* @example
* ```ts
* import { McGePoint3d, McGeVector3d } from "mxcad";
*
* const pt1 = new McGePoint3d(20,10,0);
* const pt = pt1.clone().addvec(new McGeVector3d(10,10,0))
* ```
*/
addvec(vec: McGeVector3d): this;
/**
*
* @param vec
* @return
*/
av(vec: McGeVector3d): this;
/**
*
* @param vec
* @return
* @example
* ```ts
* import { McGePoint3d, McGeVector3d } from "mxcad";
*
* const pt1 = new McGePoint3d(20,10,0);
* const pt = pt1.clone().subvec(new McGeVector3d(10,10,0));
* ```
*/
subvec(vec: McGeVector3d): this;
/**
*
* @param vec
* @return
*/
sv(vec: McGeVector3d): this;
/**
*
* @param pt
* @return
* @example
* ```ts
* import { McGePoint3d } from "mxcad";
*
* const pt1 = new McGePoint3d(20,10,0);
* const pt2 = new McGePoint3d(50,20,0);
* const vec = pt1.sub(pt2);
* ```
*/
sub(pt: McGePoint3d): McGeVector3d;
/**
*
* @param pnt
* @return
* @example
* ```ts
* import { McGePoint3d } from "mxcad";
*
* const pt1 = new McGePoint3d(20,10,0);
* const pt2 = new McGePoint3d(50,20,0);
* const dist = pt1.distanceTo(pt2);
* ```
*/
distanceTo(pnt: McGePoint3d): number;
/**
*
* @param pnt
* @return
* @example
* ```ts
* import { McGePoint3d } from "mxcad"
*
* const pt1 = new McGePoint3d(10,20,0);
* const pt2 = new McGePoint3d(10,10,0);
* const res = pt1.isEqualTo(pt2);
* console.log(res)//输出false
* ```
*/
isEqualTo(pnt: McGePoint3d): boolean;
/**
*
* @return
* @example
* ```ts
* import { McGePoint3d } from "mxcad"
*
* const pt1 = new McGePoint3d(10,10,0);
* const pt2 = pt1.clone();
* ```
*/
clone(): McGePoint3d;
/**
*
* @return
*/
c(): McGePoint3d;
/**
* X
* @param val X轴坐标值
* @example
* ```ts
* import { McGePoint3d } from "mxcad'
*
* const point = new McGePoint3d();
* point.x = 10;
* console.log(point.x)//输出10
* ```
*/
get x(): number;
set x(val: number);
/**
* Y
* @param val Y轴坐标值
* @example
* ```ts
* import { McGePoint3d } from "mxcad'
*
* const point = new McGePoint3d();
* point.y = 10;
* console.log(point.y)//输出10
* ```
*/
get y(): number;
set y(val: number);
/**
* Z
* @param val Z轴坐标值
* @example
* ```ts
* import { McGePoint3d } from "mxcad'
*
* const point = new McGePoint3d();
* point.z = 10;
* console.log(point.z)//输出10
* ```
*/
get z(): number;
set z(val: number);
}
/**
*
* @example
* ```ts
* //求失量与X轴的夹角
* const angle1 = vetT.angleTo2(McGeVector3d.McGeVector3d.kXAxis ,McGeVector3d.kNegateZAxis)
* ```
* ```ts
* //求出vetFx逆时针到vetT的角度
* const angle2 = vetFx.angleTo2(vetT, McGeVector3d.kZAxis)
* ```
* ```ts
* //判断向量vetT在向量VetFX的左边,还是在右边的调用
* const angle3 = vetFx.angleTo2(vetT, McGeVector3d.kZAxis);
if(angle >= 0.0 && angle <= PI ){
//向量vetT在vetFX的左边.
} else {
//向量vetT在vetFX的右边.
}
// 或
if (vetFX.dotProduct(vetT.perpVector()) < 0){
// vetFX在vetT的左边。
}
* ```
*/
export declare class McGeVector3d {
/**
* X轴单位向量, X
* @example
* ```ts
* import { McGeVector3d } from "mxcad"
*
* const x_vec = McGeVector3d.kXAxis;
* ```
* */
static kXAxis: McGeVector3d;
/**
* Y轴单位向量, Y
* @example
* ```ts
* import { McGeVector3d } from "mxcad"
*
* const y_vec = McGeVector3d.kYAxis;
* ```
*/
static kYAxis: McGeVector3d;
/**
* Z轴单位向量, Z
* @example
* ```ts
* import { McGeVector3d } from "mxcad"
*
* const y_vec = McGeVector3d.kZAxis;
* ```
*/
static kZAxis: McGeVector3d;
/**
* Z轴单位向量, Z
* @example
* ```ts
* import { McGeVector3d } from "mxcad"
*
* const zNegate_vec = McGeVector3d.kNegateZAxis;
* ```
*/
static kNegateZAxis: McGeVector3d;
/** 内部实现对象 */
imp: any;
/**
*
* @param dX X
* @param dY Y
* @param dZ Z
* @example
* ```ts
* import { MdGeVector3d } from "mxcad";
*
* const vec = new MdGeVector3d(20,10,0)
* ```
*/
constructor(dX?: number | object, dY?: number, dZ?: number);
/** THREE.Vector3
* @example
* ```ts
* import { McGeVector3d } from "mxcad";
*
* const vec = new McGeVector3d(20,10,0);
* const v = vec.toVector3();
* ```
* */
toVector3(): THREE.Vector3;
/**
*
* @param val
* @return
* @example
* ```ts
* import { McGeVector3d } from "mxcad"
*
* const vec1 = new McGeVector3d(20,10,0);
* const vec2 = new McGeVector3d();
* vec2.copy(vec1);
* ```
*/
copy(val: McGeVector3d): this;
/**
*
* @return
* @example
* ```ts
* import { McGeVector3d } from "mxcad"
*
* const vec1 = new McGeVector3d(20,10,0);
* const vec2 = vec1.clone();
* ```
*/
clone(): McGeVector3d;
/**
*
* @return
*/
c(): McGeVector3d;
/**
* @param ang
* @param axis
* @example
* ```ts
* import { McGeVector3d } from "mxcad";
*
* const vec = new McGeVector3d(20,10,0);
* vec.rotateBy(Math.PI * 0.5);
* ```
* */
rotateBy(ang: number, axis?: McGeVector3d): this;
/**
*
* @example
* ```ts
* import { McGeVector3d } from "mxcad";
*
* const vec = new McGeVector3d(20,10,0);
* vec_neg = vec.clone().negate()
* ```
* */
negate(): this;
/**
*
* @example
* ```ts
* import { McGeVector3d } from "mxcad";
*
* const vec = new McGeVector3d(20,10,0);
* vec_perp = vec.clone().perpVector()
* ```
* */
perpVector(): this;
/** [0, Pi]
* @example
* ```ts
* import { McGeVector3d } from "mxcad";
*
* const vec1 = new McGeVector3d(20,10,0);
* const vec2 = new McGeVector3d(50,0,0);
* const angle = vec1.angleTo1(vec2);
* ```
* */
angleTo1(vec: McGeVector3d): number;
/** [0, 2*Pi]
* @example
* ```ts
* import { McGeVector3d } from "mxcad";
*
* const vec1 = new McGeVector3d(20,10,0);
* const angle = vec1.angleTo2(McGeVector3d.kXAxis, McGeVector3d.kNegateZAxis);
* ```
* */
angleTo2(vec: McGeVector3d, refVec?: McGeVector3d): number;
/**
*
* @return
* @example
* ```ts
* import { McGeVector3d } from "mxcad";
*
* const vec1 = new McGeVector3d(20,10,0);
* vec1.normalize();
* ```
* */
normalize(): this;
/**
*
* @return
* @example
* ```ts
* import { McGeVector3d } from "mxcad";
*
* const vec1 = new McGeVector3d(20,10,0);
* const length = vec1.length();
* ```
* */
length(): number;
/**
*
* @return
* @example
* ```ts
* import { McGeVector3d } from "mxcad";
*
* const vec1 = new McGeVector3d(20,10,0);
* const res = vec1.isUnitLength();
* console.log(res)//输出false
* ```
* */
isUnitLength(): boolean;
/**
*
* @return
* @example
* ```ts
* import { McGeVector3d } from "mxcad";
*
* const vec1 = new McGeVector3d(20,10,0);
* const res = vec1.isZeroLength();
* console.log(res)//输出false
* ```
* */
isZeroLength(): boolean;
/**
*
* @param vec
* @return
* @example
```ts
//判断两个向量方向相同还是相反
const db = vec1.dotProduct(vec2);
if(db < 0 ){
//向量返向.
}
// 两个向量点乘如果等于0,表示向量垂直。
// 两个向量点乘如果等于1,表示向量方向完全向同。
// 两个向量点乘如果等于-1,表示向量方向完全反向。
```
* */
dotProduct(vec: McGeVector3d): number;
/**
*
* @return
* @example
* ```ts
* import { McGeVector3d } from "mxcad";
*
* const vec1 = new McGeVector3d(20,10,0);
* const vec2 = new McGeVector3d(10,10,0);
* const vec = vec2.crossProduct(vec1)
* ```
* */
crossProduct(vec: McGeVector3d): McGeVector3d;
/**
*
* @param vec
* @return
* ```ts
* import { McGeVector3d } from "mxcad";
*
* const vec1 = new McGeVector3d(20,10,0);
* const vec2 = new McGeVector3d(10,10,0);
* const res = vec1.isEqualTo(vec2)
* ```
* */
isEqualTo(vec: McGeVector3d): boolean;
/**
*
* @param val
* @return
* @example
* ```ts
* import { McGeVector3d } from "mxcad";
*
* const vec1 = new McGeVector3d(20,10,0);
* const vec = vec1.clone().normalize().mult(20)
* ```
* */
mult(val: number): this;
/**
* X
* @param val x轴坐标
* @example
* ```ts
* import { McGeVector3d } from "mxcad";
*
* const vec1 = new McGeVector3d();
* vec1.x = 10;
* ```
*/
get x(): number;
set x(val: number);
/**
* Y
* @param val y轴坐标
* @example
* ```ts
* import { McGeVector3d } from "mxcad";
*
* const vec1 = new McGeVector3d();
* vec1.y = 10;
* ```
*/
get y(): number;
set y(val: number);
/**
* Z
* @param val z轴坐标
* @example
* ```ts
* import { McGeVector3d } from "mxcad";
*
* const vec1 = new McGeVector3d();
* vec1.z = 0;
* ```
*/
get z(): number;
set z(val: number);
}
/** 表示三维矩阵对象 */
export declare class McGeMatrix3d {
/** 乘法的单位矩阵 */
static kIdentity: McGeMatrix3d;
/** 内部实现对象 */
imp: any;
/**
*
* @param imp
* @example
* ```ts
* import { McGeMatrix3d } from "mxcad"
*
* const matrix = new McGeMatrix3d()
* ```
*/
constructor(imp?: object);
/**
*
* @param val
* @return
* ```ts
* // matrix1 一个三维矩阵对象
* const matrix = new McGeMatrix3d();
* matrix.copy(matrix1)
* ```
*/
copy(val: McGeMatrix3d): this;
/**
*
* @return
* @example
* ```ts
* // matrix1 一个三维矩阵对象
* const matrix = matrix1.clone()
* ```
*/
clone(): McGeMatrix3d;
/**
*
* @example
* ```ts
* // matrix 表示一个三维矩阵对象
* matrix.setToIdentity()
* ```
*/
setToIdentity(): this;
/**
*
* @param leftSide
* @return
* @example
* ```ts
* // matrix1 表示一个三维矩阵对象
* const matrix = new McGeMatrix3d()
* matrix.preMultBy(matrix1);
* ```
*/
preMultBy(leftSide: McGeMatrix3d): this;
/**
*
* @return
* @example
* ```ts
* // matrix1 表示一个三维矩阵对象
* const matrix = new McGeMatrix3d()
* matrix.postMultBy(matrix1);
* ```
*/
postMultBy(rightSide: McGeMatrix3d): this;
/**
*
* @param mat1
* @param mat2
* @example
* ```ts
* // matrix1 matrix2 表示两个三维矩阵对象
* const matrix = new McGeMatrix3d()
* matrix.setToProduct(matrix1, matrix2);
* ```
*/
setToProduct(mat1: McGeMatrix3d, mat2: McGeMatrix3d): this;
/**
*
* @example
* ```ts
* // matrix表示一个三维矩阵对象
* const mat_invert = matrix.clone().invert();
* ```
*/
invert(): this;
/**
*
* @returns true false
* @example
* ```ts
* // matrix表示一个三维矩阵对象
* const res = matrix.isSingular();
* console.log(res)
* ```
*/
isSingular(): boolean;
/**
*
* @example
* ```ts
* // matrix表示一个三维矩阵对象
* const mst_trs = matrix.clone().transposeIt();
* ```
*/
transposeIt(): this;
/**
*
* @param mat
* @returns true false
* @example
* ```ts
* // matrix1 matrix2 表示两个三维矩阵对象
* const res = matrix1.isEqualTo(matrix2);
* console.log(res)
* ```
*/
isEqualTo(mat: McGeMatrix3d): boolean;
/**
*
* @returns
* @example
* ```ts
* // matrix 表示一个三维矩阵对象
* const detNum = matrix.det();
* console.log(detNum)
* ```
*/
det(): number;
/**
*
* @param origin
* @param xAxis X
* @param yAxis Y
* @param zAxis Z
* @example
* ```ts
* import { McGeMatrix3d , McGePoint3d, McGeVector3d} from "mxcad"
*
* const m1 = new McGeMatrix3d()
* m1.setCoordSystem(new McGePoint3d(), new McGeVector3d(), new McGeVector3d(), new McGeVector3d())
* ```
*/
setCoordSystem(origin: McGePoint3d, xAxis: McGeVector3d, yAxis: McGeVector3d, zAxis: McGeVector3d): this;
/**
*
* @param vec
* @example
* ```ts
*import { McGeMatrix3d, McDbEntity } from "mxcad";
let matrix = new McGeMatrix3d();
const event = new McDbEntity();
matrix.setToTranslation(new McGeVector3d(20,10,0));//平移
event.transformBy(matrix);
* ```
*/
setToTranslation(vec: McGeVector3d): this;
/**
*
* @param angle
* @param axis
* @param center
* @example
* ```ts
*import { McGeMatrix3d, McDbEntity } from "mxcad";
let matrix = new McGeMatrix3d();
const event = new McDbEntity();
matrix.setToRotation(Math.PI, McGeVector3d.kZAxis / 180.0, new McGeVector3d(20,10,0));//平移
event.transformBy(matrix);
* ```
*/
setToRotation(angle: number, axis: McGeVector3d, center: McGePoint3d): this;
/**
*
* @param scaleAll
* @param center
* @example
* ```ts
*import { McGeMatrix3d, McDbEntity } from "mxcad";
let matrix = new McGeMatrix3d();
const event = new McDbEntity();
matrix.setToScaling(0.5, new McGeVector3d(0, 0, 0));//平移
event.transformBy(matrix);
* ```
*/
setToScaling(scaleAll: number, center: McGePoint3d): this;
/**
*
* @example
* ```ts
*import { McGeMatrix3d, McDbEntity } from "mxcad";
const matrix = new McGeMatrix3d();
const event = new McDbEntity();
matrix.setMirror(new McGeVector3d(0, 0, 0), new McGeVector3d(20, 0, 0));//平移
event.transformBy(matrix);
* ```
*/
setMirror(pt1: McGePoint3d, pt2: McGePoint3d): this;
/**
*
* @returns
* @example
* ```ts
* // matrix 表示一个三维矩阵对象
* const scaleNum = matrix.scale()
* console.log(scaleNum)
* ```
*/
scale(): number;
/**
*
* @param row
* @param col
* @returns
* @example
* ```ts
* // matrix 表示一个三维矩阵对象
* const data = matrix.getData(2,3)
* console.log(data)
* ```
*/
getData(row: number, col: number): number;
}
/**
*
*/
export declare class McGeLongArray {
/** 内部实现对象 */
imp: any;
/**
*
* @param imp
* @example
* ```ts
* import { McGeLongArray } from "mxcad"
*
// 创建一个新的 McGeLongArray 实例
const myArray = new McGeLongArray();
// 通过传入一个对象初始化 McGeLongArray
const initialValues = { data: [1, 2, 3, 4] };
const myArray2 = new McGeLongArray(initialValues);
* ```
*/
constructor(imp?: object);
/**
*
* @param val
* @example
* ```ts
* import { McGeLongArray } from "mxcad"
*
const array1 = new McGeLongArray();
const array2 = new McGeLongArray();
array2.append(10);
array2.append(20);
// 复制 array2 的值到 array1
array1.copy(array2);
* ```
*/
copy(val: McGeLongArray): this;
/**
* McObjectId
* @param aryId McObjectId
* @example
* ```ts
* //objectIdArray 为一个对象id数组
const array = new McGeLongArray();
array.copyFormAryId(objectIdArray);
* ```
*/
copyFormAryId(aryId: McObjectId[]): this;
/**
*
* @param val
* @example
* ```ts
* import { McGeLongArray } from "mxcad";
*
const array = new McGeLongArray();
array.append(5);
array.append(10)
* ```
*/
append(val: number): void;
/**
*
* @return
* @example
* ```ts
* import { McGeLongArray } from "mxcad"
*
const array = new McGeLongArray();
console.log(array.length()); // 输出: 0
* ```
*/
length(): number;
/**
*
* @param index
* @return
* @example
* ```ts
* import { McGeLongArray } from "mxcad"
*
const array = new McGeLongArray();
array.append(5);
array.append(10);
console.log(array.at(0)); // 输出: 5
console.log(array.at(1)); // 输出: 10
* ```
*/
at(index: number): number;
/**
*
* @param index
* @param val
* @example
* ```ts
* import { McGeLongArray } from "mxcad"
*
const array = new McGeLongArray();
array.append(5);
array.append(10);
array.setAt(0, 15);
console.log(array.at(0)); // 输出: 15
* ```
*/
setAt(index: number, val: number): void;
/**
*
* @example
* ```ts
* // array为整数数组
* array.clear()
* ```
*/
clear(): void;
/**
*
* @param call
* @example
* ```ts
* import { McGeLongArray } from "mxcad"
*
const array = new McGeLongArray();
array.append(5);
array.append(10);
array.forEach((val, index) => {
console.log(`Index ${index}: Value ${val}`);
});
// 输出:
// Index 0: Value 5
// Index 1: Value 10
* ```
*/
forEach(call: (val: number, index: number) => void): void;
}
/**
*
*/
export declare class McGeStringArray {
/** 内部实现对象 */
imp: any;
/**
*
* @param imp
* @example
* ```ts
* import { McGeStringArray } from "mxcad";
*
// 创建一个新的 McGeStringArray 实例
const myArray = new McGeStringArray();
// 通过传入一个对象初始化 McGeStringArray
const initialValues = { data: ["apple", "banana", "orange"] };
const myArray2 = new McGeStringArray(initialValues);
* ```
*/
constructor(imp?: object);
/**
*
* @example
* ```ts
* import { McGeStringArray } from "mxcad";
*
const array1 = new McGeStringArray();
const array2 = new McGeStringArray();
array2.append("apple");
array2.append("banana");
// 复制 array2 的值到 array1
array1.copy(array2);
* ```
*/
copy(val: McGeStringArray): this;
/**
*
* @param val
* @example
* ```ts
* import { McGeStringArray } from "mxcad";
*
* const array = new McGeStringArray();
array.append("apple");
array.append("banana");
* ```
*/
append(val: string): void;
/**
*
* @return
* @example
* ```ts
* import { McGeStringArray } from "mxcad";
*
* const array = new McGeStringArray();
* console.log(array.length()); // 输出: 0
* ```
*/
length(): number;
/**
*
* @param index
* @return
* @example
* ```ts
* import { McGeStringArray } from "mxcad";
*
const array = new McGeStringArray();
array.append("apple");
array.append("banana");
console.log(array.at(0)); // 输出: "apple"
console.log(array.at(1)); // 输出: "banana"
* ```
*/
at(index: number, decodeFromGb2312?: boolean): string;
/**
*
* @param index
* @param val
* @example
* ```ts
* import { McGeStringArray } from "mxcad";
*
const array = new McGeStringArray();
array.append("apple");
array.append("banana");
array.setAt(0, "orange");
console.log(array.at(0)); // 输出: "orange"
* ```
*/
setAt(index: number, val: string, decodeFromGb2312?: boolean): void;
/**
*
* @param call
* @example
* ```ts
* import { McGeStringArray } from "mxcad";
*
const array = new McGeStringArray();
array.append("apple");
array.append("banana");
array.forEach((val, index) => {
console.log(`Index ${index}: Value ${val}`);
});
// 输出:
// Index 0: Value apple
// Index 1: Value banana
* ```
*/
forEach(call: (val: string, index: number) => void, decodeFromGb2312?: boolean): void;
/**
*
* @example
* ```ts
* import { McGeStringArray } from "mxcad";
*
const array = new McGeStringArray();
array.append("apple");
array.append("banana");
array.clear();
console.log(array.length()); // 输出: 0
* ```
* */
clear(): void;
}
/**
*
*/
export declare class McGePoint3dArray {
/** 内部实现对象 */
imp: any;
/**
*
* @param imp
* @example
* ```ts
* import { McGePoint3dArray, McGePoint3d } from "mxcad";
*
// 创建一个新的 McGePoint3dArray 实例
const myArray = new McGePoint3dArray();
// 通过传入一个对象初始化 McGePoint3dArray
const initialValues = [
new McGePoint3d({ x: 1, y: 2, z: 3 }),
new McGePoint3d({ x: 4, y: 5, z: 6 }),
];
const myArray2 = new McGePoint3dArray(initialValues);
* ```
*/
constructor(imp?: object);
/**
*
* @param val
* @example
* ```ts
* import { McGePoint3d, McGePoint3dArray } from "mxcad"
*
const array1 = new McGePoint3dArray();
const array2 = new McGePoint3dArray();
array2.append(new McGePoint3d({ x: 1, y: 2, z: 3 }));
array2.append(new McGePoint3d({ x: 4, y: 5, z: 6 }));
// 复制 array2 的值到 array1
array1.copy(array2);
* ```
*/
copy(val: McGePoint3dArray | McGePoint3d[]): this;
/**
*
* @param val
* @example
* ```ts
* import { McGePoint3d, McGePoint3dArray } from "mxcad"
*
* const array = new McGePoint3dArray();
array.append(new McGePoint3d({ x: 1, y: 2, z: 3 }));
array.append(new McGePoint3d({ x: 4, y: 5, z: 6 }));
* ```
*/
append(val: McGePoint3d): void;
/**
*
* @return
* @example
* ```ts
* import { McGePoint3dArray } from "mxcad"
*const array = new McGePoint3dArray();
console.log(array.length()); // 输出: 0
* ```
*/
length(): number;
/**
*
* @return
* @example
* ```ts
* import { McGePoint3dArray, McGePoint3d } from "mxcad"
const array = new McGePoint3dArray();
console.log(array.isEmpty()); // 输出: true
array.append(new McGePoint3d({ x: 1, y: 2, z: 3 }));
console.log(array.isEmpty()); // 输出: false
* ```
*/
isEmpty(): boolean;
/**
*
* @param index
* @example
* ```ts
* import { McGePoint3dArray, McGePoint3d } from "mxcad"
*
const array = new McGePoint3dArray();
array.append(new McGePoint3d({ x: 1, y: 2, z: 3 }));
array.append(new McGePoint3d({ x: 4, y: 5, z: 6 }));
const point = array.at(0);
console.log(point); // 输出: McGePoint3d { x: 1, y: 2, z: 3 }
* ```
*/
at(index: number): McGePoint3d;
/**
*
* @param index
* @param val
* @example
* ```ts
* import { McGePoint3dArray, McGePoint3d } from "mxcad"
*
const array = new McGePoint3dArray();
array.append(new McGePoint3d({ x: 1, y: 2, z: 3 }));
array.append(new McGePoint3d({ x: 4, y: 5, z: 6 }));
array.setAt(0, new McGePoint3d({ x: 7, y: 8, z: 9 }));
console.log(array.at(0)); // 输出: McGePoint3d { x: 7, y: 8, z: 9 }
* ```
*/
setAt(index: number, val: McGePoint3d): void;
/**
*
* @example
* ```ts
* import { McGePoint3dArray, McGePoint3d } from "mxcad"
*
const array = new McGePoint3dArray();
array.append(new McGePoint3d({ x: 1, y: 2, z: 3 }));
array.append(new McGePoint3d({ x: 4, y: 5, z: 6 }));
array.clear();
console.log(array.length()); // 输出: 0
* ```
* */
clear(): void;
/**
*
* @param call
* @example
* ```ts
* import { McGePoint3dArray, McGePoint3d } from "mxcad"
*
const array = new McGePoint3dArray();
array.append(new McGePoint3d({ x: 1, y: 2, z: 3 }));
array.append(new McGePoint3d({ x: 4, y: 5, z: 6 }));
array.forEach((point, index) => {
console.log(`Index ${index}: Point ${point}`);
});
// 输出:
// Index 0: Point McGePoint3d { x: 1, y: 2, z: 3 }
// Index 1: Point McGePoint3d { x: 4, y: 5, z: 6 }
* ```
*/
forEach(call: (val: McGePoint3d, index: number) => void): void;
}
/**
*
*/
export declare class McGeDoubleArray {
/** 内部实现对象 */
imp: any;
/**
*
* @param imp
* @example
* ```ts
* import { McGeDoubleArray } from "mxcad"
const array = new McGeDoubleArray();
* ```
*/
constructor(imp?: object);
/**
*
* @param val
* @example
* ```ts
* import { McGeDoubleArray } from "mxcad"
*
// array1 表示一个双精度浮点数数组
const array2 = new McGeDoubleArray();
array2.copy(array1);
// 现在array2与array1具有相同的值
* ```
*/
copy(val: McGeDoubleArray): this;
/**
*
* @param val
* @example
* ```ts
* import { McGeDoubleArray } from "mxcad"
*
// 创建数组实例
const array = new McGeDoubleArray();
array.append(3.14159);
* ```
*/
append(val: number): void;
/**
*
* @return
* @example
* ```ts
* import { McGeDoubleArray } from "mxcad"
const array = new McGeDoubleArray();
const length = array.length();//0
* ```
*/
length(): number;
/**
*
* @param index
* @example
* ```ts
* import { McGeDoubleArray } from "mxcad"
const array = new McGeDoubleArray();
// 获取特定索引位置的值
const value = array.at(2); // 假设索引为2的位置有值
* ```
*/
at(index: number): number;
/**
*
* @param
* @param val
* @example
* ```ts
* import { McGeDoubleArray } from "mxcad"
const array = new McGeDoubleArray();
array.setAt(1, 3.14159); // 将索引为1的位置的值设置为3.14159
* ```
*/
setAt(index: number, val: number): void;
/**
*
* @example
* ```ts
* // array 表示一个McGeDoubleArray数组
array.clear();
* ```
* */
clear(): void;
/**
*
* @param call
* @example
* ```ts
* import { McGeDoubleArray } from "mxcad"
const array = new McGeDoubleArray();
array.append(3.14159);
array.forEach((val,index)=>{
console.log(`Value at index ${index}: ${value}`);
})
* ```
*/
forEach(call: (val: number, index: number) => void): void;
}
/**
*
*/
export declare class McGeBound {
/**
*
* @example
* ```ts
* import { McGeBound, McGePoint3d } from "mxcad"
*
// 创建 McGeBound 实例
const bound = new McGeBound();
// 访问最小点属性并设置其值
bound.minPoint = new McGePoint3d(0, 0, 0);
```
*/
minPoint: McGePoint3d;
/**
*
* @example
* ```ts
* import { McGeBound, McGePoint3d } from "mxcad"
*
// 创建 McGeBound 实例
const bound = new McGeBound();
// 访问最大点属性并设置其值
bound.maxPoint = new McGePoint3d(20, 10, 0);
```
* */
maxPoint: McGePoint3d;
/**
*
* @example
* ```ts
* import { McGeBound } from "mxcad"
*
// 创建 McGeBound 实例
const bound = new McGeBound();
// 访问是否有效属性并设置其值
bound.isValid = true;;
```
* */
isValid: boolean;
/**
*
* @param pts
* @example
* ```ts
* import { McGeBound, McGePoint3d } from "mxcad"
*
const points = [new McGePoint3d(1, 2, 3), new McGePoint3d(4, 5, 6)];
const bound = new McGeBound(points);
* ```
*/
constructor(pts?: McGePoint3dArray | McGePoint3d[]);
/**
*
* @param pt
* @example
* ```ts
* import { McGeBound, McGePoint3d } from "mxcad"
* // 创建 McGeBound 实例
const bound = new McGeBound();
// 添加一个点到边界
const point = new McGePoint3d(3, 4, 5);
bound.addPoint(point);
* ```
*/
addPoint(pt: McGePoint3d): void;
/**
*
* @param pts
* @example
* ```ts
* import { McGeBound } from "mxcad"
*
// 创建 McGeBound 实例
const bound = new McGeBound();
// 创建一组点
const points = [new McGePoint3d(1, 2, 3), new McGePoint3d(4, 5, 6), new McGePoint3d(7, 8, 9)];
// 添加一组点到边界
bound.addPoints(points);
* ```
*/
addPoints(pts: McGePoint3dArray | McGePoint3d[]): void;
}
/** 坐标转换类型 */
export declare class MxCoordConvertType {
/** cad
* @param pt
* @returns
* @example
* ```ts
* import { MxCpp, McGePoint3d } from 'mxcad';
* const mxcad = MxCpp.getCurrentCAD();
* let pt1CAD = mxcad.doc2cad1(new McGePoint3d(20,0,0));
* console.log(pt1CAD)
* ```
*/
doc2cad(pt: McGePoint3d): McGePoint3d;
/** cad
* @param pt
* @returns
* @example
* ```ts
* import { MxCpp, McGePoint3d } from 'mxcad';
* const mxcad = MxCpp.getCurrentCAD();
* let pt1DOC = mxcad.cad2doc(new McGePoint3d(20,0,0));
* console.log(pt1DOC)
* ```
*/
cad2doc(pt: McGePoint3d): McGePoint3d;
/** cad
* @param pt THREE.js点对象
* @returns
* @example
* ```ts
* import { MxCpp, McGePoint3d } from 'mxcad';
* import THREE from "three"
*
* const mxcad = MxCpp.getCurrentCAD();
* let pt = mxcad.doc2cad1(new THREE.Vector3(20, 10));
* console.log(pt)
* ```
*/
doc2cad1(pt: THREE.Vector3): McGePoint3d;
/** cad
* @param x X轴坐标
* @param y Y轴坐标
* @param z Z轴坐标
* @returns
* @example
* ```ts
* import { MxCpp, McGePoint3d } from 'mxcad';
* import THREE from "three"
*
* const mxcad = MxCpp.getCurrentCAD();
* let pt = mxcad.doc2cad1(20, 10, 0);
* console.log(pt)
* ```
*/
doc2cad2(x: number, y: number, z: number): McGePoint3d;
/** cad
* @param pt
* @returns THREE.js点对象
*/
cad2doc1(pt: McGePoint3d): THREE.Vector3;
/** cad
* @param x X轴坐标
* @param y Y轴坐标
* @param z Z轴坐标
* @returns THREE.js点对象
* @example
* ```ts
* import { MxCpp, McGePoint3d } from 'mxcad';
* const mxcad = MxCpp.getCurrentCAD();
* let pt = mxcad.cad2doc2(20,0,0);
* console.log(pt)
* ```
*/
cad2doc2(x: number, y: number, z: number): THREE.Vector3;
}
/** 提供坐标转换方法 */
export declare let MxCoordConvert: MxCoordConvertType;
/**
* CAD()
* @param filter
* @returns CAD过滤器imp
* @example
* ```ts
import { getFilterImp, MxCADResbuf } from 'mxcad';
// 当filter为null时,检索CAD filter
const filterImp1 = getFilterImp();
console.log("Filter Implementation 1:", filterImp1);
// 示例2:在提供filter时检索CAD filter
const filter = new MxCADResbuf(); // Assuming you have a MxCADResbuf object
// MxCADResbuf有一个方法getImp()返回imp
const filterImp2 = getFilterImp(filter);
console.log("Filter Implementation 2:", filterImp2);
* ```
*/
export declare function getFilterImp(filter?: MxCADResbuf | null): any;
/**
* MxCADResbuf AutoCAD resbuf
* @example
* ```ts
// 筛选图纸中的所有文字对象
import { MxCADResbuf } from "mxcad"
// 定义过滤
const filter = new MxCADResbuf();
filter.AddMcDbEntityTypes("TEXT,MTEXT");
// 设置选择,筛选文字对象
let ss = new MxCADSelectionSet();
ss.allSelect(filter);
ss.forEach((id) => {
let ent: any = id.getMcDbEntity();
if (!ent) return;
ent = McDbEntityToJsonObject(ent);
console.log(JSON.stringify(ent));
})
* ```
*/
export declare class MxCADResbuf extends McRxObject {
/**
*
* @param imp
* @example
* ```ts
* import { MxCADResbuf, DxfCode } from "mxcad"
* // 定义过滤器,过滤实体类型:直线,圆弧,圆,多义线
* const filter = new MxCADResbuf([DxfCode.kEntityType, "LINE,ARC,CIRCLE,LWPOLYLINE"]));
* ```
*/
constructor(imp?: any);
/**
* resbuf
* @example
* ```ts
* import { MxCADResbuf } from "mxcad"
* // 定义过滤器
* const filter = new MxCADResbuf()
* filter.AddMcDbEntityTypes("TEXT,MTEXT");
* filter.Clear();
* console.log(filter.GetCount())//输出0
* ```
*/
Clear(): void;
/**
*
* @param call 3val:元素的值type:dxf:元素的数据交换格式
* @example
* ```ts
import {MxCADResbuf} from "mxcad"
//创建MxCADResbuf实例
const cadResbuf = new MxCADResbuf();
cadResbuf.AddPoint(new McGePoint3d(1,2,3));//添加一个point元素
cadResbuf.AddString(Hello);//添加一个字符串元素
cadResbuf.AddDouble (3.14);//添加双精度型数据
cadResbuf.AddLong (42);//添加一个整型数据
//迭代CAD Resbuf实例中的元素
cadResbuf.forEach((val, type, dxf)=>{
console.log("值:",val);
console.log("类型:",type);
console.log("DXF:",DXF);
});
//输出:
//值:{x: 1, y: 2, z: 3}
//类型:5009
// dxf: 10
//值:Hello
//类型:5005
// dxf: 10
//取值:3.14
//类型:5001
// dxf: 10
//取值:42
//类型:5010
// dxf: 10
* ```
*/
forEach(call: (val: any, type: number, dxf: number, index: number) => void): void;
/**
* resbuf
* @returns resbuf
* @example
* ```ts
* import { MxCADResbuf } from "mxcad"
* // 定义过滤器
* const filter = new MxCADResbuf()
* console.log(filter.GetCount())//输出0
* ```
*/
GetCount(): number;
/**
* resbuf double
* @param lItem
* @returns double
* @example
* ```ts
* import { MxCADResbuf } from "mxcad"
* // 定义过滤器
* const filter = new MxCADResbuf()
* console.log(filter.AtDouble(0))
* ```
*/
AtDouble(lItem: number): {
val: number;
ret: boolean;
};
/**
* resbuf long
* @param lItem
* @returns long
* @example
* ```ts
* import { MxCADResbuf } from "mxcad"
* // 定义过滤器
* const filter = new MxCADResbuf()
* console.log(filter.AtLong(0))
* ```
*/
AtLong(lItem: number): {
val: number;
ret: boolean;
};
/**
* resbuf McRxObject
* @param lItem
* @returns
* @example
* ```ts
* import { MxCADResbuf } from "mxcad"
* // 定义过滤器
* const filter = new MxCADResbuf()
* console.log(filter.AtObject(0))
* ```
*/
AtObject(lItem: number): {
val: McDbObject | undefined;
ret: boolean;
};
/**
* McRxObject resbuf
* @param pObj McRxObject示例对象
* @example
* ```ts
* import { MxCADResbuf, McRxObject } from "mxcad"
* // 定义过滤器
* const filter = new MxCADResbuf();
* filter.AddObject( new McRxObject());
* ```
*/
AddObject(pObj: McRxObject): void;
/**
* resbuf ObjectId
* @param lItem
* @returns ObjectId
* @example
* ```ts
* import { MxCADResbuf } from "mxcad
*
* const filter = new MxCADResbuf();
* console.log(filter.AtObjectId(0))
* ```
*/
AtObjectId(lItem: number): {
val: McObjectId;
ret: boolean;
};
/**
* resbuf
* @param lItem
* @returns
* @example
* ```ts
* import { MxCADResbuf } from "mxcad
*
* const filter = new MxCADResbuf();
* console.log(filter.AtString(0))
* ```
*/
AtString(lItem: number, decodeFromGb2312?: boolean): {
val: string;
ret: boolean;
};
/**
* resbuf
* @param lItem
* @returns
* @example
* ```ts
* import { MxCADResbuf } from "mxcad
*
* const filter = new MxCADResbuf();
* console.log(filter.AtPoint(0))
* ```
*/
AtPoint(lItem: number): {
val: McGePoint3d;
ret: boolean;
};
/**
* resbuf
* @param index
* @returns
* @example
* ```ts
* import { MxCADResbuf } from "mxcad"
* // 定义过滤器
* const filter = new MxCADResbuf()
* console.log(filter.ItemDataType(0))
* ```
*/
ItemDataType(index: number): number;
/**
* resbuf DXF值
* @param index
* @returns DXF值
* @example
* ```ts
* import { MxCADResbuf } from "mxcad"
* // 定义过滤器
* const filter = new MxCADResbuf()
* console.log(filter.ItemDataDxf(0))
* ```
*/
ItemDataDxf(index: number): number;
/**
* double resbuf
* @param val double
* @param lDataType
* @returns
* @example
* ```ts
* import { MxCADResbuf } from "mxcad"
* // 定义过滤器
* const filter = new MxCADResbuf()
* filter.AddDouble (3.14);
* ```
*/
AddDouble(val: number, lDataType?: number): number;
/**
* long resbuf
* @param val long
* @param lDataType
* @returns
* @example
* ```ts
* import { MxCADResbuf } from "mxcad"
* // 定义过滤器
* const filter = new MxCADResbuf()
* filter.AddLong (42);
* ```
*/
AddLong(val: number, lDataType?: number): number;
/**
* ObjectId resbuf
* @param val ObjectId
* @param lDataType
* @returns
* @example
* ```ts
* import { MxCADResbuf, McDbObject } from "mxcad"
* // 定义过滤器
* const filter = new MxCADResbuf()
* const objId = new McDbObject();
* filter.AddObjectId (objId);
* ```
*/
AddObjectId(val: number, lDataType?: number): number;
/**
* resbuf
* @param str
* @param lDataType
* @returns
* @example
* ```ts
* import { MxCADResbuf } from "mxcad"
* // 定义过滤器
* const filter = new MxCADResbuf()
* filter.AddString ("测试字符串");
* ```
*/
AddString(str: string, lDataType?: number, decodeFromGb2312?: boolean): number;
/**
* 使
* @param str , : "TEXT,MTEXT"
* @description
* | | |
* | ------- | ------- |
* | TEXT | |
* | MTEXT | |
* | CIRCLE | |
* | ARC | |
* | LINE | 线 |
* | LWPOLYLINE | 线 |
* | INSERT | |
* | ELLIPSE | |
* | SPLINE | 线 |
* | LinkLine | |
* @example
* ```ts
* import { MxCADResbuf } from "mxcad"
* // 定义过滤器
* const filter = new MxCADResbuf()
* filter.AddMcDbEntityTypes ("TEXT,LINE");
* ```
*/
AddMcDbEntityTypes(str: string): any;
/**
* resbuf
* @param pt
* @param lDataType
* @returns
* @example
* ```ts
* import { MxCADResbuf, McGePoint3d } from "mxcad"
* // 定义过滤器
* const filter = new MxCADResbuf()
* filter.AddPoint (new McGePoint3d(10,20,0));
* ```
*/
AddPoint(pt: McGePoint3d, lDataType?: number): number;
/**
* resbuf
* @example
* ```ts
* import { MxCADResbuf } from "mxcad"
* // 定义过滤器
* const filter = new MxCADResbuf()
* filter.AtLong (42);
* filter.RemoveAll();
* ```
*/
RemoveAll(): void;
/**
* resbuf
* @param lItem
* @example
* ```ts
* import { MxCADResbuf } from "mxcad"
* // 定义过滤器
* const filter = new MxCADResbuf()
* filter.AtLong (42);
* filter.Remove(0);
* ```
*/
Remove(lItem: number): void;
/**
*
* @example
* ```ts
* import { MxCADResbuf } from "mxcad"
* // 定义过滤器
* const filter = new MxCADResbuf()
* filter.PrintData("调试信息")
* ```
*/
PrintData(): void;
}
/**
* MxCADUtilityClass
* @example
* ```ts
* import { MxCADUtility, MxCADUiPrPoint } from "mxcad"
* //点选
* const getPoint = new MxCADUiPrPoint()
* const point = await getPoint.go()
* if(!point) return
* let objId = MxCADUtility.findEntAtPoint(point.x, point.y,point.z,-1,filter)
* // 选中对象设置高亮
* MxCADUtility.highlightEntity(objId.id, true)
* console.log(objId)
* ```
*/
export declare class MxCADUtilityClass {
/** 内部实现对象 */
private imp;
constructor();
/**
* eraseObject
* @param lId - ID
* @returns
* @example
* ```ts
* import { MxCADUtility, McGePoint3d } from "mxcad";
*
* const lineId = new McDbLine(new McGePoint3d(0,0,0), new McGePoint3d(20,1,0));
* const res = MxCADUtility.eraseObject(lineId)
* ```
*/
eraseObject(lId: number, isErase?: boolean): boolean;
/**
* highlightEntity
* @param lId - ID
* @param isHighlight - true
* @example
* ```ts
* import { MxCADUtility, McGePoint3d } from "mxcad";
*
* const lineId = new McDbLine(new McGePoint3d(0,0,0), new McGePoint3d(20,1,0));
* MxCADUtility.highlightEntity(lineId, true)
* ```
*/
highlightEntity(lId: number, isHighlight?: boolean): any;
/**
* findEntAtPoint
* @param dX - X
* @param dY - Y
* @param dZ - Z
* @param dSearhRange - -1
* @param filter - null
* @returns ID
* @example
* ```ts
import { MxCADUiPrPoint, MxCADUtility, MxCpp } from "mxcad"
const mxcad = MxCpp.getCurrentCAD();
const getPoint = new MxCADUiPrPoint();
getPoint.setMessage('请选择对象\n');
const point = await getPoint.go();
if (!point) break;
let objId = MxCADUtility.findEntAtPoint(point.x, point.y, point.z, -1, filter);
mxcad.addCurrentSelect(objId);
* ```
*/
findEntAtPoint(dX: number, dY: number, dZ: number, dSearhRange?: number, filter?: MxCADResbuf | null): McObjectId;
/**
* selectEnt
* @param strPrompt - null
* @param filter - null
* @param isSelectMxDraw true
* @param init ( {@link https://mxcadx.gitee.io/mxdraw_api_docs/classes/MrxDbgUiPrPoint.html | mxdraw取点类}时触发,得到取点实例)
* @param callbackGetPoint
* @returns Promise ID
* @example
* ```ts
* import { MxCADUtility, MxCADResbuf } from "mxcad";
*
* // 定义过滤器
* const filter = new MxCADResbuf()
* filter.AddMcDbEntityTypes ("TEXT,LINE");
*
* let retIds = await MxCADUtility.selectEnt("\n选择删除对象", filter);
* console.log(retIds)
* ```
*/
selectEnt(strPrompt?: string, filter?: MxCADResbuf | null, isSelectMxDraw?: boolean, init?: (getPoint: MrxDbgUiPrPoint) => any, callbackGetPoint?: (point: McGePoint3d) => void): Promise<McObjectId[]>;
/**
* .
* @returns { object } point1 1 | point2 2 | isvalid
* @example
* ```ts
import { MxCADUtility } from "mxcad"
let ids = MxCADUtility.getCurrentSelect()
let pt1!: McGePoint3d, pt2!: McGePoint3d
const { point1, point2 } = MxCADUtility.getCurrentSelectPoints()
console.log(pt1, pt2)
*
* ```
*/
getCurrentSelectPoints(): {
point1: McGePoint3d;
point2: McGePoint3d;
isvalid: boolean;
};
/**
*
* @param filter
* @example
* ```ts
import { MxCADResbuf, MxCADUtility } from "mxcad";
const filter = new MxCADResbuf();
filter.AddMcDbEntityTypes('TEXT');
const objIds = MxCADUtility.getCurrentSelect();
console.log(objIds);
* ```
*/
getCurrentSelect(filter?: MxCADResbuf | null): McObjectId[];
/**
* @param strPrompt
* @param filter
* @returns PromiseID
* @example
* ```ts
import { MxCADResbuf, MxCADUtility } from 'mxcad';
let filter = new MxCADResbuf();
filter.AddMcDbEntityTypes("CIRCLE,ARC,LINE,LWPOLYLINE,ELLIPSE");
let aryId = await MxCADUtility.userSelect("选择目标曲线", filter);
console.log(aryId);
* ```
* */
userSelect(strPrompt?: string, filter?: MxCADResbuf | null, init?: (ss: MxCADSelectionSet, getPoint: MrxDbgUiPrPoint) => any): Promise<McObjectId[]>;
/**
*
* @example
* ```ts
import { MxCADUtility } from "mxcad";
MxCADUtility.init()
* ```
* */
init(): void;
/** ()
* @param strPrompt
* @param pt1 ()
* @param detailedResult {@link DetailedResult}
* @param drawSelectCroner (true有背景false无背景)
* @param isDisableAllTrace
* @returns Promise
* @example
* ```ts
* import { MxCADUtility } from "mxcad";
*
* const ret = await MxCADUtility.getCorner("测试");
* if (!ret) return;
* console.log(ret.pt1, ret.pt2)
* ```
* */
getCorner(strPrompt?: string, pt1?: McGePoint3d, detailedResult?: (retcode: DetailedResult) => any, drawSelectCroner?: boolean, isDisableAllTrace?: boolean, init?: (getPoint: MxCADUiPrPoint) => any): Promise<{
pt1: McGePoint3d;
pt2: McGePoint3d;
} | null>;
/**
* @param aryId ID数组
* @returns { object} minPt | maxPt
* @example
* ```ts
import { MxCADUtility } from "mxcad";
*
let aryId = await MxCADUtility.userSelect("选择目标对象");
let ext = MxCADUtility.getMcDbEntitysBoundingBox(aryId);
if (!ext) return;
console.log("最小点"ext.minPt)
console.log("最大点", ext.maxPt)
* ```
* */
getMcDbEntitysBoundingBox(aryId: McObjectId[]): {
minPt: McGePoint3d;
maxPt: McGePoint3d;
} | undefined;
/**
* @param pt1
* @param pt2
* @param pt3
* @returns
* @example
* ```ts
* import { McGePoint3d, MxCADUtility } from "mxcad"
*
* const pt1 = new McGePoint3d(0,0,0);
* const pt2 = new McGePoint3d(20,10,0);
* const pt3 = new McGePoint3d(40,0,0);
* const Bulge = MxCADUtility.calcBulge(pt1, pt2, pt3);
* console.log(Bulge)
* ```
* */
calcBulge(pt1: McGePoint3d, pt2: McGePoint3d, pt3: McGePoint3d): {
val: number;
ret: boolean;
};
/**
* @param pt
* @returns
* @example
* ```ts
import { MxCADUiPrPoint, MxCADUtility } from 'mxcad'
const getPoint = new MxCADUiPrPoint();
getPoint.setMessage("\n指定填充区域内部一点:");
getPoint.disableAllTrace(true);
getPoint.setDisableOsnap(true);
let pt = (await getPoint.go()) as McGePoint3d;
if (!pt) return;
let hatch = MxCADUtility.builderHatchFromPoint(pt);
* ```
* */
builderHatchFromPoint(pt: McGePoint3d): McDbHatch | null;
}
/** 提供了一系列与绘图相关的工具方法 */
export declare let MxCADUtility: MxCADUtilityClass;
/** 选择集状态枚举 */
export declare enum MxCADSelectionSetStatus {
/** 构造选择集成功 */
kSelected = 0,
/** 当交互构造选择集时,用户直接按下了 Enter 键。 */
kNone = 1,
/** 当交互构造选择集时,用户按下了 Esc 键取消。 */
kCanceled = 2,
/** 拒绝执行的无效请求(关键字错误)。 */
kRejected = 3,
/** 输入了关键值 */
kKeyword = 4
}
/**
*
*/
export declare class MxCADSelectionSet extends McRxObject {
/**
*
* @example
* ```ts
import { MxCADSelectionSet } from "mxcad";
let ss = new MxCADSelectionSet();
ss.isWhileSelect = false;
* ```
* */
isWhileSelect: boolean;
/**
*
* @example
* ```ts
import { MxCADSelectionSet } from "mxcad";
let ss = new MxCADSelectionSet();
ss.isSelectHighlight = true;
* ```
* */
isSelectHighlight: boolean;
/**
* 1
* @example
* ```ts
import { MxCADSelectionSet } from "mxcad";
let ss = new MxCADSelectionSet();
ss.selectPt1 = new McGePoint3d(20,10,0);
* ```
* */
private selectPt1;
/**
* 2
* @example
* ```ts
import { MxCADSelectionSet } from "mxcad";
let ss = new MxCADSelectionSet();
ss.selectPt1 = new McGePoint3d(0,0,0);
* ```
* */
private selectPt2;
/**
*
* @example
* ```ts
import { MxCADSelectionSet } from "mxcad";
let ss = new MxCADSelectionSet();
* ```
* */
constructor();
/**
*
* @returns {object} pt1 1 | pt2 2
* @example
* ```ts
import { MxCADSelectionSet } from "mxcad";
let ss = new MxCADSelectionSet();
if (!await ss.userSelect("选择目标范围")) return;
const selectPt = ss.getSelectPoint();
console.log(selectPt.pt1, selectPt.pt2);
* ```
* */
getSelectPoint(): {
pt1: McGePoint3d;
pt2: McGePoint3d;
};
/**
* @param filter
* @example
* ```ts
import { MxCADSelectionSet } from "mxcad";
let ss = new MxCADSelectionSet();
ss.allSelect();
ss.forEach((id) => {
let ent: any = id.getMcDbEntity();
if (!ent) return;
ent = McDbEntityToJsonObject(ent);
console.log(JSON.stringify(ent));
})
* ```
* @example
* ```ts
import { MxCADSelectionSet } from "mxcad";
let ss = new MxCADSelectionSet();
// 得到图上,直线,圆,圆弧,多义线,在0层上的对象.
ss.allSelect(new MxCADResbuf([DxfCode.kEntityType, "LINE,ARC,CIRCLE,LWPOLYLINE",DxfCode.kLayer,"0"]));
console.log("得到对象数目:" + ss.count());
* ```
* */
allSelect(filter?: MxCADResbuf | null): number;
/**
* @param dX x
* @param dY y
* @param filter
* @return
* @example
* ```ts
import { MxCADSelectionSet } from "mxcad";
let ss = new MxCADSelectionSet();
const index = ss.pointSelect(20,10);
* ```
* */
pointSelect(dX: number, dY: number, filter?: MxCADResbuf | null, dTol?: number): number;
/**
* @param dX1 1 X轴值
* @param dY1 1 Y轴值
* @param dX2 2 X轴值
* @param dY2 2 Y轴值
* @param filter
* @return
* @example
* ```ts
import { MxCADSelectionSet } from "mxcad";
let ss = new MxCADSelectionSet();
const index = ss.pointSelect(0,0,20,10);
* ```
* */
crossingSelect(dX1: number, dY1: number, dX2: number, dY2: number, filter?: MxCADResbuf | null): number;
/**
*
* @return
* @example
* ```ts
import { MxCADSelectionSet } from "mxcad";
let ss = new MxCADSelectionSet();
if (!await ss.userSelect("选择目标范围")) return;
const count = ss.count();
console.log(count);
* ```
* */
count(): number;
/**
*
* @return
* @example
* ```ts
import { MxCADSelectionSet } from "mxcad";
let ss = new MxCADSelectionSet();
if (!await ss.userSelect("选择目标范围")) return;
const res = ss.isNull();
* ```
* */
isNull(): boolean;
/** ID
* @param lItem
* @return id
* @example
* ```ts
import { MxCADSelectionSet } from "mxcad";
let ss = new MxCADSelectionSet();
const objId = ss.item(2);
* ```
* */
item(lItem: number): McObjectId;
/**
* @example
* ```ts
import { MxCADSelectionSet } from "mxcad";
*
let ss = new MxCADSelectionSet();
ss.allSelect();
ss.forEach((id) => {
let ent: any = id.getMcDbEntity();
})
* ```
* */
forEach(call: (val: McObjectId) => void): void;
/** ID
* @returns id对象数组
* @example
* ```ts
import { MxCADSelectionSet } from "mxcad";
let ss = new MxCADSelectionSet();
ss.allSelect();
const ids = ss.getIds();
* ```
* */
getIds(): McObjectId[];
/**
* @param strPrompt
* @param filter
* @param init
* @example
* ```ts
import { MxCADResbuf, MxCADSelectionSet } from "mxcad";
let filter = new MxCADResbuf();
filter.AddMcDbEntityTypes("INSERT");
let ss = new MxCADSelectionSet();
if (!await ss.userSelect("选择要刷的目标块:", filter)) return;
if (ss.count() == 0) return;
let ids = ss.getIds();
console.log(ids);
* ```
* */
userSelect(strPrompt?: string, filter?: MxCADResbuf | null, init?: (getPoint: MrxDbgUiPrPoint) => any): Promise<boolean>;
}
/** MxCADUiPrBase 作为 MxCADUiPr* 系列的基类,提供了一些基础的功能。 */
export declare class MxCADUiPrBase {
/** 内部实现对象 */
protected imp: any;
/** MxDraw 实例对象 */
protected mxobj: MxDrawObject;
/**
* @param imp
*/
constructor(imp: any);
/** cad
* @param pt THREE.js坐标
* @returns
*/
protected doc2cad1(pt: THREE.Vector3): McGePoint3d;
/** cad
* @param x X轴值
* @param y Y轴值
* @param z Z轴值
* @returns
*/
protected doc2cad2(x: number, y: number, z: number): McGePoint3d;
/** cad
* @param pt
* @returns THREE.js点对象
*/
protected cad2doc1(pt: McGePoint3d): THREE.Vector3;
/** cad
* @param x X轴值
* @param y Y轴值
* @param z Z轴值
* @returns THREE.js点对象
*/
protected cad2doc2(x: number, y: number, z: number): THREE.Vector3;
/**
*
* @returns
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例,其他MxCADUiPr* 系列的类同理
import { MxCADUiPrPoint } from 'mxcad'
const getPoint = new MxCADUiPrPoint();
getPoint.setKeyWords("[选项1(A)/选项2(B)]");
const keyList = getPoint.keyWords();
console.log("关键词列表", keyList)// 关键词列表 [选项1(A)/选项2(B)]
* ```
*/
keyWords(): string;
/**
*
* @param keyWordList
* @returns void
* @example
* ```ts
//以 MxCADUiPrPoint 类示例, 其他MxCADUiPr* 系列的类同理
import { MxCADUiPrPoint } from 'mxcad'
const getPoint = new MxCADUiPrPoint();
getPoint.setKeyWords("[选项1(A)/选项2(B)]")
* ```
*/
setKeyWords(keyWordList: string): void;
/**
*
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例, 其他MxCADUiPr* 系列的类同理
import { MxCADUiPrPoint } from 'mxcad'
*
const getPoint = new MxCADUiPrPoint();
getPoint.clearLastInputPoint();
* ```
*/
clearLastInputPoint(): void;
/**
*
* @param pt
* @example
* ```ts
//以 MxCADUiPrPoint 类示例, 其他MxCADUiPr* 系列的类同理
import { MxCADUiPrPoint , McGePoint3d} from 'mxcad'
*
const getPoint = new MxCADUiPrPoint();
getPoint.setLastInputPoint(new McGePoint3d(0,0,0));
* ```
*/
setLastInputPoint(pt: McGePoint3d): void;
/**
*
* @returns
* @example
* ```ts
//以 MxCADUiPrPoint 类示例, 其他MxCADUiPr* 系列的类同理
import { MxCADUiPrPoint , McGePoint3d} from 'mxcad'
*
const getPoint = new MxCADUiPrPoint();
getPoint.setMessage("测试信息");
console.log(getPoint.message());//测试信息
* ```
*/
message(): string;
/**
*
* @param message
* @returns
* @example
* ```ts
//以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad'
*
const getPoint = new MxCADUiPrPoint();
getPoint.setMessage("\n提示消息")
* ```
*/
setMessage(message: string): void;
/**
*
* @returns
* @example
* ```ts
//以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint();
getPoint.setKeyWords("[选项1(A)/选项2(B)]");
const pt = await getPoint.go();
const key = getPoint.keyWordPicked();
console.log(key)
* ```
*/
keyWordPicked(): string;
/**
*
* @param matchKeyWord
* @returns true为真
* @example
* ```ts
//以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint();
getPoint.setKeyWords("[选项1(A)/选项2(B)]");
const pt = await getPoint.go();
if(getPoint.isKeyWordPicked('A')){
console.log('选项1')
}else if(getPoint.isKeyWordPicked('B')){
console.log('选项2')
}
* ```
*/
isKeyWordPicked(matchKeyWord: string): boolean;
/**
*
* @param pDraw {@link McEdGetPointWorldDrawObject | }
* @returns void
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint();
getPoint.setUserDraw((pt,pw)=>{
console.log(pt, pw)
})
const pt = await getPoint.go();
* ```
*/
setUserDraw(pDraw: ((currentPoint: McGePoint3d, pWorldDraw: McEdGetPointWorldDrawObject) => void)): void;
/**
* 退
* @returns
* @example
* ```ts
* //以 MxCADUiPrDist 类示例
import { MxCADUiPrDist } from 'mxcad';
import { DetailedResult } from "mxdraw";
*
const getDist = new MxCADUiPrDist();
const val = await getDist.go();
if (!val) return;
if (getDist.getDetailedResult() === DetailedResult.kCoordIn) {
console.log('提示输入', val)
}
* ```
*/
getDetailedResult(): DetailedResult;
/**
*
* @return
* @example
* ```ts
* //以 MxCADUiPrDist 类示例
import { MxCADUiPrDist } from 'mxcad';
import { MrxDbgUiPrBaseReturn } from "mxdraw";
*
const getDist = new MxCADUiPrDist();
const val = await getDist.go();
if (!val) return;
if(getPoint.getStatus() === MrxDbgUiPrBaseReturn.kNone) {
// 空输入
}
* ```
* */
getStatus(): MrxDbgUiPrBaseReturn;
/**
*
* @param callAddEntity ent THREE.THREE.Object3D
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint();
const basePt = new McGePoint3d(0, 0, 0);
getPoint.setBasePt(basePt);
getPoint.setUserDraw((pt,pw)=>{
const line = new McDbLine(basePt, pt);
pw.drawMcDbEntity(line)
})
const val = await getPoint.go();
if (!val) return;
getPoint.drawReserve()
* ```
*/
drawReserve(callAddEntity?: (ent: THREE.Object3D) => void): void;
/**
* Touche输入类型, {@link MxType.InputToucheType.kGetBegan}
* @param toucheType toucheType类型
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint();
getPoint.setInputToucheType(MxType.InputToucheType.kGetEnd);
* ```
*/
setInputToucheType(toucheType: number): void;
/**
* Touche输入类型
* @returns Touche输入类型
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint();
const toucheType = getPoint.getInputToucheType();
console.log(toucheType)
* ```
*/
getInputToucheType(): number;
/**
*
* @param type
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
import { MxCursorType } from "mxdraw";
*
const getPoint = new MxCADUiPrPoint()
getPoint.setMessage("指定文字起点:")
getPoint.setCursorType(MxCursorType.kCross);
const pt = await getPoint.go();
* ```
*/
setCursorType(type: MxCursorType): void;
/**
*
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint()
console.log(getPoint.getCursorType())
* ```
*/
getCursorType(): MxCursorType;
/**
*
* @param type
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
import { DynamicInputType } from "mxdraw";
*
const getPoint = new MxCADUiPrPoint()
getPoint.setDynamicInputType(DynamicInputType.kXYCoordInput);
* ```
*/
setDynamicInputType(type: DynamicInputType): void;
/**
*
* @returns
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint()
console.log(getPoint.getDynamicInputType())
* ```
*/
getDynamicInputType(): DynamicInputType;
/**
*
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint()
console.log(getPoint.isDisableDynInput())
* ```
*/
isDisableDynInput(): boolean;
/**
*
* @param isDisable
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint()
getPoint.setDisableDynInput(true);
* ```
*/
setDisableDynInput(isDisable: boolean): void;
/**
*
* @param isDisable
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint()
getPoint.setDisableOsnap(true);
* ```
*/
setDisableOsnap(isDisable: boolean): void;
/**
*
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint()
console.log(getPoint.isDisableOsnap())
* ```
*/
isDisableOsnap(): boolean;
/**
*
*/
isOffsetInputPostion(): boolean;
/**
*
*/
setOffsetInputPostion(isOffset: boolean): void;
/**
* @param isDisable
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint()
getPoint.setDisableDynamicTrace(true);
* ```
* */
setDisableDynamicTrace(isDisable: boolean): void;
/**
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint()
console.log(getPoint.isDisableDynamicTrace())
* ```
* */
isDisableDynamicTrace(): boolean;
/**
* @param isDisable
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint()
getPoint.setDisablePolarAxisTrace(true);
* ```
* */
setDisablePolarAxisTrace(isDisable: boolean): void;
/**
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint()
console.log(getPoint.isDisablePolarAxisTrace())
* ```
* */
isDisablePolarAxisTrace(): boolean;
/**
* @param isDisable
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint()
getPoint.setDisableGridTrace(true);
* ```
* */
setDisableGridTrace(isDisable: boolean): void;
/**
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint()
console.log(getPoint.isDisableGridTrace())
* ```
* */
isDisableGridTrace(): boolean;
/**
* @param isDisable
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint()
getPoint.setDisableOrthoTrace(true);
* ```
* */
setDisableOrthoTrace(isDisable: boolean): void;
/**
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint()
console.log(getPoint.isDisableOrthoTrace())
* ```
* */
isDisableOrthoTrace(): boolean;
/**
* @param isDisable
* @example
* ```ts
* //以 MxCADUiPrPoint 类示例
import { MxCADUiPrPoint } from 'mxcad';
*
const getPoint = new MxCADUiPrPoint()
getPoint.disableAllTrace(true);
* ```
*/
disableAllTrace(isDisable?: boolean): void;
/**
*
* @example
* ```ts
* // 以 MxCADUiPrInt 类示例
import { MxCADUiPrInt } from 'mxcad';
let getInt = new MxCADUiPrInt();
console.log(getInt.userInputControls())
* ```
*/
userInputControls(): number;
/**
*
* @example
* ```ts
* // 以 MxCADUiPrInt 类示例
import { MxCADUiPrInt } from 'mxcad';
import { UserInputControls } from "mxdraw"
*
let getInt = new MxCADUiPrInt();
getInt.setMessage("输入整数:");
getInt.setUserInputControls(UserInputControls.kNoZeroResponseAccepted);
let iRowNum = await getInt.go();
if (iRowNum == null) return;
* ```
*/
setUserInputControls(contros: number): void;
/**
*
* @returns void
*/
abort(cause?: DetailedResult): void;
}
/**
* UI交互取点 ()
* @example
* ```ts
import { MxCADUiPrPoint } from 'mxcad'
const getPoint = new MxCADUiPrPoint();
getPoint.setMessage("请设置第一个点")
const point = await getPoint.go()
console.log(point)
* ```
*/
export declare class MxCADUiPrPoint extends MxCADUiPrBase {
/**
*
* @example
* ```ts
* import { MxCADUiPrPoint } from "mxcad"
*
* const getPoint = new MxCADUiPrPoint();
* ```
*/
constructor();
/**
* go方法, Promise任务
* @returns promise对象
* @description
* Promise完成,
* null Esc取消键或在交互中输入对应的关键词
* @example
* ```ts
* import { MxCADUiPrPoint } from "mxcad"
*
* const getPoint = new MxCADUiPrPoint();
* const pt = await getPoint.go();
* console.log(pt)
* ```
*/
go(): Promise<McGePoint3d | null>;
/**
*
* @returns
* @example
* ```ts
* import { MxCADUiPrPoint } from "mxcad"
*
* const getPoint = new MxCADUiPrPoint();
* await getPoint.go();
* const pt = getPoint.value();
* console.log(pt)
* ```
*/
value(): McGePoint3d;
/**
* .
* @returns MdGePoint3d
* @example
* ```ts
* import { MxCADUiPrPoint } from "mxcad"
*
* const getPoint = new MxCADUiPrPoint();
* await getPoint.go();
* const pt = getPoint.getDocValue();
* console.log(pt)
* ```
*/
getDocValue(): McGePoint3d;
/**
*
* @returns McGePoint3d
* @example
* ```ts
* import { MxCADUiPrPoint } from "mxcad"
*
* const getPoint = new MxCADUiPrPoint();
* getPoint.setBasePt(new McGePoint3d(0,0,0));
* await getPoint.go();
* console.log(getPoint.basePt())//(0,0,0)
* ```
*/
basePt(): McGePoint3d;
/**
*
* @param basePt McGePoint3d
* @example
* ```ts
* import { MxCADUiPrPoint } from "mxcad"
*
* const getPoint = new MxCADUiPrPoint();
* getPoint.setBasePt(new McGePoint3d(0,0,0));
* ```
*/
setBasePt(basePt: McGePoint3d): void;
/**
*
* @param useIt ,setBasePt会自设置true.
* @returns void
* @example
* ```ts
* import { MxCADUiPrPoint } from "mxcad"
*
* const getPoint = new MxCADUiPrPoint();
* getPoint.setUseBasePt(true);
* ```
*/
setUseBasePt(useIt: boolean): void;
}
/** UI
* @description
* @example
* ```ts
import { MxCADUiPrDist } from 'mxcad'
const getDist = new MxCADUiPrDist()
getDist.setMessage("提示用户设置距离:")
const distVal = await getDist.go()
console.log(distVal)
* ```
*/
export declare class MxCADUiPrDist extends MxCADUiPrBase {
/**
*
* @example
* ```ts
* import { MxCADUiPrDist } from 'mxcad'
*
* const getDist = new MxCADUiPrDist()
* ```
* */
constructor();
/**
*
* @returns
* @example
* ```ts
* import { MxCADUiPrDist } from 'mxcad'
*
* const getDist = new MxCADUiPrDist();
* const val = await getDist.go();
* if(!val) return;
* const dist = getDist.value();
* console.log(dist)
* ```
*/
value(): number;
/**
*
* @returns McGePoint3d
* @example
* ```ts
* import { MxCADUiPrDist, McGePoint3d } from 'mxcad'
*
* const getDist = new MxCADUiPrDist();
* getDist.setBasePt(new McGePoint3d(0,0,0))
* console.log(getDist.basePt())//(0,0,0)
* ```
*/
basePt(): McGePoint3d;
/**
*
* @param basePt McGePoint3d
* @example
* ```ts
* import { MxCADUiPrDist, McGePoint3d } from 'mxcad'
*
* const getDist = new MxCADUiPrDist();
* getDist.setBasePt(new McGePoint3d(0,0,0))
* ```
*/
setBasePt(basePt: McGePoint3d): void;
/**
* 使
* @param useIt false
* @returns void
* @example
* ```ts
* import { MxCADUiPrDist } from 'mxcad'
*
* const getDist = new MxCADUiPrDist();
* getDist.setUseBasePt(true)
* ```
*/
setUseBasePt(useIt: boolean): void;
/**
*
* @returns promise对象
* @example
* ```ts
* import { MxCADUiPrDist } from 'mxcad'
*
* const getDist = new MxCADUiPrDist();
* const val = await getDist.go();
* ```
*/
go(): Promise<number | null>;
}
/**
* UI交互
* @example
* ```ts
import { MxCADUiPrAngle } from 'mxcad'
const getAngle = new MxCADUiPrAngle()
getAngle.setMessage("提示用户设置角度:")
const angleVal = await getAngle.go()
console.log(angleVal)
* ```
*/
export declare class MxCADUiPrAngle extends MxCADUiPrBase {
/**
*
* @example
* ```ts
* import { MxCADUiPrAngle } from 'mxcad'
*
* const getAngle = new MxCADUiPrAngle()
* ```
*/
constructor();
/**
*
* @example
* ```ts
* import { MxCADUiPrAngle } from 'mxcad'
*
* const getAngle = new MxCADUiPrAngle();
* const val = await getAngle.go();
* const angle = getAngle.value();
* console.log(angle);
* ```
*/
value(): number;
/**
*
* @returns McGePoint3d
* @example
* ```ts
* import { MxCADUiPrAngle, McGePoint3d } from 'mxcad'
*
* const getAngle = new MxCADUiPrAngle();
* getAngle.setBasePt(new McGePoint3d(0,0,0));
* console.log(getAngle.basePt());//(0,0,0)
* ```
*/
basePt(): McGePoint3d;
/**
*
* @param basePt McGePoint3d
* @example
* ```ts
* import { MxCADUiPrAngle, McGePoint3d } from 'mxcad'
*
* const getAngle = new MxCADUiPrAngle();
* getAngle.setBasePt(new McGePoint3d(0,0,0));
* ```
*/
setBasePt(basePt: McGePoint3d): void;
/**
* 使
* @param useIt false
* @returns void
* @example
* ```ts
* import { MxCADUiPrAngle, McGePoint3d } from 'mxcad'
*
* const getAngle = new MxCADUiPrAngle();
* getAngle.setUseBasePt(true));
* ```
*/
setUseBasePt(useIt: boolean): void;
/**
*
* @returns promise对象
* @example
* ```ts
* import { MxCADUiPrAngle, McGePoint3d } from 'mxcad'
*
* const getAngle = new MxCADUiPrAngle();
* const angle = await getAngle.go();
* ```
*/
go(): Promise<number | null>;
}
/**
* UI交互
* @example
* ```ts
import { MxCADUiPrInt } from 'mxcad'
const getInt = new MxCADUiPrInt()
getInt.setMessage("提示用户输入数字:")
const intVal = await getInt.go()
console.log(intVal)
* ```
*/
export declare class MxCADUiPrInt extends MxCADUiPrBase {
/**
*
* @example
* ```ts
* import { MxCADUiPrInt } from 'mxcad';
*
* const getInt = new MxCADUiPrInt();
* ```
*/
constructor();
/**
*
* @example
* ```ts
* import { MxCADUiPrInt } from 'mxcad';
*
* const getInt = new MxCADUiPrInt();
* const val = await getInt.go();
* if(!val) return;
* const int = getInt.value();
* ```
*/
value(): number;
/**
*
* @returns promise对象
* @example
* ```ts
* import { MxCADUiPrInt } from 'mxcad'
*
* const getInt = new MxCADUiPrInt();
* const int = await getInt.go();
* ```
*/
go(): Promise<number | null>;
}
/**
* UI交互
* @example
* ```ts
import { MxCADUiPrKeyWord } from 'mxcad'
const getKey = new MxCADUiPrKeyWord
getKey.setMessage("提示用户关键词 A、 B、 C:")
getKey.setKeyWords("A B C")
const keyVal = await getKey.go()
console.log(keyVal)
* ```
*/
export declare class MxCADUiPrKeyWord extends MxCADUiPrBase {
/**
*
* @example
* ```ts
* import { MxCADUiPrKeyWord } from "mxcad";
*
* const getKey = new MxCADUiPrKeyWord();
* ```
*/
constructor();
/**
*
* @returns promise对象
* @example
* ```ts
* import { MxCADUiPrKeyWord } from 'mxcad'
*
* const getType = new MxCADUiPrKeyWord();
* getType.setMessage('选择连接方式');
* getType.setKeyWords('[手动逐个连线(H)/自动批量连线(A)]')
* const type = await getType.go();
* if (!type) return;
* ```
*/
go(): Promise<string | null>;
}
/**
* UI交互
* @example
* ```ts
import { MxCADUiPrString } from 'mxcad'
const getStr = new MxCADUiPrString()
getStr.setMessage("提示用户输入字符串:")
const strVal = await getStr.go()
console.log(strVal)
* ```
*/
export declare class MxCADUiPrString extends MxCADUiPrBase {
/**
*
* @example
* ```ts
* import { MxCADUiPrString } from 'mxcad';
*
* const getStr = new MxCADUiPrString();
* ```
*/
constructor();
/**
*
* @example
* ```ts
* import { MxCADUiPrString } from 'mxcad';
*
* const getStr = new MxCADUiPrString();
* const val = await getStr.go();
* if(!val) return;
* const string = getStr.value();
* console.log(string)
* ```
*/
value(): string;
/**
*
* @returns promise对象
* @example
* ```ts
* import { MxCADUiPrString } from 'mxcad'
*
* const getStr = new MxCADUiPrString();
* const string = await getStr.go();
* ```
*/
go(): Promise<string | null>;
}
/**
* UI交互
* @example
* ```ts
import { MxCADUiPrEntity, MxCpp } from "mxcad"
let getEnt = new MxCADUiPrEntity();
getEnt.setMessage("选择目标对象");
let entId = await getEnt.go();
if(!entId.id) return;
// 通过ID对象得到图形数据对象
let ent = entId.getMcDbEntity();
* ```
*/
export declare class MxCADUiPrEntity extends MxCADUiPrBase {
private filter?;
private id;
/**
*
* @example
* ```ts
* import { MxCADUiPrEntity } from "mxcad";
*
* const getEnt = new MxCADUiPrEntity();
* ```
*/
constructor();
/**
*
* @param filter
* @example
* ```ts
* import { MxCADUiPrEntity, MxCADResbuf } from "mxcad";
*
* const filter = new MxCADResbuf();
* filter.AddMcDbEntityTypes("LINE");
* const getEnt = new MxCADUiPrEntity();
* getEnt.setFilter(filter);
* ```
*/
setFilter(filter: MxCADResbuf): void;
/**
* MxCADUiPrEntity设置的过滤器详情
* @returns
* @example
* ```ts
* import { MxCADUiPrEntity, MxCADResbuf } from "mxcad";
*
* const filter = new MxCADResbuf();
* filter.AddMcDbEntityTypes("LINE");
*
* const getEnt = new MxCADUiPrEntity();
* getEnt.setFilter(filter);
* console.log(getEnt.getFilter());
* ```
*/
getFilter(): MxCADResbuf | undefined;
/**
*
* @returns promise对象
* @example
* ```ts
* import { MxCADUiPrEntity } from 'mxcad'
*
* const getEnt = new MxCADUiPrEntity();
* const entId = await getEnt.go();
* if (!entId.id) return
* ```
*/
go(): Promise<McObjectId>;
/**
*
* @return
* @example
* ```ts
* import { MxCADUiPrEntity } from 'mxcad'
*
* const getEnt = new MxCADUiPrEntity();
* const entId = await getEnt.go();
* if (!entId.id) return;
* const point = getEnt.pickPoint();
* console.log(point)
* ```
*/
pickPoint(): McGePoint3d;
/**
* id
* @returns id
* @example
* ```ts
* import { MxCADUiPrEntity } from 'mxcad'
*
* const getEnt = new MxCADUiPrEntity();
* const entId = await getEnt.go();
* if (!entId.id) return;
* const id = getEnt.value();
* ```
*/
value(): McObjectId;
/**
* CAD图纸坐标.
* @returns MdGePoint3d
* @example
* ```ts
* import { MxCADUiPrEntity } from 'mxcad'
*
* const getEnt = new MxCADUiPrEntity();
* const entId = await getEnt.go();
* if (!entId.id) return;
* const point = getEnt.getDocPickPoint();
* ```
*/
getDocPickPoint(): McGePoint3d;
}
/**
* 线
*/
export declare class McDbEntity extends McDbObject {
/**
*
* @param imp
* @example
* ```ts
* import { McDbEntity } from "mxcad";
*
* const ent = new McDbEntity()
* ```
*/
constructor(imp?: any);
/**
*
* @return resbuf
* @example
* ```ts
* import { McDbEntity, MxCADResbuf } from "mxcad";
* // 获取目标对象
* let getEnt = new MxCADUiPrEntity();
* getEnt.setMessage("选择打碎对象:");
* let id = await getEnt.go();
* let ent:McDbEntity = id.getMcDbEntity();
* if (ent === null) return;
* // 打碎对象
* let retExplode: MxCADResbuf = ent.explode();
* ```
*/
explode(): MxCADResbuf;
/**
*
* @example
* ```ts
import { McDbEntity, McCmColor} from 'mxcad'
const ent = new McDbEntity();
ent.trueColor = new McCmColor(255, 0, 0);
console.log(ent.trueColor)
* ```
*/
get trueColor(): McCmColor;
/**
*
*/
set trueColor(val: McCmColor);
/**
*
* @example
* ```ts
import { McDbEntity, ColorIndexType } from 'mxcad'
const ent = new McDbEntity();
ent.colorIndex = ColorIndexType.kByblock;
console.log(ent.colorIndex)
* ```
*/
get colorIndex(): number;
/**
*
* @param val ColorIndexType
*/
set colorIndex(val: number);
/**
*
*/
get layer(): string;
/**
*
* @param val
* @example
* ```ts
import { McDbEntity } from 'mxcad'
const ent = new McDbEntity();
ent.layer = "newLayerName";
console.log(ent.layer)
```
*/
set layer(val: string);
/**
* 线
*/
get linetype(): string;
/**
* 线
* @param val 线
* @example
* ```ts
* import { McDbEntity } from 'mxcad'
* const ent = new McDbEntity()
* ent.linetype = "MyLineType";
* console.log(ent.linetype)
* ```
*/
set linetype(val: string);
/**
* 线
*/
get linetypeScale(): number;
/**
* 线
* @param val 线
* @example
* ```ts
* import { McDbEntity } from 'mxcad'
* const ent = new McDbEntity()
* ent.linetypeScale = 0.8;
* console.log(ent.linetypeScale)
* ```
*/
set linetypeScale(val: number);
/**
*
*/
get visible(): boolean;
/**
*
* @param val
* @example
* ```ts
* import { McDbEntity } from 'mxcad'
* const ent = new McDbEntity()
* ent.visible = true;
* console.log(ent.visible)
* ```
*/
set visible(val: boolean);
/**
* 线
*/
get lineweight(): number;
/**
* 线
* @param val 线
* @example
* ```ts
* import { McDbEntity } from 'mxcad'
* const ent = new McDbEntity()
* ent.lineweight = 20;
* console.log(ent.lineweight)
* ```
*/
set lineweight(val: number);
/**
*
*/
get textStyle(): string;
/**
*
* @param val
* @example
* ```ts
* import { McDbEntity } from 'mxcad'
* const ent = new McDbEntity()
* ent.textStyle = "st_style";
* ```
*/
set textStyle(val: string);
/**
*
* @param isHighlight
* @example
* ```ts
* import { McDbEntity } from 'mxcad'
* const ent = new McDbEntity()
* ent.highlight(true);
* ```
*/
highlight(isHighlight: boolean): void;
/**
*
* @param fromPoint
* @param toPoint
* @example
* ```ts
* import { McDbEntity, McGePoint3d } from 'mxcad'
* const ent = new McDbEntity()
* ent.move(new McGePoint3d(0,0,0), new McGePoint3d(20,0,0))
* ```
*/
move(fromPoint: McGePoint3d, toPoint: McGePoint3d): boolean;
/**
*
* @param basePoint
* @param dRotationAngle
* @example
* ```ts
* import { McDbEntity, McGePoint3d } from 'mxcad'
* const ent = new McDbEntity()
* ent.rotate(new McGePoint3d(0,0,0), Math.PI)
* ```
*/
rotate(basePoint: McGePoint3d, dRotationAngle: number): boolean;
/**
*
* @param point1
* @example
* ```ts
* import { McDbEntity, McGePoint3d } from 'mxcad'
* const ent = new McDbEntity()
* ent.mirror(new McGePoint3d(0,0,0), new McGePoint3d(20,10,0))
* ```
*/
mirror(point1: McGePoint3d, point2: McGePoint3d): boolean;
/**
*
* @param basePoint
* @param dScaleFactor <1 缩小 >1
* @example
* ```ts
* import { McDbEntity, McGePoint3d } from 'mxcad'
* const ent = new McDbEntity()
* ent.scaleEntity(new McGePoint3d(0,0,0), 0.5)
* ```
*/
scaleEntity(basePoint: McGePoint3d, dScaleFactor: number): boolean;
/**
*
* @param transformationMatrix
* @example
* ```ts
* import { McGeMatrix3d, McDbEntity, McGeVector3d} from 'mxcad'
* const ent = new McDbEntity()
let matrix = new McGeMatrix3d();
matrix.setToTranslation(new McGeVector3d(20,0,0));//平移
ent.transformBy(matrix);
* ```
*/
transformBy(transformationMatrix: McGeMatrix3d): boolean;
/**
*
* @param minPt
* @param maxPt
* @param ret
* @example
* ```ts
* import { McDbText, McGePoint3d } from 'mxcad'
* const text = new McDbText();
* text.textString = "测试Test";
* text.height = 20;
* text.position = text.alignmentPoint = new McGePoint3d(0,0,0);
* const { minPt, maxPt, ret } = text.getBoundingBox()
* ```
*/
getBoundingBox(): {
minPt: McGePoint3d;
maxPt: McGePoint3d;
ret: boolean;
};
/**
*
* @param appName
* @example
* ```ts
* // 假设ent为有效实例对象
* const xData = ent.getXData();
* ```
*/
getxData(appName?: string): MxCADResbuf;
/**
*
* @param xdata
* @example
* ```ts
* import { MxCADUiPrEntity, McDbEntity } from "mxcad";
*
* //设置扩展数据
* let selEntity = new MxCADUiPrEntity();
* selEntity.setMessage("选择对象");
* let id = await selEntity.go();
* if (!id.isValid()) return;
* let ent:McDbEntity = id.getMcDbEntity();
* if (ent === null) return;
* ent.setxData(new MxCADResbuf([{type:DxfCode.kExDataName,val:"DataName"},{type:DxfCode.kString,val:"yyyyy"}]));
* ```
*/
setxData(xdata: MxCADResbuf): boolean;
/**
* XData
* @param appName
* @returns { object } val XData信息 | ret
* @example
* ```ts
* // 假设ent为有效实例对象
* let data = ent.getxDataString("DataName");
* if(data.ret){
* console.log(data.val)
* }
* ```
*/
getxDataString(appName: string): {
val: string;
ret: boolean;
};
/**
* XData
* @param appName
* @param val
* @returns
* @example
* ```ts
* import { MxCADUiPrEntity, McDbEntity } from "mxcad";
* let selEntity = new MxCADUiPrEntity();
* selEntity.setMessage("选择对象");
* let id = await selEntity.go();
* if (!id.isValid()) return;
* let ent:McDbEntity = id.getMcDbEntity();
* if (ent === null) return;
* const res = ent.setxDataString("DataName", "xxxxx");
* if(res){
* //设置成功
* }else{
* //设置失败
* }
* ```
*/
setxDataString(appName: string, val: string): boolean;
/**
* XData double
* @param appName
* @returns double
* @example
* ```ts
* // 假设ent为有效实例对象
* let data = ent.getxDataDouble("DataName");
* if(data.ret){
* console.log(data.val)
* }
* ```
*/
getxDataDouble(appName: string): {
val: number;
ret: boolean;
};
/**
* XData double
* @param appName
* @param val double
* @returns
* @example
* ```ts
* import { MxCADUiPrEntity, McDbEntity } from "mxcad";
* let selEntity = new MxCADUiPrEntity();
* selEntity.setMessage("选择对象");
* let id = await selEntity.go();
* if (!id.isValid()) return;
* let ent:McDbEntity = id.getMcDbEntity();
* if (ent === null) return;
* const res = ent.setxDataDouble("DataName", 0);
* if(res){
* //设置成功
* }else{
* //设置失败
* }
* ```
*/
setxDataDouble(appName: string, val: number): boolean;
/**
* XData long
* @param appName
* @returns long
* @example
* ```ts
* // 假设ent为有效实例对象
* let data = ent.getxDataLong("DataName");
* if(data.ret){
* console.log(data.val)
* }
* ```
*/
getxDataLong(appName: string): {
val: number;
ret: boolean;
};
/**
* XData long
* @param appName
* @param val long
* @returns long
* @example
* ```ts
* import { MxCADUiPrEntity, McDbEntity } from "mxcad";
*
* let selEntity = new MxCADUiPrEntity();
* selEntity.setMessage("选择对象");
* let id = await selEntity.go();
* if (!id.isValid()) return;
* let ent:McDbEntity = id.getMcDbEntity();
* if (ent === null) return;
* const res = ent.setxDataLong("DataName", 123456);
* if(res){
* //设置成功
* }else{
* //设置失败
* }
* ```
*/
setxDataLong(appName: string, val: number): boolean;
/**
* XData
* @param appName
* @return
*/
getxDataPoint(appName: string): {
val: McGePoint3d;
ret: boolean;
};
/**
* XData
* @param appName
* @param val
* @return
*/
setxDataPoint(appName: string, val: McGePoint3d): boolean;
/**
*
* @param appName
* @example
* ```ts
* import { MxCADUiPrEntity, McDbEntity } from "mxcad";
*
* let selEntity = new MxCADUiPrEntity();
* selEntity.setMessage("选择对象");
* let id = await selEntity.go();
* if (!id.isValid()) return;
* let ent:McDbEntity = id.getMcDbEntity();
* if (ent === null) return;
* const res = ent.deleteXData("DataName");
* if(res){
* //删除成功
* }else
* //删除失败
* }
* ```
*/
deleteXData(appName: string): boolean;
/**
* XData AppName
* @example
* ```ts
* // 假设ent为有效实例对象
* const appNames = ent.getAllAppName();
* console.log(appNames);
* ```
*/
getAllAppName(): McGeStringArray;
/**
* ID对象
* @example
* ```ts
* // 假设ent为有效实例对象
* const layerId = ent.layerId;
* ```
*/
get layerId(): McObjectId;
/**
* Id对象
* @example
* ```ts
* // 假设ent为有效实例对象
* const mxcad = MxCpp.getCurrentMxCAD();
* const layerId = mxcad.addLayer("测试图层")
* ent.layerId = layerId;
* ```
*/
set layerId(id: McObjectId);
/**
* 线ID
* @example
* ```ts
* // 假设ent为有效实例对象
* const linetypeId = ent.linetypeId;
* ```
*/
get linetypeId(): McObjectId;
/**
* 线ID
* @example
* ```ts
* // 假设ent为有效实例对象
* const mxcad = MxCpp.getCurrentMxCAD();
* const lineId = mxcad.addLinetypeEx("TestMyLine", '25,-5');
* ent.linetypeId = lineId;
* ```
*/
set linetypeId(id: McObjectId);
/**
*
* @example
* ```ts
* // 假设ent为有效实例对象
* const textStyleId = ent.textStyleId;
* ```
*/
get textStyleId(): McObjectId;
/**
*
* @example
* ```ts
* // 假设ent为有效实例对象
* const mxcad = MxCpp.getCurrentMxCAD();
* const textStyleId = mxcad.addTextStyle("MyLineTypeTextStyle", "txt.shx", "hztxt.shx", 1);
* ent.textStyleId = textStyleId;
* ```
*/
set textStyleId(id: McObjectId);
/** ,
* @param intersectObject
* @param exOption
* @returns
* @example
* ```ts
* import { McDbLine, McDb } from 'mxcad'
* const line1 = new McDbLine(new McGePoint3d(0,0,0), new McGePoint3d(20,1,0));
* const line2 = new McDbLine(new McGePoint3d(10,10,0), new McGePoint3d(11,1,0));
* const ptArr = line1.IntersectWith(line2, McDb.Intersect.kExtendBoth)
* ```
* */
IntersectWith(intersectObject: McDbEntity, exOption: McDb.Intersect): McGePoint3dArray;
/**
*
* @returns { object } val | ret
* @example
* ```ts
* import { McGePoint3d, McDbCircle } from "mxcad"
*
* const center = new McGePoint3d(0,0,0);
* const circle = new McDbCircle(center, 20);
* const area = circle.getArea();
* console.log("圆面积:", area)
* ```
*/
getArea(): {
val: number;
ret: boolean;
};
/**
* .
* @param isDisable
* @example
* ```ts
* import { McDbLine } from 'mxcad'
* const line1 = new McDbLine(new McGePoint3d(0,0,0), new McGePoint3d(20,1,0));
* line1.disableDisplay(true)
* ```
*/
disableDisplay(isDisable: boolean): void;
/**
* .
* @example
* ```ts
* // 假设ent为有效实例对象
* ent.updateDisplay()
* ```
*/
updateDisplay(): void;
/**
*
* @param _toCpp
* @example
* ```ts
* // 假设ent为有效实例对象
* const res = ent.syncData(true);
* if(res){
* //同步成功
* }else{
* //同步失败
* }
* ```
*/
syncData(_toCpp?: boolean): boolean;
/**
*
* @example
* ```ts
* // 假设ent为有效实例对象
* const order = ent.drawOrder();
* ```
*/
get drawOrder(): number;
/**
*
* @param order
* @example
* ```ts
* import { MxCpp, MxCADSelectionSet } from "mxcad";
*
* let ss = new MxCADSelectionSet();
* if (!await ss.userSelect("\n选择对象")) return;
* //得到当前图上对象的最大,小最显示顺序.
* let minmaxOrder = MxCpp.getCurrentDatabase().currentSpace.getMinMaxDrawOrder();
* // 把对象放到最上面。
* let lOrder = minmaxOrder.maxDrawOrder + 1;
* ss.forEach((id) => {
* let ent = id.getMcDbEntity();
* if (ent) {
* ent.drawOrder = lOrder;
* }
* })
* ```
*/
set drawOrder(order: number);
/**
* normal
* @example
* ```ts
* ```
*/
get normal(): McGeVector3d;
/**
* normal
* @example
* ```ts
* ```
*/
set normal(val: McGeVector3d);
}
/**
* 线线线线线 线
* @example
* ```ts
* // 下面代码演示了,选择一个曲线,然后选择其它曲线,计算曲线与这个曲线的交点,然后在交点处打断曲线。
import { MxCADUiPrEntity, MxCADResbuf, MxCpp, MxCADUtility, McDbCurve } from "mxcad";
async function Mx_IntersectBreak() {
// 选择参考曲线
let eventObj = new MxCADUiPrEntity();
eventObj.setMessage("请选择参考曲线");
let eventObj_id = await eventObj.go();
let event = await eventObj_id.getMcDbEntity()//获取实例对象
if (event === null) return;
const mxcad = MxCpp.App.getCurrentMxCAD();
let curve = event.clone();// 克隆曲线
let filter = new MxCADResbuf();
//设置过滤器 选中圆类、圆弧类、直线类、多段线类、椭圆类
filter.AddMcDbEntityTypes("CIRCLE,ARC,LINE,LWPOLYLINE,ELLIPSE");
let aryId = await MxCADUtility.userSelect("选择打断对象", filter);//选中对象的id
if (aryId.length == 0) return
// 遍历选中的曲线对象
aryId.forEach(async (id) => {
if (id.id !== eventObj_id.id) {
let breakEvent: McDbCurve = (await id.getMcDbEntity()) as McDbCurve;// 获取打断曲线的实例
let breakArr = breakEvent.IntersectWith(curve as McDbEntity, McDb.Intersect.kOnBothOperands);//与实体相交的点集合
if (breakArr.length() != 0) {
//有交点的对象
let arr: McGePoint3d[] = [];//交点数组
breakArr.forEach((item: McGePoint3d) => {
arr.push(item)
})
let breakPoint: McGePoint3d[] = [];
arr.forEach(pt => {
let closePoint = breakEvent.getClosestPointTo(pt, false);//曲线上离鼠标位置最近的点
if (!closePoint.ret) return;
let vec = breakEvent.getFirstDeriv(closePoint.val);//断点所在位置的向量
if (!vec.ret) return;
vec.val.normalize().mult(MxFun.viewCoordLong2Cad(10));//断开的距离
let pt1 = closePoint.val.clone();
pt1.addvec(vec.val);
let pt2 = closePoint.val.clone();
pt2.subvec(vec.val);
breakPoint.push(pt1);
breakPoint.push(pt2);
});
let breakcurve = breakEvent.splitCurves(breakPoint);// 根据端点截取曲线
if (breakcurve.empty()) {
breakEvent.highlight(false);
return;
}
// 重绘打断后的曲线
breakcurve.forEach((obj: McDbObject, index: number) => {
if (index % 2 == 0) mxcad.drawEntity(obj as McDbEntity);
});
breakEvent.erase() // 删除原曲线
}
}
})
}
* ```
*/
export declare class McDbCurve extends McDbEntity {
/**
*
* @param imp
* @example
* ```ts
* import { McDbCurve } from "mxcad";
*
* const curve = new McDbCurve();
* ```
*/
constructor(imp?: any);
/**
*
* @returns
* @example
* ```ts
* // 假设curve为有效曲线实例对象
* const startPa = curve.getStartParam();
* if(startPa.ret){
* console.log(startPa.val)
* }
* ```
*/
getStartParam(): {
val: number;
ret: boolean;
};
/**
*
* @returns
* @example
* ```ts
* // 假设curve为有效曲线实例对象
* const endPa = curve.getEndParam();
* if(endPa.ret){
* console.log(endPa.val)
* }
* ```
*/
getEndParam(): {
val: number;
ret: boolean;
};
/**
*
* @param param
* @returns
* @example
* ```ts
* // 假设curve为有效曲线实例对象
* const res = curve.getDistAtParam(2);
* if(res.ret){
* console.log(res.val)
* }
* ```
*/
getDistAtParam(param: number): {
val: number;
ret: boolean;
};
/**
*
* @param dist
* @returns
* @example
* ```ts
* // 假设curve为有效曲线实例对象
* const res = curve.getParamAtDist(0);
* if(res.ret){
* console.log(res.val)
* }
* ```
*/
getParamAtDist(dist: number): {
val: number;
ret: boolean;
};
/**
* 线
* @param pt
* @returns
* @example
* ```ts
* import { McGePoint3d, McDbLine } from "mxcad"
*
* const pt1 = new McGePoint3d(0,0,0);
* const pt2 = new McGePoint3d(20,0,0);
* const line = new McDbLine(pt1, pt2)
* const res = line.getDistAtPoint(pt2);
* if(res.ret){
* const dist = res.val;
* console.log(dist);//20
* }
* ```
*/
getDistAtPoint(pt: McGePoint3d): {
val: number;
ret: boolean;
};
/**
*
* @param dist
* @returns
* @example
* ```ts
* import { McGePoint3d, McDbLine } from "mxcad"
*
* const pt1 = new McGePoint3d(0,0,0);
* const pt2 = new McGePoint3d(20,0,0);
* const line = new McDbLine(pt1, pt2)
* const res = line.getPointAtDist(10);
* if(res.ret){
* const point = res.val;
* console.log(point);//(10, 0, 0)
* }
* ```
*/
getPointAtDist(dist: number): {
val: McGePoint3d;
ret: boolean;
};
/**
* 线
* @returns 线
* @example
* ```ts
* import { McGePoint3d, McDbLine } from "mxcad"
*
* const pt1 = new McGePoint3d(0,0,0);
* const pt2 = new McGePoint3d(20,0,0);
* const line = new McDbLine(pt1, pt2)
* const res = line.getStartPoint();
* if(res.ret){
* const point = res.val;
* console.log(point);//(0, 0, 0)
* }
* ```
*/
getStartPoint(): {
val: McGePoint3d;
ret: boolean;
};
/**
* 线
* @returns 线
* @example
* ```ts
* import { McGePoint3d, McDbLine } from "mxcad"
*
* const pt1 = new McGePoint3d(0,0,0);
* const pt2 = new McGePoint3d(20,0,0);
* const line = new McDbLine(pt1, pt2)
* const res = line.getEndPoint();
* if(res.ret){
* const point = res.val;
* console.log(point);//(20, 0, 0)
* }
* ```
*/
getEndPoint(): {
val: McGePoint3d;
ret: boolean;
};
/**
* 线
* @param param 线
* @returns
* @example
* ```ts
* // 假设curve为有效曲线实例对象
* const res = curve.getPointAtParam(5);
* if(res.ret){
* console.log(res.val)
* }
* ```
*/
getPointAtParam(param: number): {
val: McGePoint3d;
ret: boolean;
};
/**
* 线线
* @param pt 线
* @returns 线
* @example
* ```ts
* import { McGePoint3d, McDbLine } from "mxcad"
*
* const pt1 = new McGePoint3d(0,0,0);
* const pt2 = new McGePoint3d(20,0,0);
* const line = new McDbLine(pt1, pt2)
* const res = line.getParamAtPoint(pt1);
* if(res.ret){
* const val = res.val;
* console.log(val);
* }
* ```
*/
getParamAtPoint(pt: McGePoint3d): {
val: number;
ret: boolean;
};
/**
* 线线
* @param param 线
* @returns 线
* @example
* ```ts
* // 假设curve为有效曲线实例对象
* const res = curve.getFirstDerivFromParam(5);
* if(res.ret){
* console.log(res.val)
* }
* ```
*/
getFirstDerivFromParam(param: number): {
val: McGeVector3d;
ret: boolean;
};
/**
* 线线
* @param pt 线
* @returns 线
* @example
* ```ts
* import { McGePoint3d, McDbCircle } from "mxcad"
*
* const center = new McGePoint3d(0,0,0);
* const circle = new McDbCircle(center, 20);
* const vec = circle.getFirstDeriv(new McGePoint3d(20,0,0));//目标点切向量
* if(vec.ret){
* const val = vec.val;
* }
* ```
*/
getFirstDeriv(pt: McGePoint3d): {
val: McGeVector3d;
ret: boolean;
};
/**
* 线
* @param givenPnt
* @param isExtend
* @returns
* @example
* ```ts
* import { McGePoint3d, McDbCircle, MxCADUiPrPoint, MxCpp } from "mxcad"
*
* const center = new McGePoint3d(0,0,0);
* const circle = new McDbCircle(center, 20);
* const mxcad = MxCpp.getCurrentMxCAD();
* mxcad.drawEntity(circle);
*
* const getPoint = new MxCADUiPrPoint();
* getPoint.setUserDraw((pt,pw)=>{
* //获取pt到circle上最近的点
* const point = circle.getClosestPointTo(pt);
* console.log(point)
* })
* const point = await getPoint.go();
* ```
*/
getClosestPointTo(givenPnt: McGePoint3d, isExtend: boolean): {
val: McGePoint3d;
ret: boolean;
};
/**
* 线
* @param dOffsetDist
* @param ptOffsetRef
* @returns
* @example
* ```ts
* import { MxCADUiPrPoint, MxCpp } from 'mxcad'
let getFristPoint = new MxCADUiPrPoint();
let offsetDist = 10 ;
let getEvent = new MxCADUiPrEntity();
getEvent.setMessage('指定偏移对象');
let event_id = await getEvent.go();
if (!event_id) return;
let event = (await event_id.getMcDbEntity()) as McDbCurve;
let getoOffPt = new MxCADUiPrPoint();
getoOffPt.setMessage('指定偏移点');
let offPt = await getoOffPt.go();
if (!offPt) return;
let objArr = event.offsetCurves(offsetDist, offPt);
if (objArr.length() === 0) return;
objArr.forEach((obj: McDbObject) => {
MxCpp.getCurrentCAD().drawEntity(obj as McDbEntity);
});
* ```
*/
offsetCurves(dOffsetDist: number, ptOffsetRef: McGePoint3d): McDbObjectArray;
/**
* 线
* @param pts
* @returns 线
* @example
* ```ts
* import { MxCpp } from "mxcad"
* // PointsArr:断点数组 event:McDbCurve
event.splitCurves(PointsArr).forEach((e:McDbCurve, index:number) => {
if(index % 2 === 0){
MxCpp.getCurrentCAD().drawEntity(e as McDbEntity)
}
})
* ```
*/
splitCurves(pts: McGePoint3d[]): McDbObjectArray;
/**
* 线线
* @param params 线
* @returns 线
*/
splitCurvesFromParam(params: number[]): McDbObjectArray;
/**
* 线
* @param dApproxEps
* @returns resbuf
* @example
* ```ts
* import { McGePoint3d, McDbLine } from "mxcad"
*
* const pt1 = new McGePoint3d(0,0,0);
* const pt2 = new McGePoint3d(20,0,0);
* const line = new McDbLine(pt1, pt2);
* const resBuf = line.getSamplePoints(0.1);
* ```
*/
getSamplePoints(dApproxEps: number): MxCADResbuf;
/**
* 线
* @returns
* @example
* ```ts
* import { MxCpp, MxCADResbuf, MxCADUtility, MxCADUiPrPoint} from "mxcad"
* const mxcad = MxCpp.App.getCurrentMxCAD();
let filter = new MxCADResbuf();
filter.AddMcDbEntityTypes("CIRCLE,ARC,LINE,LWPOLYLINE,ELLIPSE");
let aryId = await MxCADUtility.userSelect("选择目标曲线", filter);
if (aryId.length == 0) return;
aryId.forEach(async (id) => {
let event = id.getMcDbEntity() as McDbCurve;
let length = event.getLength().val;
console.log(length)
});
* ```
*/
getLength(): {
val: number;
ret: boolean;
};
}
/**
* 线
* @example
* ```ts
* //参数绘直线 pt1,pt2是直线的两个点。
* import { MxCpp, McDbLine } from "mxcad"'
*
* const line = new McDbLine(); // 构造直线对象
* line.startPoint = pt1; // 设置直线起点
* line.endPoint = pt2; // 设置直线终点
* MxCpp.getCurrentMxCAD().drawEntity(line); // 绘制直线
* ```
* ```ts
//交互绘线,点击画布选择直线的起始点。
import { MxCADUiPrPoint, MxCpp } from "mxcad";
async function MxTest_DrawLine() {
// 取起始点
const getPoint = new MxCADUiPrPoint();
getPoint.setMessage("\n指定第一点:");
let prvPoint = await getPoint.go();
if (!prvPoint) return;
getPoint.setMessage("\n指定下一个点:");
// 循环取点
while (true) {
getPoint.setBasePt(prvPoint as any);
let pt = await getPoint.go();
if (!pt) return;
let line = new McDbLine(prvPoint, pt);
MxCpp.getCurrentMxCAD().drawEntity(line);
prvPoint = pt;
}
}
* ```
*/
export declare class McDbLine extends McDbCurve {
/**
*
* @param imp C++
* @example
* ```ts
* import { McDbLine, McGePoint3d } from 'mxcad';
*
* // 创建 McGePoint3d 对象表示起点和终点
* const startPoint = new McGePoint3d(0, 0, 0);
* const endPoint = new McGePoint3d(10, 10, 0);
* // 通过 McGePoint3d 对象创建 McDbLine 对象
* const line1 = new McDbLine(startPoint, endPoint);
* // 或者直接传入坐标值创建 McDbLine 对象
* const line2 = new McDbLine(0, 0, 0, 10, 10, 0);
* ```
*/
constructor(x1?: object | number, y1?: object | number, z1?: number, x2?: number, y2?: number, z2?: number);
/**
*
* @example
* ```ts
* import { McDbLine } from "mxcad";
*
* const line = new McDbLine(0, 0, 0, 10, 10, 0);
* const pt1 = line.startPoint;
* console.log(pt1)// (0,0,0)
* ```
*/
get startPoint(): McGePoint3d;
/**
*
* @param pt
* @example
* ```ts
* import { McDbLine, McGePoint3d } from "mxcad";
*
* const line = new McDbLine(0, 0, 0, 10, 10, 0);
* line.startPoint = new McGePoint3d(20,0,0)
* ```
*/
set startPoint(pt: McGePoint3d);
/**
*
* @example
* ```ts
* import { McDbLine } from "mxcad";
*
* const line = new McDbLine(0, 0, 0, 10, 10, 0);
* const pt2 = line.endPoint;
* console.log(pt2)// (10,10,0);
* ```
*/
get endPoint(): McGePoint3d;
/**
*
* @param pt
* @example
* ```ts
* import { McDbLine, McGePoint3d } from "mxcad";
*
* const line = new McDbLine(0, 0, 0, 10, 10, 0);
* line.endPoint = new McGePoint3d(20,0,0)
* ```
*/
set endPoint(pt: McGePoint3d);
}
/**
* CAD
* @example
* ```ts
* //绘垂直中间对齐的文字 pt(McGePoint3d) 文字位置点
* import { MxCpp, McDbText } from "mxcad"
*
* const text = new McDbText(); // 构造文字实体对象
* text.textString = "测试文字"; // 设置对象内容
* text.horizontalMode = McDb.TextHorzMode.kTextMid; // 设置文字对齐方式
* text.alignmentPoint = text.position = pt; // 设置文字对齐点和文字位置
* MxCpp.getCurrentMxCAD().drawEntity(text); // 绘制文字对象
*
* ```
* ```ts
// 按线对齐:选择文字对象按目标直线方向对齐
import { MxCADResbuf, MxCADUiPrEntity } from "mxcad";
async function Mx_AlignByLine() {
// 选择目标直线对象
let filter = new MxCADResbuf();
filter.AddMcDbEntityTypes("LINE");
const getLineObj = new MxCADUiPrEntity();
getLineObj.setMessage("请选择目标对齐线对象(选择直线)");
getLineObj.setFilter(filter);
const lineObj_id = await getLineObj.go();
if (!lineObj_id.id) return;
const lineObj = lineObj_id.getMcDbEntity() as McDbLine;
const getTextObj = new MxCADUiPrEntity();
// 选择目标文字对象
let filter2 = new MxCADResbuf();
filter2.AddMcDbEntityTypes("TEXT");
getTextObj.setMessage("请选择目标文字对象");
getTextObj.setFilter(filter2);
const textObj_id = await getTextObj.go();
if (!textObj_id.id) return;
const textObj = textObj_id.getMcDbEntity() as McDbText;
// 计算直线与文字对象角度
const line_v = lineObj.getFirstDeriv(lineObj.getStartPoint().val);// 直线初始点切向量
let angle1 = line_v.val.angleTo2(McGeVector3d.kXAxis, McGeVector3d.kNegateZAxis);//直线与水平方向角度
let angle2 = textObj.rotation;//文字初始角度
textObj.rotate(textObj.position, angle1 - angle2) // 文字对象旋转
const mxcad = MxCpp.App.getCurrentMxCAD();
mxcad.updateDisplay() // 更新显示
}
* ```
*/
export declare class McDbText extends McDbEntity {
/**
*
* @param imp
* @example
* ```ts
* import { McDbText } from "mxcad";
*
* const text = new McDbText();
* ```
*/
constructor(imp?: any);
/**
*
* @example
* ```ts
* // 假设text为有效文本实体
* const position = text.position;
* ```
*/
get position(): McGePoint3d;
/**
*
* @param pt
* @example
* ```ts
* import { McDbText, McGePoint3d } from "mxcad";
*
* const text = new McDbText();
* text.position = new McGePoint3d(0,0,0);
* console.log(text.position)//(0,0,0)
* ```
*/
set position(pt: McGePoint3d);
/**
*
* @example
* ```ts
* // 假设text为有效文本实体
* const alignmentPoint = text.alignmentPoint;
* ```
*/
get alignmentPoint(): McGePoint3d;
/**
*
* @param pt
* @example
* ```ts
* import { McDbText, McGePoint3d } from "mxcad";
*
* const text = new McDbText();
* text.alignmentPoint = new McGePoint3d(0,0,0);
* console.log(text.alignmentPoint)//(0,0,0)
* ```
*/
set alignmentPoint(pt: McGePoint3d);
/**
*
* @example
* ```ts
* // 假设text为有效文本实体
* const oblique = text.oblique;
* ```
*/
get oblique(): number;
/**
*
* @example
* ```ts
* import { McDbText } from "mxcad";
*
* const text = new McDbText();
* text.oblique = Math.PI/4;
* console.log(text.oblique)//45
* ```
*/
set oblique(val: number);
/**
*
* @example
* ```ts
* // 假设text为有效文本实体
* const rotation = text.rotation;
* ```
*/
get rotation(): number;
/**
*
* @example
* ```ts
* import { McDbText } from "mxcad";
*
* const text = new McDbText();
* text.rotation = Math.PI/4;
* console.log(text.rotation)//45
* ```
*/
set rotation(pt: number);
/**
*
* @example
* ```ts
* // 假设text为有效文本实体
* const height = text.height;
* ```
*/
get height(): number;
/**
*
* @param val
* @example
* ```ts
* import { McDbText } from "mxcad";
*
* const text = new McDbText();
* text.height = 20;
* console.log(text.height)//20
* ```
*/
set height(val: number);
/**
*
* @example
* ```ts
* // 假设text为有效文本实体
* const widthFactor = text.widthFactor;
* ```
*/
get widthFactor(): number;
/**
*
* @param val
* @example
* ```ts
* import { McDbText } from "mxcad";
*
* const text = new McDbText();
* text.height = 0.8;
* console.log(text.height)//0.8
* ```
*/
set widthFactor(val: number);
/**
*
* @example
* ```ts
* // 假设text为有效文本实体
* const textString = text.textString;
* ```
*/
get textString(): string;
/**
*
* @param val
* @example
* ```ts
* import { McDbText } from "mxcad";
*
* const text = new McDbText();
* text.textString = "测试文本";
* console.log(text.textString)//测试文本
* ```
*/
set textString(val: string);
/**
*
* @example
* ```ts
* // 假设text为有效文本实体
* const horizontalMode = text.horizontalMode;
* ```
*/
get horizontalMode(): McDb.TextHorzMode;
/**
*
* @param val
* @example
* ```ts
* import { McDbText, McDb } from "mxcad";
*
* const text = new McDbText();
* text.horizontalMode = McDb.TextHorzMode.kTextAlign;
* console.log(text.horizontalMode)//3
* ```
*/
set horizontalMode(val: McDb.TextHorzMode);
/**
*
* @example
* ```ts
* // 假设text为有效文本实体
* const verticalMode = text.verticalMode;
* ```
*/
get verticalMode(): McDb.TextVertMode;
/**
*
* @param val
* @example
* ```ts
* import { McDbText, McDb } from "mxcad";
*
* const text = new McDbText();
* text.verticalMode = McDb.TextVertMode.kTextVertMid;
* console.log(text.verticalMode)//2
* ```
*/
set verticalMode(val: McDb.TextVertMode);
}
/**
*
* @example
* ```ts
import { McDbBlockReference, McDbAttribute } from "mxcad"
// 遍历块中的属性文字 ent:块实体
let blkRef: McDbBlockReference = ent;
let aryId = blkRef.getAllAttribute();
aryId.forEach((id) => {
let attribt: McDbAttribute = id.getMcDbEntity() as any;
console.log(attribt.textString);
console.log(attribt.tag);
})
* ```
* ```ts
// 在块中插入属性文字 ent:块实体
let blkRef: McDbBlockReference = ent;
const blkrecId = blkRef.blockTableRecordId; // 获取块表记录id
let blkRecord: any = blkrecId.getMcDbBlockTableRecord();// 获取块表记录对象
let ids = blkRecord.getAllEntityId(); // 获取块表记录中所有实例对象ID
ids.forEach((id: any, index: any) => {
// 筛选 McDbAttributeDefinition 对象
if (!id.isKindOf("McDbAttributeDefinition")) return;
let attribDef = id.getMcDbEntity() as McDbAttributeDefinition;
let tag = attribDef.tag; // 获取属性标签
let txt = attribDef.textString; // 获取文字的字符串
let attrib = new McDbAttribute(); // 构造新属性定义文字对象
attrib.position = attribDef.position; // 设置对象位置
attrib.alignmentPoint = attribDef.alignmentPoint // 设置对象对齐位置
attrib.height = attribDef.height ; // 设置对象字高
attrib.trueColor = attribDef.trueColor // 设置对象颜色
attrib.widthFactor = attribDef.widthFactor; // 设置对象宽度因子
// 设置文字的字符串
if (txt.length > 0) attrib.textString = txt;
else attrib.textString = "test" + index;
attrib.tag = tag;// 设置属性标签
attrib.isInvisible = attribDef.isInvisible;
attrib.transformBy(blkRef.blockTransform); // 块转换
attrib = blkRef.appendAttribute(attrib).getMcDbEntity() as McDbAttribute;
attrib.textStyle = attribDef.textStyle
attrib.layer = attribDef.layer
})
* ```
*/
export declare class McDbAttribute extends McDbText {
/**
*
* @param imp
* @example
* ```ts
* import { McDbAttribute } from "mxcad";
*
* const attrib = new McDbAttribute();
* ```
*/
constructor(imp?: any);
/**
*
* @example
* ```ts
* import { McDbAttribute } from "mxcad";
*
* const attrib = new McDbAttribute();
* const tag = attrib.tag;
* ```
*/
get tag(): string;
/**
*
* @example
* ```ts
* import { McDbAttribute } from "mxcad";
*
* const attrib = new McDbAttribute();
* attrib.tag = "example_tag"
* ```
*/
set tag(val: string);
/**
*
* @example
* ```ts
* import { McDbAttribute } from "mxcad";
*
* const attrib = new McDbAttribute();
* const isV = attrib.isInvisible;
* if(isV){
* //属性可见
* }else{
* //属性不可见
* }
* ```
*/
get isInvisible(): boolean;
/**
*
* @example
* ```ts
* import { McDbAttribute } from "mxcad";
*
* const attrib = new McDbAttribute();
* attrib.isInvisible = true;
*/
set isInvisible(val: boolean);
}
/**
*
*/
export declare class McDbAttributeDefinition extends McDbText {
/**
*
* @param imp
*/
constructor(imp?: any);
/**
*
*/
get tag(): string;
/**
*
* @example
* ```ts
* import { McDbAttributeDefinition } from "mxcad";
*
* const attribute = new McDbAttributeDefinition();
* attribute.tag = "TagName"; // 设置属性标签
* console.log(attribute.tag); // 获取属性标签
* ```
*/
set tag(val: string);
/**
*
*/
get isInvisible(): boolean;
/**
*
* @example
* ```ts
* import { McDbAttributeDefinition } from "mxcad";
*
* const attribute = new McDbAttributeDefinition();
* attribute.isInvisible = true; // 设置属性为不可见
* console.log(attribute.isInvisible); // 获取属性是否可见
* ```
*/
set isInvisible(val: boolean);
/** 获取插入块实例时,提示用户输入值的文本 */
get prompt(): string;
/**
*
* @example
* ```ts
* import { McDbAttributeDefinition } from "mxcad";
*
* const attribute = new McDbAttributeDefinition();
* attribute.prompt = "Enter value here"; // 设置属性的提示文本
* console.log(attribute.prompt); // 获取属性的提示文本
* ```
*/
set prompt(val: string);
/** 获取指示属性是否是常量 */
get isConstant(): boolean;
/**
*
* @example
* ```ts
* import { McDbAttributeDefinition } from "mxcad";
*
* const attribute = new McDbAttributeDefinition();
* attribute.isConstant = true; // 设置属性为常量
* console.log(attribute.isConstant); // 获取属性是否是常量
* ```
*/
set isConstant(val: boolean);
/** 获取属性是否可验证 */
get isVerifiable(): boolean;
/**
*
* @example
* ```ts
* import { McDbAttributeDefinition } from "mxcad";
*
* const attribute = new McDbAttributeDefinition();
* attribute.isVerifiable = true; // 设置属性可验证
* console.log(attribute.isVerifiable); // 获取属性是否可验证
* ```
*/
set isVerifiable(val: boolean);
/** 获取属性是否预设 */
get isPreset(): boolean;
/**
*
* @example
* ```ts
* import { McDbAttributeDefinition } from "mxcad";
*
* const attribute = new McDbAttributeDefinition();
* attribute.isPreset = true; // 设置属性预设
* console.log(attribute.isPreset); // 获取属性是否预设
* ```
*/
set isPreset(val: boolean);
}
/**
*
* @example
* ```ts
// 绘制多行文本
import { McDbMText, MxCpp } from 'mxcad'
const mText = new McDbMText();// 构造新多行文本对象
mText.textHeight = 10;// 设置文本高度
mText.attachment = McDb.AttachmentPoint.kMiddleLeft;// 设置文本对齐方式
mText.contents = '控件:\\P 多行文本'; // 设置文本内容
mText.location = new McGePoint3d(0,0,0); // 设置文本位置
MxCpp.getCurrentMxCAD().drawEntity(mText); // 绘制多行文本
* ```
*/
export declare class McDbMText extends McDbEntity {
/**
*
* @param imp
* @example
* ```ts
* import { McDbMText } from "mxcad";
* const mText = new McDbMText();
* ```
*/
constructor(imp?: any);
/**
*
* @returns
* @example
* ```ts
* //mText 为有效多行文本
* const pt = mText.location
* ```
*/
get location(): McGePoint3d;
/**
*
* @param pt
* @example
* ```ts
* import { McDbMText, McGePoint3d } from "mxcad";
* const mText = new McDbMText();
* mText.location = new McGePoint3d(0,0,0)
* ```
*/
set location(pt: McGePoint3d);
/**
*
* @returns
* @example
* ```ts
* //mText 为有效多行文本
* const rotation = mText.rotation
* ```
*/
get rotation(): number;
/**
*
* @param val
* @example
* ```ts
* import { McDbMText } from "mxcad";
* const mText = new McDbMText();
* mText.rotation = Math.PI/4
* ```
*/
set rotation(val: number);
/**
*
* @returns
* @example
* ```ts
* //mText 为有效多行文本
* const width = mText.width
* ```
*/
get width(): number;
/**
*
* @param val
* @example
* ```ts
* import { McDbMText } from "mxcad";
* const mText = new McDbMText();
* mText.width = 10;
* ```
*/
set width(val: number);
/**
*
* @returns
* @example
* ```ts
* //mText 为有效多行文本
* const textHeight = mText.textHeight
* ```
*/
get textHeight(): number;
/**
*
* @param val
* @example
* ```ts
* import { McDbMText } from "mxcad";
* const mText = new McDbMText();
* mText.textHeight = 20;
* ```
*/
set textHeight(val: number);
/**
*
* @returns
* @example
* ```ts
* //mText 为有效多行文本
* const attachment = mText.attachment
* ```
*/
get attachment(): McDb.AttachmentPoint;
/**
*
* @param val
* @example
* ```ts
* import { McDbMText, McGePoint3d } from "mxcad";
* const mText = new McDbMText();
* mText.attachment = new McGePoint3d(0,0,0);
* ```
*/
set attachment(val: McDb.AttachmentPoint);
/**
*
* @returns
* @example
* ```ts
* //mText 为有效多行文本
* const contents = mText.contents
* ```
*/
get contents(): string;
/**
*
* @param val
* @example
* ```ts
* import { McDbMText, McGePoint3d } from "mxcad";
* const mText = new McDbMText();
* mText.contents = "测试文本1 \\P 测试文本2";
* ```
*/
set contents(val: string);
/**
*
* @returns
* @example
* ```ts
* //mText 为有效多行文本
* const str = mText.getTextString();
* ```
*/
getTextString(): string;
}
/**
*
* @example
* ```ts
* import { McDbCircle, MxCpp } from 'mxcad'
*
* //绘制一个圆心在原点,半径为20的圆
* const circle = new McDbCircle(new McGePoint3d(0,0,0), 20);
* MxCpp.getCurrentMxCAD().drawEntity(circle);
* ```
* ```ts
import { McDbCircle, MxCpp, McGePoint3d } from 'mxcad'
//交互绘圆
async function drawCircle() {
const getPoint = new MxCADUiPrPoint();
let circle = new McDbCircle();
// 获取当前绘线颜色
let drawColor = MxCpp.getCurrentMxCAD().getCurrentDatabaseDrawColor();
circle.trueColor = new McCmColor(drawColor) //设置圆颜色
let drawMethod: "default" | "3P" | "2P" | undefined
let isRadius: boolean | undefined
let center: McGePoint3d | null | undefined
let radius: number | undefined
let point1: McGePoint3d | null | undefine
let point2: McGePoint3d | null | undefined
let point3: McGePoint3d | null | undefined
let endPoint1: McGePoint3d | null | undefined
let endPoint2: McGePoint3d | null | undefined
// 循环取点
while (true) {
if(typeof drawMethod === "undefined") {
getPoint.setKeyWords("[三点(3P)/两点(2P)]");// 设置关键词
drawMethod = "default"
}
if (drawMethod === "default") {
// 设置圆心
if (!center) {
getPoint.setMessage("\n指定圆的圆心");
const point = await getPoint.go()
if (getPoint.isKeyWordPicked("3P")) {
drawMethod = "3P"
continue
}
if (getPoint.isKeyWordPicked("2P")) {
drawMethod = "2P"
continue
}
if (!point) return
center = point
}
// 设置半径
if (!radius) {
const getDist = new MxCADUiPrDist()
getDist.setBasePt(center)
if(typeof isRadius === "undefined") {
getDist.setKeyWords("[直径(D)]");
isRadius = true
}
getDist.setMessage(_ML_String("McDbCircle_Radius", "指定圆的" + (isRadius ? "半径" : "直径")));
// 动态绘制圆
getDist.setUserDraw(
(
currentPoint,
pWorldDraw
) => {
if (!center) return
let circle = new McDbCircle(center.x, center.y, center.z, isRadius
? center.distanceTo(currentPoint)
: center.distanceTo(currentPoint) / 2)
pWorldDraw.drawMcDbEntity(circle);
pWorldDraw.drawLine(circle.center.toVector3(), currentPoint.toVector3());
}
);
const _radius = await getDist.go()
if(getDist.isKeyWordPicked("D")) {
isRadius = false
getDist.clearLastInputPoint()
getDist.setBasePt(center)
getDist.setMessage(_ML_String("McDbCircle_Diameter", "指定圆的直径"));
getDist.setKeyWords("")
const diameter = await getDist.go()
if(!diameter) return
radius = diameter / 2
}
if(!radius) {
if (!_radius) return
radius = _radius as number
}
}
circle.center = center
circle.radius = radius
return MxCpp.getCurrentMxCAD().drawEntity(circle)
}
if (drawMethod === "3P") {
if(!point1) {
getPoint.setMessage("指定圆上的第一个点")
getPoint.setKeyWords("")
point1 = await getPoint.go()
if(!point1) return
}
if(!point2) {
getPoint.setMessage("指定圆上的第二个点")
getPoint.setKeyWords("")
getPoint.setUserDraw((pt, pw) => {
if(!point1) return
pw.drawLine(point1.toVector3(), pt.toVector3());
})
point2 = await getPoint.go()
if (!point2) return
}
if(!point3) {
getPoint.setMessage("指定圆上的第三个点")
getPoint.setKeyWords("")
getPoint.setUserDraw((pt, pw) => {
if(!point1) return
if(!point2) return
const center = threePointsToDetermineTheCenterOfTheCircle([
point1,
point2,
pt,
]);
if (center) {
const circle = new McDbCircle(center.x, center.y, center.z, center.distanceTo(point1))
pw.drawMcDbEntity(circle)
}
})
point3 = await getPoint.go()
if(!point3) return
}
const center = threePointsToDetermineTheCenterOfTheCircle([
point1,
point2,
point3,
]);
const circle = new McDbCircle(center.x, center.y, center.z, center.distanceTo(point1))
return MxCpp.getCurrentMxCAD().drawEntity(circle)
}
if(drawMethod === "2P") {
if(!endPoint1) {
getPoint.setMessage("指定圆直径的第一个端点")
getPoint.setKeyWords("")
endPoint1 = await getPoint.go()
if(!endPoint1) return
}
if(!endPoint2) {
getPoint.setMessage("指定圆直径的第二个端点")
getPoint.setKeyWords("")
getPoint.setUserDraw((pt, pw)=> {
if(!endPoint1) return
center = new McGePoint3d((pt.x + endPoint1.x) / 2, (pt.y + endPoint1.y) / 2, (pt.z + endPoint1.z) / 2)
radius = center.distanceTo(endPoint1)
pw.drawMcDbEntity(new McDbCircle(center.x, center.y, center.z, radius))
})
endPoint2 = await getPoint.go()
if(!endPoint2) return
}
center = new McGePoint3d((endPoint2.x + endPoint1.x) / 2, (endPoint2.y + endPoint1.y) / 2, (endPoint2.z + endPoint1.z) / 2)
radius = center.distanceTo(endPoint1)
return MxCpp.getCurrentMxCAD().drawEntity(new McDbCircle(center.x, center.y, center.z, radius))
}
}
}
* ```
*/
export declare class McDbCircle extends McDbCurve {
/**
*
* @param imp
* @example
* ```ts
* import { McDbCircle } from 'mxcad'
*
* //绘制一个圆心在原点,半径为20的圆
* const circle1 = new McDbCircle(new McGePoint3d(0,0,0), 20);
* //绘制一个圆心在原点,半径为10的圆
* const circle2 = new McDbCircle(0, 0, 0, 10);
* ```
*/
constructor(x?: object | number, y?: number, z?: number, radius?: number);
/**
*
* @param x x
* @param y y
* @param z z
* @example
* ```ts
* import { McDbCircle } from 'mxcad'
*
* const circle = new McDbCircle();
* circle.setCenter(0, 0, 0)//设置圆心在(0,0,0)
* ```
*/
setCenter(x: number, y: number, z?: number): void;
/**
*
* @example
* ```ts
* import { McDbCircle } from 'mxcad'
*
* const circle = new McDbCircle();
* circle.setCenter(20, 10, 0)//设置圆心在(20, 10, 0);
* const center = circle.center;
* console.log(center);//(20, 10, 0)
* ```
*/
get center(): McGePoint3d;
/**
*
* @param pt
* @example
* ```ts
* import { McDbCircle } from 'mxcad'
*
* const circle = new McDbCircle();
* circle.center = new McDbCircle(10, 10, 0);
* ```
*/
set center(pt: McGePoint3d);
/**
*
* @example
* ```ts
* import { McDbCircle } from 'mxcad'
*
* const circle = new McDbCircle(new McGePoint3d(0,0,0), 20);
* const radius = circle.radius;
* console.log(radius)//20
* ```
*/
get radius(): number;
/**
*
* @param r
* @example
* ```ts
* import { McDbCircle } from 'mxcad'
*
* const circle = new McDbCircle();
* circle.radius = 20;
* ```
*/
set radius(r: number);
}
/**
* 线
* @example
* ```ts
* import { McDbPolyline, MxCpp } from 'mxcad'
* //绘制线宽为10的矩形,pt1,pt2,pt3,pt4为矩形的4点个顶点
* const pl = new McDbPolyline();
* pl.constantWidth = 10;// 设置多段线线宽为10
* // 设置多段线端点
* pl.addVertexAt(pt1);
* pl.addVertexAt(pt2);
* pl.addVertexAt(pt3);
* pl.addVertexAt(pt4);
* pl.isClosed = true; // 设置多段线是否闭合
* MxCpp.getCurrentMxCAD().drawEntity(pl); // 绘制多段线
* ```
* ```ts
// 绘制中心矩形:指定矩形宽高与中心点,动态绘制矩形
import { McDbPolyline, MxCpp, MxCADUiPrDist, MxCADUiPrPoint } from 'mxcad';
async function Mx_CenterRect() {
// 设置矩形宽度
let width = 5;
const getWidth = new MxCADUiPrDist();
getWidth.setMessage("\n请输入矩形宽度<5>");
const widthVal = await getWidth.go();
if (widthVal) {
width = getWidth.value()
}
// 设置矩形高度
let height = 10;
const getHeight = new MxCADUiPrDist();
getHeight.setMessage("\n请输入矩形高度<10>");
const heightVal = await getHeight.go();
if (heightVal) {
height = getHeight.value()
}
// 设置矩形的中心点
const getCenterPt = new MxCADUiPrPoint();
getCenterPt.setMessage("请点击确定矩形中心");
const centerPt = await getCenterPt.go();
if (!centerPt) return;
// 根据矩形的中心点和宽高计算矩形的四个顶点
let pt1 = new McGePoint3d(centerPt.x + width / 2, centerPt.y + height / 2, centerPt.z)
let pt2 = new McGePoint3d(centerPt.x - width / 2, centerPt.y + height / 2, centerPt.z)
let pt3 = new McGePoint3d(centerPt.x - width / 2, centerPt.y - height / 2, centerPt.z)
let pt4 = new McGePoint3d(centerPt.x + width / 2, centerPt.y - height / 2, centerPt.z)
let pl = new McDbPolyline;// 构造一个多段线对象
// 依次添加矩形顶点
pl.addVertexAt(pt1)
pl.addVertexAt(pt2)
pl.addVertexAt(pt3)
pl.addVertexAt(pt4)
const mxcad = MxCpp.App.getCurrentMxCAD();
pl.isClosed = true; // 设置多段线闭合
mxcad.drawEntity(pl); // 绘制多段线对象
}
* ```
*/
export declare class McDbPolyline extends McDbCurve {
/**
*
* @param imp
* @example
* ```ts
* import { McDbPolyline } from "mxcad";
* const pl = new McDbPolyline();
* ```
*/
constructor(imp?: any);
/**
*
* @example
* ```ts
* import { McDbPolyline } from "mxcad";
* const pl = new McDbPolyline();
* pl.isClosed = true;//设置多线段闭合
* const res = pl.isClosed;
* console.log(res)//true
* ```
*/
get isClosed(): boolean;
/**
*
* @param val
* @example
* ```ts
* import { McDbPolyline } from "mxcad";
*
* const pl = new McDbPolyline();
* pl.isClosed = true;//设置多线段闭合
* ```
*/
set isClosed(val: boolean);
/**
*
* @example
* ```ts
* // pl 为有效多段线对象
* const width = pl.constantWidth;
* ```
*/
get constantWidth(): number;
/**
*
* @param val
* @example
* ```ts
* import { McDbPolyline } from "mxcad";
*
* const pl = new McDbPolyline();
* pl.constantWidth = 10;//设置多线段常量宽度为10
* ```
*/
set constantWidth(val: number);
/**
*
* @param index
* @param pt
* @param bulge
* @param startWidth
* @param endWidth
* @example
* ```ts
* import { McDbPolyline, MxCpp } from "mxcad";
*
* const pl = new McDbPolyline();
* pl.isClosed = true;
* pl.addVertexAt(new McGePoint3d(800, 300, 0),0,10,10);
* pl.addVertexAt(new McGePoint3d(900, 300, 0),0,10,10);
* pl.addVertexAt(new McGePoint3d(900, 400, 0),0,10,10);
* MxCpp.getCurrentMxCAD().drawEntity(pl);
* ```
*/
addVertexAt(pt: McGePoint3d | THREE.Vector3, bulge?: number, startWidth?: number, endWidth?: number, index?: number): boolean;
/**
*
* @param index
* @example
* ```ts
* // pl 为有效多段线对象
* const res = pl.removeVertexAt(2);
* if(res){
* //移除成功
* }else{
* //移除失败
* }
* ```
*/
removeVertexAt(index: number): boolean;
/**
*
* @example
* ```ts
* // pl 为有效多段线对象
* const num = pl.numVerts();
* ```
*/
numVerts(): number;
/**
*
* @param index
* @returns val: , ret: 返回值
* @example
* ```ts
* // pl 为有效多段线对象
* const res = pl.getPointAt(2);
* const point = res.val;
* ```
*/
getPointAt(index: number): {
val: McGePoint3d;
ret: number;
};
/**
*
* @param index
* @example
* ```ts
* // pl 为有效多段线对象
* const bulge = pl.getBulgeAt(2);
* ```
*/
getBulgeAt(index: number): number;
/**
*
* @param index
* @returns val1: 起始宽度, val2: 结束宽度, ret: 返回值
* @example
* ```ts
* // pl 为有效多段线对象
* const width = pl.getWidthsAt(2);
* if(width.ret){
* const startWidth = width.val1;
* const endWidth = width.val2
* }else{
* //获取失败
* }
* ```
*/
getWidthsAt(index: number): {
val1: number;
val2: number;
ret: boolean;
};
/**
*
* @param index
* @param pt
* @example
* ```ts
* import { McDbPolyline, McGePoint3d } from "mxcad";
*
* const pl = new McDbPolyline();
* pl.setPointAt(0,new McGePoint3d(0,0,0));
* pl.setPointAt(1,new McGePoint3d(10,10,0));
* ```
*/
setPointAt(index: number, pt: McGePoint3d): boolean;
/**
*
* @param index
* @param bulge
* @example
* ```ts
* import { McDbPolyline, McGePoint3d } from "mxcad";
*
* const pl = new McDbPolyline();
* pl.addVertexAt(new McGePoint3d(800, 300, 0));
* const res = pl.setBulgeAt(0, 10);
* if(res){
* //设置成功
* }else{
* //设置失败
* }
* ```
*/
setBulgeAt(index: number, bulge: number): boolean;
/**
* 线
* @param index
* @param bulge
* @example
* ```ts
* import { McDbPolyline, McGePoint3d } from "mxcad";
*
* const pl = new McDbPolyline();
* pl.addVertexAt(new McGePoint3d(800, 300, 0));
* const res = pl.setWidthsAt(0, 10, 10);
* if(res){
* //设置成功
* }else{
* //设置失败
* }
* ```
*/
setWidthsAt(index: number, dStartWdith: number, dEntWdith: number): boolean;
/**
* 线
* @example
* ```ts
* // pl 为有效多段线对象
* const type = pl.getType();
* ```
*/
getType(): McDb.PolylineType;
/**
* 线
* @param type 线
* @example
* ```ts
* // pl 为有效多段线对象
* pl.setType(McDb.PolylineType.kLwPolyline);
* ```
*/
setType(type: McDb.PolylineType): boolean;
}
/**
* CAD McDbBlockTableRecord中的一个实体集合的实例
* @example
* ```ts
* //插入图块
import { McDbBlockReference } from "mxcad"
let mxcad = MxCpp.App.getCurrentMxCAD();
// blkFilePath:图块路径,插入图块
let blkrecId = await mxcad.insertBlock(blkFilePath, "tree");
if (!blkrecId.isValid()) {
// 插入图块
return;
}
// 构造一个新图块引用实体对象
let blkRef = new McDbBlockReference();
// 设置图块记录对象ID
blkRef.blockTableRecordId = blkrecId;
// 得到图块的最小外包
let box = blkRef.getBoundingBox();
if (box.ret) {
let dLen = box.maxPt.distanceTo(box.minPt);
if (dLen > 0.00001) {
blkRef.setScale(mxcad.getMxDrawObject().screenCoordLong2Doc(100) / dLen);
}
}
// 设置图块插入点
let getPoint = new MxCADUiPrPoint();
getPoint.setMessage("\指定插入基点");
// 动态绘制图块
getPoint.setUserDraw((v, worldDraw) => {
blkRef.position = v;
worldDraw.drawMcDbEntity(blkRef);
});
let pt = await getPoint.go();
if (!pt) return;
blkRef.position = pt;// 设置块位置
let newBlkRefId = mxcad.drawEntity(blkRef);// 绘制图块
if (!newBlkRefId.isValid) {
console.log("insert error");
return;
}
* ```
*/
export declare class McDbBlockReference extends McDbEntity {
/**
* McDbBlockReference
* @param imp C++
* @example
* ```ts
* import { McDbBlockReference } from "mxcad";
*
* const blkRef = new McDbBlockReference();
* ```
*/
constructor(imp?: any);
/**
* ID
* @example
* ```ts
import { McDbBlockReference, McDbBlockTableRecord } from "mxcad";
let blkRef = new McDbBlockReference();
let blkRecId = blkTable.add(new McDbBlockTableRecord());//图块记录
blkRef.blockTableRecordId = blkrecId;
console.log(blkRef.blockTableRecordId)
* ```
*/
get blockTableRecordId(): McObjectId;
set blockTableRecordId(val: McObjectId);
/**
*
* @example
* ```ts
import { McDbBlockReference, McGePoint3d } from "mxcad";
let blkRef = new McDbBlockReference();
blkRef.position = new McGePoint3d(0, 0, 0);
* ```
*/
get position(): McGePoint3d;
set position(pt: McGePoint3d);
/**
*
* @example
* ```ts
import { McGePoint3d, McDbBlockReference } from 'mxcad';
const blkRef = new McDbBlockReference();
// 获取初始缩放因子
const initialScaleFactors = blkRef.scaleFactors;
console.log('Initial Scale Factors:', initialScaleFactors); // 输出初始缩放因子
// 设置新的缩放因子
const newScaleFactors = new McGePoint3d(2, 2, 2); // 假设将缩放因子设置为 (2, 2, 2)
blkRef.scaleFactors = newScaleFactors;
// 再次获取缩放因子
const updatedScaleFactors = blkRef.scaleFactors;
console.log('Updated Scale Factors:', updatedScaleFactors); // 输出更新后的缩放因子
* ```
*/
get scaleFactors(): McGePoint3d;
set scaleFactors(val: McGePoint3d);
/**
*
* @param val
* @example
* ```ts
import { McDbBlockReference } from 'mxcad'; // 假设这是你的类和库
const blkRef = new McDbBlockReference();
// 设置缩放比例为 2
blkRef.setScale(2);
// 获取缩放比例
const scale = blkRef.getScale();
console.log('Current Scale:', scale); // 输出当前缩放比例
* ```
*/
setScale(val: number): void;
getScale(): number;
/**
*
* @example
* ```ts
import { McDbBlockReference } from 'mxcad'; // 假设这是你的类和库
const blkRef = new McDbBlockReference();
blkRef.rotation = Math/4;
const rotation = blkRef.rotation;
console.log('Current rotation:', rotation); // 输出当前旋转角度
* ```
*/
get rotation(): number;
set rotation(val: number);
/**
*
* @example
* ```ts
* // blkRef 为有效CAD 图块引用实体
* let mat = blkRef.blockTransform;
* ```
*/
get blockTransform(): McGeMatrix3d;
set blockTransform(val: McGeMatrix3d);
/**
*
* @returns
* @example
* ```ts
* // blkRef 为有效CAD 图块引用实体
* let blkName = blkRef.blockName;
* ```
*/
get blockName(): string;
/**
*
* @param attrib
* @returns Id
* @example
* ```ts
* // blkRef 为有效CAD 图块引用实体
* let attrib = new McDbAttribute();
* attrib.textString = "test";
* const objId = blkRef.appendAttribute(attrib);
* ```
*/
appendAttribute(attrib: McDbAttribute): McObjectId;
/**
* id
* @returns id数组
* @example
* ```ts
* // blkRef 为有效CAD 图块引用实体
* let aryId = blkRef.getAllAttribute();
* aryId.forEach((id) => {
* let attribt: McDbAttribute = id.getMcDbEntity() as any;
* })
* ```
*/
getAllAttribute(): McObjectId[];
/**
*
* @example
* ```ts
* // blkRef 为有效CAD 图块引用实体
* let res = blkRef.createAttribute();
* if(res){
* //创建成功
* }else{
* //创建失败
* }
* ```
*/
createAttribute(): boolean;
/**
*
* @returns
* @example
* ```ts
* ```
*/
getSpatialFilterId(): McObjectId;
/**
*
* @returns
* @example
* ```ts
* ```
*/
createSpatialFilter(): boolean;
/**
* 使.
* @returns
* @example
* ```ts
* ```
*/
clearSpatialFilterCache(): boolean;
}
/**
* CAD
* @example
* ```ts
* ```
*/
export declare class McDbSpatialFilter extends McDbObject {
/**
* McDbSpatialFilter
* @example
* ```ts
* ```
*/
constructor(imp?: any);
/**
* .
* @returns
* @example
* ```ts
* ```
*/
boundary(): McGePoint3dArray;
/**
*
* @returns
* @example
* ```ts
* ```
*/
setBoundary(aryPoint: McGePoint3dArray): boolean;
/**
*
* @returns
* @example
* ```ts
* ```
*/
isFilterInverted(): boolean;
/**
*
* @returns
* @example
* ```ts
* ```
*/
setFilterInverted(val: boolean): boolean;
/**
*
* @returns
* @example
* ```ts
* ```
*/
isEnabled(): boolean;
/**
*
* @returns
* @example
* ```ts
* ```
*/
setEnable(val: boolean): boolean;
}
/**
* AutoCAD中所有标注实体类型的类的基类
*/
export declare class McDbDimension extends McDbEntity {
/**
*
* @param imp
*/
constructor(imp?: any);
/**
*
* @returns
* @example
* ```ts
* //设置 dim 为有效标注实体
* const position = dim.textPosition;
* console.log(position);
* ```
*/
get textPosition(): McGePoint3d;
/**
*
* @param pt
* @example
* ```ts
* //设置 dim 为有效标注实体
* dim.textPosition = new McGePoint3(0,0,0);
* ```
*/
set textPosition(pt: McGePoint3d);
/**
* 使
* @returns 使
* @example
* ```ts
* //设置 dim 为有效标注实体
* const isUsing = dim.isUsingDefaultTextPosition;
* if(isUsing){
* //使用默认文本位置
* }else{
* //未使用默认文本位置
* }
* ```
*/
isUsingDefaultTextPosition(): boolean;
/**
* 使
* @example
* ```ts
* //设置 dim 为有效标注实体
* dim.useSetTextPosition();
* ```
*/
useSetTextPosition(): void;
/**
* 使
* @example
* ```ts
* //设置 dim 为有效标注实体
* dim.useDefaultTextPosition();
* ```
*/
useDefaultTextPosition(): void;
/**
*
* @param val
* @example
* ```ts
* //设置 dim 为有效标注实体
* dim.elevation = 10;
* console.log("获取高度:", dim.elevation)
* ```
*/
get elevation(): number;
set elevation(val: number);
/**
*
* @param val
* @example
* ```ts
* //设置 dim 为有效标注实体
* dim.dimensionText = "测试文本";
* console.log("标注文本:", dim.dimensionText)// 测试文本
* ```
*/
get dimensionText(): string;
set dimensionText(val: string);
/**
*
* @param val
* @example
* ```ts
* //设置 dim 为有效标注实体
* dim.textRotation = Math.PI/4;
* console.log("旋转角度:", dim.textRotation)
* ```
*/
get textRotation(): number;
set textRotation(val: number);
/**
* id
* @param val id
* @example
* ```ts
* import { MxCpp } from "mxcad";
*
* //设置 dim 为有效标注实体
* const dimStyleId = MxCpp.getCurrentMxCAD().addDimStyle("MyDimStyle2", "41,0.18,141,0.09,40,200", "77,1,271,3", "", "");
* dim.dimensionStyle = dimStyleId;
* console.log("标注样式id:", dim.dimensionStyle)
* ```
*/
get dimensionStyle(): McObjectId;
set dimensionStyle(val: McObjectId);
/**
*
* @returns
* @example
* ```ts
* import { McDb } from "mxcad";
*
* //设置 dim 为有效标注实体
* dim.textAttachment = McDb.AttachmentPoin.kMiddleCenter//设置中心点对齐
* console.log("文本附着点:", dim.textAttachment)// 5
* ```
*/
get textAttachment(): McDb.AttachmentPoint;
set textAttachment(val: McDb.AttachmentPoint);
/**
*
* @returns
* @example
* ```ts
* //设置 dim 为有效标注实体
* dim.horizontalRotation = Math.PI/4
* console.log("水平旋转角度:", dim.horizontalRotation)// 45
* ```
*/
get horizontalRotation(): number;
set horizontalRotation(val: number);
/**
*
* @example
* ```ts
* //设置 dim 为有效标注实体
* dim.recomputeDimBlock()
* ```
*/
recomputeDimBlock(): void;
/**
*
* @param iType
* @returns
*/
getDimVarInt(iType: number): number;
/**
*
* @param iType
* @param val
*/
setDimVarInt(iType: number, val: number): void;
/**
*
* @param iType
* @returns
*/
getDimVarDouble(iType: number): number;
/**
*
* @param iType
* @param val
*/
setDimVarDouble(iType: number, val: number): void;
/**
*
* @param iType
* @returns
*/
getDimVarString(iType: number): string;
/**
*
* @param iType
* @param val
*/
setDimVarString(iType: number, val: string): void;
/**
* ID
* @param iType
* @returns ID
*/
getDimVarObjectId(iType: number): McObjectId;
/**
* ID
* @param iType
* @param val ID
*/
setDimVarObjectId(iType: number, val: McObjectId): void;
/**
*
* @example
* ```ts
* //遍历dim中的所有文字
* //设置 dim 为有效标注实体
* let txts = dim.GetAllText();
* txts.forEach((val, index) => {
* console.log(val)
* });
* ```
*/
GetAllText(): McGeStringArray;
}
/**
*
* @example
* ```ts
//绘制对齐标注
import { McDbAlignedDimension, MxCpp } from "mxcad"
const mDimension = new McDbAlignedDimension() // 构造对齐标注对象
mDimension.xLine1Point = new McGePoint3d(-1800, 800) // 设置对象第一条线的端点
mDimension.xLine2Point = new McGePoint3d(1800,800) // 设置对象第二条线的端点
mDimension.dimLinePoint = new McGePoint3d(800, 500) // 设置对象标注线的端点
mDimension.textAttachment = McDb.AttachmentPoint.kTopLeft // 设置对象文本对齐方式
mDimension.trueColor = new McCmColor(200, 255, 0) // 设置对象颜色
mDimension.oblique = 0 // 设置对象倾斜角度
MxCpp.getCurrentMxCAD().drawEntity(mDimension); //绘制对齐标注对象
* ```
*/
export declare class McDbAlignedDimension extends McDbDimension {
/**
*
* @param imp
* @example
* ```ts
* import { McDbAlignedDimension } from "mxcad";
*
* const mDimension = new McDbAlignedDimension()
* ```
*/
constructor(imp?: any);
/**
* 线
* @returns 线
* @example
* ```ts
* //mDimension 为有效对齐标注尺寸
* const pt1 = mDimension.xLine1Point;
* ```
*/
get xLine1Point(): McGePoint3d;
/**
* 线
* @param pt 线
* @example
* ```ts
* import { McDbAlignedDimension, McGePoint3d } from "mxcad";
*
* const mDimension = new McDbAlignedDimension();
* mDimension.xLine1Point = new McGePoint3d(0,0,0);
* ```
*/
set xLine1Point(pt: McGePoint3d);
/**
* 线
* @returns 线
* @example
* ```ts
* //mDimension 为有效对齐标注尺寸
* const pt2 = mDimension.xLine2Point;
* ```
*/
get xLine2Point(): McGePoint3d;
/**
* 线
* @param pt 线
* @example
* ```ts
* import { McDbAlignedDimension, McGePoint3d } from "mxcad";
*
* const mDimension = new McDbAlignedDimension();
* mDimension.xLine2Point = new McGePoint3d(20,0,0)
* ```
*/
set xLine2Point(pt: McGePoint3d);
/**
* 线
* @returns 线
* @example
* ```ts
* //mDimension 为有效对齐标注尺寸
* const pt = mDimension.dimLinePoint;
* ```
*/
get dimLinePoint(): McGePoint3d;
/**
* 线
* @param pt 线
* @example
* ```ts
* import { McDbAlignedDimension, McGePoint3d } from "mxcad";
*
* const mDimension = new McDbAlignedDimension();
* mDimension.dimLinePoint = new McGePoint3d(20,0,0)
* ```
*/
set dimLinePoint(pt: McGePoint3d);
/**
*
* @returns
* @example
* ```ts
* //mDimension 为有效对齐标注尺寸
* const pt = mDimension.oblique;
* ```
*/
get oblique(): number;
/**
*
* @param val
* @example
* ```ts
* import { McDbAlignedDimension, McGePoint3d } from "mxcad";
*
* const mDimension = new McDbAlignedDimension();
* mDimension.oblique = Math.PI/4;
* ```
*/
set oblique(val: number);
}
/**
*
* @example
* ```ts
//旋转标注
import { McDbRotatedDimension, MxCpp } from "mxcad"
const rDimension = new McDbRotatedDimension() // 构造旋转标注对象
rDimension.xLine1Point = new McGePoint3d(-1800, -800) // 设置对象第一条线的端点
rDimension.xLine2Point = new McGePoint3d(1800, -800) // 设置对象第二条线的端点
rDimension.dimLinePoint = new McGePoint3d(-800, -500) // 设置对象标注线的端点
rDimension.textAttachment = McDb.AttachmentPoint.kTopLeft // 设置对象文本对齐方式
rDimension.textRotation = 0.6 // 设置对象文字旋转角度
rDimension.trueColor = new McCmColor(200, 255, 0) // 设置对象颜色
rDimension.oblique = 0 // 设置对象倾斜角度
rDimension.rotation = 0 // 设置对象旋转角度
rDimension.dimensionText = "标注文本" // 设置对象文本内容
MxCpp.getCurrentMxCAD().drawEntity(rDimension);//绘制旋转标注对象
* ```
*/
export declare class McDbRotatedDimension extends McDbDimension {
/**
*
* @param imp
* @example
* ```ts
* import { McDbRotatedDimension } from "mxcad";
* const rDimension = new McDbRotatedDimension();
* ```
*/
constructor(imp?: any);
/**
* 线
* @returns 线
* @example
* ```ts
*
* ```
*/
get xLine1Point(): McGePoint3d;
/**
* 线
* @param pt 线
*/
set xLine1Point(pt: McGePoint3d);
/**
* 线
* @returns 线
*/
get xLine2Point(): McGePoint3d;
/**
* 线
* @param pt 线
*/
set xLine2Point(pt: McGePoint3d);
/**
* 线
* @returns 线
*/
get dimLinePoint(): McGePoint3d;
/**
* 线
* @param pt 线
*/
set dimLinePoint(pt: McGePoint3d);
/**
*
* @returns
*/
get oblique(): number;
/**
*
* @param val
*/
set oblique(val: number);
/**
*
* @returns
*/
get rotation(): number;
/**
*
* @param val
*/
set rotation(val: number);
}
/**
*
* @example
* ```ts
import { MxCpp, MxDb2LineAngularDimension, MxCADUiPrPoint } from "mxcad";
// 下面代码演示了,先选择需要测量角度的两条边,再设置角度标注位置,最后绘制出角度标注对象。
function BR_AngleMeasure() {
const angleDim = new McDb2LineAngularDimension();// 构造新角度标注尺寸对象
// 设置角边1起点
const getPoint1 = new MxCADUiPrPoint()
getPoint1.setMessage("\n指定线1起点:");
const point1 = await getPoint1.go();
if(!point1) return;
angleDim.xLine1Start = point1;
// 设置角边1终点
const getPoint2 = new MxCADUiPrPoint()
getPoint1.setMessage("\n指定线1终点:");
const point2 = await getPoint2.go();
if(!point2) return;
angleDim.xLine1End = point2;
// 设置角边2起点
const getPoint3 = new MxCADUiPrPoint()
getPoint3.setMessage("\n指定线2起点:");
const point3 = await getPoint3.go();
if(!point3) return;
angleDim.xLine2Start = point3;
// 设置角边2终点
const getPoint4 = new MxCADUiPrPoint();
getPoint4.setMessage("\n指定线2终点:");
const point4 = await getPoint4.go();
if(!point4) return;
angleDim.xLine2End = point4;
// 设置角度标注位置
const getArcPoint = new MxCADUiPrPoint()
getPoint3.setMessage("\n指定标注点:");
const arcPoint = await getArcPoint.go();
if(!arcPoint) return;
angleDim.arcPoint = arcPoint;
// 绘制角度标注尺寸对象
MxCpp.getCurrentMxCAD().drawEntity(angleDim);
}
* ```
*/
export declare class McDb2LineAngularDimension extends McDbDimension {
/**
*
* @param imp
* @example
* ```ts
* import { McDb2LineAngularDimension } from "mxcad";
*
* const angleDim = new McDb2LineAngularDimension()
* ```
*/
constructor(imp?: any);
/**
*
* @returns
* @example
* ```ts
import { McDb2LineAngularDimension } from "mxcad";
const angleDim = new McDb2LineAngularDimension();
const getArcPoint = new MxCADUiPrPoint();
getArcPoint.setMessage("\n指定标注点:");
const arcPoint = await getArcPoint.go();
if(!arcPoint) return;
angleDim.arcPoint = arcPoint;
console.log("输出文本标注点" , angleDim.arcPoint)
* ```
*/
get arcPoint(): McGePoint3d;
set arcPoint(pt: McGePoint3d);
/**
* 线
* @returns 线
* @example
* ```ts
import { McDb2LineAngularDimension } from "mxcad";
const angleDim = new McDb2LineAngularDimension()
const getPoint1 = new MxCADUiPrPoint()
getPoint1.setMessage("\n指定线1起点:");
const point1 = await getPoint1.go();
if(!point1) return;
angleDim.xLine1Start = point1;
console.log(angleDim.xLine1Start)
* ```
*/
get xLine1Start(): McGePoint3d;
set xLine1Start(pt: McGePoint3d);
/**
* 线
* @returns 线
* @example
* ```ts
import { McDb2LineAngularDimension } from "mxcad";
const angleDim = new McDb2LineAngularDimension()
const getPoint2 = new MxCADUiPrPoint()
getPoint2.setMessage("\n指定线1终点:");
const point2 = await getPoint2.go();
if(!point2) return;
angleDim.xLine1End = point2;
console.log(angleDim.xLine1End)
* ```
*/
get xLine1End(): McGePoint3d;
set xLine1End(pt: McGePoint3d);
/**
* 线
* @returns 线
* @example
* ```ts
import { McDb2LineAngularDimension } from "mxcad";
const angleDim = new McDb2LineAngularDimension()
const getPoint3 = new MxCADUiPrPoint()
getPoint3.setMessage("\n指定线2起点:");
const point3 = await getPoint3.go();
if(!point3) return;
angleDim.xLine2Start = point3;
console.log(angleDim.xLine2Start);
* ```
*/
get xLine2Start(): McGePoint3d;
set xLine2Start(pt: McGePoint3d);
/**
* 线
* @returns 线
* @example
* ```ts
import { McDb2LineAngularDimension } from "mxcad";
const angleDim = new McDb2LineAngularDimension()
const getPoint4 = new MxCADUiPrPoint()
getPoint4.setMessage("\n指定线2终点:");
const point4 = await getPoint4.go();
if(!point4) return;
angleDim.xLine2End = point4;
console.log(angleDim.xLine2End)
* ```
*/
get xLine2End(): McGePoint3d;
set xLine2End(pt: McGePoint3d);
/**
*
* @param dAngleVertexX X轴值
* @param dAngleVertexY Y轴值
* @param dFirstEndPointX 线1X轴值
* @param dFirstEndPointY 线1Y轴值
* @param dSecondEndPointX 线2X轴值
* @param dSecondEndPointY 线2Y轴值
* @param dTextPointX X轴值
* @param dTextPointY Y轴值
* @returns
* @example
* ```ts
import { McDb2LineAngularDimension } from "mxcad";
const dimension = new McDb2LineAngularDimension()
// 设置计算维度所需的参数
const dAngleVertexX = 0;
const dAngleVertexY = 0;
const dFirstEndPointX = 1;
const dFirstEndPointY = 2;
const dSecondEndPointX = 3;
const dSecondEndPointY = 4;
const dTextPointX = 5;
const dTextPointY = 6;
// 调用 compute 方法计算维度
const result = dimension.compute(
dAngleVertexX,
dAngleVertexY,
dFirstEndPointX,
dFirstEndPointY,
dSecondEndPointX,
dSecondEndPointY,
dTextPointX,
dTextPointY
);
if (result) {
console.log("计算成功");
} else {
console.error("计算失败");
}
* ```
*/
compute(dAngleVertexX: number, dAngleVertexY: number, dFirstEndPointX: number, dFirstEndPointY: number, dSecondEndPointX: number, dSecondEndPointY: number, dTextPointX: number, dTextPointY: number): boolean;
}
/**
*
* @example
* ```ts
import { McDbArc, MxCpp } from "mxcad"
// 绘制圆弧
const arc = new McDbArc() // 构造新圆弧对象
arc.center = new McGePoint3d(0,0,0) // 设置圆弧圆心
arc.radius = 20 // 设置圆弧半径
arc.startAngle = Math.PI / 2 // 设置圆弧开始角度
arc.endAngle = Math.PI * 3 / 2 // 设置圆弧结束角度
arc.trueColor = new McCmColor(255, 233, 0) // 设置圆弧颜色
MxCpp.getCurrentMxCAD().drawEntity(arc) // 绘制圆弧
* ```
*/
export declare class McDbArc extends McDbCurve {
/**
*
* @param imp
* @example
* ```ts
* import { McDbArc } from "mxcad";
* const arc = new McDbArc()
* ```
*/
constructor(imp?: any);
/**
*
* @param x x
* @param y y
* @param z z
* @example
* ```ts
* import { McDbArc } from "mxcad";
* const arc = new McDbArc();
* arc.setCenter(0,0,0)
* ```
*/
setCenter(x: number, y: number, z?: number): void;
/**
*
* @example
* ```ts
* import { McDbArc } from "mxcad";
* const arc = new McDbArc();
* arc.setCenter(0,0,0);
* const center = arc.center;
* console.log("圆心",center);//(0,0,0)
* ```
*/
get center(): McGePoint3d;
/**
*
* @param pt
* @example
* ```ts
* import { McDbArc, McGePoint3d } from "mxcad";
* const arc = new McDbArc();
* arc.center = new McGePoint3d(0 ,0 ,0);
* ```
*/
set center(pt: McGePoint3d);
/**
*
* @example
* ```ts
* // arc 为有效圆弧实例
* cosnt r = arc.radius;
* ```
*/
get radius(): number;
/**
*
* @param r
* @example
* ```ts
* import { McDbArc } from "mxcad";
* const arc = new McDbArc();
* arc.radius = 20;
* ```
*/
set radius(r: number);
/**
*
* @example
* ```ts
* // arc 为有效圆弧实例
* cosnt startAngle = arc.startAngle;
* ```
*/
get startAngle(): number;
/**
*
* @param r
* @example
* ```ts
* import { McDbArc } from "mxcad";
* const arc = new McDbArc();
* arc.startAngle = Math.PI/4;
* ```
*/
set startAngle(r: number);
/**
*
* @example
* ```ts
* // arc 为有效圆弧实例
* cosnt endAngle = arc.endAngle;
* ```
*/
get endAngle(): number;
/**
*
* @param r
* @example
* ```ts
* import { McDbArc } from "mxcad";
* const arc = new McDbArc();
* arc.endAngle = Math.PI/4;
* ```
*/
set endAngle(r: number);
/**
* 3
* @example
* ```ts
* import { McDbArc, McGePoint3d, MxCpp } from "mxcad";
*
* const arc = new McDbArc();
* const pt1 = new McGePoint3d(20,0,0);
* const pt2 = new McGePoint3d(0,20,0);
* const pt3 = new McGePoint3d(-20,0,0);
* arc.computeArc(pt1.x, pt1.y, pt2.x, pt2.y, pt3.x, pt3.y);
* MxCpp.getCurrentMxCAD().drawEntity(arc)
* ```
*/
computeArc(dStartPointX: number, dStartPointY: number, dMidPointX: number, dMidPointY: number, dEndPointX: number, dEndPointY: number): boolean;
}
/**
*
* @example
* ```ts
import { McDbEllipse, MxCpp } from "mxcad"
//绘制椭圆弧
const ellipse_arc = new McDbEllipse() // 构造椭圆对象
ellipse_arc.center = new McGePoint3d(-380, -200) // 设置对象圆心
ellipse_arc.majorAxis = new McGeVector3d(0, 150, 0) // 设置对象主轴向量
ellipse_arc.minorAxis = new McGeVector3d(280, 0, 0) // 设置对象副轴向量
ellipse_arc.startAngle = Math.PI / 2 // 设置对象开始角度
ellipse_arc.endAngle = Math.PI * 3 / 2 // 设置对象结束角度
ellipse_arc.trueColor = new McCmColor(0, 255, 255) //设置对象颜色
MxCpp.getCurrentMxCAD().drawEntity(ellipse_arc) // 绘制椭圆对象
//绘制椭圆
const ellipse = new McDbEllipse() // 构造椭圆对象
ellipse.center = new McGePoint3d(-200, -200) // 设置对象圆心
ellipse.majorAxis = new McGeVector3d(0, 300, 0) // 设置对象主轴向量
ellipse.radiusRatio = 0.5 // 设置椭圆的副轴长度与主轴长度的比值
ellipse.trueColor = new McCmColor(255, 233, 0) //设置对象颜色
MxCpp.getCurrentMxCAD().drawEntity(ellipse) // 绘制椭圆对象
* ```
*/
export declare class McDbEllipse extends McDbCurve {
/**
*
* @param imp
* @example
* ```ts
* import { McDbEllipse } from "mxcad";
*
* const ellipse = new McDbEllipse();
* ```
*/
constructor(cenx?: object | number, ceny?: number, cenz?: number, majorAxisx?: number, majorAxisy?: number, majorAxisz?: number, radiusRatio?: number, startAngle?: number, endAngle?: number);
/**
*
* @param x x
* @param y y
* @param z z
* @example
* ```ts
* import { McDbEllipse } from "mxcad";
*
* const ellipse = new McDbEllipse();
* ellipse.setCenter(0,0,0);
* ```
*/
setCenter(x: number, y: number, z?: number): void;
/**
*
* @example
* ```ts
* import { McDbEllipse } from "mxcad";
*
* const ellipse = new McDbEllipse();
* ellipse.setCenter(0,0,0);
* const center = ellipse.center;
* ```
*/
get center(): McGePoint3d;
/**
*
* @param pt
* @example
* ```ts
* import { McDbEllipse, McGePoint3d } from "mxcad";
*
* const ellipse = new McDbEllipse();
* ellipse.center = new McGePoint3d(0,0,0);
* ```
*/
set center(pt: McGePoint3d);
/**
*
* @param x x
* @param y y
* @param z z
* @example
* ```ts
* import { McDbEllipse } from "mxcad";
*
* const ellipse = new McDbEllipse();
* ellipse.setMajorAxis(20,0,0);
* ```
*/
setMajorAxis(x: number, y: number, z?: number): void;
/**
*
* @example
* ```ts
* import { McDbEllipse } from "mxcad";
*
* const ellipse = new McDbEllipse();
* ellipse.setMajorAxis(20,0,0);
* const majorAxis = ellipse.majorAxis;
* ```
*/
get majorAxis(): McGeVector3d;
/**
*
* @param vec
* @example
* ```ts
* import { McDbEllipse, McGeVector3d } from "mxcad";
*
* const ellipse = new McDbEllipse();
* ellipse.majorAxis = new McGeVector3d(20,0,0)
* ```
*/
set majorAxis(pt: McGeVector3d);
/**
*
* @param x x
* @param y y
* @param z z
* @example
* ```ts
* import { McDbEllipse } from "mxcad";
*
* const ellipse = new McDbEllipse();
* ellipse.setMinorAxis(20,0,0);
* ```
*/
setMinorAxis(x: number, y: number, z?: number): void;
/**
*
* @example
* ```ts
* import { McDbEllipse } from "mxcad";
*
* const ellipse = new McDbEllipse();
* ellipse.setMajorAxis(20,0,0);
* const minorAxis = ellipse.minorAxis;
* ```
*/
get minorAxis(): McGeVector3d;
/**
*
* @example
* ```ts
* import { McDbEllipse, McGeVector3d } from "mxcad";
*
* const ellipse = new McDbEllipse();
* ellipse.minorAxis = new McGeVector3d(20,0,0)
* ```
*/
set minorAxis(pt: McGeVector3d);
/**
*
* @example
* ```ts
* //ellipse 为有效椭圆弧实例对象
* const radiusRatio = ellipse.radiusRatio;
* ```
*/
get radiusRatio(): number;
/**
*
* @example
* ```ts
* import { McDbEllipse, McGeVector3d } from "mxcad";
*
* const ellipse = new McDbEllipse();
* ellipse.radiusRatio = 4;
* ```
*/
set radiusRatio(val: number);
/**
*
* @example
* ```ts
* //ellipse 为有效椭圆弧实例对象
* const startAngle = ellipse.startAngle;
* ```
*/
get startAngle(): number;
/**
*
* @example
* ```ts
* import { McDbEllipse, McGeVector3d } from "mxcad";
*
* const ellipse = new McDbEllipse();
* ellipse.startAngle = Math.PI/4;
* ```
*/
set startAngle(val: number);
/**
*
* @example
* ```ts
* //ellipse 为有效椭圆弧实例对象
* const endAngle = ellipse.endAngle;
* ```
*/
get endAngle(): number;
/**
*
* @example
* ```ts
* import { McDbEllipse, McGeVector3d } from "mxcad";
*
* const ellipse = new McDbEllipse();
* ellipse.endAngle = Math.PI/4;
* ```
*/
set endAngle(val: number);
}
/**
*
* @example
* ```ts
* //绘制一个点对象
import { McDbPoint } from "mxcad"
const point = new McDbPoint() // 构造一个点对象
const color = new McCmColor(0,255,0)
point.trueColor = color // 设置点对象颜色
point.setPosition(0, 0) // 设置点对象位置
MxCpp.getCurrentMxCAD().drawEntity(point) // 绘制点对象
* ```
*/
export declare class McDbPoint extends McDbEntity {
/**
*
* @param imp
* @example
* ```ts
* import { McDbPoint, McGePoint3d } from "mxcad";
*
* const pt1 = new McDbPoint(0,0,0);
*
* const point = new McGePoint3d(10,10,0);
* const pt2 = new McDbPoint(point);
* ```
*/
constructor(x?: object | number, y?: number, z?: number);
/**
*
* @param x X坐标
* @param y Y坐标
* @param z Z坐标
* @example
* ```ts
* import { McDbPoint } from "mxcad";
*
* const pt = new McDbPoint();
* pt.setPosition(10,10,0);
* ```
*/
setPosition(x: number, y: number, z?: number): void;
/**
*
* @example
* ```ts
* import { McDbPoint } from "mxcad";
*
* const pt = new McDbPoint();
* pt.setPosition(10,10,0);
* const point = pt.position;
* ```
*/
get position(): McGePoint3d;
/**
*
* @example
* ```ts
* import { McDbPoint, McGePoint3d } from "mxcad";
*
* const pt = new McDbPoint();
* pt.position = new McGePoint3d(20,20,0)
* ```
*/
set position(pt: McGePoint3d);
}
/**
*
* @example
* ```ts
import { MxCADUiPrPoint, MxCADUtility, McDbHatch, MxCpp, McDb} from "mxcad"
//选点填充
const getPoint = new MxCADUiPrPoint();
console.log("\n指定填充区域内部一点:");
let pt = (await getPoint.go()) as McGePoint3d;
if (!pt) return;
let hatch:McDbHatch = MxCADUtility.builderHatchFromPoint(pt);
if (!hatch) {
console.log("没有找到闭合区域\n")
return;
}
// 清除填充图案效果
hatch.clearPatternDefinition();
// 添加图案填充定义
hatch.addPatternDefinition(45, 1, 1, 1, 0.25, [45, 0.17677695, 0, 0, 0.25, 0.125, -0.0625])
// 设置填充图案
hatch.setPattern(McDb.HatchPatternType.kCustomDefined, 'test')
// 设置填充颜色
hatch.trueColor = new McCmColor(0, 133, 122)
// 绘制填充对象
MxCpp.getCurrentMxCAD().drawEntity(hatch);
* ```
*/
export declare class McDbHatch extends McDbEntity {
/**
*
* @param imp
* @example
* ```ts
* import { McDbHatch } from "mxcad";
*
* const hatch = new McDbHatch()
* ```
*/
constructor(x?: object);
/**
*
* @example
* ```ts
* // hatch 为图案填充实例对象
* const num = hatch.numLoops
* ```
*/
get numLoops(): number;
/**
*
* @example
* ```ts
* // hatch 为图案填充实例对象
* const looptType = hatch.loopTypeAt(0)
* ```
*/
loopTypeAt(loopIndex: number): number;
/**
* @param loopIndex index
* @returns { Object } ret | lootype | vertices | bulges凸度集合
* @example
* ```ts
* // hatch 为图案填充实例对象
* const numLoops = hatch.numLoops;
* for (let i = 0; i < numLoops; i++) {
* const loop = hatch.getLoopAt(i);
* console.log(loop)
* };
* ```
* */
getLoopAt(loopIndex: number): {
ret: boolean;
lootype: number;
vertices: McGePoint3d[];
bulges: number[];
};
/**
*
* @example
* ```ts
* // hatch 为图案填充实例对象
* const type = hatch.patternType()
* ```
*/
patternType(): number;
/**
*
* @example
* ```ts
* // hatch 为图案填充实例对象
* const patternName = hatch.patternName()
* ```
*/
patternName(): string;
/**
*
* @param type
* @param patName
* @example
* ```ts
import { McDbHatch, MxCpp } from "mxcad";
const hatch = new McDbHatch();
hatch.setPattern(McDb.HatchPatternType.kCustomDefined, 'test')
let mxcad = MxCpp.getCurrentMxCAD();
mxcad.drawEntity(hatch);
* ```
*/
setPattern(type: number, patName: string): void;
/**
*
* @example
* ```ts
* // hatch 为图案填充实例对象
* const angle = hatch.patternAngle
* ```
*/
get patternAngle(): number;
/**
*
* @example
* ```ts
* import { McDbHatch } from "mxcad";
*
* const hatch = new McDbHatch();
* hatch.patternAngle(Math.PI/4);
* ```
*/
set patternAngle(angle: number);
/**
*
* @example
* ```ts
* // hatch 为图案填充实例对象
* const scale = hatch.patternScale
* ```
*/
get patternScale(): number;
/**
*
* @example
* ```ts
* import { McDbHatch } from "mxcad";
*
* const hatch = new McDbHatch();
* hatch.patternScale = 0.8;
* ```
*/
set patternScale(scale: number);
/**
*
* @example
* ```ts
* // hatch 为图案填充实例对象
* const patternSpace = hatch.patternSpace
* ```
*/
get patternSpace(): number;
/**
*
* @example
* ```ts
* import { McDbHatch } from "mxcad";
*
* const hatch = new McDbHatch();
* hatch.patternSpace = 0.8;
* ```
*/
set patternSpace(space: number);
/**
*
* @example
* ```ts
* // hatch 为图案填充实例对象
* const isDouble = hatch.patternDouble;
* if(isDouble){
* //填充图案为双倍
* }else{
* //填充图案不为双倍
* }
* ```
*/
get patternDouble(): boolean;
/**
*
* @example
* ```ts
* import { McDbHatch } from "mxcad";
*
* const hatch = new McDbHatch();
* hatch.patternDouble = true;
* ```
*/
set patternDouble(isDouble: boolean);
/**
*
* @example
* ```ts
* // hatch 为图案填充实例对象
* const num = hatch.numPatternDefinitions;
* ```
*/
get numPatternDefinitions(): number;
/**
* @param index
* @returns { Object } ret | angle | baseX, baseY | offsetX, offsetY | aryDashes 线
* @example
* ```ts
* // hatch 为图案填充实例对象
* const obj = {};
* for (let i = 0; i < obj.numPatternDefinitions; i++) {
* obj["patternDefinitions:" + i] = hatch.getPatternDefinitionAt(i);
* };
* ```
*/
getPatternDefinitionAt(index: number): {
ret: boolean;
angle: number;
baseX: number;
baseY: number;
offsetX: number;
offsetY: number;
aryDashes: number[];
};
/**
* @param angle 45
* @param baseX x坐标
* @param baseY y坐标
* @param offsetX x坐标
* @param offsetY y坐标
* @param dashes 线
* @example
* ```ts
* import { McDbHatch } from "mxcad"
* const hatch = new McDbHatch()
* const res = hatch.addPatternDefinition(45, 0, 0, 0, 0.25, [45, 0.17677695, 0, 0, 0.25, 0.125, -0.0625]);
* if(res){
* //添加成功
* }else{
* //添加失败
* }
* ```
* @returns { Boolean }
* */
addPatternDefinition(angle: number, baseX: number, baseY: number, offsetX: number, offsetY: number, dashes: number[]): boolean;
/**
*
* @example
* ```ts
* // hatch 为图案填充实例对象
* const res = hatch.clearPatternDefinition();
* if(res){
* //清空成功
* }else{
* //清空失败
* }
* ```
*/
clearPatternDefinition(): boolean;
/**
*
* @example
* ```ts
* // hatch 为图案填充实例对象
* const style = hatch.hatchStyle();
* ```
*/
hatchStyle(): McDb.HatchStyle;
/**
*
* @example
* ```ts
* import { McDbHatch, McDb } from "mxcad"
*
* McDbHatch.setHatchStyle(McDb.HatchStyle.kNormal)
* ```
*/
setHatchStyle(val: McDb.HatchStyle): void;
/**
*
* @example
* ```ts
* import { McDbHatch } from "mxcad";
*
* const Hatch hatch = new Hatch();
*
* // 在这里进行填充操作...
*
* // 评估填充结果
* const hatchSuccess = HatchEvaluator.EvaluateHatch(hatch);
* if (hatchSuccess){
console.log("\n填充成功!");
}else{
console.log("\n填充失败!");
}
* ```
*/
evaluateHatch(): boolean;
/**
* @param loopType
* @param vertices
* @param bulges
* @return
* @example
* ```ts
import { McDbHatch, McGePoint3d, McGePoint3dArray } from "mxcad";
let solid = new McDbHatch();
const pts = [
new McGePoint3d({ x: 10, y: 20, z: 0 }),
new McGePoint3d({ x: 0, y: 0, z: 0 }),
];
const res = solid.appendLoop(new McGePoint3dArray(pts));
if(res){
//设置成功
}else{
//设置失败
}
* ```
*/
appendLoop(vertices: McGePoint3dArray, bulges?: number[], loopType?: number): boolean;
/**
*
* @param dCenX X轴坐标
* @param dCenY Y轴坐标
* @param dR
* @param dPrecision 0
* @param loopType McDb.HatchLoopType.kPolyline
* @return
* @example
* ```ts
* import { McDbHatch } from "mxcad";
* const hatch = new McDbHatch();
* const res = hatch.appendCircleLoop(0,0,0,20);
* if(res){
* //追加成功
* }else{
* //追加失败
* }
* ```
*/
appendCircleLoop(dCenX: number, dCenY: number, dR: number, dPrecision?: number, loopType?: number): any;
/**
*
* @param loopIndex
* @example
* ```ts
* // hatch 为图案填充实例对象
* const res = hatch.removeLoopAt(1);
* if(res){
* //删除成功
* }else{
* //删除失败
* }
* ```
*/
removeLoopAt(loopIndex: number): boolean;
/**
*
* @example
* ```ts
* // hatch 为图案填充实例对象
* const res = hatch.removeAllLoop();
* if(res){
* //删除成功
* }else{
* //删除失败
* }
* ```
*/
removeAllLoop(): boolean;
/**
* @param loopIndex
* @param loopType
* @param vertices
* @param bulges
* @example
* ```ts
* import { McDbHatch } from "mxcad";
*
* const hatch = new McDbHatch();
* const pts = [
* new McGePoint3d({ x: 10, y: 20, z: 0 }),
* new McGePoint3d({ x: 0, y: 0, z: 0 }),
* ];
* const isSuccess = hatch.setLoopAt(0, new McGePoint3dArray(pts), [0.4,0.8]);
* if (isSuccess) {
* console.log("循环设置成功!");
* } else {
* console.log("循环设置失败...");
* }
* ```
*/
setLoopAt(loopIndex: number, vertices: McGePoint3dArray, bulges: number[], loopType?: number): boolean;
/**
*
* @returns
* @example
* ```ts
* // hatch 为图案填充实例对象
* const res = hatch.isSolid();
* if(res){
* //实体填充
* }else{
* //非实体填充
* }
* ```
*/
isSolid(): boolean;
}
/**
*
* @example
* ```ts
* //遍历代理实体中的文字
* import { MxCADSelectionSet, McDbProxyEntity } from "mxcad";
*
* let ss = new MxCADSelectionSet();// 构造选择集对象
* // 设置过滤器
* let filter = new MxCADResbuf();
* filter.AddMcDbEntityTypes("TEXT,MTEXT,INSERT,ACAD_PROXY_ENTITY");
* ss.allSelect(filter);// 筛选图纸上所有的文本、图块、代理实体对象
* // 遍历选择对象
* ss.forEach((id,item)=>{
* const ent = id.getMcDbEntity();
* if(ent instanceof McDbProxyEntity){
* let proxyEntity: McDbProxyEntity = ent;
* let aryText = proxyEntity.getAllTextContent();
* aryText.forEach((val)=>{
* console.log("遍历文字", val);
* });
* })
* ```
*/
export declare class McDbProxyEntity extends McDbEntity {
/**
*
* @param imp
*/
constructor(x?: object);
/**
*
* @return
* @example
* ```ts
* // proxyEntity 为有效代理实体
* let aryText = proxyEntity.getAllTextContent();
* aryText.forEach((val)=>{
* console.log("遍历文字", val);
* });
* ```
*/
getAllTextContent(): McGeStringArray;
/**
* ID
* @return ID数组
* @example
* ```ts
* // proxyEntity 为有效代理实体
* let aryIds = proxyEntity.getAllEntityIds();
* aryIds.forEach((id)=>{
* console.log("实体ID", id);
* });
* ```
*/
getAllEntityIds(): McObjectId[];
/**
*
* @return
* @example
* ```ts
* // proxyEntity 为有效代理实体
* let originalName = proxyEntity.getOriginalClassName();
* console.log("原始类名", originalName)
* ```
*/
getOriginalClassName(): string;
}
/**
* CAD中显示光栅图形
*/
export declare class McDbRasterImage extends McDbEntity {
/**
*
* @param imp
* @example
* ```ts
* import { McDbRasterImage } from "mxcad";
* // 创建一个新的 McDbRasterImage 实例
* const rasterImage = new McDbRasterImage();
* ```
*/
constructor(x?: object);
/**
*
* @param origin
* @param uCorner 沿X轴的向量
* @param vOnPlane 沿Y轴的向量
* @returns
* @example
* ```ts
* import { McDbRasterImage, McGePoint3d, McGeVector3d } from "mxcad";
*
* const rasterImage = new McDbRasterImage();
* const origin = new McGePoint3d(0, 0, 0);
* const uCorner = McGeVector3d.kXAxis.clone();
* const vOnPlane = McGeVector3d.kYAxis.clone();
* const isSuccess = rasterImage.setOrientation(origin, uCorner, vOnPlane);
* if(isSuccess){
* // 设置失败
* }else{
* //设置成功
* }
* ```
*/
setOrientation(origin: McGePoint3d, uCorner: McGeVector3d, vOnPlane: McGeVector3d): boolean;
/**
*
* @returns { object } origin: 原点 | uCorner: 沿X轴的向量 | vOnPlane: 沿Y轴的向量
* @example
* ```ts
* //假设 rasterImage 为光栅图片实例
* const orientation = rasterImage.getOrientation();
* console.log(orientation.origin); // 输出原点
* console.log(orientation.uCorner); // 输出沿X轴的向量
* console.log(orientation.vOnPlane); // 输出沿Y轴的向量
* ```
*/
getOrientation(): {
origin: McGePoint3d;
uCorner: McGeVector3d;
vOnPlane: McGeVector3d;
};
/**
* ID
* @param imageId ID
* @example
* ```ts
* import { McObjectId, McDbRasterImage } from "mxcad" ;
*
* const rasterImage = new McDbRasterImage();
* // 20 : 图片id
* const imageId = new McObjectId( 20 , McObjectIdType.kMxCAD);
* rasterImage.setImageDefId(imageId);
* ```
*/
setImageDefId(imageId: McObjectId): void;
/**
* I
* @example
* ```ts
* //假设 rasterImage 为光栅图片实例
* const imageId = rasterImage.imageDefId();
* console.log(imageId.id); // 输出图像的定义 ID
* ```
*/
imageDefId(): McObjectId;
/**
*
* @param type
* @param aryPoint
* @return
* @example
* ```ts
* //假设 rasterImage 为光栅图片实例
* const clipBoundaryType = McDb.ClipBoundaryType.kRectangular; // 举例,裁剪类型为矩形
* const clipBoundaryPoints = new McGePoint3dArray(); // 假设已经填充了裁剪边界的点
* const isSuccess = rasterImage.setClipBoundary(clipBoundaryType, clipBoundaryPoints);
* if(isSuccess){
* //设置成功
* }else{
* //设置失败
* }
* ```
*/
setClipBoundary(type: McDb.ClipBoundaryType, aryPoint: McGePoint3dArray): boolean;
/**
*
* @example
* ```ts
* //假设 rasterImage 为光栅图片实例
* const clipBoundaryPoints = rasterImage.clipBoundary();
* console.log(clipBoundaryPoints); // 输出裁剪边界的点数组
* ```
*/
clipBoundary(): McGePoint3dArray;
/**
*
* @example
* ```ts
* //假设 rasterImage 为光栅图片实例
* const type = rasterImage.clipBoundaryType();
* console.log(type); // 输出裁剪边界的类型
* ```
*/
clipBoundaryType(): McDb.ClipBoundaryType;
}
/**
* Wipeout类
*/
export declare class McDbWipeout extends McDbEntity {
/**
*
* ```
*/
constructor(x?: object);
/**
* Wipeout类边界
*/
setVertices(aryPoint: McGePoint3dArray): boolean;
/**
* Wipeout类边界
* @example
* ```ts
* ```
*/
getVertices(): McGePoint3dArray;
}
/**
*
*/
export declare class McDbBackgroundEntity extends McDbEntity {
constructor(x: object);
/**
*
*/
setShow(sDwgFile: string, isShow: boolean): boolean;
/**
*
*/
isShow(sDwgFile: string): boolean;
/**
* 使
*/
setShowColor(sDwgFile: string, lColor: number): boolean;
/**
* 使.
*/
getBackgroundDatabase(sDwgFile: string): McDbDatabase | null;
/**
*
*/
clearAll(): boolean;
/**
*
*/
clearDwg(sDwgFile: string): boolean;
}
/**
* Dxf组码
* @public
*/
export declare enum DxfCode {
/** 实体类型 */
kEntityType = 5020,
/** 实体图层 */
kLayer = 8,
/** 块名 */
kBlockName = 2,
/** 颜色 */
kColor = 62,
/** XData 类型 */
kAppName = -3,
/** 长整型 */
kLong = 1071,
/** 双精度浮点数 */
kDouble = 1040,
/** 字符串 */
kString = 1000,
/** 点坐标 */
kPoint = 1010,
/** 实体ID */
kEntityId = -8000,
/** 实体 */
kEntity = -8500,
/** 扩展数据名称 */
kExDataName = 1001
}
/**
* McDb AutoCAD
* @public
*/
export declare namespace McDb {
/**
* 线
* @public
*/
enum PolylineType {
/** LW Polyline */
kLwPolyline = 0,
/** 3D Polyline */
k3dPolyline = 2
}
/**
*
* @public
*/
enum TextHorzMode {
/** 左对齐 */
kTextLeft = 0,
/** 居中对齐 */
kTextCenter = 1,
/** 右对齐 */
kTextRight = 2,
/** 水平对齐 */
kTextAlign = 3,
/** 垂直中间对齐 */
kTextMid = 4,
/** 自适应 */
kTextFit = 5
}
/**
* {@link McDbEntity.IntersectWith}
* */
enum Intersect {
/** 两个实体都不延伸 */
kOnBothOperands = 0,
/**
* {@link McDbEntity.IntersectWith}
* */
kExtendThis = 1,
/**
* {@link McDbEntity.IntersectWith}
* */
kExtendArg = 2,
/** 两个实体都延伸 */
kExtendBoth = 3
}
/**
*
* @public
*/
enum TextVertMode {
/** 基线对齐 */
kTextBase = 0,
/** 底部对齐 */
kTextBottom = 1,
/** 垂直中间对齐 */
kTextVertMid = 2,
/** 顶部对齐 */
kTextTop = 3
}
/**
*
* @public
*/
enum AttachmentPoint {
/** 左上对齐 */
kTopLeft = 1,
/** 中上对齐 */
kTopCenter = 2,
/** 右上对齐 */
kTopRight = 3,
/** 中左对齐 */
kMiddleLeft = 4,
/** 中心点对齐 */
kMiddleCenter = 5,
/** 中右对齐 */
kMiddleRight = 6,
/** 左下对齐 */
kBottomLeft = 7,
/** 底部中间对齐 */
kBottomCenter = 8,
/** 右下对齐 */
kBottomRight = 9,
kBaseLeft = 10,
kBaseCenter = 11,
kBaseRight = 12,
kBaseAlign = 13,
kBottomAlign = 14,
kMiddleAlign = 15,
kTopAlign = 16,
kBaseFit = 17,
kBottomFit = 18,
kMiddleFit = 19,
kTopFit = 20,
kBaseMid = 21,
kBottomMid = 22,
kMiddleMid = 23,
kTopMid = 24
}
/**
* 线
* @public
*/
enum LineWeight {
kLnWt000 = 0,
kLnWt005 = 5,
kLnWt009 = 9,
kLnWt013 = 13,
kLnWt015 = 15,
kLnWt018 = 18,
kLnWt020 = 20,
kLnWt025 = 25,
kLnWt030 = 30,
kLnWt035 = 35,
kLnWt040 = 40,
kLnWt050 = 50,
kLnWt053 = 53,
kLnWt060 = 60,
kLnWt070 = 70,
kLnWt080 = 80,
kLnWt090 = 90,
kLnWt100 = 100,
kLnWt106 = 106,
kLnWt120 = 120,
kLnWt140 = 140,
kLnWt158 = 158,
kLnWt200 = 200,
kLnWt211 = 211,
kLnWtByLayer = -1,
kLnWtByBlock = -2,
kLnWtByLwDefault = -3
}
/**
*
* @public
*/
enum HatchLoopType {
/** 默认填充闭合区域类型 */
kDefault = 0,
/** 外部填充闭合区域类型 表示外部轮廓或边界 */
kExternal = 1,
/** 多段线填充闭合区域类型 表示由多个线段组成的区域*/
kPolyline = 2,
/** 派生填充闭合区域类型 表示从其他图形元素派生而来的填充区域*/
kDerived = 4,
/** 文本框填充闭合区域类型 表示包含文本的区域*/
kTextbox = 8,
/** 最外层填充闭合区域类型 表示填充区域的最外层边界*/
kOutermost = 16,
/** 未闭合填充闭合区域类型 表示填充区域的边界没有闭合*/
kNotClosed = 32,
/** 自相交填充闭合区域类型 表示填充区域的边界自相交*/
kSelfIntersecting = 64,
/** 文本岛填充闭合区域类型 表示包含文本的孤立区域*/
kTextIsland = 128
}
/**
* 线
* @public
*/
enum HatchEdgeType {
/** 表示直线类型的边 */
kLine = 1,
/** 圆弧类型的边 */
kCirArc = 2,
/** 椭圆弧类型的边 */
kEllArc = 3,
/** 样条曲线类型的边 */
kSpline = 4
}
/**
*
* @public
*/
enum HatchPatternType {
/** 用户自定义的填充图案 */
kUserDefined = 0,
/** 预定义的填充图案 */
kPreDefined = 1,
/** 自定义定义的填充图案 */
kCustomDefined = 2
}
/**
*
* @public
* */
enum HatchStyle {
/** 普通风格 标准的、普通的填充图案风格 */
kNormal = 0,
/** 外部风格 填充会强调区域的外部边界 用于使外部区域在绘图中更为显眼 */
kOuter = 1,
/** 忽略风格 表示在某些情况下应忽略填充图案的风格 在特定的绘图需求下,不需要显示填充图案的情况*/
kIgnore = 2
}
/** 指定裁剪操作中使用的边界类型*/
enum ClipBoundaryType {
/** 无效的裁剪边界类型 */
kInvalid = 0,
/** 矩形裁剪边界类型 */
kRect = 1,
/** 多边形裁剪边界类型 */
kPoly = 2
}
}
/**
* RGB
* @example
* ```ts
import { McCmColor, McDbEntity} from "mxcad";
//设置对象颜色
const ent = new McDbEntity();
const color = new McCmColor(255,0,0);
ent.trueColor = color;
* ```
* ```ts
import { McCmColor, McDbEntity} from "mxcad";
// 修改对象颜色
async function Mx_Test_ChangeColor() {
// 选择标注对象
let getEntity = new MxCADUiPrEntity();
getEntity.setMessage("选择标注对象");
let id = await getEntity.go();
if (!id.isValid()) return;
let ent = id.getMcDbEntity();// 获取目标McDbEntity对象
if (!ent) return;
ent.trueColor = new McCmColor(255, 0, 255);// 修改对象颜色
}
* ```
*/
export declare class McCmColor {
/** 内部实现对象 */
private imp;
/**
* RGB
* @param red
* @param green 绿
* @param blue
* @example
* ```ts
* import { McCmColor } from "mxcad"
*
* const red_color:McCmColor = new McCmColor(255, 0, 0);
*
* const colorObj = { red:0, green:255, blue:0};
* const green_color:McCmColor = new McCmColor(colorObj);
* ```
*/
constructor(red?: number | object, green?: number, blue?: number);
/**
*
* @return
* @example
* ```ts
* import { McCmColor } from "mxcad"
*
* const color = new McCmColor();
* const imp = color.getImp();
* ```
*/
getImp(): any;
/**
*
* @param val
* @example
* ```ts
* import { McCmColor } from "mxcad"
*
* const color:McCmColor = new McCmColor();
* const red_color:McCmColor = new McCmColor(255, 0, 0);
* color.copy(red_color);
* ```
*/
copy(val: McCmColor): this;
/**
*
* @return
* @example
* ```ts
* import { McCmColor } from "mxcad"
*
* const red_color:McCmColor = new McCmColor(255, 0, 0);
* const copy_color:McCmColor = red_color.clone();
* ```
*/
clone(): McCmColor;
/**
* ,
* @param colorIndex
* @example
* ```ts
* import { McCmColor, ColorIndexType } from "mxcad"
*
* const color = new McCmColor();
* color.setColorIndex(ColorIndexType.kBylayer);//设置颜色随层
* ```
*/
setColorIndex(colorIndex: number): void;
/**
* RGB
* @param red
* @param green 绿
* @param blue
* @example
* ```ts
* import { McCmColor } from "mxcad"
*
* const color = new McCmColor();
* color.setRGB(255,0,0);//红色
* ```
*/
setRGB(red: number, green: number, blue: number): void;
/**
* rgb值中的红色值0~255
* @param val
* @example
* ```ts
* import { McCmColor } from "mxcad"
*
* const color = new McCmColor();
* color.red = 188;
* console.log(color.red)
* ```
*/
get red(): number;
set red(val: number);
/**
* rgb值中的绿色值0~255
* @param val
* @example
* ```ts
* import { McCmColor } from "mxcad"
*
* const color = new McCmColor();
* color.green = 188;
* console.log(color.green)
* ```
*/
get green(): number;
set green(val: number);
/**
* rgb值中的蓝色值0~255
* @param val
* @example
* ```ts
* import { McCmColor } from "mxcad"
*
* const color = new McCmColor();
* color.blue = 188;
* console.log(color.blue)
* ```
*/
get blue(): number;
set blue(val: number);
/**
* n
*/
get n(): number;
set n(val: number);
/**
*
*/
get method(): number;
set method(val: number);
/**
*
* @param val
* @example
* ```ts
* import { McCmColor, ColorIndexType } from "mxcad"
*
* const color = new McCmColor();
* color.colorIndex = ColorIndexType.kBylayer;//设置颜色随层
* console.log(color.colorIndex);
* ```
*/
get colorIndex(): number;
set colorIndex(val: number);
/**
*
* @returns
* @example
* ```ts
* import { McCmColor } from "mxcad"
*
* const color = new McCmColor();
* const str = color.getColorString();
* console.log(str);
* ```
*/
getColorString(): string;
/**
* layerId:颜色随层时会取layerId指向的层颜色blkRefId:颜色随块时blkRefId指向的块颜色
* @param layerId ID
* @param blkRefId ID
* @returns
* @example
* ```ts
* import { McCmColor } from "mxcad"
*
* const color = new McCmColor();
* const val = color.getColorValue();
* console.log(val);
* ```
*/
getColorValue(layerId?: McObjectId, blkRefId?: McObjectId): string;
/** 获取 css 颜色的样式 如rgb(0, 0, 0) */
getStyle(): string;
}
/**
* 线线
* @example
* ```ts
* // 添加线型
import { MxCpp, McDbLinetypeTableRecord } from "mxcad"
const mxcad = MxCpp.getCurrentMxCAD();
// 拿到当前线型样式表
let linetypeTable = mxcad.getDatabase().getLinetypeTable();
// 构造新线型表记录对象
let newLinetypeRecord = new McDbLinetypeTableRecord();
// 设置线型对象的虚线数量
newLinetypeRecord.numDashes = 0.2
// 设置线型对象的名字
newLinetypeRecord.name = "TestMyLine"
// 添加线型
const res = linetypeTable.add(newLinetypeRecord).isValid()
if (res) {
console.log("add ok");
}
* ```
*/
export declare class McDbLinetypeTableRecord extends McDbObject {
/**
*
* @param imp
* @example
* ```ts
* import { McDbLinetypeTableRecord } from "mxcad";
*
* const linetypeRec = new McDbLinetypeTableRecord();
* ```
*/
constructor(imp?: any);
/**
* 线
* @example
* ```ts
* import { McDbLinetypeTableRecord } from "mxcad";
*
* const linetypeRec = new McDbLinetypeTableRecord();
* linetypeRec.name = "测试线型"
* console.log(linetypeRec.name) // 测试线型
* ```
*/
get name(): string;
set name(val: string);
/**
* 线线
* @example
* ```ts
* import { McDbLinetypeTableRecord } from "mxcad";
*
* const linetypeRec = new McDbLinetypeTableRecord();
* linetypeRec.numDashes = 6
* console.log(linetypeRec.numDashes) // 6
* ```
*/
get numDashes(): number;
set numDashes(val: number);
/**
* 线
* @param index 线
* @param value 线
* @example
* ```ts
* import { McDbLinetypeTableRecord } from "mxcad";
*
* const linetypeRec = new McDbLinetypeTableRecord();
* linetypeRec.setDashLengthAt(0, 8)
* console.log(linetypeRec.dashLengthAt(0)) // 8
* ```
*/
dashLengthAt(index: number): number;
setDashLengthAt(index: number, value: number): boolean;
/**
* 线
* @example
* ```ts
* import { McDbLinetypeTableRecord } from "mxcad";
*
* const linetypeRec = new McDbLinetypeTableRecord();
* linetypeRec.comments = "说明字符串"
* console.log(linetypeRec.comments) // 说明字符串
* ```
*/
get comments(): string;
set comments(val: string);
/**
*
* @param index 线
* @example
* ```ts
* import { McDbLinetypeTableRecord } from "mxcad";
*
* const linetypeRec = new McDbLinetypeTableRecord();
*
* const shapeStyleAtIndex = linetypeRec.shapeStyleAt(0);
* console.log(shapeStyleAtIndex);
*
* // 设置指定索引处的形状样式为新值
* const newIndex = 5;
* const newValue = 10;
* const isSetSuccessful = linetypeRec.setShapeStyleAt(newIndex, newValue);
* if (isSetSuccessful) {
* //设置成功
* } else {
* //设置失败
* }
* ```
*/
shapeStyleAt(index: number): number;
setShapeStyleAt(index: number, value: number): boolean;
/**
*
* @param index 线
* @example
* ```ts
* import { McDbLinetypeTableRecord } from "mxcad";
*
* const linetypeRec = new McDbLinetypeTableRecord();
*
* const shapeNumberAtIndex = linetypeRec.shapeNumberAt(0);
* console.log(shapeNumberAtIndex);
*
* // 设置指定索引处的形状编号为新值
* const newIndex = 5;
* const newValue = 10;
* const isSetSuccessful = linetypeRec.setShapeNumberAt(newIndex, newValue);
* if (isSetSuccessful) {
* //设置成功
* } else {
* //设置失败
* }
* ```
*/
shapeNumberAt(index: number): number;
setShapeNumberAt(index: number, shapeNumber: number): boolean;
/**
*
* @param index 线
* @return
* @example
* ```ts
* import { McDbLinetypeTableRecord, McGeVector3d } from "mxcad";
*
* const linetypeRec = new McDbLinetypeTableRecord();
*
* const vec = linetypeRec.shapeOffsetAt(0);
* console.log(vec);
*
* // 设置指定索引处的形状偏移量为新值
* const isSetSuccessful = linetypeRec.setShapeNumberAt(0, new McGeVector3d(10, 10, 0));
* if (isSetSuccessful) {
* //设置成功
* } else {
* //设置失败
* }
* ```
*/
shapeOffsetAt(index: number): McGeVector3d;
setShapeOffsetAt(index: number, offset: McGeVector3d): boolean;
/**
*
* @param index 线
* @param scale
* @example
* ```ts
* import { McDbLinetypeTableRecord } from "mxcad";
*
* const linetypeRec = new McDbLinetypeTableRecord();
* linetypeRec.setShapeScaleAt(0,0.8);
* console.log(linetypeRec.shapeScaleAt(0));// 0.8
* ```
*/
shapeScaleAt(index: number): number;
setShapeScaleAt(index: number, scale: number): boolean;
/**
* 线
* @return
* @example
* ```ts
* import { McDbLinetypeTableRecord } from "mxcad";
*
* const linetypeRec = new McDbLinetypeTableRecord();
* linetypeRec.isScaledToFit = true;
* console.log(linetypeRec.isScaledToFit) // true
* ```
*/
get isScaledToFit(): boolean;
set isScaledToFit(scaledToFit: boolean);
/**
* UCS
* @param index 线
* @example
* ```ts
* import { McDbLinetypeTableRecord } from "mxcad";
*
* const linetypeRec = new McDbLinetypeTableRecord();
* console.log(linetypeRec.shapeIsUcsOrientedAt(0))
* ```
*/
shapeIsUcsOrientedAt(index: number): boolean;
/**
* UCS
* @param index 线
* @param isUcsOriented UCS
* @returns
* @example
* ```ts
* import { McDbLinetypeTableRecord } from "mxcad";
*
* const linetypeRec = new McDbLinetypeTableRecord();
* const res = linetypeRec.setShapeIsUcsOrientedAt(0, true);
* if(res){
* //设置成功
* }else{
* //设置失败
* }
* ```
*/
setShapeIsUcsOrientedAt(index: number, isUcsOriented: boolean): boolean;
/**
*
* @param index 线
* @return
* @example
* ```ts
* import { McDbLinetypeTableRecord } from "mxcad";
*
* const linetypeRec = new McDbLinetypeTableRecord();
* console.log(linetypeRec.shapeRotationAt(0))
* ```
*/
shapeRotationAt(index: number): number;
/**
*
* @param index 线
* @param rotation
* @returns
* @example
* ```ts
* import { McDbLinetypeTableRecord } from "mxcad";
*
* const linetypeRec = new McDbLinetypeTableRecord();
* linetypeRec.setShapeRotationAt(0, Math.PI / 2);
* ```
*/
setShapeRotationAt(index: number, rotation: number): boolean;
/**
*
* @param index 线
* @return
* @example
* ```ts
* import { McDbLinetypeTableRecord } from "mxcad";
*
* const linetypeRec = new McDbLinetypeTableRecord();
* const text = linetypeRec.textAt(0);
* console.log(text)
* ```
*/
textAt(index: number): string;
/**
*
* @param index 线
* @param text
* @returns
* @example
* ```ts
* import { McDbLinetypeTableRecord } from "mxcad";
*
* const linetypeRec = new McDbLinetypeTableRecord();
* linetypeRec.setTextAt(0, "测试文本");
* ```
*/
setTextAt(index: number, text: string): boolean;
}
/**
*
* @example
* ```ts
* ```
*/
export declare class McDbDimStyleTableRecord extends McDbObject {
/**
*
* @param imp
* @example
* ```ts
* ```
*/
constructor(imp?: any);
/**
*
* @example
* ```ts
* ```
*/
get name(): string;
set name(val: string);
/**
*
* @example
* ```ts
* ```
*/
getDimVarInt(type: number): number;
/**
*
* @example
* ```ts
* ```
*/
setDimVarInt(type: number, value: number): boolean;
/**
* double类型的属性
* @example
* ```ts
* ```
*/
getDimVarDouble(type: number): number;
/**
* double类型的属性
* @example
* ```ts
* ```
*/
setDimVarDouble(type: number, value: number): boolean;
/**
* string类型的属性
* @example
* ```ts
* ```
*/
getDimVarString(type: number): string;
/**
* string类型的属性
* @example
* ```ts
* ```
*/
setDimVarString(type: number, value: string): boolean;
/**
*
* @example
* ```ts
* ```
*/
getDimVarObjectId(type: number): McObjectId;
/**
*
* @example
* ```ts
* ```
*/
setDimVarObjectId(type: number, value: McObjectId): boolean;
}
/**
*
* @example
* ```ts
* // 添加文字样式
import { McCmColor, MxCpp, McDbTextStyleTableRecord, McDb } from "mxcad"
const mxcad = MxCpp.getCurrentMxCAD();
// 拿到当前文字样式表
const textSyleTable = mxcad.getDatabase().getTextStyleTable();
// 构造一个文字样式表记录对象
let newTextStyleRecord = new McDbTextStyleTableRecord();
// 设置对象文件名
newTextStyleRecord.fileName = "txt.shx";
// 设置对象大字体名称
newTextStyleRecord.bigFontFileName = "hztxt.shx";
// 设置对象文字大小
newTextStyleRecord.textSize = 10;
// 设置对象名
newTextStyleRecord.name = sMyTextStyle;
// 设置对象宽度因子
newTextStyleRecord.xScale = 0.7;
// 添加文字样式
const res = textSyleTable.add(newTextStyleRecord).isValid()
if (res) {
console.log("add ok");
}
* ```
*/
export declare class McDbTextStyleTableRecord extends McDbObject {
/**
*
* @param imp
* @example
* ```ts
* import { McDbTextStyleTableRecord } from 'mxcad';
*
* const newTextStyleRecord = new McDbTextStyleTableRecord();
* ```
*/
constructor(imp?: any);
/**
*
* @example
* ```ts
* import { McDbTextStyleTableRecord } from 'mxcad';
*
* const newTextStyleRecord = new McDbTextStyleTableRecord();
* newTextStyleRecord.name = "测试文字样式"
* console.log(newTextStyleRecord.name) // 测试文字样式
* ```
*/
get name(): string;
set name(val: string);
/**
* 使
* @example
* ```ts
* import { McDbTextStyleTableRecord } from 'mxcad';
*
* const newTextStyleRecord = new McDbTextStyleTableRecord();
* newTextStyleRecord.isShapeFile = false;
* console.log(newTextStyleRecord.isShapeFile) // false
* ```
*/
get isShapeFile(): boolean;
set isShapeFile(val: boolean);
/**
* 使
* @example
* ```ts
* import { McDbTextStyleTableRecord } from 'mxcad';
*
* const newTextStyleRecord = new McDbTextStyleTableRecord();
* newTextStyleRecord.isVertical = false;
* console.log(newTextStyleRecord.isVertical) // false
* ```
*/
get isVertical(): boolean;
set isVertical(val: boolean);
/**
* ()
* @example
* ```ts
* import { McDbTextStyleTableRecord } from 'mxcad';
*
* const newTextStyleRecord = new McDbTextStyleTableRecord();
* newTextStyleRecord.textSize = 20;
* console.log(newTextStyleRecord.textSize) // 20
* ```
*/
get textSize(): number;
set textSize(val: number);
/**
*
* @example
* ```ts
* import { McDbTextStyleTableRecord } from 'mxcad';
*
* const newTextStyleRecord = new McDbTextStyleTableRecord();
* newTextStyleRecord.xScale = 0.8;
* console.log(newTextStyleRecord.xScale) // 0.8
* ```
*/
get xScale(): number;
set xScale(val: number);
/**
*
* @example
* ```ts
* import { McDbTextStyleTableRecord } from 'mxcad';
*
* const newTextStyleRecord = new McDbTextStyleTableRecord();
* newTextStyleRecord.obliquingAngle = Math.PI/4;
* console.log(newTextStyleRecord.obliquingAngle) // 45
* ```
*/
get obliquingAngle(): number;
set obliquingAngle(val: number);
/**
*
* @example
* ```ts
* import { McDbTextStyleTableRecord } from 'mxcad';
*
* const newTextStyleRecord = new McDbTextStyleTableRecord();
* // 获取标志位的当前值
* const currentFlagBits = newTextStyleRecord.flagBits;
* console.log("当前标志位:", currentFlagBits);
* // 设置新的标志位值
* const newFlagBits = 0b101010; // 例如:使用二进制字面量来表示新的标志位值
* newTextStyleRecord.flagBits = newFlagBits;
* console.log("设置后的标志位:", newTextStyleRecord.flagBits);
* ```
*/
get flagBits(): number;
set flagBits(val: number);
/**
*
* @example
* ```ts
* import { McDbTextStyleTableRecord } from 'mxcad';
*
* const newTextStyleRecord = new McDbTextStyleTableRecord();
* newTextStyleRecord.fileName = "测试字体名";
* console.log("当前字体文件名:",newTextStyleRecord.fileName)
* ```
*/
get fileName(): string;
set fileName(val: string);
/**
*
* @example
* ```ts
* import { McDbTextStyleTableRecord } from 'mxcad';
*
* const newTextStyleRecord = new McDbTextStyleTableRecord();
* newTextStyleRecord.bigFontFileName = "测试";
* console.log("大字体名称:",newTextStyleRecord.bigFontFileName)
* ```
*/
get bigFontFileName(): string;
set bigFontFileName(val: string);
/**
*
* @param sTypeface
* @param bold
* @param italic
* @param charset
* @param pitchAndFamily
* @returns
* @example
* ```ts
* import { McDbTextStyleTableRecord } from 'mxcad';
*
* const newTextStyleRecord = new McDbTextStyleTableRecord();
* // 设置字体
* const typeface = "Arial"; // 字体名称
* const isBold = true; // 是否粗体
* const isItalic = false; // 是否斜体
* const charset = 0; // 字符集
* const pitchAndFamily = 0; // 字体间距和风格
* const isSetFontSuccessful = newTextStyleRecord.setFont(typeface, isBold, isItalic, charset, pitchAndFamily);
* // 检查设置是否成功
* if (isSetFontSuccessful) {
* console.log("Font set successfully.");
* } else {
* console.log("Failed to set font.");
* }
* ```
*/
setFont(sTypeface: string, bold: boolean, italic: boolean, charset: number, pitchAndFamily: number): boolean;
/**
*
* @returns { object } sTypeface: 字体名称 | bold: 是否粗体 | italic: 是否斜体 | charset: 字符集 | pitchAndFamily: 字体间距和风格
*/
font(): {
sTypeface: string;
bold: boolean;
italic: boolean;
charset: number;
pitchAndFamily: number;
};
}
/**
*
* @example
* ```ts
* //添加图层
* import { McCmColor, MxCpp, McDbLayerTableRecord, McDb } from "mxcad"
*
* const mxcad = MxCpp.getCurrentMxCAD();
* // 构造新图层表记录对象
* const layer = new McDbLayerTableRecord()
* // 设置图层颜色
* layer.color = new McCmColor(0, 0, 0)
* // 设置图层是否被冻结
* layer.isFrozen = true
* // 设置图层是否被锁定
* layer.isLocked = true
* // 设置图层是否被关闭
* layer.isOff = true
* // 设置图层线宽
* layer.lineWeight = McDb.LineWeight.kLnWt018
* // 设置图层名
* layer.name = "图层名称"
* // 获取当前图层表
* const layerTable = mxcad.getDatabase().getLayerTable();
* // 向图表中添加图层
* const objId = layerTable.add(layer)
* mxcad.updateDisplay()
* ```
*/
export declare class McDbLayerTableRecord extends McDbObject {
/**
*
* @param imp
* @example
* ```ts
* import { McDbLayerTableRecord } from "mxcad";
*
* const layerRec = new McDbLayerTableRecord()
* ```
*/
constructor(imp?: any);
/**
*
* @example
* ```ts
* import { McDbLayerTableRecord } from "mxcad";
*
* const layerRec = new McDbLayerTableRecord();
* layerRec.name = "测试图层";
* console.log(layerRec.name)//测试图层
* ```
*/
get name(): string;
set name(val: string);
/**
*
* @example
* ```ts
* import { McDbLayerTableRecord } from "mxcad";
*
* const layerRec = new McDbLayerTableRecord();
* layerRec.isFrozen = true;
* console.log(layerRec.isFrozen)//true
* ```
*/
get isFrozen(): boolean;
set isFrozen(val: boolean);
/**
*
* @example
* ```ts
* import { McDbLayerTableRecord } from "mxcad";
*
* const layerRec = new McDbLayerTableRecord();
* layerRec.isOff = true;
* console.log(layerRec.isOff)//true
* ```
*/
get isOff(): boolean;
set isOff(val: boolean);
/**
*
* @example
* ```ts
* import { McDbLayerTableRecord } from "mxcad";
*
* const layerRec = new McDbLayerTableRecord();
* layerRec.isLocked = true;
* console.log(layerRec.isLocked)//true
* ```
*/
get isLocked(): boolean;
set isLocked(val: boolean);
/**
*
* @example
* ```ts
* import { McDbLayerTableRecord, McCmColor } from "mxcad";
*
* const layerRec = new McDbLayerTableRecord();
* layerRec.color = new McCmColor(255,255,255);
* console.log(layerRec.color) //(255,255,255)
* ```
*/
get color(): McCmColor;
set color(val: McCmColor);
/**
* 线 ID
* @example
* ```ts
* import { McDbLayerTableRecord } from "mxcad";
*
* const layerRec = new McDbLayerTableRecord();
* console.log(layerRec.linetypeObjectId)
* ```
*/
get linetypeObjectId(): McObjectId;
set linetypeObjectId(val: McObjectId);
/**
* 线
* @example
* ```ts
* import { McDbLayerTableRecord, McDb } from "mxcad";
*
* const layerRec = new McDbLayerTableRecord();
* layerRec.lineWeight = McDb.LineWeight.kLnWt015;
* console.log(layerRec.lineWeight)//15
* ```
*/
get lineWeight(): McDb.LineWeight;
set lineWeight(val: McDb.LineWeight);
}
/**
*
* @example
* ```ts
* //获取所有图层
* import { MxCpp, McDbLayerTable } from "mxcad"
* // 获取当前cad对象的图层表
* let layerTable:McDbLayerTable = MxCpp.getCurrentMxCAD().getDatabase().getLayerTable();
* // 获取图层表中的所有记录对象ID
* let aryId = layerTable.getAllRecordId();
* // 遍历图层表记录对象
* aryId.forEach((id) => {
* let layerRec = id.getMcDbLayerTableRecord();
* if (layerRec === null) return;
* console.log(layerRec);
* console.log("layerRec.color:" + layerRec.color.getColorString());
* console.log("layerRec.name:" + layerRec.name);
* });
* ```
*/
export declare class McDbLayerTable extends McDbObject {
/**
*
* @param imp
*/
constructor(imp?: any);
/**
* ID
* @param skipDeleted
* @returns ID数组
* @example
* ```ts
* import { MxCpp, McDbLayerTable } from "mxcad";
*
* const layerTable:McDbLayerTable = MxCpp.getCurrentMxCAD().getDatabase().getLayerTable();
* const aryId = layerTable.getAllRecordId();
* console.log(aryId)
* ```
*/
getAllRecordId(skipDeleted?: boolean): McObjectId[];
/**
*
* @param rec
* @returns ID
* @example
* ```ts
* import { MxCpp, McDbLayerTable } from "mxcad";
*
* const layerTable:McDbLayerTable = MxCpp.getCurrentMxCAD().getDatabase().getLayerTable();
* const layerRec = new McDbLayerTableRecord();
* const id = layerTable.add(layerRec);
* ```
*/
add(rec: McDbLayerTableRecord): McObjectId;
/**
*
* @param sName
* @param skipDeleted
* @returns ID
* @example
* ```ts
* import { MxCpp, McDbLayerTable } from "mxcad";
*
* const layerTable:McDbLayerTable = MxCpp.getCurrentMxCAD().getDatabase().getLayerTable();
* const layerRec = new McDbLayerTableRecord();
* layerRec.name = "测试图层"
* layerTable.add(layerRec);
* const id = layerTable.get("测试图层")
* ```
*/
get(sName: string, skipDeleted?: boolean): McObjectId;
/**
*
* @param sName
* @param skipDeleted
* @returns
* @example
* ```ts
* import {MxCpp, McDbLayerTable } from "mxcad";
*
* const layerTable:McDbLayerTable = MxCpp.getCurrentMxCAD().getDatabase().getLayerTable();
* const layerRec = new McDbLayerTableRecord();
* layerRec.name = "测试图层"
* layerTable.add(layerRec);
* const res = layerTable.has("测试图层");
* console.log(res);
* ```
*/
has(sName: string, skipDeleted?: boolean): boolean;
}
/**
* 线线
* @example
* ```ts
* // 获取所有线型
* import { MxCpp, McDbLinetypeTable } from "mxcad"
* // 获取当前CAD对象
* let mxcad = MxCpp.getCurrentMxCAD();
* // 获取数据库线型表
* let linetypeTable: McDbLinetypeTable = mxcad.getDatabase().getLinetypeTable();
* // 获取线性表中的所有线型表记录对象ID
* let aryId = linetypeTable.getAllRecordId();
* // 遍历线型表记录对象
* aryId.forEach((id) => {
* let linetypeRec = id.getMcDbLinetypeTableRecord();
* if (linetypeRec === null) return;
* console.log(linetypeRec);
* console.log("linetypeRec.name:" + linetypeRec.name);
* });
* ```
*/
export declare class McDbLinetypeTable extends McDbObject {
/**
*
* @param imp
*/
constructor(imp?: any);
/**
* 线线ID
* @param skipDeleted 线
* @returns ret 线ID数组
* @example
* ```ts
* import { MxCpp, McDbLinetypeTable } from "mxcad";
*
* let mxcad = MxCpp.getCurrentMxCAD();
* let linetypeTable: McDbLinetypeTable = mxcad.getDatabase().getLinetypeTable();
* ```
*/
getAllRecordId(skipDeleted?: boolean): McObjectId[];
/**
* 线线
* @param rec 线
* @returns 线ID
* @example
* ```ts
* import { MxCpp, McDbLinetypeTable } from "mxcad";
*
* let mxcad = MxCpp.getCurrentMxCAD();
* let linetypeTable: McDbLinetypeTable = mxcad.getDatabase().getLinetypeTable();
* let newLinetypeRecord = new McDbLinetypeTableRecord();
* const id = linetypeTable.add(newLinetypeRecord);
* console.log(id)
* ```
*/
add(rec: McDbLinetypeTableRecord): McObjectId;
/**
* 线线
* @param sName 线
* @param skipDeleted 线
* @returns 线ID
* @example
* ```ts
* import { MxCpp, McDbLinetypeTable } from "mxcad";
*
* let mxcad = MxCpp.getCurrentMxCAD();
* let linetypeTable: McDbLinetypeTable = mxcad.getDatabase().getLinetypeTable();
* let newLinetypeRecord = new McDbLinetypeTableRecord();
* newLinetypeRecord.name = "TestMyLine";
* linetypeTable.add(newLinetypeRecord);
* const id = linetypeTable.get("TestMyLine")
* ```
*/
get(sName: string, skipDeleted?: boolean): McObjectId;
/**
* 线线
* @param sName 线
* @param skipDeleted 线
* @returns
* @example
* ```ts
* import { MxCpp, McDbLinetypeTable } from "mxcad";
*
* let mxcad = MxCpp.getCurrentMxCAD();
* let linetypeTable: McDbLinetypeTable = mxcad.getDatabase().getLinetypeTable();
* let newLinetypeRecord = new McDbLinetypeTableRecord();
* newLinetypeRecord.name = "TestMyLine";
* linetypeTable.add(newLinetypeRecord);
* const res = linetypeTable.has("TestMyLine");
* console.log(res)
* ```
*/
has(sName: string, skipDeleted?: boolean): boolean;
}
/**
*
* @example
* ```ts
* ```
*/
export declare class McDbDimStyleTable extends McDbObject {
/**
*
* @param imp
*/
constructor(imp?: any);
/**
*
* @param skipDeleted
* @returns ID数组
* @example
* ```ts
* ```
*/
getAllRecordId(skipDeleted?: boolean): McObjectId[];
/**
*
* @param rec
* @returns 线ID
* @example
* ```ts
*/
add(rec: McDbDimStyleTableRecord): McObjectId;
/**
*
* @param sName
* @param skipDeleted
* @returns ID
* @example
* ```ts
* ```
*/
get(sName: string, skipDeleted?: boolean): McObjectId;
/**
*
* @param sName
* @param skipDeleted
* @returns
* @example
* ```ts
* ```
*/
has(sName: string, skipDeleted?: boolean): boolean;
}
/**
*
* @example
* ```ts
* // 获取所有文字样式
* import { MxCpp, McDbTextStyleTable } from "mxcad"
* // 获取当前CAD对象
* let mxcad = MxCpp.getCurrentMxCAD();
* // 获取数据库文字样式表
* let textSyleTable: McDbTextStyleTable = mxcad.getDatabase().getTextStyleTable();
* // 获取文字样式表中的所有文字样式表记录对象ID
* let aryId = textSyleTable.getAllRecordId();
* // 遍历文字样式表记录对象
* aryId.forEach((id) => {
* let textSyleRec = id.getMcDbTextStyleTableRecord();
* if (textSyleRec === null) return;
* console.log(textSyleRec);
* console.log("textSyleRec.fileName:" + textSyleRec.fileName);
* console.log("textSyleRec.name:" + textSyleRec.name);
* });
* ```
*/
export declare class McDbTextStyleTable extends McDbObject {
/**
*
* @param imp
*/
constructor(imp?: any);
/**
* ID
* @param skipDeleted
* @returns ret ID数组
* @example
* ```ts
* import { MxCpp, McDbTextStyleTable } from "mxcad"
*
* let mxcad = MxCpp.getCurrentMxCAD();
* let textSyleTable: McDbTextStyleTable = mxcad.getDatabase().getTextStyleTable();
* const aryId = textSyleTable.getAllRecordId();
* console.log(aryId)
* ```
*/
getAllRecordId(skipDeleted?: boolean): McObjectId[];
/**
*
* @param rec
* @returns ID
* @example
* ```ts
* import { MxCpp, McDbTextStyleTable } from "mxcad"
*
* let mxcad = MxCpp.getCurrentMxCAD();
* let textSyleTable: McDbTextStyleTable = mxcad.getDatabase().getTextStyleTable();
*
* const newTextStyleRecord = new McDbTextStyleTableRecord();
* const id = textSyleTable.add(newTextStyleRecord);
* console.log(id)
* ```
*/
add(rec: McDbTextStyleTableRecord): McObjectId;
/**
*
* @param sName
* @param skipDeleted
* @returns ID
* @example
* ```ts
* import { MxCpp, McDbTextStyleTable } from "mxcad"
*
* let mxcad = MxCpp.getCurrentMxCAD();
* let textSyleTable: McDbTextStyleTable = mxcad.getDatabase().getTextStyleTable();
*
* const newTextStyleRecord = new McDbTextStyleTableRecord();
* newTextStyleRecord.name = "测试文字样式";
* textSyleTable.add(newTextStyleRecord);
* const objId = textSyleTable.get("测试文字样式")
* ```
*/
get(sName: string, skipDeleted?: boolean): McObjectId;
/**
*
* @param sName
* @param skipDeleted
* @returns
* @example
* ```ts
* import { MxCpp, McDbTextStyleTable } from "mxcad"
*
* let mxcad = MxCpp.getCurrentMxCAD();
* let textSyleTable: McDbTextStyleTable = mxcad.getDatabase().getTextStyleTable();
*
* const newTextStyleRecord = new McDbTextStyleTableRecord();
* newTextStyleRecord.name = "测试文字样式";
* textSyleTable.add(newTextStyleRecord);
* const res = textSyleTable.has("测试文字样式");
* console.log(res)// true
* ```
*/
has(sName: string, skipDeleted?: boolean): boolean;
}
/**
* mxcad.getDatabase()
*/
export declare class McDbDatabase extends McRxObject {
/**
*
* @param imp
*/
constructor(imp?: any);
/**
*
* @returns
* @example
* ```ts
import { MxCADUiPrEntity, MxCpp } from "mxcad";
//隐藏目标对象所在图层
async function Mx_SelectEntitHideLayer() {
let selEntity1 = new MxCADUiPrEntity();
selEntity1.setMessage("选择要隐藏的对象")
let id = await selEntity1.go();
if (!id.isValid()) return;
let ent = id.getMcDbEntity();
let mxcad = MxCpp.getCurrentMxCAD();
let layerTable = mxcad.getDatabase().getLayerTable();
let layerId = layerTable.get(ent.layer);
let layerRec = layerId.getMcDbLayerTableRecord();
if (layerRec === null) return;
layerRec.isOff = true;
mxcad.updateLayerDisplayStatus();
mxcad.updateDisplay()
}
* ```
*/
getLayerTable(): McDbLayerTable;
/**
*
* @example
* ```ts
* import { MxCpp, McDbDatabase } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* let layerTable = dataBase.layerTable;
* ```
*/
get layerTable(): McDbLayerTable;
/**
* 线
* @returns 线
* @example
* ```ts
import { MxCpp } from "mxcad"
//得所有线型
let mxcad = MxCpp.App.getCurrentMxCAD();
let linetypeTable = mxcad.getDatabase().getLinetypeTable();
let aryId = linetypeTable.getAllRecordId();
aryId.forEach((id) => {
let linetypeRec = id.getMcDbLinetypeTableRecord();
if (linetypeRec === null) return;
console.log(linetypeRec);
});
* ```
*/
getLinetypeTable(): McDbLinetypeTable;
/**
*
* @returns 线
*/
getDimStyleTable(): McDbDimStyleTable;
/**
*
* @returns 线
*/
get dimStyleTable(): McDbDimStyleTable;
/**
* 线
* @example
* ```ts
* import { MxCpp, McDbDatabase } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* let lineTypeTable = dataBase.linetypeTable;
* ```
*/
get linetypeTable(): McDbLinetypeTable;
/**
*
* @returns
* @example
* ```ts
//获取所有文字样式
import { MxCpp } from "mxcad"
let mxcad = MxCpp.getCurrentMxCAD();
let textSyleTable = mxcad.getDatabase().getTextStyleTable();
let aryId = textSyleTable.getAllRecordId();
aryId.forEach((id) => {
let textSyleRec = id.getMcDbTextStyleTableRecord();
if (textSyleRec === null) return;
let out: any = {};
out.name = textSyleRec.name;
out.font = textSyleRec.font();
out.fileName = textSyleRec.fileName;
out.bigFontFileName = textSyleRec.bigFontFileName;
out.textSize = textSyleRec.textSize;
out.xScale = textSyleRec.xScale;
console.log(out);
});
* ```
*/
getTextStyleTable(): McDbTextStyleTable;
/**
*
* @example
* ```ts
* import { MxCpp, McDbDatabase } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* let textStyleTable = dataBase.textStyleTable;
* ```
*/
get textStyleTable(): McDbTextStyleTable;
/**
*
* @returns
* @example
* ```ts
import { MxCpp, McDbDatabase } from "mxcad"
let mxcad = MxCpp.App.getCurrentMxCAD();
let blockTable = mxcad.getDatabase().getBlockTable();
let aryId = blockTable.getAllRecordId();
aryId.forEach((id) => {
let blkRec = id.getMcDbBlockTableRecord();
if (blkRec === null) return;
console.log(blkRec);
console.log("blkRec.name:" + blkRec.name);
console.log("blkRec.origin:" + blkRec.origin);
});
* ```
*/
getBlockTable(): McDbBlockTable;
/**
*
* @returns McDbDictionary
* @example
* ```ts
import { MxCpp, McDbDatabase } from "mxcad"
// 写扩展记录
let mxcad = MxCpp.getCurrentMxCAD();
let dict = mxcad.getDatabase().getNamedObjectsDictionary();
let sName = "MyDict";
let idDict = dict.getAt(sName);
if (idDict.isNull()) {
let newDict = new McDbDictionary;
idDict = dict.addObject(sName, newDict);
}
let myDict = idDict.getMcDbDictionary();
if (myDict) {
let xrec = new McDbXrecord();
let data = new MxCADResbuf();
data.AddString("TestData");
xrec.setData(data);
myDict.addObject("MyRecord", xrec);
console.log("write xrecord ok");
}
* ```
*/
getNamedObjectsDictionary(): McDbDictionary;
/**
* id
* @returns McDbDictionary
* @example
* ```
*/
getEntitiesInTheGroup(id: McObjectId): McObjectId[];
/**
*
* @returns McDbDictionary
* @example
* ```
*/
GetGroupDictionary(): McDbDictionary;
/**
*
* @returns McDbDictionary
* @example
* ```
*/
CreateGroup(ids: McObjectId[], name?: string): boolean;
/**
*
* @example
* ```ts
* import { MxCpp, McDbDatabase } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* let blkTable = dataBase.blockTable;
* ```
*/
get blockTable(): McDbBlockTable;
/**
*
* @returns
* @example
* ```ts
* import { MxCpp, McDbDatabase } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* let currentBlkRec = dataBase.currentSpace;
* ```
*/
get currentSpace(): McDbBlockTableRecord;
/**
* 线
* @returns 线
* @example
* ```ts
* import { MxCpp, McDbDatabase } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* let currentLTS = dataBase.getCurrentlyLineTypeScale();
* ```
*/
getCurrentlyLineTypeScale(): number;
/**
* 线
* @param val 线
* @returns 线
* @example
* ```ts
* import { MxCpp, McDbDatabase } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* dataBase.setCurrentlyLineTypeScale(0.8);
* ```
*/
setCurrentlyLineTypeScale(val: number): number;
/**
* 线
* @returns 线
* @example
* ```ts
* import { MxCpp, McDbDatabase } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* const name = dataBase.getCurrentlyLineTypeName();
* ```
*/
getCurrentlyLineTypeName(): string;
/**
* 线
* @param sName 线
* @example
* ```ts
* import { MxCpp, McDbDatabase } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* dataBase.setCurrentlyLineTypeName("测试线型");
* ```
*/
setCurrentlyLineTypeName(sName: string): void;
/**
*
* @returns
* @example
* ```ts
* import { MxCpp, McDbDatabase } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* const layerName = dataBase.getCurrentlyLayerName();
* ```
*/
getCurrentlyLayerName(): string;
/**
*
* @param sName
* @example
* ```ts
* import { MxCpp, McDbDatabase } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* dataBase.setCurrentlyLayerName("测试图层");
* ```
*/
setCurrentlyLayerName(sName: string): void;
/**
* CAD颜色
* @returns CAD颜色
* @example
* ```ts
* import { MxCpp, McDbDatabase } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* const color = dataBase.getCurrentlyTrueColor();
* ```
*/
getCurrentlyTrueColor(): McCmColor;
/**
* 使
* @example
* ```ts
* import { MxCpp, McDbDatabase } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* const color = dataBase.getCurrentlyDrawColor();
* ```
*/
getCurrentlyDrawColor(): THREE.Color;
/**
* CAD颜色
* @param color CAD颜色
* @example
* ```ts
* import { MxCpp, McDbDatabase, McCmColor } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* const color = new McCmColor(255, 0, 0);
* dataBase.setCurrentlyTrueColor(color);
* ```
*/
setCurrentlyTrueColor(color: McCmColor): any;
/**
*
* @returns ColorIndexType
* @example
* ```ts
* import { MxCpp, McDbDatabase } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* const colorIndex = dataBase.getCurrentlyColorIndex();
* ```
*/
getCurrentlyColorIndex(): number;
/**
* ColorIndexType
* @param colorIndex
* @example
* ```ts
* import { MxCpp, McDbDatabase } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* const colorIndex = dataBase.getCurrentlyColorIndex();
* ```
*/
setCurrentlyColorIndex(colorIndex: number): any;
/**
*
* @returns
* @example
* ```ts
* import { MxCpp, McDbDatabase } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* const textStyName = dataBase.getCurrentlyTextStyleName();
* ```
*/
getCurrentlyTextStyleName(): string;
/**
*
* @param sName
* @example
* ```ts
* import { MxCpp, McDbDatabase } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* dataBase.setCurrentlyTextStyle("测试文字样式");
* ```
*/
setCurrentlyTextStyle(sName: string): void;
/**
* id.
*/
getCurrentlyTextStyleId(): McObjectId;
/**
* id.
*/
SetCurrentlyTextStyleId(id: McObjectId): boolean;
/**
* id.
*/
getCurrentlyDimStyleId(): McObjectId;
/**
* id.
*/
setCurrentlyDimStyleId(id: McObjectId): boolean;
/**
* id.
*/
getCurrentlyLayerId(): McObjectId;
/**
* id.
*/
setCurrentlyLayerId(id: McObjectId): boolean;
/**
* 线id.
*/
getCurrentlyLinetypeId(): McObjectId;
/**
* id.
*/
setCurrentlyLinetypeId(id: McObjectId): boolean;
/**
* id.
* @example
* ```ts
* import { MxCpp, McDbDatabase } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* // 传入句柄并获取相应的对象 ID
* const handle = "ABCD1234"; // 假设这是一个有效的句柄
* const objectId = dataBase.handleToIdIndex(handle);
* // 确保获取的对象 ID 是有效的
* if (objectId) {
* console.log("success", objectId);
* } else {
* console.log("error")
* }
* ```
*/
handleToIdIndex(sHandle: string): McObjectId;
/**
*
* @return
* @example
* ```ts
* import { MxCpp, McDbDatabase } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* const res = dataBase.isModifyed();
* if(res){
* console.log("已修改")
* }else{
* console.log("未修改")
* }
* ```
*/
isModifyed(): boolean;
/**
*
* @example
* ```ts
* import { MxCpp, McDbDatabase } from "mxcad"
*
* const dataBase:McDbDatabase = MxCpp.getCurrentMxCAD().getDatabase();
* dataBase.resetModificationStatus();
* ```
*/
resetModificationStatus(): void;
}
/**
*
* @example
* ```ts
// 添加图块
import { MxCpp, McDbBlockTableRecord, McDbBlockReference, McDbLine, McCmColor } from "mxcad"
let mxcad = MxCpp.getCurrentMxCAD();
let blkTable = mxcad.getDatabase().getBlockTable();
let blkRecId = blkTable.add(new McDbBlockTableRecord());
// 根据ObjectId再次得到刚刚添加的图块记录
let blkTableRecord:McDbBlockTableRecord = blkRecId.getMcDbBlockTableRecord()
// 添加两条线段再图块记录中 这里每条线段的具体属性比如开始点和结束点自行赋值
const line = new McDbLine(80, 80, 0, -80, -80, 0)
line.trueColor = new McCmColor(255, 0, 0)
const line1 = new McDbLine(-80, 80, 0, 80, -80, 0)
blkTableRecord.appendAcDbEntity(line);
blkTableRecord.appendAcDbEntity(line1);
// 设置图块的基点 一般是包围盒内的点, 可以任意指定
blkTableRecord.origin = new McGePoint3d(0,0,0);
// 实例化块参照 这里需要设置我们刚刚添加图块记录得到的ObjectId
let blkRef = new McDbBlockReference();
blkRef.blockTableRecordId = blkRecId;
// 最后设置位置 渲染图块
blkRef.position = new McGePoint3d(0,0,0);
mxcad.drawEntity(blkRef);
* ```
* ```ts
// 改块颜色
import { McDbBlockTableRecord, MxCADResbuf, MxCpp, McCmColor} from "mxcad";
async function Mx_BlkColor() {
// 选择目标块
let filter = new MxCADResbuf();
filter.AddMcDbEntityTypes("INSERT");// 设置过滤器,选择块对象
const getBlockEvent = new MxCADUiPrEntity()
getBlockEvent.setMessage('选择需要修改基点的块');
getBlockEvent.setFilter(filter);
const block_id = await getBlockEvent.go();
if (!block_id.id) return;
// 块实体
const blkRef = block_id.getMcDbEntity() as McDbBlockReference;
let blkRec = blkRef.blockTableRecordId.getMcDbBlockTableRecord();
Mx_ModyfBlockRecordEntityColor(blkRec);// 设置块颜色类型为随块
// 设置块颜色
const getColor = new MxCADUiPrInt();
getColor.setMessage('输入颜色索引(0~256)');
let colorNum = await getColor.go() || 0;
let color = new McCmColor();
color.setColorIndex(colorNum);
blkRef.trueColor = color;
const mxcad = MxCpp.getCurrentMxCAD();
mxcad.updateDisplay()
}
// 设置块颜色类型
function Mx_ModyfBlockRecordEntityColor(blkRec: McDbBlockTableRecord) {
blkRec.getAllEntityId().forEach(id => {
let ent = id.getMcDbEntity();
ent.colorIndex = ColorIndexType.kByblock;
if (ent instanceof McDbBlockReference) {
let blkref = ent as McDbBlockReference;
Mx_ModyfBlockRecordEntityColor(blkref.blockTableRecordId.getMcDbBlockTableRecord());
}
})
}
* ```
*/
export declare class McDbBlockTableRecord extends McDbObject {
/**
*
* @param imp
* @example
* ```ts
* import { McDbBlockTableRecord } from "mxcad";
*
* const blkRec = new McDbBlockTableRecord();
* ```
*/
constructor(imp?: any);
/**
*
* @param pEntity
* @returns id
* @example
* ```ts
* import { McDbBlockTableRecord, McDbLine } from "mxcad";
*
* const line = new McDbLine(-80, 80, 0, 80, -80, 0);
* const blkRec = new McDbBlockTableRecord();
* const objId = blkRec.appendAcDbEntity(line)
* ```
*/
appendAcDbEntity(pEntity: McDbEntity): McObjectId;
/**
* ID
* @example
* ```ts
* import { McDbBlockTableRecord, McDbLine } from "mxcad";
*
* const line = new McDbLine(-80, 80, 0, 80, -80, 0);
* const blkRec = new McDbBlockTableRecord();
* blkRec.appendAcDbEntity(line);
* const aryId = blkRec.getAllEntityId();
* console.log(aryId)
* ```
*/
getAllEntityId(skipDeleted?: boolean): McObjectId[];
/**
* .
* @return { object } minDrawOrder: 最小显示顺序 | maxDrawOrder: 最大显示顺序
* @example
* ```ts
* // 获取最小和最大绘制顺序
* const { minDrawOrder, maxDrawOrder } = blkRec.getMinMaxDrawOrder();
*
* // 打印结果
* console.log("最小绘制顺序:", minDrawOrder);
* console.log("最大绘制顺序:", maxDrawOrder);
* ```
*/
getMinMaxDrawOrder(): {
minDrawOrder: number;
maxDrawOrder: number;
};
/**
*
* @return
* @example
* ```ts
* import { McDbBlockTableRecord, McGePoint3d } from "mxcad";
*
* const blkRec = new McDbBlockTableRecord();
* blkRec.origin = new McGePoint3d(0,0,0);
* console.log("图块原点", blkRec.origin)//(0,0,0)
* ```
*/
get origin(): McGePoint3d;
set origin(origin: McGePoint3d);
/**
*
* @returns { object } minPt:最小点 | maxPt:最大点 | ret:是否获取成功
* @example
* ```ts
* // 假设blkRec为一个有效的块表记录对象
* const retVal = blkRec.getBoundingBox();
* if(retVal.ret){
* console.log("最小点", retVal.minPt);
* console.log("最大点", retVal.maxPt);
* }else{
* console.log("error")
* }
* ```
*/
getBoundingBox(): {
minPt: McGePoint3d;
maxPt: McGePoint3d;
ret: boolean;
};
/**
* 使
* @example
* ```ts
* // 假设blkRec为一个有效的块表记录对象
* blkRec.invalidBoundingBoxBuffer()
* ```
*/
invalidBoundingBoxBuffer(): void;
/**
*
* @example
* ```ts
* // 假设blkRec为一个有效的块表记录对象
* blkRec.name = "测试图块名";
* console.log(blkRec.name);//测试图块名
* ```
*/
get name(): string;
set name(val: string);
}
/**
*
* @example
* ```ts
* //遍历图纸中的所有图块
* import { MxCpp, McDbBlockTable } from "mxcad"
*
* // 获取当前cad对象
* let mxcad = MxCpp.App.getCurrentMxCAD();
* // 获取块表对象
* let blockTable: McDbBlockTable = mxcad.getDatabase().getBlockTable();
* // 获取块表中的所有记录对象id
* let aryId = blockTable.getAllRecordId();
* //遍历记录对象id,获取块表记录对象详情
* aryId.forEach((id) => {
* let blkRec = id.getMcDbBlockTableRecord();
* if (blkRec === null) return;
* console.log(blkRec);
* console.log("blkRec.name:" + blkRec.name);
* console.log("blkRec.origin:" + blkRec.origin);
* });
* ```
*/
export declare class McDbBlockTable extends McDbObject {
/**
*
* @param imp
*/
constructor(imp?: any);
/**
* ID
* @param skipDeleted
* @returns ret ID数组
* @example
* ```ts
* import { MxCpp, McDbBlockTable } from "mxcad"
*
* let mxcad = MxCpp.App.getCurrentMxCAD();
* let blockTable: McDbBlockTable = mxcad.getDatabase().getBlockTable();
* const aryId = blockTable.getAllRecordId();
* console.log(aryId)
* ```
*/
getAllRecordId(skipDeleted?: boolean): McObjectId[];
/**
*
* @param rec
* @returns ID
* @example
* ```ts
* import { MxCpp, McDbBlockTable } from "mxcad"
*
* let mxcad = MxCpp.App.getCurrentMxCAD();
* let blockTable: McDbBlockTable = mxcad.getDatabase().getBlockTable();
* const blkRec = new McDbBlockTableRecord();
* const objId = blockTable.add(blkRec);
* ```
*/
add(rec: McDbBlockTableRecord | string): McObjectId;
/**
*
* @param sName
* @param skipDeleted
* @returns ID
* @example
* ```ts
* import { MxCpp, McDbBlockTable } from "mxcad"
*
* let mxcad = MxCpp.App.getCurrentMxCAD();
* let blockTable: McDbBlockTable = mxcad.getDatabase().getBlockTable();
* const blkRec = new McDbBlockTableRecord();
* blkRec.name = "测试图块";
* blockTable.add(blkRec);
* const objId = blockTable.get("测试图块");
* ```
*/
get(sName: string, skipDeleted?: boolean): McObjectId;
/**
*
* @param sName
* @param skipDeleted
* @returns
* @example
* ```ts
* import { MxCpp, McDbBlockTable } from "mxcad"
*
* let mxcad = MxCpp.App.getCurrentMxCAD();
* let blockTable: McDbBlockTable = mxcad.getDatabase().getBlockTable();
* const blkRec = new McDbBlockTableRecord();
* blkRec.name = "测试图块";
* blockTable.add(blkRec);
* const res = blockTable.has("测试图块");
* console.log(res)
* ```
*/
has(sName: string): boolean;
}
/**
* CAD中显示光栅图形
*/
export declare class McDbRasterImageDef extends McDbObject {
/**
*
* @param imp
* @example
* ```ts
* import { McDbRasterImageDef } from "mxcad";
*
* const imageDef = new McDbRasterImageDef()
* ```
*/
constructor(imp?: any);
/**
*
* @param sPathName
* @example
* ```ts
* import { McDbRasterImageDef } from "mxcad";
*
* const imageDef = new McDbRasterImageDef();
* imageDef.sourceFileName = "../example.jpg";
* const pathName = imageDef.sourceFileName;
* console.log("文件路径:", pathName);
* ```
*/
set sourceFileName(sPathName: string);
get sourceFileName(): string;
/**
* Base64
* @param sUrl
* @returns
* @example
* ```ts
* import { McDbRasterImageDef } from "mxcad";
*
* const imageDef = new McDbRasterImageDef();
* const res = imageDef.saveToBase64("../example.jpg");
* if(res){
* //保存成
* }else{
* //保存失败
* }
* ```
*/
saveToBase64(sUrl: string): boolean;
}
/**
*
* @example
* ```ts
* import { McDbDictionary, McDbXrecord } from "mxcad"
*
* //遍历字典
* function MxTest_GetNamedObjectsDictionary() {
* // 获取当前CAD对象
* let mxcad = MxCpp.getCurrentMxCAD();
* // 获取数据库中的字典对象
* let dict = mxcad.getDatabase().getNamedObjectsDictionary();
* // 获取字典中所有的对象名
* let aryName = dict.getAllObjectName();
* // 遍历对象名
* aryName.forEach((name) => {
* console.log(name);
* let id = dict.getAt(name);
* let obj = id.getMcDbObject();
* if (obj instanceof McDbDictionary) {
* let dict: McDbDictionary = obj;
* console.log(dict);
* MxTest_DictionaryData(dict);// 递归遍历字典对象
* }
* })
* }
*
* function MxTest_DictionaryData(dict: McDbDictionary) {
* let aryName = dict.getAllObjectName();
* aryName.forEach((name) => {
* console.log(name);
* let id = dict.getAt(name);
* let obj = id.getMcDbObject();
* if (obj instanceof McDbDictionary) {
* let dict: McDbDictionary = obj;
* console.log(dict);
* MxTest_DictionaryData(dict);
* }
* else if (obj instanceof McDbXrecord) {
* let xrec: McDbXrecord = obj;
* let data = xrec.getData()
* data.PrintData();
* }
* })
* }
* ```
*/
export declare class McDbDictionary extends McDbObject {
/**
*
* @param imp
*/
constructor(imp?: any);
/**
*
* @returns ID数组
* @example
* ```ts
* import { MxCpp, McDbDictionary } from "mxcad";
*
* let mxcad = MxCpp.getCurrentMxCAD();
* let dict:McDbDictionary = mxcad.getDatabase().getNamedObjectsDictionary();
* const aryId = dict.getAllObject();
* console.log(aryId);
* ```
*/
getAllObject(): McObjectId[];
/**
*
* @returns
* @example
* ```ts
* import { MxCpp, McDbDictionary } from "mxcad";
*
* let mxcad = MxCpp.getCurrentMxCAD();
* let dict:McDbDictionary = mxcad.getDatabase().getNamedObjectsDictionary();
* const aryName = dict.getAllObjectName();
* console.log(aryName);
* ```
*/
getAllObjectName(): McGeStringArray;
/**
*
* @param sName
* @returns
* @example
* ```ts
* import { MxCpp, McDbDictionary } from "mxcad";
*
* let mxcad = MxCpp.getCurrentMxCAD();
* let dict:McDbDictionary = mxcad.getDatabase().getNamedObjectsDictionary();
* const res = dict.remove("测试字典");
* if(res){
* //移除成功
* }else{
* //移除失败
* }
* ```
*/
remove(sName: string): boolean;
/**
*
* @param sName
* @param obj
* @returns ID
* @example
* ```ts
* import { MxCpp, McDbDictionary, McDbObject } from "mxcad";
*
* let mxcad = MxCpp.getCurrentMxCAD();
* let dict:McDbDictionary = mxcad.getDatabase().getNamedObjectsDictionary();
* const objectId = dict.addObject("newObject", new McDbObject());
* ```
*/
addObject(sName: string, obj: McDbObject): McObjectId;
/**
*
* @param sName
* @param isGetErased
* @returns ID
* @example
* ```ts
* import { MxCpp, McDbDictionary } from "mxcad";
*
* let mxcad = MxCpp.getCurrentMxCAD();
* let dict:McDbDictionary = mxcad.getDatabase().getNamedObjectsDictionary();
* const objId = dict.getAt("测试字典");
* ```
*/
getAt(sName: string, isGetErased?: boolean): McObjectId;
}
/**
*
* @example
* ```ts
* // 写扩展记录
* import { MxCpp, McDbDictionary, McDbXrecord, MxCADResbuf } from "mxcad"
* // 获取当前CAD对象的字典对象
* let mxcad = MxCpp.getCurrentMxCAD();
* let dict = mxcad.getDatabase().getNamedObjectsDictionary();
* // 获取字典中指定对象"MyDict"
* let sName = "MyDict";
* let idDict = dict.getAt(sName);
* if (idDict.isNull()) {
* // 向字典中添加对象
* let newDict = new McDbDictionary;
* idDict = dict.addObject(sName, newDict);
* }
* let myDict = idDict.getMcDbDictionary();
* if (myDict) {
* let xrec = new McDbXrecord();// 构造新扩展记录类型
* let data = new MxCADResbuf();// 构造resbuf对象
* data.AddString("TestData");// 添加字符串到 resbuf 中
* xrec.setData(data);// 设置扩展记录中的数据
* myDict.addObject("MyRecord", xrec); // 向字典中添加对象
* console.log("write xrecord ok");
* }
*
* // 读取扩展数据。
* async function MxTest_ReadxData() {
* // 选择目标对象
* let selEntity = new MxCADUiPrEntity();
* selEntity.setMessage("选择对象");
* let id = await selEntity.go();
* if (!id.isValid()) return;
* // 获取实例对象
* let ent = id.getMcDbEntity();
* if (ent === null) return;
* // 读取扩展数据
* let data = ent.getxData();
* data.forEach((val, type, dxf) => {
* console.log(JSON.stringify({ val: val, type: type, dxf: dxf }));
* })
*
* //let data = ent.getxDataString("DataName");
* //MxFun.acutPrintf(data.val + "\n");
* }
* ```
*/
export declare class McDbXrecord extends McDbObject {
/**
*
* @param imp
* @example
* ```ts
* import { McDbXrecord } from "mxcad";
*
* // 创建一个 McDbXrecord 对象
* const xrec = new McDbXrecord();
* ```
*/
constructor(imp?: any);
/**
*
* @param xdata resbuf
* @example
* ```ts
* import { McDbXrecord } from "mxcad";
*
* // 创建一个 McDbXrecord 对象
* const xrec = new McDbXrecord();
* let data = new MxCADResbuf();
* data.AddString("TestData");
* const res = xrec.setData(data);
* if(res){
* //设置成功
* }else{
* //设置失败
* }
* ```
*/
setData(xdata: MxCADResbuf): boolean;
/**
*
* @param xdata resbuf
* @example
* ```ts
* import { McDbXrecord } from "mxcad";
*
* // 创建一个 McDbXrecord 对象
* const xrec = new McDbXrecord();
* const resbuf = dbXrecord.getData();
* ```
*/
getData(): MxCADResbuf;
}
/**
*
* @example
* ```ts
*
* let ss = new MxCADSelectionSet();
* if (!await ss.userSelect("选择要做成组的对象:")) return;
* if (ss.count() == 0) return;
* let mxcad = MxCpp.getCurrentMxCAD();
* mxcad.getDatabase().CreateGroup(ss.getIds());
* ```
*/
export declare class McDbGroup extends McDbObject {
/**
*
*/
constructor(imp?: any);
/**
*
* @example
* ```ts
* ```
*/
set description(description: string);
get description(): string;
/**
*
* @example
* ```ts
* ```
*/
set name(name: string);
get name(): string;
/**
*
* @example
* ```ts
* ```
*/
set isSelectable(val: boolean);
get isSelectable(): boolean;
/**
*
* @example
* ```ts
* ```
*/
clear(): boolean;
/**
*
* @example
* ```ts
* ```
*/
append(id: McObjectId): boolean;
/**
*
* @example
* ```ts
* ```
*/
appendArray(aryId: McObjectId[]): boolean;
/**
*
* @example
* ```ts
* ```
*/
has(id: McObjectId): boolean;
/**
*
* @example
* ```ts
* ```
*/
getAllEntityId(): McObjectId[];
/**
*
* @example
* ```ts
* ```
*/
numEntities(): number;
}
declare class MxAI {
private serverUrl;
private mapFun;
init(serverUrl: string): void;
addFunction(name: string, call: any): void;
registTool(tool: any): void;
reloadTools(param: any): void;
chat_tool(str: string): void;
}
/** 排除接口包含某些类型的属性名称 */
export type NonPropertyNames<T, P> = {
[K in keyof T]: T[K] extends P ? never : K;
}[keyof T];
/**
* @param T
* @param P
* @example
* ```ts
* interface MyInterface {
* name: string;
* age: number;
* sayHello(): void;
* walk(distance: number): void;
* }
* ExcludePropertiesContainingThisType<MyInterface, Function>
* ```
*/
export type ExcludePropertiesContainingThisType<T, P> = Pick<T, NonPropertyNames<T, P>>;
/** 颜色方法类型 */
export declare enum ColorMethod {
/** 颜色随层 */
kByLayer = 1,
/** 颜色随块 */
kByBlock = 2,
/** 颜色值 */
kByColor = 3,
/** 颜色索引值 */
kByACI = 4,
kByPen = 5,
kForeground = 6,
kLayerOff = 7,
kLayerFrozen = 8,
kNone = 9
}
/** 颜色索引类型 */
export declare enum ColorIndexType {
/** 随块 */
kByblock = 0,
/** 红色 */
kRed = 1,
/** 黄色 */
kYellow = 2,
/** 绿色 */
kGreen = 3,
/** 青色 */
KCyan = 4,
/** 蓝色*/
kBlue = 5,
/** 洋红色*/
kMagenta = 6,
/** 白色(反色)*/
kWhite = 7,
/** 随层 */
kBylayer = 256
}
export type ConstructorArguments<T> = T extends new (...args: infer U) => any ? U : never;
/**
* McCmColor的JSON版本
*/
export type McCmColorJSON = ExcludePropertiesContainingThisType<McCmColor, Function>;
/** THREE.Color 构造函数参数类型组成的元组:字符串、数字、THREE.Color */
export type THREEColorArgs = [
(string | number | THREE.Color)
] | ConstructorArguments<typeof THREE.Color> | [
];
/** 用于指定在创建颜色时可以接受的不同类型的参数形式 */
export type CreateColorArgs = THREEColorArgs | [
(Partial<McCmColorJSON> | McCmColor)
];
/**
*
* @param ages
* @returns THREE.Color
* */
export declare const getColorUtils: (...ages: THREEColorArgs) => THREE.Color;
/**
*
* @param ages
* @returns
*/
export declare const createMcCmColor: (...ages: CreateColorArgs) => McCmColor;
/**
*
* @param mcCmColor
* @param ages
*/
export declare const setMcCmColor: (mcCmColor: McCmColor, ...ages: CreateColorArgs) => void;
/**
* Fetch
*/
export declare enum FetchAttributes {
/** 将获取的数据加载到内存中 */
EMSCRIPTEN_FETCH_LOAD_TO_MEMORY = 1,
/** 持久化文件 */
EMSCRIPTEN_FETCH_PERSIST_FILE = 4,
/** 追加数据 */
EMSCRIPTEN_FETCH_APPEND = 8,
/** 替换数据 */
EMSCRIPTEN_FETCH_REPLACE = 16
}
declare class McRxObjectImp {
}
/**
* McObject , MxCAD
*/
export declare class McObject {
/** 内部对象实现 */
private imp;
/** 内部事件 */
private event;
/** 当前文件名 */
private currentFileName;
/** 是否是第一次打开文件 */
private firstTimeOpenFile;
/**
*
* @param imp
* @example
* ```ts
* import { McObject } from 'mxcad'
*
* const mxcad = new McObject;
* ```
*/
constructor(imp?: any);
/**
* @internal
* ```
*/
protected creaeCallId(): number;
/**
*
* @param val .
* 1. DisplayPrecision 0,0 ~1000,1000
* 2. EnableUndo undo功能
* @example
* ```ts
* undo
* mxcad.setAttribute({EnableUndo:true})
* ```
*/
setAttribute(val: object): boolean;
/**
* MxCAD对象绑定的MxDraw对象
* @returns MxDraw对象
* @example
* ```ts
* import { McObject } from 'mxcad'
*
* const mxcad = new McObject()
* const mxdraw = mxcad.getMxDrawObject()
* ```
*/
getMxDrawObject(): MxDrawObject;
/**
* MxCAD对象绑定的MxDraw对象
* @returns MxDraw对象
* @example
* ```ts
* import { McObject } from 'mxcad'
*
* const mxcad = new McObject()
* const mxdraw = mxcad.mxdraw
* ```
*/
get mxdraw(): MxDrawObject;
/**
*
* @returns
*/
getImp(): any;
/**
*
* @param imp
*
*/
init(imp: any): void;
/**
* mxcad对象
* @param config createMxCad
* @example
* ```ts
* import { McObject } from "mxcad"
// 创建mxcad示例对象
const mxcad = new McObject()
mxcad.create({
// canvas元素的id
canvas: "#myCanvas",
// 获取加载wasm相关文件(wasm/js/worker.js)路径位置
locateFile: (fileName)=> new URL(`/node_modules/mxcad/dist/wasm/2d/${fileName}`, import.meta.url).href,
// 需要初始化打开的文件url路径
fileUrl: new URL("../src/assets/test.mxweb", import.meta.url).href,
// 提供加载字体的目录路径
fontspath: new URL("node_modules/mxcad/dist/fonts", import.meta.url).href,
})
* ```
*/
create(config: MxCadConfig): void;
/**
* @example
* ```ts
* import { MxCpp, McObject, McObjectId } from "mxcad"
*
* const mxcad:McObject = MxCpp.getCurrentMxCAD();
* mxcad.on("selectChange", (ids: McObjectId[])=> {
* if (ids.length == 0) return;
* let id = ids[0]
* let ent = id.getMcDbEntity()
* if(!ent) return
* console.log(ent.objectName)
* })
* ```
* */
on(name: "selectChange", fun: (ids: McObjectId[]) => void | ((ids: McObjectId[]) => void)[]): void;
/** 监听文件完全打开 */
on(name: "openFileComplete", fun: () => void): void;
/** 监听项目初始化 */
on(name: "init", fun: () => void): void;
/** 监听 mxdraw 初始化 */
on(name: "init_mxdraw", fun: (mxdraw: MxDrawObject) => void): void;
/** 监听 mxdraw 初始化前的事件 */
on(name: "init_before_mxdraw", fun: (mxdraw: MxDrawObject) => void): void;
/** 监听 mxcad 初始化 */
on(name: "init_mxcad", fun: (mxcad: McObject) => void): void;
/** 监听数据库修改事件 */
on(name: "databaseModify", fun: () => void): void;
/** 系统变量被修改 */
on(name: "sysVarChanged", fun: (name: string) => void): void;
/** 图形数据库初始化 */
on(name: "databaseInitialization", fun: () => void): void;
/** 图层数据发生了变化 */
on(name: "layerChanged", fun: () => void): void;
/** 线型数据发生了变化 */
on(name: "lineTypeChanged", fun: () => void): void;
/**
*
* @param name
* @param fun
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
*
* const mxcad:McObject = MxCpp.getCurrentMxCAD();
* mxcad.off("selectChange");
* ```
*/
off(name: string, fun?: Function): void;
/**
*
* @param name
* @param param
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
*
* const mxcad:McObject = MxCpp.getCurrentMxCAD();
* mxcad.callEvent("init");
* ```
*/
callEvent(sEventName: string, param?: any): boolean;
/**
*
* @description
* @param mxObject {@link https://mxcadx.gitee.io/mxdraw_docs | mxdraw} 创建的绘图控件
*/
initMxObject(mxObject: any): void;
/**
* ZoomAll,ZoomW后Regen才会启作用
* @example
* ```ts
* import { MxCpp, McObject } from 'mxcad'
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
//绘制一个带有宽度的圆
mxcad.addLinetype("CircleLineType", "30,-5,7,-7");
//设计当前线型为"CircleLineType"
mxcad.drawLinetype = ("CircleLineType");
mxcad.drawLineWidth = 40;
mxcad.drawCircle(600, 800, 120);
mxcad.zoomAll();
mxcad.regen();
mxcad.updateDisplay();
* ```
*/
regen(delayTime?: number): void;
/**
*
*/
zoomAll(autoRegen?: boolean): boolean;
/**
*
* @param scale scale缩放比例
* @returns void
* @example
* ```ts
* import { MxCpp, McObject } from 'mxcad'
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
mxcad.drawLine(350, 220, 600, 220);
mxcad.zoomScale(o.6);
* ```
*/
zoomScale(scale: number): void;
/**
*
* @param id id
* @returns void
* @example
* ```typescript
* import { MxCpp, McObject } from "mxcad"
* let mxcad:McObject = MxCpp.getCurrentMxCAD();
* let id = mxcad.drawLine(0,0,1000,1000);
* mxcad.addCurrentSelect(id);
* ```
*/
addCurrentSelect(id: McObjectId | McObjectId[], isDisplayGrid?: boolean): void;
/**
*
* @param minPt 1 McGePoint3d
* @param maxPt 2 McGePoint3d
* @param isWorld felse DWG图纸坐标true是THREEJS坐标
* @returns void
* @example
* ```typescript
* import { MxApp, McGePoint3d, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.zoomW(new McGePoint3d(0, 0), new McGePoint3d(30, 30))
* ```
*/
zoomW(minPt: McGePoint3d, maxPt: McGePoint3d): void;
/**
* ,dCenX,dCenY是DWG图纸坐标
* @returns void
* @example
* ```typescript
* import { MxCpp, McGePoint3d, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.zoomCenter(0, 0)
* ```
*/
zoomCenter(dCenX: number, dCenY: number): void;
/**
* PI.
* @returns void
* @param viewangle Math.PI
* @example
* ```typescript
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.zoomAngle(Math.PI / 2)
* ```
*/
zoomAngle(viewangle: number): void;
/**
*
* @param sFileUrl
* @param retCall ,0
* @param isWorkThread 使线 true
* @param fetchAttributes 1EMSCRIPTEN_FETCH_LOAD_TO_MEMORY,0:EMSCRIPTEN_FETCH_LOAD_TO_MEMORY | EMSCRIPTEN_FETCH_PERSIST_FILE | EMSCRIPTEN_FETCH_APPENDIndexedDB
* @returns
* @example
* ```ts
* import { MxCpp } from "mxcad";
* const mxcad = MxCpp.getCurrentMxCAD();
* mxcad.openWebFile("http://localhost:1337/mxcad/file/a9cbed3d3a351b79f24484e87bd78338.DWG.mxweb");
* ```
*/
openWebFile(sFileUrl: string, retCall?: (iRet: number) => void, isWorkThread?: boolean, initialParameter?: object, fetchAttributes?: number, isFetchTzFile?: boolean): boolean;
/**
*
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad" ;
*
* let mxcad:McObject = MxCpp.getCurrentMxCAD();
* mxcad.newFile();
* ```
*/
newFile(): boolean;
/**
*
* @param sFileUrl mxweb格式
* @param sBlkName
* @param isWorkThread 使线 true
* @param fetchAttributes 1EMSCRIPTEN_FETCH_LOAD_TO_MEMORY,0:EMSCRIPTEN_FETCH_LOAD_TO_MEMORY | EMSCRIPTEN_FETCH_PERSIST_FILE | EMSCRIPTEN_FETCH_APPENDIndexedDB
* @param isUpdataInsertBlock
* @param isUpdataSameNameBlock
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* const blkrecId = await mxcad.insertBlock("./blkrec.mxweb", "sBlkName");
* ```
*/
insertBlock(sFileUrl: string, sBlkName: string, isWorkThread?: boolean, fetchAttributes?: number, isUpdataInsertBlock?: boolean, isUpdataSameNameBlock?: boolean): Promise<McObjectId>;
/**
*
* @returns
*/
getCurrentFileName(): string;
/**
*
* @param sSaveProgramUrl POST请求接口, 接口具体实现: 先下载MxDraw云图开发包<https://www.mxdraw.com/download.html>
* MxDrawCloudServer\Bin\MxCAD\MxCADSaveFile\server.js "/mxcad/savefiledwg",
* "/mxcad/savefiledwg":dwg文件到服务器
* "/mxcad/savefile":mxweb文件到服务器
* ,
* @param call , ref.file
* @returns
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* MxCpp.getCurrentMxCAD().saveFileToUrl("http://localhost:3337/mxcad/savefiledwg", (iResult, sserverResult) => {
* let ret = JSON.parse(sserverResult);
* if (ret.ret == "ok") {
* console.log(ret.file)
* }
* })
* ```
*/
saveFileToUrl(sSaveProgramUrl: string, call: (iResult: number, sServerResult: string) => void, filename?: string, param?: any): boolean;
/**
*
* @param filename
* @param call
* @param isDownland true
* @param isShowSaveFileDialog true
* @returns
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.App.getCurrentMxCAD()
* const fileName = mxcad.getCurrentFileName()
* mxcad.saveFile("test", (data)=> {
* const blob = new Blob([data.buffer], { type: "application/octet-stream" });
* }, false, false)
* ```
*/
saveFile(filename?: string, call?: (data: any) => void, isDownland?: boolean, isShowSaveFileDialog?: boolean, parameter?: object): boolean;
/**
*
* @returns
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.App.getCurrentMxCAD()
* let layerTable = mxcad.getDatabase().getLayerTable();
* ```
*/
getDatabase(): McDbDatabase;
/**
*
*/
get database(): McDbDatabase;
/**
*
*/
setBrowse(browse: boolean): void;
/**
*
* @param varName
* @returns
*/
getSysVarString(varName: string): string;
/**
*
* @param varName
* @param val
* @returns
*/
setSysVarString(varName: string, val: string): any;
/**
*
* @param varName
* @returns
*/
getSysVarDouble(varName: string): number;
/**
*
* @param varName
* @returns
*/
getSysVarPoint(varName: string): McGePoint3d;
/**
*
* @param varName
* @param val
* @returns
*/
setSysVarPoint(varName: string, pt: McGePoint3d): boolean;
/**
* 2
* @param varName
* @param val
* @returns
*/
setSysVarPoint2d(varName: string, pt: McGePoint3d): boolean;
/**
*
* @param varName
* @param val
* @returns
*/
setSysVarDouble(varName: string, val: number): boolean;
/**
*
* @param varName
* @returns
*/
getSysVarLong(varName: string): number;
/**
*
* @param varName
* @param val
* @returns
*/
setSysVarLong(varName: string, val: number): boolean;
/**
*
* @returns
*/
get drawColor(): McCmColor;
/**
*
* @param val
* @example
* ```ts
* import { MxCpp, McObject } from 'mxcad';
* const mxcad:McObject = MxCpp.App.getCurrentMxCAD();
* mxcad.drawColor = new McCmColor(0, 0, 255);
* ```
*/
set drawColor(val: McCmColor);
/**
*
* @returns val
*/
get drawColorIndex(): number;
/**
*
* @param val
* @example
* ```ts
* import { MxCpp, ColorIndexType, McObject } from "mxcad" ;
* const mxcad:McObject = MxCpp.App.getCurrentMxCAD();
* mxcad.drawColorIndex = ColorIndexType.kMagenta;
* ```
*/
set drawColorIndex(val: ColorIndexType | number);
/**
* 线
* @returns 线
*/
get drawLineWeight(): McDb.LineWeight;
/**
* 线
* @param val 线
* @example
* ```ts
* import { MxCpp, McDb, McObject } from "mxcad" ;
*
* const mxcad: McObject = MxCpp.App.getCurrentMxCAD();
* mxcad.drawLineWeight(McDb.LineWeight.kLnWtByLayer)
* ```
*/
set drawLineWeight(val: McDb.LineWeight);
/**
* 线
* @returns 线
*/
get drawLineTypeScale(): number;
/**
* 线
* @param val 线
*/
set drawLineTypeScale(val: number);
/**
* 线
* @returns 线
*/
get drawLinetype(): string;
/**
* 线
* @param val 线
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad" ;
*
* const mxcad: McObject = MxCpp.App.getCurrentMxCAD();
* mxcad.addLinetype("MyLineType3", "30,-10");
* mxcad.drawLinetype = "MyLineType3";
* ```
*/
set drawLinetype(val: string);
/**
*
* @returns
*/
get drawTextStyle(): string;
/**
*
* @param val
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad" ;
*
* const mxcad: McObject = MxCpp.App.getCurrentMxCAD();
* mxcad.addTextStyle("MyTextStyle", "italicc.shx", "gbcbig.shx", 0.7);
* mxcad.drawTextStyle = "MyTextStyle";
* ```
*/
set drawTextStyle(val: string);
/**
*
* @returns
*/
get drawLayer(): string;
/**
*
* @param val
* @example
* ```ts
* import { MxCpp, McObject } from 'mxcad'
const mxcad:McObject = MxCpp.getCurrentMxCAD();
mxcad.drawLayer = "MtextLayer";
* ```
*/
set drawLayer(val: string);
/**
*
* @param pszName
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.addLayer("图层名称")
* ```
*/
addLayer(string: string): McObjectId;
/**
*
* @param pszName
* @param pszFileName
* @param pszBigFontFileName
* @param dXScale X
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.addTextStyle("MyLineTypeTextStyle", "txt.shx", "hztxt.shx", 1);
* ```
*/
addTextStyle(sName: string, sFileName: string, sBigFontFileName: string, dXScale?: number): McObjectId;
/**
* 使TrueType字体的文字样式
* @param pszName
* @param sTrueTypeFontName TrueType字体名,使TrueType字体.
* @param dXScale X
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.AddTureTypeTextStyle("MyTrueTypeTextStyle");
* ```
*/
AddTureTypeTextStyle(sName: string, sTrueTypeFontName?: string, dXScale?: number): McObjectId;
/**
* 线
* @param pszName 线
* @param pszLineDefine 线
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* //定义虚线数据据,"MyLineType"是线型名,"6,-8"是虚线的一个单位定义,6是实线长,-8是空格长。
* mxcad.addLinetype("MyLineType", "6,-10");
* ```
*/
addLinetype(sName: string, sLineDefine: string): McObjectId;
/**
* 线
* @param pszName 线
* @param pszLineDefine 线
* @param pszTextStyle
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* let lintype = mxcad.addLinetypeEx("TestMyLine", '.5,-.2,["HW",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-.2', "");
* ```
*/
addLinetypeEx(sName: string, sLineDefine: string, sTextStyle?: string): McObjectId;
/**
* 线
* @param dX1 X
* @param dY1 Y
* @param dZ1 Z
* @param dX2 X
* @param dY2 Y
* @param dZ2 Z
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.drawLine(0, 60, 100, 60);
* ```
*/
drawLine(dX1: number, dY1: number, dX2: number, dY2: number): McObjectId;
drawLine3d(dX1: number, dY1: number, dZ1: number, dX2: number, dY2: number, dZ2: number): McObjectId;
/**
*
* @param pszName
* @param pszDoubleData
* @param pszIntData
* @param pszStringData
* @param pszIdData ID
*
* @description pszDoubleData
* | | | |
* | ------- | ------- | ------- |
* | dimaltf | 143 | |
* | dimasz | 41 | 线线线|
* | dimcen | 141 | 线|
* | dimdle | 46 | 使线线线|
* | dimdli | 43 | 线线|
* | dimexe | 44 | |
* | dimexo | 42 | 线|
* | dimgap | 147 | 线|
* | dimlfac | 144 | 线|
* | dimrnd | 45 | |
* | dimscale | 40 | |
* | dimtfac | 146 | DIMTXT |
* | dimtm | 48 | |
* | dimtp | 47 | |
* | dimtsz | 142 | 线线|
* | dimtvp | 145 | 线|
* | dimtxt | 140 | |
* | dimaltrnd | 148 | |
*
* @description pszIntData
* | | | |
* | ------- | ------- | ------- |
* | dimadec | 179 | |
* | dimalt | 170 | |
* | dimaltd | 171 | |
* | dimalttd | 274 | |
* | dimalttz | 286 | |
* | dimaltu | 273 | |
* | dimaltz | 285 | |
* | dimaunit | 275 | |
* | dimclrd | 176 | 线线|
* | dimclre | 177 | 线线|
* | dimclrt | 178 | |
* | dimdec | 271 | |
* | dimfit | 287 | 线|
* | dimjust | 280 | |
* | dimlim | 72 | |
* | dimsah | 173 | 线|
* | dimsd1 | 281 | 线|
* | dimsd2 | 282 | 线|
* | dimse1 | 75 | 线|
* | dimse2 | 76 | 线|
* | dimsoxd | 175 | 线|
* | dimtad | 77 | 线|
* | dimtdec | 272 | |
* | dimtih | 73 | 线 |
* | dimtix | 174 | 线|
* | dimtofl | 172 | 线线使线|
* | dimtoh | 74 | 线|
* | dimtol | 71 | |
* | dimtolj | 283 | |
* | dimzin | 78 | |
* | dimupt | 288 | |
* | dimtzin | 284 | |
* | dimfrac | 276 | |
* | dimlunit | 277 | |
* | dimatfit | 289 | 线|
* | dimtmove | 279 | |
* | dimazin | 79 | |
*
* @description pszStringData
* | | | |
* | ------- | ------- | ------- |
* | dimapost | 4 | |
* | dimpost | 3 | |
*
* @description pszIdData ID
* | | | |
* | ------- | ------- | ------- |
* | dimblk | 342 | 线 |
* | dimblk1 | 343 | 线|
* | dimblk2 | 344 | 线|
* | dimldrblk | 341 | 线|
* | dimtxsty | 340 | |
*
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD();
*
* // MyDimStyle2:样式名称
* // "41,0.18,141,0.09,40,200":双精度型数据
* // "77,1,271,3": 整型数据
* // 其中数值两两一组,如 "41,0.18":dimasz系统变量值设置为0.18;"77,1":dimtad系统变量值设置为1
* mxcad.addDimStyle("MyDimStyle2", "41,0.18,141,0.09,40,200", "77,1,271,3", "", "");
* ```
*/
addDimStyle(pszName: string, pszDoubleData: string, pszIntData: string, pszStringData: string, pszIdData: string): McObjectId;
/**
*
*/
get drawDimStyle(): string;
/**
*
* @param val
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.drawDimStyle = "MyDimStyle2"
* ```
*/
set drawDimStyle(val: string);
/**
*
* @param isExclude
* @example
* ```ts
import { MxCpp, McObject } from "mxcad"
const mxcad:McObject = MxCpp.getCurrentMxCAD()
//绘制一个实心有圆弧边界填充,中间挖去一块.
mxcad.pathMoveToEx(440, 3310, 0, 0, 0);
mxcad.pathLineTo(480, 3310);
mxcad.pathLineTo(480, 3360);
mxcad.pathLineTo(450, 3340);
// 把上面定义的路径定义填充排除区域.
mxcad.pathMakeExclude(true);
* ```
*/
pathMakeExclude(isExclude: boolean): void;
/**
*
* @param sName
* @param sDefinitionData
* @example
* ```ts
import { MxCpp, McObject } from "mxcad"
const mxcad:McObject = MxCpp.getCurrentMxCAD()
//angle, x-origin,y-origin, delta-x,delta-y,dash-1,dash-2, …
//45 = angle 是图案线角度.
//0 = x-origin 是第一个填充线经过的点位置X坐标
//0 = y-origin 是第一个填充线经过的点位置Y坐标
//0 = delta-x 是下一个填充线相对前一个线的X方向偏移
//0.125 = delta-y 是下一个填充线相对前一个线的Y方向偏移
mxcad.addPatternDefinition("MyHatchPattern1", "((45, 0,0, 0,0.125))");
* ```
*/
addPatternDefinition(sName: string, sDefinitionData: string): void;
/**
* 线
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad: McObject = MxCpp.getCurrentMxCAD()
* mxcad.drawPatternDefinition = "MyHatchPattern1";
* ```
*/
get drawPatternDefinition(): string;
/**
* 线
* @param val 线
*/
set drawPatternDefinition(val: string);
/**
* 线
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad: McObject = MxCpp.getCurrentMxCAD()
* mxcad.drawLineWidth = 4;
* ```
*/
get drawLineWidth(): number;
/**
* 线
* @param val 线
*/
set drawLineWidth(val: number);
/**
* draw开头的绘图数使
*/
get drawUseDefaultProperties(): boolean;
/**
* draw开头的绘图数使
* @param val 线
*/
set drawUseDefaultProperties(val: boolean);
/**
*
* @param dCenterX X
* @param dCenterY Y
* @param dRadius
* @param dStartAng
* @param dEndAng
* @returns 1 0
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad: McObject = MxCpp.getCurrentMxCAD()
* mxcad.drawArc(300, 1000, 100, 30, 200);
* ```
*/
drawArc(dCenterX: number, dCenterY: number, dRadius: number, dStartAng: number, dEndAng: number): McObjectId;
/**
*
* @param dStartPointX X
* @param dStartPointY Y
* @param dMidPointX X
* @param dMidPointY Y
* @param dEndPointX X
* @param dEndPointY Y
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* //由圆弧上三个点绘制圆弧
* mxcad.drawArc2(800, 1000, 900, 1200, 1000, 900);
* ```
*/
drawArc2(dStartPointX: number, dStartPointY: number, dMidPointX: number, dMidPointY: number, dEndPointX: number, dEndPointY: number): McObjectId;
/**
*
* @param dStartPointX X
* @param dStartPointY Y
* @param dEndPointX X
* @param dEndPointY Y
* @param dBulge
* @example
* ```ts
import { MxCpp, McObject } from "mxcad"
const mxcad:McObject = MxCpp.getCurrentMxCAD()
//由圆弧上的开始点,结束度和凸度会圆弧
mxcad.drawLineWidth = 40;
mxcad.drawArc3(1200, 1000, 1400, 1000, 0.6);
* ```
*/
drawArc3(dStartPointX: number, dStartPointY: number, dEndPointX: number, dEndPointY: number, dBulge: number): McObjectId;
/**
*
* @param dCenterX X
* @param dCenterY Y
* @param dRadius
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD(
* mxcad.drawCircle(0, 0, 120);
* ```
*/
drawCircle(dCenterX: number, dCenterY: number, dRadius: number): McObjectId;
/**
* 便使
* @param imageUrl
* @param call
* @example
* ```ts
import { MxCpp, McObject } from "mxcad"
const mxcad: McObject = MxCpp.getCurrentMxCAD()
mxcad.loadImage(imagUrl, (image) => {
if (!image) {
console.log("loadImage failed");
return;
}
let width = mxcad.mxdraw.viewCoordLong2Cad(100);
let height = (image.height / image.width) * width;
idImage = mxcad.drawImage((pt as any).x, (pt as any).y, width, height, 0, imagUrl,true);
mxcad.updateDisplay();
});
* ```
*/
loadImage(imageUrl: string, call: (image: any) => void): void;
/**
*
* @param dPosX X
* @param dPosY Y
* @param dWidth
* @param dHeight
* @param dAng
* @param imageUrl
*/
drawImage(dPosX: number, dPosY: number, dWidth: number, dHeight: number, dAng: number, imageUrl: string, isConvertBase64?: boolean): McObjectId;
/**
* cad数据库中
* @param imageUrl
* @param sName
* @example
* ```ts
import { MxCpp, McObject } from "mxcad"
let mxcad:McObject = MxCpp.getCurrentMxCAD();
let imagUrl = "https://cdn.pixabay.com/photo/2022/11/15/12/23/winter-7593872_960_720.jpg";
mxcad.loadImage(imagUrl, (imagedata) => {
if (!imagedata) {
console.log("loadImage failed");
return;
}
let imagedefid = mxcad.addImageDefine(imagUrl,"winter-7593872_960_720.jpg",true);
mxcad.updateDisplay();
});
* ```
*/
addImageDefine(imageUrl: string, sName?: string, isConvertBase64?: boolean): McObjectId;
/**
* 线
*/
showLineWeight(isShow: boolean): boolean;
/**
* dwg文件当前背景对象绘制.
*/
loadDwgBackground(sFileUrl: string, call: (ret: boolean) => void, color?: number, isShow?: boolean): void;
/**
*
*/
getBackgroundEntity(): McDbBackgroundEntity;
/**
*
*/
clearDwgBackground(): void;
/**
* .
* sysVarChanged
*/
addSystemVarNameForEvent(aryVarName: string[]): void;
/**
*
* @param dCenterX X
* @param dCenterY Y
* @param dMajorAxisX X
* @param dMajorAxisY Y
* @param dRadiusRatio
* @returns 1 0
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.drawEllipse(0, 1400, 100, 0, 0.7);
* ```
*/
drawEllipse(dCenterX: number, dCenterY: number, dMajorAxisX: number, dMajorAxisY: number, dRadiusRatio: number): McObjectId;
/**
*
* @param dCenterX X
* @param dCenterY Y
* @param dMajorAxisX X
* @param dMajorAxisY Y
* @param dRadiusRatio
* @param dStartAng
* @param dEndAng
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.drawEllipseArc(0, 1600, 80, 30, 0.4, 30, 200);
* ```
*/
drawEllipseArc(dCenterX: number, dCenterY: number, dMajorAxisX: number, dMajorAxisY: number, dRadiusRatio: number, dStartAng: number, dEndAng: number): McObjectId;
/**
*
* @param dX X
* @param dY Y
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.drawPoint(0,0);
* ```
*/
drawPoint(dX: number, dY: number): McObjectId;
/**
*
* @param dX1 X
* @param dY1 Y
* @param dX2 X
* @param dY2 Y
* @param dX3 X
* @param dY3 Y
* @param dX4 X
* @param dY4 Y
* @returns id
*/
drawSolid(dX1: number, dY1: number, dX2: number, dY2: number, dX3: number, dY3: number, dX4: number, dY4: number): McObjectId;
/**
*
* @param dPosX X
* @param dPosY Y
* @param pszContents
* @param dHeight
* @param dWidth
* @param dRotation
* @param iAttachment
* @returns id
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.drawMText(0, -100, "控件:\\P多行文字测试", 50, 400, 0, 1);
* ```
*/
drawMText(dPosX: number, dPosY: number, sContents: string, dHeight: number, dWidth: number, dRotation: number, iAttachment: McDb.AttachmentPoint): McObjectId;
/**
*
* @param dPosX X
* @param dPosY Y
* @param pszText
* @param dHeight
* @param dRotation
* @param horizontalMode
* @param verticalMode
* @returns 1 0
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.drawText(0, 1900, "绘图控件文字测试", 100, 0, 0, 1);
* ```
*/
drawText(dPosX: number, dPosY: number, pszText: string, dHeight: number, dRotation: number, horizontalMode: McDb.TextHorzMode, verticalMode: McDb.TextVertMode): McObjectId;
/**
*
* @param dPosX X
* @param dPosY Y
* @param pszBlkName
* @param dScale
* @param dAng
* @returns id
*/
drawBlockReference(dPosX: number, dPosY: number, sBlkName: string, dScale: number, dAng: number): McObjectId;
/**
*
* @param dExtLine1PointX 线 X
* @param dExtLine1PointY 线 Y
* @param dExtLine2PointX 线 X
* @param dExtLine2PointY 线 Y
* @param dTextPositionX X
* @param dTextPositionY Y
* @returns 1 0
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.drawDimAligned(0, 4000, 300, 4500, 150, 4600);
* ```
*/
drawDimAligned(dExtLine1PointX: number, dExtLine1PointY: number, dExtLine2PointX: number, dExtLine2PointY: number, dTextPositionX: number, dTextPositionY: number): McObjectId;
/**
*
* @param dAngleVertexX X
* @param dAngleVertexY Y
* @param dFirstEndPointX 线 X
* @param dFirstEndPointY 线 Y
* @param dSecondEndPointX 线 X
* @param dSecondEndPointY 线 Y
* @param dTextPointX X
* @param dTextPointY Y
* @returns 1 0
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.drawDimAngular(500, 5000, 0, 5500, 1000, 5500, 500, 5500);
* ```
*/
drawDimAngular(dAngleVertexX: number, dAngleVertexY: number, dFirstEndPointX: number, dFirstEndPointY: number, dSecondEndPointX: number, dSecondEndPointY: number, dTextPointX: number, dTextPointY: number): McObjectId;
/**
*
* @param dChordPointX 线 X
* @param dChordPointY 线 Y
* @param dFarChordPointX 线 X
* @param dFarChordPointY 线 Y
* @param dLeaderLength 线
* @returns id
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.drawDimDiametric(500, 0, -500, 0, 20);
* ```
*/
drawDimDiametric(dChordPointX: number, dChordPointY: number, dFarChordPointX: number, dFarChordPointY: number, dLeaderLength: number): McObjectId;
/**
*
* @param dExtLine1PointX 线 X
* @param dExtLine1PointY 线 Y
* @param dExtLine2PointX 线 X
* @param dExtLine2PointY 线 Y
* @param dDimLineLocationX 线 X
* @param dDimLineLocationY 线 Y
* @param dRotationAngle
* @returns id
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.drawDimRotated(0, 7000, 600, 7000, 250, 7050, 0);
* ```
*/
drawDimRotated(dExtLine1PointX: number, dExtLine1PointY: number, dExtLine2PointX: number, dExtLine2PointY: number, dDimLineLocationX: number, dDimLineLocationY: number, dRotationAngle: number): McObjectId;
/**
* 线
* @param dDefinitionPointX - X
* @param dDefinitionPointY - Y
* @param dDeaderEndPointX - X
* @param dDeaderEndPointY - Y
* @param isUseXAxis - 沿 X
* @returns 线id
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.drawDimOrdinate(500, 0, -500, 0, true);
* ```
*/
drawDimOrdinate(dDefinitionPointX: number, dDefinitionPointY: number, dDeaderEndPointX: number, dDeaderEndPointY: number, isUseXAxis: boolean): McObjectId;
/**
*
* @param dCenterX - X
* @param dCenterY - Y
* @param dChordPointX - 线 X
* @param dChordPointY - 线 Y
* @param dLeaderLength - 线
* @returns id
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.drawDimOrdinate(0, 0, 0, 500, 20);
* ```
*/
drawDimRadial(dCenterX: number, dCenterY: number, dChordPointX: number, dChordPointY: number, dLeaderLength: number): McObjectId;
/**
*
* @param dX - X
* @param dY - Y
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.pathMoveTo(0, 300);
* ```
*/
pathMoveTo(dX: number, dY: number): void;
/**
*
* @param dX - X
* @param dY - Y
* @param dStartWidth -
* @param dEndWidth -
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.pathMoveToEx(1000, 300, 10, 10, 0);
* ```
*/
pathMoveToEx(dX: number, dY: number, dStartWidth: number, dEndWidth: number, dBulge: number): void;
/**
* 线
* @param dX - X
* @param dY - Y
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.pathLineTo(100, 300);
* ```
*/
pathLineTo(dX: number, dY: number): void;
/**
* 线
* @param dX - X
* @param dY - Y
* @param dStartWidth -
* @param dEndWidth -
* @param dBulge -
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.pathLineToEx(1000, 500, 30, 0, 0);
* ```
*/
pathLineToEx(dX: number, dY: number, dStartWidth: number, dEndWidth: number, dBulge: number): void;
/**
*
* @example
* ```ts
import { MxCpp, McObject } from "mxcad"
const mxcad:McObject = MxCpp.getCurrentMxCAD()
mxcad.pathCircle(0, 0, 20);
* ```
*/
pathCircle(dCenX: number, dCenY: number, dR: number, dPrecision?: number, dWidth?: number): boolean;
/**
* 线
* @returns
*/
drawPathToPolyline(): McObjectId;
/**
* 线
* @returns
*/
drawPathToSpline(): McObjectId;
/**
*
*/
pathMakeClosed(): void;
/**
*
* @param dPatternScale -
* @returns
* @example
* ```ts
import { MxCADUiPrPoint, MxCADUiPrDist, MxCpp } from "mxcad";
// 实心圆
async function Mx_SolidCircle() {
const getCenter = new MxCADUiPrPoint();
getCenter.setMessage('请确定圆心位置\n');
const center = await getCenter.go();
if (!center) return;
const getRadius = new MxCADUiPrDist();
getRadius.setBasePt(center);// 设置距离基点为圆心
getRadius.setMessage('请输入圆半径');
getRadius.setUserDraw((pt, pw) => {
const r = pt.distanceTo(center);
const circle = new McDbCircle();
circle.center = center;
circle.radius = r;
pw.drawMcDbEntity(circle)
})
const radiusVal = await getRadius.go();
if (!radiusVal) return;
const radius = getRadius.value();
const mxcad = MxCpp.getCurrentMxCAD();
mxcad.pathCircle(center.x, center.y, radius);//设置圆路径
mxcad.drawPathToHatch();// 绘制实心圆
}
* ```
*/
drawPathToHatch(dPatternScale?: number): McObjectId;
/**
*
* @param entity -
* @returns
* @example
* ```ts
* import { McDbPolyline, MxCpp } from
* let pl = new McDbPolyline();
pl.addVertexAt(new McGePoint3d(100, 100, 100));
pl.addVertexAt(new McGePoint3d(200, 100, 500));
pl.addVertexAt(new McGePoint3d(300, 400, 200));
MxCpp.getCurrentCAD().drawEntity(pl);
* ```
*/
drawEntity(entity: McDbEntity, isUseDatabaseCurrentProperties?: boolean): McObjectId;
/**
*
* @param entity -
* @returns id
*/
drawHatch(hatch: McDbHatch, dPatternScale?: number): McObjectId;
/**
* lIdIndex McDbObject
* @param lIdIndex - ID
* @returns ID McDbObject null
*/
objectIdToObject(lIdIndex: number): McDbObject | null;
/**
* McRxObjectImp
* @param pObjectImp - McRxObjectImp
*/
destroyObject(pObjectImp: McRxObjectImp): void;
/**
*
*/
getAllLayoutName(): McGeStringArray;
/**
*
* @param layoutName
*/
setCurrentLayout(layoutName: string): void;
/**
* MxCpp对象MxDraw模块中调用
*/
getMxCpp(): any;
/**
* ,cad坐标
* @returns
*/
getViewCADCoord(): {
pt1: McGePoint3d;
pt2: McGePoint3d;
pt3: McGePoint3d;
pt4: McGePoint3d;
};
/**
*
* @param isImmediate
* @param delayTime
*/
updateDisplay(isImmediate?: boolean, delayTime?: number): void;
/**
*
*/
updateLayerDisplayStatus(): void;
/**
* .
* @param sRegist
*/
initRegist(sRegist: string): void;
/**
* .
*/
isTryVersion(): boolean;
/**
* .
* @example
* ```ts
* import { MxCpp, McObject } from "mxcad"
* const mxcad:McObject = MxCpp.getCurrentMxCAD()
* mxcad.setViewBackgroundColor(255, 255, 255)
* ```
*/
setViewBackgroundColor(red: number, green: number, blue: number): void;
/**
*
*/
getCurrentDatabaseDrawColor(): THREE.Color;
/**
* 退
*/
undo(): void;
/**
*退
*/
redo(): void;
/**
*退.
*/
undoMark(): void;
}
/**
* McAppType MxCAD
* @example
* ```ts
* import { MxCpp } from "mxcad";
*
* const McAppType = MxCpp.App;
* ```
*/
export declare class McAppType {
/** 内部实现对象 */
private imp;
/**
* @internal
* MxCAD辅助,使
* ```
*/
MxCADAssist: any;
/** id 转换为 McDbObject */
private objectIdToObjectCalls;
/** 根据类型转为实例 */
private classNameToCreateCalls;
/** shx字体 */
private shxFonts;
/** shx big 字体 */
private shxBigFonts;
/** TrueType字体 */
private trueFonts;
/**
* McAppType
* @param imp imp
* @example
* ```ts
* import { MxCpp } from "mxcad";
*
* const imp = MxCpp.App.getImp();
* MxCpp.App.init(imp);
* ```
*/
init(imp: any): void;
/**
* imp
* @returns imp
* @example
* ```ts
* import { MxCpp } from "mxcad";
*
* const imp = MxCpp.App.getImp()
* ```
*/
getImp(): any;
/**
*
* @returns
* @example
* ```ts
* import { MxCpp } from "mxcad";
*
* const result = MxCpp.App.getLastCallResult();
* console.log("最后一次调用结果:", result);
* ```
*/
getLastCallResult(): number;
/**
*
* @param pObject
*/
destroyObject(pObject: McRxObjectImp): void;
/**
* MxDraw
* @returns McObject
* @example
* ```ts
* //添加图层
* import { MxCpp } from 'mxcad'
* // 获取当前cad对象
* let mxcad = MxCpp.App.getCurrentMxCAD();
* // 获取图层表
* let layerTable = mxcad.getDatabase().getLayerTable();
* if (!layerTable.has("xxx11")) {
* let newLayer = new McDbLayerTableRecord();// 构造新图层记录对象
* newLayer.name = "xxx11";// 设置新图层名为:"xxx11"
* layerTable.add(newLayer);// 图层表新增图层记录对象
* }
*
* if (layerTable.has("xxx11")) {
* console.log("add layer ok");
* }
* ```
*/
getCurrentMxCAD(): McObject;
/**
* RGB
* @param red
* @param green 绿
* @param blue
* @param bAutoNearest
* @returns
* @example
* ```ts
* import { MxCpp } from 'mxcad'
* const colorIndex = MxCpp.App.mcedRGB2Index(255, 0, 0, bAutoNearest)
* ```
*/
mcedRGB2Index(red: number, green: number, blue: number, bAutoNearest?: boolean): number;
/**
* .
* @param red
* @param green 绿
* @param blue
* @example
* ```ts
* import { MxCpp } from 'mxcad'
* MxCpp.App.setDefaultViewBackgroundColor(0, 0, 0)
* ```
*/
setDefaultViewBackgroundColor(red: number, green: number, blue: number): void;
/**
* id是否指类类型名对象
* @param lIdIndex id索引
* @param className
* @return
* @example
* ```ts
* import { MxCADUiPrEntity } from "mxcad";
* // 选择目标对象
* let selEntity = new MxCADUiPrEntity();
* selEntity.setMessage("选择对象");
* let val = await selEntity.go();
* if (!val.isValid()) return;
* // 判断目标对象是为多段线类
* const isSuccess = MxCpp.objectIdIsKindOf(val.id, "McDbPolyline");
* if(isSuccess){
* console.log("目标对象为多段线")
* }else{
* console.log("目标对象不为多段线")
* }
* ```
*/
objectIdIsKindOf(lIdIndex: number, className: string): boolean;
/**
*
*/
private initCalls;
/**
* id McDbObject
* @param lIdIndex id
* @returns McDbObject null
* @example
* ```ts
* import { MxCADUiPrEntity, MxCpp } from "mxcad";
* // 获取目标对象
* let selEntity = new MxCADUiPrEntity();
* let val = await selEntity.go();
* if (!val.isValid()) return;
* const obj = MxCpp.App.objectIdToObject(val.id);
* console.log(obj)
* ```
*/
objectIdToObject(lIdIndex: number): McDbObject | null;
/**
*
* @param clonobjImp
* @returns McDbObject
* @example
* ```ts
* import { MxCADUiPrEntity, MxCpp } from "mxcad";
* // 获取目标对象
* let selEntity = new MxCADUiPrEntity();
* let val = await selEntity.go();
* if (!val.isValid()) return;
*
* const obj = MxCpp.App.objectIdToObject(val.id);// 对象id转 McDbObject 对象
* const obj_clone = MxCpp.App.createCloneObject(obj?.getImp());// 克隆目标对象
* ```
*/
createCloneObject(clonobjImp: any): McDbObject | null;
/**
* fonts
* @param path
*/
setFontFilePath(path: string): void;
/**
* TrueType字体
* @param sTrueTypeFontName TrueType字体名
* @example
* ```ts
* import { MxCpp } from "mxcad";
* //设置默认TrueType字体为Arial.ttf
* MxCpp.setDefaultTrueTypeFontFile("Arial.ttf");
* ```
*/
setDefaultTrueTypeFontFile(sTrueTypeFontName: string): void;
/**
* shx字体
* @param fontfiles
* @example
* ```ts
* import { MxCpp } from 'mxcad';
* import { MxFun } from "mxdraw";
*
* // MxCAD创建成功
* MxFun.on("mxcadApplicationCreatedMxCADObject", () => {
* MxCpp.App.addNetworkLoadingFont( ["txt.shx","simplex.shx","aaa.shx","ltypeshp.shx","complex.shx"]);
* }
* ```
*/
addNetworkLoadingFont(fontfiles: string | string[]): void;
/**
*
* @param ini
* @example
* ```ts
* ```
*/
IniSet(ini: object): boolean;
/**
* bigfont shx字体
* @param fontfiles
* @example
* ```ts
* import { MxCpp } from 'mxcad'
* import { MxFun } from "mxdraw";
*
* // MxCAD创建成功
* MxFun.on("mxcadApplicationCreatedMxCADObject", () => {
* MxCpp.App.addNetworkLoadingBigFont(["hztxt.shx", "gbcbig.shx"]);
* }
* ```
*/
addNetworkLoadingBigFont(fontfiles: string | string[]): void;
/**
* Truetype字体
* @param fontname
* @param fontzhName
* @param fontfile
* @example
* ```ts
* import { MxCpp } from 'mxcad'
* import { MxFun } from "mxdraw";
*
* // MxCAD创建成功
* MxFun.on("mxcadApplicationCreatedMxCADObject", () => {
* MxCpp.App.addNetworkLoadingTrueTypeFont(["simsun","syadobe"],["思原宋体","思原黑体"],["stadobe.otf","syadobe.otf"]);
* }
* ```
*/
addNetworkLoadingTrueTypeFont(fontname: string[], fontzhName: string[], fontfile: string[]): void;
/**
* shx字体.
* @return
* @example
* ```ts
* import { MxCpp } from "mxcad";
*
* const fontArr = MxCpp.App.getShxFonts();
* console.log(fontArr);
* ```
*/
getShxFonts(): string[];
/**
* bigfont shx字体.
* @return
* @example
* ```ts
* import { MxCpp } from "mxcad";
*
* const bigFontArr = MxCpp.App.getShxBigFonts();
* console.log(bigFontArr);
* ```
*/
getShxBigFonts(): string[];
/**
* cad程序使便使.
* @param vecShxFonst shx字体
* @param vecBigShxFonst bigfont shx字体
* @param vecTureTypeFonts Truetype字体
* @param retCall
* @example
* ```ts
import { MxCpp } from 'mxcad';
//修改文字样式
function Mx_Test_TrueText(){
let mxcad = MxCpp.getCurrentMxCAD();
//清空当前显示内容
mxcad.newFile();
MxCpp.App.loadFonts([], [], ["syadobe","simsun"], () => {
// 添加一个黑体文字样式
mxcad.AddTureTypeTextStyle("ht_style","syadobe");
// 添加一个宋体文字样式
mxcad.AddTureTypeTextStyle("st_style","simsun");
// 设置当前样式为黑体
mxcad.drawTextStyle = "ht_style";
mxcad.drawColor = new McCmColor(200, 255, 50);
let idText = mxcad.drawText(0, 3500, "绘图控件TrueType文字测试", 100, 0, 0, 1);
let ent = idText.getMcDbEntity();
// 修改文字样式为宋体
if(ent) ent.textStyle = "st_style";
mxcad.zoomAll();
mxcad.regen();
mxcad.updateDisplay();
});
}
* ```
*/
loadFonts(vecShxFonst: string[], vecBigShxFonst: string[], vecTureTypeFonts: string[], retCall: () => void): void;
/**
* TrueType字体.
* @returns { object } name | zhname | file
* @example
* ```ts
* import { MxCpp } from "mxcad";
*
* const trueTypeFontArr = MxCpp.App.getTrueTypeFonts();
* console.log(trueTypeFontAr);
* ```
*/
getTrueTypeFonts(): {
name: string;
zhname: string;
file: string;
}[];
/**
*
* @return
* @example
* ```ts
* import { MxCpp } from "mxcad";
*
* const version = MxCpp.App.getVersionString();
* console.log("版本信息", version);
* ```
*/
getVersionString(): string;
}
/**
* MxCppType CAD
*/
export declare class MxCppType {
/**
* MxCpp
* @example
* ```ts
* //获取与修剪相关的信息
* import { MxCpp } from "mxcad";
*
* let mxcadTrimAssert = new MxCpp.mxcadassemblyimp.MxDrawTrimAssist()
* ```
*/
mxcadassemblyimp?: any;
/**
* McAppType
* @example
* ```ts
* import { MxCpp } from "mxcad";
* const McAppType = MxCpp.App;
* ```
*/
App: McAppType;
/**
* PropertiesWindow
* @example
* ```ts
* import { MxCpp } from "mxcad";
*
* // 属性界面上,对象属性被修改事件。
* MxCpp.PropertiesWindow.onEvent_setProperties((id: McObjectId, prop: any) => {
* let ent = id.getMcDbEntity();
* if (!ent) return;
* if (prop.sVarName == "DN") {
* ent.setxDataDouble("DN", prop.val);
* }
* else if (prop.sVarName == "LEN") {
* ent.setxDataDouble("LEN", prop.val);
* }
* });
* ```
*/
PropertiesWindow: MxPropertiesWindowCustom;
/**
* Mx AI实例
*/
Ai: MxAI;
/**
*
* @returns {number}
* @example
* ```ts
* import { MxCpp } from "mxcad";
*
* const res = MxCpp.getCallResult();
* console.log(res);
* ```
*/
getCallResult(): number;
/**
* McGePoint3d
* @param {any} pt
* @returns {McGePoint3d} McGePoint3d
* @example
* ```ts
* import { MxCpp } from "mxcad";
*
* const pt = MxCpp.newMcGePoint3d({x:10,y:10,z:0});
* console.log(pt)
* ```
*/
newMcGePoint3d(pt?: any): McGePoint3d;
/**
* McGeVector3d
* @param {any} pt
* @returns {McGePoint3d} McGePoint3d
* @example
* ```ts
* import { MxCpp } from "mxcad";
*
* const vec = MxCpp.newMcGeVector3d({x:10,y:10,z:0});
* console.log(vec)
* ```
*/
newMcGeVector3d(pt?: any): McGeVector3d;
/**
* CAD对象
* @example
* ```ts
* import { MxCpp } from "mxcad";
* const mxcad = MxCpp.getCurrentMxCAD();
* ```
*/
getCurrentMxCAD(): McObject;
/**
* CAD对象的数据库对象.
* @example
* ```ts
* import { MxCpp } from "mxcad";
* const dataBase = MxCpp.getCurrentDatabase();
* ```
*/
getCurrentDatabase(): McDbDatabase;
/**
* hex格式的Gb2312编码的转成utf8
* @param strHex Gb2312编码
* @example
* ```ts
* import { MxCpp } from "mxcad";
*
* const gb2312Hex = "%c4%e3%ba%c3";
* const decodedString = MxCpp.decodeFromGb2312(gb2312Hex);
* console.log("Decoded string from GB2312 hex:", decodedString);
* ```
*/
decodeFromGb2312(strHex: string): string;
/**
* utf8转成hex格式的Gb2312编码
* @param str
* @example
* ```ts
* import { MxCpp } from "mxcad";
* const stringToEncode = "你好";
* const encodedHex = MxCpp.encodeToGb2312(stringToEncode);
* console.log("Encoded string to GB2312 hex:", encodedHex);
* ```
*/
encodeToGb2312(str: string): string;
}
/**
* MxCADUI 使.
*/
export interface MxCADUI {
/**
*
*/
getUploadFileConfig: () => {
baseUrl: string;
saveDwgUrl: string;
mxfilepath: string;
saveUrl: string;
printPdfUrl: string;
cutDwgUrl: string;
};
/**
* mxServerConfig.json文件配置
*/
getServerConfig: () => any;
/**
*
* @param plugin
*/
init: (plugin: MxCADPluginBase) => void;
/**
*
*/
uploadFile: (uploadFile_call: (param: any) => void, isReloadFile: boolean) => void;
/**
* mxcad对象
*/
mxcad: McObject;
/**
* mxmap对象
*/
mxmap: MxMap;
}
/**
*
* @example
* ```ts
* //设置地图加载的缺省数据
* import { MxCADPluginMapDefaultData } from "mxcad";
*
* let map_default_data = new MxCADPluginMapDefaultData();
* // CAD图纸与地图的对齐点.
* map_default_data.cadOrigin = [116275.977014, 19273.279085];
*
* // 12698436.047373507,2575109.229937706,12698641.731873507,2575240.5864377064
* // 地图与CAD图纸的对齐位置 。
* map_default_data.mapOrigin = [114.06825863001939, 22.54283198132819];
* // CAD图上一个绘图单是地图上多少米.
* map_default_data.meterInCADUnits = 1.0;
* // 需要打开的cad图纸.
* map_default_data.openFile = './demo/road.dwg.mxweb'
* ````
*/
export declare class MxCADPluginMapDefaultData {
/** 地图与CAD图纸的对齐位置 */
mapOrigin: number[];
/** CAD图纸与地图的对齐点 */
cadOrigin: number[];
meterInCADUnits: number;
/** mapbox地图token */
mapbox_accessToken: string;
/** 需要打开的cad图纸 */
openFile?: string;
/** 栅格瓦片图层列表 */
rasterTileLayerList: any[];
/** 矢量瓦片关键词*/
rasterTileKey?: string;
providers?: any;
/** 背景颜色 */
viewColor?: {
red: number;
green: number;
blue: number;
};
}
/**
* MxCADUI
*/
export declare class MxCADPluginSampleCode {
/** 示例代码在那个类型中 */
type: string;
/** 示例代码在名称 */
name: string;
/** 示例代码内容 */
code: string;
}
/** mxcad 基础配置 */
export declare class MxCADPluginBase {
/** 注册数据 */
sRegistData: string;
/**插件程序使用的接口 */
mxcadui?: MxCADUI;
/** 打开的文件 */
openFile?: string;
/** 地图默认配置 */
map_default_data?: MxCADPluginMapDefaultData;
/** 示例代码 */
sampleCode?: MxCADPluginSampleCode[];
}
/** 自定义属性窗口的值的类型 */
export declare enum MxPropertiesWindowCustomValueType {
/** 整数 */
kInt = 1,
/** 双精度浮点数 */
kDouble = 2,
/** 字符串 */
kString = 3
}
/** 自定义属性窗口需要的值 */
export declare class MxPropertiesWindowCustomValue {
/** 自定义属性窗口名 */
sVarName: string;
/** 自定义属性窗口类型 */
iVarType: number;
/** 自定义属性窗口值 */
val: any;
/** 是否只读 */
isOnlyRead: boolean;
}
/**
* MxPropertiesWindowCustom .
*/
export declare class MxPropertiesWindowCustom {
private getPropertiesCall;
private setPropertiesCall;
/**
*
* @example
* ```ts
// 属性界面上,得到对象属性事件。
MxCpp.PropertiesWindow.onEvent_getProperties((id: McObjectId) => {
let ent = id.getMcDbEntity();
if (!ent) return [];
let dn = ent.getxDataDouble("DN");
let len = ent.getxDataDouble("LEN");
let ret = [];
if (dn.ret) {
ret.push({
sVarName: "DN",
iVarType: MxPropertiesWindowCustomValueType.kDouble,
val: dn.val,
isOnlyRead: false
});
}
if (len.ret) {
ret.push({
sVarName: "LEN",
iVarType: MxPropertiesWindowCustomValueType.kDouble,
val: len.val,
isOnlyRead: false
});
}
return ret;
})
* ```
*/
onEvent_getProperties(call: (id: McObjectId) => MxPropertiesWindowCustomValue[]): void;
/**
*
* @example
* ```ts
// 属性界面上,对象属性被修改事件。
MxCpp.PropertiesWindow.onEvent_setProperties((id: McObjectId, prop: any) => {
let ent = id.getMcDbEntity();
if (!ent) return;
if (prop.sVarName == "DN") {
ent.setxDataDouble("DN", prop.val);
}
else if (prop.sVarName == "LEN") {
ent.setxDataDouble("LEN", prop.val);
}
});
* ```
*/
onEvent_setProperties(call: (id: McObjectId, prop: MxPropertiesWindowCustomValue) => void): void;
/**
*
* @example
* ```ts
import { MxCADUiPrEntity, MxCpp } from "mxcad";
// 设置对象扩展属性值。
async function Mx_TestExProp() {
let selEntity1 = new MxCADUiPrEntity();
selEntity1.setMessage("选择要需要开启自定义属性的对象");
let idText = await selEntity1.go();
if (!idText.isValid()) return;
let ent = idText.getMcDbEntity();
MxCpp.PropertiesWindow.setEntitySupportCustom(idText);
// 设置对象扩展属性值。
ent.setxDataDouble("DN", 100);
ent.setxDataDouble("LEN", 2000);
}
* ```
*/
setEntitySupportCustom(id: McObjectId, isCustomProperties?: boolean): void;
/** 属性UI程序调用,获取给定实体的自定义属性 */
getEntityProperties(id: McObjectId): MxPropertiesWindowCustomValue[];
/** 属性UI程序调用,设置给定实体的自定义属性 */
setEntityProperties(id: McObjectId, prop: MxPropertiesWindowCustomValue): void;
}
/**
* MxCompare
*/
export declare class MxCompare {
private imp;
private result;
constructor();
private getTypeString;
/**
* database的图纸进行比较
*/
do(database: McDbDatabase): boolean;
/**
*
*/
getResult(): any[];
}
/**
*
*/
export declare enum MxCADCloneType {
/** 正常Clone */
kClone = 1,
/** 动态拖动Clone */
kDragClone = 2,
/** 数据归档 */
kCPPClone = 3
}
/**
* AutoCAD DWG AutoCAD DWG
* @example
* ```ts
import { McDbCustomEntity, IMcDbDwgFiler } from "mxcad";
// 自定义实体类 继承 McDbCustomEntity
class McDbTestLineCustomEntity extends McDbCustomEntity {
// 定义实体内 pt1、pt2 两个点对象
private pt1: McGePoint3d = new McGePoint3d();
private pt2: McGePoint3d = new McGePoint3d();
// 读取自定义实体的数据字段 pt1、pt2
public dwgInFields(filter: IMcDbDwgFiler): boolean {
this.pt1 = filter.readPoint("pt1").val;
this.pt2 = filter.readPoint("pt2").val;
return true;
}
// 写入自定义实体的数据字段 pt1、pt2
public dwgOutFields(filter: IMcDbDwgFiler): boolean {
filter.writePoint("pt1", this.pt1);
filter.writePoint("pt2", this.pt2);
return true;
}
}
* ```
*/
export declare abstract class IMcDbDwgFiler {
/**
*
*/
private type;
/**
*
* @param type
*/
constructor(type: MxCADCloneType);
/**
*
* @returns
*/
getType(): MxCADCloneType;
/**
* DWG
* @param name
* @param vals
*/
writePoints(name: string, vals: McGePoint3d[]): void;
/**
* DWG
* @param name
* @returns { Object } ret | val
*/
readPoints(name: string): {
val: McGePoint3d[];
ret: boolean;
};
/**
* DWG
* @param name
* @param val
*/
abstract writePoint(name: string, val: McGePoint3d): void;
/**
* DWG
* @param name
* @returns { Object } ret | val
*/
abstract readPoint(name: string): {
val: McGePoint3d;
ret: boolean;
};
/**
* DWG
* @param name
* @param val
*/
abstract writeLong(name: string, val: number): void;
/**
* DWG
* @param name
* @returns { Object } ret | val
*/
abstract readLong(name: string): {
val: number;
ret: boolean;
};
/**
* DWG
* @param name
* @param val
*/
abstract writeDouble(name: string, val: number): void;
/**
* DWG
* @param name
* @returns { Object } ret | val
*/
abstract readDouble(name: string): {
val: number;
ret: boolean;
};
/**
* DWG
* @param name
* @param val
*/
abstract writeString(name: string, val: string): void;
/**
* DWG
* @param name
* @returns { Object } ret | val
*/
abstract readString(name: string): {
val: string;
ret: boolean;
};
}
/**
* AutoCAD
* @example
* ```ts
import { McDbCustomEntity, McGePoint3d, MxCADWorldDraw, McDbPolyline } from "mxcad";
// 自定义实体类 继承 McDbCustomEntity
class McDbTestLineCustomEntity extends McDbCustomEntity {
// 定义实体内 pt1、pt2 两个点对象
private pt1: McGePoint3d = new McGePoint3d();
private pt2: McGePoint3d = new McGePoint3d();
// 绘制自定义实体
public worldDraw(draw: MxCADWorldDraw): void {
// 构造一个新多段线对象pl
let pl= new McDbPolyline()
// pl新增点对象
pl.addVertexAt(this.pt1)
pl.addVertexAt(this.pt2)
pl.addVertexAt(new McGePoint3d())
// 绘制pl多段线
draw.drawEntity(pl);
}
}
* ```
*/
export declare class MxCADWorldDraw {
/** 内部对象实现 */
imp: any;
/**
*
* @param lPtrWorldDraw
*/
constructor(lPtrWorldDraw: number);
/**
*
*/
drawEntity(entity: McDbEntity): void;
/**
* 使.
*/
drawOsnapEntity(entity: McDbEntity): void;
/**
*
* @param val McCmColor
*/
set trueColor(val: McCmColor);
get trueColor(): McCmColor;
}
/**
*
* @example
* ```ts
* import { IMcDbDwgFiler, McDbCustomEntity, McDbLine, McDbPolyline, McGePoint3d, McGePoint3dArray, MxCADUiPrPoint, MxCADWorldDraw, MxCpp } from "mxcad";
* import { MxFun } from "mxdraw";
// 新创建 McDbTestLineCustomEntity 类继承 McDbCustomEntity
class McDbTestLineCustomEntity extends McDbCustomEntity {
// 定义McDbTestLineCustomEntity内部的点对象 pt1、pt2
private pt1: McGePoint3d = new McGePoint3d();
private pt2: McGePoint3d = new McGePoint3d();
// 构造函数
constructor(imp?: any) {
super(imp);
}
// 创建函数
public create(imp: any) {
return new McDbTestLineCustomEntity(imp)
}
// 获取类名
public getTypeName(): string {
return "McDbTestLineCustomEntity";
}
// 读取自定义实体数据pt1、pt2
public dwgInFields(filter: IMcDbDwgFiler): boolean {
this.pt1 = filter.readPoint("pt1").val;
this.pt2 = filter.readPoint("pt2").val;
return true;
}
// 写入自定义实体数据pt1、pt2
public dwgOutFields(filter: IMcDbDwgFiler): boolean {
filter.writePoint("pt1", this.pt1);
filter.writePoint("pt2", this.pt2);
return true;
}
// 处理夹点编辑效果
public moveGripPointsAt(iIndex: number, dXOffset: number, dYOffset: number, dZOffset: number) {
this.assertWrite();
if (iIndex == 0) {
this.pt1.x += dXOffset;
this.pt1.y += dYOffset;
this.pt1.z += dZOffset;
}
else if (iIndex == 1) {
this.pt2.x += dXOffset;
this.pt2.y += dYOffset;
this.pt2.z += dZOffset;
}
};
// 设置对象编辑点位
public getGripPoints(): McGePoint3dArray {
let ret = new McGePoint3dArray()
ret.append(this.pt1);
ret.append(this.pt2);
return ret;
};
// 绘制实体
public worldDraw(draw: MxCADWorldDraw): void {
// let tmpline = new McDbLine(this.pt1, this.pt2);
let pl= new McDbPolyline()
pl.addVertexAt(this.pt1)
pl.addVertexAt(this.pt2)
pl.addVertexAt(new McGePoint3d())
draw.drawEntity(pl);
}
// 设置pt1
public setPoint1(pt1: McGePoint3d) {
this.assertWrite();
this.pt1 = pt1.clone();
}
// 设置pt2
public setPoint2(pt2: McGePoint3d) {
this.assertWrite();
this.pt2 = pt2.clone();
}
// 获取pt1
public getPoint1() {
return this.pt1;
}
// 获取pt2
public getPoint2() {
return this.pt2;
}
}
* ```
*/
export declare abstract class McDbCustomEntity extends McDbEntity {
/**
*
* @param imp
*/
constructor(imp?: any);
/**
*
* @example
* ```ts
* import { MxFun } from 'mxdraw
* // MxCAD创建成功
* MxFun.on("mxcadApplicationCreatedMxCADObject", (param) => {
* // McDbTestLineCustomEntity 自定义实体
* new McDbTestLineCustomEntity().rxInit();// 自定义实体注册
* MxFun.addCommand("MxTest_DrawCustomEntity");// 注册绘制实体命令
* })
* ```
*/
rxInit(): void;
/**
*
* @example
* ```ts
* import { McDbCustomEntity } from "mxcad";
*
* const customEnt = new McDbCustomEntity();// 构造新自定义实体对象
* const cloneEnt = customEnt.clone();// 复制实体
* ```
*/
clone(): McDbObject | null;
/** js 对像的数据与McDbCustomEntity::m_mapData的同步。 */
syncData(toCpp?: boolean): boolean;
/**
* @internal
* MxCAD辅助,使
* ```
*/
tempRelationObject(): number;
/**
* @internal
* MxCAD辅助,使
* ```
*/
freeTempRelationObject(): void;
protected assertWrite(autoUndo?: boolean): void;
/**
*
* @param _iIndex
* @param _dXOffset X轴偏移量
* @param _dYOffset Y轴偏移量
* @param _dZOffset Z轴偏移量
* @example
* ```ts
import { McDbCustomEntity, MxCADWorldDraw, McDbLine } from 'mxcad';
// 新创建 McDbTestLineCustomEntity 类继承 McDbCustomEntity
class McDbTestLineCustomEntity extends McDbCustomEntity {
// 定义McDbTestLineCustomEntity内部的点对象 pt1、pt2
private pt1: McGePoint3d = new McGePoint3d();
private pt2: McGePoint3d = new McGePoint3d();
// 移动自定义对象的夹点。
public moveGripPointsAt(iIndex: number, dXOffset: number, dYOffset: number, dZOffset: number) {
this.assertWrite();
if (iIndex == 0) {
this.pt1.x += dXOffset;
this.pt1.y += dYOffset;
this.pt1.z += dZOffset;
}
else if (iIndex == 1) {
this.pt2.x += dXOffset;
this.pt2.y += dYOffset;
this.pt2.z += dZOffset;
}
};
}
* ```
*/
moveGripPointsAt(_iIndex: number, _dXOffset: number, _dYOffset: number, _dZOffset: number): void;
/**
*
* @returns
*/
getGripPoints(): McGePoint3dArray;
/**
* ()
*/
abstract create(imp?: any): McDbCustomEntity;
/**
*
* @returns
*/
abstract getTypeName(): string;
/**
* DWG
* @example
* ```ts
import { McDbCustomEntity, IMcDbDwgFiler } from 'mxcad'
// 新创建 McDbTestLineCustomEntity 类继承 McDbCustomEntity
class McDbTestLineCustomEntity extends McDbCustomEntity {
// 定义McDbTestLineCustomEntity内部的点对象 pt1、pt2
private pt1: McGePoint3d = new McGePoint3d();
private pt2: McGePoint3d = new McGePoint3d();
// 读取自定义实体的数据字段pt1、pt2
public dwgInFields(filter: IMcDbDwgFiler): boolean {
this.pt1 = filter.readPoint("pt1").val;
this.pt2 = filter.readPoint("pt2").val;
return true;
}
}
* ```
*/
abstract dwgInFields(filter: IMcDbDwgFiler): boolean;
/**
* DWG
* @example
* ```ts
// 新创建 McDbTestLineCustomEntity 类继承 McDbCustomEntity
import { McDbCustomEntity, IMcDbDwgFiler } from 'mxcad'
class McDbTestLineCustomEntity extends McDbCustomEntity {
// 定义McDbTestLineCustomEntity内部的点对象 pt1、pt2
private pt1: McGePoint3d = new McGePoint3d();
private pt2: McGePoint3d = new McGePoint3d();
// 写入自定义实体的数据字段pt1、pt2
public dwgOutFields(filter: IMcDbDwgFiler): boolean {
filter.writePoint("pt1", this.pt1);
filter.writePoint("pt2", this.pt2);
return true;
}
}
* ```
*/
abstract dwgOutFields(filter: IMcDbDwgFiler): boolean;
/**
*
* @example
* ```ts
import { McDbCustomEntity, MxCADWorldDraw, McDbLine } from 'mxcad'
// 新创建 McDbTestLineCustomEntity 类继承 McDbCustomEntity
class McDbTestLineCustomEntity extends McDbCustomEntity {
// 定义McDbTestLineCustomEntity内部的点对象 pt1、pt2
private pt1: McGePoint3d = new McGePoint3d();
private pt2: McGePoint3d = new McGePoint3d();
//绘制实体
public worldDraw(draw: MxCADWorldDraw): void {
let tmpline = new McDbLine(this.pt1, this.pt2);
draw.drawEntity(tmpline);
}
}
* ```
*/
abstract worldDraw(draw: MxCADWorldDraw): void;
}
export declare let MxCpp: MxCppType;
/**
* MxCAD assembly
* @param call
* @param locateFile wasm
* @param wasmBinary wasm
* @param fontspath
* @param networkFonts
* @returns Promise MxCppType
* @example
* ```ts
import { loadMxCADassembly } from "mxcad"
// 调用 loadMxCADassembly 函数并处理返回的 Promise
loadMxCADassembly(
(MxCpp) => {
console.log('MxCAD assembly 已加载');
// 在这里可以对 MxCAD assembly 进行操作
},
// 可选参数,你可以根据需要提供定位函数和其他参数
).then((MxCpp) => {
console.log('MxCAD assembly 加载完成');
// 在这里可以继续处理加载完成后的 MxCAD assembly
}).catch((error) => {
console.error('加载 MxCAD assembly 时出错:', error);
});
* ```
*/
export declare function loadMxCADassembly(call?: (MxCpp: MxCppType) => void, locateFile?: (fileName: string, base?: string | URL) => string, wasmBinary?: ArrayBuffer, fontspath?: string, networkFonts?: string[]): Promise<MxCppType>;
/**
*
* @returns { object } ok | error | var
* @example
* ```ts
import { MxCheckTheBrowser } from 'mxcad';
const browserCheckResult = MxCheckTheBrowser();
if (browserCheckResult.ok) {
console.log('浏览器符合要求,可以加载 MxCAD assembly。');
// 在这里调用 loadMxCADassembly 函数加载 MxCAD assembly
} else {
console.error('浏览器不符合要求:', browserCheckResult.error);
// 在这里处理浏览器不符合要求的情况,可能给出用户友好的提示或者采取其他措施
}
* ```
*/
export declare function MxCheckTheBrowser(): {
ok: boolean;
error: string;
var: any;
};
/**
* createMxCad
* @example
* ```ts
createMxCad({
canvas: "#mxcad",
locateFile: (fileName) => new URL(`/node_modules/mxcad/dist/wasm/2d/${fileName}`, import.meta.url).href,
// 提供要打开的文件 注意../assets/test.mxweb 是相对路径下的文件地址,
// 在vite中可用通过这样的方式得到该文件正确的的网络地址
fileUrl: new URL("../assets/test.mxweb", import.meta.url).href,
// 提供加载字体的目录路径
fontspath: new URL("node_modules/mxcad/dist/fonts", import.meta.url).href,
viewBackgroundColor:{red:0,green:0,blue:0}, //黑色背景
middlePan:false, //禁用鼠标中间键操作
multipleSelect: true, // 开启多选
onOpenFileComplete:()=>{
console.log("成功打开文件!")
}
})
* ```
*/
export interface MxCadConfig {
/** wasm(wasm/js/worker.js)
* @param fileName wasm相关的文件名称
* @param base js调用位置的http URL绝对路径
* @returns filePath base + fileName
* @abstract locateFile配置函数就是返回wasm相关文件在自己的服务器上的位置
* npm包中`node_modules/mxcad/dist/wasm/2d/`2d的相关wasm文件
*/
locateFile?: (fileName: string, base?: string | URL) => string;
/** WebAssembly 模块二进制文件 默认情况无需配置 **/
wasmBinary?: ArrayBuffer;
/**
* MxFun.getCurrentDraw mxDraw实例时
* canvas属性(css选择器字符串也可以是一个canvas元素)mxdraw实例
* mxDraw实例 mxdraw包中导出的 MxFun.getCurrentDraw方法即可
* gis模式下canvas变量不会使用使mapbox的canvas.
* */
canvas?: string | HTMLCanvasElement;
/**
* mxdraw和mxcad
* onInit默认值函数如下实例所示
* @example
* ```js
* import { MxFun } from "mxdraw"
* onInit() {
* MxFun.setIniset({
* // 启用对象选择功能.
* EnableIntelliSelect: true,
* // 选择类型
* IntelliSelectType: 1,
* // 是否开启多个选择
* multipleSelect: false,
* });
* }
* ```
* */
onInit?: Function;
/** 需要初始化打开的文件url路径 */
fileUrl?: string;
/**
*
*/
onOpenFileComplete?: Function;
/** 字体文件加载路径,默认是fonts */
fontspath?: string;
/** 服务器上可供加载的字体列表 */
networkFonts?: string[];
/** 打开文件参数设置,如,打开文件不使用缓存:{fetchAttributes:FetchAttributes.EMSCRIPTEN_FETCH_LOAD_TO_MEMORY}*/
openParameter?: object;
/**鼠标中间键操作设置,默认为鼠标中间移动视区 */
middlePan?: number | boolean;
/**注册数据 */
registdata?: string;
/**注册文件 */
registfile?: string;
/**
*
*/
viewBackgroundColor?: {
red: number;
green: number;
blue: number;
};
/**地图模块 */
map?: any;
/**多选模式 */
multipleSelect?: boolean;
/**是否启用Undo */
enableUndo?: boolean;
/**使用鼠标中键移动视区,默认是使用 */
mouseMiddlePan?: number;
/**是否启用选择功能,默认是使用 */
enableIntelliSelect?: boolean;
/**是否启用浏览模式,默认是编辑模式 */
browse?: boolean;
/**是否使用webgl1方式启动 */
webgl1?: boolean;
}
/** MxCad
* @param config
* @param mxcadobj
* @example
* //通过创建实例实现图纸展示以下基于vite打包工具
* ```ts
* import { createMxCad } from "mxcad";
*
* createMxCad({
* canvas: "#mxcad",
* locateFile: (fileName) => new URL(`/node_modules/mxcad/dist/wasm/2d/${fileName}`, import.meta.url).href,
* // 提供要打开的文件 注意../assets/test.mxweb 是相对路径下的文件地址,
* // 在vite中可用通过这样的方式得到该文件正确的的网络地址
* fileUrl: new URL("../assets/test.mxweb", import.meta.url).href,
* // 提供加载字体的目录路径
* fontspath: new URL("node_modules/mxcad/dist/fonts", import.meta.url).href,
* })
* ```
*/
export declare const createMxCad: (config?: MxCadConfig, mxcadobj?: McObject) => Promise<McObject>;
/**
* @param height
* @param text
* @param position
* @param angle
* @param color
*/
export declare function drawText(): Promise<McObjectId | undefined>;
/**
*
*/
export declare function drawCircle(): Promise<McObjectId | undefined>;
/**
* 线
*/
export declare function drawLine(): Promise<void>;
/**
*
*/
export declare function drawMText(): Promise<McObjectId | undefined>;
/** 绘多义线 */
export declare function drawPolyLine(): Promise<void>;
/** 绘制正多边形 */
export declare function drawPolygon(): Promise<void>;
/**
*
*/
export declare function drawArc(): Promise<void>;
/**
*
*/
export declare function drawEllipticalArc(): Promise<McObjectId | undefined>;
/**
*
*/
export declare function Mx_Erase(): Promise<void>;
/**
*
*/
export declare const drawRectang: () => Promise<void>;
export declare namespace MdGe {
enum MxShapeEnum {
Enum_COMPOUND = 0,
Enum_COMPSOLID = 1,
Enum_SOLID = 2,
Enum_SHELL = 3,
Enum_FACE = 4,
Enum_WIRE = 5,
Enum_EDGE = 6,
Enum_VERTEX = 7,
Enum_SHAPE = 8
}
enum MxHorizontalTextAlignment {
HTA_LEFT = 0,
HTA_CENTER = 1,
HTA_RIGHT = 2
}
enum MxVerticalTextAlignment {
CVTA_BOTTOM = 0,
CVTA_CENTER = 1,
CVTA_TOP = 2,
CVTA_TOPFIRSTLINE = 3
}
enum MxFontAspect {
FA_UNDEFINED = -1,
FA_Regular = 0,
FA_Bold = 1,
FA_Italic = 2,
FA_BoldItalic = 3
}
enum MxTypeOfDisplayText {
TODT_NORMAL = 0,
TODT_SUBTITLE = 1,
TODT_DEKALE = 2,
TODT_BLEND = 3,
TODT_DIMENSION = 4,
TODT_SHADOW = 5
}
enum MxCF3dFilletShapeEnum {
Enum_Rational = 0,
Enum_QuasiAngular = 1,
Enum_Polynomial = 2
}
enum MxCFDSChamfMode {
Enum_ClassicChamfer = 0,
Enum_ConstThroatChamfer = 1,
Enum_ConstThroatWithPenetrationChamfer = 2
}
enum MxGFTrihedron {
GF_IsCorrectedFrenet = 0,
GF_IsFixed = 1,
GF_IsFrenet = 2,
GF_IsConstantNormal = 3,
GF_IsDarboux = 4,
GF_IsGuideAC = 5,
GF_IsGuidePlan = 6,
GF_IsGuideACWithContact = 7,
GF_IsGuidePlanWithContact = 8,
GF_IsDiscreteTrihedron = 9
}
enum MxGAShapeEnum {
GA_C0 = 0,
GA_G1 = 1,
GA_C1 = 2,
GA_G2 = 3,
GA_C2 = 4,
GA_C3 = 5,
GA_CN = 6
}
enum MxOffsetModeEnum {
Offset_Skin = 0,
Offset_Pipe = 1,
Offset_RectoVerso = 2
}
enum MxGAJoinTypeEnum {
GA_Arc = 0,
GA_Tangent = 1,
GA_Intersection = 2
}
enum MxNameOfMaterial {
Material_NOM_Brass = 0,
Material_NOM_Bronze = 1,
Material_NOM_Copper = 2,
Material_NOM_Gold = 3,
Material_NOM_Pewter = 4,
Material_NOM_Plastered = 5,
Material_NOM_Plastified = 6,
Material_NOM_Silver = 7,
Material_NOM_Steel = 8,
Material_NOM_Stone = 9,
Material_NOM_ShinyPlastified = 10,
Material_NOM_Satin = 11,
Material_NOM_Metalized = 12,
Material_NOM_Ionized = 13,
Material_NOM_Chrome = 14,
Material_NOM_Aluminum = 15,
Material_NOM_Obsidian = 16,
Material_NOM_Neon = 17,
Material_NOM_Jade = 18,
Material_NOM_Charcoal = 19,
Material_NOM_Water = 20,
Material_NOM_Glass = 21,
Material_NOM_Diamond = 22,
Material_NOM_Transparent = 23,
Material_NOM_DEFAULT = 24,
Material_NOM_UserDefined = 25
}
enum MxTypeOfMaterial {
Material_TOM_ASPECT = 0,
Material_TOM_PHYSIC = 1
}
enum MxTypeOfReflection {
Reflection_TOR_AMBIENT = 0,
Reflection_TOR_DIFFUSE = 1,
Reflection_TOR_SPECULAR = 2,
Reflection_TOR_EMISSION = 3
}
enum MxNameOfColor {
Color_NOC_BLACK = 0,
Color_NOC_MATRABLUE = 1,
Color_NOC_MATRAGRAY = 2,
Color_NOC_ALICEBLUE = 3,
Color_NOC_ANTIQUEWHITE = 4,
Color_NOC_ANTIQUEWHITE1 = 5,
Color_NOC_ANTIQUEWHITE2 = 6,
Color_NOC_ANTIQUEWHITE3 = 7,
Color_NOC_ANTIQUEWHITE4 = 8,
Color_NOC_AQUAMARINE1 = 9,
Color_NOC_AQUAMARINE2 = 10,
Color_NOC_AQUAMARINE4 = 11,
Color_NOC_AZURE = 12,
Color_NOC_AZURE2 = 13,
Color_NOC_AZURE3 = 14,
Color_NOC_AZURE4 = 15,
Color_NOC_BEIGE = 16,
Color_NOC_BISQUE = 17,
Color_NOC_BISQUE2 = 18,
Color_NOC_BISQUE3 = 19,
Color_NOC_BISQUE4 = 20,
Color_NOC_BLANCHEDALMOND = 21,
Color_NOC_BLUE = 22,
Color_NOC_BLUE1 = 22,
Color_NOC_BLUE2 = 23,
Color_NOC_BLUE3 = 24,
Color_NOC_BLUE4 = 25,
Color_NOC_BLUEVIOLET = 26,
Color_NOC_BROWN = 27,
Color_NOC_BROWN1 = 28,
Color_NOC_BROWN2 = 29,
Color_NOC_BROWN3 = 30,
Color_NOC_BROWN4 = 31,
Color_NOC_BURLYWOOD = 32,
Color_NOC_BURLYWOOD1 = 33,
Color_NOC_BURLYWOOD2 = 34,
Color_NOC_BURLYWOOD3 = 35,
Color_NOC_BURLYWOOD4 = 36,
Color_NOC_CADETBLUE = 37,
Color_NOC_CADETBLUE1 = 38,
Color_NOC_CADETBLUE2 = 39,
Color_NOC_CADETBLUE3 = 40,
Color_NOC_CADETBLUE4 = 41,
Color_NOC_CHARTREUSE = 42,
Color_NOC_CHARTREUSE1 = 42,
Color_NOC_CHARTREUSE2 = 43,
Color_NOC_CHARTREUSE3 = 44,
Color_NOC_CHARTREUSE4 = 45,
Color_NOC_CHOCOLATE = 46,
Color_NOC_CHOCOLATE1 = 47,
Color_NOC_CHOCOLATE2 = 48,
Color_NOC_CHOCOLATE3 = 49,
Color_NOC_CHOCOLATE4 = 50,
Color_NOC_CORAL = 51,
Color_NOC_CORAL1 = 52,
Color_NOC_CORAL2 = 53,
Color_NOC_CORAL3 = 54,
Color_NOC_CORAL4 = 55,
Color_NOC_CORNFLOWERBLUE = 56,
Color_NOC_CORNSILK1 = 57,
Color_NOC_CORNSILK2 = 58,
Color_NOC_CORNSILK3 = 59,
Color_NOC_CORNSILK4 = 60,
Color_NOC_CYAN = 61,
Color_NOC_CYAN1 = 61,
Color_NOC_CYAN2 = 62,
Color_NOC_CYAN3 = 63,
Color_NOC_CYAN4 = 64,
Color_NOC_DARKGOLDENROD = 65,
Color_NOC_DARKGOLDENROD1 = 66,
Color_NOC_DARKGOLDENROD2 = 67,
Color_NOC_DARKGOLDENROD3 = 68,
Color_NOC_DARKGOLDENROD4 = 69,
Color_NOC_DARKGREEN = 70,
Color_NOC_DARKKHAKI = 71,
Color_NOC_DARKOLIVEGREEN = 72,
Color_NOC_DARKOLIVEGREEN1 = 73,
Color_NOC_DARKOLIVEGREEN2 = 74,
Color_NOC_DARKOLIVEGREEN3 = 75,
Color_NOC_DARKOLIVEGREEN4 = 76,
Color_NOC_DARKORANGE = 77,
Color_NOC_DARKORANGE1 = 78,
Color_NOC_DARKORANGE2 = 79,
Color_NOC_DARKORANGE3 = 80,
Color_NOC_DARKORANGE4 = 81,
Color_NOC_DARKORCHID = 82,
Color_NOC_DARKORCHID1 = 83,
Color_NOC_DARKORCHID2 = 84,
Color_NOC_DARKORCHID3 = 85,
Color_NOC_DARKORCHID4 = 86,
Color_NOC_DARKSALMON = 87,
Color_NOC_DARKSEAGREEN = 88,
Color_NOC_DARKSEAGREEN1 = 89,
Color_NOC_DARKSEAGREEN2 = 90,
Color_NOC_DARKSEAGREEN3 = 91,
Color_NOC_DARKSEAGREEN4 = 92,
Color_NOC_DARKSLATEBLUE = 93,
Color_NOC_DARKSLATEGRAY1 = 94,
Color_NOC_DARKSLATEGRAY2 = 95,
Color_NOC_DARKSLATEGRAY3 = 96,
Color_NOC_DARKSLATEGRAY4 = 97,
Color_NOC_DARKSLATEGRAY = 98,
Color_NOC_DARKTURQUOISE = 99,
Color_NOC_DARKVIOLET = 100,
Color_NOC_DEEPPINK = 101,
Color_NOC_DEEPPINK2 = 102,
Color_NOC_DEEPPINK3 = 103,
Color_NOC_DEEPPINK4 = 104,
Color_NOC_DEEPSKYBLUE1 = 105,
Color_NOC_DEEPSKYBLUE2 = 106,
Color_NOC_DEEPSKYBLUE3 = 107,
Color_NOC_DEEPSKYBLUE4 = 108,
Color_NOC_DODGERBLUE1 = 109,
Color_NOC_DODGERBLUE2 = 110,
Color_NOC_DODGERBLUE3 = 111,
Color_NOC_DODGERBLUE4 = 112,
Color_NOC_FIREBRICK = 113,
Color_NOC_FIREBRICK1 = 114,
Color_NOC_FIREBRICK2 = 115,
Color_NOC_FIREBRICK3 = 116,
Color_NOC_FIREBRICK4 = 117,
Color_NOC_FLORALWHITE = 118,
Color_NOC_FORESTGREEN = 119,
Color_NOC_GAINSBORO = 120,
Color_NOC_GHOSTWHITE = 121,
Color_NOC_GOLD = 122,
Color_NOC_GOLD1 = 122,
Color_NOC_GOLD2 = 123,
Color_NOC_GOLD3 = 124,
Color_NOC_GOLD4 = 125,
Color_NOC_GOLDENROD = 126,
Color_NOC_GOLDENROD1 = 127,
Color_NOC_GOLDENROD2 = 128,
Color_NOC_GOLDENROD3 = 129,
Color_NOC_GOLDENROD4 = 130,
Color_NOC_GRAY = 131,
Color_NOC_GRAY0 = 132,
Color_NOC_GRAY1 = 133,
Color_NOC_GRAY2 = 134,
Color_NOC_GRAY3 = 135,
Color_NOC_GRAY4 = 136,
Color_NOC_GRAY5 = 137,
Color_NOC_GRAY6 = 138,
Color_NOC_GRAY7 = 139,
Color_NOC_GRAY8 = 140,
Color_NOC_GRAY9 = 141,
Color_NOC_GRAY10 = 142,
Color_NOC_GRAY11 = 143,
Color_NOC_GRAY12 = 144,
Color_NOC_GRAY13 = 145,
Color_NOC_GRAY14 = 146,
Color_NOC_GRAY15 = 147,
Color_NOC_GRAY16 = 148,
Color_NOC_GRAY17 = 149,
Color_NOC_GRAY18 = 150,
Color_NOC_GRAY19 = 151,
Color_NOC_GRAY20 = 152,
Color_NOC_GRAY21 = 153,
Color_NOC_GRAY22 = 154,
Color_NOC_GRAY23 = 155,
Color_NOC_GRAY24 = 156,
Color_NOC_GRAY25 = 157,
Color_NOC_GRAY26 = 158,
Color_NOC_GRAY27 = 159,
Color_NOC_GRAY28 = 160,
Color_NOC_GRAY29 = 161,
Color_NOC_GRAY30 = 162,
Color_NOC_GRAY31 = 163,
Color_NOC_GRAY32 = 164,
Color_NOC_GRAY33 = 165,
Color_NOC_GRAY34 = 166,
Color_NOC_GRAY35 = 167,
Color_NOC_GRAY36 = 168,
Color_NOC_GRAY37 = 169,
Color_NOC_GRAY38 = 170,
Color_NOC_GRAY39 = 171,
Color_NOC_GRAY40 = 172,
Color_NOC_GRAY41 = 173,
Color_NOC_GRAY42 = 174,
Color_NOC_GRAY43 = 175,
Color_NOC_GRAY44 = 176,
Color_NOC_GRAY45 = 177,
Color_NOC_GRAY46 = 178,
Color_NOC_GRAY47 = 179,
Color_NOC_GRAY48 = 180,
Color_NOC_GRAY49 = 181,
Color_NOC_GRAY50 = 182,
Color_NOC_GRAY51 = 183,
Color_NOC_GRAY52 = 184,
Color_NOC_GRAY53 = 185,
Color_NOC_GRAY54 = 186,
Color_NOC_GRAY55 = 187,
Color_NOC_GRAY56 = 188,
Color_NOC_GRAY57 = 189,
Color_NOC_GRAY58 = 190,
Color_NOC_GRAY59 = 191,
Color_NOC_GRAY60 = 192,
Color_NOC_GRAY61 = 193,
Color_NOC_GRAY62 = 194,
Color_NOC_GRAY63 = 195,
Color_NOC_GRAY64 = 196,
Color_NOC_GRAY65 = 197,
Color_NOC_GRAY66 = 198,
Color_NOC_GRAY67 = 199,
Color_NOC_GRAY68 = 200,
Color_NOC_GRAY69 = 201,
Color_NOC_GRAY70 = 202,
Color_NOC_GRAY71 = 203,
Color_NOC_GRAY72 = 204,
Color_NOC_GRAY73 = 205,
Color_NOC_GRAY74 = 206,
Color_NOC_GRAY75 = 207,
Color_NOC_GRAY76 = 208,
Color_NOC_GRAY77 = 209,
Color_NOC_GRAY78 = 210,
Color_NOC_GRAY79 = 211,
Color_NOC_GRAY80 = 212,
Color_NOC_GRAY81 = 213,
Color_NOC_GRAY82 = 214,
Color_NOC_GRAY83 = 215,
Color_NOC_GRAY85 = 216,
Color_NOC_GRAY86 = 217,
Color_NOC_GRAY87 = 218,
Color_NOC_GRAY88 = 219,
Color_NOC_GRAY89 = 220,
Color_NOC_GRAY90 = 221,
Color_NOC_GRAY91 = 222,
Color_NOC_GRAY92 = 223,
Color_NOC_GRAY93 = 224,
Color_NOC_GRAY94 = 225,
Color_NOC_GRAY95 = 226,
Color_NOC_GRAY97 = 227,
Color_NOC_GRAY98 = 228,
Color_NOC_GRAY99 = 229,
Color_NOC_GREEN = 230,
Color_NOC_GREEN1 = 230,
Color_NOC_GREEN2 = 231,
Color_NOC_GREEN3 = 232,
Color_NOC_GREEN4 = 233,
Color_NOC_GREENYELLOW = 234,
Color_NOC_HONEYDEW = 235,
Color_NOC_HONEYDEW2 = 236,
Color_NOC_HONEYDEW3 = 237,
Color_NOC_HONEYDEW4 = 238,
Color_NOC_HOTPINK = 239,
Color_NOC_HOTPINK1 = 240,
Color_NOC_HOTPINK2 = 241,
Color_NOC_HOTPINK3 = 242,
Color_NOC_HOTPINK4 = 243,
Color_NOC_INDIANRED = 244,
Color_NOC_INDIANRED1 = 245,
Color_NOC_INDIANRED2 = 246,
Color_NOC_INDIANRED3 = 247,
Color_NOC_INDIANRED4 = 248,
Color_NOC_IVORY = 249,
Color_NOC_IVORY2 = 250,
Color_NOC_IVORY3 = 251,
Color_NOC_IVORY4 = 252,
Color_NOC_KHAKI = 253,
Color_NOC_KHAKI1 = 254,
Color_NOC_KHAKI2 = 255,
Color_NOC_KHAKI3 = 256,
Color_NOC_KHAKI4 = 257,
Color_NOC_LAVENDER = 258,
Color_NOC_LAVENDERBLUSH1 = 259,
Color_NOC_LAVENDERBLUSH2 = 260,
Color_NOC_LAVENDERBLUSH3 = 261,
Color_NOC_LAVENDERBLUSH4 = 262,
Color_NOC_LAWNGREEN = 263,
Color_NOC_LEMONCHIFFON1 = 264,
Color_NOC_LEMONCHIFFON2 = 265,
Color_NOC_LEMONCHIFFON3 = 266,
Color_NOC_LEMONCHIFFON4 = 267,
Color_NOC_LIGHTBLUE = 268,
Color_NOC_LIGHTBLUE1 = 269,
Color_NOC_LIGHTBLUE2 = 270,
Color_NOC_LIGHTBLUE3 = 271,
Color_NOC_LIGHTBLUE4 = 272,
Color_NOC_LIGHTCORAL = 273,
Color_NOC_LIGHTCYAN = 274,
Color_NOC_LIGHTCYAN1 = 274,
Color_NOC_LIGHTCYAN2 = 275,
Color_NOC_LIGHTCYAN3 = 276,
Color_NOC_LIGHTCYAN4 = 277,
Color_NOC_LIGHTGOLDENROD = 278,
Color_NOC_LIGHTGOLDENROD1 = 279,
Color_NOC_LIGHTGOLDENROD2 = 280,
Color_NOC_LIGHTGOLDENROD3 = 281,
Color_NOC_LIGHTGOLDENROD4 = 282,
Color_NOC_LIGHTGOLDENRODYELLOW = 283,
Color_NOC_LIGHTGRAY = 284,
Color_NOC_LIGHTPINK = 285,
Color_NOC_LIGHTPINK1 = 286,
Color_NOC_LIGHTPINK2 = 287,
Color_NOC_LIGHTPINK3 = 288,
Color_NOC_LIGHTPINK4 = 289,
Color_NOC_LIGHTSALMON1 = 290,
Color_NOC_LIGHTSALMON2 = 291,
Color_NOC_LIGHTSALMON3 = 292,
Color_NOC_LIGHTSALMON4 = 293,
Color_NOC_LIGHTSEAGREEN = 294,
Color_NOC_LIGHTSKYBLUE = 295,
Color_NOC_LIGHTSKYBLUE1 = 296,
Color_NOC_LIGHTSKYBLUE2 = 297,
Color_NOC_LIGHTSKYBLUE3 = 298,
Color_NOC_LIGHTSKYBLUE4 = 299,
Color_NOC_LIGHTSLATEBLUE = 300,
Color_NOC_LIGHTSLATEGRAY = 301,
Color_NOC_LIGHTSTEELBLUE = 302,
Color_NOC_LIGHTSTEELBLUE1 = 303,
Color_NOC_LIGHTSTEELBLUE2 = 304,
Color_NOC_LIGHTSTEELBLUE3 = 305,
Color_NOC_LIGHTSTEELBLUE4 = 306,
Color_NOC_LIGHTYELLOW = 307,
Color_NOC_LIGHTYELLOW2 = 308,
Color_NOC_LIGHTYELLOW3 = 309,
Color_NOC_LIGHTYELLOW4 = 310,
Color_NOC_LIMEGREEN = 311,
Color_NOC_LINEN = 312,
Color_NOC_MAGENTA = 313,
Color_NOC_MAGENTA1 = 313,
Color_NOC_MAGENTA2 = 314,
Color_NOC_MAGENTA3 = 315,
Color_NOC_MAGENTA4 = 316,
Color_NOC_MAROON = 317,
Color_NOC_MAROON1 = 318,
Color_NOC_MAROON2 = 319,
Color_NOC_MAROON3 = 320,
Color_NOC_MAROON4 = 321,
Color_NOC_MEDIUMAQUAMARINE = 322,
Color_NOC_MEDIUMORCHID = 323,
Color_NOC_MEDIUMORCHID1 = 324,
Color_NOC_MEDIUMORCHID2 = 325,
Color_NOC_MEDIUMORCHID3 = 326,
Color_NOC_MEDIUMORCHID4 = 327,
Color_NOC_MEDIUMPURPLE = 328,
Color_NOC_MEDIUMPURPLE1 = 329,
Color_NOC_MEDIUMPURPLE2 = 330,
Color_NOC_MEDIUMPURPLE3 = 331,
Color_NOC_MEDIUMPURPLE4 = 332,
Color_NOC_MEDIUMSEAGREEN = 333,
Color_NOC_MEDIUMSLATEBLUE = 334,
Color_NOC_MEDIUMSPRINGGREEN = 335,
Color_NOC_MEDIUMTURQUOISE = 336,
Color_NOC_MEDIUMVIOLETRED = 337,
Color_NOC_MIDNIGHTBLUE = 338,
Color_NOC_MINTCREAM = 339,
Color_NOC_MISTYROSE = 340,
Color_NOC_MISTYROSE2 = 341,
Color_NOC_MISTYROSE3 = 342,
Color_NOC_MISTYROSE4 = 343,
Color_NOC_MOCCASIN = 344,
Color_NOC_NAVAJOWHITE1 = 345,
Color_NOC_NAVAJOWHITE2 = 346,
Color_NOC_NAVAJOWHITE3 = 347,
Color_NOC_NAVAJOWHITE4 = 348,
Color_NOC_NAVYBLUE = 349,
Color_NOC_OLDLACE = 350,
Color_NOC_OLIVEDRAB = 351,
Color_NOC_OLIVEDRAB1 = 352,
Color_NOC_OLIVEDRAB2 = 353,
Color_NOC_OLIVEDRAB3 = 354,
Color_NOC_OLIVEDRAB4 = 355,
Color_NOC_ORANGE = 356,
Color_NOC_ORANGE1 = 356,
Color_NOC_ORANGE2 = 357,
Color_NOC_ORANGE3 = 358,
Color_NOC_ORANGE4 = 359,
Color_NOC_ORANGERED = 360,
Color_NOC_ORANGERED1 = 360,
Color_NOC_ORANGERED2 = 361,
Color_NOC_ORANGERED3 = 362,
Color_NOC_ORANGERED4 = 363,
Color_NOC_ORCHID = 364,
Color_NOC_ORCHID1 = 365,
Color_NOC_ORCHID2 = 366,
Color_NOC_ORCHID3 = 367,
Color_NOC_ORCHID4 = 368,
Color_NOC_PALEGOLDENROD = 369,
Color_NOC_PALEGREEN = 370,
Color_NOC_PALEGREEN1 = 371,
Color_NOC_PALEGREEN2 = 372,
Color_NOC_PALEGREEN3 = 373,
Color_NOC_PALEGREEN4 = 374,
Color_NOC_PALETURQUOISE = 375,
Color_NOC_PALETURQUOISE1 = 376,
Color_NOC_PALETURQUOISE2 = 377,
Color_NOC_PALETURQUOISE3 = 378,
Color_NOC_PALETURQUOISE4 = 379,
Color_NOC_PALEVIOLETRED = 380,
Color_NOC_PALEVIOLETRED1 = 381,
Color_NOC_PALEVIOLETRED2 = 382,
Color_NOC_PALEVIOLETRED3 = 383,
Color_NOC_PALEVIOLETRED4 = 384,
Color_NOC_PAPAYAWHIP = 385,
Color_NOC_PEACHPUFF = 386,
Color_NOC_PEACHPUFF2 = 387,
Color_NOC_PEACHPUFF3 = 388,
Color_NOC_PEACHPUFF4 = 389,
Color_NOC_PERU = 390,
Color_NOC_PINK = 391,
Color_NOC_PINK1 = 392,
Color_NOC_PINK2 = 393,
Color_NOC_PINK3 = 394,
Color_NOC_PINK4 = 395,
Color_NOC_PLUM = 396,
Color_NOC_PLUM1 = 397,
Color_NOC_PLUM2 = 398,
Color_NOC_PLUM3 = 399,
Color_NOC_PLUM4 = 400,
Color_NOC_POWDERBLUE = 401,
Color_NOC_PURPLE = 402,
Color_NOC_PURPLE1 = 403,
Color_NOC_PURPLE2 = 404,
Color_NOC_PURPLE3 = 405,
Color_NOC_PURPLE4 = 406,
Color_NOC_RED = 407,
Color_NOC_RED1 = 407,
Color_NOC_RED2 = 408,
Color_NOC_RED3 = 409,
Color_NOC_RED4 = 410,
Color_NOC_ROSYBROWN = 411,
Color_NOC_ROSYBROWN1 = 412,
Color_NOC_ROSYBROWN2 = 413,
Color_NOC_ROSYBROWN3 = 414,
Color_NOC_ROSYBROWN4 = 415,
Color_NOC_ROYALBLUE = 416,
Color_NOC_ROYALBLUE1 = 417,
Color_NOC_ROYALBLUE2 = 418,
Color_NOC_ROYALBLUE3 = 419,
Color_NOC_ROYALBLUE4 = 420,
Color_NOC_SADDLEBROWN = 421,
Color_NOC_SALMON = 422,
Color_NOC_SALMON1 = 423,
Color_NOC_SALMON2 = 424,
Color_NOC_SALMON3 = 425,
Color_NOC_SALMON4 = 426,
Color_NOC_SANDYBROWN = 427,
Color_NOC_SEAGREEN = 428,
Color_NOC_SEAGREEN1 = 429,
Color_NOC_SEAGREEN2 = 430,
Color_NOC_SEAGREEN3 = 431,
Color_NOC_SEAGREEN4 = 432,
Color_NOC_SEASHELL = 433,
Color_NOC_SEASHELL2 = 434,
Color_NOC_SEASHELL3 = 435,
Color_NOC_SEASHELL4 = 436,
Color_NOC_BEET = 437,
Color_NOC_TEAL = 438,
Color_NOC_SIENNA = 439,
Color_NOC_SIENNA1 = 440,
Color_NOC_SIENNA2 = 441,
Color_NOC_SIENNA3 = 442,
Color_NOC_SIENNA4 = 443,
Color_NOC_SKYBLUE = 444,
Color_NOC_SKYBLUE1 = 445,
Color_NOC_SKYBLUE2 = 446,
Color_NOC_SKYBLUE3 = 447,
Color_NOC_SKYBLUE4 = 448,
Color_NOC_SLATEBLUE = 449,
Color_NOC_SLATEBLUE1 = 450,
Color_NOC_SLATEBLUE2 = 451,
Color_NOC_SLATEBLUE3 = 452,
Color_NOC_SLATEBLUE4 = 453,
Color_NOC_SLATEGRAY1 = 454,
Color_NOC_SLATEGRAY2 = 455,
Color_NOC_SLATEGRAY3 = 456,
Color_NOC_SLATEGRAY4 = 457,
Color_NOC_SLATEGRAY = 458,
Color_NOC_SNOW = 459,
Color_NOC_SNOW2 = 460,
Color_NOC_SNOW3 = 461,
Color_NOC_SNOW4 = 462,
Color_NOC_SPRINGGREEN = 463,
Color_NOC_SPRINGGREEN2 = 464,
Color_NOC_SPRINGGREEN3 = 465,
Color_NOC_SPRINGGREEN4 = 466,
Color_NOC_STEELBLUE = 467,
Color_NOC_STEELBLUE1 = 468,
Color_NOC_STEELBLUE2 = 469,
Color_NOC_STEELBLUE3 = 470,
Color_NOC_STEELBLUE4 = 471,
Color_NOC_TAN = 472,
Color_NOC_TAN1 = 473,
Color_NOC_TAN2 = 474,
Color_NOC_TAN3 = 475,
Color_NOC_TAN4 = 476,
Color_NOC_THISTLE = 477,
Color_NOC_THISTLE1 = 478,
Color_NOC_THISTLE2 = 479,
Color_NOC_THISTLE3 = 480,
Color_NOC_THISTLE4 = 481,
Color_NOC_TOMATO = 482,
Color_NOC_TOMATO1 = 482,
Color_NOC_TOMATO2 = 483,
Color_NOC_TOMATO3 = 484,
Color_NOC_TOMATO4 = 485,
Color_NOC_TURQUOISE = 486,
Color_NOC_TURQUOISE1 = 487,
Color_NOC_TURQUOISE2 = 488,
Color_NOC_TURQUOISE3 = 489,
Color_NOC_TURQUOISE4 = 490,
Color_NOC_VIOLET = 491,
Color_NOC_VIOLETRED = 492,
Color_NOC_VIOLETRED1 = 493,
Color_NOC_VIOLETRED2 = 494,
Color_NOC_VIOLETRED3 = 495,
Color_NOC_VIOLETRED4 = 496,
Color_NOC_WHEAT = 497,
Color_NOC_WHEAT1 = 498,
Color_NOC_WHEAT2 = 499,
Color_NOC_WHEAT3 = 500,
Color_NOC_WHEAT4 = 501,
Color_NOC_WHITESMOKE = 502,
Color_NOC_YELLOW = 503,
Color_NOC_YELLOW1 = 503,
Color_NOC_YELLOW2 = 504,
Color_NOC_YELLOW3 = 505,
Color_NOC_YELLOW4 = 506,
Color_NOC_YELLOWGREEN = 507,
Color_NOC_WHITE = 508
}
enum MxTypeOfColor {
Color_TOC_RGB = 0,
Color_TOC_sRGB = 1,
Color_TOC_HLS = 2,
Color_TOC_CIELab = 3,
Color_TOC_CIELch = 4
}
enum MxDisplayMode {
DM_WireFrame = 0,
DM_Shaded = 1
}
enum MxTypeOfLightSource {
LightSource_TOLS_AMBIENT = 0,
LightSource_TOLS_DIRECTIONAL = 1,
LightSource_TOLS_POSITIONAL = 2,
LightSource_TOLS_SPOT = 3
}
enum MxCameraProjection {
CProjection_Orthographic = 0,
CProjection_Perspective = 1,
CProjection_Stereo = 2,
CProjection_MonoLeftEye = 3,
CProjection_MonoRightEye = 4
}
enum MxV3dTypeOfOrientation {
Orientation_Xpos = 0,
Orientation_Ypos = 1,
Orientation_Zpos = 2,
Orientation_Xneg = 3,
Orientation_Yneg = 4,
Orientation_Zneg = 5,
Orientation_XposYpos = 6,
Orientation_XposZpos = 7,
Orientation_YposZpos = 8,
Orientation_XnegYneg = 9,
Orientation_XnegYpos = 10,
Orientation_XnegZneg = 11,
Orientation_XnegZpos = 12,
Orientation_YnegZneg = 13,
Orientation_YnegZpos = 14,
Orientation_XposYneg = 15,
Orientation_XposZneg = 16,
Orientation_YposZneg = 17,
Orientation_XposYposZpos = 18,
Orientation_XposYnegZpos = 19,
Orientation_XposYposZneg = 20,
Orientation_XnegYposZpos = 21,
Orientation_XposYnegZneg = 22,
Orientation_XnegYposZneg = 23,
Orientation_XnegYnegZpos = 24,
Orientation_XnegYnegZneg = 25,
Orientation_TypeOfOrientation_Zup_AxoLeft = 24,
Orientation_TypeOfOrientation_Zup_AxoRight = 19,
Orientation_TypeOfOrientation_Zup_Front = 4,
Orientation_TypeOfOrientation_Zup_Back = 1,
Orientation_TypeOfOrientation_Zup_Top = 2,
Orientation_TypeOfOrientation_Zup_Bottom = 5,
Orientation_TypeOfOrientation_Zup_Left = 3,
Orientation_TypeOfOrientation_Zup_Right = 0,
Orientation_TypeOfOrientation_Yup_AxoLeft = 21,
Orientation_TypeOfOrientation_Yup_AxoRight = 18,
Orientation_TypeOfOrientation_Yup_Front = 2,
Orientation_TypeOfOrientation_Yup_Back = 5,
Orientation_TypeOfOrientation_Yup_Top = 1,
Orientation_TypeOfOrientation_Yup_Bottom = 4,
Orientation_TypeOfOrientation_Yup_Left = 0,
Orientation_TypeOfOrientation_Yup_Right = 3
}
enum MxTypeOfAngle {
Angle_TypeOfAngle_Interior = 0,
Angle_TypeOfAngle_Exterior = 1
}
enum MxTypeOfAngleArrowVisibility {
Visibility_TOAAV_Both = 0,
Visibility_TOAAV_First = 1,
Visibility_TOAAV_Second = 2,
Visibility_TOAAV_None = 3
}
enum MxTypeOfLine {
Line_TOL_EMPTY = -1,
Line_TOL_SOLID = 0,
Line_TOL_DASH = 1,
Line_TOL_DOT = 2,
Line_TOL_DOTDASH = 3,
Line_TOL_USERDEFINED = 4
}
enum MxTextPath {
TextPath_TP_UP = 0,
TextPath_TP_DOWN = 1,
TextPath_TP_LEFT = 2,
TextPath_TP_RIGHT = 3
}
enum MxDimensionArrowOrientation {
DimensionArrowOrientation_DAO_Internal = 0,
DimensionArrowOrientation_DAO_External = 1,
DimensionArrowOrientation_DAO_Fit = 2
}
enum MxDimensionTextVerticalPosition {
DimensionTextVerticalPosition_DTVP_Above = 0,
DimensionTextVerticalPosition_DTVP_Below = 1,
DimensionTextVerticalPosition_DTVP_Center = 2
}
enum MxDimensionTextHorizontalPosition {
DimensionTextHorizontalPosition_DTHP_Left = 0,
DimensionTextHorizontalPosition_DTHP_Right = 1,
DimensionTextHorizontalPosition_DTHP_Center = 2,
DimensionTextHorizontalPosition_DTHP_Fit = 3
}
enum MxKindOfDimension {
KindOfDimension_KOD_NONE = 0,
KindOfDimension_KOD_LENGTH = 1,
KindOfDimension_KOD_PLANEANGLE = 2,
KindOfDimension_KOD_SOLIDANGLE = 3,
KindOfDimension_KOD_AREA = 4,
KindOfDimension_KOD_VOLUME = 5,
KindOfDimension_KOD_MASS = 6,
KindOfDimension_KOD_TIME = 7,
KindOfDimension_KOD_RADIUS = 8,
KindOfDimension_KOD_DIAMETER = 9,
KindOfDimension_KOD_CHAMF2D = 10,
KindOfDimension_KOD_CHAMF3D = 11,
KindOfDimension_KOD_OFFSET = 12,
KindOfDimension_KOD_ELLIPSERADIUS = 13
}
enum MxDocColorType {
DocColor_ColorGen = 0,
DocColor_ColorSurf = 1,
DocColor_ColorCurv = 2
}
enum MxKindOfInteractive {
KindOfInteractive_None = 0,
KindOfInteractive_Datum = 1,
KindOfInteractive_Shape = 2,
KindOfInteractive_Object = 3,
KindOfInteractive_Relation = 4,
KindOfInteractive_Dimension = 5,
KindOfInteractive_LightSource = 6,
KOI_None = 0,
KOI_Datum = 1,
KOI_Shape = 2,
KOI_Object = 3,
KOI_Relation = 4,
KOI_Dimension = 5
}
enum MxPrs3dTypeOfHLR {
TOH_NotSet = 0,
TOH_PolyAlgo = 1,
TOH_Algo = 2
}
enum MxDisplayStatus {
DisplayStatus_Displayed = 0,
DisplayStatus_Erased = 1,
DisplayStatus_None = 2,
DS_Displayed = 0,
DS_Erased = 1,
DS_None = 2
}
enum MxGlobalDisplayMode {
DisplayMode_Wireframe = 0,
DisplayMode_HiddenLineRemoval = 1,
DisplayMode_Shaded = 2,
DisplayMode_ShadedWithFaceBoundary = 3,
DisplayMode_Transparency = 4
}
enum MxGradientFillMethod {
GradientFillMethod_None = 0,
GradientFillMethod_Horizontal = 1,
GradientFillMethod_Vertical = 2,
GradientFillMethod_Diagonal1 = 3,
GradientFillMethod_Diagonal2 = 4,
GradientFillMethod_Corner1 = 5,
GradientFillMethod_Corner2 = 6,
GradientFillMethod_Corner3 = 7,
GradientFillMethod_Corner4 = 8,
GradientFillMethod_Elliptical = 9,
GFM_NONE = 0,
GFM_HOR = 1,
GFM_VER = 2,
GFM_DIAG1 = 3,
GFM_DIAG2 = 4,
GFM_CORNER1 = 5,
GFM_CORNER2 = 6,
GFM_CORNER3 = 7,
GFM_CORNER4 = 8
}
enum MxFormat {
Format_Unknown = 0,
Format_Image = 1,
Format_3DS = 2,
Format_3MF = 3,
Format_AMF = 4,
Format_COLLADA = 5,
Format_DXF = 6,
Format_FBX = 7,
Format_GLTF = 8,
Format_IGES = 9,
Format_OBJ = 10,
Format_OCCBREP = 11,
Format_OFF = 12,
Format_PLY = 13,
Format_STEP = 14,
Format_STL = 15,
Format_VRML = 16,
Format_X3D = 17,
Format_Blender = 18
}
enum MxQuantAspect {
Quant_Length = 0,
Quant_Area = 1,
Quant_Volume = 2
}
enum MxOrientation {
Orientation_FORWARD = 0,
Orientation_REVERSED = 1,
Orientation_INTERNAL = 2,
Orientation_EXTERNAL = 3
}
}
export type EventType = string | symbol;
export type PubSubEvent = Record<EventType, (...ages: any) => any>;
declare class PubSub<Events extends PubSubEvent = PubSubEvent> {
events: {
[x: EventType]: Events[keyof Events][];
};
constructor();
/**
*
* @param event
* @param callback
*/
on<Key extends keyof Events>(event: Key, callback: Events[keyof Events]): void;
/**
*
* @param event
* @param data
*/
emit<Key extends keyof Events>(event: Key | number, ...data: Parameters<Events[Key]>): void;
/**
*
* @param event
* @param callback
*/
off<Key extends keyof Events>(event: Key, callback?: Events[keyof Events]): void;
}
declare class MxApp3DType extends PubSub<{
eventModesSelected: (ids: number[]) => void;
eventAddToTree: (node: string) => void;
eventRemoveFromTree: (ids: number[]) => void;
eventFileSave: (fileName: string) => void;
eventRebuildTree: (tree_str: string) => void;
eventUpdatePointer: (pointer: number[]) => void;
eventUpdateViewSize: (pointer: number[]) => void;
eventUpdateAttribute: (attrStr: string) => void;
}> {
/**
* @internal
*/
init(imp: any): void;
/**
* @internal
*/
imp?: any;
/**
* @internal
*/
cpp_app: any;
/**
* @internal
*/
tool: any;
/**
* @internal
*/
globalMethods: any;
/**
*
* @param theCanvasSelector canvas的CSS选择器字符串
* @returns
*/
createView(theCanvasSelector: string): Mx3dView;
/**
*
* @returns
*/
getCurrentActiveView(): Mx3dView;
}
/**
*
*/
export declare const MxApp3D: MxApp3DType;
export interface MxCAD3DConfig {
[x: string]: any;
canvas: string | HTMLCanvasElement;
/** canvas最小宽度 默认300 */
minWidth?: number;
/** canvas最小高度 默认300 */
minHeight?: number;
/** 指定更新Canvas大小的函数,不指定则默认自动处理(指定该函数则 minHeight, minWidth无效) */
updateCanvasSize?: () => void;
locateFile?: (fileName: string, base?: string | URL) => string;
}
/**
*
* Canvas视图和一个文档
*/
export declare class MxCAD3DObject {
/**
* @internal
*/
private event;
/**
* @internal
*/
private imp;
/**
* @internal
*/
private canvas;
/**
* @internal
*/
private ctx;
/**
* @internal
*/
private updateCanvasSizeFun;
constructor();
/**
*
* @returns
*/
getDocument(): Mx3dDbDocument;
/**
*
* @param theUpdateView
*/
removeAll(theUpdateView?: boolean): void;
/**
*
*/
removeSelected(): void;
/**
*
* @param isUpAllData
* @param isRemoveAll
*/
update(isUpAllData?: boolean, isRemoveAll?: boolean): void;
/**
*
* @param theProjection
*/
setProjectionType(theProjection: MdGe.MxCameraProjection): void;
/**
*
* @param theToShow true显示false不显示
*/
showCenterTrihedron(theToShow: boolean): void;
/**
*
* @param theAuto
*/
fitAllObjects(theAuto: boolean): void;
/**
* /X轴剖切面
* @param theToEnabled X轴剖切面
*/
enableXClipPlane(theToEnabled: boolean): void;
/**
* X轴剖切面的位置
* @param thePosition
*/
setXClipPlaneXPosition(thePosition: number): void;
/**
* X轴剖切面
*/
setXClipPlaneReverse(): void;
/**
* /Y轴剖切面
* @param theToEnabled Y轴剖切面
*/
enableYClipPlane(theToEnabled: boolean): void;
/**
* Y轴剖切面的位置
* @param thePosition
*/
setYClipPlaneYPosition(thePosition: number): void;
/**
* Y轴剖切面
*/
setYClipPlaneReverse(): void;
/**
* /Z轴剖切面
* @param theToEnabled Z轴剖切面
*/
enableZClipPlane(theToEnabled: boolean): void;
/**
* Z轴剖切面的位置
* @param thePosition
*/
setZClipPlaneZPosition(thePosition: number): void;
/**
* Z轴剖切面
*/
setZClipPlaneReverse(): void;
/**
* /
* @param theToEnabled
*/
enableCustomClipPlane(theToEnabled: boolean): void;
/**
*
* @param thePosition
*/
setCustomClipPlanePosition(thePosition: number): void;
/**
*
*/
setCustomClipPlaneReverse(): void;
/**
*
* @param x x分量
* @param y y分量
* @param z z分量
*/
setCustomClipPlaneDirection(x: number, y: number, z: number): void;
/**
*
* @param theSymbol
*/
displaySymbolText(theSymbol: Mx3dSymbolText): void;
/**
*
* @param theDimension
*/
displayDimension(theDimension: Mx3dDimObject): void;
/**
*
* @param theFileName
*/
addModelTexture(theFileName: string): void;
/**
*
*/
removeModelTexture(): void;
/**
*
* @param theColor1 1
* @param theColor2 2
* @param theMethod
*/
setGradientBgColor(theColor1: Mx3dGeColor, theColor2: Mx3dGeColor, theMethod: MdGe.MxGradientFillMethod): void;
/**
*
* @param theOrientation
* @param theIsYup Y轴向上
*/
setProj(theOrientation: MdGe.MxV3dTypeOfOrientation, theIsYup: boolean): void;
/**
*
* @param color
*/
setSelectedColor(color: Mx3dGeColor): void;
/**
*
* @param material
*/
setSelectedMaterial(material: Mx3dGeMaterial): void;
/**
*
* @param theMode
*/
setDisplayMode(theMode: MdGe.MxGlobalDisplayMode): void;
enableDirLightSrc(theToEnabled: boolean): void;
setCubemapBackground(theRight: string, theLeft: string, theTop: string, theBottom: string, theFront: string, theBack: string): void;
getImp(): any;
getCtx(): any;
updateCanvasSize(): void;
init(imp: any): void;
on(name: "init", fun: () => void): void;
off(name: string, fun?: Function): void;
callEvent(sEventName: string, param?: any): boolean;
/**
*
* @param config canvas可以是选择器字符串canvas对象
*/
create(config: MxCAD3DConfig): void;
}
export type Vector = [
theX: number,
theY: number,
theZ: number
];
/**
*
*/
export type UniPoint = Mx3dGePoint | Vector;
/**
*
*/
export type UniDir = Mx3dGeDir | Vector;
/**
*
*/
export type UniVec = Mx3dGeVec | Vector;
/**
*
*/
export declare class Mx3dApplication {
/**
* @internal
*/
protected imp: any;
/**
* @internal
*/
constructor();
/**
*
* @param theCanvasSelector canvas的CSS选择器字符串
* @returns
*/
createView(theCanvasSelector: string): Mx3dView;
/**
*
* @returns
*/
getCurrentActiveView(): Mx3dView;
}
/**
*
*/
export declare class Mx3dBaseObject {
/**
* @internal
*/
protected imp: any;
/**
* @internal
*/
constructor(imp?: any);
/**
* @internal
*/
getImp(): any;
/**
* @internal
*/
protected initTempObject(imp: any): void;
}
/**
*
*/
export declare class Mx3dDimObject extends Mx3dBaseObject {
/**
* @internal
*/
constructor(p?: object);
}
/**
*
*/
export declare class Mx3dSymbolObject extends Mx3dBaseObject {
/**
* @internal
*/
constructor(p?: object);
}
/**
*
*/
export declare class Mx3dAlgoObject extends Mx3dBaseObject {
/**
* @internal
*/
constructor(p?: object);
}
/**
*
*/
export declare class Mx3dAspectObject extends Mx3dBaseObject {
/**
* @internal
*/
constructor(p?: object);
}
/**
*
*/
export declare class Mx3dGeObject extends Mx3dBaseObject {
/**
* @internal
*/
constructor(p?: object);
}
/**
* 线
*/
export declare class Mx3dGeCurve extends Mx3dGeObject {
/**
* @internal
*/
constructor(p?: object);
}
/**
* 线
*/
export declare class Mx3dGeConic extends Mx3dGeCurve {
/**
* @internal
*/
constructor(p?: object);
}
/**
*
*
*
*/
export declare class Mx3dGePoint extends Mx3dGeObject {
/**
* (0, 0, 0)
*/
constructor();
/**
* 使
*
* @param theXYZ - X, Y, Z坐标值的数组
*/
constructor(theXYZ: Vector);
/**
* 使X, Y, Z坐标值构造一个点
*
* @param theX - X坐标值
* @param theY - Y坐标值
* @param theZ - Z坐标值
*/
constructor(theX: number, theY: number, theZ: number);
/**
* X坐标值
* @returns X坐标值
*/
X(): number;
/**
* Y坐标值
* @returns Y坐标值
*/
Y(): number;
/**
* Z坐标值
* @returns Z坐标值
*/
Z(): number;
/**
* X坐标值
* @param theX X坐标值
*/
setX(theX: number): void;
/**
* Y坐标值
* @param theY Y坐标值
*/
setY(theY: number): void;
/**
* Z坐标值
* @param theZ Z坐标值
*/
setZ(theZ: number): void;
/**
* X,Y,Z坐标值
* @param theX X坐标值
* @param theY Y坐标值
* @param theZ Z坐标值
*/
setXYZ(theX: number, theY: number, theZ: number): void;
/**
*
* @returns
*/
Vertex(): Mx3dShapeVertex;
}
/**
*
*/
export declare class Mx3dGeTrsf extends Mx3dGeObject {
constructor();
/**
*
* @param point
*/
SetMirrorByPoint(point: UniPoint): void;
/**
*
* @param axis
*/
SetMirrorByAxis(axis: Mx3dGeAxis): void;
/**
* XOY平面
* @param csysr
*/
SetMirrorByCSYSR(csysr: Mx3dGeCSYSR): void;
/**
*
* @param axis
* @param ang
*/
SetRotation(axis: Mx3dGeAxis, ang: number): void;
/**
*
* @param point
* @param s
*/
SetScale(point: UniPoint, s: number): void;
/**
*
* @param vec
*/
SetTranslationByVec(vec: UniVec): void;
/**
*
* @param point1
* @param point2
*/
SetTranslationBy2Points(point1: UniPoint, point2: UniPoint): void;
/**
*
* @param vec
*/
SetTranslationPart(vec: Mx3dGeVec): void;
/**
*
* @param s
*/
SetScaleFactor(s: number): void;
/**
* 仿
* @param a11 11
* @param a12 12
* @param a13 13
* @param a14 14
* @param a21 21
* @param a22 22
* @param a23 23
* @param a24 24
* @param a31 31
* @param a32 32
* @param a33 33
* @param a34 34
*/
SetValues(a11: number, a12: number, a13: number, a14: number, a21: number, a22: number, a23: number, a24: number, a31: number, a32: number, a33: number, a34: number): void;
/**
*
* @returns
*/
IsNegative(): boolean;
/**
*
* @returns
*/
ScaleFactor(): number;
/**
*
* @param row
* @param col
* @returns
*/
Value(row: number, col: number): number;
/**
*
*/
Invert(): void;
/**
*
* @returns
*/
Inverted(): Mx3dGeTrsf;
/**
* [res] = [me] * t[res][me]t是另外的变换矩阵
* @param t
* @returns
*/
Multiplied(t: Mx3dGeTrsf): Mx3dGeTrsf;
/**
* [me] = [me] * t[me]t是另外的变换矩阵
* @param t
*/
Multiply(t: Mx3dGeTrsf): void;
/**
* [me] = t * [me][me]t是另外的变换矩阵
* @param t
*/
PreMultiply(t: Mx3dGeTrsf): void;
/**
* n幂次方运算[me] * [me] * .......* [me][me]n次
* @param n
*/
Power(n: number): void;
/**
* n次幂方运算后的结果[res] = [me] * [me] * .......* [me][res][me]n个[me]
* @param n
* @returns n幂次方的结果
*/
Powered(n: number): Mx3dGeTrsf;
/**
*
* @param x
* @param y
* @param z
*/
Transforms(x: number, y: number, z: number): void;
}
/**
*
*/
export declare class Mx3dGeAxis extends Mx3dGeObject {
/**
*
*/
constructor();
/**
*
* @param theLoc
* @param theDir
*/
constructor(theLoc: UniPoint, theDir: UniDir);
/**
*
* @returns
*/
Direction(): Mx3dGeDir;
/**
*
* @returns
*/
Location(): Mx3dGePoint;
/**
*
* @param theDir
*/
SetDirection(theDir: Mx3dGeDir): void;
/**
*
* @param theLoc
*/
SetLocation(theLoc: UniPoint): void;
}
/**
* 1
*/
export declare class Mx3dGeDir extends Mx3dGeObject {
/**
*
*/
constructor();
/**
*
* @param theXv X方向
* @param theYv Y方向
* @param theZv Z方向
*/
constructor(theXv: number, theYv: number, theZv: number);
/**
* X方向的大小
* @returns X方向的大小
*/
X(): number;
/**
* Y方向的大小
* @returns Y方向的大小
*/
Y(): number;
/**
* Z方向的大小
* @returns Z方向的大小
*/
Z(): number;
/**
* X方向的大小
* @param theX X方向的大小
*/
SetX(theX: number): void;
/**
* Y方向的大小
* @param theY Y方向的大小
*/
SetY(theY: number): void;
/**
* Z方向的大小
* @param theZ Z方向的大小
*/
SetZ(theZ: number): void;
/**
* X,Y,Z方向的大小
* @param theXv X方向的大小
* @param theYv Y方向的大小
* @param theZv Z方向的大小
*/
SetXYZ(theXv: number, theYv: number, theZv: number): void;
/**
*
* @param theOther
* @param theAngularTolerance
* @returns
*/
IsEqual(theOther: Mx3dGeDir, theAngularTolerance: number): boolean;
/**
*
* @param theOther
* @param theAngularTolerance
* @returns
*/
IsNormal(theOther: Mx3dGeDir, theAngularTolerance: number): boolean;
/**
*
* @param theOther
* @param theAngularTolerance
* @returns
*/
IsOpposite(theOther: Mx3dGeDir, theAngularTolerance: number): boolean;
/**
*
* @param theOther
* @param theAngularTolerance
* @returns
*/
IsParallel(theOther: Mx3dGeDir, theAngularTolerance: number): boolean;
/**
* [0,PI]
* @param theOther
* @returns
*/
Angle(theOther: Mx3dGeDir): number;
/**
*
* @param theOther
* @param theVRef
* @returns
*/
AngleWithRef(theOther: Mx3dGeDir, theVRef: Mx3dGeDir): number;
/**
* [me] = [me] ^ theRight[me]^
* @param theRight
*/
Cross(theRight: Mx3dGeDir): void;
/**
* [res] = [me] ^ theRight[me][res]^
* @param theRight
* @returns
*/
Crossed(theRight: Mx3dGeDir): Mx3dGeDir;
/**
* [me] ^ (theV1 ^ theV2)[me]^
* @param theV1
* @param theV2
*/
CrossCross(theV1: Mx3dGeDir, theV2: Mx3dGeDir): void;
/**
* [res] ^ (theV1 ^ theV2)[me][res]^
* @param theV1
* @param theV2
* @returns
*/
CrossCrossed(theV1: Mx3dGeDir, theV2: Mx3dGeDir): Mx3dGeDir;
/**
* [res] = [me] * theOther[me][res]*
* @param theOther
* @returns
*/
Dot(theOther: Mx3dGeDir): number;
/**
* [res] = [me] * (theV1 ^ theV2)[me][res]^*
* @param theV1
* @param theV2
* @returns
*/
DotCross(theV1: Mx3dGeDir, theV2: Mx3dGeDir): number;
/**
*
*/
Reverse(): void;
/**
*
* @returns
*/
Reversed(): Mx3dGeDir;
/**
*
* @param theV
*/
MirrorByVec(theV: Mx3dGeDir): void;
MirroredByVec(theV: Mx3dGeDir): Mx3dGeDir;
MirrorByAxis(theA1: Mx3dGeAxis): void;
MirroredByAxis(theA1: Mx3dGeAxis): Mx3dGeDir;
MirrorByCSYSR(theA2: Mx3dGeCSYSR): void;
MirroredByCSYSR(theA2: Mx3dGeCSYSR): Mx3dGeDir;
Rotate(theA1: Mx3dGeAxis, theAng: number): void;
Rotated(theA1: Mx3dGeAxis, theAng: number): Mx3dGeDir;
Transform(theT: Mx3dGeTrsf): void;
Transformed(theT: Mx3dGeTrsf): Mx3dGeDir;
}
/**
* Mx3dGeObject类
* 访
*/
export declare class Mx3dGeEllipse extends Mx3dGeObject {
/**
*
*/
constructor();
/**
*
* @param theA2
* @param theMajorRadius
* @param theMinorRadius
*/
constructor(theA2: Mx3dGeCSYSR, theMajorRadius: number, theMinorRadius: number);
/**
*
* @param theA1
*/
SetAxis(theA1: Mx3dGeAxis): void;
/**
*
* @param theP
*/
SetLocation(theP: Mx3dGePoint): void;
/**
*
* @param theMajorRadius
*/
SetMajorRadius(theMajorRadius: number): void;
/**
*
* @param theMinorRadius
*/
SetMinorRadius(theMinorRadius: number): void;
/**
*
* @param theA2
*/
SetPosition(theA2: Mx3dGeCSYSR): void;
/**
*
* @returns
*/
Area(): number;
/**
*
* @returns
*/
Axis(): Mx3dGeAxis;
/**
* 线线
* @returns 线1
*/
Directrix1(): Mx3dGeAxis;
/**
* 线线
* @returns 线2
*/
Directrix2(): Mx3dGeAxis;
/**
*
* @returns
*/
Eccentricity(): number;
/**
*
* @returns
*/
Focal(): number;
/**
*
* @returns
*/
Focus1(): Mx3dGePoint;
/**
*
* @returns
*/
Focus2(): Mx3dGePoint;
/**
*
* @returns
*/
Location(): Mx3dGePoint;
/**
*
* @returns
*/
MajorRadius(): number;
/**
*
* @returns
*/
MinorRadius(): number;
/**
*
* @returns
*/
Parameter(): number;
/**
*
* @returns
*/
Position(): Mx3dGeCSYSR;
/**
* 沿
* @returns
*/
XAxis(): Mx3dGeAxis;
/**
* 沿
* @returns
*/
YAxis(): Mx3dGeAxis;
/**
*
* @param theP
*/
MirrorByPoint(theP: Mx3dGePoint): void;
/**
* 沿
* @param theP
* @returns
*/
MirroredByPoint(theP: Mx3dGePoint): Mx3dGeEllipse;
/**
*
* @param theA1
*/
MirrorByAxis(theA1: Mx3dGeAxis): void;
/**
* 沿
* @param theA1
* @returns
*/
MirroredByAxis(theA1: Mx3dGeAxis): Mx3dGeEllipse;
/**
*
* @param theA2
*/
MirrorByCSYSR(theA2: Mx3dGeCSYSR): void;
/**
* 沿
* @param theA2
* @returns
*/
MirroredByCSYSR(theA2: Mx3dGeCSYSR): Mx3dGeEllipse;
/**
*
* @param theA1
* @param theAng
*/
Rotate(theA1: Mx3dGeAxis, theAng: number): void;
/**
*
* @param theA1
* @param theAng
* @returns
*/
Rotated(theA1: Mx3dGeAxis, theAng: number): Mx3dGeEllipse;
/**
*
* @param theP
* @param theS
*/
Scale(theP: Mx3dGePoint, theS: number): void;
/**
*
* @param theP
* @param theS
* @returns
*/
Scaled(theP: Mx3dGePoint, theS: number): Mx3dGeEllipse;
/**
*
* @param theT
*/
Transform(theT: Mx3dGeTrsf): void;
/**
*
* @param theT
* @returns
*/
Transformed(theT: Mx3dGeTrsf): Mx3dGeEllipse;
/**
* 沿沿
* @param theV
*/
TranslateByVec(theV: Mx3dGeVec): void;
/**
*
* @param theV
* @returns
*/
TranslatedByVec(theV: Mx3dGeVec): Mx3dGeEllipse;
/**
*
* @param theP1
* @param theP2
*/
TranslateBy2Points(theP1: Mx3dGePoint, theP2: Mx3dGePoint): void;
/**
*
* @param theP1
* @param theP2
* @returns
*/
TranslatedBy2Points(theP1: Mx3dGePoint, theP2: Mx3dGePoint): Mx3dGeEllipse;
}
/**
* 线
* 线
*/
export declare class Mx3dGeHyperbola extends Mx3dGeObject {
/**
* 线
*/
constructor();
/**
* Mx3dGeCSYSR线
* 线
* - 线
* - "X方向"线
* - "Y方向"线
* @param theA2 线
* @param theMajorRadius 线
* @param theMinorRadius 线
*/
constructor(theA2: Mx3dGeCSYSR, theMajorRadius: number, theMinorRadius: number);
/**
* 线
* @param theA1
*/
SetAxis(theA1: Mx3dGeAxis): void;
/**
* 线
* @param theP
*/
SetLocation(theP: Mx3dGePoint): void;
/**
* 线
* @param theMajorRadius
*/
SetMajorRadius(theMajorRadius: number): void;
/**
* 线
* @param theMinorRadius
*/
SetMinorRadius(theMinorRadius: number): void;
/**
* 线
* @param theA2
*/
SetPosition(theA2: Mx3dGeCSYSR): void;
/**
* 线
* @returns 线
*/
Asymptote1(): Mx3dGeAxis;
/**
*
* @returns 线
*/
Asymptote2(): Mx3dGeAxis;
/**
* 线线
* @returns 线线
*/
Axis(): Mx3dGeAxis;
/**
* 1
* @returns 线1
*/
ConjugateBranch1(): Mx3dGeHyperbola;
/**
* 2
* @returns 线2
*/
ConjugateBranch2(): Mx3dGeHyperbola;
/**
* 线1
* @returns 线线1
*/
Directrix1(): Mx3dGeAxis;
/**
* 线2
* @returns 线线2
*/
Directrix2(): Mx3dGeAxis;
/**
*
* @returns 线
*/
Eccentricity(): number;
/**
*
* @returns 线
*/
Focal(): number;
/**
* 1
* @returns 线
*/
Focus1(): Mx3dGePoint;
/**
* 2
* @returns 线
*/
Focus2(): Mx3dGePoint;
/**
* 线
* @returns
*/
Location(): Mx3dGePoint;
/**
* 线
* @returns number线
*/
MajorRadius(): number;
/**
* 线
* @returns number线
*/
MinorRadius(): number;
/**
* 线
* @returns
*/
OtherBranch(): Mx3dGeHyperbola;
/**
* 线
* @returns number线
*/
Parameter(): number;
/**
* 线
* @returns
*/
Position(): Mx3dGeCSYSR;
/**
* X轴线
* @returns X轴
*/
XAxis(): Mx3dGeAxis;
/**
* Y轴线
* @returns Y轴
*/
YAxis(): Mx3dGeAxis;
/**
* 线
* @param theP Mx3dGePoint
*/
MirrorByPoint(theP: Mx3dGePoint): void;
/**
* 线
* @param theP (Mx3dGePoint)
* @returns 线 (Mx3dGeHyperbola)
*/
MirroredByPoint(theP: Mx3dGePoint): Mx3dGeHyperbola;
/**
* 线
* @param theA1 (Mx3dGeAxis)
*/
MirrorByAxis(theA1: Mx3dGeAxis): void;
/**
* 线
* @param theA1 (Mx3dGeAxis)
* @returns 线 (Mx3dGeHyperbola)
*/
MirroredByAxis(theA1: Mx3dGeAxis): Mx3dGeHyperbola;
/**
* 线
* @param theA2 (Mx3dGeCSYSR)
*/
MirrorByCSYSR(theA2: Mx3dGeCSYSR): void;
/**
* 线
* @param theA2 (Mx3dGeCSYSR)
* @returns 线 (Mx3dGeHyperbola)
*/
MirroredByCSYSR(theA2: Mx3dGeCSYSR): Mx3dGeHyperbola;
/**
* 线
* @param theA1 (Mx3dGeAxis)
* @param theAng
*/
Rotate(theA1: Mx3dGeAxis, theAng: number): void;
/**
* 线
* @param theA1 (Mx3dGeAxis)
* @param theAng
* @returns 线 (Mx3dGeHyperbola)
*/
Rotated(theA1: Mx3dGeAxis, theAng: number): Mx3dGeHyperbola;
/**
* 线
* @param theP (Mx3dGePoint)
* @param theS
*/
Scale(theP: Mx3dGePoint, theS: number): void;
/**
* 线
* @param theP (Mx3dGePoint)
* @param theS
* @returns 线 (Mx3dGeHyperbola)
*/
Scaled(theP: Mx3dGePoint, theS: number): Mx3dGeHyperbola;
/**
* 线
* @param theTrsf (Mx3dGeTrsf)
*/
Transform(theT: Mx3dGeTrsf): void;
/**
* 线
* @param theTrsf (Mx3dGeTrsf)
* @returns 线 (Mx3dGeHyperbola)
*/
Transformed(theT: Mx3dGeTrsf): Mx3dGeHyperbola;
/**
* 线
* @param theV (Mx3dGeVector)
*/
TranslateByVec(theV: Mx3dGeVec): void;
/**
* 线
* @param theV (Mx3dGeVector)
* @returns 线 (Mx3dGeHyperbola)
*/
TranslatedByVec(theV: Mx3dGeVec): Mx3dGeHyperbola;
/**
* 线
* @param theP1 (Mx3dGePoint)
* @param theP2 (Mx3dGePoint)
*/
TranslateBy2Points(theP1: Mx3dGePoint, theP2: Mx3dGePoint): void;
/**
* 线
* @param theP1 (Mx3dGePoint)
* @param theP2 (Mx3dGePoint)
* @returns 线 (Mx3dGeHyperbola)
*/
TranslatedBy2Points(theP1: Mx3dGePoint, theP2: Mx3dGePoint): Mx3dGeHyperbola;
}
/**
*
*/
export declare class Mx3dGeVec extends Mx3dGeObject {
/**
* Mx3dGeVec
*
* @param x x
* @param y y
* @param z z
* @param thePoint1
* @param thePoint2
*/
constructor();
constructor(x: number, y: number, z: number);
constructor(thePoint1: Mx3dGePoint, thePoint2: Mx3dGePoint);
/**
* x
* @returns x
*/
X(): number;
/**
* y
* @returns y
*/
Y(): number;
/**
* z
* @returns z
*/
Z(): number;
/**
* x
* @param x x
*/
SetX(x: number): void;
/**
* y
* @param y y
*/
SetY(y: number): void;
/**
* z
* @param z z
*/
SetZ(z: number): void;
/**
* x, y z
* @param x x
* @param y y
* @param z z
*/
SetXYZ(x: number, y: number, z: number): void;
/**
*
* @param other
* @param linearTolerance 线
* @param angularTolerance
* @returns
*/
IsEqual(other: Mx3dGeVec, linearTolerance: number, angularTolerance: number): boolean;
/**
*
* @param other
* @param angularTolerance
* @returns
*/
IsNormal(other: Mx3dGeVec, angularTolerance: number): boolean;
/**
*
* @param other
* @param angularTolerance
* @returns
*/
IsOpposite(other: Mx3dGeVec, angularTolerance: number): boolean;
/**
*
* @param other
* @param angularTolerance
* @returns
*/
IsParallel(other: Mx3dGeVec, angularTolerance: number): boolean;
/**
*
* @param other
* @returns
*/
Angle(other: Mx3dGeVec): number;
/**
*
* @param other
* @param ref
* @returns
*/
AngleWithRef(other: Mx3dGeVec, ref: Mx3dGeVec): number;
/**
*
* @returns
*/
Magnitude(): number;
/**
*
* @returns
*/
SquareMagnitude(): number;
/**
*
* @param other
*/
Add(other: Mx3dGeVec): void;
/**
*
* @param other
* @returns
*/
Added(other: Mx3dGeVec): Mx3dGeVec;
/**
*
* @param right
*/
Subtract(right: Mx3dGeVec): void;
/**
*
* @param right
* @returns
*/
Subtracted(right: Mx3dGeVec): Mx3dGeVec;
/**
*
* @param scalar
*/
Multiply(scalar: number): void;
/**
*
* @param scalar
* @returns
*/
Multiplied(scalar: number): Mx3dGeVec;
/**
*
* @param scalar
*/
Divide(scalar: number): void;
/**
*
* @param scalar
* @returns
*/
Divided(scalar: number): Mx3dGeVec;
/**
*
* @param right
*/
Cross(right: Mx3dGeVec): void;
/**
*
* @param right
* @returns
*/
Crossed(right: Mx3dGeVec): Mx3dGeVec;
/**
*
* @param right
* @returns
*/
CrossMagnitude(right: Mx3dGeVec): number;
/**
*
* @param right
* @returns
*/
CrossSquareMagnitude(right: Mx3dGeVec): number;
/**
*
* @param v1 1
* @param v2 2
*/
CrossCross(v1: Mx3dGeVec, v2: Mx3dGeVec): void;
/**
*
* @param v1 1
* @param v2 2
* @returns
*/
CrossCrossed(v1: Mx3dGeVec, v2: Mx3dGeVec): Mx3dGeVec;
/**
*
* @param other
* @returns
*/
Dot(other: Mx3dGeVec): number;
/**
* -
* @param v1 1
* @param v2 2
* @returns -
*/
DotCross(v1: Mx3dGeVec, v2: Mx3dGeVec): number;
/**
*
*/
Normalize(): void;
/**
*
* @returns
*/
Normalized(): Mx3dGeVec;
/**
*
*/
Reverse(): void;
/**
*
* @returns
*/
Reversed(): Mx3dGeVec;
/**
* 线
* @param v1 1
* @param v2 2
*/
SetLinearForm(v1: Mx3dGeVec, v2: Mx3dGeVec): void;
SetLinearForm(a1: number, v1: Mx3dGeVec, v2: Mx3dGeVec): void;
SetLinearForm(a1: number, v1: Mx3dGeVec, a2: number, v2: Mx3dGeVec): void;
SetLinearForm(a1: number, v1: Mx3dGeVec, a2: number, v2: Mx3dGeVec, v3: Mx3dGeVec): void;
SetLinearForm(a1: number, v1: Mx3dGeVec, a2: number, v2: Mx3dGeVec, a3: number, v3: Mx3dGeVec): void;
SetLinearForm(a1: number, v1: Mx3dGeVec, a2: number, v2: Mx3dGeVec, a3: number, v3: Mx3dGeVec, v4: Mx3dGeVec): void;
/**
*
* @param vec
*/
MirrorByVec(vec: Mx3dGeVec): void;
/**
*
* @param vec
* @returns
*/
MirroredByVec(vec: Mx3dGeVec): Mx3dGeVec;
/**
*
* @param axis
*/
MirrorByAxis(axis: Mx3dGeAxis): void;
/**
*
* @param axis
* @returns
*/
MirroredByAxis(axis: Mx3dGeAxis): Mx3dGeVec;
/**
*
* @param csysr
*/
MirrorByCSYSR(csysr: Mx3dGeCSYSR): void;
/**
*
* @param csysr
* @returns
*/
MirroredByCSYSR(csysr: Mx3dGeCSYSR): Mx3dGeVec;
/**
*
* @param axis
* @param ang
*/
Rotate(axis: Mx3dGeAxis, ang: number): void;
/**
*
* @param axis
* @param ang
* @returns
*/
Rotated(axis: Mx3dGeAxis, ang: number): Mx3dGeVec;
/**
*
* @param s
*/
Scale(s: number): void;
/**
*
* @param s
* @returns
*/
Scaled(s: number): Mx3dGeVec;
/**
*
* @param csysr
*/
Transform(t: Mx3dGeTrsf): void;
/**
*
* @param csysr
* @returns
*/
Transformed(t: Mx3dGeTrsf): Mx3dGeVec;
}
/**
*
*
*
*
*/
export declare class Mx3dGeBndBox extends Mx3dGeObject {
/**
*
*/
constructor();
/**
* 使
*
* @param theMin -
* @param theMax -
*/
constructor(theMin: Mx3dGePoint, theMax: Mx3dGePoint);
/**
*
*/
SetWhole(): void;
/**
*
*/
SetVoid(): void;
/**
*
*
* @param P -
* @param D -
*/
Set(P: Mx3dGePoint, D: Mx3dGeDir): void;
Update(aXmin: number, aYmin: number, aZmin: number, aXmax: number, aYmax: number, aZmax: number): void;
GetGap(): number;
SetGap(Tol: number): void;
Enlarge(Tol: number): void;
CornerMin(): Mx3dGePoint;
CornerMax(): Mx3dGePoint;
OpenXmin(): void;
OpenXmax(): void;
OpenYmin(): void;
OpenYmax(): void;
OpenZmin(): void;
OpenZmax(): void;
IsOpen(): boolean;
IsOpenXmin(): boolean;
IsOpenXmax(): boolean;
IsOpenYmin(): boolean;
IsOpenYmax(): boolean;
IsOpenZmin(): boolean;
IsOpenZmax(): boolean;
IsWhole(): boolean;
IsVoid(): boolean;
IsXThin(tol: number): boolean;
IsYThin(tol: number): boolean;
IsZThin(tol: number): boolean;
IsThin(tol: number): boolean;
Transformed(T: Mx3dGeTrsf): Mx3dGeBndBox;
AddBndBox(Other: Mx3dGeBndBox): void;
AddPoint(P: Mx3dGePoint): void;
AddPointDir(P: Mx3dGePoint, D: Mx3dGeDir): void;
AddDir(D: Mx3dGeDir): void;
IsOutPoint(P: Mx3dGePoint): boolean;
IsOutBndBox(Other: Mx3dGeBndBox): boolean;
IsOutBndBox(Other: Mx3dGeBndBox, T: Mx3dGeTrsf): boolean;
IsOutTBT(T1: Mx3dGeTrsf, Other: Mx3dGeBndBox, T2: Mx3dGeTrsf): boolean;
IsOutPPD(P1: Mx3dGePoint, P2: Mx3dGePoint, D: Mx3dGeDir): boolean;
Distance(Other: Mx3dGeBndBox): number;
SquareExtent(): number;
FinitePart(): Mx3dGeBndBox;
HasFinitePart(): boolean;
}
/**
*
*/
export declare class Mx3dGeCircle extends Mx3dGeObject {
/**
*
*/
constructor();
/**
*
* @param theA2
* @param theRadius
*/
constructor(theA2: Mx3dGeCSYSR, theRadius: number);
/**
*
* @param theA1
*/
SetAxis(theA1: Mx3dGeAxis): void;
/**
*
* @param theP
*/
SetLocation(theP: Mx3dGePoint): void;
/**
*
* @param theA2
*/
SetPosition(theA2: Mx3dGeCSYSR): void;
/**
*
* @param theRadius
*/
SetRadius(theRadius: number): void;
/**
*
* @returns
*/
Area(): number;
/**
*
* @returns
*/
Axis(): Mx3dGeAxis;
/**
*
* @returns
*/
Length(): number;
/**
*
* @returns
*/
Location(): Mx3dGePoint;
/**
*
* @returns
*/
Position(): Mx3dGeCSYSR;
/**
*
* @returns
*/
Radius(): number;
/**
* X轴
* @returns X轴
*/
XAxis(): Mx3dGeAxis;
/**
* Y轴
* @returns Y轴
*/
YAxis(): Mx3dGeAxis;
/**
*
* @param theP
* @returns
*/
Distance(theP: Mx3dGePoint): number;
/**
*
* @param theP
* @returns
*/
SquareDistance(theP: Mx3dGePoint): number;
/**
*
* @param theP
* @param theLinearTolerance 线
* @returns truefalse
*/
Contains(theP: Mx3dGePoint, theLinearTolerance: number): boolean;
/**
*
* @param theP
*/
MirrorByPoint(theP: Mx3dGePoint): void;
/**
*
* @param theP
* @returns
*/
MirroredByPoint(theP: Mx3dGePoint): Mx3dGeCircle;
/**
*
* @param theA1
*/
MirrorByAxis(theA1: Mx3dGeAxis): void;
/**
*
* @param theA1
* @returns
*/
MirroredByAxis(theA1: Mx3dGeAxis): Mx3dGeCircle;
/**
*
* @param theA2
*/
MirrorByCSYSR(theA2: Mx3dGeCSYSR): void;
/**
*
* @param theA2
* @returns
*/
MirroredByCSYSR(theA2: Mx3dGeCSYSR): Mx3dGeCircle;
/**
*
* @param theA1
* @param theAng
*/
Rotate(theA1: Mx3dGeAxis, theAng: number): void;
/**
*
* @param theA1
* @param theAng
* @returns
*/
Rotated(theA1: Mx3dGeAxis, theAng: number): Mx3dGeCircle;
/**
*
* @param theP
* @param theS
*/
Scale(theP: Mx3dGePoint, theS: number): void;
/**
*
* @param theP
* @param theS
* @returns
*/
Scaled(theP: Mx3dGePoint, theS: number): Mx3dGeCircle;
/**
*
* @param theT
*/
Transform(theT: Mx3dGeTrsf): void;
/**
*
* @param theT
* @returns
*/
Transformed(theT: Mx3dGeTrsf): Mx3dGeCircle;
/**
*
* @param theV
*/
TranslateByVec(theV: Mx3dGeVec): void;
/**
*
* @param theV
* @returns
*/
TranslatedByVec(theV: Mx3dGeVec): Mx3dGeCircle;
/**
*
* @param theP1
* @param theP2
*/
TranslateBy2Points(theP1: Mx3dGePoint, theP2: Mx3dGePoint): void;
/**
*
* @param theP1
* @param theP2
* @returns
*/
TranslatedBy2Points(theP1: Mx3dGePoint, theP2: Mx3dGePoint): Mx3dGeCircle;
}
/**
*
*/
export declare class Mx3dShapeObject extends Mx3dBaseObject {
/**
*
* @param p
*/
constructor(p?: object);
/**
*
* @returns
*/
getBndBox(): Mx3dGeBndBox;
/**
*
*/
reverse(): void;
/**
*
* @returns
*/
reversed(): Mx3dShapeObject;
/**
*
* @returns
*/
Orientation(): MdGe.MxOrientation;
/**
*
* @param theLocation
*/
move(theLocation: Mx3dGeLocation): void;
/**
*
* @param theLocation
* @returns
*/
moved(theLocation: Mx3dGeLocation): Mx3dShapeObject;
/**
*
* @returns
*/
clone(): Mx3dShapeObject;
/**
*
* @param theOther
* @returns
*/
fuse(theOther: Mx3dShapeObject): Mx3dShapeObject;
/**
*
* @param theOther
* @returns
*/
cut(theOther: Mx3dShapeObject): Mx3dShapeObject;
/**
*
* @param theOther
* @returns
*/
common(theOther: Mx3dShapeObject): Mx3dShapeObject;
/**
*
* @param theOther
* @returns
*/
section(theOther: Mx3dShapeObject): Mx3dShapeObject;
/**
* 使
* @param theTools
* @returns
*/
spliter(theTools: Mx3dShapeObject[]): Mx3dShapeObject[];
/**
*
* @param theP
*/
MirrorByPoint(theP: Mx3dGePoint): void;
/**
*
* @param theP
* @returns
*/
MirroredByPoint(theP: Mx3dGePoint): Mx3dShapeObject;
/**
*
* @param axis
*/
MirrorByAxis(axis: Mx3dGeAxis): void;
/**
*
* @param axis
* @returns
*/
MirroredByAxis(axis: Mx3dGeAxis): Mx3dShapeObject;
/**
*
* @param csysr
*/
MirrorByCSYSR(csysr: Mx3dGeCSYSR): void;
/**
*
* @param csysr
* @returns
*/
MirroredByCSYSR(csysr: Mx3dGeCSYSR): Mx3dShapeObject;
/**
*
* @param axis
* @param ang
*/
Rotate(axis: Mx3dGeAxis, ang: number): void;
/**
*
* @param axis
* @param ang
* @returns
*/
Rotated(axis: Mx3dGeAxis, ang: number): Mx3dShapeObject;
/**
*
* @param point
* @param s
*/
Scale(point: Mx3dGePoint, s: number): void;
/**
*
* @param point
* @param s
* @returns
*/
Scaled(point: Mx3dGePoint, s: number): Mx3dShapeObject;
/**
*
* @param trsf
*/
Transform(trsf: Mx3dGeTrsf): void;
/**
*
* @param trsf
* @returns
*/
Transformed(trsf: Mx3dGeTrsf): Mx3dShapeObject;
/**
*
* @param vec
*/
TranslateByVec(vec: Mx3dGeVec): void;
/**
*
* @param theX X坐标
* @param theY Y坐标
* @param theZ Z坐标
*/
TranslateByVec(theX: number, theY: number, theZ: number): void;
/**
*
* @param vec
* @returns
*/
TranslatedByVec(vec: Mx3dGeVec): Mx3dShapeObject;
/**
*
* @param theX X坐标
* @param theY Y坐标
* @param theZ Z坐标
* @returns
*/
TranslatedByVec(theX: number, theY: number, theZ: number): Mx3dShapeObject;
/**
*
* @param point1
* @param point2
*/
TranslateBy2Points(point1: Mx3dGePoint, point2: Mx3dGePoint): void;
/**
*
* @param point1
* @param point2
* @returns
*/
TranslatedBy2Points(point1: Mx3dGePoint, point2: Mx3dGePoint): Mx3dShapeObject;
/**
*
* @param ToFind
* @returns
*/
Explore(ToFind: MdGe.MxShapeEnum): Mx3dShapeObject[];
/**
*
* @returns
*/
ShapeType(): MdGe.MxShapeEnum;
/**
*
* @param theAspect
* @returns
*/
Quantities(theAspect: MdGe.MxQuantAspect): number;
/**
*
* @param theAspect
* @returns
*/
Centroid(theAspect: MdGe.MxQuantAspect): Mx3dGePoint;
}
/**
*
*/
export declare class Mx3dShapeFace extends Mx3dShapeObject {
constructor(p?: object);
}
/**
*
*/
export declare class Mx3dShapeVertex extends Mx3dShapeObject {
constructor(p?: object);
}
/**
*
*/
export declare class Mx3dShapeEdge extends Mx3dShapeObject {
constructor();
/**
*
* @param pt1
* @param pt2
*/
constructor(pt1: Mx3dGePoint, pt2: Mx3dGePoint);
}
/**
*
*/
export declare class Mx3dShapeWire extends Mx3dShapeObject {
constructor(p?: object);
}
/**
*
*/
export declare class Mx3dShapeShell extends Mx3dShapeObject {
constructor(p?: object);
}
/**
*
*/
export declare class Mx3dShapeSolid extends Mx3dShapeObject {
constructor(p?: object);
}
/**
*
*/
export declare class Mx3dShapeCompSolid extends Mx3dShapeObject {
constructor(p?: object);
}
/**
*
*/
export declare class Mx3dShapeCompound extends Mx3dShapeObject {
constructor(p?: object);
}
/**
*
*/
export declare class Mx3dAlgoFillet extends Mx3dAlgoObject {
constructor(S: Mx3dShapeObject, FShape: MdGe.MxCF3dFilletShapeEnum);
Add(Radius: number, E: Mx3dShapeEdge): void;
Shape(): Mx3dShapeObject;
}
/**
*
*/
export declare class Mx3dAlgoChamfer extends Mx3dAlgoObject {
/**
*
* @param S
*/
constructor(S: Mx3dShapeObject);
/**
*
* @param Dis
* @param E
*/
Add(Dis: number, E: Mx3dShapeEdge): void;
/**
*
* @returns
*/
Shape(): Mx3dShapeObject;
}
/**
*
*/
export declare class Mx3dAlgoFillet2d extends Mx3dAlgoObject {
/**
*
*/
constructor();
/**
* Wire和Wire所在平面
* @param theWire Wire
* @param thePlane Wire所在平面
*/
constructor(theWire: Mx3dShapeWire, thePlane: Mx3dGePlane);
/**
* Edge
* @param theEdge1 Edge
* @param theEdge2 Edge
* @param thePlane
*/
constructor(theEdge1: Mx3dShapeEdge, theEdge2: Mx3dShapeEdge, thePlane: Mx3dGePlane);
/**
* Wire和Wire所在平面
* @param theWire Wire
* @param thePlane Wire所在平面
*/
Init(theWire: Mx3dShapeWire, thePlane: Mx3dGePlane): void;
/**
* Edge
* @param theEdge1 Edge
* @param theEdge2 Edge
* @param thePlane
*/
Init(theEdge1: Mx3dShapeEdge, theEdge2: Mx3dShapeEdge, thePlane: Mx3dGePlane): void;
/**
*
* @param theRadius
* @returns
*/
Perform(theRadius: number): boolean;
/**
*
* @param thePoint
* @returns
*/
NbResults(thePoint: Mx3dGePoint): number;
/**
*
* @param thePoint 线
* @param theEdge1 Edge
* @param theEdge2 Edge
* @param iSolution -1thePoint的结果
*/
Result(thePoint: Mx3dGePoint, theEdge1: Mx3dShapeEdge, theEdge2: Mx3dShapeEdge, iSolution?: number): Mx3dShapeEdge;
}
/**
*
*/
export declare class Mx3dDbObject extends Mx3dBaseObject {
constructor(p?: object);
}
export declare class Mx3dView extends Mx3dBaseObject {
/**
* @internal
*/
constructor(p: object);
/**
*
* @returns
*/
getDocument(): Mx3dDbDocument;
/**
*
* @param theUpdateView
*/
removeAll(theUpdateView?: boolean): void;
/**
*
*/
removeSelected(): void;
/**
*
* @param isUpAllData
* @param isRemoveAll
*/
update(isUpAllData?: boolean, isRemoveAll?: boolean): void;
/**
*
* @param theProjection
*/
setProjectionType(theProjection: MdGe.MxCameraProjection): void;
/**
*
* @param theToShow true显示false不显示
*/
showCenterTrihedron(theToShow: boolean): void;
/**
*
* @param theAuto
*/
fitAllObjects(theAuto: boolean): void;
/**
* /X轴剖切面
* @param theToEnabled X轴剖切面
*/
enableXClipPlane(theToEnabled: boolean): void;
/**
* X轴剖切面的位置
* @param thePosition
*/
setXClipPlaneXPosition(thePosition: number): void;
/**
* X轴剖切面
*/
setXClipPlaneReverse(): void;
/**
* /Y轴剖切面
* @param theToEnabled Y轴剖切面
*/
enableYClipPlane(theToEnabled: boolean): void;
/**
* Y轴剖切面的位置
* @param thePosition
*/
setYClipPlaneYPosition(thePosition: number): void;
/**
* Y轴剖切面
*/
setYClipPlaneReverse(): void;
/**
* /Z轴剖切面
* @param theToEnabled Z轴剖切面
*/
enableZClipPlane(theToEnabled: boolean): void;
/**
* Z轴剖切面的位置
* @param thePosition
*/
setZClipPlaneZPosition(thePosition: number): void;
/**
* Z轴剖切面
*/
setZClipPlaneReverse(): void;
/**
* /
* @param theToEnabled
*/
enableCustomClipPlane(theToEnabled: boolean): void;
/**
*
* @param thePosition
*/
setCustomClipPlanePosition(thePosition: number): void;
/**
*
*/
setCustomClipPlaneReverse(): void;
/**
*
* @param x x分量
* @param y y分量
* @param z z分量
*/
setCustomClipPlaneDirection(x: number, y: number, z: number): void;
/**
*
* @param theSymbol
*/
displaySymbolText(theSymbol: Mx3dSymbolText): void;
/**
*
* @param theDimension
*/
displayDimension(theDimension: Mx3dDimObject): void;
/**
*
* @param theFileName
*/
addModelTexture(theFileName: string): void;
/**
*
*/
removeModelTexture(): void;
/**
*
* @param theColor1 1
* @param theColor2 2
* @param theMethod
*/
setGradientBgColor(theColor1: Mx3dGeColor, theColor2: Mx3dGeColor, theMethod: MdGe.MxGradientFillMethod): void;
/**
*
* @param theOrientation
* @param theIsYup Y轴向上
*/
setProj(theOrientation: MdGe.MxV3dTypeOfOrientation, theIsYup: boolean): void;
/**
*
* @param color
*/
setSelectedColor(color: Mx3dGeColor): void;
/**
*
* @param material
*/
setSelectedMaterial(material: Mx3dGeMaterial): void;
/**
*
* @param theMode
*/
setDisplayMode(theMode: MdGe.MxGlobalDisplayMode): void;
enableDirLightSrc(theToEnabled: boolean): void;
setCubemapBackground(theRight: string, theLeft: string, theTop: string, theBottom: string, theFront: string, theBack: string): void;
}
/**
*
*/
export declare class Mx3dGeColor extends Mx3dBaseObject {
/**
*
*/
constructor();
/**
* 使
* @param theColorName
*/
constructor(theColorName: MdGe.MxNameOfColor);
/**
* 使 RGB
* @param theR
* @param theG 绿
* @param theB
* @param theType
*/
constructor(theR: number, theG: number, theB: number, theType: MdGe.MxTypeOfColor);
/**
*
* @returns
*/
Name(): MdGe.MxNameOfColor;
/**
*
* @param theName
*/
SetValues(theName: MdGe.MxNameOfColor): void;
/**
*
* @param theC1
* @param theC2 绿
* @param theC3
* @param theType
*/
SetValues(theC1: number, theC2: number, theC3: number, theType: MdGe.MxTypeOfColor): void;
/**
*
* @returns
*/
Red(): number;
/**
* 绿
* @returns 绿
*/
Green(): number;
/**
*
* @returns
*/
Blue(): number;
/**
*
* @returns
*/
Hue(): number;
/**
*
* @returns
*/
Light(): number;
/**
*
* @param theDelta
*/
ChangeIntensity(theDelta: number): void;
/**
*
* @returns
*/
Saturation(): number;
/**
*
* @param theDelta
*/
ChangeContrast(theDelta: number): void;
/**
*
* @param theOther
* @returns
*/
IsDifferent(theOther: Mx3dGeColor): boolean;
/**
*
* @param theOther
* @returns
*/
IsEqual(theOther: Mx3dGeColor): boolean;
/**
*
* @param theColor
* @returns
*/
Distance(theColor: Mx3dGeColor): number;
/**
*
* @param theColor
* @returns
*/
SquareDistance(theColor: Mx3dGeColor): number;
/**
* Delta E2000
* @param theOther
* @returns Delta E2000
*/
DeltaE2000(theOther: Mx3dGeColor): number;
}
/**
*
*/
export declare class Mx3dGeCSYS extends Mx3dGeObject {
/**
*
*/
constructor();
/**
* 使
* @param csysr
*/
constructor(csysr: Mx3dGeCSYSR);
/**
* 使 Z
* @param origin
* @param z_axis Z
*/
constructor(origin: Mx3dGePoint, z_axis: Mx3dGeDir);
/**
* 使Z X
* @param origin
* @param z_axis Z
* @param x_vec X
*/
constructor(origin: Mx3dGePoint, z_axis: Mx3dGeDir, x_vec: Mx3dGeDir);
/**
* X
*/
XReverse(): void;
/**
* Y
*/
YReverse(): void;
/**
* Z
*/
ZReverse(): void;
/**
*
* @param z_axis Z
*/
SetAxis(z_axis: Mx3dGeAxis): void;
/**
*
* @param z_dir Z
*/
SetDirection(z_dir: Mx3dGeDir): void;
/**
*
* @param origin
*/
SetLocation(origin: Mx3dGePoint): void;
/**
*
* @param theX X
* @param theY Y
* @param theZ Z
*/
SetLocation(theX: number, theY: number, theZ: number): void;
/**
* X
* @param x_dir X
*/
SetXDirection(x_dir: Mx3dGeDir): void;
/**
* Y
* @param y_dir Y
*/
SetYDirection(y_dir: Mx3dGeDir): void;
/**
*
* @param other
* @returns
*/
Angle(other: Mx3dGeCSYS): number;
/**
*
* @returns
*/
Axis(): Mx3dGeAxis;
/**
*
* @returns
*/
CSYSR(): Mx3dGeCSYSR;
/**
*
* @returns
*/
Direction(): Mx3dGeDir;
/**
*
* @returns
*/
Location(): Mx3dGePoint;
/**
* X
* @returns X
*/
XDirection(): Mx3dGeDir;
/**
* Y
* @returns Y
*/
YDirection(): Mx3dGeDir;
/**
*
* @returns
*/
Direct(): boolean;
/**
*
* @param other
* @param linearTolerance 线
* @param angularTolerance
* @returns
*/
IsCoplanarWithCSYS(other: Mx3dGeCSYS, linearTolerance: number, angularTolerance: number): boolean;
/**
*
* @param axis
* @param linearTolerance 线
* @param angularTolerance
* @returns
*/
IsCoplanarWithAxis(axis: Mx3dGeAxis, linearTolerance: number, angularTolerance: number): boolean;
/**
*
* @param point
*/
MirrorByPoint(point: Mx3dGePoint): void;
/**
*
* @param point
* @returns
*/
MirroredByPoint(point: Mx3dGePoint): Mx3dGeCSYS;
/**
*
* @param axis
*/
MirrorByAxis(axis: Mx3dGeAxis): void;
/**
*
* @param axis
* @returns
*/
MirroredByAxis(axis: Mx3dGeAxis): Mx3dGeCSYS;
/**
*
* @param csysr
*/
MirrorByCSYSR(csysr: Mx3dGeCSYSR): void;
/**
*
* @param csysr
* @returns
*/
MirroredByCSYSR(csysr: Mx3dGeCSYSR): Mx3dGeCSYS;
/**
*
* @param axis
* @param ang
*/
Rotate(axis: Mx3dGeAxis, ang: number): void;
/**
*
* @param axis
* @param ang
* @returns
*/
Rotated(axis: Mx3dGeAxis, ang: number): Mx3dGeCSYS;
/**
*
* @param point
* @param s
*/
Scale(point: Mx3dGePoint, s: number): void;
/**
*
* @param point
* @param s
* @returns
*/
Scaled(point: Mx3dGePoint, s: number): Mx3dGeCSYS;
/**
*
* @param t
*/
Transform(t: Mx3dGeTrsf): void;
/**
*
* @param t
* @returns
*/
Transformed(t: Mx3dGeTrsf): Mx3dGeCSYS;
/**
*
* @param vec
*/
TranslateByVec(vec: Mx3dGeVec): void;
/**
*
* @param vec
* @returns
*/
TranslatedByVec(vec: Mx3dGeVec): Mx3dGeCSYS;
/**
*
* @param point1
* @param point2
*/
TranslateBy2Points(point1: Mx3dGePoint, point2: Mx3dGePoint): void;
/**
*
* @param point1
* @param point2
* @returns
*/
TranslatedBy2Points(point1: Mx3dGePoint, point2: Mx3dGePoint): Mx3dGeCSYS;
}
/**
*
*/
export declare class Mx3dGeCSYSR extends Mx3dGeObject {
/**
*
*/
constructor();
/**
* 使Z X
* @param origin
* @param z_axis Z
* @param x_vec X
*/
constructor(origin: Mx3dGePoint, z_axis: Mx3dGeDir, x_vec: Mx3dGeDir);
/**
* 使Z X Y
* @param origin
* @param z_axis Z
*/
constructor(origin: Mx3dGePoint, z_axis: Mx3dGeDir);
/**
*
* @returns
*/
Location(): Mx3dGePoint;
/**
* X
* @returns X
*/
XDirection(): Mx3dGeDir;
/**
* Y
* @returns Y
*/
YDirection(): Mx3dGeDir;
/**
* Z
* @returns Z
*/
Direction(): Mx3dGeDir;
/**
*
* @param origin
*/
SetLocation(origin: Mx3dGePoint): void;
/**
*
* @param theX X
* @param theY Y
* @param theZ Z
*/
SetLocation(theX: number, theY: number, theZ: number): void;
/**
* X
* @param x_dir X
*/
SetXDirection(x_dir: Mx3dGePoint): void;
/**
* Y
* @param y_dir Y
*/
SetYDirection(y_dir: Mx3dGeDir): void;
/**
* Z
* @param z_dir Z
*/
SetDirection(z_dir: Mx3dGeDir): void;
/**
*
* @param theOther
* @returns
*/
Angle(theOther: Mx3dGeCSYSR): number;
/**
*
* @returns
*/
Axis(): Mx3dGeAxis;
/**
*
* @param Other
* @param LinearTolerance 线
* @param AngularTolerance
* @returns
*/
IsCoplanarWithCSYSR(Other: Mx3dGeCSYSR, LinearTolerance: number, AngularTolerance: number): boolean;
/**
*
* @param A1
* @param LinearTolerance 线
* @param AngularTolerance
* @returns
*/
IsCoplanarWithAxis(A1: Mx3dGeAxis, LinearTolerance: number, AngularTolerance: number): boolean;
/**
*
* @param P
*/
MirrorByPoint(P: Mx3dGePoint): void;
/**
*
* @param P
* @returns
*/
MirroredByPoint(P: Mx3dGePoint): Mx3dGeCSYSR;
/**
*
* @param A1
*/
MirrorByAxis(A1: Mx3dGeAxis): void;
/**
*
* @param A1
* @returns
*/
MirroredByAxis(A1: Mx3dGeAxis): Mx3dGeCSYSR;
/**
*
* @param A2
*/
MirrorByCSYSR(A2: Mx3dGeCSYSR): void;
/**
*
* @param A2
* @returns
*/
MirroredByCSYSR(A2: Mx3dGeCSYSR): Mx3dGeCSYSR;
/**
*
* @param theA1
* @param theAng
*/
Rotate(theA1: Mx3dGeAxis, theAng: number): void;
/**
*
* @param theA1
* @param theAng
* @returns
*/
Rotated(theA1: Mx3dGeAxis, theAng: number): Mx3dGeCSYSR;
/**
*
* @param theP
* @param theS
*/
Scale(theP: Mx3dGePoint, theS: number): void;
/**
*
* @param theP
* @param theS
* @returns
*/
Scaled(theP: Mx3dGePoint, theS: number): Mx3dGeCSYSR;
/**
*
* @param theT
*/
Transform(theT: Mx3dGeTrsf): void;
/**
*
* @param theT
* @returns
*/
Transformed(theT: Mx3dGeTrsf): Mx3dGeCSYSR;
/**
*
* @param theV
*/
TranslateByVec(theV: Mx3dGeVec): void;
/**
*
* @param theV
* @returns
*/
TranslatedByVec(theV: Mx3dGeVec): Mx3dGeCSYSR;
/**
*
* @param theP1
* @param theP2
*/
TranslateBy2Points(theP1: Mx3dGePoint, theP2: Mx3dGePoint): void;
/**
*
* @param theP1
* @param theP2
* @returns
*/
TranslatedBy2Points(theP1: Mx3dGePoint, theP2: Mx3dGePoint): Mx3dGeCSYSR;
}
/**
*
*/
export declare class Mx3dGeCylinder extends Mx3dGeObject {
/**
*
*/
constructor();
/**
* 使
* @param theA3
* @param theRadius
*/
constructor(theA3: Mx3dGeCSYS, theRadius: number);
/**
*
* @param theA1
*/
SetAxis(theA1: Mx3dGeAxis): void;
/**
*
* @param theLoc
*/
SetLocation(theLoc: Mx3dGePoint): void;
/**
*
* @param theA3
*/
SetPosition(theA3: Mx3dGeCSYS): void;
/**
*
* @param theR
*/
SetRadius(theR: number): void;
/**
* U
*/
UReverse(): void;
/**
* V
*/
VReverse(): void;
/**
*
* @returns
*/
Direct(): boolean;
/**
*
* @returns
*/
Axis(): Mx3dGeAxis;
/**
*
* @returns
*/
Location(): Mx3dGePoint;
/**
*
* @returns
*/
Position(): Mx3dGeCSYS;
/**
*
* @returns
*/
Radius(): number;
/**
* X
* @returns X
*/
XAxis(): Mx3dGeAxis;
/**
* Y
* @returns Y
*/
YAxis(): Mx3dGeAxis;
/**
*
* @param theP
*/
MirrorByPoint(theP: Mx3dGePoint): void;
/**
*
* @param theP
* @returns
*/
MirroredByPoint(theP: Mx3dGePoint): Mx3dGeCylinder;
/**
*
* @param theA1
*/
MirrorByAxis(theA1: Mx3dGeAxis): void;
/**
*
* @param theA1
* @returns
*/
MirroredByAxis(theA1: Mx3dGeAxis): Mx3dGeCylinder;
/**
*
* @param theA2
*/
MirrorByCSYSR(theA2: Mx3dGeCSYSR): void;
/**
*
* @param theA2
* @returns
*/
MirroredByCSYSR(theA2: Mx3dGeCSYSR): Mx3dGeCylinder;
/**
*
* @param theA1
* @param theAng
*/
Rotate(theA1: Mx3dGeAxis, theAng: number): void;
/**
*
* @param theA1
* @param theAng
* @returns
*/
Rotated(theA1: Mx3dGeAxis, theAng: number): Mx3dGeCylinder;
/**
*
* @param theP
* @param theS
*/
Scale(theP: Mx3dGePoint, theS: number): void;
/**
*
* @param theP
* @param theS
* @returns
*/
Scaled(theP: Mx3dGePoint, theS: number): Mx3dGeCylinder;
/**
*
* @param theT
*/
Transform(theT: Mx3dGeTrsf): void;
/**
*
* @param theT
* @returns
*/
Transformed(theT: Mx3dGeTrsf): Mx3dGeCylinder;
/**
*
* @param theV
*/
TranslateByVec(theV: Mx3dGeVec): void;
/**
*
* @param theV
* @returns
*/
TranslatedByVec(theV: Mx3dGeVec): Mx3dGeCylinder;
/**
* 沿线
* @param theP1 -
* @param theP2 -
*/
TranslateBy2Points(theP1: Mx3dGePoint, theP2: Mx3dGePoint): void;
/**
* 沿线
* @param theP1 -
* @param theP2 -
* @returns Mx3dGeCylinder
*/
TranslatedBy2Points(theP1: Mx3dGePoint, theP2: Mx3dGePoint): Mx3dGeCylinder;
/**
* Mx3dShapeObject
* @param H -
* @param Angle -
* @returns Mx3dShapeObject
*/
Shape(H: number, Angle?: number): Mx3dShapeObject;
}
/**
* Mx3dDbObject
*/
export declare class Mx3dDbDocument extends Mx3dDbObject {
/**
* Mx3dDbDocument
*/
constructor();
/**
*
* @param theFile -
* @param theFormat -
* @returns Promise
*/
read(theFile: File, theFormat: MdGe.MxFormat): Promise<boolean>;
readFile(theFilePath: string, theFormat: MdGe.MxFormat): void;
/**
* 访
* @returns 访
*/
getAccessLabel(): Mx3dDbLabel;
/**
*
* @returns
*/
getShapesLabel(): Mx3dDbLabel;
/**
*
* @returns
*/
getColorsLabel(): Mx3dDbLabel;
/**
*
* @returns
*/
getLayersLabel(): Mx3dDbLabel;
/**
*
* @returns
*/
addShapeLabel(): Mx3dDbLabel;
/**
*
* @param theLabel -
* @returns
*/
removeShapeLabel(theLabel: Mx3dDbLabel): boolean;
/**
*
* @param theLabel -
*/
removeComponent(theLabel: Mx3dDbLabel): void;
/**
*
* @returns
*/
getTopFreeLabels(): Mx3dDbLabel[];
/**
*
* @returns
*/
getDocName(): string;
/**
*
* @returns
*/
getView(): Mx3dView;
/**
*
* @param theColor -
* @returns
*/
addColorLabel(theColor: Mx3dGeColor): Mx3dDbLabel;
/**
*
* @param theFilePath -
* @param theFormat -
* @returns
*/
write(theFilePath: string, theFormat: MdGe.MxFormat): boolean;
/**
*
*/
newCommand(): void;
/**
*
*/
abortCommand(): void;
/**
*
* @returns
*/
commitCommand(): boolean;
/**
*
* @returns
*/
undo(): boolean;
/**
*
* @returns
*/
redo(): boolean;
}
/**
* Mx3dDbObject
*/
export declare class Mx3dDbLabel extends Mx3dDbObject {
/**
* @internal
*/
constructor(p?: object);
/**
*
* @param theShape -
*/
setShape(theShape: Mx3dShapeObject): void;
/**
*
* @returns
*/
getShape(): Mx3dShapeObject;
/**
*
* @returns
*/
hasChildLabel(): boolean;
/**
*
* @returns
*/
getChildLabels(): Mx3dDbLabel[];
/**
*
* @returns
*/
hasParentLabel(): boolean;
/**
*
* @returns
*/
getParentLabel(): Mx3dDbLabel;
/**
*
* @returns
*/
addChildLabel(): Mx3dDbLabel;
/**
*
* @param theShape -
* @returns
*/
addSubShape(theShape: Mx3dShapeObject): Mx3dDbLabel;
/**
*
* @returns
*/
isReference(): boolean;
/**
*
* @returns
*/
isAssembly(): boolean;
/**
*
* @returns
*/
isSimpleShape(): boolean;
/**
*
* @returns
*/
isTopLevel(): boolean;
/**
*
* @returns
*/
isFree(): boolean;
/**
*
* @returns
*/
isShape(): boolean;
/**
*
* @returns
*/
isComponent(): boolean;
/**
*
* @returns
*/
isCompound(): boolean;
/**
*
* @returns
*/
isSubShape(): boolean;
/**
*
* @returns
*/
getReferredLabel(): Mx3dDbLabel;
/**
*
* @returns
*/
getLocation(): Mx3dGeLocation;
/**
*
* @param comp -
* @param Loc -
* @returns
*/
addComponent(comp: Mx3dDbLabel, Loc: Mx3dGeLocation): Mx3dDbLabel;
/**
*
* @param theName -
*/
setName(theName: string): void;
/**
*
* @returns
*/
hasShape(): boolean;
/**
*
* @returns
*/
isSetColor(): boolean;
/**
*
* @param theColor -
*/
setColor(theColor: Mx3dGeColor): void;
/**
*
* @returns
*/
getColor(): Mx3dGeColor;
/**
*
* @returns
*/
getName(): string;
/**
*
* @returns
*/
getEntry(): string;
/**
* JSON字符串
* @returns
*/
getAttributeStr(): string;
/**
*
* @param theFilePath -
* @param theScaleU - U 1
* @param theScaleV - V 1
* @param theRepeatU - U 1
* @param theRepeatV - V 1
* @param theOriginU - U 0
* @param theOriginV - V 0
*/
setTexture(theFilePath: string, theScaleU?: number, theScaleV?: number, theRepeatU?: number, theRepeatV?: number, theOriginU?: number, theOriginV?: number): void;
/**
*
* @param theMaterial -
*/
setMaterial(theMaterial: Mx3dGeMaterial): void;
}
/**
* 3D几何系统中的位置
* 3D位置和变换的各种方法
*/
export declare class Mx3dGeLocation extends Mx3dGeObject {
/**
*
*/
constructor();
/**
* 使
* @param theTrsf -
*/
constructor(theTrsf: Mx3dGeTrsf);
/**
*
* @returns truefalse
*/
IsIdentity(): boolean;
/**
*
*/
Identity(): void;
/**
*
* @returns
*/
FirstPower(): number;
/**
*
* @returns
*/
NextLocation(): Mx3dGeLocation;
/**
*
* @returns
*/
Inverted(): Mx3dGeLocation;
/**
*
* @param theLocation -
* @returns
*/
Multiplied(theLocation: Mx3dGeLocation): Mx3dGeLocation;
/**
*
* @param Other -
* @returns
*/
Divided(Other: Mx3dGeLocation): Mx3dGeLocation;
/**
*
* @param Other -
* @returns
*/
Predivided(Other: Mx3dGeLocation): Mx3dGeLocation;
/**
*
* @param pwr -
* @returns
*/
Powered(pwr: number): Mx3dGeLocation;
/**
*
* @param Other -
* @returns truefalse
*/
IsEqual(Other: Mx3dGeLocation): boolean;
/**
*
* @param Other -
* @returns truefalse
*/
IsDifferent(Other: Mx3dGeLocation): boolean;
/**
*
*/
Clear(): void;
/**
*
* @returns
*/
ScalePrec(): number;
}
/**
* 3D几何中的平面
*
*/
export declare class Mx3dGePlane extends Mx3dGeObject {
/**
*
*/
constructor();
/**
* 使
*
* @param theA3 - CSYS
*/
constructor(theA3: Mx3dGeCSYS);
/**
* 使
*
* @param theP -
* @param theV -
*/
constructor(theP: Mx3dGePoint, theV: Mx3dGeDir);
/**
* 使
*
* @param theA - A
* @param theB - B
* @param theC - C
* @param theD - D
*/
constructor(theA: number, theB: number, theC: number, theD: number);
/**
*
*
* @param theA1 -
*/
SetAxis(theA1: Mx3dGeAxis): void;
/**
*
*
* @param theLoc -
*/
SetLocation(theLoc: Mx3dGePoint): void;
/**
*
*
* @param theA3 -
*/
SetPosition(theA3: Mx3dGeCSYS): void;
/**
* U方向
*/
UReverse(): void;
/**
* V方向
*/
VReverse(): void;
/**
*
*
* @returns truefalse
*/
Direct(): boolean;
/**
*
*
* @returns
*/
Axis(): Mx3dGeAxis;
/**
*
*
* @returns
*/
Location(): Mx3dGePoint;
/**
*
*
* @returns
*/
Position(): Mx3dGeCSYS;
/**
*
*
* @param theP -
* @returns
*/
DistanceToPoint(theP: Mx3dGePoint): number;
/**
*
*
* @param theOther -
* @returns
*/
DistanceToPlane(theOther: Mx3dGePlane): number;
/**
*
*
* @param theP -
* @returns
*/
SquareDistanceToPoint(theP: Mx3dGePoint): number;
/**
*
*
* @param theOther -
* @returns
*/
SquareDistanceToPlane(theOther: Mx3dGePlane): number;
/**
* X轴的方向
*
* @returns X轴的轴向对象
*/
XAxis(): Mx3dGeAxis;
/**
* Y轴的方向
*
* @returns Y轴的轴向对象
*/
YAxis(): Mx3dGeAxis;
/**
*
*
* @param theP -
* @param theLinearTolerance - 线
* @returns truefalse
*/
Contains(theP: Mx3dGePoint, theLinearTolerance: number): boolean;
/**
*
*
* @param theP -
*/
MirrorByPoint(theP: Mx3dGePoint): void;
/**
*
*
* @param theP -
* @returns
*/
MirroredByPoint(theP: Mx3dGePoint): Mx3dGePlane;
/**
*
*
* @param theA1 -
*/
MirrorByAxis(theA1: Mx3dGeAxis): void;
/**
*
*
* @param theA1 -
* @returns
*/
MirroredByAxis(theA1: Mx3dGeAxis): Mx3dGePlane;
/**
*
*
* @param theA2 -
*/
MirrorByCSYSR(theA2: Mx3dGeCSYSR): void;
/**
*
*
* @param theA2 -
* @returns
*/
MirroredByCSYSR(theA2: Mx3dGeCSYSR): Mx3dGePlane;
/**
*
*
* @param theA1 -
* @param theAng -
*/
Rotate(theA1: Mx3dGeAxis, theAng: number): void;
/**
*
*
* @param theA1 -
* @param theAng -
* @returns
*/
Rotated(theA1: Mx3dGeAxis, theAng: number): Mx3dGePlane;
/**
*
*
* @param theP -
* @param theS -
*/
Scale(theP: Mx3dGePoint, theS: number): void;
/**
*
*
* @param theP -
* @param theS -
* @returns
*/
Scaled(theP: Mx3dGePoint, theS: number): Mx3dGePlane;
/**
*
*
* @param theT -
*/
Transform(theT: Mx3dGeTrsf): void;
/**
*
*
* @param theT -
* @returns
*/
Transformed(theT: Mx3dGeTrsf): Mx3dGePlane;
/**
* 沿
*
* @param theV -
*/
TranslateByVec(theV: Mx3dGeVec): void;
/**
*
*
* @param theV -
* @returns
*/
TranslatedByVec(theV: Mx3dGeVec): Mx3dGePlane;
/**
*
*
* @param theP1 -
* @param theP2 -
*/
TranslateBy2Points(theP1: Mx3dGePoint, theP2: Mx3dGePoint): void;
/**
*
*
* @param theP1 -
* @param theP2 -
* @returns
*/
TranslatedBy2Points(theP1: Mx3dGePoint, theP2: Mx3dGePoint): Mx3dGePlane;
/**
*
*
* @returns
*/
Shape(): Mx3dShapeObject;
/**
*
*
* @param UMin - U方向的最小值
* @param UMax - U方向的最大值
* @param VMin - V方向的最小值
* @param VMax - V方向的最大值
* @returns
*/
Shape(UMin: number, UMax: number, VMin: number, VMax: number): Mx3dShapeObject;
}
/**
* Mx3dSymbolObject
*/
export declare class Mx3dSymbolText extends Mx3dSymbolObject {
/**
*
*/
constructor();
/**
* 使
* @param text
* @param height
* @param position
*/
constructor(text: string, height: number, position: Mx3dGePoint);
/**
*
* @param theColor
*/
SetColor(theColor: Mx3dGeColor): void;
/**
*
* @param theR
* @param theG 绿
* @param theB
*/
SetColor(theR: number, theG: number, theB: number): void;
/**
*
* @param text
*/
SetText(text: string): void;
/**
*
* @param position
*/
SetPositon(position: Mx3dGePoint): void;
/**
*
* @param theHJust
*/
SetHJustification(theHJust: MdGe.MxHorizontalTextAlignment): void;
/**
*
* @param theVJust
*/
SetVJustification(theVJust: MdGe.MxVerticalTextAlignment): void;
/**
*
* @param theAngle
*/
SetAngle(theAngle: number): void;
/**
*
* @param theIsZoomable
*/
SetZoomable(theIsZoomable: boolean): void;
/**
*
* @param height
*/
SetHeight(height: number): void;
/**
*
* @param theFontAspect
*/
SetFontAspect(theFontAspect: MdGe.MxFontAspect): void;
/**
*
* @param theFont
*/
SetFont(theFont: string): void;
/**
* 3D方向
* @param theOrientation 3D方向
*/
SetOrientation3D(theOrientation: Mx3dGeCSYSR): void;
/**
* 3D方向设置
*/
UnsetOrientation3D(): void;
/**
*
* @returns
*/
Position(): Mx3dGePoint;
/**
*
* @returns
*/
FontAspect(): MdGe.MxFontAspect;
/**
* 3D方向
* @returns 3D方向
*/
Orientation3D(): Mx3dGeCSYSR;
/**
* 3D方向
* @returns 3D方向
*/
HasOrientation3D(): boolean;
/**
*
* @param theIsFlipping
*/
SetFlipping(theIsFlipping: boolean): void;
/**
*
* @returns
*/
HasFlipping(): boolean;
/**
*
* @returns
*/
HasOwnAnchorPoint(): boolean;
/**
*
* @param theOwnAnchorPoint
*/
SetOwnAnchorPoint(theOwnAnchorPoint: boolean): void;
/**
*
* @param theDisplayType
*/
SetDisplayType(theDisplayType: MdGe.MxTypeOfDisplayText): void;
/**
*
* @param theR
* @param theG 绿
* @param theB
*/
SetColorSubTitle(theR: number, theG: number, theB: number): void;
}
/**
*
*/
export declare class Mx3dShapeDownCast {
/**
* Mx3dShapeObject Mx3dShapeVertex (Mx3dShapeObject Mx3dShapeVertex)
* @param S
* @returns
*/
static Vertex(S: Mx3dShapeObject): Mx3dShapeVertex;
/**
* Mx3dShapeObject Mx3dShapeEdge (Mx3dShapeObject Mx3dShapeEdge)
* @param S
* @returns
*/
static Edge(S: Mx3dShapeObject): Mx3dShapeEdge;
/**
* Mx3dShapeObject Mx3dShapeWire (Mx3dShapeObject Mx3dShapeWire)
* @param S
* @returns
*/
static Wire(S: Mx3dShapeObject): Mx3dShapeWire;
/**
* Mx3dShapeObject Mx3dShapeFace (Mx3dShapeObject Mx3dShapeFace)
* @param S
* @returns
*/
static Face(S: Mx3dShapeObject): Mx3dShapeFace;
/**
* Mx3dShapeObject Mx3dShapeShell (Mx3dShapeObject Mx3dShapeShell)
* @param S
* @returns
*/
static Shell(S: Mx3dShapeObject): Mx3dShapeShell;
/**
* Mx3dShapeObject Mx3dShapeSolid (Mx3dShapeObject Mx3dShapeSolid)
* @param S
* @returns
*/
static Solid(S: Mx3dShapeObject): Mx3dShapeSolid;
/**
* Mx3dShapeObject Mx3dShapeCompSolid (Mx3dShapeObject Mx3dShapeCompSolid)
* @param S
* @returns
*/
static CompSolid(S: Mx3dShapeObject): Mx3dShapeCompSolid;
/**
* Mx3dShapeObject Mx3dShapeCompound (Mx3dShapeObject Mx3dShapeCompound)
* @param S
* @returns
*/
static Compound(S: Mx3dShapeObject): Mx3dShapeCompound;
}
/**
*
*/
export declare class Mx3dBrepCastGeom {
/**
*
* @param F
* @returns
*/
static Surface(F: Mx3dShapeFace): Mx3dGeomSurface;
/**
* Edge转换为参数几何曲线
* @param E Edge
* @param SEParam 线
* @returns 线
*/
static Curve(E: Mx3dShapeEdge, SEParam: [
FirstParam: number,
LastParam: number
]): Mx3dGeomCurve;
}
/**
*
*/
export declare class Mx3dUtils {
/**
* URL地址加载文件到虚拟文件系统
* @param theFileUrl URL地址
* @param theSaveFileName
* @returns
*/
static LoadFileFromUrl(theFileUrl: string, theSaveFileName: string): Promise<string>;
/**
*
* @param theFilePath
* @param theFormat
* @returns
*/
static LoadShapeFromFile(theFilePath: string, theFormat: MdGe.MxFormat): Mx3dShapeObject[];
static LoadLocalFile(theFile: File, theFilePath: string): Promise<string>;
}
/**
* 线
*/
export declare class Mx3dGeLine extends Mx3dGeCurve {
/**
* 使线
* @param A1
*/
constructor(A1: Mx3dGeAxis);
/**
* 使线
* @param P
* @param V
*/
constructor(P: Mx3dGePoint, V: Mx3dGeDir);
/**
* 线
* @param V
*/
SetDirection(V: Mx3dGeDir): void;
/**
* 线
* @param P
*/
SetLocation(P: Mx3dGePoint): void;
/**
* 线
* @param A1
*/
SetPosition(A1: Mx3dGeAxis): void;
/**
* 线
* @returns
*/
Position(): Mx3dGeAxis;
/**
* 线
*/
Reverse(): void;
/**
* 线
* @returns 线
*/
Reversed(): Mx3dGeLine;
/**
*
* @param U
* @returns
*/
ReversedParameter(U: number): number;
/**
* 线
* @returns
*/
FirstParameter(): number;
/**
* 线
* @returns
*/
LastParameter(): number;
/**
* 线
* @returns
*/
IsClosed(): boolean;
/**
* 线
* @returns
*/
IsPeriodic(): boolean;
/**
* 线
* @returns
*/
Continuity(): MdGe.MxGAShapeEnum;
/**
* 线
* @param N
* @returns
*/
IsCN(N: number): boolean;
/**
*
* @param U
* @param P
*/
D0(U: number, P: Mx3dGePoint): void;
/**
*
* @param U
* @param P
* @param V1
*/
D1(U: number, P: Mx3dGePoint, V1: Mx3dGeVec): void;
/**
*
* @param U
* @param P
* @param V1
* @param V2
*/
D2(U: number, P: Mx3dGePoint, V1: Mx3dGeVec, V2: Mx3dGeVec): void;
/**
*
* @param U
* @param P
* @param V1
* @param V2
* @param V3
*/
D3(U: number, P: Mx3dGePoint, V1: Mx3dGeVec, V2: Mx3dGeVec, V3: Mx3dGeVec): void;
/**
* N阶导数向量
* @param U
* @param N
* @returns N阶导数向量
*/
DN(U: number, N: number): Mx3dGeVec;
/**
* 线
* @param T
*/
Transform(T: Mx3dGeTrsf): void;
/**
*
* @param U
* @param T
* @returns
*/
TransformedParameter(U: number, T: Mx3dGeTrsf): number;
/**
*
* @param T
* @returns
*/
ParametricTransformation(T: Mx3dGeTrsf): number;
/**
* 线
* @returns
*/
Period(): number;
/**
*
* @param U
* @returns
*/
Value(U: number): Mx3dGePoint;
/**
*
* @param p1
* @param p2
* @returns
*/
Edge(p1: number, p2: number): Mx3dShapeEdge;
}
export interface Mx3dGeomObject {
DynCast(theObject: Mx3dGeomObject): this;
}
/**
*
*/
export declare class Mx3dGeomObject extends Mx3dBaseObject {
constructor(p?: object);
/**
*
* @param P
*/
MirrorByPoint(P: Mx3dGePoint): void;
/**
*
* @param A1
*/
MirrorByAxis(A1: Mx3dGeAxis): void;
/**
*
* @param A2
*/
MirrorByCSYSR(A2: Mx3dGeCSYSR): void;
/**
*
* @param A1
* @param Ang
*/
Rotate(A1: Mx3dGeAxis, Ang: number): void;
/**
*
* @param P
* @param S
*/
Scale(P: Mx3dGePoint, S: number): void;
/**
*
* @param V
*/
TranslateByVec(V: Mx3dGeVec): void;
/**
*
* @param P1
* @param P2
*/
TranslateBy2Points(P1: Mx3dGePoint, P2: Mx3dGePoint): void;
/**
*
* @param P
* @returns
*/
MirroredByPoint(P: Mx3dGePoint): this;
/**
*
* @param A1
* @returns
*/
MirroredByAxis(A1: Mx3dGeAxis): this;
/**
*
* @param A2
* @returns
*/
MirroredByCSYSR(A2: Mx3dGeCSYSR): this;
/**
*
* @param A1
* @param Ang
* @returns
*/
Rotated(A1: Mx3dGeAxis, Ang: number): this;
/**
*
* @param P
* @param S
* @returns
*/
Scaled(P: Mx3dGePoint, S: number): this;
/**
*
* @param T
* @returns
*/
Transformed(T: Mx3dGeTrsf): this;
/**
*
* @param V
* @returns
*/
TranslatedByVec(V: Mx3dGeVec): this;
/**
*
* @param P1
* @param P2
* @returns
*/
TranslatedBy2Points(P1: Mx3dGePoint, P2: Mx3dGePoint): this;
}
/**
* 线 Mx3dGeomObject
*/
export declare class Mx3dGeomCurve extends Mx3dGeomObject {
constructor(p?: object);
/**
* 线
* @returns 线
*/
Reversed(): this;
/**
* 线
* @returns 线
*/
Period(): number;
/**
* U
* @param U
* @returns
*/
Value(U: number): Mx3dGePoint;
/**
*
* @returns
*/
DynamicType(): string;
}
/**
* 线(线) Mx3dGeomCurve
*/
export declare class Mx3dGeomConic extends Mx3dGeomCurve {
constructor(p?: object);
/**
* 线
* @param theA1
*/
SetAxis(theA1: Mx3dGeAxis): void;
/**
* 线
* @param theP
*/
SetLocation(theP: Mx3dGePoint): void;
/**
* 线
* @param theA2
*/
SetPosition(theA2: Mx3dGeCSYSR): void;
/**
* 线
* @returns
*/
Axis(): Mx3dGeAxis;
/**
* 线
* @returns
*/
Location(): Mx3dGePoint;
/**
* 线
* @returns
*/
Position(): Mx3dGeCSYSR;
/**
* 线 X
* @returns X
*/
XAxis(): Mx3dGeAxis;
/**
* 线 Y
* @returns Y
*/
YAxis(): Mx3dGeAxis;
/**
* 线
*/
Reverse(): void;
/**
* 线
* @returns
*/
Continuity(): MdGe.MxGAShapeEnum;
/**
* 线
* @param N
* @returns true false
*/
IsCN(N: number): boolean;
/**
*
* @returns
*/
DynamicType(): string;
}
/**
* Mx3dGeomConic
*/
export declare class Mx3dGeomCircle extends Mx3dGeomConic {
/**
*
* @param theCSYSR
* @param theRadius
*/
constructor(theCSYSR: Mx3dGeCSYSR, theRadius: number);
/**
*
* @param R
*/
SetRadius(R: number): void;
/**
*
* @returns
*/
Radius(): number;
/**
*
* @param U
* @returns
*/
ReversedParameter(U: number): number;
/**
*
* @returns
*/
Eccentricity(): number;
/**
*
* @returns
*/
FirstParameter(): number;
/**
*
* @returns
*/
LastParameter(): number;
/**
*
* @returns true false
*/
IsClosed(): boolean;
/**
*
* @returns true false
*/
IsPeriodic(): boolean;
/**
* U
* @param U
* @param P
*/
D0(U: number, P: Mx3dGePoint): void;
/**
* U
* @param U
* @param P
* @param V1
*/
D1(U: number, P: Mx3dGePoint, V1: Mx3dGeVec): void;
/**
* U
* @param U
* @param P
* @param V1
* @param V2
*/
D2(U: number, P: Mx3dGePoint, V1: Mx3dGeVec, V2: Mx3dGeVec): void;
/**
* U
* @param U
* @param P
* @param V1
* @param V2
* @param V3
*/
D3(U: number, P: Mx3dGePoint, V1: Mx3dGeVec, V2: Mx3dGeVec, V3: Mx3dGeVec): void;
/**
* U N
* @param U
* @param N
* @returns N
*/
DN(U: number, N: number): Mx3dGeVec;
/**
*
* @param T
*/
Transform(T: Mx3dGeTrsf): void;
/**
*
* @returns
*/
Copy(): Mx3dGeomObject;
/**
*
* @param p1
* @param p2
* @returns
*/
Edge(p1: number, p2: number): Mx3dShapeEdge;
/**
* 线
* @returns 线
*/
Wire(): Mx3dShapeWire;
/**
* 线
* @param Offset
* @param V
* @param isNotCheckC0 C0
* @returns 线
*/
OffsetCurve(Offset: number, V: Mx3dGeDir, isNotCheckC0: boolean): Mx3dShapeEdge;
/**
*
* @param thePt1
* @param thePt2
* @param thePt3
* @returns 线
*/
static MakeArcOfCircle(thePt1: UniPoint, thePt2: UniPoint, thePt3: UniPoint): Mx3dShapeEdge;
/**
* @internal
*/
DynCast(theObject: Mx3dGeomObject): this;
/**
* Mx3dGeomCircle
* @param theObject
* @returns Mx3dGeomCircle
*/
static DownCast(theObject: Mx3dGeomObject): Mx3dGeomCircle;
/**
*
* @returns
*/
DynamicType(): string;
}
/**
* 线 Mx3dGeomCurve
*/
export declare class Mx3dGeomLine extends Mx3dGeomCurve {
/**
*
* @param A1
*/
constructor(A1: Mx3dGeAxis);
/**
*
* @param P
* @param V
*/
constructor(P: Mx3dGePoint, V: Mx3dGeDir);
/**
* 线
* @param V
*/
SetDirection(V: Mx3dGeDir): void;
/**
* 线
* @param P
*/
SetLocation(P: Mx3dGePoint): void;
/**
* 线
* @param A1
*/
SetPosition(A1: Mx3dGeAxis): void;
/**
* 线
* @returns
*/
Position(): Mx3dGeAxis;
/**
* 线
*/
Reverse(): void;
/**
*
* @param U
* @returns
*/
ReversedParameter(U: number): number;
/**
* 线
* @returns
*/
FirstParameter(): number;
/**
* 线
* @returns
*/
LastParameter(): number;
/**
* 线
* @returns 线 true false
*/
IsClosed(): boolean;
/**
* 线
* @returns 线 true false
*/
IsPeriodic(): boolean;
/**
* 线
* @returns
*/
Continuity(): MdGe.MxGAShapeEnum;
/**
* 线 C^N
* @param N
* @returns 线 C^N true false
*/
IsCN(N: number): boolean;
/**
* U
* @param U
* @param P
*/
D0(U: number, P: Mx3dGePoint): void;
/**
* U
* @param U
* @param P
* @param V1
*/
D1(U: number, P: Mx3dGePoint, V1: Mx3dGeVec): void;
/**
* U
* @param U
* @param P
* @param V1
* @param V2
*/
D2(U: number, P: Mx3dGePoint, V1: Mx3dGeVec, V2: Mx3dGeVec): void;
/**
* U
* @param U
* @param P
* @param V1
* @param V2
* @param V3
*/
D3(U: number, P: Mx3dGePoint, V1: Mx3dGeVec, V2: Mx3dGeVec, V3: Mx3dGeVec): void;
/**
* U N
* @param U
* @param N
* @returns N
*/
DN(U: number, N: number): Mx3dGeVec;
/**
* 线
* @param T
*/
Transform(T: Mx3dGeTrsf): void;
/**
*
* @param U
* @param T
* @returns
*/
TransformedParameter(U: number, T: Mx3dGeTrsf): number;
/**
*
* @param T
* @returns
*/
ParametricTransformation(T: Mx3dGeTrsf): number;
/**
* 线
* @returns 线
*/
Copy(): Mx3dGeomObject;
/**
* 线
* @param p1
* @param p2
* @returns 线
*/
Edge(p1: number, p2: number): Mx3dShapeEdge;
/**
* 线线
* @param Offset
* @param V
* @param isNotCheckC0 C0
* @returns 线线
*/
OffsetCurve(Offset: number, V: Mx3dGeDir, isNotCheckC0: boolean): Mx3dShapeEdge;
/**
* @internal
*/
DynCast(theObject: Mx3dGeomObject): this;
/**
* Mx3dGeomLine
* @param theObject
* @returns Mx3dGeomLine
*/
static DownCast(theObject: Mx3dGeomObject): Mx3dGeomLine;
/**
*
* @returns
*/
DynamicType(): string;
}
/**
* Mx3dGeomConic
*/
export declare class Mx3dGeomEllipse extends Mx3dGeomConic {
/**
*
* @param A2
* @param MajorRadius
* @param MinorRadius
*/
constructor(A2: Mx3dGeCSYSR, MajorRadius: number, MinorRadius: number);
/**
*
* @param MajorRadius
*/
SetMajorRadius(MajorRadius: number): void;
/**
*
* @param MinorRadius
*/
SetMinorRadius(MinorRadius: number): void;
/**
*
* @param U
* @returns
*/
ReversedParameter(U: number): number;
/**
* 线
* @returns 线
*/
Directrix1(): Mx3dGeAxis;
/**
* 线
* @returns 线
*/
Directrix2(): Mx3dGeAxis;
/**
*
* @returns
*/
Eccentricity(): number;
/**
*
* @returns
*/
Focal(): number;
/**
*
* @returns
*/
Focus1(): Mx3dGePoint;
/**
*
* @returns
*/
Focus2(): Mx3dGePoint;
/**
*
* @returns
*/
MajorRadius(): number;
/**
*
* @returns
*/
MinorRadius(): number;
/**
*
* @returns
*/
Parameter(): number;
/**
*
* @returns
*/
FirstParameter(): number;
/**
*
* @returns
*/
LastParameter(): number;
/**
*
* @returns true false
*/
IsClosed(): boolean;
/**
*
* @returns true false
*/
IsPeriodic(): boolean;
/**
* U
* @param U
* @param P
*/
D0(U: number, P: Mx3dGePoint): void;
/**
* U
* @param U
* @param P
* @param V1
*/
D1(U: number, P: Mx3dGePoint, V1: Mx3dGeVec): void;
/**
* U
* @param U
* @param P
* @param V1
* @param V2
*/
D2(U: number, P: Mx3dGePoint, V1: Mx3dGeVec, V2: Mx3dGeVec): void;
/**
* U
* @param U
* @param P
* @param V1
* @param V2
* @param V3
*/
D3(U: number, P: Mx3dGePoint, V1: Mx3dGeVec, V2: Mx3dGeVec, V3: Mx3dGeVec): void;
/**
* U N
* @param U
* @param N
* @returns N
*/
DN(U: number, N: number): Mx3dGeVec;
/**
*
* @param T
*/
Transform(T: Mx3dGeTrsf): void;
/**
*
* @returns
*/
Copy(): Mx3dGeomObject;
/**
*
* @param p1
* @param p2
* @returns
*/
Edge(p1: number, p2: number): Mx3dShapeEdge;
/**
* Wire形状对象
* @returns Wire形状对象
*/
Wire(): Mx3dShapeWire;
/**
* 线
* @param Offset
* @param V
* @param isNotCheckC0 C0
* @returns 线
*/
OffsetCurve(Offset: number, V: Mx3dGeDir, isNotCheckC0: boolean): Mx3dShapeEdge;
/**
* @internal
*/
DynCast(theObject: Mx3dGeomObject): this;
/**
* Mx3dGeomEllipse
* @param theObject
* @returns Mx3dGeomEllipse
*/
static DownCast(theObject: Mx3dGeomObject): Mx3dGeomEllipse;
/**
*
* @returns
*/
DynamicType(): string;
}
/**
* 线 Mx3dGeomConic
*/
export declare class Mx3dGeomHyperbola extends Mx3dGeomConic {
/**
*
* @param A2
* @param MajorRadius
* @param MinorRadius
*/
constructor(A2: Mx3dGeCSYSR, MajorRadius: number, MinorRadius: number);
/**
*
* @param MajorRadius
*/
SetMajorRadius(MajorRadius: number): void;
/**
*
* @param MinorRadius
*/
SetMinorRadius(MinorRadius: number): void;
/**
*
* @param U
* @returns
*/
ReversedParameter(U: number): number;
/**
* 线
* @returns
*/
FirstParameter(): number;
/**
* 线
* @returns
*/
LastParameter(): number;
/**
* 线
* @returns 线 true false
*/
IsClosed(): boolean;
/**
* 线
* @returns 线 true false
*/
IsPeriodic(): boolean;
/**
* 线
* @returns 线
*/
Asymptote1(): Mx3dGeAxis;
/**
* 线
* @returns 线
*/
Asymptote2(): Mx3dGeAxis;
/**
*
* @returns
*/
ConjugateBranch1(): Mx3dGeomHyperbola;
/**
*
* @returns
*/
ConjugateBranch2(): Mx3dGeomHyperbola;
/**
* 线
* @returns 线
*/
Directrix1(): Mx3dGeAxis;
/**
* 线
* @returns 线
*/
Directrix2(): Mx3dGeAxis;
/**
*
* @returns
*/
Eccentricity(): number;
/**
*
* @returns
*/
Focal(): number;
/**
*
* @returns
*/
Focus1(): Mx3dGePoint;
/**
*
* @returns
*/
Focus2(): Mx3dGePoint;
/**
*
* @returns
*/
MajorRadius(): number;
/**
*
* @returns
*/
MinorRadius(): number;
/**
* 线
* @returns 线
*/
OtherBranch(): Mx3dGeomHyperbola;
/**
*
* @returns
*/
Parameter(): number;
/**
* U
* @param U
* @param P
*/
D0(U: number, P: Mx3dGePoint): void;
/**
* U
* @param U
* @param P
* @param V1
*/
D1(U: number, P: Mx3dGePoint, V1: Mx3dGeVec): void;
/**
* U
* @param U
* @param P
* @param V1
* @param V2
*/
D2(U: number, P: Mx3dGePoint, V1: Mx3dGeVec, V2: Mx3dGeVec): void;
/**
* U
* @param U
* @param P
* @param V1
* @param V2
* @param V3
*/
D3(U: number, P: Mx3dGePoint, V1: Mx3dGeVec, V2: Mx3dGeVec, V3: Mx3dGeVec): void;
/**
* U N
* @param U
* @param N
* @returns N
*/
DN(U: number, N: number): Mx3dGeVec;
/**
* 线
* @param T
*/
Transform(T: Mx3dGeTrsf): void;
/**
* 线
* @returns 线
*/
Copy(): Mx3dGeomObject;
/**
* 线
* @param p1
* @param p2
* @returns 线
*/
Edge(p1: number, p2: number): Mx3dShapeEdge;
/**
* 线线
* @param Offset
* @param V
* @param isNotCheckC0 C0
* @returns 线
*/
OffsetCurve(Offset: number, V: Mx3dGeDir, isNotCheckC0: boolean): Mx3dShapeEdge;
/**
* @internal
*/
DynCast(theObject: Mx3dGeomObject): this;
/**
* Mx3dGeomHyperbola
* @param theObject
* @returns Mx3dGeomHyperbola
*/
static DownCast(theObject: Mx3dGeomObject): Mx3dGeomHyperbola;
/**
*
* @returns
*/
DynamicType(): string;
}
export declare class Mx3dGeomParabola extends Mx3dGeomConic {
/**
*
* @param A2
* @param Focal
*/
constructor(A2: Mx3dGeCSYSR, Focal: number);
/**
*
* @param Focal
*/
SetFocal(Focal: number): void;
/**
*
* @param U
* @returns
*/
ReversedParameter(U: number): number;
/**
* 线
* @returns
*/
FirstParameter(): number;
/**
* 线
* @returns
*/
LastParameter(): number;
/**
* 线
* @returns 线 true false
*/
IsClosed(): boolean;
/**
* 线
* @returns 线 true false
*/
IsPeriodic(): boolean;
/**
* 线
* @returns 线
*/
Directrix(): Mx3dGeAxis;
/**
*
* @returns
*/
Eccentricity(): number;
/**
*
* @returns
*/
Focus(): Mx3dGePoint;
/**
*
* @returns
*/
Focal(): number;
/**
*
* @returns
*/
Parameter(): number;
/**
* U
* @param U
* @param P
*/
D0(U: number, P: Mx3dGePoint): void;
/**
* U
* @param U
* @param P
* @param V1
*/
D1(U: number, P: Mx3dGePoint, V1: Mx3dGeVec): void;
/**
* U
* @param U
* @param P
* @param V1
* @param V2
*/
D2(U: number, P: Mx3dGePoint, V1: Mx3dGeVec, V2: Mx3dGeVec): void;
/**
* U
* @param U
* @param P
* @param V1
* @param V2
* @param V3
*/
D3(U: number, P: Mx3dGePoint, V1: Mx3dGeVec, V2: Mx3dGeVec, V3: Mx3dGeVec): void;
/**
* U N
* @param U
* @param N
* @returns N
*/
DN(U: number, N: number): Mx3dGeVec;
/**
* 线
* @param T
*/
Transform(T: Mx3dGeTrsf): void;
/**
*
* @param U
* @param T
* @returns
*/
TransformedParameter(U: number, T: Mx3dGeTrsf): number;
/**
*
* @param T
* @returns
*/
ParametricTransformation(T: Mx3dGeTrsf): number;
/**
* 线
* @returns 线
*/
Copy(): Mx3dGeomObject;
/**
* 线
* @param p1
* @param p2
* @returns 线
*/
Edge(p1: number, p2: number): Mx3dShapeEdge;
/**
* 线线
* @param Offset
* @param V
* @param isNotCheckC0 C0
* @returns 线
*/
OffsetCurve(Offset: number, V: Mx3dGeDir, isNotCheckC0: boolean): Mx3dShapeEdge;
/**
* @internal
*/
DynCast(theObject: Mx3dGeomObject): this;
/**
* Mx3dGeomParabola
* @param theObject
* @returns Mx3dGeomParabola
*/
static DownCast(theObject: Mx3dGeomObject): Mx3dGeomParabola;
/**
*
* @returns
*/
DynamicType(): string;
}
/**
* Mx3dBaseObject
*/
export declare class Mx3dMkObject extends Mx3dBaseObject {
/**
* @internal
*/
constructor(p?: object);
}
/**
* Mx3dMkObject
*/
export declare class Mx3dMkBox extends Mx3dMkObject {
/**
*
* @param thePnt1
* @param thePnt2
*/
constructor(thePnt1: UniPoint, thePnt2: UniPoint);
/**
* (0, 0, 0)(theDX, theDY, theDZ)
* @param theDX X方向分量
* @param theDY Y方向分量
* @param theDZ Z方向分量
*/
constructor(theDX: number, theDY: number, theDZ: number);
/**
* theAxes (0, 0, 0)(theDX, theDY, theDZ)
* @param theAxes
* @param theDX X方向分量
* @param theDY Y方向分量
* @param theDZ Z方向分量
*/
constructor(theAxes: Mx3dGeCSYSR, theDX: number, theDY: number, theDZ: number);
/**
*
*/
Build(): void;
/**
*
* @returns
*/
Shape(): Mx3dShapeObject;
/**
*
* @returns
*/
Shell(): Mx3dShapeShell;
/**
*
* @returns
*/
Solid(): Mx3dShapeSolid;
/**
*
* @returns
*/
BottomFace(): Mx3dShapeFace;
/**
*
* @returns
*/
BackFace(): Mx3dShapeFace;
/**
*
* @returns
*/
FrontFace(): Mx3dShapeFace;
/**
*
* @returns
*/
LeftFace(): Mx3dShapeFace;
/**
*
* @returns
*/
RightFace(): Mx3dShapeFace;
/**
*
* @returns
*/
TopFace(): Mx3dShapeFace;
/**
*
* @returns true false
*/
IsDone(): boolean;
}
/**
* Mx3dMkObject
*/
export declare class Mx3dMkCone extends Mx3dMkObject {
/**
*
* @param Axes
* @param R1
* @param R2
* @param H
* @param angle
*/
constructor(Axes: Mx3dGeCSYSR, R1: number, R2: number, H: number, angle?: number);
/**
*
*/
Build(): void;
/**
*
* @returns
*/
Shape(): Mx3dShapeObject;
/**
*
* @returns
*/
Face(): Mx3dShapeFace;
/**
*
* @returns
*/
Shell(): Mx3dShapeShell;
/**
*
* @returns
*/
Solid(): Mx3dShapeSolid;
/**
*
* @returns true false
*/
IsDone(): boolean;
}
/**
* Mx3dMkObject
*/
export declare class Mx3dMkCylinder extends Mx3dMkObject {
/**
*
* @param Axes
* @param R
* @param H
* @param Angle
*/
constructor(Axes: Mx3dGeCSYSR, R: number, H: number, Angle?: number);
/**
*
*/
Build(): void;
/**
*
* @returns
*/
Shape(): Mx3dShapeObject;
/**
*
* @returns
*/
Face(): Mx3dShapeFace;
/**
*
* @returns
*/
Shell(): Mx3dShapeShell;
/**
*
* @returns
*/
Solid(): Mx3dShapeSolid;
/**
*
* @returns true false
*/
IsDone(): boolean;
}
/**
* Mx3dMkObject
*/
export declare class Mx3dMkRevol extends Mx3dMkObject {
/**
*
* @param S
* @param A
* @param D
*/
constructor(S: Mx3dShapeObject, A: Mx3dGeAxis, D?: number);
/**
*
*/
Build(): void;
/**
*
* @returns
*/
Shape(): Mx3dShapeObject;
/**
*
* @returns true false
*/
IsDone(): boolean;
}
/**
* Mx3dMkObject
*/
export declare class Mx3dMkSphere extends Mx3dMkObject {
/**
*
* @param Axes
* @param R
*/
constructor(Axes: Mx3dGeCSYSR, R: number);
/**
*
* @param Axes
* @param R
* @param angle
*/
constructor(Axes: Mx3dGeCSYSR, R: number, angle: number);
/**
*
* @param Axes
* @param R
* @param angle1
* @param angle2
*/
constructor(Axes: Mx3dGeCSYSR, R: number, angle1: number, angle2: number);
/**
*
* @param Axes
* @param R
* @param angle1
* @param angle2
* @param angle3
*/
constructor(Axes: Mx3dGeCSYSR, R: number, angle1: number, angle2: number, angle3: number);
/**
*
*/
Build(): void;
/**
*
* @returns
*/
Shape(): Mx3dShapeObject;
/**
*
* @returns
*/
Face(): Mx3dShapeFace;
/**
*
* @returns
*/
Shell(): Mx3dShapeShell;
/**
*
* @returns
*/
Solid(): Mx3dShapeSolid;
/**
*
* @returns true false
*/
IsDone(): boolean;
}
/**
* Mx3dMkObject
*/
export declare class Mx3dMkTorus extends Mx3dMkObject {
/**
*
* @param Axes
* @param R1
* @param R2
*/
constructor(Axes: Mx3dGeCSYSR, R1: number, R2: number);
/**
*
* @param Axes
* @param R1
* @param R2
* @param angle
*/
constructor(Axes: Mx3dGeCSYSR, R1: number, R2: number, angle: number);
/**
*
* @param Axes
* @param R1
* @param R2
* @param angle1
* @param angle2
*/
constructor(Axes: Mx3dGeCSYSR, R1: number, R2: number, angle1: number, angle2: number);
/**
*
* @param Axes
* @param R1
* @param R2
* @param angle1
* @param angle2
* @param angle3
*/
constructor(Axes: Mx3dGeCSYSR, R1: number, R2: number, angle1: number, angle2: number, angle: number);
/**
*
*/
Build(): void;
/**
*
* @returns
*/
Shape(): Mx3dShapeObject;
/**
*
* @returns
*/
Face(): Mx3dShapeFace;
/**
*
* @returns
*/
Shell(): Mx3dShapeShell;
/**
*
* @returns
*/
Solid(): Mx3dShapeSolid;
/**
*
* @returns true false
*/
IsDone(): boolean;
}
/**
* Mx3dMkObject
*/
export declare class Mx3dMkPipe extends Mx3dMkObject {
/**
*
* @param Spine 线
* @param Profile
*/
constructor(Spine: Mx3dShapeWire, Profile: Mx3dShapeObject);
/**
*
* @param Spine 线
* @param Profile
* @param aMode
* @param ForceApproxC1 C1连续性
*/
constructor(Spine: Mx3dShapeWire, Profile: Mx3dShapeObject, aMode: MdGe.MxGFTrihedron, ForceApproxC1: boolean);
/**
*
*/
Build(): void;
/**
*
* @returns
*/
Shape(): Mx3dShapeObject;
/**
*
* @returns true false
*/
IsDone(): boolean;
}
/**
* Mx3dMkObject
*/
export declare class Mx3dMkPrism extends Mx3dMkObject {
/**
*
* @param S
* @param V
*/
constructor(S: Mx3dShapeObject, V: Mx3dGeVec);
/**
*
* @param S
* @param D
*/
constructor(S: Mx3dShapeObject, D: Mx3dGeDir);
/**
*
*/
Build(): void;
/**
*
* @returns
*/
Shape(): Mx3dShapeObject;
/**
*
* @returns true false
*/
IsDone(): boolean;
}
/**
* Mx3dMkObject
*/
export declare class Mx3dMkWedge extends Mx3dMkObject {
/**
*
* @param dx 沿x轴方向的尺寸
* @param dy 沿y轴方向的尺寸
* @param dz 沿z轴方向的尺寸
* @param ltx
*/
constructor(dx: number, dy: number, dz: number, ltx: number);
/**
*
* @param Axes
* @param dx 沿x轴方向的尺寸
* @param dy 沿y轴方向的尺寸
* @param dz 沿z轴方向的尺寸
* @param ltx
*/
constructor(Axes: Mx3dGeCSYSR, dx: number, dy: number, dz: number, ltx: number);
/**
*
* @param dx 沿x轴方向的尺寸
* @param dy 沿y轴方向的尺寸
* @param dz 沿z轴方向的尺寸
* @param xmin x轴方向的最小边界值
* @param zmin z轴方向的最小边界值
* @param xmax x轴方向的最大边界值
* @param zmax z轴方向的最大边界值
*/
constructor(dx: number, dy: number, dz: number, xmin: number, zmin: number, xmax: number, zmax: number);
/**
*
* @param Axes
* @param dx 沿x轴方向的尺寸
* @param dy 沿y轴方向的尺寸
* @param dz 沿z轴方向的尺寸
* @param xmin x轴方向的最小边界值
* @param zmin z轴方向的最小边界值
* @param xmax x轴方向的最大边界值
* @param zmax z轴方向的最大边界值
*/
constructor(Axes: Mx3dGeCSYSR, dx: number, dy: number, dz: number, xmin: number, zmin: number, xmax: number, zmax: number);
/**
*
*/
Build(): void;
/**
*
* @returns
*/
Shape(): Mx3dShapeObject;
/**
*
* @returns
*/
Shell(): Mx3dShapeShell;
/**
*
* @returns
*/
Solid(): Mx3dShapeSolid;
/**
*
* @returns true false
*/
IsDone(): boolean;
}
/**
* Mx3dMkObject
*/
export declare class Mx3dMkLoft extends Mx3dMkObject {
/**
*
* @param isSolid false
* @param ruled 使 false
* @param pres3d 0
*/
constructor(isSolid?: boolean, ruled?: boolean, pres3d?: number);
/**
* Wire到放样体
* @param wire Wire对象
*/
AddWire(wire: Mx3dShapeWire): void;
/**
*
* @param aVertex
*/
AddVertex(aVertex: Mx3dShapeVertex): void;
/**
* 使
* @param UseSmoothing 使
*/
SetSmoothing(UseSmoothing: boolean): void;
/**
*
* @param C
*/
SetContinuity(C: MdGe.MxGAShapeEnum): void;
/**
*
* @returns
*/
Continuity(): MdGe.MxGAShapeEnum;
/**
* 使
* @returns 使true 使false 使
*/
UseSmoothing(): boolean;
/**
*
*/
Build(): void;
/**
*
* @returns
*/
Shape(): Mx3dShapeObject;
/**
*
* @returns true false
*/
IsDone(): boolean;
}
/**
* 线 Mx3dMkObject
*/
export declare class Mx3dMkPolygon extends Mx3dMkObject {
/**
* 线
*/
constructor();
/**
* 线
* @param P
*/
Add(P: Mx3dGePoint): void;
/**
*
* @returns true false
*/
Added(): boolean;
/**
* 线
*/
Close(): void;
/**
* 线
* @returns
*/
FirstVertex(): Mx3dShapeVertex;
/**
* 线
* @returns
*/
LastVertex(): Mx3dShapeVertex;
/**
* 线
*/
Build(): void;
/**
* 线
* @returns 线
*/
Shape(): Mx3dShapeObject;
/**
*
* @returns true false
*/
IsDone(): boolean;
/**
* 线Edge对象
* @returns 线Edge对象
*/
Edge(): Mx3dShapeEdge;
/**
* 线Wire对象
* @returns 线Wire对象
*/
Wire(): Mx3dShapeWire;
}
/**
* Mx3dMkObject
*/
export declare class Mx3dMkFace extends Mx3dMkObject {
/**
* Wire对象和一个布尔值来初始化面对象
* @param theWire 使线 (WireHole)
* @param OnlyPlane false
*/
constructor(theWire: Mx3dShapeWire | Mx3dShapeFace, OnlyPlane?: boolean);
/**
*
*/
Build(): void;
/**
*
* @returns
*/
Shape(): Mx3dShapeObject;
/**
*
* @returns
*/
Face(): Mx3dShapeFace;
/**
*
* @returns true false
*/
IsDone(): boolean;
Add(W: Mx3dShapeWire): void;
}
/**
* Mx3dMkObject
*/
export declare class Mx3dMkThickSolid extends Mx3dMkObject {
/**
*
*/
constructor();
/**
* 使
*
* @param theS 使
* @param theOffsetValue
*/
MakeThickSolidBySimple(theS: Mx3dShapeObject, theOffsetValue: number): void;
/**
* 使
*
* @param S 使
* @param ClosingFaces
* @param Offset
* @param Tol
* @param Mode BRepOffset_Skin线
* @param Intersection
* @param SelfInter
* @param Join GeomAbs_Arc线
* @param RemoveIntEdges
*/
MakeThickSolidByJoin(S: Mx3dShapeObject, ClosingFaces: Mx3dShapeObject[], Offset: number, Tol: number, Mode?: MdGe.MxOffsetModeEnum, Intersection?: boolean, SelfInter?: boolean, Join?: MdGe.MxGAJoinTypeEnum, RemoveIntEdges?: boolean): void;
/**
*
*
*/
Build(): void;
/**
*
* @returns
*/
Shape(): Mx3dShapeObject;
/**
*
* @returns true false
*/
IsDone(): boolean;
}
/**
* Wire
*/
export declare class Mx3dWireTool {
/**
* 线线
* 线
*
* @param edges -
* @param toler -
* @param shared - true false
* @returns 线线
*/
static ConnectEdgesToWires(edges: Mx3dShapeObject[], toler: number, shared: boolean): Mx3dShapeObject[];
/**
* 线线线线
* 线线
*
* @param wires - 线
* @param toler - 线
* @param shared - true线 false线
* @returns 线线
*/
static ConnectWiresToWires(wires: Mx3dShapeObject[], toler: number, shared: boolean): Mx3dShapeObject[]; /**
* Edge Wire
* @param theEdge Edge
* @returns Wire
*/
static EdgeToWire(theEdge: Mx3dShapeEdge): Mx3dShapeWire;
}
/**
* 线
*/
export declare class Mx3dGeomBoundedCurve extends Mx3dGeomCurve {
/**
* @internal
*/
constructor(p?: object);
/**
*
* @returns
*/
DynamicType(): string;
}
/**
* B样条曲线
* Mx3dGeomBoundedCurve并封装了B样条曲线的操作和属性
*/
export declare class Mx3dGeomBSplineCurve extends Mx3dGeomBoundedCurve {
/**
* B样条曲线
* @param Poles
* @param Knots
* @param Multiplicities
* @param Degree 线
*/
constructor(Poles: Mx3dGePoint[], Knots: number[], Multiplicities: number[], Degree: number);
/**
* B样条曲线
* @param Poles
* @param Weights
* @param Knots
* @param Multiplicities
* @param Degree 线
*/
constructor(Poles: Mx3dGePoint[], Weights: number[], Knots: number[], Multiplicities: number[], Degree: number);
/**
* 线
* @param Degree
*/
IncreaseDegree(Degree: number): void;
/**
*
* @param Index
* @param M
*/
IncreaseMultiplicity(Index: number, M: number): void;
/**
*
* @param I1
* @param I2
* @param M
*/
IncreaseMultiplicity(I1: number, I2: number, M: number): void;
/**
*
* @param I1
* @param I2
* @param M
*/
IncrementMultiplicity(I1: number, I2: number, M: number): void;
/**
*
* @param U
* @param M
* @param ParametricTolerance
* @param Add
*/
InsertKnot(U: number, M?: number, ParametricTolerance?: number, Add?: boolean): void;
/**
*
* @param Knots
* @param Mults
* @param ParametricTolerance
* @param Add
*/
InsertKnots(Knots: number[], Mults: number[], ParametricTolerance?: number, Add?: boolean): void;
/**
*
* @param Index
* @param M
* @param Tolerance
* @returns
*/
RemoveKnot(Index: number, M: number, Tolerance: number): boolean;
/**
* 线
*/
Reverse(): void;
/**
*
* @param U
* @returns
*/
ReversedParameter(U: number): number;
/**
* 线
* @param U1
* @param U2
*/
Segment(U1: number, U2: number): void;
/**
*
* @param Index
* @param K
*/
SetKnot(Index: number, K: number): void;
/**
*
* @param Index
* @param K
* @param M
*/
SetKnot(Index: number, K: number, M: number): void;
/**
*
* @param dK
*/
SetKnots(dK: number[]): void;
/**
* 线
*/
SetPeriodic(): void;
/**
*
* @param Index
*/
SetOrigin(Index: number): void;
/**
*
* @param U
* @param Tol
*/
SetOrigin(U: number, Tol: number): void;
/**
* 线
*/
SetNotPeriodic(): void;
/**
*
* @param Index
* @param P
*/
SetPole(Index: number, P: UniPoint): void;
/**
*
* @param Index
* @param P
* @param Weight
*/
SetPole(Index: number, P: UniPoint, Weight: number): void;
/**
*
* @param Index
* @param Weight
*/
SetWeight(Index: number, Weight: number): void;
/**
* 线
* @param N
* @returns 线truefalse
*/
IsCN(N: number): boolean;
/**
* 线G1连续性
* @param theTf
* @param theTl
* @param theAngTol
* @returns 线G1连续性truefalse
*/
IsG1(theTf: number, theTl: number, theAngTol: number): boolean;
/**
* 线
* @returns 线truefalse
*/
IsClosed(): boolean;
/**
* 线
* @returns 线truefalse
*/
IsPeriodic(): boolean;
/**
* 线
* @returns 线truefalse
*/
IsRational(): boolean;
/**
* 线
* @returns 线
*/
Continuity(): MdGe.MxGAShapeEnum;
/**
* 线
* @returns 线
*/
Degree(): number;
/**
* 线
* @param U
* @param P
*/
D0(U: number, P: Mx3dGePoint): void;
/**
* 线
* @param U
* @param P
* @param V1
*/
D1(U: number, P: Mx3dGePoint, V1: Mx3dGeVec): void;
/**
* 线
* @param U
* @param P
* @param V1
* @param V2
*/
D2(U: number, P: Mx3dGePoint, V1: Mx3dGeVec, V2: Mx3dGeVec): void;
/**
* 线
* @param U
* @param P
* @param V1
* @param V2
* @param V3
*/
D3(U: number, P: Mx3dGePoint, V1: Mx3dGeVec, V2: Mx3dGeVec, V3: Mx3dGeVec): void;
/**
* 线N阶导数
* @param U
* @param N
* @returns N阶导数
*/
DN(U: number, N: number): Mx3dGeVec;
/**
*
* @param U
* @param FromK1
* @param ToK2
* @returns
*/
LocalValue(U: number, FromK1: number, ToK2: number): Mx3dGePoint;
/**
*
* @param U
* @param FromK1
* @param ToK2
* @param P
*/
LocalD0(U: number, FromK1: number, ToK2: number, P: Mx3dGePoint): void;
/**
*
* @param U
* @param FromK1
* @param ToK2
* @param P
* @param V1
*/
LocalD1(U: number, FromK1: number, ToK2: number, P: Mx3dGePoint, V1: Mx3dGeVec): void;
/**
*
* @param U
* @param FromK1
* @param ToK2
* @param P
* @param V1
* @param V2
*/
LocalD2(U: number, FromK1: number, ToK2: number, P: Mx3dGePoint, V1: Mx3dGeVec, V2: Mx3dGeVec): void;
/**
*
* @param U
* @param FromK1
* @param ToK2
* @param P
* @param V1
* @param V2
* @param V3
*/
LocalD3(U: number, FromK1: number, ToK2: number, P: Mx3dGePoint, V1: Mx3dGeVec, V2: Mx3dGeVec, V3: Mx3dGeVec): void;
/**
* N阶导数
* @param U
* @param FromK1
* @param ToK2
* @param N
* @returns N阶导数
*/
LocalDN(U: number, FromK1: number, ToK2: number, N: number): Mx3dGeVec;
/**
* 线
* @returns 线
*/
EndPoint(): Mx3dGePoint;
/**
* 线
* @returns
*/
FirstUKnotIndex(): number;
/**
* 线
* 线
* @returns
*/
FirstParameter(): number;
/**
* 线
* @param Index
* @returns
*/
Knot(Index: number): number;
/**
* 线
* @returns
*/
Knots(): number[];
/**
* 线
* @returns
*/
LastUKnotIndex(): number;
/**
* 线
* 线
* @returns
*/
LastParameter(): number;
/**
*
* 线
* @param Index
* @returns
*/
Multiplicity(Index: number): number;
/**
* 线
* 线
* @returns
*/
Multiplicities(): number[];
/**
* 线
* @returns
*/
NbKnots(): number;
/**
* 线
* @returns
*/
NbPoles(): number;
/**
*
* 线
* @param Index
* @returns
*/
Pole(Index: number): Mx3dGePoint;
/**
* 线
* @returns
*/
Poles(): Mx3dGePoint[];
/**
* 线
* @returns 线
*/
StartPoint(): Mx3dGePoint;
/**
*
* B样条曲线的局部形状和重要性
* @param Index
* @returns
*/
Weight(Index: number): number;
/**
* 线
* @returns
*/
Weights(): number[];
/**
* 线
* @param T
*/
Transform(T: Mx3dGeTrsf): void;
/**
* B样条曲线的副本
* @returns B样条曲线对象
*/
Copy(): Mx3dGeomObject;
/**
* 线
* @param p1
* @param p2
* @returns 线
*/
Edge(p1: number, p2: number): Mx3dShapeEdge;
/**
* 线Wire
* @returns 线Wire对象
*/
Wire(): Mx3dShapeWire;
/**
* 线
* @param Offset
* @param V
* @param isNotCheckC0 C0连续性
* @returns 线
*/
OffsetCurve(Offset: number, V: UniDir, isNotCheckC0: boolean): Mx3dShapeEdge;
/**
* 线线
* @param theOther B样条曲线对象
* @param thePreci
* @returns 线truefalse
*/
IsEqual(theOther: Mx3dGeomBSplineCurve, thePreci: number): boolean;
/**
* @internal
*/
DynCast(theObject: Mx3dGeomObject): this;
/**
* Mx3dGeomBSplineCurve
* @param theObject
* @returns Mx3dGeomBSplineCurve
*/
static DownCast(theObject: Mx3dGeomObject): Mx3dGeomBSplineCurve;
/**
*
* @returns
*/
DynamicType(): string;
}
/**
* Mx3dGeomBezierCurve Bezier曲线Bezier曲线的属性
*/
export declare class Mx3dGeomBezierCurve extends Mx3dGeomBoundedCurve {
/**
* Bezier曲线
* @param CurvePoles -
* @param PoleWeights -
*/
constructor(CurvePoles: Mx3dGePoint[], PoleWeights?: number[]);
/**
* Bezier曲线的阶数
* @param Degree -
*/
Increase(Degree: number): void;
/**
*
* @param Index -
* @param P -
* @param Weight -
*/
InsertPoleAfter(Index: number, P: Mx3dGePoint, Weight?: number): void;
/**
*
* @param Index -
* @param P -
* @param Weight -
*/
InsertPoleBefore(Index: number, P: Mx3dGePoint, Weight?: number): void;
/**
*
* @param Index -
*/
RemovePole(Index: number): void;
/**
* Bezier曲线的参数方向
*/
Reverse(): void;
/**
*
* @param U -
* @returns
*/
ReversedParameter(U: number): number;
/**
* Bezier曲线的一部分
* @param U1 -
* @param U2 -
*/
Segment(U1: number, U2: number): void;
/**
*
* @param Index -
* @param P -
* @param Weight -
*/
SetPole(Index: number, P: Mx3dGePoint, Weight?: number): void;
/**
*
* @param Index -
* @param Weight -
*/
SetWeight(Index: number, Weight: number): void;
/**
* 线
* @returns 线
*/
IsClosed(): boolean;
/**
* 线
* @param N -
* @returns 线
*/
IsCN(N: number): boolean;
/**
* 线
* @returns 线
*/
IsPeriodic(): boolean;
/**
* 线Bezier曲线
* @returns 线
*/
IsRational(): boolean;
/**
* 线
* @returns 线
*/
Continuity(): MdGe.MxGAShapeEnum;
/**
* 线
* @returns 线
*/
Degree(): number;
/**
* 线
* @param U -
* @param P -
*/
D0(U: number, P: Mx3dGePoint): void;
/**
* 线
* @param U -
* @param P -
* @param V1 -
*/
D1(U: number, P: Mx3dGePoint, V1: Mx3dGeVec): void;
/**
* 线
* @param U -
* @param P -
* @param V1 -
* @param V2 -
*/
D2(U: number, P: Mx3dGePoint, V1: Mx3dGeVec, V2: Mx3dGeVec): void;
/**
* 线
* @param U -
* @param P -
* @param V1 -
* @param V2 -
* @param V3 -
*/
D3(U: number, P: Mx3dGePoint, V1: Mx3dGeVec, V2: Mx3dGeVec, V3: Mx3dGeVec): void;
/**
* 线N阶导数
* @param U -
* @param N -
* @returns N阶导数
*/
DN(U: number, N: number): Mx3dGeVec;
/**
* 线
* @returns 线
*/
StartPoint(): Mx3dGePoint;
/**
* 线
* @returns 线
*/
EndPoint(): Mx3dGePoint;
/**
* 线
* @returns 线
*/
FirstParameter(): number;
/**
* 线
* @returns 线
*/
LastParameter(): number;
/**
* 线
* @returns 线
*/
NbPoles(): number;
/**
*
* @param Index -
* @returns
*/
Pole(Index: number): Mx3dGePoint;
/**
*
* @returns
*/
Poles(): Mx3dGePoint[];
/**
*
* @param Index -
* @returns
*/
Weight(Index: number): number;
/**
*
* @returns
*/
Weights(): number[];
/**
* 线
* @param T -
*/
Transform(T: Mx3dGeTrsf): void;
/**
* 线
* @returns 线
*/
Copy(): Mx3dGeomObject;
/**
*
* @param p1 -
* @param p2 -
* @returns
*/
Edge(p1: number, p2: number): Mx3dShapeEdge;
/**
* 线
* @returns 线
*/
Wire(): Mx3dShapeWire;
/**
* 线
* @param Offset -
* @param V -
* @param isNotCheckC0 - C0连续性
* @returns 线
*/
OffsetCurve(Offset: number, V: UniDir, isNotCheckC0: boolean): Mx3dShapeEdge;
/**
* @internal
*/
DynCast(theObject: Mx3dGeomObject): this;
/**
* Mx3dGeomBezierCurve
* @param theObject
* @returns Mx3dGeomBezierCurve
*/
static DownCast(theObject: Mx3dGeomObject): Mx3dGeomBezierCurve;
/**
*
* @returns
*/
DynamicType(): string;
}
/**
* Mx3dGeomSurface 3D
*/
export declare class Mx3dGeomSurface extends Mx3dGeomObject {
/**
* @internal
*/
constructor(p?: object);
/**
* U
* @returns
*/
UReversed(): this;
/**
* V
* @returns
*/
VReversed(): this;
/**
* T
* @param UV U V
* @param T
*/
TransformParameters(UV: [
dU: number,
dV: number
], T: Mx3dGeTrsf): void;
/**
* U
* @returns U
*/
UPeriod(): number;
/**
* V
* @returns V
*/
VPeriod(): number;
/**
* (U, V)
* @param U U
* @param V V
* @returns
*/
Value(U: number, V: number): Mx3dGePoint;
/**
*
* @returns
*/
DynamicType(): string;
}
/**
* Mx3dGeomElementarySurface Elementary Surface
* Mx3dGeomSurface
*/
export declare class Mx3dGeomElementarySurface extends Mx3dGeomSurface {
/**
* @internal
*/
constructor(p?: object);
/**
* Z轴
* @param theA1
*/
SetAxis(theA1: Mx3dGeAxis): void;
/**
*
* @param theLoc
*/
SetLocation(theLoc: Mx3dGePoint): void;
/**
*
* @param theAx3
*/
SetPosition(theAx3: Mx3dGeCSYSR): void;
/**
* Z轴
* @returns
*/
Axis(): Mx3dGeAxis;
/**
*
* @returns
*/
Location(): Mx3dGePoint;
/**
*
* @returns
*/
Position(): Mx3dGeCSYSR;
/**
* U
*/
UReverse(): void;
/**
* V
*/
VReverse(): void;
/**
* MxGAShapeEnum
* @returns
*/
Continuity(): MdGe.MxGAShapeEnum;
/**
* U
* @param N
* @returns true false
*/
IsCNu(N: number): boolean;
/**
* V
* @param N
* @returns true false
*/
IsCNv(N: number): boolean;
/**
*
* @returns
*/
DynamicType(): string;
}
/**
* Mx3dGeomPlane 3D空间中平面的功能
* (Mx3dGeCSYSR)
*/
export declare class Mx3dGeomPlane extends Mx3dGeomElementarySurface {
/**
* 3D空间中的平面
* @param A3 - (Mx3dGeCSYSR)
*/
constructor(A3: Mx3dGeCSYSR);
/**
*
* @param P -
* @param V -
*/
constructor(P: UniPoint, V: UniDir);
/**
*
* @param A - Ax + By + Cz + D = 0 A
* @param B - Ax + By + Cz + D = 0 B
* @param C - Ax + By + Cz + D = 0 C
* @param D - Ax + By + Cz + D = 0 D
*/
constructor(A: number, B: number, C: number, D: number);
/**
* U
*/
UReverse(): void;
/**
* U U
* @param U - U
* @returns U
*/
UReversedParameter(U: number): number;
/**
* V
*/
VReverse(): void;
/**
* V V
* @param V - V
* @returns V
*/
VReversedParameter(V: number): number;
/**
* U V T
* @param UV - [dU, dV]
* @param T - (Mx3dGeTrsf)
*/
TransformParameters(UV: [
dU: number,
dV: number
], T: Mx3dGeTrsf): void;
/**
*
* @param U1U2V1V2 - [dU1, dU2, dV1, dV2]
*/
Bounds(U1U2V1V2: [
dU1: number,
dU2: number,
dV1: number,
dV2: number
]): void;
/**
*
* @param ABCD - [dA, dB, dC, dD]
*/
Coefficients(ABCD: [
dA: number,
dB: number,
dC: number,
dD: number
]): void;
/**
* U
* @returns false
*/
IsUClosed(): boolean;
/**
* V
* @returns false
*/
IsVClosed(): boolean;
/**
* U
* @returns false
*/
IsUPeriodic(): boolean;
/**
* V
* @returns false
*/
IsVPeriodic(): boolean;
/**
* U V
* @param U - U
* @param V - V
* @param P - (Mx3dGePoint)
* P = O + U * XDir + V * YDir
* O XDir YDir U V
*/
D0(U: number, V: number, P: Mx3dGePoint): void;
/**
* U V
* @param U - U
* @param V - V
* @param P - (Mx3dGePoint)
* @param D1U - U (Mx3dGeVec)
* @param D1V - V (Mx3dGeVec)
*
* - P = O + U * XDir + V * YDir
* - D1U D1V XDir YDir
*/
D1(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec): void;
/**
* U V
* @param U - U
* @param V - V
* @param P - (Mx3dGePoint)
* @param D1U - U (Mx3dGeVec)
* @param D1V - V (Mx3dGeVec)
* @param D2U - U (Mx3dGeVec)
* @param D2V - V (Mx3dGeVec)
* @param D2UV - UV (Mx3dGeVec)
*
* - P = O + U * XDir + V * YDir
* - D1U D1V XDir YDir
* - D2UD2V D2UV
*/
D2(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec, D2U: Mx3dGeVec, D2V: Mx3dGeVec, D2UV: Mx3dGeVec): void;
/**
* U V
* @param U - U
* @param V - V
* @param P - (Mx3dGePoint)
* @param D1U - U (Mx3dGeVec)
* @param D1V - V (Mx3dGeVec)
* @param D2U - U (Mx3dGeVec)
* @param D2V - V (Mx3dGeVec)
* @param D2UV - UV (Mx3dGeVec)
* @param D3U - U (Mx3dGeVec)
* @param D3V - V (Mx3dGeVec)
* @param D3UUV - UUU (Mx3dGeVec)
* @param D3UVV - UVV (Mx3dGeVec)
*
* - P = O + U * XDir + V * YDir
* - D1U D1V XDir YDir
* - D2UD2V D2UV
* - D3UD3VD3UUV D3UVV
*/
D3(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec, D2U: Mx3dGeVec, D2V: Mx3dGeVec, D2UV: Mx3dGeVec, D3U: Mx3dGeVec, D3V: Mx3dGeVec, D3UUV: Mx3dGeVec, D3UVV: Mx3dGeVec): void;
/**
* U V
* @param U - U
* @param V - V
* @param Nu - U
* @param Nv - V
* @returns (Mx3dGeVec)
* @throws Nu + Nv < 1 Nu < 0 Nv < 0
*
*/
DN(U: number, V: number, Nu: number, Nv: number): Mx3dGeVec;
/**
* T
* @param T - (Mx3dGeTrsf)
*/
Transform(T: Mx3dGeTrsf): void;
/**
*
* @returns (Mx3dGeomObject)
*/
Copy(): Mx3dGeomObject;
/**
*
* @returns
*/
DynamicType(): string;
/**
* @internal
*/
DynCast(theObject: Mx3dGeomObject): this;
/**
* Mx3dGeomPlane
* @param theObject
* @returns Mx3dGeomPlane
*/
static DownCast(theObject: Mx3dGeomObject): Mx3dGeomPlane;
/**
*
* @param TolDegen -
* @returns (Mx3dShapeFace)
*/
Face(TolDegen: number): Mx3dShapeFace;
/**
* 线
* @param W - 线 (Mx3dShapeWire)
* @param Inside -
* @returns (Mx3dShapeFace)
*/
Face(W: Mx3dShapeWire, Inside: boolean): Mx3dShapeFace;
/**
* U V
* @param UMin - U
* @param UMax - U
* @param VMin - V
* @param VMax - V
* @param TolDegen -
* @returns (Mx3dShapeFace)
*/
Face(UMin: number, UMax: number, VMin: number, VMax: number, TolDegen: number): Mx3dShapeFace;
}
/**
*
*
*/
export declare class Mx3dGeomConicalSurface extends Mx3dGeomElementarySurface {
/**
*
* @param A3 -
* @param Ang - [0, PI/2]
* @param Radius -
*/
constructor(A3: Mx3dGeCSYSR, Ang: number, Radius: number);
/**
*
* @param R -
*/
SetRadius(R: number): void;
/**
*
* @param Ang - ]0, PI/2[
*/
SetSemiAngle(Ang: number): void;
/**
* U参数
* @param U - U参数
* @returns U参数
*/
UReversedParameter(U: number): number;
/**
* V参数
* @param V - V参数
* @returns V参数
*/
VReversedParameter(V: number): number;
/**
* V参数方向
*/
VReverse(): void;
/**
*
* @param UV - [dU, dV]
* @param T -
*/
TransformParameters(UV: [
dU: number,
dV: number
], T: Mx3dGeTrsf): void;
/**
*
* @returns
*/
Apex(): Mx3dGePoint;
/**
*
* @param U1U2V1V2 - [dU1, dU2, dV1, dV2]
*/
Bounds(U1U2V1V2: [
dU1: number,
dU2: number,
dV1: number,
dV2: number
]): void;
/**
*
* A1.X^2 + A2.Y^2 + A3.Z^2 + 2*(B1.X.Y + B2.X.Z + B3.Y.Z) + 2*(C1.X + C2.Y + C3.Z) + D = 0
* @param A1A2A3B1B2B3C1C2C3D - [A1, A2, A3, B1, B2, B3, C1, C2, C3, D]
*/
Coefficients(A1A2A3B1B2B3C1C2C3D: [
A1: number,
A2: number,
A3: number,
B1: number,
B2: number,
B3: number,
C1: number,
C2: number,
C3: number,
D: number
]): void;
/**
*
* @returns
*/
RefRadius(): number;
/**
*
* @returns
*/
SemiAngle(): number;
/**
* U参数是否闭合
* @returns true
*/
IsUClosed(): boolean;
/**
* V参数是否闭合
* @returns false
*/
IsVClosed(): boolean;
/**
* U参数是否周期性
* @returns true
*/
IsUPeriodic(): boolean;
/**
* V参数是否周期性
* @returns false
*/
IsVPeriodic(): boolean;
/**
* (U, V)
* @param U - U参数
* @param V - V参数
* @param P -
*/
D0(U: number, V: number, P: Mx3dGePoint): void;
/**
* (U, V) U和V方向的第一导数
* @param U - U参数
* @param V - V参数
* @param P -
* @param D1U - U方向的第一导数
* @param D1V - V方向的第一导数
*/
D1(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec): void;
/**
* (U, V) U和V方向的第一和第二导数
* @param U - U参数
* @param V - V参数
* @param P -
* @param D1U - U方向的第一导数
* @param D1V - V方向的第一导数
* @param D2U - U方向的第二导数
* @param D2V - V方向的第二导数
* @param D2UV - UV方向的混合导数
*/
D2(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec, D2U: Mx3dGeVec, D2V: Mx3dGeVec, D2UV: Mx3dGeVec): void;
/**
* (U, V) U和V方向的第一
* @param U - U参数
* @param V - V参数
* @param P -
* @param D1U - U方向的第一导数
* @param D1V - V方向的第一导数
* @param D2U - U方向的第二导数
* @param D2V - V方向的第二导数
* @param D2UV - UV方向的混合导数
* @param D3U - U方向的第三导数
* @param D3V - V方向的第三导数
* @param D3UUV - UU方向的混合导数
* @param D3UVV - UV方向的混合导数
*/
D3(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec, D2U: Mx3dGeVec, D2V: Mx3dGeVec, D2UV: Mx3dGeVec, D3U: Mx3dGeVec, D3V: Mx3dGeVec, D3UUV: Mx3dGeVec, D3UVV: Mx3dGeVec): void;
/**
* (U, V)
* @param U - U参数
* @param V - V参数
* @param Nu - U方向的导数阶数
* @param Nv - V方向的导数阶数
* @returns
* @throws Nu + Nv小于1Nu或Nv为负
*/
DN(U: number, V: number, Nu: number, Nv: number): Mx3dGeVec;
/**
*
* @param T -
*/
Transform(T: Mx3dGeTrsf): void;
/**
*
* @returns
*/
Copy(): Mx3dGeomObject;
/**
*
* @returns
*/
DynamicType(): string;
/**
* @internal
*/
DynCast(theObject: Mx3dGeomObject): this;
/**
* Mx3dGeomConicalSurface
* @param theObject
* @returns Mx3dGeomConicalSurface
*/
static DownCast(theObject: Mx3dGeomObject): Mx3dGeomConicalSurface;
/**
*
* @param TolDegen -
* @returns
*/
Face(TolDegen: number): Mx3dShapeFace;
/**
* 线
* @param W - 线
* @param Inside -
* @returns
*/
Face(W: Mx3dShapeWire, Inside: boolean): Mx3dShapeFace;
/**
*
* @param UMin - U参数的最小值
* @param UMax - U参数的最大值
* @param VMin - V参数的最小值
* @param VMax - V参数的最大值
* @param TolDegen -
* @returns
*/
Face(UMin: number, UMax: number, VMin: number, VMax: number, TolDegen: number): Mx3dShapeFace;
}
/**
* Mx3dGeomCylindricalSurface Mx3dGeomElementarySurface
*/
export declare class Mx3dGeomCylindricalSurface extends Mx3dGeomElementarySurface {
/**
*
* @param A3
* @param Radius
*/
constructor(A3: Mx3dGeCSYSR, Radius: number);
/**
*
* @param R
*/
SetRadius(R: number): void;
/**
* U
* @param U U
* @returns
*/
UReversedParameter(U: number): number;
/**
* V
* @param V V
* @returns
*/
VReversedParameter(V: number): number;
/**
* U V
* @param UV [dU, dV]
* @param T
*/
TransformParameters(UV: [
dU: number,
dV: number
], T: Mx3dGeTrsf): void;
/**
*
* @param U1U2V1V2 [dU1, dU2, dV1, dV2]
*/
Bounds(U1U2V1V2: [
dU1: number,
dU2: number,
dV1: number,
dV2: number
]): void;
/**
*
* @param A1A2A3B1B2B3C1C2C3D [A1, A2, A3, B1, B2, B3, C1, C2, C3, D]
*/
Coefficients(A1A2A3B1B2B3C1C2C3D: [
A1: number,
A2: number,
A3: number,
B1: number,
B2: number,
B3: number,
C1: number,
C2: number,
C3: number,
D: number
]): void;
/**
*
* @returns
*/
Radius(): number;
/**
* U
* @returns true false
*/
IsUClosed(): boolean;
/**
* V
* @returns true false
*/
IsVClosed(): boolean;
/**
* U
* @returns true false
*/
IsUPeriodic(): boolean;
/**
* V
* @returns true false
*/
IsVPeriodic(): boolean;
/**
*
* @param U U
* @param V V
* @param P
*/
D0(U: number, V: number, P: Mx3dGePoint): void;
/**
*
* @param U U
* @param V V
* @param P
* @param D1U U
* @param D1V V
*/
D1(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec): void;
/**
*
* @param U U
* @param V V
* @param P
* @param D1U U
* @param D1V V
* @param D2U U
* @param D2V V
* @param D2UV U V
*/
D2(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec, D2U: Mx3dGeVec, D2V: Mx3dGeVec, D2UV: Mx3dGeVec): void;
/**
*
* @param U U
* @param V V
* @param P
* @param D1U U
* @param D1V V
* @param D2U U
* @param D2V V
* @param D2UV U V
* @param D3U U
* @param D3V V
* @param D3UUV U U
* @param D3UVV U V
*/
D3(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec, D2U: Mx3dGeVec, D2V: Mx3dGeVec, D2UV: Mx3dGeVec, D3U: Mx3dGeVec, D3V: Mx3dGeVec, D3UUV: Mx3dGeVec, D3UVV: Mx3dGeVec): void;
/**
*
* @param U U
* @param V V
* @param Nu U
* @param Nv V
* @returns
*/
DN(U: number, V: number, Nu: number, Nv: number): Mx3dGeVec;
/**
* T
* @param T
*/
Transform(T: Mx3dGeTrsf): void;
/**
*
* @returns
*/
Copy(): Mx3dGeomObject;
/**
*
* @returns
*/
DynamicType(): string;
/**
* @internal
*/
DynCast(theObject: Mx3dGeomObject): this;
/**
* Mx3dGeomCylindricalSurface
* @param theObject
* @returns Mx3dGeomCylindricalSurface
*/
static DownCast(theObject: Mx3dGeomObject): Mx3dGeomCylindricalSurface;
/**
*
* @param TolDegen 退
* @returns
*/
Face(TolDegen: number): Mx3dShapeFace;
/**
*
* @param W 线
* @param Inside
* @returns
*/
Face(W: Mx3dShapeWire, Inside: boolean): Mx3dShapeFace;
/**
*
* @param UMin U
* @param UMax U
* @param VMin V
* @param VMax V
* @param TolDegen 退
* @returns
*/
Face(UMin: number, UMax: number, VMin: number, VMax: number, TolDegen: number): Mx3dShapeFace;
}
/**
*
*
*/
export declare class Mx3dGeomSphericalSurface extends Mx3dGeomElementarySurface {
/**
*
* @param A3 Mx3dGeCSYSR
* @param Radius
*/
constructor(A3: Mx3dGeCSYSR, Radius: number);
/**
*
* @param R
*/
SetRadius(R: number): void;
/**
* U参数方向反转后的U参数值
* @param U U参数
* @returns U参数值
*/
UReversedParameter(U: number): number;
/**
* V参数方向反转后的V参数值
* @param V V参数
* @returns V参数值
*/
VReversedParameter(V: number): number;
/**
*
* @returns
*/
Area(): number;
/**
*
* @param U1U2V1V2 [dU1, dU2, dV1, dV2]
*/
Bounds(U1U2V1V2: [
dU1: number,
dU2: number,
dV1: number,
dV2: number
]): void;
/**
*
* @param A1A2A3B1B2B3C1C2C3D [A1, A2, A3, B1, B2, B3, C1, C2, C3, D]
*/
Coefficients(A1A2A3B1B2B3C1C2C3D: [
A1: number,
A2: number,
A3: number,
B1: number,
B2: number,
B3: number,
C1: number,
C2: number,
C3: number,
D: number
]): void;
/**
*
* @returns
*/
Radius(): number;
/**
*
* @returns
*/
Volume(): number;
/**
* U方向是否闭合
* @returns U方向闭合则为TrueFalse
*/
IsUClosed(): boolean;
/**
* V方向是否闭合
* @returns V方向闭合则为TrueFalse
*/
IsVClosed(): boolean;
/**
* U方向是否周期性
* @returns U方向周期性则为TrueFalse
*/
IsUPeriodic(): boolean;
/**
* V方向是否周期性
* @returns V方向周期性则为TrueFalse
*/
IsVPeriodic(): boolean;
/**
* U和V参数的表面点
* @param U U参数
* @param V V参数
* @param P
*/
D0(U: number, V: number, P: Mx3dGePoint): void;
/**
* U和V参数的点及其一阶导数
* @param U U参数
* @param V V参数
* @param P
* @param D1U U方向的导数
* @param D1V V方向的导数
*/
D1(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec): void;
/**
* U和V参数的点
* @param U U参数
* @param V V参数
* @param P
* @param D1U U方向的一阶导数
* @param D1V V方向的一阶导数
* @param D2U U方向的二阶导数
* @param D2V V方向的二阶导数
* @param D2UV
*/
D2(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec, D2U: Mx3dGeVec, D2V: Mx3dGeVec, D2UV: Mx3dGeVec): void;
/**
* U和V参数的点
* @param U U参数
* @param V V参数
* @param P
* @param D1U U方向的一阶导数
* @param D1V V方向的一阶导数
* @param D2U U方向的二阶导数
* @param D2V V方向的二阶导数
* @param D2UV
* @param D3U U方向的三阶导数
* @param D3V V方向的三阶导数
* @param D3UUV U和U
* @param D3UVV U和V
*/
D3(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec, D2U: Mx3dGeVec, D2V: Mx3dGeVec, D2UV: Mx3dGeVec, D3U: Mx3dGeVec, D3V: Mx3dGeVec, D3UUV: Mx3dGeVec, D3UVV: Mx3dGeVec): void;
/**
* U和V方向上的指定阶数导数
* @param U U参数
* @param V V参数
* @param Nu U方向上的导数阶数
* @param Nv V方向上的导数阶数
* @returns N阶导数向量
*/
DN(U: number, V: number, Nu: number, Nv: number): Mx3dGeVec;
/**
*
* @param T
*/
Transform(T: Mx3dGeTrsf): void;
/**
*
* @returns
*/
Copy(): Mx3dGeomObject;
/**
*
* @returns
*/
DynamicType(): string;
/**
* @internal
*/
DynCast(theObject: Mx3dGeomObject): this;
/**
* Mx3dGeomSphericalSurface
* @param theObject
* @returns Mx3dGeomSphericalSurface
*/
static DownCast(theObject: Mx3dGeomObject): Mx3dGeomSphericalSurface;
/**
* 使退
* @param TolDegen 退
* @returns
*/
Face(TolDegen: number): Mx3dShapeFace;
/**
* 使线
* @param W 线
* @param Inside 线
* @returns
*/
Face(W: Mx3dShapeWire, Inside: boolean): Mx3dShapeFace;
/**
* 使退
* @param UMin U值
* @param UMax U值
* @param VMin V值
* @param VMax V值
* @param TolDegen 退退
* @returns
*/
Face(UMin: number, UMax: number, VMin: number, VMax: number, TolDegen: number): Mx3dShapeFace;
}
/**
* Toroidal Surface
*
*/
export declare class Mx3dGeomToroidalSurface extends Mx3dGeomElementarySurface {
/**
*
* @param A3 Mx3dGeCSYSR
* @param MajorRadius
* @param MinorRadius
*/
constructor(A3: Mx3dGeCSYSR, MajorRadius: number, MinorRadius: number);
/**
*
* @param MajorRadius
*/
SetMajorRadius(MajorRadius: number): void;
/**
*
* @param MinorRadius
*/
SetMinorRadius(MinorRadius: number): void;
/**
* U参数上的环面U方向反转后的参数值
* @param U U参数
* @returns U参数值
*/
UReversedParameter(U: number): number;
/**
* V参数上的环面V方向反转后的参数值
* @param V V参数
* @returns V参数值
*/
VReversedParameter(V: number): number;
/**
*
* @returns
*/
Area(): number;
/**
*
* @param U1U2V1V2 [U1, U2, V1, V2]
*/
Bounds(U1U2V1V2: [
dU1: number,
dU2: number,
dV1: number,
dV2: number
]): void;
/**
*
* @param Coef 31
*/
Coefficients(Coef: number[]): void;
/**
*
* @returns
*/
MajorRadius(): number;
/**
*
* @returns
*/
MinorRadius(): number;
/**
*
* @returns
*/
Volume(): number;
/**
* U方向是否闭合
* @returns U方向闭合则返回truefalse
*/
IsUClosed(): boolean;
/**
* V方向是否闭合
* @returns V方向闭合则返回truefalse
*/
IsVClosed(): boolean;
/**
* U方向是否周期性
* @returns U方向周期性则返回truefalse
*/
IsUPeriodic(): boolean;
/**
* V方向是否周期性
* @returns V方向周期性则返回truefalse
*/
IsVPeriodic(): boolean;
/**
* U和V参数处的点
* @param U U
* @param V V
* @param P Mx3dGePoint
*/
D0(U: number, V: number, P: Mx3dGePoint): void;
/**
* UV方向的一阶导数
* @param U U
* @param V V
* @param P Mx3dGePoint
* @param D1U U方向的一阶导数Mx3dGeVec
* @param D1V V方向的一阶导数Mx3dGeVec
*/
D1(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec): void;
/**
*
* @param U U
* @param V V
* @param P Mx3dGePoint
* @param D1U U方向的一阶导数Mx3dGeVec
* @param D1V V方向的一阶导数Mx3dGeVec
* @param D2U U方向的二阶导数Mx3dGeVec
* @param D2V V方向的二阶导数Mx3dGeVec
* @param D2UV U,V方向的二阶混合导数Mx3dGeVec
*/
D2(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec, D2U: Mx3dGeVec, D2V: Mx3dGeVec, D2UV: Mx3dGeVec): void;
/**
*
* @param U U
* @param V V
* @param P Mx3dGePoint
* @param D1U U方向的一阶导数Mx3dGeVec
* @param D1V V方向的一阶导数Mx3dGeVec
* @param D2U U方向的二阶导数Mx3dGeVec
* @param D2V V方向的二阶导数Mx3dGeVec
* @param D2UV U,V方向的二阶混合导数Mx3dGeVec
* @param D3U U方向的三阶导数Mx3dGeVec
* @param D3V V方向的三阶导数Mx3dGeVec
* @param D3UUV U方向的二阶混合三阶导数Mx3dGeVec
* @param D3UVV V方向的二阶混合三阶导数Mx3dGeVec
*/
D3(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec, D2U: Mx3dGeVec, D2V: Mx3dGeVec, D2UV: Mx3dGeVec, D3U: Mx3dGeVec, D3V: Mx3dGeVec, D3UUV: Mx3dGeVec, D3UVV: Mx3dGeVec): void;
/**
* (U, V)
* @param U U
* @param V V
* @param Nu U方向阶数
* @param Nv V方向阶数
* @returns Mx3dGeVec
*/
DN(U: number, V: number, Nu: number, Nv: number): Mx3dGeVec;
/**
* T到环面
* @param T Mx3dGeTrsf
*/
Transform(T: Mx3dGeTrsf): void;
/**
*
* @returns Mx3dGeomObject
*/
Copy(): Mx3dGeomObject;
/**
*
* @returns
*/
DynamicType(): string;
/**
* @internal
*/
DynCast(theObject: Mx3dGeomObject): this;
/**
* Mx3dGeomToroidalSurface
* @param theObject
* @returns Mx3dGeomToroidalSurface
*/
static DownCast(theObject: Mx3dGeomObject): Mx3dGeomToroidalSurface;
/**
*
* @param TolDegen 退
* @returns Mx3dShapeFace
*/
Face(TolDegen: number): Mx3dShapeFace;
/**
* 线
* @param W 线Mx3dShapeWire
* @param Inside
* @returns Mx3dShapeFace
*/
Face(W: Mx3dShapeWire, Inside: boolean): Mx3dShapeFace;
/**
* U, V范围
* @param UMin U参数
* @param UMax U参数
* @param VMin V参数
* @param VMax V参数
* @param TolDegen 退
* @returns Mx3dShapeFace
*/
Face(UMin: number, UMax: number, VMin: number, VMax: number, TolDegen: number): Mx3dShapeFace;
}
/**
*
*/
export declare class Mx3dGeomBoundedSurface extends Mx3dGeomSurface {
/**
* @internal
*/
constructor(p?: object);
/**
*
* @returns
*/
DynamicType(): string;
}
/**
* B样条曲面Mx3dGeomBoundedSurface
* B样条曲面
*/
export declare class Mx3dGeomBSplineSurface extends Mx3dGeomBoundedSurface {
/**
* B样条曲面
* @param Poles U方向和V方向的控制点
* @param dUKnots U方向的节点序列
* @param dVKnots V方向的节点序列
* @param iUMults U方向节点的多重性
* @param iVMults V方向节点的多重性
* @param UDegree U方向的曲线阶数
* @param VDegree V方向的曲线阶数
* @param UPeriodic U方向是否为周期性
* @param VPeriodic V方向是否为周期性
*/
constructor(Poles: Mx3dGePoint[][], dUKnots: number[], dVKnots: number[], iUMults: number[], iVMults: number[], UDegree: number, VDegree: number, UPeriodic: boolean, VPeriodic: boolean);
/**
* B样条曲面
* @param Poles U方向和V方向的控制点
* @param dWeights
* @param dUKnots U方向的节点序列
* @param dVKnots V方向的节点序列
* @param iUMults U方向节点的多重性
* @param iVMults V方向节点的多重性
* @param UDegree U方向的曲线阶数
* @param VDegree V方向的曲线阶数
* @param UPeriodic U方向是否为周期性
* @param VPeriodic V方向是否为周期性
*/
constructor(Poles: Mx3dGePoint[][], dWeights: number[][], dUKnots: number[], dVKnots: number[], iUMults: number[], iVMults: number[], UDegree: number, VDegree: number, UPeriodic: boolean, VPeriodic: boolean);
/**
* U和V方向的节点序列
*/
ExchangeUV(): void;
/**
* U方向为周期性
*/
SetUPeriodic(): void;
/**
* V方向为周期性
*/
SetVPeriodic(): void;
/**
*
* @param UV U和V方向的参数
*/
PeriodicNormalization(UV: [
dU: number,
dV: number
]): void;
/**
* U方向的原点索引
* @param Index
*/
SetUOrigin(Index: number): void;
/**
* V方向的原点索引
* @param Index
*/
SetVOrigin(Index: number): void;
/**
* U方向为非周期性
*/
SetUNotPeriodic(): void;
/**
* V方向为非周期性
*/
SetVNotPeriodic(): void;
/**
* U方向节点序列
*/
UReverse(): void;
/**
* V方向节点序列
*/
VReverse(): void;
/**
* U方向反向参数
* @param U
* @returns
*/
UReversedParameter(U: number): number;
/**
* V方向反向参数
* @param V
* @returns
*/
VReversedParameter(V: number): number;
/**
* U和V方向阶数
* @param UDegree U方向阶数
* @param VDegree V方向阶数
*/
IncreaseDegree(UDegree: number, VDegree: number): void;
/**
* U方向节点
* @param dKnots
* @param iMults
* @param dParametricTolerance
* @param Add
*/
InsertUKnots(dKnots: number[], iMults: number[], dParametricTolerance: number, Add: boolean): void;
/**
* V方向节点
* @param dKnots
* @param iMults
* @param dParametricTolerance
* @param Add
*/
InsertVKnots(dKnots: number[], iMults: number[], dParametricTolerance: number, Add: boolean): void;
/**
* U方向节点
* @param iIndex
* @param iM
* @param dTolerance
* @returns
*/
RemoveUKnot(iIndex: number, iM: number, dTolerance: number): boolean;
/**
* V方向节点
* @param iIndex
* @param iM
* @param dTolerance
* @returns
*/
RemoveVKnot(iIndex: number, iM: number, dTolerance: number): boolean;
/**
* U方向节点的多重性
* @param UIndex
* @param M
*/
IncreaseUMultiplicity(UIndex: number, M: number): void;
/**
* U方向节点多重性在指定区间内
* @param FromI1
* @param ToI2
* @param M
*/
IncreaseUMultiplicity(FromI1: number, ToI2: number, M: number): void;
/**
* U方向节点多重性在指定区间内
* @param FromI1
* @param ToI2
* @param Step
*/
IncrementUMultiplicity(FromI1: number, ToI2: number, Step: number): void;
/**
* V方向节点的多重性
* @param VIndex
* @param M
*/
IncreaseVMultiplicity(VIndex: number, M: number): void;
/**
* V方向节点多重性在指定区间内
* @param FromI1
* @param ToI2
* @param M
*/
IncreaseVMultiplicity(FromI1: number, ToI2: number, M: number): void;
/**
* V方向节点多重性在指定区间内
* @param FromI1
* @param ToI2
* @param Step
*/
IncrementVMultiplicity(FromI1: number, ToI2: number, Step: number): void;
/**
* U方向节点
* @param U
* @param M
* @param ParametricTolerance
* @param Add
*/
InsertUKnot(U: number, M: number, ParametricTolerance: number, Add: boolean): void;
/**
* V方向节点
* @param V
* @param M
* @param ParametricTolerance
* @param Add
*/
InsertVKnot(V: number, M: number, ParametricTolerance: number, Add: boolean): void;
/**
* U和V范围内的曲面片段
* @param U1 U参数
* @param U2 U参数
* @param V1 V参数
* @param V2 V参数
*/
Segment(U1: number, U2: number, V1: number, V2: number): void;
/**
* U和V范围内的曲面片段
* @param U1 U参数
* @param U2 U参数
* @param V1 V参数
* @param V2 V参数
*/
CheckAndSegment(U1: number, U2: number, V1: number, V2: number): void;
/**
* U方向的节点值
* @param UIndex
* @param K
*/
SetUKnot(UIndex: number, K: number): void;
/**
* U方向的节点值
* @param UIndex
* @param K
* @param M
*/
SetUKnot(UIndex: number, K: number, M: number): void;
/**
* V方向的节点值
* @param VIndex
* @param K
*/
SetVKnot(VIndex: number, K: number): void;
/**
* V方向的节点值
* @param VIndex
* @param K
* @param M
*/
SetVKnot(VIndex: number, K: number, M: number): void;
/**
* U方向节点序列
* @param dUK U方向节点序列
*/
SetUKnots(dUK: number[]): void;
/**
* V方向节点序列
* @param dVK V方向节点序列
*/
SetVKnots(dVK: number[]): void;
/**
* U方向的节点
* @param U
* @param ParametricTolerance
* @param I1I2
* @param WithKnotRepetition
*/
LocateU(U: number, ParametricTolerance: number, I1I2: [
iI1: number,
iI2: number
], WithKnotRepetition: boolean): void;
/**
* V方向的节点
* @param V
* @param ParametricTolerance
* @param I1I2
* @param WithKnotRepetition
*/
LocateV(V: number, ParametricTolerance: number, I1I2: [
iI1: number,
iI2: number
], WithKnotRepetition: boolean): void;
/**
* U和V索引的控制点
* @param UIndex U方向索引
* @param VIndex V方向索引
* @param P
*/
SetPole(UIndex: number, VIndex: number, P: Mx3dGePoint): void;
/**
* U和V索引的控制点及权重
* @param UIndex U方向索引
* @param VIndex V方向索引
* @param P
* @param Weight
*/
SetPole(UIndex: number, VIndex: number, P: Mx3dGePoint, Weight: number): void;
/**
* V方向索引的控制点列
* @param VIndex V方向索引
* @param CPoles
*/
SetPoleCol(VIndex: number, CPoles: Mx3dGePoint[]): void;
/**
* V方向索引的控制点列及权重
* @param VIndex V方向索引
* @param CPoles
* @param dCPoleWeights
*/
SetPoleCol(VIndex: number, CPoles: Mx3dGePoint[], dCPoleWeights: number[]): void;
/**
* U方向索引的控制点行
* @param UIndex U方向索引
* @param CPoles
*/
SetPoleRow(UIndex: number, CPoles: Mx3dGePoint[]): void;
/**
* U方向索引的控制点行及权重
* @param UIndex U方向索引
* @param CPoles
* @param dCPoleWeights
*/
SetPoleRow(UIndex: number, CPoles: Mx3dGePoint[], dCPoleWeights: number[]): void;
/**
* U和V索引的权重值
* @param UIndex U方向索引
* @param VIndex V方向索引
* @param Weight
*/
SetWeight(UIndex: number, VIndex: number, Weight: number): void;
/**
* V方向索引的权重列
* @param VIndex V方向索引
* @param dCPoleWeights
*/
SetWeightCol(VIndex: number, dCPoleWeights: number[]): void;
/**
* U方向索引的权重行
* @param UIndex U方向索引
* @param dCPoleWeights
*/
SetWeightRow(UIndex: number, dCPoleWeights: number[]): void;
/**
* U和V索引的控制点
* @param U U参数值
* @param V V参数值
* @param P
* @param UIndex1 U方向起始索引
* @param UIndex2 U方向结束索引
* @param VIndex1 V方向起始索引
* @param VIndex2 V方向结束索引
* @param UFULVFVL
*/
MovePoint(U: number, V: number, P: Mx3dGePoint, UIndex1: number, UIndex2: number, VIndex1: number, VIndex2: number, UFULVFVL: [
iUF: number,
iUL: number,
iVF: number,
iVL: number
]): void;
/**
* U方向是否为周期性
* @returns
*/
IsUClosed(): boolean;
/**
* V方向是否为周期性
* @returns
*/
IsVClosed(): boolean;
/**
* U方向是否为连续N阶
* @param N
* @returns N阶
*/
IsCNu(N: number): boolean;
/**
* V方向是否为连续N阶
* @param N
* @returns N阶
*/
IsCNv(N: number): boolean;
/**
* U方向是否为周期性
* @returns
*/
IsUPeriodic(): boolean;
/**
* U方向是否为有理
* @returns
*/
IsURational(): boolean;
/**
* V方向是否为周期性
* @returns
*/
IsVPeriodic(): boolean;
/**
* V方向是否为有理
* @returns
*/
IsVRational(): boolean;
/**
*
* @param U1U2V1V2
*/
Bounds(U1U2V1V2: [
dU1: number,
dU2: number,
dV1: number,
dV2: number
]): void;
/**
*
* @returns
*/
Continuity(): MdGe.MxGAShapeEnum;
/**
* U方向的第一个节点索引
* @returns
*/
FirstUKnotIndex(): number;
/**
* V方向的第一个节点索引
* @returns
*/
FirstVKnotIndex(): number;
/**
* U方向的最后一个节点索引
* @returns
*/
LastUKnotIndex(): number;
/**
* V方向的最后一个节点索引
* @returns
*/
LastVKnotIndex(): number;
/**
* U方向节点数目
* @returns
*/
NbUKnots(): number;
/**
* U方向控制点数目
* @returns
*/
NbUPoles(): number;
/**
* V方向节点数目
* @returns
*/
NbVKnots(): number;
/**
* V方向控制点数目
* @returns
*/
NbVPoles(): number;
/**
* U和V索引的控制点
* @param UIndex U方向索引
* @param VIndex V方向索引
* @returns
*/
Pole(UIndex: number, VIndex: number): Mx3dGePoint;
/**
*
* @returns
*/
Poles(): Mx3dGePoint[][];
/**
* U方向的阶数
* @returns U方向的阶数
*/
UDegree(): number;
/**
* U方向的节点值
* @param UIndex
* @returns
*/
UKnot(UIndex: number): number;
/**
* U方向节点数组
* @returns
*/
UKnots(): number[];
/**
* U方向节点序列
* @returns
*/
UKnotSequence(): number[];
/**
* U方向节点多重性
* @param UIndex
* @returns
*/
UMultiplicity(UIndex: number): number;
/**
* U方向节点多重性数组
* @returns
*/
UMultiplicities(): number[];
/**
* V方向的阶数
* @returns V方向的阶数
*/
VDegree(): number;
/**
* V方向的节点值
* @param VIndex
* @returns
*/
VKnot(VIndex: number): number;
/**
* V方向节点数组
* @returns
*/
VKnots(): number[];
/**
* V方向节点序列
* @returns
*/
VKnotSequence(): number[];
/**
* V方向节点多重性
* @param VIndex
* @returns
*/
VMultiplicity(VIndex: number): number;
/**
* V方向节点多重性数组
* @returns
*/
VMultiplicities(): number[];
/**
* U和V索引的权重值
* @param UIndex U方向索引
* @param VIndex V方向索引
* @returns
*/
Weight(UIndex: number, VIndex: number): number;
/**
*
* @returns
*/
Weights(): number[][];
/**
*
* @param U U值
* @param V V值
* @param P
*/
D0(U: number, V: number, P: Mx3dGePoint): void;
/**
*
* @param U U值
* @param V V值
* @param P
* @param D1U U方向的一阶导数
* @param D1V V方向的一阶导数
*/
D1(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec): void;
/**
*
* @param U U值
* @param V V值
* @param P
* @param D1U U方向的一阶导数
* @param D1V V方向的一阶导数
* @param D2U U方向的二阶导数
* @param D2V V方向的二阶导数
* @param D2UV U和V方向的混合二阶导数
*/
D2(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec, D2U: Mx3dGeVec, D2V: Mx3dGeVec, D2UV: Mx3dGeVec): void;
/**
*
* @param U U值
* @param V V值
* @param P
* @param D1U U方向的一阶导数
* @param D1V V方向的一阶导数
* @param D2U U方向的二阶导数
* @param D2V V方向的二阶导数
* @param D2UV U和V方向的混合二阶导数
* @param D3U U方向的三阶导数
* @param D3V V方向的三阶导数
* @param D3UUV U和U方向的混合三阶导数
* @param D3UVV U和V方向的混合三阶导数
*/
D3(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec, D2U: Mx3dGeVec, D2V: Mx3dGeVec, D2UV: Mx3dGeVec, D3U: Mx3dGeVec, D3V: Mx3dGeVec, D3UUV: Mx3dGeVec, D3UVV: Mx3dGeVec): void;
/**
* N阶导数
* @param U U值
* @param V V值
* @param Nu U
* @param Nv V
* @returns
*/
DN(U: number, V: number, Nu: number, Nv: number): Mx3dGeVec;
/**
*
* @param U U值
* @param V V值
* @param FromUK1 U方向的起始节点
* @param ToUK2 U方向的结束节点
* @param FromVK1 V方向的起始节点
* @param ToVK2 V方向的结束节点
* @param P
*/
LocalD0(U: number, V: number, FromUK1: number, ToUK2: number, FromVK1: number, ToVK2: number, P: Mx3dGePoint): void;
/**
*
* @param U U值
* @param V V值
* @param FromUK1 U方向的起始节点
* @param ToUK2 U方向的结束节点
* @param FromVK1 V方向的起始节点
* @param ToVK2 V方向的结束节点
* @param P
* @param D1U U方向的一阶导数
* @param D1V V方向的一阶导数
*/
LocalD1(U: number, V: number, FromUK1: number, ToUK2: number, FromVK1: number, ToVK2: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec): void;
/**
*
* @param U U值
* @param V V值
* @param FromUK1 U方向的起始节点
* @param ToUK2 U方向的结束节点
* @param FromVK1 V方向的起始节点
* @param ToVK2 V方向的结束节点
* @param P
* @param D1U U方向的一阶导数
* @param D1V V方向的一阶导数
* @param D2U U方向的二阶导数
* @param D2V V方向的二阶导数
* @param D2UV U和V方向的混合二阶导数
*/
LocalD2(U: number, V: number, FromUK1: number, ToUK2: number, FromVK1: number, ToVK2: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec, D2U: Mx3dGeVec, D2V: Mx3dGeVec, D2UV: Mx3dGeVec): void;
/**
*
* @param U U值
* @param V V值
* @param FromUK1 U方向的起始节点
* @param ToUK2 U方向的结束节点
* @param FromVK1 V方向的起始节点
* @param ToVK2 V方向的结束节点
* @param P
* @param D1U U方向的一阶导数
* @param D1V V方向的一阶导数
* @param D2U U方向的二阶导数
* @param D2V V方向的二阶导数
* @param D2UV U和V方向的混合二阶导数
* @param D3U U方向的三阶导数
* @param D3V V方向的三阶导数
* @param D3UUV U和U方向的混合三阶导数
* @param D3UVV U和V方向的混合三阶导数
*/
LocalD3(U: number, V: number, FromUK1: number, ToUK2: number, FromVK1: number, ToVK2: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec, D2U: Mx3dGeVec, D2V: Mx3dGeVec, D2UV: Mx3dGeVec, D3U: Mx3dGeVec, D3V: Mx3dGeVec, D3UUV: Mx3dGeVec, D3UVV: Mx3dGeVec): void;
/**
* N阶导数
* @param U U值
* @param V V值
* @param FromUK1 U方向的起始节点
* @param ToUK2 U方向的结束节点
* @param FromVK1 V方向的起始节点
* @param ToVK2 V方向的结束节点
* @param Nu U
* @param Nv V
* @returns
*/
LocalDN(U: number, V: number, FromUK1: number, ToUK2: number, FromVK1: number, ToVK2: number, Nu: number, Nv: number): Mx3dGeVec;
/**
*
* @param U U值
* @param V V值
* @param FromUK1 U方向起始索引
* @param ToUK2 U方向结束索引
* @param FromVK1 V方向起始索引
* @param ToVK2 V方向结束索引
* @returns
*/
LocalValue(U: number, V: number, FromUK1: number, ToUK2: number, FromVK1: number, ToVK2: number): Mx3dGePoint;
/**
*
* @param T
*/
Transform(T: Mx3dGeTrsf): void;
/**
*
* @returns
*/
Copy(): Mx3dGeomObject;
/**
*
* @returns
*/
DynamicType(): string;
/**
* @internal
*/
DynCast(theObject: Mx3dGeomObject): this;
/**
* Mx3dGeomBSplineSurface
* @param theObject
* @returns Mx3dGeomBSplineSurface
*/
static DownCast(theObject: Mx3dGeomObject): Mx3dGeomBSplineSurface;
/**
*
* @param TolDegen
* @returns
*/
Face(TolDegen: number): Mx3dShapeFace;
/**
* 线
* @param W 线
* @param Inside
* @returns
*/
Face(W: Mx3dShapeWire, Inside: boolean): Mx3dShapeFace;
/**
* UV范围和容忍度生成面片
* @param UMin U方向最小值
* @param UMax U方向最大值
* @param VMin V方向最小值
* @param VMax V方向最大值
* @param TolDegen
* @returns
*/
Face(UMin: number, UMax: number, VMin: number, VMax: number, TolDegen: number): Mx3dShapeFace;
}
/**
* Bezier曲面Mx3dGeomBoundedSurface
* Bezier曲面
*/
export declare class Mx3dGeomBezierSurface extends Mx3dGeomBoundedSurface {
/**
* Bezier曲面
* @param SurfacePoles
* @param PoleWeights
*/
constructor(SurfacePoles: Mx3dGePoint[][], PoleWeights?: number[][]);
/**
* U和V方向的顺序
*/
ExchangeUV(): void;
/**
*
* @param UDeg U方向的增加阶数
* @param VDeg V方向的增加阶数
*/
Increase(UDeg: number, VDeg: number): void;
/**
*
* @param VIndex
* @param CPoles
* @param CPoleWeights
*/
InsertPoleColAfter(VIndex: number, CPoles: Mx3dGePoint[], CPoleWeights?: number[]): void;
/**
*
* @param VIndex
* @param CPoles
* @param CPoleWeights
*/
InsertPoleColBefore(VIndex: number, CPoles: Mx3dGePoint[], CPoleWeights?: number[]): void;
/**
*
* @param UIndex
* @param CPoles
* @param CPoleWeights
*/
InsertPoleRowAfter(UIndex: number, CPoles: Mx3dGePoint[], CPoleWeights?: number[]): void;
/**
*
* @param UIndex
* @param CPoles
* @param CPoleWeights
*/
InsertPoleRowBefore(UIndex: number, CPoles: Mx3dGePoint[], CPoleWeights?: number[]): void;
/**
*
* @param VIndex
*/
RemovePoleCol(VIndex: number): void;
/**
*
* @param UIndex
*/
RemovePoleRow(UIndex: number): void;
/**
* U和V的范围
* @param U1 U值
* @param U2 U值
* @param V1 V值
* @param V2 V值
*/
Segment(U1: number, U2: number, V1: number, V2: number): void;
/**
*
* @param UIndex U方向的索引
* @param VIndex V方向的索引
* @param P
* @param Weight
*/
SetPole(UIndex: number, VIndex: number, P: Mx3dGePoint, Weight?: number): void;
/**
*
* @param VIndex
* @param CPoles
* @param CPoleWeights
*/
SetPoleCol(VIndex: number, CPoles: Mx3dGePoint[], CPoleWeights?: number[]): void;
/**
*
* @param UIndex
* @param CPoles
* @param CPoleWeights
*/
SetPoleRow(UIndex: number, CPoles: Mx3dGePoint[], CPoleWeights?: number[]): void;
/**
*
* @param UIndex U方向的索引
* @param VIndex V方向的索引
* @param Weight
*/
SetWeight(UIndex: number, VIndex: number, Weight: number): void;
/**
*
* @param VIndex
* @param CPoleWeights
*/
SetWeightCol(VIndex: number, CPoleWeights: number[]): void;
/**
*
* @param UIndex
* @param CPoleWeights
*/
SetWeightRow(UIndex: number, CPoleWeights: number[]): void;
/**
* U方向的参数
*/
UReverse(): void;
/**
* U参数
* @param U U值
* @returns
*/
UReversedParameter(U: number): number;
/**
* V方向的参数
*/
VReverse(): void;
/**
* V参数
* @param V V值
* @returns
*/
VReversedParameter(V: number): number;
/**
*
* @param U1U2V1V2
*/
Bounds(U1U2V1V2: [
dU1: number,
dU2: number,
dV1: number,
dV2: number
]): void;
/**
*
* @returns
*/
Continuity(): MdGe.MxGAShapeEnum;
/**
*
* @param U U值
* @param V V值
* @param P
*/
D0(U: number, V: number, P: Mx3dGePoint): void;
/**
*
* @param U U值
* @param V V值
* @param P
* @param D1U U方向的一阶导数向量
* @param D1V V方向的一阶导数向量
*/
D1(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec): void;
/**
*
* @param U U值
* @param V V值
* @param P
* @param D1U U方向的一阶导数向量
* @param D1V V方向的一阶导数向量
* @param D2U U方向的二阶导数向量
* @param D2V V方向的二阶导数向量
* @param D2UV UV方向的二阶导数向量
*/
D2(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec, D2U: Mx3dGeVec, D2V: Mx3dGeVec, D2UV: Mx3dGeVec): void;
/**
*
* @param U U值
* @param V V值
* @param P
* @param D1U U方向的一阶导数向量
* @param D1V V方向的一阶导数向量
* @param D2U U方向的二阶导数向量
* @param D2V V方向的二阶导数向量
* @param D2UV UV方向的二阶导数向量
* @param D3U U方向的三阶导数向量
* @param D3V V方向的三阶导数向量
* @param D3UUV UU方向的三阶导数向量
* @param D3UVV UV方向的三阶导数向量
*/
D3(U: number, V: number, P: Mx3dGePoint, D1U: Mx3dGeVec, D1V: Mx3dGeVec, D2U: Mx3dGeVec, D2V: Mx3dGeVec, D2UV: Mx3dGeVec, D3U: Mx3dGeVec, D3V: Mx3dGeVec, D3UUV: Mx3dGeVec, D3UVV: Mx3dGeVec): void;
/**
* N阶导数
* @param U U值
* @param V V值
* @param Nu U方向阶数
* @param Nv V方向阶数
* @returns
*/
DN(U: number, V: number, Nu: number, Nv: number): Mx3dGeVec;
/**
* U方向上的控制点数量
* @returns U方向控制点数量
*/
NbUPoles(): number;
/**
* V方向上的控制点数量
* @returns V方向控制点数量
*/
NbVPoles(): number;
/**
*
* @param UIndex U方向的索引
* @param VIndex V方向的索引
* @returns
*/
Pole(UIndex: number, VIndex: number): Mx3dGePoint;
/**
*
* @returns
*/
Poles(): Mx3dGePoint[][];
/**
* U方向的阶数
* @returns U方向的阶数
*/
UDegree(): number;
/**
*
* @param UIndex U方向的索引
* @param VIndex V方向的索引
* @returns
*/
Weight(UIndex: number, VIndex: number): number;
/**
*
* @returns
*/
Weights(): number[][];
/**
* U方向是否闭合
* @returns
*/
IsUClosed(): boolean;
/**
* V方向是否闭合
* @returns
*/
IsVClosed(): boolean;
/**
* U方向上的连续阶数
* @param N
* @returns
*/
IsCNu(N: number): boolean;
/**
* V方向上的连续阶数
* @param N
* @returns
*/
IsCNv(N: number): boolean;
/**
* U方向是否周期性
* @returns
*/
IsUPeriodic(): boolean;
/**
* V方向是否周期性
* @returns
*/
IsVPeriodic(): boolean;
/**
* U方向是否为有理曲面
* @returns
*/
IsURational(): boolean;
/**
* V方向是否为有理曲面
* @returns
*/
IsVRational(): boolean;
/**
*
* @param T
*/
Transform(T: Mx3dGeTrsf): void;
/**
*
* @returns
*/
Copy(): Mx3dGeomObject;
DynCast(theObject: Mx3dGeomObject): this;
static DownCast(theObject: Mx3dGeomObject): Mx3dGeomBezierSurface;
/**
*
* @param TolDegen
* @returns
*/
Face(TolDegen: number): Mx3dShapeFace;
/**
* 线
* @param W 线
* @param Inside
* @returns
*/
Face(W: Mx3dShapeWire, Inside: boolean): Mx3dShapeFace;
/**
* UV范围和容忍度生成面片
* @param UMin U方向最小值
* @param UMax U方向最大值
* @param VMin V方向最小值
* @param VMax V方向最大值
* @param TolDegen
* @returns
*/
Face(UMin: number, UMax: number, VMin: number, VMax: number, TolDegen: number): Mx3dShapeFace;
}
/**
*
*/
export declare class Mx3dGeMaterial extends Mx3dBaseObject {
/**
*
*/
constructor();
/**
*
* @param theName MdGe.MxNameOfMaterial
*/
constructor(theName: MdGe.MxNameOfMaterial);
/**
*
* @returns
*/
Name(): MdGe.MxNameOfMaterial;
/**
*
* @returns
*/
RequestedName(): MdGe.MxNameOfMaterial;
/**
*
* @returns
*/
StringName(): string;
/**
*
* @returns
*/
MaterialName(): string;
/**
*
* @param theName
*/
SetMaterialName(theName: string): void;
/**
*
*/
Reset(): void;
/**
*
* @returns
*/
Color(): Mx3dGeColor;
/**
*
* @param theColor
*/
SetColor(theColor: Mx3dGeColor): void;
/**
* 0.01.0
* @returns
*/
Transparency(): number;
/**
* 0.01.0
* @returns
*/
Alpha(): number;
/**
*
* @param theValue 0.01.0
*/
SetTransparency(theValue: number): void;
/**
*
* @param theValue 0.01.0
*/
SetAlpha(theValue: number): void;
/**
*
* @returns
*/
AmbientColor(): Mx3dGeColor;
/**
*
* @param theColor
*/
SetAmbientColor(theColor: Mx3dGeColor): void;
/**
*
* @returns
*/
DiffuseColor(): Mx3dGeColor;
/**
*
* @param theColor
*/
SetDiffuseColor(theColor: Mx3dGeColor): void;
/**
*
* @returns
*/
SpecularColor(): Mx3dGeColor;
/**
*
* @param theColor
*/
SetSpecularColor(theColor: Mx3dGeColor): void;
/**
*
* @returns
*/
EmissiveColor(): Mx3dGeColor;
/**
*
* @param theColor
*/
SetEmissiveColor(theColor: Mx3dGeColor): void;
/**
*
* @returns
*/
Shininess(): number;
/**
*
* @param theValue 01
*/
SetShininess(theValue: number): void;
/**
*
* @param theDelta
*/
IncreaseShine(theDelta: number): void;
/**
*
* @returns
*/
RefractionIndex(): number;
/**
*
* @param theValue 1.0
*/
SetRefractionIndex(theValue: number): void;
/**
*
* @param theType MdGe.MxTypeOfReflection
* @returns true false
*/
ReflectionMode(theType: MdGe.MxTypeOfReflection): boolean;
/**
*
* @returns MdGe.MxTypeOfMaterial
*/
MaterialType(): MdGe.MxTypeOfMaterial;
/**
*
* @param theType MdGe.MxTypeOfMaterial
*/
SetMaterialType(theType: MdGe.MxTypeOfMaterial): void;
/**
*
* @param theOther
* @returns true false
*/
IsDifferent(theOther: Mx3dGeMaterial): boolean;
/**
*
* @param theOther
* @returns true false
*/
IsEqual(theOther: Mx3dGeMaterial): boolean;
}
/**
* 线
*/
export declare class Mx3dAspectLine extends Mx3dAspectObject {
/**
* 线线线
* @param theColor
* @param theType 线
* @param theWidth 线
*/
constructor(theColor: Mx3dGeColor, theType: MdGe.MxTypeOfLine, theWidth: number);
/**
* 线
* @param theColor Mx3dGeColor
*/
SetColor(theColor: Mx3dGeColor): void;
/**
* 线线
* @param theType 线
*/
SetTypeOfLine(theType: MdGe.MxTypeOfLine): void;
/**
* 线线
* @param theWidth 线
*/
SetWidth(theWidth: number): void;
}
/**
*
*
*/
export declare class Mx3dAspectText extends Mx3dAspectObject {
/**
*
*/
constructor();
/**
*
* @param theColor Mx3dGeColor
*/
SetColor(theColor: Mx3dGeColor): void;
/**
*
* @param theFont
*/
SetFont(theFont: string): void;
/**
*
* @param theHeight
*/
SetHeight(theHeight: number): void;
/**
*
* @param theAngle
*/
SetAngle(theAngle: number): void;
/**
*
* @returns
*/
Height(): number;
/**
*
* @returns
*/
Angle(): number;
/**
*
* @param theJustification MdGe.MxHorizontalTextAlignment
*/
SetHorizontalJustification(theJustification: MdGe.MxHorizontalTextAlignment): void;
/**
*
* @param theJustification MdGe.MxVerticalTextAlignment
*/
SetVerticalJustification(theJustification: MdGe.MxVerticalTextAlignment): void;
/**
*
* @param theOrientation MdGe.MxTextPath
*/
SetOrientation(theOrientation: MdGe.MxTextPath): void;
/**
*
* @returns MdGe.MxHorizontalTextAlignment
*/
HorizontalJustification(): MdGe.MxHorizontalTextAlignment;
/**
*
* @returns MdGe.MxVerticalTextAlignment
*/
VerticalJustification(): MdGe.MxVerticalTextAlignment;
/**
*
* @returns MdGe.MxTextPath
*/
Orientation(): MdGe.MxTextPath;
}
/**
* Mx3dAspectArrow
*
*/
export declare class Mx3dAspectArrow extends Mx3dAspectObject {
/**
*
*/
constructor();
/**
*
* @param anAngle
* @param aLength
*/
constructor(anAngle: number, aLength: number);
/**
*
* @param anAngle
*/
SetAngle(anAngle: number): void;
/**
*
* @returns
*/
Angle(): number;
/**
*
* @param theLength
*/
SetLength(theLength: number): void;
/**
*
* @returns
*/
Length(): number;
/**
*
* @param theIsZoomable true false
*/
SetZoomable(theIsZoomable: boolean): void;
/**
*
* @returns true false
*/
IsZoomable(): boolean;
/**
*
* @param theColor
*/
SetColor(theColor: Mx3dGeColor): void;
}
/**
* Mx3dAspectDim 3D
* 线
*/
export declare class Mx3dAspectDim extends Mx3dAspectObject {
/**
*
*/
constructor();
/**
* 线
* @param theAspect - 线
*/
SetLineAspect(theAspect: Mx3dAspectLine): void;
/**
*
* @param theAspect -
*/
SetTextAspect(theAspect: Mx3dAspectText): void;
/**
* 3D
* @returns 3D true false
*/
IsText3d(): boolean;
/**
* 3D 2D
* @param isText3d - true 3D 2D
*/
MakeText3d(isText3d: boolean): void;
/**
* 3D
* @returns true false
*/
IsTextShaded(): boolean;
/**
* 3D
* @param theIsTextShaded - true
*/
MakeTextShaded(theIsTextShaded: boolean): void;
/**
* 3D
* @returns 3D true false
*/
IsArrows3d(): boolean;
/**
* 3D 2D
* @param theIsArrows3d - true 3D 2D
*/
MakeArrows3d(theIsArrows3d: boolean): void;
/**
*
* @returns true false
*/
IsUnitsDisplayed(): boolean;
/**
*
* @param theIsDisplayed - true
*/
MakeUnitsDisplayed(theIsDisplayed: boolean): void;
/**
*
* @param theArrowOrient -
*/
SetArrowOrientation(theArrowOrient: MdGe.MxDimensionArrowOrientation): void;
/**
*
* @returns
*/
ArrowOrientation(): MdGe.MxDimensionArrowOrientation;
/**
*
* @param thePosition -
*/
SetTextVerticalPosition(thePosition: MdGe.MxDimensionTextVerticalPosition): void;
/**
*
* @returns
*/
TextVerticalPosition(): MdGe.MxDimensionTextVerticalPosition;
/**
*
* @param thePosition -
*/
SetTextHorizontalPosition(thePosition: MdGe.MxDimensionTextHorizontalPosition): void;
/**
*
* @returns
*/
TextHorizontalPosition(): MdGe.MxDimensionTextHorizontalPosition;
/**
*
* @param theAspect -
*/
SetArrowAspect(theAspect: Mx3dAspectArrow): void;
/**
* 线
* @param theColor -
*/
SetCommonColor(theColor: Mx3dGeColor): void;
/**
*
* @param theSize -
*/
SetExtensionSize(theSize: number): void;
/**
*
* @returns
*/
ExtensionSize(): number;
/**
*
* @param theSize -
*/
SetArrowTailSize(theSize: number): void;
/**
*
* @returns
*/
ArrowTailSize(): number;
/**
*
* @param theFormat -
*/
SetValueStringFormat(theFormat: string): void;
/**
*
* @returns
*/
ValueStringFormat(): string;
}
/**
* @class Mx3dDimDiameter
* @extends Mx3dDimObject
*
* 3D环境中的直径尺寸
* 便3D空间中实现精确的尺寸标注
*/
export declare class Mx3dDimDiameter extends Mx3dDimObject {
/**
*
* @param theCircle
*/
constructor(theCircle: Mx3dGeCircle);
/**
*
* @param theCircle
* @param thePlane
*/
constructor(theCircle: Mx3dGeCircle, thePlane: Mx3dGePlane);
/**
* @returns
*/
Circle(): Mx3dGeCircle;
/**
* @returns
*/
AnchorPoint(): Mx3dGePoint;
/**
* @returns
*/
Shape(): Mx3dShapeObject;
/**
*
* @param theCircle
*/
SetMeasuredGeometry(theCircle: Mx3dGeCircle): void;
/**
*
* @param theTextPos
*/
SetTextPosition(theTextPos: Mx3dGePoint): void;
/**
*
* @returns
*/
GetTextPosition(): Mx3dGePoint;
/**
*
* @param theUnits
*/
SetDisplayUnits(theUnits: string): void;
/**
*
* @param theUnits
*/
SetModelUnits(theUnits: string): void;
/**
*
* @returns
*/
GetValue(): number;
/**
*
*/
SetComputedValue(): void;
/**
*
* @param theValue
*/
SetCustomValue(theValue: number): void;
/**
*
* @returns
*/
GetPlane(): Mx3dGePlane;
/**
*
* @returns
*/
GetGeometryType(): number;
/**
*
* @param thePlane
*/
SetCustomPlane(thePlane: Mx3dGePlane): void;
/**
*
*/
UnsetCustomPlane(): void;
/**
*
* @returns
*/
IsTextPositionCustom(): boolean;
/**
*
* @param theDimensionAspect
*/
SetDimensionAspect(theDimensionAspect: Mx3dAspectDim): void;
/**
*
* @returns
*/
KindOfDimension(): MdGe.MxKindOfDimension;
/**
*
*/
UnsetFixedTextPosition(): void;
/**
*
* @returns
*/
SelToleranceForText2d(): number;
/**
*
* @param theTol
*/
SetSelToleranceForText2d(theTol: number): void;
/**
* 线
* @returns 线
*/
GetFlyout(): number;
/**
* 线
* @param theFlyout 线
*/
SetFlyout(theFlyout: number): void;
/**
*
* @returns
*/
IsValid(): boolean;
}
/**
* @class Mx3dDimRadius
* @extends Mx3dDimObject
*
* 3D环境中的半径尺寸
* 便3D空间中实现精确的尺寸标注
*/
export declare class Mx3dDimRadius extends Mx3dDimObject {
/**
*
* @param theCircle
*/
constructor(theCircle: Mx3dGeCircle);
/**
*
* @param theCircle
* @param theAnchorPoint
*/
constructor(theCircle: Mx3dGeCircle, theAnchorPoint: Mx3dGePoint);
/**
*
* @returns
*/
Circle(): Mx3dGeCircle;
/**
*
* @returns
*/
AnchorPoint(): Mx3dGePoint;
/**
*
* @returns
*/
Shape(): Mx3dShapeObject;
/**
*
* @param theCircle
*/
SetMeasuredGeometry(theCircle: Mx3dGeCircle): void;
/**
*
* @param theCircle
* @param theAnchorPoint
* @param theHasAnchor 使
*/
SetMeasuredGeometry(theCircle: Mx3dGeCircle, theAnchorPoint: Mx3dGePoint, theHasAnchor: boolean): void;
/**
*
* @param theTextPos
*/
SetTextPosition(theTextPos: Mx3dGePoint): void;
/**
*
* @returns
*/
GetTextPosition(): Mx3dGePoint;
/**
*
* @returns
*/
GetValue(): number;
/**
*
*/
SetComputedValue(): void;
/**
*
* @param theValue
*/
SetCustomValue(theValue: number): void;
/**
*
* @returns
*/
GetPlane(): Mx3dGePlane;
/**
*
* @returns
*/
GetGeometryType(): number;
/**
*
* @param thePlane
*/
SetCustomPlane(thePlane: Mx3dGePlane): void;
/**
*
*/
UnsetCustomPlane(): void;
/**
*
* @returns
*/
IsTextPositionCustom(): boolean;
/**
*
* @param theDimensionAspect
*/
SetDimensionAspect(theDimensionAspect: Mx3dAspectDim): void;
/**
*
* @returns
*/
KindOfDimension(): MdGe.MxKindOfDimension;
/**
*
*/
UnsetFixedTextPosition(): void;
/**
* 2D文本选择公差
* @returns 2D文本选择公差
*/
SelToleranceForText2d(): number;
/**
* 2D文本选择公差
* @param theTol 2D文本选择公差
*/
SetSelToleranceForText2d(theTol: number): void;
/**
* 线
* @returns 线
*/
GetFlyout(): number;
/**
* 线
* @param theFlyout 线
*/
SetFlyout(theFlyout: number): void;
/**
*
* @returns
*/
IsValid(): boolean;
}
/**
* @class Mx3dDimAngle
* @extends Mx3dDimObject
*
* 3D环境中的角度尺寸线
* 便3D空间中实现精确的角度标注
*/
export declare class Mx3dDimAngle extends Mx3dDimObject {
/**
*
* @param theFirstEdge
* @param theSecondEdge
*/
constructor(theFirstEdge: Mx3dShapeEdge, theSecondEdge: Mx3dShapeEdge);
/**
*
* @param theFirstPoint
* @param theSecondPoint
* @param theThirdPoint
*/
constructor(theFirstPoint: Mx3dGePoint, theSecondPoint: Mx3dGePoint, theThirdPoint: Mx3dGePoint);
/**
* @returns
*/
FirstPoint(): Mx3dGePoint;
/**
* @returns
*/
SecondPoint(): Mx3dGePoint;
/**
* @returns
*/
CenterPoint(): Mx3dGePoint;
/**
* @returns
*/
FirstShape(): Mx3dShapeObject;
/**
* @returns
*/
SecondShape(): Mx3dShapeObject;
/**
* @returns
*/
ThirdShape(): Mx3dShapeObject;
/**
*
* @param theCone
*/
SetMeasuredGeometry(theCone: Mx3dShapeFace): void;
/**
*
* @param theFirstEdge
* @param theSecondEdge
*/
SetMeasuredGeometry(theFirstEdge: Mx3dShapeEdge, theSecondEdge: Mx3dShapeEdge): void;
/**
*
* @param theFirstPoint
* @param theSecondPoint
* @param theThridPoint
*/
SetMeasuredGeometry(theFirstPoint: Mx3dGePoint, theSecondPoint: Mx3dGePoint, theThridPoint: Mx3dGePoint): void;
/**
*
* @param theTextPos
*/
SetTextPosition(theTextPos: Mx3dGePoint): void;
/**
* @returns
*/
GetTextPosition(): Mx3dGePoint;
/**
* @returns
*/
GetDisplayUnits(): string;
/**
* @returns
*/
GetModelUnits(): string;
/**
*
* @param theUnits
*/
SetDisplayUnits(theUnits: string): void;
/**
*
* @param theUnits
*/
SetModelUnits(theUnits: string): void;
/**
*
* @param theType
*/
SetType(theType: MdGe.MxTypeOfAngle): void;
/**
* @returns
*/
GetType(): MdGe.MxTypeOfAngle;
/**
*
* @param theType
*/
SetArrowsVisibility(theType: MdGe.MxTypeOfAngleArrowVisibility): void;
/**
* @returns
*/
GetArrowsVisibility(): MdGe.MxTypeOfAngleArrowVisibility;
/**
* @returns
*/
GetValue(): number;
/**
*
*/
SetComputedValue(): void;
/**
*
* @param theValue
*/
SetCustomValue(theValue: number): void;
/**
* @returns
*/
GetPlane(): Mx3dGePlane;
/**
* @returns
*/
GetGeometryType(): number;
/**
*
* @param thePlane
*/
SetCustomPlane(thePlane: Mx3dGePlane): void;
/**
*
*/
UnsetCustomPlane(): void;
/**
* @returns
*/
IsTextPositionCustom(): boolean;
/**
*
* @param theDimensionAspect
*/
SetDimensionAspect(theDimensionAspect: Mx3dAspectDim): void;
/**
* @returns
*/
KindOfDimension(): MdGe.MxKindOfDimension;
/**
*
*/
UnsetFixedTextPosition(): void;
/**
* @returns
*/
SelToleranceForText2d(): number;
/**
*
* @param theTol
*/
SetSelToleranceForText2d(theTol: number): void;
/**
* @returns 线
*/
GetFlyout(): number;
/**
* 线
* @param theFlyout 线
*/
SetFlyout(theFlyout: number): void;
/**
* @returns
*/
IsValid(): boolean;
}
/**
* @class Mx3dDimLength
* @extends Mx3dDimObject
*
* 3D环境中的长度尺寸
* 便3D空间中实现精确的长度标注
*/
export declare class Mx3dDimLength extends Mx3dDimObject {
/**
*
*/
constructor();
/**
*
* @param theEdge
* @param thePlane
*/
constructor(theEdge: Mx3dShapeEdge, thePlane: Mx3dGePlane);
/**
*
* @param theFirstPoint
* @param theSecondPoint
* @param thePlane
*/
constructor(theFirstPoint: Mx3dGePoint, theSecondPoint: Mx3dGePoint, thePlane: Mx3dGePlane);
/**
*
* @returns
*/
FirstPoint(): Mx3dGePoint;
/**
*
* @returns
*/
SecondPoint(): Mx3dGePoint;
/**
*
* @returns
*/
FirstShape(): Mx3dShapeObject;
/**
*
* @returns
*/
SecondShape(): Mx3dShapeObject;
/**
*
* @param theFirstPoint
* @param theSecondPoint
* @param thePlane
*/
SetMeasuredGeometry(theFirstPoint: Mx3dGePoint, theSecondPoint: Mx3dGePoint, thePlane: Mx3dGePlane): void;
/**
*
* @param theFirstShape
* @param theSecondShape
*/
SetMeasuredShapes(theFirstShape: Mx3dShapeObject, theSecondShape: Mx3dShapeObject): void;
/**
*
* @param theTextPos
*/
SetTextPosition(theTextPos: Mx3dGePoint): void;
/**
*
* @returns
*/
GetTextPosition(): Mx3dGePoint;
/**
*
* @param theDirection
* @param theUseDirection 使
*/
SetDirection(theDirection: Mx3dGeDir, theUseDirection: boolean): void;
/**
*
* @returns
*/
GetValue(): number;
/**
*
*/
SetComputedValue(): void;
/**
*
* @param theValue
*/
SetCustomValue(theValue: number): void;
/**
*
* @returns
*/
GetPlane(): Mx3dGePlane;
/**
*
* @returns
*/
GetGeometryType(): number;
/**
*
* @param thePlane
*/
SetCustomPlane(thePlane: Mx3dGePlane): void;
/**
*
*/
UnsetCustomPlane(): void;
/**
*
* @returns true false
*/
IsTextPositionCustom(): boolean;
/**
*
* @param theDimensionAspect
*/
SetDimensionAspect(theDimensionAspect: Mx3dAspectDim): void;
/**
*
* @returns
*/
KindOfDimension(): MdGe.MxKindOfDimension;
/**
*
*/
UnsetFixedTextPosition(): void;
/**
* 2D文本选择公差
* @returns 2D文本选择公差
*/
SelToleranceForText2d(): number;
/**
* 2D文本选择公差
* @param theTol 2D文本选择公差
*/
SetSelToleranceForText2d(theTol: number): void;
/**
* 线
* @returns 线
*/
GetFlyout(): number;
/**
* 线
* @param theFlyout 线
*/
SetFlyout(theFlyout: number): void;
/**
*
* @returns true false
*/
IsValid(): boolean;
}
/**
* B样条曲线算法
*/
export declare class Mx3dInterpolateBSplineCurve extends Mx3dBaseObject {
/**
* B样条曲线的对象
* @param Points
* @param PeriodicFlag
* @param Tolerance
*/
constructor(Points: Mx3dGePoint[], PeriodicFlag: boolean, Tolerance: number);
/**
* B样条曲线的对象
* @param Points
* @param Parameters
* @param PeriodicFlag
* @param Tolerance
*/
constructor(Points: Mx3dGePoint[], Parameters: number[], PeriodicFlag: boolean, Tolerance: number);
/**
*
* @param InitialTangent
* @param FinalTangent
*/
LoadEnds(InitialTangent: UniVec, FinalTangent: UniVec): void;
/**
*
* @param Tangents
* @param TangentFlags
*/
Load(Tangents: Mx3dGeVec[], TangentFlags: boolean[]): void;
/**
*
*/
Perform(): void;
/**
* B样条曲线
* @returns B样条曲线
*/
Curve(): Mx3dGeomBSplineCurve;
/**
*
* @returns true false
*/
IsDone(): boolean;
}
export type Map = any;
/**
* cad地图对象
* @example
* ```ts
* import { MxMap } from 'mxcad';
* let mx_map = new MxMap;
* ```
*/
export declare class MxMap {
private imp;
private map;
private originLngLatLike;
private originCAD;
private meterInCADUnits;
private modelAltitude;
private loadOldEditionMethod;
/**mxcad对象 */
mxcad: McObject;
constructor();
/**
*
*/
setLoadOldEditionMethod(): void;
/**
* mxdraw对象
* @return mxdraw对象
* */
getMxDrawObject(): MxDrawObject;
/**
* mapbox
* @param map map对象
*/
initMapbox(map: Map): void;
/**
* mapbox的map对象
* @return map对象
*/
getMapbox(): Map;
/**
* mapbox的墨卡托坐标系到cad
* @param x X轴坐标
* @param y Y轴坐标
* @returns
*/
mercatorCoord2CAD(x: number, y: number): THREE.Vector3;
/**
* mapbox的墨卡托坐标系到cad
* @param x X轴坐标
* @param y Y轴坐标
* @returns
*/
mercatorCoordToCAD(x: number, y: number): THREE.Vector3;
/**
* cad到mapbox的墨卡托坐标系
* @param pt
* @returns
*/
cadToMercatorCoord(pt: THREE.Vector3): THREE.Vector3;
/**
* cad坐标
* @param lng
* @param lat
* @return
*/
lnglatToCAD(lng: number, lat: number): THREE.Vector3;
/**
* cad坐标转换为经度和纬度
* @param pt
* @returns
*/
cadTolnglat(pt: THREE.Vector3): number[];
/**
*
* @param x X轴坐标
* @param y Y轴坐标
* @returns
*/
map_meters_to_lnglat(x: number, y: number): number[];
/**
*
* @param lng
* @param lat
* @returns
*/
map_lnglat_to_meters(lng: number, lat: number): number[];
/**
* mapbox的墨卡托坐标系坐标
* @param lng
* @param lat
* @returns
*/
lnglat_to_mercator(lng: number, lat: number): THREE.Vector3;
/**
* mapbox的墨卡托坐标系到经纬度
* @param x X轴坐标
* @param y Y轴坐标
* @param z Z轴坐标
* @returns
*/
mercator_to_lnglat(x: number, y: number, z: number): number[];
/**
*
* @param lng
* @param lat
* @returns
*/
outOfChina(lng: number, lat: number): boolean;
/**
*
* @param len
* @return
*/
cadLongToMercatorCoord(len: number): number;
/**
*
* @param originLngLatLike
* @param originCAD AutoCAD
* @param meterInCADUnits AutoCAD 使
*/
setCoordinatePointAlignment(originLngLatLike: number[], originCAD: number[], meterInCADUnits: number): void;
/**
*
* @param map map对象
* @param MxCadConfig createMxCad
*/
create(map: Map, config: MxCadConfig | any): Promise<void>;
}
/**
*
* @param map map对象
* @param layerList
* @param key 访 API
* @param providers
*/
export declare function MxMapAddRasterTileLayer(map: any, layerList: any[], key?: string, providers?: any): void;
/**
* GoogleCnLayer地图图层,
* @param map map对象
* @param types
* @param urls URL
*/
export declare function MxMapAddGoogleCnLayer(map: any, types: string[], urls?: string[]): void;
/**
* GPS WGS 84 GCJ-02
* @param lng
* @param lat
* @returns
*/
export declare function mx_gps84_To_gcj02(lng: any, lat: any): {
lng: any;
lat: any;
};
/**
* GCJ-02 GPS WGS 84
* @param lng
* @param lat
* @returns @returns
*/
export declare function mx_gcj02_To_gps84(lng: any, lat: any): {
lng: number;
lat: number;
};
export {};