csyjk 1.1.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- package/.babelrc +7 -0
- package/.idea/modules.xml +8 -0
- package/.idea/xx.iml +12 -0
- package/dist/app.js +43 -0
- package/{index.html → dist/index.html} +0 -0
- package/{style.css → dist/style.css} +1 -1
- package/package.json +40 -5
- package/public/gltf.js +2241 -0
- package/public/index.html +10 -0
- package/src/index.js +3 -0
- package/src/lib/gltf/assets/check.jpg +0 -0
- package/src/lib/gltf/assets/iconfont/iconfont.css +358 -0
- package/src/lib/gltf/assets/iconfont/iconfont.eot +0 -0
- package/src/lib/gltf/assets/iconfont/iconfont.js +1 -0
- package/src/lib/gltf/assets/iconfont/iconfont.json +604 -0
- package/src/lib/gltf/assets/iconfont/iconfont.svg +189 -0
- package/src/lib/gltf/assets/iconfont/iconfont.ttf +0 -0
- package/src/lib/gltf/assets/iconfont/iconfont.woff +0 -0
- package/src/lib/gltf/assets/iconfont/iconfont.woff2 +0 -0
- package/src/lib/gltf/assets/yjkkit-sdk/index.js +0 -0
- package/src/lib/gltf/assets/yjkkit-sdk/package.json +15 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/extras/ContextMenu/ContextMenu.js +863 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/extras/ContextMenu/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/extras/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/index.js +3 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurement.js +462 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.js +279 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.js +262 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/Annotation.js +362 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/AnnotationsPlugin.js +575 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AxisGizmoPlugin/AxisGizmoPlugin.js +333 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AxisGizmoPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.js +777 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/BCFViewpointsPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.js +525 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.js +242 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.js +297 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/FastNavPlugin/FastNavPlugin.js +345 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/FastNavPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFDefaultDataSource.js +122 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js +462 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFPerformanceModelLoader.js +508 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFSceneGraphLoader.js +922 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/index.js +2 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/CubeTextureCanvas.js +273 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/NavCubePlugin.js +687 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/OBJLoaderPlugin.js +145 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/OBJSceneGraphLoader.js +777 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLDefaultDataSource.js +33 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLLoaderPlugin.js +273 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLSceneGraphLoader.js +313 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/index.js +2 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Control.js +1328 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Overview.js +249 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Plane.js +169 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/SectionPlanesPlugin.js +403 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SkyboxesPlugin/SkyboxesPlugin.js +134 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SkyboxesPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/IFCStoreyPlanObjectStates.js +77 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/Storey.js +61 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/StoreyMap.js +57 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/StoreyViewsPlugin.js +822 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/ModelTreeView.js +888 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/TreeViewNode.js +88 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/TreeViewPlugin.js +624 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/modelValidation.js +87 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/ViewCullPlugin/ViewCullPlugin.js +295 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/ViewCullPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/XKTDefaultDataSource.js +78 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js +847 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/index.js +2 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV1.js +167 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV2.js +228 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV3.js +220 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV4.js +279 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV5.js +244 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV6.js +301 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV7.js +426 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV8.js +479 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/lib/pako.js +6818 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/XML3DLoaderPlugin.js +238 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/XML3DSceneGraphLoader.js +1279 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/.jshintrc +11 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/deflate.js +2060 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/inflate.js +2155 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/mime-types.js +1002 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/pako/codecs.js +64 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/z-worker.js +153 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip-ext.js +267 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip-fs.js +553 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip.js +991 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zlib-asm/codecs.js +49 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/index.js +17 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/culling/ObjectCullStates.js +205 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Dot.js +78 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Label.js +97 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Wire.js +95 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/Plugin.js +112 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/Viewer.js +372 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/index.js +3 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/IFCObjectDefaultColors.js +162 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/IFCObjectDefaults.js +39 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaModel.js +145 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaObject.js +215 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaScene.js +311 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/CameraControl.js +1669 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/cc.js +0 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/CameraUpdater.js +312 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PanController.js +112 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PickController.js +193 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PivotController.js +289 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/cu.js +0 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/KeyboardAxisViewHandler.js +122 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/KeyboardPanRotateDollyHandler.js +186 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MouseMiscHandler.js +68 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MousePanRotateDollyHandler.js +439 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MousePickHandler.js +361 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/TouchPanRotateAndDollyHandler.js +258 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/TouchPickHandler.js +197 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/mouspan.js +498 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/Component.js +908 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/Entity.js +475 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/ImagePlane/ImagePlane.js +570 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/ImagePlane/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/PerformanceModel.js +2623 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/ENTITY_FLAGS.js +21 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/PerformanceMesh.js +262 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/PerformanceNode.js +697 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/RENDER_PASSES.js +34 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/ScratchMemory.js +63 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/compression.js +183 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingBuffer.js +33 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingLayer.js +736 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingRenderers.js +68 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/renderers/LinesBatchingColorRenderer.js +295 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/renderers/LinesBatchingSilhouetteRenderer.js +327 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/LinesInstancingLayer.js +698 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/LinesInstancingRenderers.js +68 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/renderers/LinesInstancingColorRenderer.js +364 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/renderers/LinesInstancingSilhouetteRenderer.js +356 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingBuffer.js +33 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingLayer.js +776 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingRenderers.js +113 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingColorRenderer.js +340 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingOcclusionRenderer.js +312 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingPickDepthRenderer.js +343 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingPickMeshRenderer.js +331 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingShadowRenderer.js +242 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingSilhouetteRenderer.js +348 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/PointsInstancingLayer.js +737 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/PointsInstancingRenderers.js +143 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingColorRenderer.js +373 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingDepthRenderer.js +366 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingOcclusionRenderer.js +370 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingPickDepthRenderer.js +386 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingPickMeshRenderer.js +376 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingShadowRenderer.js +293 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingSilhouetteRenderer.js +382 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingBuffer.js +37 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingLayer.js +1017 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingRenderers.js +246 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingColorQualityRenderer.js +809 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingColorRenderer.js +504 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingDepthRenderer.js +297 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingEdgesColorRenderer.js +300 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingEdgesRenderer.js +322 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingNormalsRenderer.js +311 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingOcclusionRenderer.js +291 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickDepthRenderer.js +319 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickMeshRenderer.js +305 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickNormalsRenderer.js +300 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingShadowRenderer.js +242 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingSilhouetteRenderer.js +323 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/TrianglesInstancingLayer.js +969 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/TrianglesInstancingRenderers.js +246 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingColorQualityRenderer.js +859 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingColorRenderer.js +557 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingDepthRenderer.js +341 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingEdgesColorRenderer.js +338 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingEdgesRenderer.js +356 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingNormalsRenderer.js +354 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingOcclusionRenderer.js +329 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickDepthRenderer.js +358 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickMeshRenderer.js +349 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickNormalsRenderer.js +363 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingShadowRenderer.js +284 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingSilhouetteRenderer.js +354 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Camera.js +880 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraFlightAnimation.js +669 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraPath.js +194 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraPathAnimation.js +326 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CustomProjection.js +149 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Frustum.js +316 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Ortho.js +286 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Perspective.js +302 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/index.js +2 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/canvas/Canvas.js +464 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/canvas/Spinner.js +323 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/core.js +234 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/Geometry.js +33 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/ReadableGeometry.js +689 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/VBOGeometry.js +327 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildBoxGeometry.js +238 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildBoxLinesGeometry.js +106 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildCylinderGeometry.js +271 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildGridGeometry.js +102 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildPlaneGeometry.js +168 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildSphereGeometry.js +161 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildTorusGeometry.js +172 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildVectorTextGeometry.js +1721 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/index.js +8 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/index.js +4 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/index.js +2 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/load3DSGeometry.js +103 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/loadOBJGeometry.js +130 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/index.js +18 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/input/Input.js +1475 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/libs/canvas2image.js +218 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/libs/k3d.js +1032 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/AmbientLight.js +175 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/CubeTexture.js +156 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/DirLight.js +314 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/Light.js +29 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/LightMap.js +77 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/PointLight.js +395 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/ReflectionMap.js +79 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/Shadow.js +138 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/index.js +5 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/marker/Marker.js +382 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/marker/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/EdgeMaterial.js +359 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/EmphasisMaterial.js +577 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Fresnel.js +222 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/LambertMaterial.js +378 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/LinesMaterial.js +169 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Material.js +39 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/MetallicMaterial.js +820 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/PhongMaterial.js +860 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/PointsMaterial.js +320 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/SpecularMaterial.js +807 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Texture.js +522 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/index.js +8 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/Frustum.js +118 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/buildEdgeIndices.js +162 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/geometryCompressionUtils.js +353 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/math.js +5302 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/rtcCoords.js +132 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/CameraMemento.js +200 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/ModelMemento.js +272 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/ObjectsMemento.js +259 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/index.js +3 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/Mesh.js +2165 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/draw/DrawRenderer.js +978 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/draw/DrawShaderSource.js +1566 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisEdgesRenderer.js +249 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisEdgesShaderSource.js +163 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisFillRenderer.js +276 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisFillShaderSource.js +269 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/occlusion/OcclusionRenderer.js +207 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/occlusion/OcclusionShaderSource.js +156 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickMeshRenderer.js +210 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickMeshShaderSource.js +146 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickTriangleRenderer.js +186 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickTriangleShaderSource.js +120 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/shadow/ShadowRenderer.js +214 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/shadow/ShadowShaderSource.js +96 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/metriqs/Metriqs.js +259 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/nodes/Node.js +1356 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/nodes/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/CubicBezierCurve.js +194 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/Curve.js +183 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/Path.js +239 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/QuadraticBezierCurve.js +161 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/SplineCurve.js +133 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/index.js +5 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/postfx/SAO.js +547 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/scene/Scene.js +2481 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/sectionPlane/SectionPlane.js +194 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/sectionPlane/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/skybox/Skybox.js +119 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/skybox/index.js +1 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/stats.js +45 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/Map.js +45 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/Queue.js +56 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/index.js +2 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils.js +452 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/viewport/Viewport.js +212 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/ArrayBuf.js +121 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Attribute.js +23 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Drawable.js +270 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/FrameContext.js +259 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/PickResult.js +317 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Pickable.js +69 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Program.js +179 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderBuffer.js +315 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderFlags.js +203 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderState.js +40 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Renderer.js +1300 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Sampler.js +18 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Shader.js +49 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Texture2D.js +217 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/occlusion/OcclusionLayer.js +214 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/occlusion/OcclusionTester.js +432 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/sao/SAODepthLimitedBlurRenderer.js +326 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/sao/SAOOcclusionRenderer.js +375 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/webglEnums.js +61 -0
- package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webglInfo.js +48 -0
- package/src/lib/gltf/gltf.css +392 -0
- package/src/lib/gltf/gltf.js +2241 -0
- package/webpack.config.js +70 -0
- package/app.js +0 -43
@@ -0,0 +1,553 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2013 Gildas Lormeau. All rights reserved.
|
3
|
+
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
5
|
+
modification, are permitted provided that the following conditions are met:
|
6
|
+
|
7
|
+
1. Redistributions of source code must retain the above copyright notice,
|
8
|
+
this list of conditions and the following disclaimer.
|
9
|
+
|
10
|
+
2. Redistributions in binary form must reproduce the above copyright
|
11
|
+
notice, this list of conditions and the following disclaimer in
|
12
|
+
the documentation and/or other materials provided with the distribution.
|
13
|
+
|
14
|
+
3. The names of the authors may not be used to endorse or promote products
|
15
|
+
derived from this software without specific prior written permission.
|
16
|
+
|
17
|
+
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
|
18
|
+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
|
20
|
+
INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
|
21
|
+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
23
|
+
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
24
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
25
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
26
|
+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
*/
|
28
|
+
|
29
|
+
(function() {
|
30
|
+
"use strict";
|
31
|
+
|
32
|
+
var CHUNK_SIZE = 512 * 1024;
|
33
|
+
|
34
|
+
var TextWriter = zip.TextWriter, //
|
35
|
+
BlobWriter = zip.BlobWriter, //
|
36
|
+
Data64URIWriter = zip.Data64URIWriter, //
|
37
|
+
Reader = zip.Reader, //
|
38
|
+
TextReader = zip.TextReader, //
|
39
|
+
BlobReader = zip.BlobReader, //
|
40
|
+
Data64URIReader = zip.Data64URIReader, //
|
41
|
+
createReader = zip.createReader, //
|
42
|
+
createWriter = zip.createWriter;
|
43
|
+
|
44
|
+
function ZipBlobReader(entry) {
|
45
|
+
var that = this, blobReader;
|
46
|
+
|
47
|
+
function init(callback) {
|
48
|
+
that.size = entry.uncompressedSize;
|
49
|
+
callback();
|
50
|
+
}
|
51
|
+
|
52
|
+
function getData(callback) {
|
53
|
+
if (that.data)
|
54
|
+
callback();
|
55
|
+
else
|
56
|
+
entry.getData(new BlobWriter(), function(data) {
|
57
|
+
that.data = data;
|
58
|
+
blobReader = new BlobReader(data);
|
59
|
+
callback();
|
60
|
+
}, null, that.checkCrc32);
|
61
|
+
}
|
62
|
+
|
63
|
+
function readUint8Array(index, length, callback, onerror) {
|
64
|
+
getData(function() {
|
65
|
+
blobReader.readUint8Array(index, length, callback, onerror);
|
66
|
+
}, onerror);
|
67
|
+
}
|
68
|
+
|
69
|
+
that.size = 0;
|
70
|
+
that.init = init;
|
71
|
+
that.readUint8Array = readUint8Array;
|
72
|
+
}
|
73
|
+
ZipBlobReader.prototype = new Reader();
|
74
|
+
ZipBlobReader.prototype.constructor = ZipBlobReader;
|
75
|
+
ZipBlobReader.prototype.checkCrc32 = false;
|
76
|
+
|
77
|
+
function getTotalSize(entry) {
|
78
|
+
var size = 0;
|
79
|
+
|
80
|
+
function process(entry) {
|
81
|
+
size += entry.uncompressedSize || 0;
|
82
|
+
entry.children.forEach(process);
|
83
|
+
}
|
84
|
+
|
85
|
+
process(entry);
|
86
|
+
return size;
|
87
|
+
}
|
88
|
+
|
89
|
+
function initReaders(entry, onend, onerror) {
|
90
|
+
var index = 0;
|
91
|
+
|
92
|
+
function next() {
|
93
|
+
index++;
|
94
|
+
if (index < entry.children.length)
|
95
|
+
process(entry.children[index]);
|
96
|
+
else
|
97
|
+
onend();
|
98
|
+
}
|
99
|
+
|
100
|
+
function process(child) {
|
101
|
+
if (child.directory)
|
102
|
+
initReaders(child, next, onerror);
|
103
|
+
else {
|
104
|
+
child.reader = new child.Reader(child.data, onerror);
|
105
|
+
child.reader.init(function() {
|
106
|
+
child.uncompressedSize = child.reader.size;
|
107
|
+
next();
|
108
|
+
});
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
112
|
+
if (entry.children.length)
|
113
|
+
process(entry.children[index]);
|
114
|
+
else
|
115
|
+
onend();
|
116
|
+
}
|
117
|
+
|
118
|
+
function detach(entry) {
|
119
|
+
var children = entry.parent.children;
|
120
|
+
children.forEach(function(child, index) {
|
121
|
+
if (child.id == entry.id)
|
122
|
+
children.splice(index, 1);
|
123
|
+
});
|
124
|
+
}
|
125
|
+
|
126
|
+
function exportZip(zipWriter, entry, onend, onprogress, totalSize) {
|
127
|
+
var currentIndex = 0;
|
128
|
+
|
129
|
+
function process(zipWriter, entry, onend, onprogress, totalSize) {
|
130
|
+
var childIndex = 0;
|
131
|
+
|
132
|
+
function exportChild() {
|
133
|
+
var child = entry.children[childIndex];
|
134
|
+
if (child)
|
135
|
+
zipWriter.add(child.getFullname(), child.reader, function() {
|
136
|
+
currentIndex += child.uncompressedSize || 0;
|
137
|
+
process(zipWriter, child, function() {
|
138
|
+
childIndex++;
|
139
|
+
exportChild();
|
140
|
+
}, onprogress, totalSize);
|
141
|
+
}, function(index) {
|
142
|
+
if (onprogress)
|
143
|
+
onprogress(currentIndex + index, totalSize);
|
144
|
+
}, {
|
145
|
+
directory : child.directory,
|
146
|
+
version : child.zipVersion
|
147
|
+
});
|
148
|
+
else
|
149
|
+
onend();
|
150
|
+
}
|
151
|
+
|
152
|
+
exportChild();
|
153
|
+
}
|
154
|
+
|
155
|
+
process(zipWriter, entry, onend, onprogress, totalSize);
|
156
|
+
}
|
157
|
+
|
158
|
+
function addFileEntry(zipEntry, fileEntry, onend, onerror) {
|
159
|
+
function getChildren(fileEntry, callback) {
|
160
|
+
var entries = [];
|
161
|
+
if (fileEntry.isDirectory) {
|
162
|
+
var directoryReader = fileEntry.createReader();
|
163
|
+
(function readEntries() {
|
164
|
+
directoryReader.readEntries(function(temporaryEntries) {
|
165
|
+
if (!temporaryEntries.length)
|
166
|
+
callback(entries);
|
167
|
+
else {
|
168
|
+
entries = entries.concat(temporaryEntries);
|
169
|
+
readEntries();
|
170
|
+
}
|
171
|
+
}, onerror);
|
172
|
+
})();
|
173
|
+
}
|
174
|
+
if (fileEntry.isFile)
|
175
|
+
callback(entries);
|
176
|
+
}
|
177
|
+
|
178
|
+
function process(zipEntry, fileEntry, onend) {
|
179
|
+
getChildren(fileEntry, function(children) {
|
180
|
+
var childIndex = 0;
|
181
|
+
|
182
|
+
function addChild(child) {
|
183
|
+
function nextChild(childFileEntry) {
|
184
|
+
process(childFileEntry, child, function() {
|
185
|
+
childIndex++;
|
186
|
+
processChild();
|
187
|
+
});
|
188
|
+
}
|
189
|
+
|
190
|
+
if (child.isDirectory)
|
191
|
+
nextChild(zipEntry.addDirectory(child.name));
|
192
|
+
if (child.isFile)
|
193
|
+
child.file(function(file) {
|
194
|
+
var childZipEntry = zipEntry.addBlob(child.name, file);
|
195
|
+
childZipEntry.uncompressedSize = file.size;
|
196
|
+
nextChild(childZipEntry);
|
197
|
+
}, onerror);
|
198
|
+
}
|
199
|
+
|
200
|
+
function processChild() {
|
201
|
+
var child = children[childIndex];
|
202
|
+
if (child)
|
203
|
+
addChild(child);
|
204
|
+
else
|
205
|
+
onend();
|
206
|
+
}
|
207
|
+
|
208
|
+
processChild();
|
209
|
+
});
|
210
|
+
}
|
211
|
+
|
212
|
+
if (fileEntry.isDirectory)
|
213
|
+
process(zipEntry, fileEntry, onend);
|
214
|
+
else
|
215
|
+
fileEntry.file(function(file) {
|
216
|
+
zipEntry.addBlob(fileEntry.name, file);
|
217
|
+
onend();
|
218
|
+
}, onerror);
|
219
|
+
}
|
220
|
+
|
221
|
+
function getFileEntry(fileEntry, entry, onend, onprogress, onerror, totalSize, checkCrc32) {
|
222
|
+
var currentIndex = 0;
|
223
|
+
|
224
|
+
function process(fileEntry, entry, onend, onprogress, onerror, totalSize) {
|
225
|
+
var childIndex = 0;
|
226
|
+
|
227
|
+
function addChild(child) {
|
228
|
+
function nextChild(childFileEntry) {
|
229
|
+
currentIndex += child.uncompressedSize || 0;
|
230
|
+
process(childFileEntry, child, function() {
|
231
|
+
childIndex++;
|
232
|
+
processChild();
|
233
|
+
}, onprogress, onerror, totalSize);
|
234
|
+
}
|
235
|
+
|
236
|
+
if (child.directory)
|
237
|
+
fileEntry.getDirectory(child.name, {
|
238
|
+
create : true
|
239
|
+
}, nextChild, onerror);
|
240
|
+
else
|
241
|
+
fileEntry.getFile(child.name, {
|
242
|
+
create : true
|
243
|
+
}, function(file) {
|
244
|
+
child.getData(new zip.FileWriter(file, zip.getMimeType(child.name)), nextChild, function(index) {
|
245
|
+
if (onprogress)
|
246
|
+
onprogress(currentIndex + index, totalSize);
|
247
|
+
}, checkCrc32);
|
248
|
+
}, onerror);
|
249
|
+
}
|
250
|
+
|
251
|
+
function processChild() {
|
252
|
+
var child = entry.children[childIndex];
|
253
|
+
if (child)
|
254
|
+
addChild(child);
|
255
|
+
else
|
256
|
+
onend();
|
257
|
+
}
|
258
|
+
|
259
|
+
processChild();
|
260
|
+
}
|
261
|
+
|
262
|
+
if (entry.directory)
|
263
|
+
process(fileEntry, entry, onend, onprogress, onerror, totalSize);
|
264
|
+
else
|
265
|
+
entry.getData(new zip.FileWriter(fileEntry, zip.getMimeType(entry.name)), onend, onprogress, checkCrc32);
|
266
|
+
}
|
267
|
+
|
268
|
+
function resetFS(fs) {
|
269
|
+
fs.entries = [];
|
270
|
+
fs.root = new ZipDirectoryEntry(fs);
|
271
|
+
}
|
272
|
+
|
273
|
+
function bufferedCopy(reader, writer, onend, onprogress, onerror) {
|
274
|
+
var chunkIndex = 0;
|
275
|
+
|
276
|
+
function stepCopy() {
|
277
|
+
var index = chunkIndex * CHUNK_SIZE;
|
278
|
+
if (onprogress)
|
279
|
+
onprogress(index, reader.size);
|
280
|
+
if (index < reader.size)
|
281
|
+
reader.readUint8Array(index, Math.min(CHUNK_SIZE, reader.size - index), function(array) {
|
282
|
+
writer.writeUint8Array(new Uint8Array(array), function() {
|
283
|
+
chunkIndex++;
|
284
|
+
stepCopy();
|
285
|
+
});
|
286
|
+
}, onerror);
|
287
|
+
else
|
288
|
+
writer.getData(onend);
|
289
|
+
}
|
290
|
+
|
291
|
+
stepCopy();
|
292
|
+
}
|
293
|
+
|
294
|
+
function addChild(parent, name, params, directory) {
|
295
|
+
if (parent.directory)
|
296
|
+
return directory ? new ZipDirectoryEntry(parent.fs, name, params, parent) : new ZipFileEntry(parent.fs, name, params, parent);
|
297
|
+
else
|
298
|
+
throw "Parent entry is not a directory.";
|
299
|
+
}
|
300
|
+
|
301
|
+
function ZipEntry() {
|
302
|
+
}
|
303
|
+
|
304
|
+
ZipEntry.prototype = {
|
305
|
+
init : function(fs, name, params, parent) {
|
306
|
+
var that = this;
|
307
|
+
if (fs.root && parent && parent.getChildByName(name))
|
308
|
+
throw "Entry filename already exists.";
|
309
|
+
if (!params)
|
310
|
+
params = {};
|
311
|
+
that.fs = fs;
|
312
|
+
that.name = name;
|
313
|
+
that.id = fs.entries.length;
|
314
|
+
that.parent = parent;
|
315
|
+
that.children = [];
|
316
|
+
that.zipVersion = params.zipVersion || 0x14;
|
317
|
+
that.uncompressedSize = 0;
|
318
|
+
fs.entries.push(that);
|
319
|
+
if (parent)
|
320
|
+
that.parent.children.push(that);
|
321
|
+
},
|
322
|
+
getFileEntry : function(fileEntry, onend, onprogress, onerror, checkCrc32) {
|
323
|
+
var that = this;
|
324
|
+
initReaders(that, function() {
|
325
|
+
getFileEntry(fileEntry, that, onend, onprogress, onerror, getTotalSize(that), checkCrc32);
|
326
|
+
}, onerror);
|
327
|
+
},
|
328
|
+
moveTo : function(target) {
|
329
|
+
var that = this;
|
330
|
+
if (target.directory) {
|
331
|
+
if (!target.isDescendantOf(that)) {
|
332
|
+
if (that != target) {
|
333
|
+
if (target.getChildByName(that.name))
|
334
|
+
throw "Entry filename already exists.";
|
335
|
+
detach(that);
|
336
|
+
that.parent = target;
|
337
|
+
target.children.push(that);
|
338
|
+
}
|
339
|
+
} else
|
340
|
+
throw "Entry is a ancestor of target entry.";
|
341
|
+
} else
|
342
|
+
throw "Target entry is not a directory.";
|
343
|
+
},
|
344
|
+
getFullname : function() {
|
345
|
+
var that = this, fullname = that.name, entry = that.parent;
|
346
|
+
while (entry) {
|
347
|
+
fullname = (entry.name ? entry.name + "/" : "") + fullname;
|
348
|
+
entry = entry.parent;
|
349
|
+
}
|
350
|
+
return fullname;
|
351
|
+
},
|
352
|
+
isDescendantOf : function(ancestor) {
|
353
|
+
var entry = this.parent;
|
354
|
+
while (entry && entry.id != ancestor.id)
|
355
|
+
entry = entry.parent;
|
356
|
+
return !!entry;
|
357
|
+
}
|
358
|
+
};
|
359
|
+
ZipEntry.prototype.constructor = ZipEntry;
|
360
|
+
|
361
|
+
var ZipFileEntryProto;
|
362
|
+
|
363
|
+
function ZipFileEntry(fs, name, params, parent) {
|
364
|
+
var that = this;
|
365
|
+
ZipEntry.prototype.init.call(that, fs, name, params, parent);
|
366
|
+
that.Reader = params.Reader;
|
367
|
+
that.Writer = params.Writer;
|
368
|
+
that.data = params.data;
|
369
|
+
if (params.getData) {
|
370
|
+
that.getData = params.getData;
|
371
|
+
}
|
372
|
+
}
|
373
|
+
|
374
|
+
ZipFileEntry.prototype = ZipFileEntryProto = new ZipEntry();
|
375
|
+
ZipFileEntryProto.constructor = ZipFileEntry;
|
376
|
+
ZipFileEntryProto.getData = function(writer, onend, onprogress, onerror) {
|
377
|
+
var that = this;
|
378
|
+
if (!writer || (writer.constructor == that.Writer && that.data))
|
379
|
+
onend(that.data);
|
380
|
+
else {
|
381
|
+
if (!that.reader)
|
382
|
+
that.reader = new that.Reader(that.data, onerror);
|
383
|
+
that.reader.init(function() {
|
384
|
+
writer.init(function() {
|
385
|
+
bufferedCopy(that.reader, writer, onend, onprogress, onerror);
|
386
|
+
}, onerror);
|
387
|
+
});
|
388
|
+
}
|
389
|
+
};
|
390
|
+
|
391
|
+
ZipFileEntryProto.getText = function(onend, onprogress, checkCrc32, encoding) {
|
392
|
+
this.getData(new TextWriter(encoding), onend, onprogress, checkCrc32);
|
393
|
+
};
|
394
|
+
ZipFileEntryProto.getBlob = function(mimeType, onend, onprogress, checkCrc32) {
|
395
|
+
this.getData(new BlobWriter(mimeType), onend, onprogress, checkCrc32);
|
396
|
+
};
|
397
|
+
ZipFileEntryProto.getData64URI = function(mimeType, onend, onprogress, checkCrc32) {
|
398
|
+
this.getData(new Data64URIWriter(mimeType), onend, onprogress, checkCrc32);
|
399
|
+
};
|
400
|
+
|
401
|
+
var ZipDirectoryEntryProto;
|
402
|
+
|
403
|
+
function ZipDirectoryEntry(fs, name, params, parent) {
|
404
|
+
var that = this;
|
405
|
+
ZipEntry.prototype.init.call(that, fs, name, params, parent);
|
406
|
+
that.directory = true;
|
407
|
+
}
|
408
|
+
|
409
|
+
ZipDirectoryEntry.prototype = ZipDirectoryEntryProto = new ZipEntry();
|
410
|
+
ZipDirectoryEntryProto.constructor = ZipDirectoryEntry;
|
411
|
+
ZipDirectoryEntryProto.addDirectory = function(name) {
|
412
|
+
return addChild(this, name, null, true);
|
413
|
+
};
|
414
|
+
ZipDirectoryEntryProto.addText = function(name, text) {
|
415
|
+
return addChild(this, name, {
|
416
|
+
data : text,
|
417
|
+
Reader : TextReader,
|
418
|
+
Writer : TextWriter
|
419
|
+
});
|
420
|
+
};
|
421
|
+
ZipDirectoryEntryProto.addBlob = function(name, blob) {
|
422
|
+
return addChild(this, name, {
|
423
|
+
data : blob,
|
424
|
+
Reader : BlobReader,
|
425
|
+
Writer : BlobWriter
|
426
|
+
});
|
427
|
+
};
|
428
|
+
ZipDirectoryEntryProto.addData64URI = function(name, dataURI) {
|
429
|
+
return addChild(this, name, {
|
430
|
+
data : dataURI,
|
431
|
+
Reader : Data64URIReader,
|
432
|
+
Writer : Data64URIWriter
|
433
|
+
});
|
434
|
+
};
|
435
|
+
ZipDirectoryEntryProto.addFileEntry = function(fileEntry, onend, onerror) {
|
436
|
+
addFileEntry(this, fileEntry, onend, onerror);
|
437
|
+
};
|
438
|
+
ZipDirectoryEntryProto.addData = function(name, params) {
|
439
|
+
return addChild(this, name, params);
|
440
|
+
};
|
441
|
+
ZipDirectoryEntryProto.importBlob = function(blob, onend, onerror) {
|
442
|
+
this.importZip(new BlobReader(blob), onend, onerror);
|
443
|
+
};
|
444
|
+
ZipDirectoryEntryProto.importText = function(text, onend, onerror) {
|
445
|
+
this.importZip(new TextReader(text), onend, onerror);
|
446
|
+
};
|
447
|
+
ZipDirectoryEntryProto.importData64URI = function(dataURI, onend, onerror) {
|
448
|
+
this.importZip(new Data64URIReader(dataURI), onend, onerror);
|
449
|
+
};
|
450
|
+
ZipDirectoryEntryProto.exportBlob = function(onend, onprogress, onerror) {
|
451
|
+
this.exportZip(new BlobWriter("application/zip"), onend, onprogress, onerror);
|
452
|
+
};
|
453
|
+
ZipDirectoryEntryProto.exportText = function(onend, onprogress, onerror) {
|
454
|
+
this.exportZip(new TextWriter(), onend, onprogress, onerror);
|
455
|
+
};
|
456
|
+
ZipDirectoryEntryProto.exportFileEntry = function(fileEntry, onend, onprogress, onerror) {
|
457
|
+
this.exportZip(new zip.FileWriter(fileEntry, "application/zip"), onend, onprogress, onerror);
|
458
|
+
};
|
459
|
+
ZipDirectoryEntryProto.exportData64URI = function(onend, onprogress, onerror) {
|
460
|
+
this.exportZip(new Data64URIWriter("application/zip"), onend, onprogress, onerror);
|
461
|
+
};
|
462
|
+
ZipDirectoryEntryProto.importZip = function(reader, onend, onerror) {
|
463
|
+
var that = this;
|
464
|
+
createReader(reader, function(zipReader) {
|
465
|
+
zipReader.getEntries(function(entries) {
|
466
|
+
entries.forEach(function(entry) {
|
467
|
+
var parent = that, path = entry.filename.split("/"), name = path.pop();
|
468
|
+
path.forEach(function(pathPart) {
|
469
|
+
parent = parent.getChildByName(pathPart) || new ZipDirectoryEntry(that.fs, pathPart, null, parent);
|
470
|
+
});
|
471
|
+
if (!entry.directory)
|
472
|
+
addChild(parent, name, {
|
473
|
+
data : entry,
|
474
|
+
Reader : ZipBlobReader
|
475
|
+
});
|
476
|
+
});
|
477
|
+
onend();
|
478
|
+
});
|
479
|
+
}, onerror);
|
480
|
+
};
|
481
|
+
ZipDirectoryEntryProto.exportZip = function(writer, onend, onprogress, onerror) {
|
482
|
+
var that = this;
|
483
|
+
initReaders(that, function() {
|
484
|
+
createWriter(writer, function(zipWriter) {
|
485
|
+
exportZip(zipWriter, that, function() {
|
486
|
+
zipWriter.close(onend);
|
487
|
+
}, onprogress, getTotalSize(that));
|
488
|
+
}, onerror);
|
489
|
+
}, onerror);
|
490
|
+
};
|
491
|
+
ZipDirectoryEntryProto.getChildByName = function(name) {
|
492
|
+
var childIndex, child, that = this;
|
493
|
+
for (childIndex = 0; childIndex < that.children.length; childIndex++) {
|
494
|
+
child = that.children[childIndex];
|
495
|
+
if (child.name == name)
|
496
|
+
return child;
|
497
|
+
}
|
498
|
+
};
|
499
|
+
|
500
|
+
function FS() {
|
501
|
+
resetFS(this);
|
502
|
+
}
|
503
|
+
FS.prototype = {
|
504
|
+
remove : function(entry) {
|
505
|
+
detach(entry);
|
506
|
+
this.entries[entry.id] = null;
|
507
|
+
},
|
508
|
+
find : function(fullname) {
|
509
|
+
var index, path = fullname.split("/"), node = this.root;
|
510
|
+
for (index = 0; node && index < path.length; index++)
|
511
|
+
node = node.getChildByName(path[index]);
|
512
|
+
return node;
|
513
|
+
},
|
514
|
+
getById : function(id) {
|
515
|
+
return this.entries[id];
|
516
|
+
},
|
517
|
+
importBlob : function(blob, onend, onerror) {
|
518
|
+
resetFS(this);
|
519
|
+
this.root.importBlob(blob, onend, onerror);
|
520
|
+
},
|
521
|
+
importText : function(text, onend, onerror) {
|
522
|
+
resetFS(this);
|
523
|
+
this.root.importText(text, onend, onerror);
|
524
|
+
},
|
525
|
+
importData64URI : function(dataURI, onend, onerror) {
|
526
|
+
resetFS(this);
|
527
|
+
this.root.importData64URI(dataURI, onend, onerror);
|
528
|
+
},
|
529
|
+
exportBlob : function(onend, onprogress, onerror) {
|
530
|
+
this.root.exportBlob(onend, onprogress, onerror);
|
531
|
+
},
|
532
|
+
exportText : function(onend, onprogress, onerror) {
|
533
|
+
this.root.exportText(onend, onprogress, onerror);
|
534
|
+
},
|
535
|
+
exportFileEntry : function(fileEntry, onend, onprogress, onerror) {
|
536
|
+
this.root.exportFileEntry(fileEntry, onend, onprogress, onerror);
|
537
|
+
},
|
538
|
+
exportData64URI : function(onend, onprogress, onerror) {
|
539
|
+
this.root.exportData64URI(onend, onprogress, onerror);
|
540
|
+
}
|
541
|
+
};
|
542
|
+
|
543
|
+
zip.fs = {
|
544
|
+
FS : FS,
|
545
|
+
ZipDirectoryEntry : ZipDirectoryEntry,
|
546
|
+
ZipFileEntry : ZipFileEntry
|
547
|
+
};
|
548
|
+
|
549
|
+
zip.getMimeType = function() {
|
550
|
+
return "application/octet-stream";
|
551
|
+
};
|
552
|
+
|
553
|
+
})();
|