Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Instrument Control
Protos
Nomad 3D
nomad-3d-commons
Commits
ed090b33
Commit
ed090b33
authored
Jul 05, 2017
by
Ivan Dages
Browse files
component subdivision
parent
d9a5fdb0
Changes
2
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
ed090b33
...
...
@@ -37,7 +37,7 @@
<url>
https://maven.ill.fr/content/repositories/eclipse
</url>
</repository>
</repositories>
<profiles>
<profile>
<id>
jzmq
</id>
...
...
@@ -85,6 +85,13 @@
<version>
1.11
</version>
<type>
jar
</type>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>
commons-io
</groupId>
<artifactId>
commons-io
</artifactId>
<version>
2.5
</version>
</dependency>
</dependencies>
<build>
...
...
src/main/java/fr/ill/ics/n3d/model/Model.java
View file @
ed090b33
...
...
@@ -234,7 +234,7 @@ public class Model {
* @param visualizeAxes true to activate
*/
public
void
setVisualizeAxes
(
boolean
visualizeAxes
)
{
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Setting axes visualization "
+
((
visualizeAxes
)
?
"ON"
:
"OFF"
)
+
"\n"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Setting axes visualization "
+
((
visualizeAxes
)
?
"ON"
:
"OFF"
));
this
.
visualizeAxes
=
visualizeAxes
;
updateVisualAxes
();
}
...
...
@@ -255,7 +255,7 @@ public class Model {
* @return true if the component was not in the selection already
*/
public
boolean
addToSelection
(
Component
c
)
{
Logger
.
getLogger
(
"nomad-3d"
).
fine
(
"Adding component \""
+
c
.
getName
()
+
"\" to selection...
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
fine
(
"Adding component \""
+
c
.
getName
()
+
"\" to selection..."
);
if
(
c
.
isLeaf
())
{
MeshView
meshView
=
(
MeshView
)
c
.
getSceneNode
();
meshView
.
setMaterial
(
SELECTED_MATERIAL
);
...
...
@@ -265,7 +265,7 @@ public class Model {
}
c
.
visibleAxis
(
this
.
visualizeAxes
);
boolean
res
=
this
.
selection
.
add
(
c
);
Logger
.
getLogger
(
"nomad-3d"
).
fine
(
"Component added.
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
fine
(
"Component added."
);
return
res
;
}
...
...
@@ -275,7 +275,7 @@ public class Model {
* @return true if the selection contained the component
*/
public
boolean
removeFromSelection
(
Component
c
)
{
Logger
.
getLogger
(
"nomad-3d"
).
fine
(
"Removing component \""
+
c
.
getName
()
+
"\" from selection...
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
fine
(
"Removing component \""
+
c
.
getName
()
+
"\" from selection..."
);
if
(
c
.
isLeaf
())
{
MeshView
meshView
=
(
MeshView
)
c
.
getSceneNode
();
meshView
.
setMaterial
(
c
.
getMaterial
());
...
...
@@ -285,7 +285,7 @@ public class Model {
}
c
.
visibleAxis
(
false
);
boolean
res
=
this
.
selection
.
remove
(
c
);
Logger
.
getLogger
(
"nomad-3d"
).
fine
(
"Component removed.
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
fine
(
"Component removed."
);
return
res
;
}
...
...
@@ -293,33 +293,33 @@ public class Model {
* Clears the selection.
*/
public
void
clearSelection
()
{
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Clearing selection of the model \""
+
this
.
name
+
"\"...
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Clearing selection of the model \""
+
this
.
name
+
"\"..."
);
for
(
Component
comp
:
this
.
selection
)
{
removeFromSelection
(
comp
);
}
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Selection cleared.
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Selection cleared."
);
}
/**
* Selects all the components of the model.
*/
public
void
selectAll
()
{
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Selecting all components of the model \""
+
this
.
name
+
"\"...
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Selecting all components of the model \""
+
this
.
name
+
"\"..."
);
this
.
root
.
setSelected
(
true
,
this
,
true
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"All components selected.
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"All components selected."
);
}
/**
* Clears the model.
*/
public
void
clear
()
{
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Clearing model \""
+
this
.
name
+
"\"...
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Clearing model \""
+
this
.
name
+
"\"..."
);
this
.
root
=
null
;
this
.
name
=
""
;
this
.
directoryPath
=
""
;
this
.
selection
.
clear
();
this
.
visualizeAxes
=
true
;
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Model cleared.
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Model cleared."
);
}
/**
...
...
@@ -334,22 +334,22 @@ public class Model {
* @param lod Level of detail of the components geometries
*/
public
void
computeSceneHierarchies
(
int
lod
)
{
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Computing tree view of the model \""
+
this
.
name
+
"\"...
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Computing tree view of the model \""
+
this
.
name
+
"\"..."
);
this
.
root
.
toTreeItem
(
this
);
// must be done before computing scene hierarchy
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Tree view computed.
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Computing 3D scene graph of the model \""
+
this
.
name
+
"\"...
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Tree view computed."
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Computing 3D scene graph of the model \""
+
this
.
name
+
"\"..."
);
this
.
root
.
computeSceneHierarchy
(
this
,
lod
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Scene graph computed.
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Scene graph computed."
);
}
/**
* Computes the axes of the model.
*/
public
void
computeAxes
()
{
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Computing axes of the model \""
+
this
.
name
+
"\"...
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Computing axes of the model \""
+
this
.
name
+
"\"..."
);
this
.
selection
.
clear
();
this
.
root
.
computeAxes
();
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Axes computed.
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Axes computed."
);
if
(
this
.
state
!=
State
.
EXPORTED
)
{
computeSceneHierarchies
();
...
...
@@ -361,9 +361,9 @@ public class Model {
* @return true if the analysis is successful, false in case of errors
*/
public
boolean
analyzeConfigurations
()
{
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Analyzing configurations of the model \""
+
this
.
name
+
"\"...
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Analyzing configurations of the model \""
+
this
.
name
+
"\"..."
);
boolean
res
=
this
.
root
.
configurationsAnalysis
();
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Configurations analyzed.
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Configurations analyzed."
);
return
res
;
}
...
...
@@ -372,19 +372,19 @@ public class Model {
* @param configName Name of the configuration
*/
public
void
showConfiguration
(
String
configName
)
{
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Showing configuration \""
+
configName
+
"\" of the model \""
+
this
.
name
+
"\"...
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Showing configuration \""
+
configName
+
"\" of the model \""
+
this
.
name
+
"\"..."
);
this
.
root
.
resetAxisTransform
(
true
);
this
.
root
.
showConfiguration
(
configName
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Configuration shown.
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Configuration shown."
);
}
/**
* Resets the movement of every component along its axis.
*/
public
void
resetMovement
()
{
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Reseting movement of the model \""
+
this
.
name
+
"\"...
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Reseting movement of the model \""
+
this
.
name
+
"\"..."
);
this
.
root
.
resetAxisTransform
(
true
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Movement reset.
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Movement reset."
);
}
@Override
...
...
@@ -401,8 +401,8 @@ public class Model {
* Updates the visual axes for all configurations.
*/
private
void
updateVisualAxes
()
{
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Updating visual axes of the model \""
+
this
.
name
+
"\"...
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Updating visual axes of the model \""
+
this
.
name
+
"\"..."
);
this
.
root
.
updateVisualAxes
(
this
.
selection
,
this
.
visualizeAxes
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Visual axes updated.
\n
"
);
Logger
.
getLogger
(
"nomad-3d"
).
info
(
"Visual axes updated."
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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