Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
76f34f51
Commit
76f34f51
authored
4 months ago
by
Riegel
Browse files
Options
Download
Email Patches
Plain Diff
Add NorthArrow in MeshView
parent
2ed18e2e
master
107-opengl-view
dev
dev_cpp_code_conversion
dev_gui_features
dev_gui_features_zip_loading
3.16.0
archive/dev_gui_features_zip_loading
archive/dev_citygml3
2 merge requests
!11
CityDoctor Release Version 3.16.0
,
!10
CityGML 3.0. Support
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
+2
-0
...e/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/MainWindow.java
+24
-1
...ain/java/de/hft/stuttgart/citydoctor2/gui/MainWindow.java
CityDoctorParent/Extensions/CityDoctorGUI/src/main/resources/de/hft/stuttgart/citydoctor2/gui/icons/north.png
+0
-0
...esources/de/hft/stuttgart/citydoctor2/gui/icons/north.png
with
26 additions
and
1 deletion
+26
-1
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
+
2
-
0
View file @
76f34f51
...
...
@@ -137,6 +137,8 @@ public class CityDoctorController {
mainWindow
.
getLod4Btn
().
setDisable
(
false
);
mainWindow
.
getWorldBtn
().
setDisable
(
false
);
mainWindow
.
getSaveBtn
().
setDisable
(
false
);
mainWindow
.
getNorthArrow
().
setVisible
(
true
);
mainWindow
.
alignNorthArrow
();
setupFeatureTabs
();
buildTrees
();
});
...
...
This diff is collapsed.
Click to expand it.
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/MainWindow.java
+
24
-
1
View file @
76f34f51
...
...
@@ -12,6 +12,7 @@ import java.util.TimerTask;
import
javax.imageio.ImageIO
;
import
javafx.scene.chart.NumberAxis
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
...
...
@@ -268,6 +269,7 @@ public class MainWindow extends Application {
private
MainToolBar
mainToolBar
;
private
SubScene
geomScene
;
private
ImageView
northArrow
;
private
static
boolean
loadFileAtStartup
=
false
;
private
static
String
inputFile
;
...
...
@@ -856,9 +858,15 @@ public class MainWindow extends Application {
meshGroup
=
new
Group
();
world
.
getChildren
().
add
(
meshGroup
);
Image
north
=
new
Image
(
getClass
().
getResourceAsStream
(
"icons/north.png"
));
northArrow
=
new
ImageView
(
north
);
northArrow
.
setFitHeight
(
50
);
northArrow
.
setFitWidth
(
50
);
meshView
.
getChildren
().
add
(
northArrow
);
northArrow
.
setVisible
(
false
);
AmbientLight
al
=
new
AmbientLight
(
Color
.
WHITE
);
root
.
getChildren
().
add
(
al
);
buildCamera
();
cameraXRotation
.
setAxis
(
Rotate
.
X_AXIS
);
cameraZRotation
.
setAxis
(
Rotate
.
Z_AXIS
);
...
...
@@ -904,6 +912,7 @@ public class MainWindow extends Application {
cameraZRotation
.
setAngle
(
cameraXRot
);
cameraXRotation
.
setAngle
(
cameraYRot
);
alignNorthArrow
();
}
if
(
me
.
getButton
()
==
MouseButton
.
SECONDARY
)
{
double
translationSpeed
=
Math
.
abs
(
camera
.
getTranslateZ
())/
1000
;
...
...
@@ -927,6 +936,16 @@ public class MainWindow extends Application {
cameraXRotation
.
setAngle
(
cameraYRot
);
}
public
void
alignNorthArrow
(){
double
absRotZ
=
cameraZRotation
.
getAngle
()
-
360
*
Math
.
floor
(
cameraZRotation
.
getAngle
()
/
360
);
double
absRotX
=
cameraXRotation
.
getAngle
()
-
360
*
Math
.
floor
(
cameraXRotation
.
getAngle
()
/
360
);
double
northRot
=
((
80
<=
absRotX
&&
absRotX
<=
260
)
?
360
-
absRotZ:
(
absRotZ
+
180
)%
360
);
northArrow
.
setRotate
(
northRot
);
}
public
void
addFileNameToTitle
(
String
fileName
)
{
String
version
=
Localization
.
getText
(
Localization
.
VERSION
);
stage
.
setTitle
(
"CityDoctor "
+
version
+
" - "
+
fileName
);
...
...
@@ -1044,6 +1063,10 @@ public class MainWindow extends Application {
return
mainToolBar
.
getWorldBtn
();
}
public
ImageView
getNorthArrow
(){
return
northArrow
;
}
public
Button
getSaveBtn
()
{
return
mainToolBar
.
getSaveBtn
();
}
...
...
This diff is collapsed.
Click to expand it.
CityDoctorParent/Extensions/CityDoctorGUI/src/main/resources/de/hft/stuttgart/citydoctor2/gui/icons/north.png
0 → 100644
+
0
-
0
View file @
76f34f51
2.03 KB
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets