@itwin/hypermodeling-frontend 4.0.0-dev.52 → 4.0.0-dev.55
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/lib/cjs/HyperModeling.d.ts +114 -114
- package/lib/cjs/HyperModeling.js +238 -238
- package/lib/cjs/HyperModeling.js.map +1 -1
- package/lib/cjs/HyperModelingConfig.d.ts +54 -54
- package/lib/cjs/HyperModelingConfig.js +9 -9
- package/lib/cjs/HyperModelingDecorator.d.ts +110 -110
- package/lib/cjs/HyperModelingDecorator.js +335 -335
- package/lib/cjs/HyperModelingDecorator.js.map +1 -1
- package/lib/cjs/PopupToolbar.d.ts +24 -24
- package/lib/cjs/PopupToolbar.js +57 -57
- package/lib/cjs/PopupToolbar.js.map +1 -1
- package/lib/cjs/SectionDrawingLocationState.d.ts +90 -90
- package/lib/cjs/SectionDrawingLocationState.js +107 -107
- package/lib/cjs/SectionGraphicsProvider.d.ts +13 -13
- package/lib/cjs/SectionGraphicsProvider.js +272 -272
- package/lib/cjs/SectionMarkerHandler.d.ts +52 -52
- package/lib/cjs/SectionMarkerHandler.js +111 -111
- package/lib/cjs/SectionMarkers.d.ts +82 -82
- package/lib/cjs/SectionMarkers.js +174 -174
- package/lib/cjs/Tools.d.ts +5 -5
- package/lib/cjs/Tools.js +170 -170
- package/lib/cjs/hypermodeling-frontend.d.ts +13 -13
- package/lib/cjs/hypermodeling-frontend.js +33 -29
- package/lib/cjs/hypermodeling-frontend.js.map +1 -1
- package/lib/esm/HyperModeling.d.ts +114 -114
- package/lib/esm/HyperModeling.js +235 -234
- package/lib/esm/HyperModeling.js.map +1 -1
- package/lib/esm/HyperModelingConfig.d.ts +54 -54
- package/lib/esm/HyperModelingConfig.js +8 -8
- package/lib/esm/HyperModelingDecorator.d.ts +110 -110
- package/lib/esm/HyperModelingDecorator.js +331 -331
- package/lib/esm/HyperModelingDecorator.js.map +1 -1
- package/lib/esm/PopupToolbar.d.ts +24 -24
- package/lib/esm/PopupToolbar.js +54 -53
- package/lib/esm/PopupToolbar.js.map +1 -1
- package/lib/esm/SectionDrawingLocationState.d.ts +90 -90
- package/lib/esm/SectionDrawingLocationState.js +103 -103
- package/lib/esm/SectionGraphicsProvider.d.ts +13 -13
- package/lib/esm/SectionGraphicsProvider.js +268 -268
- package/lib/esm/SectionMarkerHandler.d.ts +52 -52
- package/lib/esm/SectionMarkerHandler.js +107 -107
- package/lib/esm/SectionMarkers.d.ts +82 -82
- package/lib/esm/SectionMarkers.js +168 -168
- package/lib/esm/Tools.d.ts +5 -5
- package/lib/esm/Tools.js +166 -166
- package/lib/esm/hypermodeling-frontend.d.ts +13 -13
- package/lib/esm/hypermodeling-frontend.js +17 -17
- package/package.json +14 -14
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/** @packageDocumentation
|
|
6
|
-
* @module HyperModeling
|
|
7
|
-
*/
|
|
8
|
-
import { IModelApp } from "@itwin/core-frontend";
|
|
9
|
-
/** Supplies interactions with [[SectionMarker]]s, including a mini-toolbar displayed when the mouse hovers over a marker and what action occurs when the user clicks a marker.
|
|
10
|
-
* The base implementation supplies the following interactions:
|
|
11
|
-
* * Click: Toggle display of the section graphics and clip volume; apply the section's spatial view if toggling on.
|
|
12
|
-
* * Toolbar:
|
|
13
|
-
* * Apply Section: Applies the section location's spatial view to the viewport and displays the 2d section graphics.
|
|
14
|
-
* * Open Drawing: Navigates to the section drawing view. By default, this applies the section drawing view to the viewport.
|
|
15
|
-
* * Open Sheet: Navigates to the [ViewAttachment]($backend) of the section drawing on a [Sheet]($backend). Disabled if no such attachment exists.
|
|
16
|
-
* @see [[HyperModelingConfig]] to override the default handler by supplying a subclass of `SectionMarkerHandler`.
|
|
17
|
-
* @see [[HyperModelingDecorator]] for various methods that might be usefully wired up to marker click or toolbar actions.
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
20
|
-
export class SectionMarkerHandler {
|
|
21
|
-
/** Respond to activation of the specified marker. Return true if the marker should become the active marker - i.e., if the marker was successfully activated.
|
|
22
|
-
* @see [[SectionMarkerHandler.deactivateMarker]].
|
|
23
|
-
*/
|
|
24
|
-
async activateMarker(marker, decorator) {
|
|
25
|
-
return decorator.toggleSection(marker, true);
|
|
26
|
-
}
|
|
27
|
-
/** Respond to deactivation of the specified marker. Invoked when the user clicks on the marker while it is the active marker.
|
|
28
|
-
* This should perform the inverse of [[SectionMarkerHandler.activateMarker]]. The marker becomes inactive as a result.
|
|
29
|
-
*/
|
|
30
|
-
async deactivateMarker(marker, decorator) {
|
|
31
|
-
await decorator.toggleSection(marker, false);
|
|
32
|
-
}
|
|
33
|
-
/** Return toolbar items for the specified marker. If the array of toolbar items is empty, no toolbar will be displayed.
|
|
34
|
-
* @see [[executeCommand]] to implement each toolbar command.
|
|
35
|
-
*/
|
|
36
|
-
getToolbarProps(marker, _decorator) {
|
|
37
|
-
const localization = IModelApp.localization;
|
|
38
|
-
return {
|
|
39
|
-
items: [
|
|
40
|
-
{
|
|
41
|
-
id: "apply_view",
|
|
42
|
-
itemPriority: 10,
|
|
43
|
-
label: localization.getLocalizedString("HyperModeling:Message.ApplyView"),
|
|
44
|
-
icon: "icon-spatial-view-apply",
|
|
45
|
-
execute: () => { },
|
|
46
|
-
isDisabled: false,
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
id: "open_section",
|
|
50
|
-
itemPriority: 20,
|
|
51
|
-
label: localization.getLocalizedString("HyperModeling:Message.OpenSection"),
|
|
52
|
-
icon: "icon-plan-drawing",
|
|
53
|
-
execute: () => { },
|
|
54
|
-
isDisabled: false,
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
id: "open_sheet",
|
|
58
|
-
itemPriority: 30,
|
|
59
|
-
label: localization.getLocalizedString("HyperModeling:Message.OpenSheet"),
|
|
60
|
-
icon: "icon-plan-floor",
|
|
61
|
-
execute: () => { },
|
|
62
|
-
isDisabled: undefined === marker.state.viewAttachment?.viewId,
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
/** Execute the command associated with the specified tool bar item.
|
|
68
|
-
* @see [[getToolbarProps]] to define the set of commands.
|
|
69
|
-
*/
|
|
70
|
-
async executeCommand(commandId, marker, decorator) {
|
|
71
|
-
switch (commandId) {
|
|
72
|
-
case "apply_view":
|
|
73
|
-
await decorator.applySpatialView(marker);
|
|
74
|
-
break;
|
|
75
|
-
case "open_section":
|
|
76
|
-
await decorator.openSection(marker);
|
|
77
|
-
break;
|
|
78
|
-
case "open_sheet":
|
|
79
|
-
await decorator.openSheet(marker);
|
|
80
|
-
break;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
/** Customize which markers are visible. [[HyperModelingDecorator]] determines marker visibility as follows:
|
|
84
|
-
* - If a marker is currently active (selected), only that marker is visible.
|
|
85
|
-
* - Otherwise, the marker is visible if this method returns `true`.
|
|
86
|
-
* The default implementation of this method determines visibility based on the [[SectionMarkerConfig]] as follows.
|
|
87
|
-
* - If the marker is of a type included in the config's `hiddenSectionTypes`, it is invisible.
|
|
88
|
-
* - If the marker belongs to a model not currently displayed in the viewport and the config's `ignoreModelSelector` is false, it is invisible.
|
|
89
|
-
* - If the marker belongs to a category not currently displayed in the viewport and the config's `ignoreCategorySelector` is false, it is invisible,
|
|
90
|
-
* - Otherwise, the marker is visible, unless this method returns `false`.
|
|
91
|
-
* The default implementation of this method always returns `true`
|
|
92
|
-
* @param marker The marker whose visibility is to be determined.
|
|
93
|
-
* @param decorator The hypermodeling decorator to which the marker belongs.
|
|
94
|
-
* @param config The configuration controlling marker visibility based on [SectionType]($common), [ModelSelectorState]($frontend), and [CategorySelectorState]($frontend).
|
|
95
|
-
* @returns true if the marker should be displayed; false to make it invisible.
|
|
96
|
-
* @see [[HyperModelingDecorator.requestSync]] to force the decorator to reevaluate marker visibility when the criterion used by your implementation of this method changes.
|
|
97
|
-
*/
|
|
98
|
-
isMarkerVisible(marker, decorator, config) {
|
|
99
|
-
if (undefined !== config.hiddenSectionTypes && config.hiddenSectionTypes.includes(marker.state.sectionType))
|
|
100
|
-
return false;
|
|
101
|
-
if (!config.ignoreCategorySelector && !decorator.viewport.view.viewsCategory(marker.state.category))
|
|
102
|
-
return false;
|
|
103
|
-
if (!config.ignoreModelSelector && !decorator.viewport.view.viewsModel(marker.state.model))
|
|
104
|
-
return false;
|
|
105
|
-
return true;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module HyperModeling
|
|
7
|
+
*/
|
|
8
|
+
import { IModelApp } from "@itwin/core-frontend";
|
|
9
|
+
/** Supplies interactions with [[SectionMarker]]s, including a mini-toolbar displayed when the mouse hovers over a marker and what action occurs when the user clicks a marker.
|
|
10
|
+
* The base implementation supplies the following interactions:
|
|
11
|
+
* * Click: Toggle display of the section graphics and clip volume; apply the section's spatial view if toggling on.
|
|
12
|
+
* * Toolbar:
|
|
13
|
+
* * Apply Section: Applies the section location's spatial view to the viewport and displays the 2d section graphics.
|
|
14
|
+
* * Open Drawing: Navigates to the section drawing view. By default, this applies the section drawing view to the viewport.
|
|
15
|
+
* * Open Sheet: Navigates to the [ViewAttachment]($backend) of the section drawing on a [Sheet]($backend). Disabled if no such attachment exists.
|
|
16
|
+
* @see [[HyperModelingConfig]] to override the default handler by supplying a subclass of `SectionMarkerHandler`.
|
|
17
|
+
* @see [[HyperModelingDecorator]] for various methods that might be usefully wired up to marker click or toolbar actions.
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export class SectionMarkerHandler {
|
|
21
|
+
/** Respond to activation of the specified marker. Return true if the marker should become the active marker - i.e., if the marker was successfully activated.
|
|
22
|
+
* @see [[SectionMarkerHandler.deactivateMarker]].
|
|
23
|
+
*/
|
|
24
|
+
async activateMarker(marker, decorator) {
|
|
25
|
+
return decorator.toggleSection(marker, true);
|
|
26
|
+
}
|
|
27
|
+
/** Respond to deactivation of the specified marker. Invoked when the user clicks on the marker while it is the active marker.
|
|
28
|
+
* This should perform the inverse of [[SectionMarkerHandler.activateMarker]]. The marker becomes inactive as a result.
|
|
29
|
+
*/
|
|
30
|
+
async deactivateMarker(marker, decorator) {
|
|
31
|
+
await decorator.toggleSection(marker, false);
|
|
32
|
+
}
|
|
33
|
+
/** Return toolbar items for the specified marker. If the array of toolbar items is empty, no toolbar will be displayed.
|
|
34
|
+
* @see [[executeCommand]] to implement each toolbar command.
|
|
35
|
+
*/
|
|
36
|
+
getToolbarProps(marker, _decorator) {
|
|
37
|
+
const localization = IModelApp.localization;
|
|
38
|
+
return {
|
|
39
|
+
items: [
|
|
40
|
+
{
|
|
41
|
+
id: "apply_view",
|
|
42
|
+
itemPriority: 10,
|
|
43
|
+
label: localization.getLocalizedString("HyperModeling:Message.ApplyView"),
|
|
44
|
+
icon: "icon-spatial-view-apply",
|
|
45
|
+
execute: () => { },
|
|
46
|
+
isDisabled: false,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: "open_section",
|
|
50
|
+
itemPriority: 20,
|
|
51
|
+
label: localization.getLocalizedString("HyperModeling:Message.OpenSection"),
|
|
52
|
+
icon: "icon-plan-drawing",
|
|
53
|
+
execute: () => { },
|
|
54
|
+
isDisabled: false,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: "open_sheet",
|
|
58
|
+
itemPriority: 30,
|
|
59
|
+
label: localization.getLocalizedString("HyperModeling:Message.OpenSheet"),
|
|
60
|
+
icon: "icon-plan-floor",
|
|
61
|
+
execute: () => { },
|
|
62
|
+
isDisabled: undefined === marker.state.viewAttachment?.viewId,
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/** Execute the command associated with the specified tool bar item.
|
|
68
|
+
* @see [[getToolbarProps]] to define the set of commands.
|
|
69
|
+
*/
|
|
70
|
+
async executeCommand(commandId, marker, decorator) {
|
|
71
|
+
switch (commandId) {
|
|
72
|
+
case "apply_view":
|
|
73
|
+
await decorator.applySpatialView(marker);
|
|
74
|
+
break;
|
|
75
|
+
case "open_section":
|
|
76
|
+
await decorator.openSection(marker);
|
|
77
|
+
break;
|
|
78
|
+
case "open_sheet":
|
|
79
|
+
await decorator.openSheet(marker);
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/** Customize which markers are visible. [[HyperModelingDecorator]] determines marker visibility as follows:
|
|
84
|
+
* - If a marker is currently active (selected), only that marker is visible.
|
|
85
|
+
* - Otherwise, the marker is visible if this method returns `true`.
|
|
86
|
+
* The default implementation of this method determines visibility based on the [[SectionMarkerConfig]] as follows.
|
|
87
|
+
* - If the marker is of a type included in the config's `hiddenSectionTypes`, it is invisible.
|
|
88
|
+
* - If the marker belongs to a model not currently displayed in the viewport and the config's `ignoreModelSelector` is false, it is invisible.
|
|
89
|
+
* - If the marker belongs to a category not currently displayed in the viewport and the config's `ignoreCategorySelector` is false, it is invisible,
|
|
90
|
+
* - Otherwise, the marker is visible, unless this method returns `false`.
|
|
91
|
+
* The default implementation of this method always returns `true`
|
|
92
|
+
* @param marker The marker whose visibility is to be determined.
|
|
93
|
+
* @param decorator The hypermodeling decorator to which the marker belongs.
|
|
94
|
+
* @param config The configuration controlling marker visibility based on [SectionType]($common), [ModelSelectorState]($frontend), and [CategorySelectorState]($frontend).
|
|
95
|
+
* @returns true if the marker should be displayed; false to make it invisible.
|
|
96
|
+
* @see [[HyperModelingDecorator.requestSync]] to force the decorator to reevaluate marker visibility when the criterion used by your implementation of this method changes.
|
|
97
|
+
*/
|
|
98
|
+
isMarkerVisible(marker, decorator, config) {
|
|
99
|
+
if (undefined !== config.hiddenSectionTypes && config.hiddenSectionTypes.includes(marker.state.sectionType))
|
|
100
|
+
return false;
|
|
101
|
+
if (!config.ignoreCategorySelector && !decorator.viewport.view.viewsCategory(marker.state.category))
|
|
102
|
+
return false;
|
|
103
|
+
if (!config.ignoreModelSelector && !decorator.viewport.view.viewsModel(marker.state.model))
|
|
104
|
+
return false;
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
108
|
//# sourceMappingURL=SectionMarkerHandler.js.map
|
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module HyperModeling
|
|
3
|
-
*/
|
|
4
|
-
import { BeEvent, Id64String } from "@itwin/core-bentley";
|
|
5
|
-
import { XAndY, XYAndZ } from "@itwin/core-geometry";
|
|
6
|
-
import { BeButtonEvent, Cluster, DecorateContext, Marker, MarkerImage, MarkerSet, ScreenViewport } from "@itwin/core-frontend";
|
|
7
|
-
import { SectionDrawingLocationState } from "./SectionDrawingLocationState";
|
|
8
|
-
/** A [Marker]($frontend) associated with a [[SectionDrawingLocationState]], displayed as a canvas decoration at the location of the section.
|
|
9
|
-
* Clicking on the marker toggles display of the section graphics. Mousing over the marker produces a toolbar with additional interactions.
|
|
10
|
-
* @see [[HyperModelingDecorator]] for a [Decorator]($frontend) capable of displaying section markers for each section drawing location.
|
|
11
|
-
* @see [[SectionMarkerHandler]] to customize the marker interactions.
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
export declare class SectionMarker extends Marker {
|
|
15
|
-
/** The section drawing location state associated with the marker. */
|
|
16
|
-
readonly state: SectionDrawingLocationState;
|
|
17
|
-
/** A description displayed as part of the tooltip when this marker is clustered with other markers. */
|
|
18
|
-
readonly description: string;
|
|
19
|
-
/** @internal */
|
|
20
|
-
readonly onMouseEnterEvent: BeEvent<(marker: SectionMarker) => void>;
|
|
21
|
-
/** @internal */
|
|
22
|
-
readonly onMouseButtonEvent: BeEvent<(marker: SectionMarker) => void>;
|
|
23
|
-
/** @internal */
|
|
24
|
-
private _isActive;
|
|
25
|
-
/** Constructor, typically invoked indirectly via [[HyperModelingDecorator]].
|
|
26
|
-
* @param state The section drawing location state this marker will represent.
|
|
27
|
-
* @param pos The world coordinates at which to display the marker.
|
|
28
|
-
* @param description A brief description of this marker, used as part of the tooltip when this marker is part of a cluster.
|
|
29
|
-
* @param icon The icon displayed by the marker.
|
|
30
|
-
* @param tooltip Optional detailed tooltip displayed on mouse hover. If undefined, the `description` is used instead.
|
|
31
|
-
*/
|
|
32
|
-
constructor(state: SectionDrawingLocationState);
|
|
33
|
-
/** @internal */
|
|
34
|
-
get isHilited(): boolean;
|
|
35
|
-
/** Returns true if this is the "active" section marker. At most one marker is active at a given time.
|
|
36
|
-
* @see [[HyperModelingDecorator.activeMarker]].
|
|
37
|
-
* @see [[HyperModelingDecorator.setActiveMarker]].
|
|
38
|
-
* @see [[SectionMarkerHandler.toggleMarker]].
|
|
39
|
-
*/
|
|
40
|
-
get isActive(): boolean;
|
|
41
|
-
/** @internal */
|
|
42
|
-
setActive(active: boolean): void;
|
|
43
|
-
/** @internal */
|
|
44
|
-
protected drawActive(ctx: CanvasRenderingContext2D): boolean;
|
|
45
|
-
/** @internal */
|
|
46
|
-
drawDecoration(ctx: CanvasRenderingContext2D): void;
|
|
47
|
-
/** @internal */
|
|
48
|
-
onMouseEnter(ev: BeButtonEvent): void;
|
|
49
|
-
/** @internal */
|
|
50
|
-
onMouseButton(ev: BeButtonEvent): boolean;
|
|
51
|
-
/** @internal */
|
|
52
|
-
addMarker(context: DecorateContext): void;
|
|
53
|
-
}
|
|
54
|
-
/** A Marker used to show a cluster of section locations.
|
|
55
|
-
* @internal
|
|
56
|
-
*/
|
|
57
|
-
export declare class SectionMarkerCluster extends Marker {
|
|
58
|
-
/** Create a new cluster marker */
|
|
59
|
-
constructor(location: XYAndZ, size: XAndY, cluster: Cluster<SectionMarker>, image: MarkerImage | Promise<MarkerImage> | undefined);
|
|
60
|
-
/** Show the cluster as a white circle with an outline */
|
|
61
|
-
drawFunc(ctx: CanvasRenderingContext2D): void;
|
|
62
|
-
onMouseButton(_ev: BeButtonEvent): boolean;
|
|
63
|
-
}
|
|
64
|
-
/** A [MarkerSet]($frontend) containing [[SectionMarker]]s identifying [SectionDrawingLocation]($backend)s within a spatial view.
|
|
65
|
-
* Typically used indirectly via [[HyperModelingDecorator]].
|
|
66
|
-
* @public
|
|
67
|
-
*/
|
|
68
|
-
export declare class SectionMarkerSet extends MarkerSet<SectionMarker> {
|
|
69
|
-
minimumClusterSize: number;
|
|
70
|
-
/** Constructor
|
|
71
|
-
* @param viewport The viewport in which the markers are to be displayed.
|
|
72
|
-
* @param markers The markers to be displayed.
|
|
73
|
-
* @note Each marker's [[SectionDrawingLocationState]] must be associated with the same [IModelConnection]($frontend) as the viewport; any markers from other iModels will be omitted.
|
|
74
|
-
*/
|
|
75
|
-
constructor(viewport: ScreenViewport, markers: SectionMarker[]);
|
|
76
|
-
/** The viewport in which the markers are to be displayed. */
|
|
77
|
-
get viewport(): ScreenViewport;
|
|
78
|
-
/** @internal */
|
|
79
|
-
protected getClusterMarker(cluster: Cluster<SectionMarker>): Marker;
|
|
80
|
-
/** Find the SectionMarker corresponding to the specified [SectionDrawingLocation]($backend) Id. */
|
|
81
|
-
findMarkerById(sectionDrawingLocationId: Id64String): SectionMarker | undefined;
|
|
82
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module HyperModeling
|
|
3
|
+
*/
|
|
4
|
+
import { BeEvent, Id64String } from "@itwin/core-bentley";
|
|
5
|
+
import { XAndY, XYAndZ } from "@itwin/core-geometry";
|
|
6
|
+
import { BeButtonEvent, Cluster, DecorateContext, Marker, MarkerImage, MarkerSet, ScreenViewport } from "@itwin/core-frontend";
|
|
7
|
+
import { SectionDrawingLocationState } from "./SectionDrawingLocationState";
|
|
8
|
+
/** A [Marker]($frontend) associated with a [[SectionDrawingLocationState]], displayed as a canvas decoration at the location of the section.
|
|
9
|
+
* Clicking on the marker toggles display of the section graphics. Mousing over the marker produces a toolbar with additional interactions.
|
|
10
|
+
* @see [[HyperModelingDecorator]] for a [Decorator]($frontend) capable of displaying section markers for each section drawing location.
|
|
11
|
+
* @see [[SectionMarkerHandler]] to customize the marker interactions.
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export declare class SectionMarker extends Marker {
|
|
15
|
+
/** The section drawing location state associated with the marker. */
|
|
16
|
+
readonly state: SectionDrawingLocationState;
|
|
17
|
+
/** A description displayed as part of the tooltip when this marker is clustered with other markers. */
|
|
18
|
+
readonly description: string;
|
|
19
|
+
/** @internal */
|
|
20
|
+
readonly onMouseEnterEvent: BeEvent<(marker: SectionMarker) => void>;
|
|
21
|
+
/** @internal */
|
|
22
|
+
readonly onMouseButtonEvent: BeEvent<(marker: SectionMarker) => void>;
|
|
23
|
+
/** @internal */
|
|
24
|
+
private _isActive;
|
|
25
|
+
/** Constructor, typically invoked indirectly via [[HyperModelingDecorator]].
|
|
26
|
+
* @param state The section drawing location state this marker will represent.
|
|
27
|
+
* @param pos The world coordinates at which to display the marker.
|
|
28
|
+
* @param description A brief description of this marker, used as part of the tooltip when this marker is part of a cluster.
|
|
29
|
+
* @param icon The icon displayed by the marker.
|
|
30
|
+
* @param tooltip Optional detailed tooltip displayed on mouse hover. If undefined, the `description` is used instead.
|
|
31
|
+
*/
|
|
32
|
+
constructor(state: SectionDrawingLocationState);
|
|
33
|
+
/** @internal */
|
|
34
|
+
get isHilited(): boolean;
|
|
35
|
+
/** Returns true if this is the "active" section marker. At most one marker is active at a given time.
|
|
36
|
+
* @see [[HyperModelingDecorator.activeMarker]].
|
|
37
|
+
* @see [[HyperModelingDecorator.setActiveMarker]].
|
|
38
|
+
* @see [[SectionMarkerHandler.toggleMarker]].
|
|
39
|
+
*/
|
|
40
|
+
get isActive(): boolean;
|
|
41
|
+
/** @internal */
|
|
42
|
+
setActive(active: boolean): void;
|
|
43
|
+
/** @internal */
|
|
44
|
+
protected drawActive(ctx: CanvasRenderingContext2D): boolean;
|
|
45
|
+
/** @internal */
|
|
46
|
+
drawDecoration(ctx: CanvasRenderingContext2D): void;
|
|
47
|
+
/** @internal */
|
|
48
|
+
onMouseEnter(ev: BeButtonEvent): void;
|
|
49
|
+
/** @internal */
|
|
50
|
+
onMouseButton(ev: BeButtonEvent): boolean;
|
|
51
|
+
/** @internal */
|
|
52
|
+
addMarker(context: DecorateContext): void;
|
|
53
|
+
}
|
|
54
|
+
/** A Marker used to show a cluster of section locations.
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
export declare class SectionMarkerCluster extends Marker {
|
|
58
|
+
/** Create a new cluster marker */
|
|
59
|
+
constructor(location: XYAndZ, size: XAndY, cluster: Cluster<SectionMarker>, image: MarkerImage | Promise<MarkerImage> | undefined);
|
|
60
|
+
/** Show the cluster as a white circle with an outline */
|
|
61
|
+
drawFunc(ctx: CanvasRenderingContext2D): void;
|
|
62
|
+
onMouseButton(_ev: BeButtonEvent): boolean;
|
|
63
|
+
}
|
|
64
|
+
/** A [MarkerSet]($frontend) containing [[SectionMarker]]s identifying [SectionDrawingLocation]($backend)s within a spatial view.
|
|
65
|
+
* Typically used indirectly via [[HyperModelingDecorator]].
|
|
66
|
+
* @public
|
|
67
|
+
*/
|
|
68
|
+
export declare class SectionMarkerSet extends MarkerSet<SectionMarker> {
|
|
69
|
+
minimumClusterSize: number;
|
|
70
|
+
/** Constructor
|
|
71
|
+
* @param viewport The viewport in which the markers are to be displayed.
|
|
72
|
+
* @param markers The markers to be displayed.
|
|
73
|
+
* @note Each marker's [[SectionDrawingLocationState]] must be associated with the same [IModelConnection]($frontend) as the viewport; any markers from other iModels will be omitted.
|
|
74
|
+
*/
|
|
75
|
+
constructor(viewport: ScreenViewport, markers: SectionMarker[]);
|
|
76
|
+
/** The viewport in which the markers are to be displayed. */
|
|
77
|
+
get viewport(): ScreenViewport;
|
|
78
|
+
/** @internal */
|
|
79
|
+
protected getClusterMarker(cluster: Cluster<SectionMarker>): Marker;
|
|
80
|
+
/** Find the SectionMarker corresponding to the specified [SectionDrawingLocation]($backend) Id. */
|
|
81
|
+
findMarkerById(sectionDrawingLocationId: Id64String): SectionMarker | undefined;
|
|
82
|
+
}
|
|
83
83
|
//# sourceMappingURL=SectionMarkers.d.ts.map
|