@kitware/vtk.js 24.4.1 → 24.5.2
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/Common/Core/Base64.d.ts +4 -2
- package/Common/Core/CellArray.d.ts +2 -2
- package/Common/Core/DataArray.d.ts +2 -2
- package/Common/Core/Endian.d.ts +1 -1
- package/Common/Core/ImageHelper.d.ts +1 -1
- package/Common/Core/LookupTable.d.ts +1 -1
- package/Common/Core/Math/index.js +1 -1
- package/Common/Core/Math.d.ts +1 -1
- package/Common/Core/Math.js +1 -1
- package/Common/Core/MatrixBuilder.d.ts +1 -1
- package/Common/Core/Points.d.ts +2 -2
- package/Common/Core/PriorityQueue.d.ts +1 -1
- package/Common/Core/ProgressHandler.d.ts +1 -1
- package/Common/Core/ScalarsToColors.d.ts +3 -3
- package/Common/Core/StringArray.d.ts +1 -1
- package/Common/Core/VariantArray.d.ts +1 -1
- package/Common/DataModel/Box.d.ts +2 -2
- package/Common/DataModel/CardinalSpline1D.d.ts +1 -1
- package/Common/DataModel/Cell.d.ts +3 -3
- package/Common/DataModel/Cone.d.ts +2 -2
- package/Common/DataModel/Cylinder.d.ts +2 -2
- package/Common/DataModel/DataSet.d.ts +1 -1
- package/Common/DataModel/DataSetAttributes/FieldData.d.ts +1 -1
- package/Common/DataModel/DataSetAttributes.d.ts +3 -3
- package/Common/DataModel/ImageData.d.ts +1 -1
- package/Common/DataModel/Line.d.ts +1 -1
- package/Common/DataModel/PiecewiseFunction.d.ts +2 -2
- package/Common/DataModel/Plane.d.ts +2 -2
- package/Common/DataModel/PointSet.d.ts +2 -2
- package/Common/DataModel/PolyData.d.ts +2 -2
- package/Common/DataModel/Polygon.d.ts +2 -2
- package/Common/DataModel/SelectionNode.d.ts +2 -2
- package/Common/DataModel/Sphere.d.ts +2 -2
- package/Common/DataModel/Spline1D.d.ts +1 -1
- package/Common/DataModel/Spline3D.d.ts +1 -1
- package/Common/DataModel/Triangle.d.ts +1 -1
- package/Common/Transform/LandmarkTransform.d.ts +2 -2
- package/Filters/Core/PolyDataNormals.js +124 -0
- package/Filters/Core.js +3 -1
- package/Filters/General/AppendPolyData.d.ts +1 -1
- package/Filters/General/ImageCropFilter.d.ts +1 -1
- package/Filters/General/ImageOutlineFilter.d.ts +1 -1
- package/Filters/General/ImageSliceFilter.d.ts +1 -1
- package/Filters/General/ImageStreamline.d.ts +3 -3
- package/Filters/General/LineFilter.d.ts +1 -1
- package/Filters/General/OBBTree.js +1 -1
- package/Filters/General/OutlineFilter.d.ts +1 -1
- package/Filters/General/TriangleFilter.d.ts +1 -1
- package/Filters/General/TubeFilter.d.ts +2 -2
- package/Filters/General/WindowedSincPolyDataFilter.js +1 -1
- package/Filters/Sources/Arrow2DSource.d.ts +2 -2
- package/Filters/Sources/ArrowSource.d.ts +2 -2
- package/Filters/Sources/CircleSource.d.ts +2 -2
- package/Filters/Sources/ConeSource.d.ts +2 -2
- package/Filters/Sources/CubeSource.d.ts +2 -2
- package/Filters/Sources/Cursor3D.d.ts +3 -3
- package/Filters/Sources/CylinderSource.d.ts +2 -2
- package/Filters/Sources/LineSource.d.ts +2 -2
- package/Filters/Sources/PlaneSource.d.ts +2 -2
- package/Filters/Sources/PointSource.d.ts +2 -2
- package/Filters/Sources/SphereSource.d.ts +2 -2
- package/Filters/Texture/TextureMapToPlane.d.ts +1 -1
- package/Filters/Texture/TextureMapToSphere.d.ts +1 -1
- package/IO/Core/DataAccessHelper.d.ts +4 -4
- package/IO/Core/HttpDataSetReader.d.ts +1 -1
- package/IO/Core/HttpSceneLoader.d.ts +5 -5
- package/IO/Core/ImageStream/DefaultProtocol.d.ts +1 -1
- package/IO/Core/ImageStream/ViewStream.d.ts +4 -4
- package/IO/Core/ImageStream.d.ts +3 -3
- package/IO/Core/WSLinkClient.d.ts +1 -1
- package/IO/Geometry/DracoReader.d.ts +5 -5
- package/IO/Geometry/PLYReader.d.ts +5 -5
- package/IO/Geometry/PLYWriter.d.ts +2 -2
- package/IO/Geometry/STLReader.d.ts +5 -5
- package/IO/Geometry/STLWriter.d.ts +2 -2
- package/IO/Misc/ElevationReader.d.ts +5 -5
- package/IO/Misc/ITKImageReader.d.ts +1 -1
- package/IO/Misc/ITKPolyDataReader.d.ts +1 -1
- package/IO/Misc/JSONNucleoReader.d.ts +5 -5
- package/IO/Misc/JSONReader.d.ts +1 -1
- package/IO/Misc/MTLReader.d.ts +6 -6
- package/IO/Misc/OBJReader.d.ts +38 -7
- package/IO/Misc/OBJReader.js +132 -34
- package/IO/Misc/PDBReader.d.ts +5 -5
- package/IO/XML/XMLReader.d.ts +5 -5
- package/Interaction/Widgets/OrientationMarkerWidget.d.ts +6 -6
- package/Rendering/Core/AbstractMapper.d.ts +2 -2
- package/Rendering/Core/AbstractMapper3D.d.ts +1 -1
- package/Rendering/Core/AbstractPicker.d.ts +2 -2
- package/Rendering/Core/Actor.d.ts +1 -1
- package/Rendering/Core/Actor2D.d.ts +1 -1
- package/Rendering/Core/Camera.d.ts +2 -2
- package/Rendering/Core/CellPicker.d.ts +2 -2
- package/Rendering/Core/ColorTransferFunction.d.ts +1 -1
- package/Rendering/Core/Coordinate.d.ts +1 -1
- package/Rendering/Core/Glyph3DMapper.d.ts +1 -1
- package/Rendering/Core/ImageMapper.d.ts +1 -1
- package/Rendering/Core/ImageProperty.d.ts +1 -1
- package/Rendering/Core/ImageSlice.d.ts +1 -1
- package/Rendering/Core/Light.d.ts +2 -2
- package/Rendering/Core/Mapper.d.ts +1 -1
- package/Rendering/Core/Mapper2D.d.ts +1 -1
- package/Rendering/Core/Picker.d.ts +1 -1
- package/Rendering/Core/PointPicker.d.ts +1 -1
- package/Rendering/Core/Prop.d.ts +1 -1
- package/Rendering/Core/Prop3D.d.ts +1 -1
- package/Rendering/Core/Property.d.ts +2 -2
- package/Rendering/Core/Property2D.d.ts +2 -2
- package/Rendering/Core/RenderWindow.d.ts +2 -2
- package/Rendering/Core/RenderWindowInteractor.d.ts +1 -1
- package/Rendering/Core/Renderer.d.ts +1 -1
- package/Rendering/Core/ScalarBarActor.d.ts +2 -2
- package/Rendering/Core/Texture.d.ts +1 -1
- package/Rendering/Core/Viewport.d.ts +2 -2
- package/Rendering/Core/Volume.d.ts +1 -1
- package/Rendering/Core/VolumeMapper.d.ts +1 -1
- package/Rendering/Core/VolumeProperty.d.ts +1 -1
- package/Rendering/Misc/CanvasView.d.ts +2 -2
- package/Rendering/Misc/FullScreenRenderWindow.d.ts +8 -8
- package/Rendering/Misc/GenericRenderWindow.d.ts +6 -6
- package/Rendering/Misc/RemoteView.d.ts +2 -2
- package/Rendering/Misc/RenderWindowWithControlBar.d.ts +1 -1
- package/Rendering/Misc/SynchronizableRenderWindow.d.ts +2 -2
- package/Rendering/Misc/TextureLODsDownloader.d.ts +3 -3
- package/Rendering/OpenGL/RenderWindow.d.ts +6 -6
- package/Rendering/SceneGraph/RenderPass.d.ts +1 -1
- package/Rendering/SceneGraph/ViewNode.d.ts +1 -1
- package/Rendering/SceneGraph/ViewNodeFactory.d.ts +1 -1
- package/Widgets/Manipulators/LineManipulator.d.ts +1 -1
- package/Widgets/Manipulators/PlaneManipulator.d.ts +1 -1
- package/Widgets/Manipulators/TrackballManipulator.d.ts +1 -1
- package/Widgets/Representations/WidgetRepresentation.d.ts +1 -1
- package/Widgets/Widgets3D/ShapeWidget/behavior.js +1 -1
- package/Widgets/Widgets3D/SphereWidget.d.ts +2 -2
- package/_virtual/rollup-plugin-web-worker-loader__helper__funcToSource.js +8 -8
- package/interfaces.d.ts +2 -2
- package/macros.d.ts +1 -1
- package/package.json +1 -1
- package/types.d.ts +1 -1
- package/tsconfig.json +0 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import HtmlDataAccessHelper from '
|
|
2
|
-
import HttpDataAccessHelper from '
|
|
3
|
-
import JSZipDataAccessHelper from '
|
|
4
|
-
import LiteHttpDataAccessHelper from '
|
|
1
|
+
import HtmlDataAccessHelper from './DataAccessHelper/HtmlDataAccessHelper';
|
|
2
|
+
import HttpDataAccessHelper from './DataAccessHelper/HttpDataAccessHelper';
|
|
3
|
+
import JSZipDataAccessHelper from './DataAccessHelper/JSZipDataAccessHelper';
|
|
4
|
+
import LiteHttpDataAccessHelper from './DataAccessHelper/LiteHttpDataAccessHelper';
|
|
5
5
|
|
|
6
6
|
export function has(type: string): boolean;
|
|
7
7
|
export function get(type?: string, options?: object): HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { vtkAlgorithm, vtkObject, vtkSubscription } from '
|
|
1
|
+
import { vtkAlgorithm, vtkObject, vtkSubscription } from './../../interfaces';
|
|
2
2
|
import HtmlDataAccessHelper from './DataAccessHelper/HtmlDataAccessHelper';
|
|
3
3
|
import HttpDataAccessHelper from './DataAccessHelper/HttpDataAccessHelper';
|
|
4
4
|
import JSZipDataAccessHelper from './DataAccessHelper/JSZipDataAccessHelper';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { vtkObject } from '
|
|
2
|
-
import vtkAnnotatedCubeActor from '
|
|
3
|
-
import vtkAxesActor from '
|
|
4
|
-
import vtkRenderer from '
|
|
5
|
-
import vtkRenderWindowInteractor from '
|
|
1
|
+
import { vtkObject } from './../../interfaces';
|
|
2
|
+
import vtkAnnotatedCubeActor from './../../Rendering/Core/AnnotatedCubeActor';
|
|
3
|
+
import vtkAxesActor from './../../Rendering/Core/AxesActor';
|
|
4
|
+
import vtkRenderer from './../../Rendering/Core/Renderer';
|
|
5
|
+
import vtkRenderWindowInteractor from './../../Rendering/Core/RenderWindowInteractor';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { vtkObject } from '
|
|
2
|
-
import { Size } from '
|
|
3
|
-
import vtkCamera from '
|
|
4
|
-
import DefaultProtocol from '
|
|
1
|
+
import { vtkObject } from '../../../interfaces';
|
|
2
|
+
import { Size } from '../../../types';
|
|
3
|
+
import vtkCamera from '../../../Rendering/Core/Camera';
|
|
4
|
+
import DefaultProtocol from './DefaultProtocol';
|
|
5
5
|
/**
|
|
6
6
|
*
|
|
7
7
|
*/
|
package/IO/Core/ImageStream.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { vtkObject } from '
|
|
2
|
-
import { Size } from '
|
|
3
|
-
import vtkViewStream from '
|
|
1
|
+
import { vtkObject } from './../../interfaces';
|
|
2
|
+
import { Size } from './../../types';
|
|
3
|
+
import vtkViewStream from './ImageStream/ViewStream';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { vtkAlgorithm, vtkObject } from '
|
|
2
|
-
import HtmlDataAccessHelper from '
|
|
3
|
-
import HttpDataAccessHelper from '
|
|
4
|
-
import JSZipDataAccessHelper from '
|
|
5
|
-
import LiteHttpDataAccessHelper from '
|
|
1
|
+
import { vtkAlgorithm, vtkObject } from './../../interfaces';
|
|
2
|
+
import HtmlDataAccessHelper from './../Core/DataAccessHelper/HtmlDataAccessHelper';
|
|
3
|
+
import HttpDataAccessHelper from './../Core/DataAccessHelper/HttpDataAccessHelper';
|
|
4
|
+
import JSZipDataAccessHelper from './../Core/DataAccessHelper/JSZipDataAccessHelper';
|
|
5
|
+
import LiteHttpDataAccessHelper from './../Core/DataAccessHelper/LiteHttpDataAccessHelper';
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
interface IDracoReaderOptions {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { vtkAlgorithm, vtkObject } from '
|
|
2
|
-
import HtmlDataAccessHelper from '
|
|
3
|
-
import HttpDataAccessHelper from '
|
|
4
|
-
import JSZipDataAccessHelper from '
|
|
5
|
-
import LiteHttpDataAccessHelper from '
|
|
1
|
+
import { vtkAlgorithm, vtkObject } from './../../interfaces';
|
|
2
|
+
import HtmlDataAccessHelper from './../Core/DataAccessHelper/HtmlDataAccessHelper';
|
|
3
|
+
import HttpDataAccessHelper from './../Core/DataAccessHelper/HttpDataAccessHelper';
|
|
4
|
+
import JSZipDataAccessHelper from './../Core/DataAccessHelper/JSZipDataAccessHelper';
|
|
5
|
+
import LiteHttpDataAccessHelper from './../Core/DataAccessHelper/LiteHttpDataAccessHelper';
|
|
6
6
|
|
|
7
7
|
interface IPLYReaderOptions {
|
|
8
8
|
binary?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mat4 } from "gl-matrix";
|
|
2
|
-
import vtkPolyData from '
|
|
3
|
-
import { vtkAlgorithm, vtkObject } from '
|
|
2
|
+
import vtkPolyData from './../../Common/DataModel/PolyData';
|
|
3
|
+
import { vtkAlgorithm, vtkObject } from './../../interfaces';
|
|
4
4
|
|
|
5
5
|
export enum FormatTypes {
|
|
6
6
|
ASCII,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { vtkAlgorithm, vtkObject } from '
|
|
2
|
-
import HtmlDataAccessHelper from '
|
|
3
|
-
import HttpDataAccessHelper from '
|
|
4
|
-
import JSZipDataAccessHelper from '
|
|
5
|
-
import LiteHttpDataAccessHelper from '
|
|
1
|
+
import { vtkAlgorithm, vtkObject } from './../../interfaces';
|
|
2
|
+
import HtmlDataAccessHelper from './../Core/DataAccessHelper/HtmlDataAccessHelper';
|
|
3
|
+
import HttpDataAccessHelper from './../Core/DataAccessHelper/HttpDataAccessHelper';
|
|
4
|
+
import JSZipDataAccessHelper from './../Core/DataAccessHelper/JSZipDataAccessHelper';
|
|
5
|
+
import LiteHttpDataAccessHelper from './../Core/DataAccessHelper/LiteHttpDataAccessHelper';
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
interface ISTLReaderOptions {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mat4 } from "gl-matrix";
|
|
2
|
-
import vtkPolyData from '
|
|
3
|
-
import { vtkAlgorithm, vtkObject } from '
|
|
2
|
+
import vtkPolyData from './../../Common/DataModel/PolyData';
|
|
3
|
+
import { vtkAlgorithm, vtkObject } from './../../interfaces';
|
|
4
4
|
|
|
5
5
|
export enum FormatTypes {
|
|
6
6
|
ASCII,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { vtkAlgorithm, vtkObject, vtkSubscription } from '
|
|
2
|
-
import HtmlDataAccessHelper from '
|
|
3
|
-
import HttpDataAccessHelper from '
|
|
4
|
-
import JSZipDataAccessHelper from '
|
|
5
|
-
import LiteHttpDataAccessHelper from '
|
|
1
|
+
import { vtkAlgorithm, vtkObject, vtkSubscription } from './../../interfaces';
|
|
2
|
+
import HtmlDataAccessHelper from './../Core/DataAccessHelper/HtmlDataAccessHelper';
|
|
3
|
+
import HttpDataAccessHelper from './../Core/DataAccessHelper/HttpDataAccessHelper';
|
|
4
|
+
import JSZipDataAccessHelper from './../Core/DataAccessHelper/JSZipDataAccessHelper';
|
|
5
|
+
import LiteHttpDataAccessHelper from './../Core/DataAccessHelper/LiteHttpDataAccessHelper';
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
interface IElevationReaderOptions {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { vtkAlgorithm, vtkObject } from '
|
|
2
|
-
import HtmlDataAccessHelper from '
|
|
3
|
-
import HttpDataAccessHelper from '
|
|
4
|
-
import JSZipDataAccessHelper from '
|
|
5
|
-
import LiteHttpDataAccessHelper from '
|
|
1
|
+
import { vtkAlgorithm, vtkObject } from './../../interfaces';
|
|
2
|
+
import HtmlDataAccessHelper from './../Core/DataAccessHelper/HtmlDataAccessHelper';
|
|
3
|
+
import HttpDataAccessHelper from './../Core/DataAccessHelper/HttpDataAccessHelper';
|
|
4
|
+
import JSZipDataAccessHelper from './../Core/DataAccessHelper/JSZipDataAccessHelper';
|
|
5
|
+
import LiteHttpDataAccessHelper from './../Core/DataAccessHelper/LiteHttpDataAccessHelper';
|
|
6
6
|
|
|
7
7
|
interface IJSONNucleoReaderOptions {
|
|
8
8
|
binary?: boolean;
|
package/IO/Misc/JSONReader.d.ts
CHANGED
package/IO/Misc/MTLReader.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { vtkObject, vtkSubscription } from '
|
|
1
|
+
import { vtkObject, vtkSubscription } from './../../interfaces';
|
|
2
2
|
|
|
3
|
-
import vtkActor from '
|
|
4
|
-
import HtmlDataAccessHelper from '
|
|
5
|
-
import HttpDataAccessHelper from '
|
|
6
|
-
import JSZipDataAccessHelper from '
|
|
7
|
-
import LiteHttpDataAccessHelper from '
|
|
3
|
+
import vtkActor from './../../Rendering/Core/Actor';
|
|
4
|
+
import HtmlDataAccessHelper from './../Core/DataAccessHelper/HtmlDataAccessHelper';
|
|
5
|
+
import HttpDataAccessHelper from './../Core/DataAccessHelper/HttpDataAccessHelper';
|
|
6
|
+
import JSZipDataAccessHelper from './../Core/DataAccessHelper/JSZipDataAccessHelper';
|
|
7
|
+
import LiteHttpDataAccessHelper from './../Core/DataAccessHelper/LiteHttpDataAccessHelper';
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
interface IMTLReaderOptions {
|
package/IO/Misc/OBJReader.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { vtkAlgorithm, vtkObject, vtkSubscription } from '
|
|
2
|
-
import HtmlDataAccessHelper from '
|
|
3
|
-
import HttpDataAccessHelper from '
|
|
4
|
-
import JSZipDataAccessHelper from '
|
|
5
|
-
import LiteHttpDataAccessHelper from '
|
|
1
|
+
import { vtkAlgorithm, vtkObject, vtkSubscription } from './../../interfaces';
|
|
2
|
+
import HtmlDataAccessHelper from './../Core/DataAccessHelper/HtmlDataAccessHelper';
|
|
3
|
+
import HttpDataAccessHelper from './../Core/DataAccessHelper/HttpDataAccessHelper';
|
|
4
|
+
import JSZipDataAccessHelper from './../Core/DataAccessHelper/JSZipDataAccessHelper';
|
|
5
|
+
import LiteHttpDataAccessHelper from './../Core/DataAccessHelper/LiteHttpDataAccessHelper';
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
interface IOBJReaderOptions {
|
|
@@ -28,6 +28,24 @@ type vtkOBJReaderBase = vtkObject & Omit<vtkAlgorithm,
|
|
|
28
28
|
| 'addInputConnection'
|
|
29
29
|
| 'addInputData'>;
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Convenient method to get the id of all duplicated points.
|
|
33
|
+
* Relies on a "Duplicates" array that contains the id of:
|
|
34
|
+
* - the first duplicate id for the original point (or self Id if there is no duplicate)
|
|
35
|
+
* - the original id for the duplicate points
|
|
36
|
+
* Duplicated points must be adjacent to each other.
|
|
37
|
+
* Example:
|
|
38
|
+
* - Points: [pt0, pt1, pt2, pt3, pt1d0, pt1d1, pt1d3, pt3d1, pt3d2]
|
|
39
|
+
* - Duplicates: [0, 4, 2, 3, 1, 1, 1, 3, 3]
|
|
40
|
+
* Expected results:
|
|
41
|
+
* - getPointDuplicateIds(p, 1) => [1, 4, 5, 6]
|
|
42
|
+
* - getPointDuplicateIds(p, 0) => [0]
|
|
43
|
+
* - getPointDuplicateIds(p, 5) => [1, 4, 5, 6]
|
|
44
|
+
* @param polydata A polydata generated by the OBJReader
|
|
45
|
+
* @param pointId A point Id (duplicated or not)
|
|
46
|
+
*/
|
|
47
|
+
export function getPointDuplicateIds(polydata: any, pointId: number): Array<number>;
|
|
48
|
+
|
|
31
49
|
export interface vtkOBJReader extends vtkOBJReaderBase {
|
|
32
50
|
|
|
33
51
|
/**
|
|
@@ -50,6 +68,11 @@ export interface vtkOBJReader extends vtkOBJReaderBase {
|
|
|
50
68
|
*/
|
|
51
69
|
getSplitMode(): number;
|
|
52
70
|
|
|
71
|
+
/**
|
|
72
|
+
* True if duplicates are tracked in output polydata.
|
|
73
|
+
*/
|
|
74
|
+
getTrackDuplicates(): boolean
|
|
75
|
+
|
|
53
76
|
/**
|
|
54
77
|
*
|
|
55
78
|
* @param {Boolean} busy
|
|
@@ -93,11 +116,19 @@ export interface vtkOBJReader extends vtkOBJReaderBase {
|
|
|
93
116
|
setDataAccessHelper(dataAccessHelper: HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper): boolean;
|
|
94
117
|
|
|
95
118
|
/**
|
|
96
|
-
*
|
|
97
|
-
* @param {String} splitMode
|
|
119
|
+
* String in OBJ file used to split in multiple output polydata.
|
|
120
|
+
* @param {Null | String} splitMode
|
|
98
121
|
*/
|
|
99
122
|
setSplitMode(splitMode: string): boolean;
|
|
100
123
|
|
|
124
|
+
/**
|
|
125
|
+
* Set to true to be able to use getPointDuplicateIds() on output polydata.
|
|
126
|
+
* Requires splitMode to not be null.
|
|
127
|
+
* @param trackDuplicates true or false (false by default)
|
|
128
|
+
* @see getPointDuplicateIds(), setSplitMode()
|
|
129
|
+
*/
|
|
130
|
+
setTrackDuplicates(trackDuplicates: boolean): boolean;
|
|
131
|
+
|
|
101
132
|
/**
|
|
102
133
|
* Set the url of the object to load.
|
|
103
134
|
* @param {String} url the url of the object to load.
|
package/IO/Misc/OBJReader.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
1
2
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
2
3
|
import macro from '../../macros.js';
|
|
3
4
|
import DataAccessHelper from '../Core/DataAccessHelper.js';
|
|
@@ -5,6 +6,9 @@ import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
|
5
6
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
6
7
|
import '../Core/DataAccessHelper/LiteHttpDataAccessHelper.js';
|
|
7
8
|
|
|
9
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
|
+
|
|
11
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
12
|
// import 'vtk.js/Sources/IO/Core/DataAccessHelper/HttpDataAccessHelper'; // HTTP + gz
|
|
9
13
|
// import 'vtk.js/Sources/IO/Core/DataAccessHelper/HtmlDataAccessHelper'; // html + base64 + zip
|
|
10
14
|
// import 'vtk.js/Sources/IO/Core/DataAccessHelper/JSZipDataAccessHelper'; // zip
|
|
@@ -12,9 +16,9 @@ import '../Core/DataAccessHelper/LiteHttpDataAccessHelper.js';
|
|
|
12
16
|
|
|
13
17
|
var data = {}; // ----------------------------------------------------------------------------
|
|
14
18
|
|
|
15
|
-
function
|
|
19
|
+
function copyVector(src, srcOffset, dst, dstOffset, vectorSize) {
|
|
16
20
|
for (var i = 0; i < vectorSize; i++) {
|
|
17
|
-
dst
|
|
21
|
+
dst[dstOffset + i] = src[srcOffset + i];
|
|
18
22
|
}
|
|
19
23
|
} // ----------------------------------------------------------------------------
|
|
20
24
|
|
|
@@ -93,6 +97,60 @@ function end(model) {
|
|
|
93
97
|
model.numberOfOutputs = data.size;
|
|
94
98
|
|
|
95
99
|
for (var idx = 0; idx < data.size; idx++) {
|
|
100
|
+
var polyIn = data.f[idx];
|
|
101
|
+
var nbElems = polyIn.length;
|
|
102
|
+
var nbPoints = data.v.length / 3;
|
|
103
|
+
var keyPointId = {};
|
|
104
|
+
var pointDuplicatesReferences = void 0;
|
|
105
|
+
|
|
106
|
+
if (model.trackDuplicates) {
|
|
107
|
+
// In trackDuplicates mode, we want the following point layout:
|
|
108
|
+
// [pt0, pt1, pt2, ... ptN, pt0d1, pt0d2, pt1d1]
|
|
109
|
+
var pointKeys = [];
|
|
110
|
+
var duplicatesCount = 0;
|
|
111
|
+
|
|
112
|
+
for (var _offset = 0; _offset < nbElems;) {
|
|
113
|
+
var cellSize = polyIn[_offset++];
|
|
114
|
+
|
|
115
|
+
for (var pIdx = 0; pIdx < cellSize; pIdx++) {
|
|
116
|
+
var _polyIn$_offset = _slicedToArray(polyIn[_offset++], 3),
|
|
117
|
+
vIdx = _polyIn$_offset[0],
|
|
118
|
+
tcIdx = _polyIn$_offset[1],
|
|
119
|
+
nIdx = _polyIn$_offset[2];
|
|
120
|
+
|
|
121
|
+
var key = "".concat(vIdx, "/").concat(tcIdx, "/").concat(nIdx);
|
|
122
|
+
|
|
123
|
+
if (keyPointId[key] === undefined) {
|
|
124
|
+
if (pointKeys[vIdx] === undefined) {
|
|
125
|
+
pointKeys[vIdx] = [key];
|
|
126
|
+
} else {
|
|
127
|
+
pointKeys[vIdx].push(key);
|
|
128
|
+
++duplicatesCount;
|
|
129
|
+
} // will be overwritten for duplicates
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
keyPointId[key] = vIdx;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
pointDuplicatesReferences = new Uint16Array(nbPoints + duplicatesCount);
|
|
138
|
+
var duplicates = 0;
|
|
139
|
+
|
|
140
|
+
for (var pointId = 0; pointId < pointKeys.length; ++pointId) {
|
|
141
|
+
var usageCount = pointKeys[pointId] ? pointKeys[pointId].length : 0; // Set the first duplicate index on the original point
|
|
142
|
+
|
|
143
|
+
pointDuplicatesReferences[pointId] = usageCount > 1 ? nbPoints + duplicates : pointId; // Set the original index on each duplicated point
|
|
144
|
+
|
|
145
|
+
for (var duplicateId = 1; duplicateId < usageCount; ++duplicateId) {
|
|
146
|
+
var finalDuplicateId = nbPoints + duplicates++;
|
|
147
|
+
pointDuplicatesReferences[finalDuplicateId] = pointId; // Associate the duplicate index to the key
|
|
148
|
+
|
|
149
|
+
keyPointId[pointKeys[pointId][duplicateId]] = finalDuplicateId;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
96
154
|
var ctMapping = {};
|
|
97
155
|
var polydata = vtkPolyData.newInstance({
|
|
98
156
|
name: data.pieces[idx]
|
|
@@ -101,42 +159,50 @@ function end(model) {
|
|
|
101
159
|
var tc = [];
|
|
102
160
|
var normals = [];
|
|
103
161
|
var polys = [];
|
|
104
|
-
var polyIn = data.f[idx];
|
|
105
|
-
var nbElems = polyIn.length;
|
|
106
162
|
var offset = 0;
|
|
107
163
|
|
|
108
164
|
while (offset < nbElems) {
|
|
109
|
-
var
|
|
110
|
-
polys.push(
|
|
165
|
+
var _cellSize = polyIn[offset];
|
|
166
|
+
polys.push(_cellSize);
|
|
111
167
|
|
|
112
|
-
for (var
|
|
113
|
-
var _polyIn = _slicedToArray(polyIn[offset +
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
168
|
+
for (var _pIdx = 0; _pIdx < _cellSize; _pIdx++) {
|
|
169
|
+
var _polyIn = _slicedToArray(polyIn[offset + _pIdx + 1], 3),
|
|
170
|
+
_vIdx = _polyIn[0],
|
|
171
|
+
_tcIdx = _polyIn[1],
|
|
172
|
+
_nIdx = _polyIn[2];
|
|
117
173
|
|
|
118
|
-
var
|
|
174
|
+
var _key = "".concat(_vIdx, "/").concat(_tcIdx, "/").concat(_nIdx);
|
|
119
175
|
|
|
120
|
-
if (ctMapping[
|
|
121
|
-
|
|
122
|
-
|
|
176
|
+
if (ctMapping[_key] === undefined) {
|
|
177
|
+
var dstOffset = model.trackDuplicates ? keyPointId[_key] : pts.length / 3;
|
|
178
|
+
ctMapping[_key] = dstOffset;
|
|
179
|
+
copyVector(data.v, _vIdx * 3, pts, dstOffset * 3, 3);
|
|
123
180
|
|
|
124
181
|
if (hasTcoords) {
|
|
125
|
-
|
|
182
|
+
copyVector(data.vt, _tcIdx * 2, tc, dstOffset * 2, 2);
|
|
126
183
|
}
|
|
127
184
|
|
|
128
185
|
if (hasNormals) {
|
|
129
|
-
|
|
186
|
+
copyVector(data.vn, _nIdx * 3, normals, dstOffset * 3, 3);
|
|
130
187
|
}
|
|
131
188
|
}
|
|
132
189
|
|
|
133
|
-
polys.push(ctMapping[
|
|
190
|
+
polys.push(ctMapping[_key]);
|
|
134
191
|
}
|
|
135
192
|
|
|
136
|
-
offset +=
|
|
193
|
+
offset += _cellSize + 1;
|
|
137
194
|
}
|
|
138
195
|
|
|
139
196
|
polydata.getPoints().setData(Float32Array.from(pts), 3);
|
|
197
|
+
|
|
198
|
+
if (model.trackDuplicates) {
|
|
199
|
+
var duplicatesArray = vtkDataArray.newInstance({
|
|
200
|
+
name: 'Duplicates',
|
|
201
|
+
values: pointDuplicatesReferences
|
|
202
|
+
});
|
|
203
|
+
polydata.getPointData().addArray(duplicatesArray);
|
|
204
|
+
}
|
|
205
|
+
|
|
140
206
|
polydata.getPolys().setData(Uint32Array.from(polys));
|
|
141
207
|
|
|
142
208
|
if (hasTcoords) {
|
|
@@ -190,21 +256,21 @@ function end(model) {
|
|
|
190
256
|
var _polys = [];
|
|
191
257
|
var _polyIn2 = data.f[0];
|
|
192
258
|
var _nbElems = _polyIn2.length;
|
|
193
|
-
var
|
|
259
|
+
var _offset2 = 0;
|
|
194
260
|
|
|
195
|
-
while (
|
|
196
|
-
var
|
|
261
|
+
while (_offset2 < _nbElems) {
|
|
262
|
+
var _cellSize2 = _polyIn2[_offset2];
|
|
197
263
|
|
|
198
|
-
_polys.push(
|
|
264
|
+
_polys.push(_cellSize2);
|
|
199
265
|
|
|
200
|
-
for (var
|
|
201
|
-
var _polyIn3 = _slicedToArray(_polyIn2[
|
|
202
|
-
|
|
266
|
+
for (var _pIdx2 = 0; _pIdx2 < _cellSize2; _pIdx2++) {
|
|
267
|
+
var _polyIn3 = _slicedToArray(_polyIn2[_offset2 + _pIdx2 + 1], 1),
|
|
268
|
+
_vIdx2 = _polyIn3[0];
|
|
203
269
|
|
|
204
|
-
_polys.push(
|
|
270
|
+
_polys.push(_vIdx2);
|
|
205
271
|
}
|
|
206
272
|
|
|
207
|
-
|
|
273
|
+
_offset2 += _cellSize2 + 1;
|
|
208
274
|
}
|
|
209
275
|
|
|
210
276
|
_polydata.getPolys().setData(Uint32Array.from(_polys));
|
|
@@ -212,10 +278,41 @@ function end(model) {
|
|
|
212
278
|
model.output[0] = _polydata;
|
|
213
279
|
}
|
|
214
280
|
} // ----------------------------------------------------------------------------
|
|
215
|
-
//
|
|
281
|
+
// Static API
|
|
216
282
|
// ----------------------------------------------------------------------------
|
|
217
283
|
|
|
218
284
|
|
|
285
|
+
function getPointDuplicateIds(polyData, pointId) {
|
|
286
|
+
var res = [];
|
|
287
|
+
var duplicates = polyData.getPointData().getArrayByName('Duplicates');
|
|
288
|
+
|
|
289
|
+
if (duplicates == null) {
|
|
290
|
+
return res;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
var duplicatesData = duplicates.getData();
|
|
294
|
+
var originalPointId = Math.min(pointId, duplicatesData[pointId]);
|
|
295
|
+
res.push(originalPointId);
|
|
296
|
+
var duplicateId = duplicatesData[originalPointId];
|
|
297
|
+
|
|
298
|
+
if (duplicateId !== originalPointId) {
|
|
299
|
+
// point has duplicates
|
|
300
|
+
while (duplicateId < duplicatesData.length && duplicatesData[duplicateId] === originalPointId) {
|
|
301
|
+
// Duplicated points must be next to each other and original point must
|
|
302
|
+
// reference first duplicate
|
|
303
|
+
res.push(duplicateId++);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
return res;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
var STATIC = {
|
|
311
|
+
getPointDuplicateIds: getPointDuplicateIds
|
|
312
|
+
}; // ----------------------------------------------------------------------------
|
|
313
|
+
// vtkOBJReader methods
|
|
314
|
+
// ----------------------------------------------------------------------------
|
|
315
|
+
|
|
219
316
|
function vtkOBJReader(publicAPI, model) {
|
|
220
317
|
// Set our className
|
|
221
318
|
model.classHierarchy.push('vtkOBJReader'); // Create default dataAccessHelper if not available
|
|
@@ -292,7 +389,8 @@ function vtkOBJReader(publicAPI, model) {
|
|
|
292
389
|
var DEFAULT_VALUES = {
|
|
293
390
|
numberOfOutputs: 1,
|
|
294
391
|
requestCount: 0,
|
|
295
|
-
splitMode: null
|
|
392
|
+
splitMode: null,
|
|
393
|
+
trackDuplicates: false // baseURL: null,
|
|
296
394
|
// dataAccessHelper: null,
|
|
297
395
|
// url: null,
|
|
298
396
|
|
|
@@ -304,7 +402,7 @@ function extend(publicAPI, model) {
|
|
|
304
402
|
|
|
305
403
|
macro.obj(publicAPI, model);
|
|
306
404
|
macro.get(publicAPI, model, ['url', 'baseURL']);
|
|
307
|
-
macro.setGet(publicAPI, model, ['dataAccessHelper', 'splitMode']);
|
|
405
|
+
macro.setGet(publicAPI, model, ['dataAccessHelper', 'splitMode', 'trackDuplicates']);
|
|
308
406
|
macro.algo(publicAPI, model, 0, 1);
|
|
309
407
|
macro.event(publicAPI, model, 'busy'); // Object methods
|
|
310
408
|
|
|
@@ -313,9 +411,9 @@ function extend(publicAPI, model) {
|
|
|
313
411
|
|
|
314
412
|
var newInstance = macro.newInstance(extend, 'vtkOBJReader'); // ----------------------------------------------------------------------------
|
|
315
413
|
|
|
316
|
-
var vtkOBJReader$1 = {
|
|
414
|
+
var vtkOBJReader$1 = _objectSpread({
|
|
317
415
|
newInstance: newInstance,
|
|
318
416
|
extend: extend
|
|
319
|
-
};
|
|
417
|
+
}, STATIC);
|
|
320
418
|
|
|
321
|
-
export { vtkOBJReader$1 as default, extend, newInstance };
|
|
419
|
+
export { STATIC, vtkOBJReader$1 as default, extend, newInstance };
|
package/IO/Misc/PDBReader.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { vtkAlgorithm, vtkObject, vtkSubscription } from '
|
|
2
|
-
import HtmlDataAccessHelper from '
|
|
3
|
-
import HttpDataAccessHelper from '
|
|
4
|
-
import JSZipDataAccessHelper from '
|
|
5
|
-
import LiteHttpDataAccessHelper from '
|
|
1
|
+
import { vtkAlgorithm, vtkObject, vtkSubscription } from './../../interfaces';
|
|
2
|
+
import HtmlDataAccessHelper from './../Core/DataAccessHelper/HtmlDataAccessHelper';
|
|
3
|
+
import HttpDataAccessHelper from './../Core/DataAccessHelper/HttpDataAccessHelper';
|
|
4
|
+
import JSZipDataAccessHelper from './../Core/DataAccessHelper/JSZipDataAccessHelper';
|
|
5
|
+
import LiteHttpDataAccessHelper from './../Core/DataAccessHelper/LiteHttpDataAccessHelper';
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
interface IPDBReaderOptions {
|
package/IO/XML/XMLReader.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { vtkAlgorithm, vtkObject } from '
|
|
2
|
-
import HtmlDataAccessHelper from '
|
|
3
|
-
import HttpDataAccessHelper from '
|
|
4
|
-
import JSZipDataAccessHelper from '
|
|
5
|
-
import LiteHttpDataAccessHelper from '
|
|
1
|
+
import { vtkAlgorithm, vtkObject } from './../../interfaces';
|
|
2
|
+
import HtmlDataAccessHelper from './../Core/DataAccessHelper/HtmlDataAccessHelper';
|
|
3
|
+
import HttpDataAccessHelper from './../Core/DataAccessHelper/HttpDataAccessHelper';
|
|
4
|
+
import JSZipDataAccessHelper from './../Core/DataAccessHelper/JSZipDataAccessHelper';
|
|
5
|
+
import LiteHttpDataAccessHelper from './../Core/DataAccessHelper/LiteHttpDataAccessHelper';
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
interface IXMLReaderOptions {
|