Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish setting center-of-rotation feature. Implement a Docker Container to build/server project #88

Merged
merged 3 commits into from
Jan 18, 2022

Conversation

camtauxe
Copy link
Contributor

@camtauxe camtauxe commented Dec 17, 2021

This PR finishes up my earlier work on issue #82 and fixes issue #87. More importantly, there is an initial implementation of our next major feature: A Docker "standalone app" that can build and serve projects for a user. This is kinda like issue #84, although our recent meetings have changed the scope of it somewhat. I've copied the commit message for this change below:

This is the first crack at creating an easy-to-use "app" that can build
and run a browser instance just from project input data. It's not
fool-proof yet, but it's a strong foundation.

To run it:
- First build the docker image:
docker build -t 4dgbrunner .
- Then run with docker-compose
docker-compose run --rm -p 127.0.0.1:8000:8000 browser

This will "import" the test.01 project, and spin up an instance of the
browser on port 8000.

The important thing here is that, if this Docker image is built
and (eventually) published on DockerHub, users won't even need
this repository to browser their projects. They would only need
to assemble their project in a directory, then run docker-compose
(which can be wrapped in a simple script later).

You can try a bit of this now by moving to a totally different
directory after building the image, copying the 'projects/'
directory into your new directory, then running the docker-compose
command.

EDIT: Added a commit fixing issue #87

Clicking on a segment in the Geometry Canvas will now set the
camera's center of rotation to the point you clicked. To reset,
a "Reset Camera" button has been added to the ControlPanel.

The old functionality of selecting the segment is commented-out
if we ever want it back.

This commit also fixes some funky behavior when a project is first
loaded (and there's no saved state yet). Now everything will be
initialized with the default settings of the Controller class.

I'm really not happy with all the repeated similar code for handling
Controller events. Although I like the API that it gives Components.
A more general solution e.g. `controller.setSetting('variable', x)`
would make it easier to add new settings, but I wouldn't want to
do that unless we could use TypeScript or something to make the
API safer.

It's probably a moot point, since we're planning to rewrite
everything after this next milestone anyway ¯\_(ツ)_/¯
This is the first crack at creating an easy-to-use "app" that can build
and run a browser instance just from project input data. It's not
fool-proof yet, but it's a strong foundation.

To run it:
    - First build the docker image:
        docker build -t 4dgbrunner .
    - Then run with docker-compose
        docker-compose run --rm -p 127.0.0.1:8000:8000 browser

This will "import" the test.01 project, and spin up an instance of the
browser on port 8000.

The important thing here is that, if this Docker image is built
and (eventually) published on DockerHub, users won't even need
this repository to browser their projects. They would only need
to assemble their project in a directory, then run docker-compose
(which can be wrapped in a simple script later).

You can try a bit of this now by moving to a totally different
directory after building the image, copying the 'projects/'
directory into your new directory, then running the docker-compose
command.
…he camera.

To distinguish between a single click and a click-and-drag, we simply time
how long the mouse button was held down. In my testing, I found 300 millseconds
to be a pretty good cutoff, but we might want to change that later.
@dhrogers dhrogers merged commit 424a5f2 into lanl:master Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants