Revisão | ccc7ebe0a26a665dd93e6e5c5e7670f7be672f96 (tree) |
---|---|
Hora | 2021-06-20 22:10:10 |
Autor | sebastian_bugiu |
Commiter | sebastian_bugiu |
Added button for adding asteroids directly.
@@ -87,6 +87,8 @@ | ||
87 | 87 | * Controller class for main fxml file. |
88 | 88 | */ |
89 | 89 | public class MainController implements Initializable { |
90 | + | |
91 | + private static MainController singleton; | |
90 | 92 | public Button endBtn; |
91 | 93 | public Button ffBtn; |
92 | 94 | public CheckMenuItem loadAsPolygonsCheckBox; |
@@ -194,6 +196,7 @@ | ||
194 | 196 | @SuppressWarnings("deprecation") |
195 | 197 | @Override |
196 | 198 | public void initialize(URL location, ResourceBundle resources) { |
199 | + singleton = this; | |
197 | 200 | try { |
198 | 201 | // CREATE NAVIGATOR CONTROLS |
199 | 202 | navigationPanel = FXMLLoader.load(MainController.class.getResource("/resources/com/javafx/experiments/jfx3dviewer/navigation.fxml")); |
@@ -364,7 +367,7 @@ | ||
364 | 367 | updateStatus(); |
365 | 368 | } |
366 | 369 | |
367 | - private void load(File file) { | |
370 | + public void load(File file) { | |
368 | 371 | loadedPath = file; |
369 | 372 | try { |
370 | 373 | doLoad(file.toURI() |
@@ -433,4 +436,8 @@ | ||
433 | 436 | private void requestSceneFocus() { |
434 | 437 | contentModel.getSubScene().requestFocus(); |
435 | 438 | } |
439 | + | |
440 | + public static MainController getSingleton() { | |
441 | + return singleton; | |
442 | + } | |
436 | 443 | } |
@@ -31,6 +31,7 @@ | ||
31 | 31 | */ |
32 | 32 | package com.javafx.experiments.jfx3dviewer; |
33 | 33 | |
34 | +import java.io.File; | |
34 | 35 | import java.net.URL; |
35 | 36 | import java.util.ResourceBundle; |
36 | 37 |
@@ -41,6 +42,7 @@ | ||
41 | 42 | import javafx.beans.binding.DoubleBinding; |
42 | 43 | import javafx.beans.binding.ObjectBinding; |
43 | 44 | import javafx.beans.property.DoubleProperty; |
45 | +import javafx.event.ActionEvent; | |
44 | 46 | import javafx.fxml.FXML; |
45 | 47 | import javafx.fxml.Initializable; |
46 | 48 | import javafx.scene.Node; |
@@ -531,4 +533,10 @@ | ||
531 | 533 | "ambientEnable"); |
532 | 534 | sessionManager.bind(settings, "settingsPane"); |
533 | 535 | } |
536 | + | |
537 | + public void loadAsteroid(ActionEvent event) { | |
538 | + System.out.println("loading asteroid"); | |
539 | + | |
540 | + MainController.getSingleton().load(new File("/Users/sebastian/Downloads/BlackholeDarksunOnline6/HotshotEditor/src/resources/com/javafx/experiments/jfx3dviewer/box.obj")); | |
541 | + } | |
534 | 542 | } |
@@ -34,6 +34,7 @@ | ||
34 | 34 | |
35 | 35 | <?import javafx.geometry.Insets?> |
36 | 36 | <?import javafx.scene.control.Accordion?> |
37 | +<?import javafx.scene.control.Button?> | |
37 | 38 | <?import javafx.scene.control.CheckBox?> |
38 | 39 | <?import javafx.scene.control.ColorPicker?> |
39 | 40 | <?import javafx.scene.control.Label?> |
@@ -241,7 +242,7 @@ | ||
241 | 242 | <GridPane hgap="5.0" padding="$x3" styleClass="settings" vgap="5.0"> |
242 | 243 | <children> |
243 | 244 | <Label text="Field of view:" GridPane.columnIndex="0" GridPane.rowIndex="0" /> |
244 | - <Slider fx:id="fovSlider" majorTickUnit="40.0" max="180.0" min="0.0" minorTickCount="4" showTickLabels="true" showTickMarks="true" GridPane.columnIndex="1" GridPane.rowIndex="0" value="90" /> | |
245 | + <Slider fx:id="fovSlider" majorTickUnit="40.0" max="180.0" min="0.0" minorTickCount="4" showTickLabels="true" showTickMarks="true" value="90" GridPane.columnIndex="1" GridPane.rowIndex="0" /> | |
245 | 246 | <Label fx:id="nearClipLabel" text="Near clipping pane: %.5f" GridPane.columnIndex="0" GridPane.rowIndex="1" /> |
246 | 247 | <Slider fx:id="nearClipSlider" majorTickUnit="1" max="5" min="-5" minorTickCount="4" showTickLabels="true" showTickMarks="true" GridPane.columnIndex="1" GridPane.rowIndex="1" /> |
247 | 248 | <Label fx:id="farClipLabel" text="Far clipping pane: %.5f" GridPane.columnIndex="0" GridPane.rowIndex="2" /> |
@@ -311,6 +312,7 @@ | ||
311 | 312 | <ToggleButton fx:id="asteroid5Toggle" layoutX="106.0" layoutY="10.0" mnemonicParsing="false" text="5" toggleGroup="$asteroidGroup" /> |
312 | 313 | </children> |
313 | 314 | </HBox> |
315 | + <Button fx:id="loadAsteroidBtn" mnemonicParsing="false" onAction="#loadAsteroid" text="Add" GridPane.rowIndex="1" /> | |
314 | 316 | </children> |
315 | 317 | </GridPane> |
316 | 318 | </content> |
@@ -1,328 +0,0 @@ | ||
1 | -<?xml version="1.0" encoding="UTF-8"?> | |
2 | - | |
3 | -<!-- | |
4 | -Copyright (c) 2010, 2014, Oracle and/or its affiliates. | |
5 | -All rights reserved. Use is subject to license terms. | |
6 | - | |
7 | -This file is available and licensed under the following license: | |
8 | - | |
9 | -Redistribution and use in source and binary forms, with or without | |
10 | -modification, are permitted provided that the following conditions | |
11 | -are met: | |
12 | - | |
13 | - - Redistributions of source code must retain the above copyright | |
14 | - notice, this list of conditions and the following disclaimer. | |
15 | - - Redistributions in binary form must reproduce the above copyright | |
16 | - notice, this list of conditions and the following disclaimer in | |
17 | - the documentation and/or other materials provided with the distribution. | |
18 | - - Neither the name of Oracle Corporation nor the names of its | |
19 | - contributors may be used to endorse or promote products derived | |
20 | - from this software without specific prior written permission. | |
21 | - | |
22 | -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
23 | -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
24 | -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
25 | -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
26 | -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
27 | -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
28 | -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
29 | -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
30 | -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
31 | -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
32 | -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
33 | ---> | |
34 | -<?import java.lang.*?> | |
35 | -<?import java.net.*?> | |
36 | -<?import java.util.*?> | |
37 | -<?import javafx.geometry.*?> | |
38 | -<?import javafx.scene.control.*?> | |
39 | -<?import javafx.scene.control.MenuBar?> | |
40 | -<?import javafx.scene.control.ToolBar?> | |
41 | -<?import javafx.scene.layout.*?> | |
42 | -<?import javafx.scene.paint.*?> | |
43 | -<?import com.javafx.experiments.shape3d.*?> | |
44 | -<?scenebuilder-stylesheet viewer.css?> | |
45 | - | |
46 | -<!--suppress JavaFxUnresolvedStyleClassReference --> | |
47 | - | |
48 | -<Accordion fx:id="settings" minWidth="0.0" prefHeight="798.0" prefWidth="279.0" xmlns:fx="http://javafx.com/fxml" fx:controller="com.javafx.experiments.jfx3dviewer.SettingsController"> | |
49 | - <expandedPane> | |
50 | - <TitledPane fx:id="x5" animated="false" expanded="true" text="Hierarchy"> | |
51 | - <content> | |
52 | - <TreeTableView fx:id="hierarachyTreeTable" editable="true" prefHeight="200.0" prefWidth="200.0"> | |
53 | - <columns> | |
54 | - <TreeTableColumn fx:id="nodeColumn" editable="false" prefWidth="75.0" sortable="false" text="Node" /> | |
55 | - <TreeTableColumn fx:id="idColumn" editable="false" prefWidth="75.0" text="Id" /> | |
56 | - <TreeTableColumn fx:id="visibilityColumn" editable="true" text="Visibility" /> | |
57 | - <TreeTableColumn fx:id="widthColumn" editable="false" text="W" /> | |
58 | - <TreeTableColumn fx:id="heightColumn" editable="false" text="H" /> | |
59 | - <TreeTableColumn fx:id="depthColumn" editable="false" text="D" /> | |
60 | - </columns> | |
61 | - </TreeTableView> | |
62 | - </content> | |
63 | - </TitledPane> | |
64 | - </expandedPane> | |
65 | - <panes> | |
66 | - <TitledPane fx:id="x4" animated="false" expanded="false" text="Options"> | |
67 | - <content> | |
68 | - <GridPane hgap="5.0" styleClass="settings" vgap="5.0"> | |
69 | - <children> | |
70 | - <Label text="Show Axis:" GridPane.columnIndex="0" GridPane.rowIndex="0" /> | |
71 | - <Label text="Y Up:" GridPane.columnIndex="0" GridPane.rowIndex="1" /> | |
72 | - <CheckBox fx:id="showAxisCheckBox" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="0" /> | |
73 | - <CheckBox fx:id="yUpCheckBox" mnemonicParsing="false" selected="true" text="" GridPane.columnIndex="1" GridPane.rowIndex="1" /> | |
74 | - <Label text="MSAA Antialiasing" GridPane.columnIndex="0" GridPane.rowIndex="2" /> | |
75 | - <CheckBox id="msaaCheckBox" fx:id="msaaCheckBox" mnemonicParsing="false" selected="true" text="" GridPane.columnIndex="1" GridPane.rowIndex="2" /> | |
76 | - <Label text="Background Color" GridPane.columnIndex="0" GridPane.rowIndex="3" /> | |
77 | - <ColorPicker fx:id="backgroundColorPicker" GridPane.columnIndex="1" GridPane.rowIndex="3" /> | |
78 | - <Label text="Wireframe" GridPane.columnIndex="0" GridPane.rowIndex="4" /> | |
79 | - <CheckBox fx:id="wireFrameCheckbox" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="4" /> | |
80 | - <Label text="Subdivision level" GridPane.columnIndex="0" GridPane.rowIndex="5" /> | |
81 | - <HBox prefHeight="-1.0" prefWidth="-1.0" GridPane.columnIndex="1" GridPane.rowIndex="5"> | |
82 | - <children> | |
83 | - <ToggleButton mnemonicParsing="false" selected="true" styleClass="left-pill" text="None" userData="0"> | |
84 | - <toggleGroup> | |
85 | - <ToggleGroup fx:id="subdivisionLevelGroup" /> | |
86 | - </toggleGroup> | |
87 | - </ToggleButton> | |
88 | - <ToggleButton mnemonicParsing="false" styleClass="center-pill" text="1" toggleGroup="$subdivisionLevelGroup" userData="1" /> | |
89 | - <ToggleButton mnemonicParsing="false" styleClass="center-pill" text="2" toggleGroup="$subdivisionLevelGroup" userData="2" /> | |
90 | - <ToggleButton mnemonicParsing="false" styleClass="right-pill" text="3" toggleGroup="$subdivisionLevelGroup" userData="3" /> | |
91 | - </children> | |
92 | - </HBox> | |
93 | - <Label text="Creases (Boundary Rules)" GridPane.columnIndex="0" GridPane.rowIndex="6" /> | |
94 | - <HBox prefHeight="-1.0" prefWidth="-1.0" GridPane.columnIndex="1" GridPane.rowIndex="6"> | |
95 | - <children> | |
96 | - <ToggleButton mnemonicParsing="false" selected="true" styleClass="left-pill" text="Edges"> | |
97 | - <toggleGroup> | |
98 | - <ToggleGroup fx:id="subdivisionBoundaryGroup" /> | |
99 | - </toggleGroup> | |
100 | - <userData> | |
101 | - <SubdivisionMesh.BoundaryMode fx:value="CREASE_EDGES"/> | |
102 | - </userData> | |
103 | - <tooltip> | |
104 | - <Tooltip text="Only edges at the boundary are treated as creases" /> | |
105 | - </tooltip> | |
106 | - </ToggleButton> | |
107 | - <ToggleButton mnemonicParsing="false" styleClass="right-pill" text="All" toggleGroup="$subdivisionBoundaryGroup"> | |
108 | - <userData> | |
109 | - <SubdivisionMesh.BoundaryMode fx:value="CREASE_ALL"/> | |
110 | - </userData> | |
111 | - <tooltip> | |
112 | - <Tooltip text="Edges and points at the boundary are treated as creases" /> | |
113 | - </tooltip> | |
114 | - </ToggleButton> | |
115 | - </children> | |
116 | - </HBox> | |
117 | - <Label text="Smooth Texture Map" GridPane.columnIndex="0" GridPane.rowIndex="7" /> | |
118 | - <HBox prefHeight="-1.0" prefWidth="-1.0" GridPane.columnIndex="1" GridPane.rowIndex="7"> | |
119 | - <children> | |
120 | - <ToggleButton mnemonicParsing="false" selected="true" styleClass="left-pill" text="None"> | |
121 | - <toggleGroup> | |
122 | - <ToggleGroup fx:id="subdivisionSmoothGroup" /> | |
123 | - </toggleGroup> | |
124 | - <userData> | |
125 | - <SubdivisionMesh.MapBorderMode fx:value="NOT_SMOOTH"/> | |
126 | - </userData> | |
127 | - <tooltip> | |
128 | - <Tooltip text="Keeps the same uvs for all control points" /> | |
129 | - </tooltip> | |
130 | - </ToggleButton> | |
131 | - <ToggleButton mnemonicParsing="false" styleClass="center-pill" text="Internal" toggleGroup="$subdivisionSmoothGroup"> | |
132 | - <userData> | |
133 | - <SubdivisionMesh.MapBorderMode fx:value="SMOOTH_INTERNAL"/> | |
134 | - </userData> | |
135 | - <tooltip> | |
136 | - <Tooltip text="Smooths uvs of points at corners" /> | |
137 | - </tooltip> | |
138 | - </ToggleButton> | |
139 | - <ToggleButton mnemonicParsing="false" styleClass="right-pill" text="All" toggleGroup="$subdivisionSmoothGroup"> | |
140 | - <userData> | |
141 | - <SubdivisionMesh.MapBorderMode fx:value="SMOOTH_ALL"/> | |
142 | - </userData> | |
143 | - <tooltip> | |
144 | - <Tooltip text="Smooths uvs of points at boundaries" /> | |
145 | - </tooltip> | |
146 | - </ToggleButton> | |
147 | - </children> | |
148 | - </HBox> | |
149 | - <Region maxHeight="1.7976931348623157E308" prefHeight="-1.0" prefWidth="-1.0" GridPane.columnIndex="0" GridPane.rowIndex="8" /> | |
150 | - </children> | |
151 | - <columnConstraints> | |
152 | - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | |
153 | - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | |
154 | - </columnConstraints> | |
155 | - <padding> | |
156 | - <Insets bottom="8.0" left="8.0" right="8.0" top="8.0" fx:id="x3" /> | |
157 | - </padding> | |
158 | - <rowConstraints> | |
159 | - <RowConstraints minHeight="10.0" prefHeight="-1.0" vgrow="SOMETIMES" /> | |
160 | - <RowConstraints minHeight="10.0" prefHeight="-1.0" vgrow="SOMETIMES" /> | |
161 | - <RowConstraints minHeight="10.0" prefHeight="-1.0" vgrow="SOMETIMES" /> | |
162 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
163 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
164 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
165 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
166 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
167 | - <RowConstraints minHeight="10.0" vgrow="ALWAYS" /> | |
168 | - </rowConstraints> | |
169 | - </GridPane> | |
170 | - </content> | |
171 | - </TitledPane> | |
172 | - <TitledPane fx:id="x2" animated="false" text="Lights"> | |
173 | - <content> | |
174 | - <ScrollPane fitToWidth="true" prefHeight="200.0" prefWidth="200.0"> | |
175 | - <content> | |
176 | - <GridPane hgap="5.0" padding="$x3" styleClass="settings" vgap="5.0"> | |
177 | - <children> | |
178 | - <Label text="Color:" GridPane.columnIndex="0" GridPane.rowIndex="2" /> | |
179 | - <Label maxWidth="1.7976931348623157E308" styleClass="settings-header" text="Ambient" GridPane.columnIndex="0" GridPane.columnSpan="2147483647" GridPane.hgrow="ALWAYS" GridPane.rowIndex="0" /> | |
180 | - <ColorPicker fx:id="ambientColorPicker" GridPane.columnIndex="1" GridPane.rowIndex="2" /> | |
181 | - <Label text="Enabled" GridPane.columnIndex="0" GridPane.rowIndex="1" /> | |
182 | - <CheckBox fx:id="ambientEnableCheckbox" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="1" /> | |
183 | - <Label text="Color:" GridPane.columnIndex="0" GridPane.rowIndex="5" /> | |
184 | - <ColorPicker id="ambientColorPicker" fx:id="light1ColorPicker" GridPane.columnIndex="1" GridPane.rowIndex="5" /> | |
185 | - <Label maxWidth="1.7976931348623157E308" styleClass="settings-header" text="Light 1 (Camera)" GridPane.columnIndex="0" GridPane.columnSpan="2" GridPane.hgrow="ALWAYS" GridPane.rowIndex="3" /> | |
186 | - <Label text="Enabled" GridPane.columnIndex="0" GridPane.rowIndex="4" /> | |
187 | - <CheckBox fx:id="light1EnabledCheckBox" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="4" /> | |
188 | - <Label text="Lock to Camera" GridPane.columnIndex="0" GridPane.rowIndex="6" /> | |
189 | - <CheckBox fx:id="light1followCameraCheckBox" mnemonicParsing="false" selected="true" text="" GridPane.columnIndex="1" GridPane.rowIndex="6" /> | |
190 | - <Label text="X" GridPane.columnIndex="0" GridPane.rowIndex="7" /> | |
191 | - <Slider fx:id="light1x" majorTickUnit="20.0" max="100.0" min="-100.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="7" /> | |
192 | - <Label text="Y" GridPane.columnIndex="0" GridPane.rowIndex="8" /> | |
193 | - <Slider fx:id="light1y" majorTickUnit="20.0" max="100.0" min="-100.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="8" /> | |
194 | - <Label text="Z" GridPane.columnIndex="0" GridPane.rowIndex="9" /> | |
195 | - <Slider fx:id="light1z" majorTickUnit="20.0" max="100.0" min="-100.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="9" /> | |
196 | - <Label maxWidth="1.7976931348623157E308" styleClass="settings-header" text="Light 2" GridPane.columnIndex="0" GridPane.columnSpan="2" GridPane.hgrow="ALWAYS" GridPane.rowIndex="10" /> | |
197 | - <Label text="Enabled" GridPane.columnIndex="0" GridPane.rowIndex="11" /> | |
198 | - <CheckBox fx:id="light2EnabledCheckBox" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="11" /> | |
199 | - <Label text="X" GridPane.columnIndex="0" GridPane.rowIndex="13" /> | |
200 | - <Slider fx:id="light2x" majorTickUnit="20.0" max="100.0" min="-100.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="13" /> | |
201 | - <Label text="Y" GridPane.columnIndex="0" GridPane.rowIndex="14" /> | |
202 | - <Slider fx:id="light2y" majorTickUnit="20.0" max="100.0" min="-100.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="14" /> | |
203 | - <Label text="Z" GridPane.columnIndex="0" GridPane.rowIndex="15" /> | |
204 | - <Slider fx:id="light2z" majorTickUnit="20.0" max="100.0" min="-100.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="15" /> | |
205 | - <Label maxWidth="1.7976931348623157E308" styleClass="settings-header" text="Light 3" GridPane.columnIndex="0" GridPane.columnSpan="2" GridPane.hgrow="ALWAYS" GridPane.rowIndex="16" /> | |
206 | - <Label text="Enabled" GridPane.columnIndex="0" GridPane.rowIndex="17" /> | |
207 | - <CheckBox fx:id="light3EnabledCheckBox" mnemonicParsing="false" text="" GridPane.columnIndex="1" GridPane.rowIndex="17" /> | |
208 | - <Label text="Lock to Camera" GridPane.columnIndex="0" GridPane.rowIndex="19" /> | |
209 | - <Slider fx:id="light3x" majorTickUnit="20.0" max="100.0" min="-100.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="19" /> | |
210 | - <Label text="Y" GridPane.columnIndex="0" GridPane.rowIndex="20" /> | |
211 | - <Slider fx:id="light3y" majorTickUnit="20.0" max="100.0" min="-100.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="20" /> | |
212 | - <Label text="Z" GridPane.columnIndex="0" GridPane.rowIndex="21" /> | |
213 | - <Slider fx:id="light3z" majorTickUnit="20.0" max="100.0" min="-100.0" minorTickCount="5" showTickLabels="true" showTickMarks="false" value="0.0" GridPane.columnIndex="1" GridPane.rowIndex="21" /> | |
214 | - <Label text="Color:" GridPane.columnIndex="0" GridPane.rowIndex="12" /> | |
215 | - <ColorPicker fx:id="light2ColorPicker" GridPane.columnIndex="1" GridPane.rowIndex="12" /> | |
216 | - <Label text="Color" GridPane.columnIndex="0" GridPane.rowIndex="18" /> | |
217 | - <ColorPicker fx:id="light3ColorPicker" GridPane.columnIndex="1" GridPane.rowIndex="18" /> | |
218 | - </children> | |
219 | - <columnConstraints> | |
220 | - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | |
221 | - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | |
222 | - </columnConstraints> | |
223 | - <rowConstraints> | |
224 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
225 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
226 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
227 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
228 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
229 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
230 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
231 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
232 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
233 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
234 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
235 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
236 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
237 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
238 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
239 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
240 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
241 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
242 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
243 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
244 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
245 | - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |
246 | - </rowConstraints> | |
247 | - </GridPane> | |
248 | - </content> | |
249 | - </ScrollPane> | |
250 | - </content> | |
251 | - </TitledPane> | |
252 | - <TitledPane fx:id="x1" animated="false" text="Camera"> | |
253 | - <content> | |
254 | - <GridPane hgap="5.0" padding="$x3" styleClass="settings" vgap="5.0"> | |
255 | - <children> | |
256 | - <Label text="Field of view:" GridPane.columnIndex="0" GridPane.rowIndex="0" /> | |
257 | - <Slider fx:id="fovSlider" majorTickUnit="40.0" max="180.0" min="0.0" minorTickCount="4" showTickLabels="true" showTickMarks="true" GridPane.columnIndex="1" GridPane.rowIndex="0" /> | |
258 | - <Label fx:id="nearClipLabel" text="Near clipping pane: %.5f" GridPane.columnIndex="0" GridPane.rowIndex="1" /> | |
259 | - <Slider fx:id="nearClipSlider" majorTickUnit="1" max="5" min="-5" minorTickCount="4" showTickLabels="true" showTickMarks="true" GridPane.columnIndex="1" GridPane.rowIndex="1" /> | |
260 | - <Label fx:id="farClipLabel" text="Far clipping pane: %.5f" GridPane.columnIndex="0" GridPane.rowIndex="2" /> | |
261 | - <Slider fx:id="farClipSlider" majorTickUnit="1" max="5" min="-5" minorTickCount="4" showTickLabels="true" showTickMarks="true" GridPane.columnIndex="1" GridPane.rowIndex="2" /> | |
262 | - </children> | |
263 | - <columnConstraints> | |
264 | - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | |
265 | - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | |
266 | - </columnConstraints> | |
267 | - <rowConstraints> | |
268 | - <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |
269 | - | |
270 | - </rowConstraints> | |
271 | - </GridPane> | |
272 | - </content> | |
273 | - </TitledPane> | |
274 | - <TitledPane animated="false" expanded="true" text="Hierarchy" fx:id="x5"> | |
275 | - <content> | |
276 | - <TreeTableView fx:id="hierarachyTreeTable" editable="true" prefHeight="200.0" prefWidth="200.0"> | |
277 | - <columns> | |
278 | - <TreeTableColumn fx:id="nodeColumn" editable="false" prefWidth="75.0" sortable="false" text="Node" /> | |
279 | - <TreeTableColumn fx:id="idColumn" editable="false" prefWidth="75.0" text="Id" /> | |
280 | - <TreeTableColumn fx:id="visibilityColumn" editable="true" text="Visibility" /> | |
281 | - <TreeTableColumn fx:id="widthColumn" editable="false" text="W" /> | |
282 | - <TreeTableColumn fx:id="heightColumn" editable="false" text="H" /> | |
283 | - <TreeTableColumn fx:id="depthColumn" editable="false" text="D" /> | |
284 | - </columns> | |
285 | - </TreeTableView> | |
286 | - </content> | |
287 | - </TitledPane> | |
288 | - <TitledPane animated="false" expanded="false" text="Transforms" fx:id="x6"> | |
289 | - <content> | |
290 | - <VBox> | |
291 | - <children> | |
292 | - <Label fx:id="selectedNodeLabel"/> | |
293 | - <ListView fx:id="transformsList" prefHeight="200.0" prefWidth="200.0"> | |
294 | - <VBox.vgrow>ALWAYS</VBox.vgrow> | |
295 | - </ListView> | |
296 | - </children> | |
297 | - </VBox> | |
298 | - </content> | |
299 | - </TitledPane> | |
300 | - <TitledPane animated="false" text="Asteroid"> | |
301 | - <content> | |
302 | - <GridPane> | |
303 | - <columnConstraints> | |
304 | - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | |
305 | - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | |
306 | - </columnConstraints> | |
307 | - <rowConstraints> | |
308 | - <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |
309 | - <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |
310 | - <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |
311 | - </rowConstraints> | |
312 | - <children> | |
313 | - <Label text="Asteroid" /> | |
314 | - <HBox prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="1"> | |
315 | - <children> | |
316 | - <ToggleButton mnemonicParsing="false" text="ToggleButton" /> | |
317 | - <ToggleButton layoutX="10.0" layoutY="10.0" mnemonicParsing="false" text="ToggleButton" /> | |
318 | - <ToggleButton layoutX="74.0" layoutY="10.0" mnemonicParsing="false" text="ToggleButton" /> | |
319 | - <ToggleButton layoutX="96.0" layoutY="10.0" mnemonicParsing="false" text="ToggleButton" /> | |
320 | - <ToggleButton layoutX="106.0" layoutY="10.0" mnemonicParsing="false" text="ToggleButton" /> | |
321 | - </children> | |
322 | - </HBox> | |
323 | - </children> | |
324 | - </GridPane> | |
325 | - </content> | |
326 | - </TitledPane> | |
327 | - </panes> | |
328 | -</Accordion> |
@@ -31,22 +31,36 @@ | ||
31 | 31 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
32 | 32 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
33 | 33 | --> |
34 | -<?import java.lang.*?> | |
35 | -<?import java.net.*?> | |
36 | -<?import java.util.*?> | |
37 | -<?import javafx.geometry.*?> | |
38 | -<?import javafx.scene.control.*?> | |
39 | -<?import javafx.scene.control.MenuBar?> | |
40 | -<?import javafx.scene.control.ToolBar?> | |
41 | -<?import javafx.scene.layout.*?> | |
42 | -<?import javafx.scene.paint.*?> | |
43 | -<?import com.javafx.experiments.shape3d.*?> | |
34 | + | |
35 | +<?import javafx.geometry.Insets?> | |
36 | +<?import javafx.scene.control.Accordion?> | |
37 | +<?import javafx.scene.control.CheckBox?> | |
38 | +<?import javafx.scene.control.ColorPicker?> | |
39 | +<?import javafx.scene.control.Label?> | |
40 | +<?import javafx.scene.control.ListView?> | |
41 | +<?import javafx.scene.control.ScrollPane?> | |
42 | +<?import javafx.scene.control.Slider?> | |
43 | +<?import javafx.scene.control.TextField?> | |
44 | +<?import javafx.scene.control.TitledPane?> | |
45 | +<?import javafx.scene.control.ToggleButton?> | |
46 | +<?import javafx.scene.control.ToggleGroup?> | |
47 | +<?import javafx.scene.control.Tooltip?> | |
48 | +<?import javafx.scene.control.TreeTableColumn?> | |
49 | +<?import javafx.scene.control.TreeTableView?> | |
50 | +<?import javafx.scene.layout.AnchorPane?> | |
51 | +<?import javafx.scene.layout.ColumnConstraints?> | |
52 | +<?import javafx.scene.layout.GridPane?> | |
53 | +<?import javafx.scene.layout.HBox?> | |
54 | +<?import javafx.scene.layout.Region?> | |
55 | +<?import javafx.scene.layout.RowConstraints?> | |
56 | +<?import javafx.scene.layout.VBox?> | |
44 | 57 | <?scenebuilder-stylesheet viewer.css?> |
58 | + | |
45 | 59 | <!--suppress JavaFxUnresolvedStyleClassReference --> |
46 | 60 | |
47 | 61 | <Accordion fx:id="settings" minWidth="0.0" prefHeight="798.0" prefWidth="279.0" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.javafx.experiments.jfx3dviewer.SettingsController"> |
48 | 62 | <panes> |
49 | - <TitledPane fx:id="x4" animated="false" expanded="false" text="Options"> | |
63 | + <TitledPane animated="false" expanded="false" text="Options" fx:id="x4"> | |
50 | 64 | <content> |
51 | 65 | <GridPane hgap="5.0" styleClass="settings" vgap="5.0"> |
52 | 66 | <children> |
@@ -73,6 +87,52 @@ | ||
73 | 87 | <ToggleButton mnemonicParsing="false" styleClass="right-pill" text="3" toggleGroup="$subdivisionLevelGroup" userData="3" /> |
74 | 88 | </children> |
75 | 89 | </HBox> |
90 | + <Label text="Creases (Boundary Rules)" GridPane.columnIndex="0" GridPane.rowIndex="6" /> | |
91 | + <HBox prefHeight="-1.0" prefWidth="-1.0" GridPane.columnIndex="1" GridPane.rowIndex="6"> | |
92 | + <children> | |
93 | + <ToggleButton mnemonicParsing="false" selected="true" styleClass="left-pill" text="Edges"> | |
94 | + <toggleGroup> | |
95 | + <ToggleGroup fx:id="subdivisionBoundaryGroup" /> | |
96 | + </toggleGroup> | |
97 | + | |
98 | + <tooltip> | |
99 | + <Tooltip text="Only edges at the boundary are treated as creases" /> | |
100 | + </tooltip> | |
101 | + </ToggleButton> | |
102 | + <ToggleButton mnemonicParsing="false" styleClass="right-pill" text="All" toggleGroup="$subdivisionBoundaryGroup"> | |
103 | + | |
104 | + <tooltip> | |
105 | + <Tooltip text="Edges and points at the boundary are treated as creases" /> | |
106 | + </tooltip> | |
107 | + </ToggleButton> | |
108 | + </children> | |
109 | + </HBox> | |
110 | + <Label text="Smooth Texture Map" GridPane.columnIndex="0" GridPane.rowIndex="7" /> | |
111 | + <HBox prefHeight="-1.0" prefWidth="-1.0" GridPane.columnIndex="1" GridPane.rowIndex="7"> | |
112 | + <children> | |
113 | + <ToggleButton mnemonicParsing="false" selected="true" styleClass="left-pill" text="None"> | |
114 | + <toggleGroup> | |
115 | + <ToggleGroup fx:id="subdivisionSmoothGroup" /> | |
116 | + </toggleGroup> | |
117 | + | |
118 | + <tooltip> | |
119 | + <Tooltip text="Keeps the same uvs for all control points" /> | |
120 | + </tooltip> | |
121 | + </ToggleButton> | |
122 | + <ToggleButton mnemonicParsing="false" styleClass="center-pill" text="Internal" toggleGroup="$subdivisionSmoothGroup"> | |
123 | + | |
124 | + <tooltip> | |
125 | + <Tooltip text="Smooths uvs of points at corners" /> | |
126 | + </tooltip> | |
127 | + </ToggleButton> | |
128 | + <ToggleButton mnemonicParsing="false" styleClass="right-pill" text="All" toggleGroup="$subdivisionSmoothGroup"> | |
129 | + | |
130 | + <tooltip> | |
131 | + <Tooltip text="Smooths uvs of points at boundaries" /> | |
132 | + </tooltip> | |
133 | + </ToggleButton> | |
134 | + </children> | |
135 | + </HBox> | |
76 | 136 | <Region maxHeight="1.7976931348623157E308" prefHeight="-1.0" prefWidth="-1.0" GridPane.columnIndex="0" GridPane.rowIndex="8" /> |
77 | 137 | </children> |
78 | 138 | <columnConstraints> |
@@ -96,7 +156,7 @@ | ||
96 | 156 | </GridPane> |
97 | 157 | </content> |
98 | 158 | </TitledPane> |
99 | - <TitledPane fx:id="x2" animated="false" text="Lights"> | |
159 | + <TitledPane animated="false" text="Lights" fx:id="x2"> | |
100 | 160 | <content> |
101 | 161 | <ScrollPane fitToWidth="true" prefHeight="200.0" prefWidth="200.0"> |
102 | 162 | <content> |
@@ -176,12 +236,12 @@ | ||
176 | 236 | </ScrollPane> |
177 | 237 | </content> |
178 | 238 | </TitledPane> |
179 | - <TitledPane fx:id="x1" animated="false" text="Camera"> | |
239 | + <TitledPane animated="false" text="Camera" fx:id="x1"> | |
180 | 240 | <content> |
181 | 241 | <GridPane hgap="5.0" padding="$x3" styleClass="settings" vgap="5.0"> |
182 | 242 | <children> |
183 | 243 | <Label text="Field of view:" GridPane.columnIndex="0" GridPane.rowIndex="0" /> |
184 | - <Slider fx:id="fovSlider" majorTickUnit="40.0" max="180.0" min="0.0" minorTickCount="4" showTickLabels="true" showTickMarks="true" GridPane.columnIndex="1" GridPane.rowIndex="0" /> | |
244 | + <Slider fx:id="fovSlider" majorTickUnit="40.0" max="180.0" min="0.0" minorTickCount="4" showTickLabels="true" showTickMarks="true" GridPane.columnIndex="1" GridPane.rowIndex="0" value="90" /> | |
185 | 245 | <Label fx:id="nearClipLabel" text="Near clipping pane: %.5f" GridPane.columnIndex="0" GridPane.rowIndex="1" /> |
186 | 246 | <Slider fx:id="nearClipSlider" majorTickUnit="1" max="5" min="-5" minorTickCount="4" showTickLabels="true" showTickMarks="true" GridPane.columnIndex="1" GridPane.rowIndex="1" /> |
187 | 247 | <Label fx:id="farClipLabel" text="Far clipping pane: %.5f" GridPane.columnIndex="0" GridPane.rowIndex="2" /> |
@@ -241,19 +301,78 @@ | ||
241 | 301 | <Label text="Asteroid" /> |
242 | 302 | <HBox prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="1"> |
243 | 303 | <children> |
244 | - <ToggleButton mnemonicParsing="false" selected="true" text="1"> | |
304 | + <ToggleButton fx:id="asteroid1Toggle" mnemonicParsing="false" selected="true" text="1"> | |
245 | 305 | <toggleGroup> |
246 | 306 | <ToggleGroup fx:id="asteroidGroup" /> |
247 | 307 | </toggleGroup></ToggleButton> |
248 | - <ToggleButton layoutX="10.0" layoutY="10.0" mnemonicParsing="false" text="2" /> | |
249 | - <ToggleButton layoutX="74.0" layoutY="10.0" mnemonicParsing="false" text="3" toggleGroup="$asteroidGroup" /> | |
250 | - <ToggleButton layoutX="96.0" layoutY="10.0" mnemonicParsing="false" text="4" toggleGroup="$asteroidGroup" /> | |
251 | - <ToggleButton layoutX="106.0" layoutY="10.0" mnemonicParsing="false" text="5" toggleGroup="$asteroidGroup" /> | |
308 | + <ToggleButton fx:id="asteroid2Toggle" layoutX="10.0" layoutY="10.0" mnemonicParsing="false" text="2" /> | |
309 | + <ToggleButton fx:id="ateroid3Toggle" layoutX="74.0" layoutY="10.0" mnemonicParsing="false" text="3" toggleGroup="$asteroidGroup" /> | |
310 | + <ToggleButton fx:id="asteroid4Toggle" layoutX="96.0" layoutY="10.0" mnemonicParsing="false" text="4" toggleGroup="$asteroidGroup" /> | |
311 | + <ToggleButton fx:id="asteroid5Toggle" layoutX="106.0" layoutY="10.0" mnemonicParsing="false" text="5" toggleGroup="$asteroidGroup" /> | |
252 | 312 | </children> |
253 | 313 | </HBox> |
254 | 314 | </children> |
255 | 315 | </GridPane> |
256 | 316 | </content> |
257 | 317 | </TitledPane> |
318 | + <TitledPane animated="false" text="Modifiers"> | |
319 | + <content> | |
320 | + <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0"> | |
321 | + <children> | |
322 | + <GridPane layoutX="24.0" layoutY="17.0" prefHeight="73.0" prefWidth="220.0"> | |
323 | + <columnConstraints> | |
324 | + <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | |
325 | + </columnConstraints> | |
326 | + <rowConstraints> | |
327 | + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |
328 | + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |
329 | + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |
330 | + </rowConstraints> | |
331 | + <children> | |
332 | + <HBox prefHeight="100.0" prefWidth="200.0"> | |
333 | + <children> | |
334 | + <ToggleButton fx:id="translationButton" mnemonicParsing="false" selected="true" text="Translation"> | |
335 | + <toggleGroup> | |
336 | + <ToggleGroup fx:id="modifiersGroup" /> | |
337 | + </toggleGroup> | |
338 | + </ToggleButton> | |
339 | + <ToggleButton fx:id="rotationButton" mnemonicParsing="false" text="Rotation" toggleGroup="$modifiersGroup" /> | |
340 | + <ToggleButton fx:id="scalingButton" mnemonicParsing="false" text="Scaling" toggleGroup="$modifiersGroup" /> | |
341 | + </children> | |
342 | + </HBox> | |
343 | + </children> | |
344 | + </GridPane> | |
345 | + <VBox layoutX="24.0" layoutY="43.0" prefHeight="200.0" prefWidth="234.0"> | |
346 | + <children> | |
347 | + <HBox prefHeight="100.0" prefWidth="200.0"> | |
348 | + <children> | |
349 | + <Label text="Pos" /> | |
350 | + <TextField prefHeight="26.0" prefWidth="58.0" fx:id="xPosTextField" /> | |
351 | + <TextField fx:id="yPosTextField" layoutX="31.0" layoutY="10.0" prefHeight="26.0" prefWidth="58.0" /> | |
352 | + <TextField fx:id="zPosTextField" layoutX="89.0" layoutY="10.0" prefHeight="26.0" prefWidth="58.0" /> | |
353 | + </children> | |
354 | + </HBox> | |
355 | + <HBox prefHeight="100.0" prefWidth="200.0"> | |
356 | + <children> | |
357 | + <Label text="Rot" /> | |
358 | + <TextField prefHeight="26.0" prefWidth="60.0" fx:id="xRotTextField" /> | |
359 | + <TextField fx:id="yRotTextField" layoutX="29.0" layoutY="10.0" prefHeight="26.0" prefWidth="60.0" /> | |
360 | + <TextField fx:id="zRotTextField" layoutX="89.0" layoutY="10.0" prefHeight="26.0" prefWidth="60.0" /> | |
361 | + </children> | |
362 | + </HBox> | |
363 | + <HBox prefHeight="100.0" prefWidth="200.0"> | |
364 | + <children> | |
365 | + <Label text="Scl" /> | |
366 | + <TextField prefHeight="26.0" prefWidth="62.0" fx:id="xSclTextField" /> | |
367 | + <TextField fx:id="ySclTextField" layoutX="27.0" layoutY="10.0" prefHeight="26.0" prefWidth="62.0" /> | |
368 | + <TextField fx:id="zSclTextField" layoutX="89.0" layoutY="10.0" prefHeight="26.0" prefWidth="62.0" /> | |
369 | + </children> | |
370 | + </HBox> | |
371 | + </children> | |
372 | + </VBox> | |
373 | + </children> | |
374 | + </AnchorPane> | |
375 | + </content> | |
376 | + </TitledPane> | |
258 | 377 | </panes> |
259 | 378 | </Accordion> |