Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
We have upgraded GitLab to 15.1. Due to major code changes GitLab was down for some time.
Open sidebar
vadere
vadere
Commits
939c6119
Commit
939c6119
authored
Jul 02, 2018
by
Daniel Lehmberg
Browse files
[WIP] Example: Stairs with new attribute in ScenarioElement
parent
2530cd7e
Pipeline
#59448
failed with stage
in 21 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
VadereState/src/org/vadere/state/scenario/Stairs.java
View file @
939c6119
...
...
@@ -5,6 +5,7 @@ import java.awt.geom.Path2D;
import
java.awt.geom.PathIterator
;
import
java.awt.geom.Rectangle2D
;
import
org.vadere.state.attributes.Attributes
;
import
org.vadere.state.attributes.scenario.AttributesStairs
;
import
org.vadere.state.types.ScenarioElementType
;
import
org.vadere.util.geometry.shapes.VLine
;
...
...
@@ -22,17 +23,15 @@ public class Stairs extends ScenarioElement {
}
}
private
final
AttributesStairs
attributes
;
private
final
Tread
[]
treads
;
private
AttributesStairs
attributes
;
private
Tread
[]
treads
;
private
double
treadDepth
;
public
Stairs
(
AttributesStairs
attributes
)
{
this
.
attributes
=
attributes
;
treads
=
initializeTreads
();
setAttributes
(
attributes
);
}
private
Tread
[]
initializ
eTreads
()
{
private
Tread
[]
comput
eTreads
()
{
// tread count + 2 since the first and last treads must be placed outside of the shape and
// on the next floor.
Tread
[]
treadsResult
=
new
Tread
[
this
.
getAttributes
().
getTreadCount
()
+
2
];
...
...
@@ -73,6 +72,12 @@ public class Stairs extends ScenarioElement {
return
treadsResult
;
}
@Override
public
void
setAttributes
(
Attributes
attributes
)
{
this
.
attributes
=
(
AttributesStairs
)
attributes
;
treads
=
computeTreads
();
}
@Override
public
void
setShape
(
VShape
newShape
)
{
attributes
.
setShape
(
newShape
);
...
...
Write
Preview
Supports
Markdown
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