Repository: NASA-AMMOS/3DTilesRendererJS
Pull request #1208 (2025-07-04 01:34:19)

Reorg: Add "renderer" subfolders
Related to #1187 


Patch:
diff --git a/src/core/index.d.ts b/src/core/index.d.ts
index ce0c525..8e8808e 100644
--- a/src/core/index.d.ts
+++ b/src/core/index.d.ts
@@ -1,8 +1,8 @@
 // common
-export { TilesRendererBase } from './TilesRendererBase.js';
-export { Tile } from './Tile.js';
-export { TileBase } from './TileBase.js';
-export { Tileset } from './Tileset.js';
+export { TilesRendererBase } from './renderer/TilesRendererBase.js';
+export { Tile } from './renderer/Tile.js';
+export { TileBase } from './renderer/TileBase.js';
+export { Tileset } from './renderer/Tileset.js';
 export { B3DMLoaderBase } from './loaders/B3DMLoaderBase.js';
 export { I3DMLoaderBase } from './loaders/I3DMLoaderBase.js';
 export { PNTSLoaderBase } from './loaders/PNTSLoaderBase.js';
diff --git a/src/core/index.js b/src/core/index.js
index 1be0e79..42f2852 100644
--- a/src/core/index.js
+++ b/src/core/index.js
@@ -1,5 +1,5 @@
 // common
-export { TilesRendererBase } from './TilesRendererBase.js';
+export { TilesRendererBase } from './renderer/TilesRendererBase.js';
 export { LoaderBase } from './loaders/LoaderBase.js';
 export { B3DMLoaderBase } from './loaders/B3DMLoaderBase.js';
 export { I3DMLoaderBase } from './loaders/I3DMLoaderBase.js';
