GraphicAssembler Class
Provides methods for assembling geometric primitives and symbology into a graphical representation. Two concrete implementations are provided:
- GraphicBuilder, for creating RenderGraphics directly; and
- GraphicDescriptionBuilder, for creating a GraphicDescription from which a RenderGraphic can be produced.
GraphicBuilder can only be used on the main JavaScript thread, so its use should be reserved for relatively simple, quick-to-produce graphics like Decorations. GraphicDescriptionBuilder is designed for use in a Worker. It can be used to assemble more complex graphics without blocking the main thread.
@note Most of the methods which add geometry to the builder take ownership of their inputs rather than cloning them. So, for example, if you pass an array of points to addLineString, you should not subsequently modify that array.
Extended by
Methods
Name | Description | |
---|---|---|
activateFeature(feature: Feature): void | Change the Feature to be associated with subsequently-added geometry. | |
activateGraphicParams(graphicParams: GraphicParams): void | Sets the current active symbology for this builder. | |
activatePickableId(id: string): void | Change the pickable Id to be associated with subsequently-added geometry. | |
add(geom: Geometry): void | ||
addArc(ellipse: Arc3d, isEllipse: boolean, filled: boolean): void | Appends a 3d open arc or closed ellipse to the builder. | |
addArc2d(ellipse: Arc3d, isEllipse: boolean, filled: boolean, zDepth: number): void | Appends a 2d open arc or closed ellipse to the builder. | |
addCurvePrimitive(curve: AnyCurvePrimitive): void | Append a CurvePrimitive to the builder. | |
addFrustum(frustum: Frustum): void | Add Frustum edges. | |
addFrustumSides(frustum: Frustum): void | Add Frustum sides. | |
addLineString(points: Point3d[]): void | Appends a 3d line string to the builder. | |
addLineString2d(points: Point2d[], zDepth: number): void | Appends a 2d line string to the builder. | |
addLoop(loop: Loop): void | Append a 3d planar region to the builder. | |
addPath(path: Path): void | Append a 3d open path to the builder. | |
addPointString(points: Point3d[]): void | Appends a 3d point string to the builder. | |
addPointString2d(points: Point2d[], zDepth: number): void | Appends a 2d point string to the builder. | |
addPolyface(meshData: Polyface, _filled: booleanfalse): void | Append a mesh to the builder. | |
addPrimitive(primitive: GraphicPrimitive): void | Append any primitive to the builder. | |
addRangeBox(range: Range3d, solid: booleanfalse): void | Add a box representing a volume of space. | |
addRangeBoxFromCorners(p: Point3d[]): void | Add range edges from corner points | |
addRangeBoxSidesFromCorners(p: Point3d[]): void | Add range sides from corner points | |
addShape(points: Point3d[]): void | Appends a closed 3d planar region to the builder. | |
addShape2d(points: Point2d[], zDepth: number): void | Appends a closed 2d region to the builder. | |
addSolidPrimitive(primitive: SolidPrimitive): void | Append a solid primitive to the builder. | |
setBlankingFill(fillColor: ColorDef): void | Set the current active symbology for this builder to be a blanking fill before adding a planar region. | |
setSymbology(lineColor: ColorDef, fillColor: ColorDef, lineWidth: number, linePixels: LinePixelsLinePixels.Solid): void | Sets the current active symbology for this builder. |
Properties
Name | Type | Description | |
---|---|---|---|
isOverlay Accessor ReadOnly | boolean | True if the builder produces a graphic of WorldOverlay or ViewOerlay. | |
isSceneGraphic Accessor ReadOnly | boolean | True if the builder produces a graphic of GraphicType.Scene. | |
isViewBackground Accessor ReadOnly | boolean | True if the builder produces a graphic of ViewBackground. | |
isViewCoordinates Accessor ReadOnly | boolean | Whether the builder's geometry is defined in CoordSystem.View coordinates. | |
isWorldCoordinates Accessor ReadOnly | boolean | Whether the builder's geometry is defined in CoordSystem.World coordinates - the inverse of isViewCoordinates. | |
pickable Readonly | Readonly<PickableGraphicOptions> | undefined | If the graphic is to be interactive, specifies its Id and other options. | |
placement Readonly | Transform | The local-to-world transform in which the builder's geometry is to be defined. | |
preserveOrder Readonly | boolean | If true, the order in which geometry is added to the builder is preserved. | |
type Readonly | GraphicType | The type of graphic to be produced. | |
wantEdges Readonly | boolean | If true, edges are generated for surfaces, to be drawn if edge display is enabled for the view in which the graphic is drawn. | |
wantNormals Readonly | boolean | If true, normal vectors will be generated for surfaces, allowing 3d geometry to receive lighting and reduce z-fighting. |
Defined in
Last Updated: 21 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.