PolyfaceVisitor Interface
A PolyfaceVisitor manages data while walking through facets.
- The polyface visitor holds data for one facet at a time.
- The caller can request the position in the addressed polyfaceData as a "readIndex".
- The readIndex values (as numbers) are not promised to be sequential (i.e., it might be a simple facet count or might have "gaps" at the whim of the particular PolyfaceVisitor implementation).
Extends
Implemented by
Methods
Name | Description | |
---|---|---|
clearArrays(): void | Clear the contents of all arrays. | |
clientAuxIndex(i: number): number | Return the aux data index of vertex i within the currently loaded facet. | |
clientColorIndex(i: number): number | Return the color index of vertex i within the currently loaded facet. | |
clientNormalIndex(i: number): number | Return the normal index of vertex i within the currently loaded facet. | |
clientParamIndex(i: number): number | Return the param index of vertex i within the currently loaded facet. | |
clientPointIndex(i: number): number | Return the point index of vertex i within the currently loaded facet. | |
clientPolyface(): undefined | Polyface | Return the client polyface. | |
currentReadIndex(): number | Return the readIndex of the currently loaded facet. | |
getVisitableFacetCount(): number Optional | Return the number of facets this visitor is able to visit. | |
moveToNextFacet(): boolean | Load data for the next facet. | |
moveToReadIndex(index: number): boolean | Load data for the facet with given index. | |
pushDataFrom(other: PolyfaceVisitor, index: number): void | Transfer data from a specified index of the other visitor as new data in this visitor. | |
pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void | Transfer interpolated data from the other visitor. | |
reset(): void | Reset to initial state for reading all facets sequentially with moveToNextFacet. | |
setNumWrap(numWrap: number): void | Set the number of vertices replicated in visitor arrays (both data and index arrays). |
Inherited methods
Name | Inherited from | Description |
---|---|---|
clone(): PolyfaceData Inherited | PolyfaceData | Return a deep clone. |
compress(tolerance: numberGeometry.smallMetricDistance): void Inherited | PolyfaceData | Compress the instance by equating duplicate data. |
copyNormalTo(i: number, dest: Vector3d): void Inherited | PolyfaceData | Copy the contents (not pointer) of normal[i] into dest . |
copyParamTo(i: number, dest: Point2d): void Inherited | PolyfaceData | Copy the contents (not pointer) of param[i] into dest . |
copyPointTo(i: number, dest: Point3d): void Inherited | PolyfaceData | Copy the contents (not pointer) of point[i] into dest . |
gatherIndexedData(other: PolyfaceData, index0: number, index1: number, numWrap: number): void Inherited | PolyfaceData | Copy data from other to this . |
getColor(i: number): number Inherited | PolyfaceData | Return indexed color at index i . |
getEdgeVisible(i: number): boolean Inherited | PolyfaceData | Return indexed visibility. |
getNormal(i: number, result?: Vector3d): undefined | Vector3d Inherited | PolyfaceData | Return indexed normal at index i . |
getParam(i: number, result?: Point2d): undefined | Point2d Inherited | PolyfaceData | Return indexed param at index i . |
getPoint(i: number, result?: Point3d): undefined | Point3d Inherited | PolyfaceData | Return indexed point at index i . |
isAlmostEqual(other: PolyfaceData): boolean Inherited | PolyfaceData | Test for equal indices and nearly equal coordinates. |
isAlmostEqualParamIndexUV(i: number, u: number, v: number): boolean Inherited | PolyfaceData | Test if param at a index i matches the given uv |
range(result?: Range3d, transform?: Transform): Range3d Inherited | PolyfaceData | Return the range of the point array (optionally transformed). |
resizeAllArrays(length: number): void Inherited | PolyfaceData | Resize all data and index arrays to the specified length . |
resizeAllDataArrays(length: number): void Inherited | PolyfaceData | Resize all data arrays to the specified length . |
reverseIndices(facetStartIndex?: number[]): void Inherited | PolyfaceData | Reverse the indices for the specified facets in the index arrays (pointIndex, normalIndex, paramIndex, colorIndex, |
reverseIndicesSingleFacet(facetIndex: number, facetStartIndex: number[]): void Inherited | PolyfaceData | Reverse the indices for the specified facet in the index arrays (pointIndex, normalIndex, paramIndex, colorIndex, |
reverseNormals(): void Inherited | PolyfaceData | Scale all the normals by -1. |
setTaggedNumericData(data: TaggedNumericData): void Inherited | PolyfaceData | Set the tagged geometry data. |
trimAllIndexArrays(length: number): void Inherited | PolyfaceData | Trim all index arrays to the stated length . |
tryTransformInPlace(transform: Transform): boolean Inherited | PolyfaceData | Apply transform to point and normal arrays and to auxData. |
Inherited properties
Name | Type | Inherited from | Description |
---|---|---|---|
auxData Inherited | PolyfaceAuxData | undefined | PolyfaceData | Auxiliary data. |
color Inherited | number[] | undefined | PolyfaceData | Color values. |
colorIndex Inherited | number[] | undefined | PolyfaceData | Indices of colors at facet vertices. |
edgeVisible Inherited | boolean[] | PolyfaceData | Booleans indicating visibility of corresponding edges. |
face Inherited | FacetFaceData[] | PolyfaceData | Map from facet index to face data. |
normal Inherited | GrowableXYZArray | undefined | PolyfaceData | Coordinates of normal vectors (packed as numbers in a contiguous array). |
normalIndex Inherited | number[] | undefined | PolyfaceData | Indices of normals at facet vertices. |
param Inherited | GrowableXYArray | undefined | PolyfaceData | Coordinates of uv parameters (packed as numbers in a contiguous array). |
paramIndex Inherited | number[] | undefined | PolyfaceData | Indices of params at facet vertices. |
point Inherited | GrowableXYZArray | PolyfaceData | Coordinate data for points in the facets (packed as numbers in a contiguous array). |
pointIndex Inherited | number[] | PolyfaceData | Indices of points at facet vertices. |
taggedNumericData Inherited | TaggedNumericData | undefined | PolyfaceData | Tagged geometry data. |
colorCount Accessor Inherited ReadOnly | number | PolyfaceData | Get the color count |
expectedClosure Accessor Inherited | number | PolyfaceData | Get flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2). |
faceCount Accessor Inherited ReadOnly | number | PolyfaceData | Get the number of faces. * Note that a "face" is not a facet. * A face is a subset of the Polyface's facets grouped for application purposes. |
indexCount Accessor Inherited ReadOnly | number | PolyfaceData | Get the index count. Note that the point array is always indexed, and index arrays all have the same length. |
normalCount Accessor Inherited ReadOnly | number | PolyfaceData | Get the normal count |
paramCount Accessor Inherited ReadOnly | number | PolyfaceData | Get the param count |
pointCount Accessor Inherited ReadOnly | number | PolyfaceData | Get the point count |
requireColors Accessor Inherited ReadOnly | boolean | PolyfaceData | Ask if colors are required in this mesh. |
requireNormals Accessor Inherited ReadOnly | boolean | PolyfaceData | Ask if normals are required in this mesh. |
requireParams Accessor Inherited ReadOnly | boolean | PolyfaceData | Ask if params are required in this mesh. |
twoSided Accessor Inherited | boolean | PolyfaceData | Get boolean tag indicating if the facets are to be considered viewable from the back. |
Defined in
- polyface/Polyface.ts Line 649
Last Updated: 14 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.