diff --git a/src/core/Tile.d.ts b/src/core/renderer/Tile.d.ts
similarity index 100%
rename from src/core/Tile.d.ts
rename to src/core/renderer/Tile.d.ts
diff --git a/src/core/TileBase.d.ts b/src/core/renderer/TileBase.d.ts
similarity index 100%
rename from src/core/TileBase.d.ts
rename to src/core/renderer/TileBase.d.ts
diff --git a/src/core/TileInternal.d.ts b/src/core/renderer/TileInternal.d.ts
similarity index 100%
rename from src/core/TileInternal.d.ts
rename to src/core/renderer/TileInternal.d.ts
diff --git a/src/core/TilesRendererBase.d.ts b/src/core/renderer/TilesRendererBase.d.ts
similarity index 89%
rename from src/core/TilesRendererBase.d.ts
rename to src/core/renderer/TilesRendererBase.d.ts
index 90145cc..c75750d 100644
--- a/src/core/TilesRendererBase.d.ts
+++ b/src/core/renderer/TilesRendererBase.d.ts
@@ -1,5 +1,5 @@
-import { LRUCache } from './utilities/LRUCache.js';
-import { PriorityQueue } from './utilities/PriorityQueue.js';
+import { LRUCache } from '../utilities/LRUCache.js';
+import { PriorityQueue } from '../utilities/PriorityQueue.js';
 
 export class TilesRendererBase {
 
diff --git a/src/core/TilesRendererBase.js b/src/core/renderer/TilesRendererBase.js
similarity index 98%
rename from src/core/TilesRendererBase.js
rename to src/core/renderer/TilesRendererBase.js
index 58170b0..95fc43f 100644
--- a/src/core/TilesRendererBase.js
+++ b/src/core/renderer/TilesRendererBase.js
@@ -1,9 +1,9 @@
-import { getUrlExtension } from './utilities/urlExtension.js';
-import { LRUCache } from './utilities/LRUCache.js';
-import { PriorityQueue } from './utilities/PriorityQueue.js';
+import { getUrlExtension } from '../utilities/urlExtension.js';
+import { LRUCache } from '../utilities/LRUCache.js';
+import { PriorityQueue } from '../utilities/PriorityQueue.js';
 import { markUsedTiles, toggleTiles, markVisibleTiles, markUsedSetLeaves, traverseSet } from './traverseFunctions.js';
-import { UNLOADED, LOADING, PARSING, LOADED, FAILED } from './constants.js';
-import { throttle } from './utilities/throttle.js';
+import { UNLOADED, LOADING, PARSING, LOADED, FAILED } from '../constants.js';
+import { throttle } from '../utilities/throttle.js';
 
 const PLUGIN_REGISTERED = Symbol( 'PLUGIN_REGISTERED' );
 
diff --git a/src/core/Tileset.d.ts b/src/core/renderer/Tileset.d.ts
similarity index 100%
rename from src/core/Tileset.d.ts
rename to src/core/renderer/Tileset.d.ts
diff --git a/src/core/traverseFunctions.js b/src/core/renderer/traverseFunctions.js
similarity index 99%
rename from src/core/traverseFunctions.js
rename to src/core/renderer/traverseFunctions.js
index 1bc7938..51ce758 100644
--- a/src/core/traverseFunctions.js
+++ b/src/core/renderer/traverseFunctions.js
@@ -1,4 +1,4 @@
-import { LOADED, FAILED, UNLOADED } from './constants.js';
+import { LOADED, FAILED, UNLOADED } from '../constants.js';
 
 const viewErrorTarget = {
 	inView: false,
diff --git a/src/plugins/core/auth/GoogleCloudAuth.js b/src/plugins/core/auth/GoogleCloudAuth.js
index 52b61a6..f196de0 100644
--- a/src/plugins/core/auth/GoogleCloudAuth.js
+++ b/src/plugins/core/auth/GoogleCloudAuth.js
@@ -1,4 +1,4 @@
-import { traverseSet } from '../../../core/traverseFunctions.js';
+import { traverseSet } from '../../../core/renderer/traverseFunctions.js';
 
 const TILES_MAP_URL = 'https://tile.googleapis.com/v1/createSession';
 
diff --git a/src/plugins/three/DebugTilesPlugin.d.ts b/src/plugins/three/DebugTilesPlugin.d.ts
index c0c29c4..2ff0842 100644
--- a/src/plugins/three/DebugTilesPlugin.d.ts
+++ b/src/plugins/three/DebugTilesPlugin.d.ts
@@ -1,4 +1,4 @@
-import { Tile } from '../../core/Tile.js';
+import { Tile } from '../../core/renderer/Tile.js';
 import { Color } from 'three';
 
 export enum ColorMode {}
diff --git a/src/plugins/three/DebugTilesPlugin.js b/src/plugins/three/DebugTilesPlugin.js
index e0b4675..d520e26 100644
--- a/src/plugins/three/DebugTilesPlugin.js
+++ b/src/plugins/three/DebugTilesPlugin.js
@@ -1,7 +1,7 @@
 import { Box3Helper, Group, MeshStandardMaterial, PointsMaterial, Sphere, Color, MeshBasicMaterial } from 'three';
 import { SphereHelper } from './objects/SphereHelper.js';
 import { EllipsoidRegionLineHelper } from './objects/EllipsoidRegionHelper.js';
-import { traverseAncestors, traverseSet } from '../../core/traverseFunctions.js';
+import { traverseAncestors, traverseSet } from '../../core/renderer/traverseFunctions.js';
 
 const ORIGINAL_MATERIAL = Symbol( 'ORIGINAL_MATERIAL' );
 const HAS_RANDOM_COLOR = Symbol( 'HAS_RANDOM_COLOR' );
diff --git a/src/plugins/three/LoadRegionPlugin.d.ts b/src/plugins/three/LoadRegionPlugin.d.ts
index 51d8a80..01b5556 100644
--- a/src/plugins/three/LoadRegionPlugin.d.ts
+++ b/src/plugins/three/LoadRegionPlugin.d.ts
@@ -1,6 +1,6 @@
 import { TileBoundingVolume } from '../../three/math/TileBoundingVolume.js';
-import { Tile } from '../../core/Tile.js';
-import { TilesRenderer } from '../../three/TilesRenderer.js';
+import { Tile } from '../../core/renderer/Tile.js';
+import { TilesRenderer } from '../../three/renderer/TilesRenderer.js';
 import { OBB } from '../../three/math/OBB.js';
 import { Sphere, Ray } from 'three';
 
diff --git a/src/r3f/components/TilesRenderer.d.ts b/src/r3f/components/TilesRenderer.d.ts
index 06532a0..b44c751 100644
--- a/src/r3f/components/TilesRenderer.d.ts
+++ b/src/r3f/components/TilesRenderer.d.ts
@@ -1,4 +1,4 @@
-import type { TilesRenderer as TilesRendererImpl, TilesRendererEventMap } from '../../three/TilesRenderer.js';
+import type { TilesRenderer as TilesRendererImpl, TilesRendererEventMap } from '../../three/renderer/TilesRenderer.js';
 import type {
 	ReactNode,
 	Context,
diff --git a/src/r3f/components/TilesRenderer.jsx b/src/r3f/components/TilesRenderer.jsx
index d2836df..9de9bdc 100644
--- a/src/r3f/components/TilesRenderer.jsx
+++ b/src/r3f/components/TilesRenderer.jsx
@@ -1,7 +1,7 @@
 import { createContext, useContext, useEffect, useRef, forwardRef, useMemo, useCallback, useState } from 'react';
 import { useThree, useFrame } from '@react-three/fiber';
 import { Object3D } from 'three';
-import { TilesRenderer as TilesRendererImpl } from '../../three/TilesRenderer.js';
+import { TilesRenderer as TilesRendererImpl } from '../../three/renderer/TilesRenderer.js';
 import { useDeepOptions } from '../utilities/useOptions.js';
 import { useObjectDep } from '../utilities/useObjectDep.js';
 import { useApplyRefs } from '../utilities/useApplyRefs.js';
diff --git a/src/three/controls/EnvironmentControls.d.ts b/src/three/controls/EnvironmentControls.d.ts
index 24096ef..e5cd7eb 100644
--- a/src/three/controls/EnvironmentControls.d.ts
+++ b/src/three/controls/EnvironmentControls.d.ts
@@ -1,5 +1,5 @@
 import { Camera, EventDispatcher, Object3D, Plane, Vector3 } from 'three';
-import { TilesRenderer } from '../TilesRenderer.js';
+import { TilesRenderer } from '../renderer/TilesRenderer.js';
 
 export interface EnvironmentControlsEventMap {
 	'change': {};
diff --git a/src/three/index.d.ts b/src/three/index.d.ts
index 48c876a..a358714 100644
--- a/src/three/index.d.ts
+++ b/src/three/index.d.ts
@@ -1,6 +1,6 @@
 // three.js
-export { TilesRenderer, TilesRendererEventMap } from './TilesRenderer.js';
-export { TilesGroup } from './TilesGroup.js';
+export { TilesRenderer, TilesRendererEventMap } from './renderer/TilesRenderer.js';
+export { TilesGroup } from './renderer/TilesGroup.js';
 export { B3DMLoader, B3DMScene } from './loaders/B3DMLoader.js';
 export { I3DMLoader, I3DMScene } from './loaders/I3DMLoader.js';
 export { PNTSLoader, PNTSScene } from './loaders/PNTSLoader.js';
diff --git a/src/three/index.js b/src/three/index.js
index ee9d61f..82c9b6d 100644
--- a/src/three/index.js
+++ b/src/three/index.js
@@ -1,5 +1,5 @@
 // three.js
-export { TilesRenderer } from './TilesRenderer.js';
+export { TilesRenderer } from './renderer/TilesRenderer.js';
 export { B3DMLoader } from './loaders/B3DMLoader.js';
 export { PNTSLoader } from './loaders/PNTSLoader.js';
 export { I3DMLoader } from './loaders/I3DMLoader.js';
diff --git a/src/three/TilesGroup.d.ts b/src/three/renderer/TilesGroup.d.ts
similarity index 100%
rename from src/three/TilesGroup.d.ts
rename to src/three/renderer/TilesGroup.d.ts
diff --git a/src/three/TilesGroup.js b/src/three/renderer/TilesGroup.js
similarity index 100%
rename from src/three/TilesGroup.js
rename to src/three/renderer/TilesGroup.js
diff --git a/src/three/TilesRenderer.d.ts b/src/three/renderer/TilesRenderer.d.ts
similarity index 94%
rename from src/three/TilesRenderer.d.ts
rename to src/three/renderer/TilesRenderer.d.ts
index a5c7fef..870dfbe 100644
--- a/src/three/TilesRenderer.d.ts
+++ b/src/three/renderer/TilesRenderer.d.ts
@@ -1,8 +1,8 @@
 import { Box3, Camera, Vector2, Matrix4, WebGLRenderer, Object3D, LoadingManager, Sphere, EventListener, EventDispatcher, BaseEvent } from 'three';
-import { Tile } from '../core/Tile.js';
-import { TilesRendererBase } from '../core/TilesRendererBase.js';
+import { Tile } from '../../core/renderer/Tile.js';
+import { TilesRendererBase } from '../../core/renderer/TilesRendererBase.js';
 import { TilesGroup } from './TilesGroup.js';
-import { Ellipsoid } from './math/Ellipsoid.js';
+import { Ellipsoid } from '../math/Ellipsoid.js';
 
 export interface TilesRendererEventMap {
 	'add-camera': { camera: Camera };
diff --git a/src/three/TilesRenderer.js b/src/three/renderer/TilesRenderer.js
similarity index 97%
rename from src/three/TilesRenderer.js
rename to src/three/renderer/TilesRenderer.js
index 2411c3f..cbd5124 100644
--- a/src/three/TilesRenderer.js
+++ b/src/three/renderer/TilesRenderer.js
@@ -1,8 +1,8 @@
-import { TilesRendererBase } from '../core/TilesRendererBase.js';
-import { B3DMLoader } from './loaders/B3DMLoader.js';
-import { PNTSLoader } from './loaders/PNTSLoader.js';
-import { I3DMLoader } from './loaders/I3DMLoader.js';
-import { CMPTLoader } from './loaders/CMPTLoader.js';
+import { TilesRendererBase } from '../../core/renderer/TilesRendererBase.js';
+import { B3DMLoader } from '../loaders/B3DMLoader.js';
+import { PNTSLoader } from '../loaders/PNTSLoader.js';
+import { I3DMLoader } from '../loaders/I3DMLoader.js';
+import { CMPTLoader } from '../loaders/CMPTLoader.js';
 import { TilesGroup } from './TilesGroup.js';
 import {
 	Matrix4,
@@ -14,11 +14,11 @@ import {
 	Group,
 } from 'three';
 import { raycastTraverse, raycastTraverseFirstHit } from './raycastTraverse.js';
-import { readMagicBytes } from '../core/utilities/readMagicBytes.js';
-import { TileBoundingVolume } from './math/TileBoundingVolume.js';
-import { ExtendedFrustum } from './math/ExtendedFrustum.js';
+import { readMagicBytes } from '../../core/utilities/readMagicBytes.js';
+import { TileBoundingVolume } from '../math/TileBoundingVolume.js';
+import { ExtendedFrustum } from '../math/ExtendedFrustum.js';
 import { estimateBytesUsed } from './utilities.js';
-import { WGS84_ELLIPSOID } from './math/GeoConstants.js';
+import { WGS84_ELLIPSOID } from '../math/GeoConstants.js';
 import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
 
 const _mat = new Matrix4();


Test patch:
diff --git a/src/three/raycastTraverse.js b/src/three/renderer/raycastTraverse.js
similarity index 100%
rename from src/three/raycastTraverse.js
rename to src/three/renderer/raycastTraverse.js
diff --git a/src/three/utilities.js b/src/three/renderer/utilities.js
similarity index 100%
rename from src/three/utilities.js
rename to src/three/renderer/utilities.js
diff --git a/test/traverseFunctions.test.js b/test/traverseFunctions.test.js
index 7cbfb94..858dc47 100644
--- a/test/traverseFunctions.test.js
+++ b/test/traverseFunctions.test.js
@@ -1,4 +1,4 @@
-import { traverseAncestors, traverseSet } from '../src/core/traverseFunctions.js';
+import { traverseAncestors, traverseSet } from '../src/core/renderer/traverseFunctions.js';
 
 describe( 'traverseSet', () => {