Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
8077e613
Commit
8077e613
authored
Dec 15, 2016
by
Jakob Schöttl
Browse files
Simplify code
parent
b90c9ffb
Changes
3
Hide whitespace changes
Inline
Side-by-side
VadereGui/src/org/vadere/gui/topographycreator/model/TopographyCreatorModel.java
View file @
8077e613
...
...
@@ -331,9 +331,9 @@ public class TopographyCreatorModel extends DefaultModel implements IDrawPanelMo
}
@Override
public
VShape
translateElement
(
ScenarioElement
element
ToCopy
,
VPoint
vector
)
{
public
VShape
translateElement
(
ScenarioElement
element
,
VPoint
vector
)
{
// double factor = Math.max(10,1/getGridResulution()); // ?? related to scaleTopography?
return
element
ToCopy
.
getShape
().
translatePrecise
(
alignToGrid
(
vector
));
return
element
.
getShape
().
translatePrecise
(
alignToGrid
(
vector
));
}
@Override
...
...
VadereUtils/src/org/vadere/util/geometry/shapes/VCircle.java
View file @
8077e613
...
...
@@ -6,7 +6,6 @@ import java.awt.geom.Ellipse2D;
import
java.awt.geom.PathIterator
;
import
java.awt.geom.Point2D
;
import
java.awt.geom.Rectangle2D
;
import
java.math.BigDecimal
;
import
org.vadere.util.geometry.ShapeType
;
import
org.vadere.util.geometry.Vector2D
;
...
...
VadereUtils/src/org/vadere/util/geometry/shapes/VRing.java
View file @
8077e613
...
...
@@ -10,9 +10,6 @@ import java.util.List;
import
org.vadere.util.geometry.ShapeType
;
import
com.vividsolutions.jts.geomgraph.Edge
;
import
com.vividsolutions.jts.geomgraph.index.EdgeSetIntersector
;
/**
* A ring consists of two circles of different size.
*
...
...
@@ -30,12 +27,6 @@ public class VRing implements VShape {
this
(
new
VPoint
(
0
,
0
),
radius1
,
radius2
);
}
private
VRing
(
VRing
ring
)
{
this
.
center
=
ring
.
center
;
this
.
radiusInnerCircle
=
ring
.
radiusInnerCircle
;
this
.
radiusOuterCircle
=
ring
.
radiusOuterCircle
;
}
public
VRing
(
VPoint
center
,
double
radius1
,
double
radius2
)
{
if
(
radius1
<=
0
||
radius2
<=
0
)
{
throw
new
IllegalArgumentException
(
"Radius must be positive."
);
...
...
@@ -87,6 +78,7 @@ public class VRing implements VShape {
}
@Override
// TODO not implemented, not tested!
public
boolean
contains
(
double
x
,
double
y
,
double
w
,
double
h
)
{
return
contains
(
new
VRectangle
(
x
,
y
,
w
,
h
));
...
...
@@ -116,7 +108,7 @@ public class VRing implements VShape {
}
private
List
<
VPoint
>
normalizePointsToCenter
(
List
<
VPoint
>
points
)
{
List
<
VPoint
>
normalizedPoints
=
new
ArrayList
<
VPoint
>();
List
<
VPoint
>
normalizedPoints
=
new
ArrayList
<>();
for
(
VPoint
point
:
points
)
{
VPoint
normalizedPoint
=
new
VPoint
(
point
.
x
-
center
.
x
,
point
.
y
-
center
.
y
);
...
...
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