diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a862b6b..26f6e28b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,250 +1,16 @@ # Change Log -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## 2024-09-25 - -### Changes - ---- - -Packages with breaking changes: - - - [`thermion_dart` - `v0.2.0-dev.7.0`](#thermion_dart---v020-dev70) - -Packages with other changes: - - - [`thermion_flutter_web` - `v0.1.0-dev.7.0`](#thermion_flutter_web---v010-dev70) - - [`thermion_flutter` - `v0.2.0-dev.7.0`](#thermion_flutter---v020-dev70) - - [`thermion_flutter_platform_interface` - `v0.2.0-dev.7.0`](#thermion_flutter_platform_interface---v020-dev70) - - [`thermion_flutter_ffi` - `v0.2.0-dev.7.0`](#thermion_flutter_ffi---v020-dev70) - -Packages with dependency updates only: - -> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project. - - - `thermion_flutter_web` - `v0.1.0-dev.7.0` - - `thermion_flutter` - `v0.2.0-dev.7.0` - - `thermion_flutter_platform_interface` - `v0.2.0-dev.7.0` - - `thermion_flutter_ffi` - `v0.2.0-dev.7.0` - ---- - -#### `thermion_dart` - `v0.2.0-dev.7.0` - - - **BREAKING** **FIX**: fix min SDK for thermion_dart. - - -## 2024-09-25 - -### Changes - ---- - -Packages with breaking changes: - - - [`thermion_dart` - `v0.2.0-dev.6.0`](#thermion_dart---v020-dev60) - -Packages with other changes: - - - [`thermion_flutter_web` - `v0.1.0-dev.6.0`](#thermion_flutter_web---v010-dev60) - - [`thermion_flutter` - `v0.2.0-dev.6.0`](#thermion_flutter---v020-dev60) - - [`thermion_flutter_platform_interface` - `v0.2.0-dev.6.0`](#thermion_flutter_platform_interface---v020-dev60) - - [`thermion_flutter_ffi` - `v0.2.0-dev.6.0`](#thermion_flutter_ffi---v020-dev60) - -Packages with dependency updates only: - -> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project. - - - `thermion_flutter_web` - `v0.1.0-dev.6.0` - - `thermion_flutter` - `v0.2.0-dev.6.0` - - `thermion_flutter_platform_interface` - `v0.2.0-dev.6.0` - - `thermion_flutter_ffi` - `v0.2.0-dev.6.0` - ---- - -#### `thermion_dart` - `v0.2.0-dev.6.0` - - - **BREAKING** **CHORE**: cleanup deleted export. - - -## 2024-09-25 - -### Changes - ---- - -Packages with breaking changes: - - - [`thermion_flutter` - `v0.2.0-dev.6.0`](#thermion_flutter---v020-dev60) - -Packages with other changes: - - - There are no other changes in this release. - ---- - -#### `thermion_flutter` - `v0.2.0-dev.6.0` - - - **BREAKING** **CHORE**: remove superseded HardwareKeyboard* classes. - - -## 2024-09-25 - -### Changes - ---- - -Packages with breaking changes: - - - [`thermion_dart` - `v0.2.0-dev.5.0`](#thermion_dart---v020-dev50) - -Packages with other changes: - - - [`thermion_flutter_web` - `v0.1.0-dev.5.0`](#thermion_flutter_web---v010-dev50) - - [`thermion_flutter` - `v0.2.0-dev.5.0`](#thermion_flutter---v020-dev50) - - [`thermion_flutter_platform_interface` - `v0.2.0-dev.5.0`](#thermion_flutter_platform_interface---v020-dev50) - - [`thermion_flutter_ffi` - `v0.2.0-dev.5.0`](#thermion_flutter_ffi---v020-dev50) - -Packages with dependency updates only: - -> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project. - - - `thermion_flutter_web` - `v0.1.0-dev.5.0` - - `thermion_flutter` - `v0.2.0-dev.5.0` - - `thermion_flutter_platform_interface` - `v0.2.0-dev.5.0` - - `thermion_flutter_ffi` - `v0.2.0-dev.5.0` - ---- - -#### `thermion_dart` - `v0.2.0-dev.5.0` - - - **BREAKING** **CHORE**: remove EntityTransformController (requires replacement). - - -## 2024-09-25 - -### Changes - ---- - -Packages with breaking changes: - - - [`thermion_dart` - `v0.2.0-dev.4.0`](#thermion_dart---v020-dev40) - - [`thermion_flutter_web` - `v0.1.0-dev.4.0`](#thermion_flutter_web---v010-dev40) - -Packages with other changes: - - - [`thermion_flutter` - `v0.2.0-dev.4.0`](#thermion_flutter---v020-dev40) - - [`thermion_flutter_platform_interface` - `v0.2.0-dev.4.0`](#thermion_flutter_platform_interface---v020-dev40) - - [`thermion_flutter_ffi` - `v0.2.0-dev.4.0`](#thermion_flutter_ffi---v020-dev40) - -Packages with dependency updates only: - -> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project. - - - `thermion_flutter` - `v0.2.0-dev.4.0` - - `thermion_flutter_platform_interface` - `v0.2.0-dev.4.0` - - `thermion_flutter_ffi` - `v0.2.0-dev.4.0` - ---- - -#### `thermion_dart` - `v0.2.0-dev.4.0` - - - **BREAKING** **FIX**: (web/wasm) free pick callbacks on dispose. - - **BREAKING** **CHORE**: restructure viewer folders as libraries to only export the public interface. - -#### `thermion_flutter_web` - `v0.1.0-dev.4.0` - - - **BREAKING** **CHORE**: restructure viewer folders as libraries to only export the public interface. - - -## 2024-09-25 - -### Changes - ---- - -Packages with breaking changes: - - - [`thermion_flutter` - `v0.2.0-dev.3.0`](#thermion_flutter---v020-dev30) - -Packages with other changes: - - - There are no other changes in this release. - ---- - -#### `thermion_flutter` - `v0.2.0-dev.3.0` - - - **BREAKING** **FIX**: remove EntityControllerMouseWidget (replace with GestureHandler). - - **BREAKING** **CHORE**: (flutter) cleanup for pub.dev publishing. - - -## 2024-09-25 - -### Changes - ---- - -Packages with breaking changes: - - - [`thermion_flutter` - `v0.2.0-dev.2.0`](#thermion_flutter---v020-dev20) - -Packages with other changes: - - - There are no other changes in this release. - ---- - -#### `thermion_flutter` - `v0.2.0-dev.2.0` - - - **BREAKING** **CHORE**: remove EntityListWidget - will replace with new Scene. - - -## 2024-09-25 - -### Changes - ---- - -Packages with breaking changes: - - - [`thermion_dart` - `v0.2.0-dev.1.0`](#thermion_dart---v020-dev10) - - [`thermion_flutter` - `v0.2.0-dev.1.0`](#thermion_flutter---v020-dev10) - - [`thermion_flutter_ffi` - `v0.2.0-dev.1.0`](#thermion_flutter_ffi---v020-dev10) - - [`thermion_flutter_platform_interface` - `v0.2.0-dev.1.0`](#thermion_flutter_platform_interface---v020-dev10) - - [`thermion_flutter_web` - `v0.1.0-dev.1.0`](#thermion_flutter_web---v010-dev10) - -Packages with other changes: - - - There are no other changes in this release. - ---- - -#### `thermion_dart` - `v0.2.0-dev.1.0` - - - **REFACTOR**: native types. - - **REFACTOR**: native types. - - **REFACTOR**: move native types to own header, add methods for create/destroy material instance, add priority/layer to load_glb_from_buffer. - - **REFACTOR**: Dart types. - - **FIX**: (web) add emscripten guards for flushAndWait call when swapchain destroyed. - - **FIX**: ignore pick results directly on axis. - - **FIX**: properly destroy entities/material/etc in Gizmo on destruction, remove custom scene creation logic. - - **FIX**: add check for nan NDC coordinates for viewport translation. - - **FIX**: (wasm) use correct coords for pick, free memory correctly, keep pixelratio copy. - - **FIX**: add more nan checks for gizmo manipulation. - - **FIX**: emscripten export visibility for add_light. - - **FIX**: add Fence to capture() and set stencil buffer by default. - - **FEAT**: add removeStencilHighlight, queuePositionUpdateFromViewportCoords to ThermionViewer. - - **FEAT**: add removeStencilHighlight, accept color param for setStencilHighlight, queuePositionUpdateFromViewportCoords to ThermionDartApi. - - **FEAT**: add flag for keepData for gltf instancing, add highlightScene, add stencilHighlight method. - - **FEAT**: grid uses own material. - - **FEAT**: parent the cloned entity instance when setting stencil highlight. - - **FEAT**: add grid material. - - **FEAT**: expose setLightDirection and setLightPosition. - - **FEAT**: move HighlightOverlay to nested class, move createGeometry to SceneManager, add queueRelativePositionUpdateFromViewportVector. +v0.2.0 + +- **BREAKING** Dart SDK 3.6.0 required +- **BREAKING** Libraries have been restructured so you should only need to import `package:thermion_dart/thermion_dart.dart`, `package:thermion_flutter/thermion_flutter.dart` +- **BREAKING** The former GestureDetector widgets and EntityControllerMouseWidget/EntityTransformController have been removed and replaced with ThermionListenerWidget. that accepts an InputHandler. +- **BREAKING** The former debugging widgets and Scene class have been removed. +- **REFACTOR** The creation of the main camera has been refactored; the default projection & near/far planes should not have changed, but pay close attention. +- **REFACTOR**: add methods for create/destroy material instance, add priority/layer to load_glb_from_buffer. +- **FEAT**: Translation gizmo, stencil highlight & overlays. +- **FEAT**: new setLightDirection and setLightPosition. +- **FEAT**: move HighlightOverlay to nested class, move createGeometry to SceneManager, add queueRelativePositionUpdateFromViewportVector. - **FEAT**: move createGeometry to SceneManager, add queueRelativePositionUpdateFromViewportVector and removeStencilHighlight. - **FEAT**: add setGizmoVisibility/pickGizmo methods to ThermionViewer. - **FEAT**: remove gizmo view references, exclude gizmo entities from picking, add createIbl. @@ -272,9 +38,6 @@ Packages with other changes: - **FEAT**: createIbl. - **BREAKING** **FEAT**: (web) (flutter) create canvas when createViewer is called (no longer need to manually add canvas element to web HTML). - **BREAKING** **FEAT**: update web/http dependencies. - -#### `thermion_flutter` - `v0.2.0-dev.1.0` - - **FIX**: (flutter) pass ThermionFlutterOptions to ThermionWidget, use dpr for resizeTexture, delete unnecessary TransparencyPainter class. - **FIX**: (flutter/web) use window.devicePixelRatio for viewport. - **FIX**: (flutter) desktop gesture detector changes for new Gizmo methods. @@ -288,20 +51,11 @@ Packages with other changes: - **BREAKING** **FEAT**: (web) (flutter) create canvas when createViewer is called (no longer need to manually add canvas element to web HTML). - **BREAKING** **FEAT**: resize canvas on web. - **BREAKING** **CHORE**: rename controller to viewer in gesture detector widgets. - -#### `thermion_flutter_ffi` - `v0.2.0-dev.1.0` - - **FEAT**: (flutter) move DPR calculation to resizeTexture and add createViewerWithOptions method to ThermionFlutterFFI. - **BREAKING** **FIX**: (flutter) pass pixelRatio to createTexture. - -#### `thermion_flutter_platform_interface` - `v0.2.0-dev.1.0` - - **FEAT**: add createViewerWithOptions to ThermionFlutterPlugin and mark createViewer as deprecated. - **FEAT**: add ThermionFlutterOptions classes, rename interface parameter for offsetTop and ensure pixelRatio is passed to resizeTexture. - **BREAKING** **FIX**: (flutter) pass pixelRatio to createTexture. - -#### `thermion_flutter_web` - `v0.1.0-dev.1.0` - - **FIX**: (flutter/web) use window.devicePixelRatio for viewport. - **FEAT**: (flutter) (web) use options to determine whether to create canvas, and set fixed position + offset. - **FEAT**: add ThermionFlutterOptions classes, rename interface parameter for offsetTop and ensure pixelRatio is passed to resizeTexture. @@ -310,35 +64,7 @@ Packages with other changes: - **BREAKING** **FEAT**: resize canvas on web. -## 2024-07-23 - -### Changes - ---- - -Packages with breaking changes: - - - There are no breaking changes in this release. - -Packages with other changes: - - - [`thermion_dart` - `v0.1.3`](#thermion_dart---v013) - - [`thermion_flutter_ffi` - `v0.1.0+12`](#thermion_flutter_ffi---v01012) - - [`thermion_flutter_web` - `v0.0.3`](#thermion_flutter_web---v003) - - [`thermion_flutter_platform_interface` - `v0.1.0+11`](#thermion_flutter_platform_interface---v01011) - - [`thermion_flutter` - `v0.1.1+13`](#thermion_flutter---v01113) - -Packages with dependency updates only: - -> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project. - - - `thermion_flutter_platform_interface` - `v0.1.0+11` - - `thermion_flutter` - `v0.1.1+13` - ---- - -#### `thermion_dart` - `v0.1.3` - +## v0.1.3 - **FIX**: manually remove leading slash for compiler path on Windows when building for Android. - **FIX**: web/JS bool checks need to compare to int. - **FIX**: shadow JS<->WASM bridge methods. diff --git a/thermion_dart/lib/thermion_dart/entities/abstract_gizmo.dart b/thermion_dart/lib/src/entities/abstract_gizmo.dart similarity index 83% rename from thermion_dart/lib/thermion_dart/entities/abstract_gizmo.dart rename to thermion_dart/lib/src/entities/abstract_gizmo.dart index b5a722e7..cebe9d42 100644 --- a/thermion_dart/lib/thermion_dart/entities/abstract_gizmo.dart +++ b/thermion_dart/lib/src/entities/abstract_gizmo.dart @@ -1,6 +1,7 @@ -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; import 'package:vector_math/vector_math_64.dart'; +import '../../thermion_dart.dart'; + abstract class AbstractGizmo { bool get isVisible; diff --git a/thermion_dart/lib/thermion_dart/entities/gizmo.dart b/thermion_dart/lib/src/entities/gizmo.dart similarity index 96% rename from thermion_dart/lib/thermion_dart/entities/gizmo.dart rename to thermion_dart/lib/src/entities/gizmo.dart index 2cde276e..aef7fd60 100644 --- a/thermion_dart/lib/thermion_dart/entities/gizmo.dart +++ b/thermion_dart/lib/src/entities/gizmo.dart @@ -1,7 +1,8 @@ import 'dart:async'; -import 'package:thermion_dart/thermion_dart/entities/abstract_gizmo.dart'; +import 'package:thermion_dart/src/entities/abstract_gizmo.dart'; + import 'package:vector_math/vector_math_64.dart'; -import '../thermion_viewer.dart'; +import '../viewer/viewer.dart'; class Gizmo extends AbstractGizmo { final ThermionEntity x; diff --git a/thermion_dart/lib/thermion_dart/input/input.dart b/thermion_dart/lib/src/input/input.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/input/input.dart rename to thermion_dart/lib/src/input/input.dart diff --git a/thermion_dart/lib/thermion_dart/input/src/delegate_gesture_handler.dart b/thermion_dart/lib/src/input/src/delegate_gesture_handler.dart similarity index 97% rename from thermion_dart/lib/thermion_dart/input/src/delegate_gesture_handler.dart rename to thermion_dart/lib/src/input/src/delegate_gesture_handler.dart index 616919bf..f5138789 100644 --- a/thermion_dart/lib/thermion_dart/input/src/delegate_gesture_handler.dart +++ b/thermion_dart/lib/src/input/src/delegate_gesture_handler.dart @@ -1,12 +1,10 @@ import 'dart:async'; import 'package:logging/logging.dart'; -import 'package:thermion_dart/thermion_dart/input/src/delegates.dart'; +import 'package:thermion_dart/thermion_dart.dart'; import 'package:vector_math/vector_math_64.dart'; -import '../../viewer/thermion_viewer_base.dart'; import 'implementations/fixed_orbit_camera_rotation_delegate.dart'; import 'implementations/free_flight_camera_delegate.dart'; -import 'input_handler.dart'; class DelegateInputHandler implements InputHandler { final ThermionViewer viewer; diff --git a/thermion_dart/lib/thermion_dart/input/src/delegates.dart b/thermion_dart/lib/src/input/src/delegates.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/input/src/delegates.dart rename to thermion_dart/lib/src/input/src/delegates.dart diff --git a/thermion_dart/lib/thermion_dart/input/src/implementations/default_keyboard_camera_flight_delegate.dart b/thermion_dart/lib/src/input/src/implementations/default_keyboard_camera_flight_delegate.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/input/src/implementations/default_keyboard_camera_flight_delegate.dart rename to thermion_dart/lib/src/input/src/implementations/default_keyboard_camera_flight_delegate.dart diff --git a/thermion_dart/lib/thermion_dart/input/src/implementations/default_pan_camera_delegate.dart b/thermion_dart/lib/src/input/src/implementations/default_pan_camera_delegate.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/input/src/implementations/default_pan_camera_delegate.dart rename to thermion_dart/lib/src/input/src/implementations/default_pan_camera_delegate.dart diff --git a/thermion_dart/lib/thermion_dart/input/src/implementations/fixed_orbit_camera_rotation_delegate.dart b/thermion_dart/lib/src/input/src/implementations/fixed_orbit_camera_rotation_delegate.dart similarity index 95% rename from thermion_dart/lib/thermion_dart/input/src/implementations/fixed_orbit_camera_rotation_delegate.dart rename to thermion_dart/lib/src/input/src/implementations/fixed_orbit_camera_rotation_delegate.dart index f44dd5aa..047dba30 100644 --- a/thermion_dart/lib/thermion_dart/input/src/implementations/fixed_orbit_camera_rotation_delegate.dart +++ b/thermion_dart/lib/src/input/src/implementations/fixed_orbit_camera_rotation_delegate.dart @@ -1,8 +1,8 @@ import 'dart:async'; -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; -import 'package:thermion_dart/thermion_dart/input/src/delegates.dart'; import 'package:vector_math/vector_math_64.dart'; -import '../../../viewer/shared_types/camera.dart'; +import '../../../viewer/src/shared_types/camera.dart'; +import '../../../viewer/viewer.dart'; +import '../../input.dart'; import '../input_handler.dart'; class FixedOrbitRotateInputHandlerDelegate implements InputHandlerDelegate { diff --git a/thermion_dart/lib/thermion_dart/input/src/implementations/free_flight_camera_delegate.dart b/thermion_dart/lib/src/input/src/implementations/free_flight_camera_delegate.dart similarity index 97% rename from thermion_dart/lib/thermion_dart/input/src/implementations/free_flight_camera_delegate.dart rename to thermion_dart/lib/src/input/src/implementations/free_flight_camera_delegate.dart index 4b19fbec..3a85aaaf 100644 --- a/thermion_dart/lib/thermion_dart/input/src/implementations/free_flight_camera_delegate.dart +++ b/thermion_dart/lib/src/input/src/implementations/free_flight_camera_delegate.dart @@ -1,8 +1,8 @@ import 'dart:async'; -import 'package:thermion_dart/thermion_dart/input/src/input_handler.dart'; -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; import 'package:vector_math/vector_math_64.dart'; +import '../../../viewer/viewer.dart'; import '../delegates.dart'; +import '../input_handler.dart'; class FreeFlightInputHandlerDelegate implements InputHandlerDelegate { diff --git a/thermion_dart/lib/thermion_dart/input/src/implementations/picking_camera_gesture_handler.dart b/thermion_dart/lib/src/input/src/implementations/picking_camera_gesture_handler.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/input/src/implementations/picking_camera_gesture_handler.dart rename to thermion_dart/lib/src/input/src/implementations/picking_camera_gesture_handler.dart diff --git a/thermion_dart/lib/thermion_dart/input/src/input_handler.dart b/thermion_dart/lib/src/input/src/input_handler.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/input/src/input_handler.dart rename to thermion_dart/lib/src/input/src/input_handler.dart diff --git a/thermion_dart/lib/thermion_dart/scene.dart b/thermion_dart/lib/src/scene.dart similarity index 98% rename from thermion_dart/lib/thermion_dart/scene.dart rename to thermion_dart/lib/src/scene.dart index 12f1b330..647b0e5f 100644 --- a/thermion_dart/lib/thermion_dart/scene.dart +++ b/thermion_dart/lib/src/scene.dart @@ -1,7 +1,8 @@ import 'dart:convert'; -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; import 'package:vector_math/vector_math_64.dart'; +import '../thermion_dart.dart'; + class SceneV2 { final Map assets; final List lights; diff --git a/thermion_dart/lib/thermion_dart/swift/swift_bindings.g.dart b/thermion_dart/lib/src/swift/swift_bindings.g.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/swift/swift_bindings.g.dart rename to thermion_dart/lib/src/swift/swift_bindings.g.dart diff --git a/thermion_dart/lib/thermion_dart/utils/camera_orientation.dart b/thermion_dart/lib/src/utils/camera_orientation.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/utils/camera_orientation.dart rename to thermion_dart/lib/src/utils/camera_orientation.dart diff --git a/thermion_dart/lib/thermion_dart/utils/dart_resources.dart b/thermion_dart/lib/src/utils/dart_resources.dart similarity index 90% rename from thermion_dart/lib/thermion_dart/utils/dart_resources.dart rename to thermion_dart/lib/src/utils/dart_resources.dart index e20ab3b7..1f3143b8 100644 --- a/thermion_dart/lib/thermion_dart/utils/dart_resources.dart +++ b/thermion_dart/lib/src/utils/dart_resources.dart @@ -2,7 +2,8 @@ import 'dart:ffi'; import 'dart:io'; import 'package:ffi/ffi.dart'; -import 'package:thermion_dart/thermion_dart/viewer/ffi/src/thermion_dart.g.dart'; + +import '../viewer/src/ffi/src/thermion_dart.g.dart'; class DartResourceLoader { static final _assets = {}; diff --git a/thermion_dart/lib/thermion_dart/utils/geometry.dart b/thermion_dart/lib/src/utils/geometry.dart similarity index 98% rename from thermion_dart/lib/thermion_dart/utils/geometry.dart rename to thermion_dart/lib/src/utils/geometry.dart index 84985d84..1da4cafe 100644 --- a/thermion_dart/lib/thermion_dart/utils/geometry.dart +++ b/thermion_dart/lib/src/utils/geometry.dart @@ -1,7 +1,7 @@ import 'dart:math'; import 'dart:typed_data'; -import 'package:thermion_dart/thermion_dart/viewer/shared_types/geometry.dart'; -import 'package:thermion_dart/thermion_dart/viewer/thermion_viewer_base.dart'; + +import '../../thermion_dart.dart'; class GeometryHelper { static Geometry sphere({bool normals = true, bool uvs = true}) { diff --git a/thermion_dart/lib/thermion_dart/utils/matrix.dart b/thermion_dart/lib/src/utils/matrix.dart similarity index 90% rename from thermion_dart/lib/thermion_dart/utils/matrix.dart rename to thermion_dart/lib/src/utils/matrix.dart index 75a9aa6d..98eb0d42 100644 --- a/thermion_dart/lib/thermion_dart/utils/matrix.dart +++ b/thermion_dart/lib/src/utils/matrix.dart @@ -1,5 +1,5 @@ // Helper function to convert double4x4 to Matrix4 -import 'package:thermion_dart/thermion_dart/viewer/ffi/src/thermion_dart.g.dart'; +import 'package:thermion_dart/src/viewer/src/ffi/src/thermion_dart.g.dart'; import 'package:vector_math/vector_math_64.dart'; import 'dart:ffi'; diff --git a/thermion_dart/lib/thermion_dart/viewer/events.dart b/thermion_dart/lib/src/viewer/src/events.dart similarity index 96% rename from thermion_dart/lib/thermion_dart/viewer/events.dart rename to thermion_dart/lib/src/viewer/src/events.dart index eddf168e..0180ef1d 100644 --- a/thermion_dart/lib/thermion_dart/viewer/events.dart +++ b/thermion_dart/lib/src/viewer/src/events.dart @@ -1,4 +1,3 @@ -import 'package:thermion_dart/thermion_dart/viewer/shared_types/entities.dart'; import 'shared_types/shared_types.dart'; /// diff --git a/thermion_dart/lib/thermion_dart/viewer/ffi/src/callbacks.dart b/thermion_dart/lib/src/viewer/src/ffi/src/callbacks.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/viewer/ffi/src/callbacks.dart rename to thermion_dart/lib/src/viewer/src/ffi/src/callbacks.dart diff --git a/thermion_dart/lib/thermion_dart/viewer/ffi/src/camera_ffi.dart b/thermion_dart/lib/src/viewer/src/ffi/src/camera_ffi.dart similarity index 85% rename from thermion_dart/lib/thermion_dart/viewer/ffi/src/camera_ffi.dart rename to thermion_dart/lib/src/viewer/src/ffi/src/camera_ffi.dart index c2a24c9d..ef727d2d 100644 --- a/thermion_dart/lib/thermion_dart/viewer/ffi/src/camera_ffi.dart +++ b/thermion_dart/lib/src/viewer/src/ffi/src/camera_ffi.dart @@ -1,11 +1,11 @@ import 'dart:ffi'; -import 'package:thermion_dart/thermion_dart/utils/matrix.dart'; -import 'package:thermion_dart/thermion_dart/viewer/ffi/src/thermion_dart.g.dart'; -import 'package:thermion_dart/thermion_dart/viewer/shared_types/camera.dart'; import 'package:vector_math/vector_math_64.dart'; +import '../../../../utils/matrix.dart'; +import '../../shared_types/camera.dart'; import '../../thermion_viewer_base.dart'; +import 'thermion_dart.g.dart'; class ThermionFFICamera extends Camera { final Pointer camera; diff --git a/thermion_dart/lib/thermion_dart/viewer/ffi/src/thermion_dart.g.dart b/thermion_dart/lib/src/viewer/src/ffi/src/thermion_dart.g.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/viewer/ffi/src/thermion_dart.g.dart rename to thermion_dart/lib/src/viewer/src/ffi/src/thermion_dart.g.dart diff --git a/thermion_dart/lib/thermion_dart/viewer/ffi/src/thermion_viewer_ffi.dart b/thermion_dart/lib/src/viewer/src/ffi/src/thermion_viewer_ffi.dart similarity index 99% rename from thermion_dart/lib/thermion_dart/viewer/ffi/src/thermion_viewer_ffi.dart rename to thermion_dart/lib/src/viewer/src/ffi/src/thermion_viewer_ffi.dart index 91b8e542..d99c5c03 100644 --- a/thermion_dart/lib/thermion_dart/viewer/ffi/src/thermion_viewer_ffi.dart +++ b/thermion_dart/lib/src/viewer/src/ffi/src/thermion_viewer_ffi.dart @@ -1,19 +1,20 @@ import 'dart:async'; +import 'dart:ffi'; import 'dart:math'; import 'dart:typed_data'; import 'package:animation_tools_dart/animation_tools_dart.dart'; -import 'package:thermion_dart/thermion_dart/entities/gizmo.dart'; - -import 'package:thermion_dart/thermion_dart/utils/matrix.dart'; -import 'package:thermion_dart/thermion_dart/viewer/events.dart'; -import 'package:thermion_dart/thermion_dart/viewer/ffi/src/callbacks.dart'; -import 'package:thermion_dart/thermion_dart/viewer/shared_types/camera.dart'; import 'package:vector_math/vector_math_64.dart'; import 'package:vector_math/vector_math_64.dart' as v64; +import '../../../../entities/gizmo.dart'; +import '../../../../utils/matrix.dart'; +import '../../events.dart'; +import '../../shared_types/camera.dart'; import '../../thermion_viewer_base.dart'; import 'package:logging/logging.dart'; +import 'callbacks.dart'; import 'camera_ffi.dart'; +import 'thermion_dart.g.dart'; // ignore: constant_identifier_names const ThermionEntity _FILAMENT_ASSET_ERROR = 0; diff --git a/thermion_dart/lib/thermion_dart/viewer/ffi/thermion_viewer_ffi.dart b/thermion_dart/lib/src/viewer/src/ffi/thermion_viewer_ffi.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/viewer/ffi/thermion_viewer_ffi.dart rename to thermion_dart/lib/src/viewer/src/ffi/thermion_viewer_ffi.dart diff --git a/thermion_dart/lib/thermion_dart/viewer/shared_types/camera.dart b/thermion_dart/lib/src/viewer/src/shared_types/camera.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/viewer/shared_types/camera.dart rename to thermion_dart/lib/src/viewer/src/shared_types/camera.dart diff --git a/thermion_dart/lib/thermion_dart/viewer/shared_types/entities.dart b/thermion_dart/lib/src/viewer/src/shared_types/entities.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/viewer/shared_types/entities.dart rename to thermion_dart/lib/src/viewer/src/shared_types/entities.dart diff --git a/thermion_dart/lib/thermion_dart/viewer/shared_types/entity.dart b/thermion_dart/lib/src/viewer/src/shared_types/entity.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/viewer/shared_types/entity.dart rename to thermion_dart/lib/src/viewer/src/shared_types/entity.dart diff --git a/thermion_dart/lib/thermion_dart/viewer/shared_types/geometry.dart b/thermion_dart/lib/src/viewer/src/shared_types/geometry.dart similarity index 90% rename from thermion_dart/lib/thermion_dart/viewer/shared_types/geometry.dart rename to thermion_dart/lib/src/viewer/src/shared_types/geometry.dart index 3417253e..993718f4 100644 --- a/thermion_dart/lib/thermion_dart/viewer/shared_types/geometry.dart +++ b/thermion_dart/lib/src/viewer/src/shared_types/geometry.dart @@ -1,6 +1,6 @@ import 'dart:typed_data'; -import 'package:thermion_dart/thermion_dart/viewer/thermion_viewer_base.dart'; +import '../../viewer.dart'; class Geometry { final Float32List vertices; diff --git a/thermion_dart/lib/thermion_dart/viewer/shared_types/gltf.dart b/thermion_dart/lib/src/viewer/src/shared_types/gltf.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/viewer/shared_types/gltf.dart rename to thermion_dart/lib/src/viewer/src/shared_types/gltf.dart diff --git a/thermion_dart/lib/thermion_dart/viewer/shared_types/light.dart b/thermion_dart/lib/src/viewer/src/shared_types/light.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/viewer/shared_types/light.dart rename to thermion_dart/lib/src/viewer/src/shared_types/light.dart diff --git a/thermion_dart/lib/thermion_dart/viewer/shared_types/light_options.dart b/thermion_dart/lib/src/viewer/src/shared_types/light_options.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/viewer/shared_types/light_options.dart rename to thermion_dart/lib/src/viewer/src/shared_types/light_options.dart diff --git a/thermion_dart/lib/thermion_dart/viewer/shared_types/manipulator.dart b/thermion_dart/lib/src/viewer/src/shared_types/manipulator.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/viewer/shared_types/manipulator.dart rename to thermion_dart/lib/src/viewer/src/shared_types/manipulator.dart diff --git a/thermion_dart/lib/thermion_dart/viewer/shared_types/material.dart b/thermion_dart/lib/src/viewer/src/shared_types/material.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/viewer/shared_types/material.dart rename to thermion_dart/lib/src/viewer/src/shared_types/material.dart diff --git a/thermion_dart/lib/thermion_dart/viewer/shared_types/pick_result.dart b/thermion_dart/lib/src/viewer/src/shared_types/pick_result.dart similarity index 77% rename from thermion_dart/lib/thermion_dart/viewer/shared_types/pick_result.dart rename to thermion_dart/lib/src/viewer/src/shared_types/pick_result.dart index 3daa74de..1c935e18 100644 --- a/thermion_dart/lib/thermion_dart/viewer/shared_types/pick_result.dart +++ b/thermion_dart/lib/src/viewer/src/shared_types/pick_result.dart @@ -1,5 +1,5 @@ // "picking" means clicking/tapping on the viewport, and unprojecting the X/Y coordinate to determine whether any renderable entities were present at those coordinates. -import 'package:thermion_dart/thermion_dart/viewer/shared_types/shared_types.dart'; +import '../../viewer.dart'; typedef FilamentPickResult = ({ThermionEntity entity, double x, double y}); typedef ThermionPickResult = FilamentPickResult; diff --git a/thermion_dart/lib/thermion_dart/viewer/shared_types/primitive.dart b/thermion_dart/lib/src/viewer/src/shared_types/primitive.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/viewer/shared_types/primitive.dart rename to thermion_dart/lib/src/viewer/src/shared_types/primitive.dart diff --git a/thermion_dart/lib/thermion_dart/viewer/shared_types/shadow.dart b/thermion_dart/lib/src/viewer/src/shared_types/shadow.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/viewer/shared_types/shadow.dart rename to thermion_dart/lib/src/viewer/src/shared_types/shadow.dart diff --git a/thermion_dart/lib/thermion_dart/viewer/shared_types/shared_types.dart b/thermion_dart/lib/src/viewer/src/shared_types/shared_types.dart similarity index 92% rename from thermion_dart/lib/thermion_dart/viewer/shared_types/shared_types.dart rename to thermion_dart/lib/src/viewer/src/shared_types/shared_types.dart index ed30b00b..55aee2c1 100644 --- a/thermion_dart/lib/thermion_dart/viewer/shared_types/shared_types.dart +++ b/thermion_dart/lib/src/viewer/src/shared_types/shared_types.dart @@ -1,5 +1,6 @@ library shared_types; +export 'camera.dart'; export 'material.dart'; export 'texture.dart'; export 'entities.dart'; diff --git a/thermion_dart/lib/thermion_dart/viewer/shared_types/texture.dart b/thermion_dart/lib/src/viewer/src/shared_types/texture.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/viewer/shared_types/texture.dart rename to thermion_dart/lib/src/viewer/src/shared_types/texture.dart diff --git a/thermion_dart/lib/thermion_dart/viewer/shared_types/texture_details.dart b/thermion_dart/lib/src/viewer/src/shared_types/texture_details.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/viewer/shared_types/texture_details.dart rename to thermion_dart/lib/src/viewer/src/shared_types/texture_details.dart diff --git a/thermion_dart/lib/thermion_dart/viewer/shared_types/tone_mapper.dart b/thermion_dart/lib/src/viewer/src/shared_types/tone_mapper.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/viewer/shared_types/tone_mapper.dart rename to thermion_dart/lib/src/viewer/src/shared_types/tone_mapper.dart diff --git a/thermion_dart/lib/thermion_dart/viewer/thermion_viewer_base.dart b/thermion_dart/lib/src/viewer/src/thermion_viewer_base.dart similarity index 99% rename from thermion_dart/lib/thermion_dart/viewer/thermion_viewer_base.dart rename to thermion_dart/lib/src/viewer/src/thermion_viewer_base.dart index a53f96dd..02b957d3 100644 --- a/thermion_dart/lib/thermion_dart/viewer/thermion_viewer_base.dart +++ b/thermion_dart/lib/src/viewer/src/thermion_viewer_base.dart @@ -1,12 +1,11 @@ -import 'package:thermion_dart/thermion_dart/viewer/events.dart'; -import 'package:thermion_dart/thermion_dart/viewer/shared_types/camera.dart'; - +import 'package:thermion_dart/src/viewer/src/events.dart'; +import '../../entities/abstract_gizmo.dart'; +import 'shared_types/camera.dart'; import 'shared_types/shared_types.dart'; export 'shared_types/shared_types.dart'; import 'dart:math'; import 'dart:typed_data'; -import 'package:thermion_dart/thermion_dart/entities/abstract_gizmo.dart'; import 'package:vector_math/vector_math_64.dart'; import 'dart:async'; import 'package:animation_tools_dart/animation_tools_dart.dart'; diff --git a/thermion_dart/lib/thermion_dart/viewer/thermion_viewer_stub.dart b/thermion_dart/lib/src/viewer/src/thermion_viewer_stub.dart similarity index 98% rename from thermion_dart/lib/thermion_dart/viewer/thermion_viewer_stub.dart rename to thermion_dart/lib/src/viewer/src/thermion_viewer_stub.dart index adca0182..8e52e3fc 100644 --- a/thermion_dart/lib/thermion_dart/viewer/thermion_viewer_stub.dart +++ b/thermion_dart/lib/src/viewer/src/thermion_viewer_stub.dart @@ -1,15 +1,15 @@ import 'dart:math'; import 'dart:typed_data'; -import 'package:thermion_dart/thermion_dart/entities/abstract_gizmo.dart'; -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; -import 'package:thermion_dart/thermion_dart/viewer/events.dart'; -import 'package:thermion_dart/thermion_dart/viewer/shared_types/camera.dart'; -import 'package:thermion_dart/thermion_dart/viewer/thermion_viewer_base.dart'; +import 'package:thermion_dart/thermion_dart.dart'; import 'package:vector_math/vector_math_64.dart'; import 'dart:async'; import 'package:animation_tools_dart/animation_tools_dart.dart'; +import '../../entities/abstract_gizmo.dart'; +import 'events.dart'; +import 'shared_types/camera.dart'; + class ThermionViewerStub extends ThermionViewer { @override Future addAnimationComponent(ThermionEntity entity) { diff --git a/thermion_dart/lib/thermion_dart/viewer/web_js/src/thermion_viewer_dart_bridge.dart b/thermion_dart/lib/src/viewer/src/web_js/src/thermion_viewer_dart_bridge.dart similarity index 99% rename from thermion_dart/lib/thermion_dart/viewer/web_js/src/thermion_viewer_dart_bridge.dart rename to thermion_dart/lib/src/viewer/src/web_js/src/thermion_viewer_dart_bridge.dart index 6804e71b..e428e2a2 100644 --- a/thermion_dart/lib/thermion_dart/viewer/web_js/src/thermion_viewer_dart_bridge.dart +++ b/thermion_dart/lib/src/viewer/src/web_js/src/thermion_viewer_dart_bridge.dart @@ -3,14 +3,12 @@ library thermion_flutter_js; import 'dart:js_interop'; import 'package:logging/logging.dart'; -import 'package:thermion_dart/thermion_dart/viewer/web_js/src/thermion_viewer_js_shim.dart'; - import 'package:vector_math/vector_math_64.dart' as v64; import 'package:animation_tools_dart/animation_tools_dart.dart'; -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; import 'dart:js_interop_unsafe'; - import 'package:vector_math/vector_math_64.dart'; +import '../../../viewer.dart'; +import 'thermion_viewer_js_shim.dart'; /// /// A (Dart) class that wraps a (Dart) instance of [ThermionViewer], diff --git a/thermion_dart/lib/thermion_dart/viewer/web_js/src/thermion_viewer_js.dart b/thermion_dart/lib/src/viewer/src/web_js/src/thermion_viewer_js.dart similarity index 98% rename from thermion_dart/lib/thermion_dart/viewer/web_js/src/thermion_viewer_js.dart rename to thermion_dart/lib/src/viewer/src/web_js/src/thermion_viewer_js.dart index 2d2cb478..c066711a 100644 --- a/thermion_dart/lib/thermion_dart/viewer/web_js/src/thermion_viewer_js.dart +++ b/thermion_dart/lib/src/viewer/src/web_js/src/thermion_viewer_js.dart @@ -5,13 +5,11 @@ import 'dart:typed_data'; import 'package:animation_tools_dart/animation_tools_dart.dart'; import 'package:logging/logging.dart'; -import 'package:thermion_dart/thermion_dart/entities/abstract_gizmo.dart'; -import 'package:thermion_dart/thermion_dart/scene.dart'; -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; -import 'package:thermion_dart/thermion_dart/viewer/events.dart'; -import 'package:thermion_dart/thermion_dart/viewer/shared_types/camera.dart'; - import 'package:vector_math/vector_math_64.dart'; +import '../../../../entities/abstract_gizmo.dart'; +import '../../../viewer.dart'; +import '../../events.dart'; +import '../../shared_types/camera.dart'; import 'thermion_viewer_js_shim.dart'; /// diff --git a/thermion_dart/lib/thermion_dart/viewer/web_js/src/thermion_viewer_js_shim.dart b/thermion_dart/lib/src/viewer/src/web_js/src/thermion_viewer_js_shim.dart similarity index 99% rename from thermion_dart/lib/thermion_dart/viewer/web_js/src/thermion_viewer_js_shim.dart rename to thermion_dart/lib/src/viewer/src/web_js/src/thermion_viewer_js_shim.dart index 5ade4d60..3dd9e74c 100644 --- a/thermion_dart/lib/thermion_dart/viewer/web_js/src/thermion_viewer_js_shim.dart +++ b/thermion_dart/lib/src/viewer/src/web_js/src/thermion_viewer_js_shim.dart @@ -3,7 +3,7 @@ library thermion_flutter_js; import 'dart:js_interop'; -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; +import '../../shared_types/shared_types.dart'; /// /// An extension type on [JSObject] that represents a diff --git a/thermion_dart/lib/thermion_dart/viewer/web_js/thermion_viewer_js.dart b/thermion_dart/lib/src/viewer/src/web_js/thermion_viewer_js.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/viewer/web_js/thermion_viewer_js.dart rename to thermion_dart/lib/src/viewer/src/web_js/thermion_viewer_js.dart diff --git a/thermion_dart/lib/thermion_dart/viewer/web_wasm/src/camera.dart b/thermion_dart/lib/src/viewer/src/web_wasm/src/camera.dart similarity index 75% rename from thermion_dart/lib/thermion_dart/viewer/web_wasm/src/camera.dart rename to thermion_dart/lib/src/viewer/src/web_wasm/src/camera.dart index 186b53dd..4296f7e5 100644 --- a/thermion_dart/lib/thermion_dart/viewer/web_wasm/src/camera.dart +++ b/thermion_dart/lib/src/viewer/src/web_wasm/src/camera.dart @@ -1,6 +1,6 @@ -import 'package:thermion_dart/thermion_dart/viewer/shared_types/camera.dart'; import 'package:vector_math/vector_math_64.dart'; +import '../../shared_types/camera.dart'; import '../../thermion_viewer_base.dart'; class ThermionWasmCamera extends Camera { @@ -33,4 +33,16 @@ class ThermionWasmCamera extends Camera { // TODO: implement setTransform throw UnimplementedError(); } + + @override + ThermionEntity getEntity() { + // TODO: implement getEntity + throw UnimplementedError(); + } + + @override + Future setModelMatrix(Matrix4 matrix) { + // TODO: implement setModelMatrix + throw UnimplementedError(); + } } diff --git a/thermion_dart/lib/thermion_dart/viewer/web_wasm/src/material_instance.dart b/thermion_dart/lib/src/viewer/src/web_wasm/src/material_instance.dart similarity index 83% rename from thermion_dart/lib/thermion_dart/viewer/web_wasm/src/material_instance.dart rename to thermion_dart/lib/src/viewer/src/web_wasm/src/material_instance.dart index 7491ed5c..e5776836 100644 --- a/thermion_dart/lib/thermion_dart/viewer/web_wasm/src/material_instance.dart +++ b/thermion_dart/lib/src/viewer/src/web_wasm/src/material_instance.dart @@ -1,4 +1,4 @@ -import 'package:thermion_dart/thermion_dart/viewer/shared_types/material.dart'; +import '../../../viewer.dart'; class ThermionWasmMaterialInstance extends MaterialInstance { final int pointer; diff --git a/thermion_dart/lib/thermion_dart/viewer/web_wasm/src/thermion_viewer_wasm.dart b/thermion_dart/lib/src/viewer/src/web_wasm/src/thermion_viewer_wasm.dart similarity index 99% rename from thermion_dart/lib/thermion_dart/viewer/web_wasm/src/thermion_viewer_wasm.dart rename to thermion_dart/lib/src/viewer/src/web_wasm/src/thermion_viewer_wasm.dart index 8aff79ab..a99e3951 100644 --- a/thermion_dart/lib/thermion_dart/viewer/web_wasm/src/thermion_viewer_wasm.dart +++ b/thermion_dart/lib/src/viewer/src/web_wasm/src/thermion_viewer_wasm.dart @@ -5,16 +5,17 @@ import 'dart:math'; import 'dart:typed_data' as td; import 'dart:typed_data'; import 'package:logging/logging.dart'; -import 'package:thermion_dart/thermion_dart/entities/abstract_gizmo.dart'; -import 'package:thermion_dart/thermion_dart/entities/gizmo.dart'; -import 'package:thermion_dart/thermion_dart/viewer/events.dart'; -import 'package:thermion_dart/thermion_dart/viewer/shared_types/camera.dart'; import 'package:web/web.dart'; import 'package:animation_tools_dart/animation_tools_dart.dart'; -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; + import 'package:vector_math/vector_math_64.dart'; import 'package:http/http.dart' as http; import 'dart:convert'; +import '../../../../entities/abstract_gizmo.dart'; +import '../../../../entities/gizmo.dart'; +import '../../../viewer.dart'; +import '../../events.dart'; +import '../../shared_types/camera.dart'; import 'camera.dart'; import 'material_instance.dart'; diff --git a/thermion_dart/lib/thermion_dart/viewer/web_wasm/thermion_viewer_web_wasm.dart b/thermion_dart/lib/src/viewer/src/web_wasm/thermion_viewer_web_wasm.dart similarity index 100% rename from thermion_dart/lib/thermion_dart/viewer/web_wasm/thermion_viewer_web_wasm.dart rename to thermion_dart/lib/src/viewer/src/web_wasm/thermion_viewer_web_wasm.dart diff --git a/thermion_dart/lib/src/viewer/viewer.dart b/thermion_dart/lib/src/viewer/viewer.dart new file mode 100644 index 00000000..60065e59 --- /dev/null +++ b/thermion_dart/lib/src/viewer/viewer.dart @@ -0,0 +1,7 @@ +library thermion_viewer; + +export 'src/shared_types/shared_types.dart'; +export 'src/thermion_viewer_base.dart'; +export 'src/thermion_viewer_stub.dart' + if (dart.library.io) 'src/ffi/thermion_viewer_ffi.dart' + if (dart.library.js_interop) 'src/web_wasm/thermion_viewer_web_wasm.dart'; diff --git a/thermion_dart/lib/thermion_dart.dart b/thermion_dart/lib/thermion_dart.dart index 7ade6b33..9985304a 100644 --- a/thermion_dart/lib/thermion_dart.dart +++ b/thermion_dart/lib/thermion_dart.dart @@ -1,5 +1,5 @@ library filament_dart; -export 'thermion_dart/input/input.dart'; -export 'thermion_dart/thermion_viewer.dart'; -export 'thermion_dart/utils/geometry.dart'; +export 'src/viewer/viewer.dart'; +export 'src/input/input.dart'; +export 'src/utils/geometry.dart'; diff --git a/thermion_dart/lib/thermion_dart/thermion_viewer.dart b/thermion_dart/lib/thermion_dart/thermion_viewer.dart deleted file mode 100644 index 48a17df7..00000000 --- a/thermion_dart/lib/thermion_dart/thermion_viewer.dart +++ /dev/null @@ -1,6 +0,0 @@ -library thermion_viewer; - -export 'viewer/thermion_viewer_base.dart'; -export 'viewer/thermion_viewer_stub.dart' - if (dart.library.io) 'viewer/ffi/thermion_viewer_ffi.dart' - if (dart.library.js_interop) 'viewer/web/thermion_viewer_wasm.dart'; diff --git a/thermion_dart/test/camera_tests.dart b/thermion_dart/test/camera_tests.dart index 518ffa67..7c78419c 100644 --- a/thermion_dart/test/camera_tests.dart +++ b/thermion_dart/test/camera_tests.dart @@ -1,6 +1,5 @@ import 'package:thermion_dart/thermion_dart.dart'; import 'package:test/test.dart'; -import 'package:thermion_dart/thermion_dart/utils/geometry.dart'; import 'package:vector_math/vector_math_64.dart'; import 'helpers.dart'; diff --git a/thermion_dart/test/helpers.dart b/thermion_dart/test/helpers.dart index 23aa7143..f0ead246 100644 --- a/thermion_dart/test/helpers.dart +++ b/thermion_dart/test/helpers.dart @@ -5,12 +5,11 @@ import 'package:image/image.dart' as img; import 'dart:typed_data'; import 'package:ffi/ffi.dart'; import 'package:image/image.dart'; +import 'package:thermion_dart/src/swift/swift_bindings.g.dart'; +import 'package:thermion_dart/src/utils/dart_resources.dart'; +import 'package:thermion_dart/src/viewer/src/ffi/src/thermion_dart.g.dart'; +import 'package:thermion_dart/src/viewer/src/ffi/thermion_viewer_ffi.dart'; import 'package:thermion_dart/thermion_dart.dart'; -import 'package:thermion_dart/thermion_dart/swift/swift_bindings.g.dart'; -import 'package:thermion_dart/thermion_dart/utils/dart_resources.dart'; -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; -import 'package:thermion_dart/thermion_dart/viewer/ffi/src/thermion_dart.g.dart'; -import 'package:thermion_dart/thermion_dart/viewer/ffi/src/thermion_viewer_ffi.dart'; import 'package:vector_math/vector_math_64.dart'; import 'package:path/path.dart' as p; diff --git a/thermion_dart/test/input_handlers.dart b/thermion_dart/test/input_handlers.dart index ac8cdb96..3eb7ccd0 100644 --- a/thermion_dart/test/input_handlers.dart +++ b/thermion_dart/test/input_handlers.dart @@ -1,9 +1,8 @@ import 'package:mockito/mockito.dart'; import 'package:mockito/annotations.dart'; import 'package:test/test.dart'; -import 'package:thermion_dart/thermion_dart/input/src/input_handler.dart'; -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; -import 'package:thermion_dart/thermion_dart/input/src/implementations/fixed_orbit_camera_rotation_delegate.dart'; +import 'package:thermion_dart/src/input/src/implementations/fixed_orbit_camera_rotation_delegate.dart'; +import 'package:thermion_dart/thermion_dart.dart'; import 'package:vector_math/vector_math_64.dart'; // Generate mocks @@ -30,7 +29,6 @@ void main() { delegate = FixedOrbitRotateInputHandlerDelegate( mockViewer, - entity: mockEntity, minimumDistance: 1.0, ); }); diff --git a/thermion_dart/test/input_handlers.mocks.dart b/thermion_dart/test/input_handlers.mocks.dart index fbdea0fd..75e72ba1 100644 --- a/thermion_dart/test/input_handlers.mocks.dart +++ b/thermion_dart/test/input_handlers.mocks.dart @@ -8,13 +8,11 @@ import 'dart:typed_data' as _i8; import 'package:animation_tools_dart/animation_tools_dart.dart' as _i9; import 'package:mockito/mockito.dart' as _i1; -import 'package:thermion_dart/thermion_dart/viewer/events.dart' as _i7; -import 'package:thermion_dart/thermion_dart/viewer/shared_types/camera.dart' - as _i3; -import 'package:thermion_dart/thermion_dart/viewer/shared_types/shared_types.dart' +import 'package:thermion_dart/src/viewer/src/events.dart' as _i7; +import 'package:thermion_dart/src/viewer/src/shared_types/camera.dart' as _i3; +import 'package:thermion_dart/src/viewer/src/shared_types/shared_types.dart' as _i4; -import 'package:thermion_dart/thermion_dart/viewer/thermion_viewer_base.dart' - as _i5; +import 'package:thermion_dart/src/viewer/src/thermion_viewer_base.dart' as _i5; import 'package:vector_math/vector_math_64.dart' as _i2; // ignore_for_file: type=lint diff --git a/thermion_dart/test/integration_test.dart b/thermion_dart/test/integration_test.dart index 292a8f97..4b312b51 100644 --- a/thermion_dart/test/integration_test.dart +++ b/thermion_dart/test/integration_test.dart @@ -1,14 +1,11 @@ import 'dart:async'; import 'dart:io'; import 'dart:math'; -import 'dart:typed_data'; - -import 'package:image/image.dart'; +import 'package:thermion_dart/src/viewer/src/events.dart'; +import 'package:thermion_dart/src/viewer/src/ffi/src/thermion_viewer_ffi.dart'; import 'package:thermion_dart/thermion_dart.dart'; import 'package:test/test.dart'; -import 'package:animation_tools_dart/animation_tools_dart.dart'; -import 'package:thermion_dart/thermion_dart/viewer/events.dart'; -import 'package:thermion_dart/thermion_dart/viewer/ffi/src/thermion_viewer_ffi.dart'; + import 'package:vector_math/vector_math_64.dart'; import 'helpers.dart'; diff --git a/thermion_dart/test/viewport_gizmo.dart b/thermion_dart/test/viewport_gizmo.dart index 89c4efce..52f90e2d 100644 --- a/thermion_dart/test/viewport_gizmo.dart +++ b/thermion_dart/test/viewport_gizmo.dart @@ -2,16 +2,12 @@ import 'dart:ffi'; import 'dart:io'; import 'dart:math'; import 'package:ffi/ffi.dart'; -import 'package:thermion_dart/thermion_dart/swift/swift_bindings.g.dart'; -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; - -import 'package:thermion_dart/thermion_dart/utils/dart_resources.dart'; - import 'package:test/test.dart'; -import 'package:animation_tools_dart/animation_tools_dart.dart'; -import 'package:thermion_dart/thermion_dart/utils/geometry.dart'; -import 'package:thermion_dart/thermion_dart/viewer/ffi/src/thermion_dart.g.dart'; -import 'package:thermion_dart/thermion_dart/viewer/ffi/src/thermion_viewer_ffi.dart'; +import 'package:thermion_dart/src/swift/swift_bindings.g.dart'; +import 'package:thermion_dart/src/utils/dart_resources.dart'; +import 'package:thermion_dart/src/viewer/src/ffi/src/thermion_dart.g.dart'; +import 'package:thermion_dart/src/viewer/src/ffi/thermion_viewer_ffi.dart'; +import 'package:thermion_dart/thermion_dart.dart'; import 'package:vector_math/vector_math_64.dart'; /// Test files are run in a variety of ways, find this package root in all. diff --git a/thermion_dart/test/viewport_grid.dart b/thermion_dart/test/viewport_grid.dart index 8cf5691e..fb727013 100644 --- a/thermion_dart/test/viewport_grid.dart +++ b/thermion_dart/test/viewport_grid.dart @@ -1,17 +1,10 @@ import 'dart:ffi'; import 'dart:io'; -import 'dart:math'; import 'package:ffi/ffi.dart'; -import 'package:thermion_dart/thermion_dart/swift/swift_bindings.g.dart'; -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; - -import 'package:thermion_dart/thermion_dart/utils/dart_resources.dart'; - -import 'package:test/test.dart'; -import 'package:thermion_dart/thermion_dart/viewer/ffi/src/thermion_dart.g.dart'; -import 'package:thermion_dart/thermion_dart/viewer/ffi/src/thermion_viewer_ffi.dart'; - -import 'package:vector_math/vector_math_64.dart'; +import 'package:thermion_dart/src/swift/swift_bindings.g.dart'; +import 'package:thermion_dart/src/utils/dart_resources.dart'; +import 'package:thermion_dart/src/viewer/src/ffi/src/thermion_dart.g.dart'; +import 'package:thermion_dart/src/viewer/src/ffi/thermion_viewer_ffi.dart'; /// Test files are run in a variety of ways, find this package root in all. /// diff --git a/thermion_flutter/thermion_flutter/lib/src/thermion_flutter_plugin.dart b/thermion_flutter/thermion_flutter/lib/src/thermion_flutter_plugin.dart index 13ba901e..b37a158b 100644 --- a/thermion_flutter/thermion_flutter/lib/src/thermion_flutter_plugin.dart +++ b/thermion_flutter/thermion_flutter/lib/src/thermion_flutter_plugin.dart @@ -8,7 +8,7 @@ import 'package:thermion_flutter_platform_interface/thermion_flutter_texture.dar /// Handles all platform-specific initialization to create a backing rendering /// surface in a Flutter application and lifecycle listeners to pause rendering /// when the app is inactive or in the background. -/// Call [createViewer] to create an instance of [ThermionViewer]. +/// Call [createViewerWithOptions] to create an instance of [ThermionViewer]. /// class ThermionFlutterPlugin { ThermionFlutterPlugin._(); diff --git a/thermion_flutter/thermion_flutter/lib/src/widgets/src/camera/camera_options_widget.dart b/thermion_flutter/thermion_flutter/lib/src/widgets/src/camera/camera_options_widget.dart index 4a3296cf..8387fdb8 100644 --- a/thermion_flutter/thermion_flutter/lib/src/widgets/src/camera/camera_options_widget.dart +++ b/thermion_flutter/thermion_flutter/lib/src/widgets/src/camera/camera_options_widget.dart @@ -1,5 +1,6 @@ -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart';import 'package:flutter/material.dart'; +import 'package:thermion_dart/thermion_dart.dart'; +import 'package:flutter/material.dart'; import '../../../utils/camera_orientation.dart'; import 'dart:math'; diff --git a/thermion_flutter/thermion_flutter/lib/src/widgets/src/camera/gestures/mobile_gesture_handler_selector_widget.dart b/thermion_flutter/thermion_flutter/lib/src/widgets/src/camera/gestures/mobile_gesture_handler_selector_widget.dart deleted file mode 100644 index de0cbe79..00000000 --- a/thermion_flutter/thermion_flutter/lib/src/widgets/src/camera/gestures/mobile_gesture_handler_selector_widget.dart +++ /dev/null @@ -1,28 +0,0 @@ -// import 'package:flutter/widgets.dart'; -// import 'package:thermion_dart/thermion_dart/input/input_handler.dart'; - -// class MobileGestureHandlerSelectorWidget extends StatelessWidget { -// final InputHandler handler; - -// const MobileGestureHandlerSelectorWidget({super.key, required this.handler}); -// @override -// Widget build(BuildContext context) { -// throw Exception("TODO"); -// // return GestureDetector( -// // onTap: () { - -// // var curIdx = -// // InputType.values.indexOf(handler.gestureType); -// // var nextIdx = -// // curIdx == InputType.values.length - 1 ? 0 : curIdx + 1; -// // handler.setInputType(InputType.values[nextIdx]); -// // }); -// // }, -// // child: Container( -// // padding: const EdgeInsets.all(50), -// // child: Icon(_icons[widget.gestureHandler.gestureType], -// // color: Colors.green), -// // ), -// // ); -// } -// } diff --git a/thermion_flutter/thermion_flutter/lib/src/widgets/src/camera/gestures/thermion_gesture_detector.dart b/thermion_flutter/thermion_flutter/lib/src/widgets/src/camera/gestures/thermion_gesture_detector.dart deleted file mode 100644 index ae20650f..00000000 --- a/thermion_flutter/thermion_flutter/lib/src/widgets/src/camera/gestures/thermion_gesture_detector.dart +++ /dev/null @@ -1,86 +0,0 @@ -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; -import 'package:flutter/material.dart'; - -/// -/// A widget that translates finger/mouse gestures to zoom/pan/rotate actions. -/// -@Deprecated("Use ThermionListenerWidget instead") -class ThermionGestureDetector extends StatelessWidget { - /// - /// The content to display below the gesture detector/listener widget. - /// This will usually be a ThermionWidget (so you can navigate by directly interacting with the viewport), but this is not necessary. - /// It is equally possible to render the viewport/gesture controls elsewhere in the widget hierarchy. The only requirement is that they share the same [FilamentController]. - /// - final Widget? child; - - /// - /// The [controller] attached to the [ThermionWidget] you wish to control. - /// - final ThermionViewer controller; - - /// - /// If true, an overlay will be shown with buttons to toggle whether pointer movements are interpreted as: - /// 1) rotate or a pan (mobile only), - /// 2) moving the camera or the background image (TODO). - /// - final bool showControlOverlay; - - /// - /// If false, gestures will not manipulate the active camera. - /// - final bool enableCamera; - - /// - /// If false, pointer down events will not trigger hit-testing (picking). - /// - final bool enablePicking; - - final void Function(ScaleStartDetails)? onScaleStart; - final void Function(ScaleUpdateDetails)? onScaleUpdate; - final void Function(ScaleEndDetails)? onScaleEnd; - - const ThermionGestureDetector( - {Key? key, - required this.controller, - this.child, - this.showControlOverlay = false, - this.enableCamera = true, - this.enablePicking = false, - this.onScaleStart, - this.onScaleUpdate, - this.onScaleEnd}) - : super(key: key); - - @override - Widget build(BuildContext context) { - throw Exception("TODO"); - // return FutureBuilder( - // future: controller.initialized, - // builder: (_, initialized) { - // if (initialized.data != true) { - // return child ?? Container(); - // } - // if (kIsWeb || Platform.isLinux || - // Platform.isWindows || - // Platform.isMacOS) { - // return ThermionGestureDetectorDesktop( - // controller: controller, - // child: child, - // showControlOverlay: showControlOverlay, - // enableCamera: enableCamera, - // enablePicking: enablePicking, - // ); - // } else { - // return ThermionGestureDetectorMobile( - // controller: controller, - // child: child, - // showControlOverlay: showControlOverlay, - // enableCamera: enableCamera, - // enablePicking: enablePicking, - // onScaleStart: onScaleStart, - // onScaleUpdate: onScaleUpdate, - // onScaleEnd: onScaleEnd); - // } - // }); - } -} diff --git a/thermion_flutter/thermion_flutter/lib/src/widgets/src/camera/gestures/thermion_gesture_detector_desktop.dart b/thermion_flutter/thermion_flutter/lib/src/widgets/src/camera/gestures/thermion_gesture_detector_desktop.dart deleted file mode 100644 index 5ce2e627..00000000 --- a/thermion_flutter/thermion_flutter/lib/src/widgets/src/camera/gestures/thermion_gesture_detector_desktop.dart +++ /dev/null @@ -1,60 +0,0 @@ -// import 'package:thermion_dart/thermion_dart.dart'; - -// import 'package:flutter/gestures.dart'; -// import 'package:flutter/material.dart'; - -// import 'package:vector_math/vector_math_64.dart'; -// import 'dart:ui' show Offset; - -// extension OffsetExtension on Offset { -// Vector2 toVector2() { -// return Vector2(dx, dy); -// } -// } - -// class ThermionGestureDetectorDesktop extends StatefulWidget { -// final Widget? child; -// final InputHandler gestureHandler; -// final bool showControlOverlay; -// final bool enableCamera; -// final bool enablePicking; - -// const ThermionGestureDetectorDesktop({ -// Key? key, -// required this.gestureHandler, -// this.child, -// this.showControlOverlay = false, -// this.enableCamera = true, -// this.enablePicking = true, -// }) : super(key: key); - -// @override -// State createState() => _ThermionGestureDetectorDesktopState(); -// } - -// class _ThermionGestureDetectorDesktopState -// extends State { - -// @override -// Widget build(BuildContext context) { -// return Listener( -// onPointerHover: (event) => -// widget.gestureHandler.onPointerHover(event.localPosition.toVector2(), event.delta.toVector2()), -// onPointerSignal: (PointerSignalEvent pointerSignal) { -// if (pointerSignal is PointerScrollEvent) { -// widget.gestureHandler.onPointerScroll( -// pointerSignal.localPosition.toVector2(), pointerSignal.scrollDelta.dy); -// } -// }, -// onPointerPanZoomStart: (pzs) { -// throw Exception("TODO - is this a pinch zoom on laptop trackpad?"); -// }, -// onPointerDown: (d) => -// widget.gestureHandler.onPointerDown(d.localPosition.toVector2(), d.buttons & kMiddleMouseButton != 0), -// onPointerMove: (PointerMoveEvent d) => -// widget.gestureHandler.onPointerMove(d.localPosition.toVector2(), d.delta.toVector2(), d.buttons & kMiddleMouseButton != 0), -// onPointerUp: (d) => widget.gestureHandler.onPointerUp(d.buttons), -// child: widget.child, -// ); -// } -// } diff --git a/thermion_flutter/thermion_flutter/lib/src/widgets/src/camera/gestures/thermion_gesture_detector_mobile.dart b/thermion_flutter/thermion_flutter/lib/src/widgets/src/camera/gestures/thermion_gesture_detector_mobile.dart deleted file mode 100644 index 066c631d..00000000 --- a/thermion_flutter/thermion_flutter/lib/src/widgets/src/camera/gestures/thermion_gesture_detector_mobile.dart +++ /dev/null @@ -1,234 +0,0 @@ -import 'dart:async'; -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; -import 'package:flutter/material.dart'; - -enum InputType { rotateCamera, panCamera, panBackground } - -/// -/// A widget that translates finger/mouse gestures to zoom/pan/rotate actions. -/// -class ThermionGestureDetectorMobile extends StatefulWidget { - /// - /// The content to display below the gesture detector/listener widget. - /// This will usually be a ThermionWidget (so you can navigate by directly interacting with the viewport), but this is not necessary. - /// It is equally possible to render the viewport/gesture controls elsewhere in the widget hierarchy. The only requirement is that they share the same [Filamentviewer]. - /// - final Widget? child; - - /// - /// The [viewer] attached to the [ThermionWidget] you wish to control. - /// - final ThermionViewer viewer; - - /// - /// If true, an overlay will be shown with buttons to toggle whether pointer movements are interpreted as: - /// 1) rotate or a pan (mobile only), - /// 2) moving the camera or the background image (TODO). - /// - final bool showControlOverlay; - - /// - /// If false, gestures will not manipulate the active camera. - /// - final bool enableCamera; - - /// - /// If false, pointer down events will not trigger hit-testing (picking). - /// - final bool enablePicking; - - final double zoomDelta; - - final void Function(ScaleStartDetails)? onScaleStart; - final void Function(ScaleUpdateDetails)? onScaleUpdate; - final void Function(ScaleEndDetails)? onScaleEnd; - - const ThermionGestureDetectorMobile( - {Key? key, - required this.viewer, - this.child, - this.showControlOverlay = false, - this.enableCamera = true, - this.enablePicking = true, - this.onScaleStart, - this.onScaleUpdate, - this.onScaleEnd, - this.zoomDelta = 1}) - : super(key: key); - - @override - State createState() => _ThermionGestureDetectorMobileState(); -} - -class _ThermionGestureDetectorMobileState - extends State { - InputType gestureType = InputType.panCamera; - - final _icons = { - InputType.panBackground: Icons.image, - InputType.panCamera: Icons.pan_tool, - InputType.rotateCamera: Icons.rotate_90_degrees_ccw - }; - - // on mobile, we can't differentiate between pointer down events like we do on desktop with primary/secondary/tertiary buttons - // we allow the user to toggle between panning and rotating by double-tapping the widget - bool _rotateOnPointerMove = false; - - // - // - // - bool _scaling = false; - - // to avoid duplicating code for pan/rotate (panStart, panUpdate, panEnd, rotateStart, rotateUpdate etc) - // we have only a single function for start/update/end. - // when the gesture type is changed, these properties are updated to point to the correct function. - // ignore: unused_field - late Function(double x, double y) _functionStart; - // ignore: unused_field - late Function(double x, double y) _functionUpdate; - // ignore: unused_field - late Function() _functionEnd; - - @override - void initState() { - _setFunction(); - super.initState(); - } - - void _setFunction() { - switch (gestureType) { - case InputType.rotateCamera: - _functionStart = widget.viewer.rotateStart; - _functionUpdate = widget.viewer.rotateUpdate; - _functionEnd = widget.viewer.rotateEnd; - break; - case InputType.panCamera: - _functionStart = widget.viewer.panStart; - _functionUpdate = widget.viewer.panUpdate; - _functionEnd = widget.viewer.panEnd; - break; - // TODO - case InputType.panBackground: - _functionStart = (x, y) async {}; - _functionUpdate = (x, y) async {}; - _functionEnd = () async {}; - } - } - - @override - void didUpdateWidget(ThermionGestureDetectorMobile oldWidget) { - if (widget.showControlOverlay != oldWidget.showControlOverlay || - widget.enableCamera != oldWidget.enableCamera || - widget.enablePicking != oldWidget.enablePicking) { - setState(() {}); - } - - super.didUpdateWidget(oldWidget); - } - - // ignore: unused_field - Timer? _scrollTimer; - double _lastScale = 0; - - // pinch zoom on mobile - // couldn't find any equivalent for pointerCount in Listener (?) so we use a GestureDetector - @override - Widget build(BuildContext context) { - return Stack(children: [ - Positioned.fill( - child: GestureDetector( - behavior: HitTestBehavior.translucent, - onTapDown: (d) { - if (!widget.enablePicking) { - return; - } - - widget.viewer.pick( - d.globalPosition.dx.toInt(), d.globalPosition.dy.toInt()); - }, - onDoubleTap: () { - setState(() { - _rotateOnPointerMove = !_rotateOnPointerMove; - }); - }, - onScaleStart: (d) async { - if (widget.onScaleStart != null) { - widget.onScaleStart!.call(d); - return; - } - if (d.pointerCount == 2 && widget.enableCamera) { - _scaling = true; - await widget.viewer.zoomBegin(); - } else if (!_scaling && widget.enableCamera) { - if (_rotateOnPointerMove) { - widget.viewer.rotateStart( - d.localFocalPoint.dx, d.localFocalPoint.dy); - } else { - widget.viewer - .panStart(d.localFocalPoint.dx, d.localFocalPoint.dy); - } - } - }, - onScaleUpdate: (ScaleUpdateDetails d) async { - if (widget.onScaleUpdate != null) { - widget.onScaleUpdate!.call(d); - return; - } - if (d.pointerCount == 2 && widget.enableCamera) { - if (d.horizontalScale != _lastScale) { - widget.viewer.zoomUpdate( - d.localFocalPoint.dx, - d.localFocalPoint.dy, - d.horizontalScale > _lastScale ? 0.1 : -0.1); - _lastScale = d.horizontalScale; - } - } else if (!_scaling && widget.enableCamera) { - if (_rotateOnPointerMove) { - widget.viewer - .rotateUpdate(d.focalPoint.dx, d.focalPoint.dy); - } else { - widget.viewer - .panUpdate(d.focalPoint.dx, d.focalPoint.dy); - } - } - }, - onScaleEnd: (d) async { - if (widget.onScaleEnd != null) { - widget.onScaleEnd!.call(d); - return; - } - - if (d.pointerCount == 2 && widget.enableCamera) { - widget.viewer.zoomEnd(); - } else if (!_scaling && widget.enableCamera) { - if (_rotateOnPointerMove) { - widget.viewer.rotateEnd(); - } else { - widget.viewer.panEnd(); - } - } - _scaling = false; - }, - child: widget.child)), - widget.showControlOverlay - ? Align( - alignment: Alignment.bottomRight, - child: GestureDetector( - onTap: () { - setState(() { - var curIdx = InputType.values.indexOf(gestureType); - var nextIdx = curIdx == InputType.values.length - 1 - ? 0 - : curIdx + 1; - gestureType = InputType.values[nextIdx]; - _setFunction(); - }); - }, - child: Container( - padding: const EdgeInsets.all(50), - child: Icon(_icons[gestureType], color: Colors.green)), - )) - : Container() - ]); - } -} diff --git a/thermion_flutter/thermion_flutter/lib/src/widgets/src/debug/child_renderable_widget.dart b/thermion_flutter/thermion_flutter/lib/src/widgets/src/debug/child_renderable_widget.dart index 8cf047ab..d4048f64 100644 --- a/thermion_flutter/thermion_flutter/lib/src/widgets/src/debug/child_renderable_widget.dart +++ b/thermion_flutter/thermion_flutter/lib/src/widgets/src/debug/child_renderable_widget.dart @@ -1,5 +1,5 @@ import 'package:animation_tools_dart/animation_tools_dart.dart'; -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; +import 'package:thermion_dart/thermion_dart.dart'; import 'package:flutter/material.dart'; import 'dart:math'; diff --git a/thermion_flutter/thermion_flutter/lib/src/widgets/src/debug/skeleton_menu_item_widget.dart b/thermion_flutter/thermion_flutter/lib/src/widgets/src/debug/skeleton_menu_item_widget.dart index 1c676310..b9819368 100644 --- a/thermion_flutter/thermion_flutter/lib/src/widgets/src/debug/skeleton_menu_item_widget.dart +++ b/thermion_flutter/thermion_flutter/lib/src/widgets/src/debug/skeleton_menu_item_widget.dart @@ -1,7 +1,6 @@ import 'dart:math'; import 'package:thermion_dart/thermion_dart.dart'; -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; import 'package:animation_tools_dart/animation_tools_dart.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; diff --git a/thermion_flutter/thermion_flutter/lib/src/widgets/src/lights/ibl_rotation_slider.dart b/thermion_flutter/thermion_flutter/lib/src/widgets/src/lights/ibl_rotation_slider.dart index 51d320a8..e0968e50 100644 --- a/thermion_flutter/thermion_flutter/lib/src/widgets/src/lights/ibl_rotation_slider.dart +++ b/thermion_flutter/thermion_flutter/lib/src/widgets/src/lights/ibl_rotation_slider.dart @@ -1,6 +1,6 @@ import 'dart:math'; -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; import 'package:flutter/material.dart'; +import 'package:thermion_dart/thermion_dart.dart'; import 'package:vector_math/vector_math_64.dart' as v; class IblRotationSliderWidget extends StatefulWidget { diff --git a/thermion_flutter/thermion_flutter/lib/src/widgets/src/camera/gestures/thermion_listener_widget.dart b/thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_listener_widget.dart similarity index 100% rename from thermion_flutter/thermion_flutter/lib/src/widgets/src/camera/gestures/thermion_listener_widget.dart rename to thermion_flutter/thermion_flutter/lib/src/widgets/src/thermion_listener_widget.dart diff --git a/thermion_flutter/thermion_flutter/lib/src/widgets/widgets.dart b/thermion_flutter/thermion_flutter/lib/src/widgets/widgets.dart index de0efe1d..8c2cbf41 100644 --- a/thermion_flutter/thermion_flutter/lib/src/widgets/widgets.dart +++ b/thermion_flutter/thermion_flutter/lib/src/widgets/widgets.dart @@ -1,4 +1,4 @@ library; export 'src/thermion_widget.dart'; -export 'src/camera/gestures/thermion_listener_widget.dart'; +export 'src/thermion_listener_widget.dart'; diff --git a/thermion_flutter/thermion_flutter_ffi/lib/thermion_flutter_ffi.dart b/thermion_flutter/thermion_flutter_ffi/lib/thermion_flutter_ffi.dart index 900df23b..e30c6020 100644 --- a/thermion_flutter/thermion_flutter_ffi/lib/thermion_flutter_ffi.dart +++ b/thermion_flutter/thermion_flutter_ffi/lib/thermion_flutter_ffi.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'package:flutter/services.dart'; import 'dart:ffi'; import 'package:thermion_dart/thermion_dart.dart'; -import 'package:thermion_dart/thermion_dart/viewer/ffi/thermion_viewer_ffi.dart'; +import 'package:thermion_dart/src/viewer/src/ffi/thermion_viewer_ffi.dart'; import 'package:thermion_flutter_platform_interface/thermion_flutter_platform_interface.dart'; import 'package:thermion_flutter_platform_interface/thermion_flutter_texture.dart'; import 'package:logging/logging.dart'; diff --git a/thermion_flutter/thermion_flutter_platform_interface/lib/thermion_flutter_platform_interface.dart b/thermion_flutter/thermion_flutter_platform_interface/lib/thermion_flutter_platform_interface.dart index 03f81098..2a861b84 100644 --- a/thermion_flutter/thermion_flutter_platform_interface/lib/thermion_flutter_platform_interface.dart +++ b/thermion_flutter/thermion_flutter_platform_interface/lib/thermion_flutter_platform_interface.dart @@ -1,7 +1,7 @@ import 'dart:async'; -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; import 'package:plugin_platform_interface/plugin_platform_interface.dart'; +import 'package:thermion_dart/thermion_dart.dart'; import 'thermion_flutter_texture.dart'; class ThermionFlutterOptions { diff --git a/thermion_flutter/thermion_flutter_web/lib/thermion_flutter_web.dart b/thermion_flutter/thermion_flutter_web/lib/thermion_flutter_web.dart index 1780b152..db762d80 100644 --- a/thermion_flutter/thermion_flutter_web/lib/thermion_flutter_web.dart +++ b/thermion_flutter/thermion_flutter_web/lib/thermion_flutter_web.dart @@ -1,5 +1,4 @@ -import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; -import 'package:thermion_dart/thermion_dart/viewer/web_wasm/src/thermion_viewer_wasm.dart'; +import 'package:thermion_dart/thermion_dart.dart'; import 'package:thermion_flutter_platform_interface/thermion_flutter_platform_interface.dart'; import 'package:thermion_flutter_platform_interface/thermion_flutter_texture.dart'; import 'package:flutter_web_plugins/flutter_web_plugins.dart';