@mlightcad/graphic-interface 3.3.14 → 3.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/graphic-interface.js +0 -45
- package/lib/AcGiRenderer.d.ts +0 -15
- package/lib/AcGiRenderer.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -4,64 +4,42 @@ class h {
|
|
|
4
4
|
constructor() {
|
|
5
5
|
this._number = -1, this._id = "", this._groupId = "", this._centerPoint = new t(), this._height = 0, this._width = 0, this._viewCenter = new t(), this._viewHeight = 0;
|
|
6
6
|
}
|
|
7
|
-
/**
|
|
8
|
-
* The viewport ID number. If the viewport is inactive, -1 is returned.
|
|
9
|
-
*/
|
|
10
7
|
get number() {
|
|
11
8
|
return this._number;
|
|
12
9
|
}
|
|
13
10
|
set number(s) {
|
|
14
11
|
this._number = s;
|
|
15
12
|
}
|
|
16
|
-
/**
|
|
17
|
-
* The id of the viewport.
|
|
18
|
-
*/
|
|
19
13
|
get id() {
|
|
20
14
|
return this._id;
|
|
21
15
|
}
|
|
22
16
|
set id(s) {
|
|
23
17
|
this._id = s;
|
|
24
18
|
}
|
|
25
|
-
/**
|
|
26
|
-
* The id of the group which this viewport belongs to.
|
|
27
|
-
*/
|
|
28
19
|
get groupId() {
|
|
29
20
|
return this._groupId;
|
|
30
21
|
}
|
|
31
22
|
set groupId(s) {
|
|
32
23
|
this._groupId = s;
|
|
33
24
|
}
|
|
34
|
-
/**
|
|
35
|
-
* The center point of the viewport entity in WCS coordinates (within Paper Space).
|
|
36
|
-
*/
|
|
37
25
|
get centerPoint() {
|
|
38
26
|
return this._centerPoint;
|
|
39
27
|
}
|
|
40
28
|
set centerPoint(s) {
|
|
41
29
|
this._centerPoint.copy(s);
|
|
42
30
|
}
|
|
43
|
-
/**
|
|
44
|
-
* The height of the viewport entity's window in drawing units.
|
|
45
|
-
*/
|
|
46
31
|
get height() {
|
|
47
32
|
return this._height;
|
|
48
33
|
}
|
|
49
34
|
set height(s) {
|
|
50
35
|
this._height = s;
|
|
51
36
|
}
|
|
52
|
-
/**
|
|
53
|
-
* The width of the viewport entity's window in drawing units. This is the width in Paper Space
|
|
54
|
-
* of the viewport itself, not the width of the Model Space view within the viewport.
|
|
55
|
-
*/
|
|
56
37
|
get width() {
|
|
57
38
|
return this._width;
|
|
58
39
|
}
|
|
59
40
|
set width(s) {
|
|
60
41
|
this._width = s;
|
|
61
42
|
}
|
|
62
|
-
/**
|
|
63
|
-
* The bounding box (in world coordinate system coordinates) of the viewport.
|
|
64
|
-
*/
|
|
65
43
|
get box() {
|
|
66
44
|
const s = new I();
|
|
67
45
|
return s.setFromCenterAndSize(this.centerPoint, {
|
|
@@ -69,35 +47,21 @@ class h {
|
|
|
69
47
|
y: this.height
|
|
70
48
|
}), s;
|
|
71
49
|
}
|
|
72
|
-
/**
|
|
73
|
-
* The view center (in display coordinate system coordinates) of the view in the viewport.
|
|
74
|
-
*/
|
|
75
50
|
get viewCenter() {
|
|
76
51
|
return this._viewCenter;
|
|
77
52
|
}
|
|
78
53
|
set viewCenter(s) {
|
|
79
54
|
this._viewCenter.copy(s);
|
|
80
55
|
}
|
|
81
|
-
/**
|
|
82
|
-
* The height (in display coordinate system coordinates) of the Model Space view within the viewport.
|
|
83
|
-
* Zooming the view out within the viewport increases this value and zooming in decreases this value.
|
|
84
|
-
*/
|
|
85
56
|
get viewHeight() {
|
|
86
57
|
return this._viewHeight;
|
|
87
58
|
}
|
|
88
59
|
set viewHeight(s) {
|
|
89
60
|
this._viewHeight = s;
|
|
90
61
|
}
|
|
91
|
-
/**
|
|
92
|
-
* The width (in display coordinate system coordinates) of the Model Space view within the viewport.
|
|
93
|
-
* This is one computed property based on 'viewHeight' and viewport ratio of width and height.
|
|
94
|
-
*/
|
|
95
62
|
get viewWidth() {
|
|
96
63
|
return this.viewHeight * (this.width / this.height);
|
|
97
64
|
}
|
|
98
|
-
/**
|
|
99
|
-
* The bounding box (in display coordinate system coordinates) of the Model Space view within the viewport.
|
|
100
|
-
*/
|
|
101
65
|
get viewBox() {
|
|
102
66
|
const s = new I();
|
|
103
67
|
return s.setFromCenterAndSize(this.viewCenter, {
|
|
@@ -105,19 +69,10 @@ class h {
|
|
|
105
69
|
y: this.viewHeight
|
|
106
70
|
}), s;
|
|
107
71
|
}
|
|
108
|
-
/**
|
|
109
|
-
* Clone this viewport
|
|
110
|
-
* @returns Return the cloned instance of this viewport
|
|
111
|
-
*/
|
|
112
72
|
clone() {
|
|
113
73
|
const s = new h();
|
|
114
74
|
return s.id = this.id, s.groupId = this.groupId, s.number = this.number, s.centerPoint.copy(this.centerPoint), s.height = this.height, s.width = this.width, s.viewCenter.copy(this.viewCenter), s.viewHeight = this.viewHeight, s;
|
|
115
75
|
}
|
|
116
|
-
/**
|
|
117
|
-
* Copy the property values of the passed viewport to this viewport.
|
|
118
|
-
* @param viewport Input one viewport instance
|
|
119
|
-
* @returns Return this viewport
|
|
120
|
-
*/
|
|
121
76
|
copy(s) {
|
|
122
77
|
return this.id = s.id, this.groupId = s.groupId, this.number = s.number, this.centerPoint.copy(s.centerPoint), this.height = s.height, this.width = s.width, this.viewCenter.copy(s.viewCenter), this.viewHeight = s.viewHeight, this;
|
|
123
78
|
}
|
package/lib/AcGiRenderer.d.ts
CHANGED
|
@@ -11,21 +11,6 @@ import { AcGiMTextData, AcGiTextStyle } from './AcGiTextStyle';
|
|
|
11
11
|
*/
|
|
12
12
|
export type AcGiFontMapping = Record<string, string>;
|
|
13
13
|
export interface AcGiRenderer<T extends AcGiEntity = AcGiEntity> {
|
|
14
|
-
/**
|
|
15
|
-
* JavaScript (and WebGL) use 64‑bit floating point numbers for CPU-side calculations,
|
|
16
|
-
* but GPU shaders typically use 32‑bit floats. A 32-bit float has ~7.2 decimal digits
|
|
17
|
-
* of precision. If passing 64-bit floating vertices data to GPU directly, it will
|
|
18
|
-
* destroy number preciesion.
|
|
19
|
-
*
|
|
20
|
-
* So we adopt a simpler but effective version of the "origin-shift" idea. Recompute
|
|
21
|
-
* geometry using re-centered coordinates and apply offset to its position. The base
|
|
22
|
-
* point is extractly offset value.
|
|
23
|
-
*
|
|
24
|
-
* Get the rendering base point.
|
|
25
|
-
* @returns Return the rendering base point.
|
|
26
|
-
*/
|
|
27
|
-
get basePoint(): AcGePoint3d | undefined;
|
|
28
|
-
set basePoint(value: AcGePoint3d | undefined);
|
|
29
14
|
/**
|
|
30
15
|
* The entity traits object gives the user control of, and access to, the attribute
|
|
31
16
|
* (color, layer, linetype, etc.) settings of the current geometry.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcGiRenderer.d.ts","sourceRoot":"","sources":["../src/AcGiRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,eAAe,EAChB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE9D;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAEpD,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU;IAC7D
|
|
1
|
+
{"version":3,"file":"AcGiRenderer.d.ts","sourceRoot":"","sources":["../src/AcGiRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,eAAe,EAChB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,k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eAAe,GAAG,IAAI,CAAA;CAC/C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mlightcad/graphic-interface",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.16",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"require": "./dist/graphic-interface.umd.cjs"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@mlightcad/common": "1.4.
|
|
36
|
-
"@mlightcad/geometry-engine": "3.2.
|
|
35
|
+
"@mlightcad/common": "1.4.16",
|
|
36
|
+
"@mlightcad/geometry-engine": "3.2.16"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"clean": "rimraf dist lib tsconfig.tsbuildinfo",
|