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
b525cd91
Commit
b525cd91
authored
Oct 14, 2019
by
Benedikt Kleinmeier
Browse files
Merge branch 'master' into tukl_cooperation
parents
dec5690e
ae1a4492
Changes
6
Hide whitespace changes
Inline
Side-by-side
VadereGui/src/org/vadere/gui/postvisualization/control/ActionSetTimeStep.java
View file @
b525cd91
...
...
@@ -42,10 +42,9 @@ public class ActionSetTimeStep extends ActionVisualization implements ChangeList
@Override
public
void
stateChanged
(
final
ChangeEvent
event
)
{
JSlider
source
=
(
JSlider
)
event
.
getSource
();
if
(!
source
.
getValueIsAdjusting
())
{
model
.
setStep
(
source
.
getValue
());
model
.
notifyObservers
();
}
JSlider
slider
=
(
JSlider
)
event
.
getSource
();
model
.
setStep
(
slider
.
getValue
());
model
.
notifyObservers
();
}
}
VadereGui/src/org/vadere/gui/postvisualization/control/EJSliderAction.java
View file @
b525cd91
...
...
@@ -20,23 +20,17 @@ public class EJSliderAction implements MouseListener {
@Override
public
void
mousePressed
(
final
MouseEvent
e
)
{
setSliderValue
(
e
);
}
@Override
public
void
mouseReleased
(
final
MouseEvent
e
)
{
Point
p
=
e
.
getPoint
();
double
percent
=
p
.
x
/
((
double
)
slider
.
getWidth
());
int
range
=
slider
.
getMaximum
()
-
slider
.
getMinimum
();
double
newVal
=
range
*
percent
;
int
result
=
(
int
)
(
Math
.
ceil
(
slider
.
getMinimum
()
+
newVal
));
// logger.info("change to step: " + Thread.currentThread().getName() + (result+1));
slider
.
setValue
(
result
);
setSliderValue
(
e
);
}
@Override
public
void
mouseClicked
(
MouseEvent
e
)
{
setSliderValue
(
e
);
}
@Override
...
...
@@ -48,4 +42,14 @@ public class EJSliderAction implements MouseListener {
public
void
mouseExited
(
MouseEvent
e
)
{
}
private
void
setSliderValue
(
MouseEvent
e
)
{
Point
sliderPosition
=
e
.
getPoint
();
double
percent
=
sliderPosition
.
x
/
((
double
)
slider
.
getWidth
());
int
sliderRange
=
slider
.
getMaximum
()
-
slider
.
getMinimum
();
double
newValue
=
sliderRange
*
percent
;
int
result
=
(
int
)
(
Math
.
ceil
(
slider
.
getMinimum
()
+
newValue
));
slider
.
setValue
(
result
);
}
}
VadereMeshing/src/org/vadere/meshing/examples/EikMeshPlots.java
View file @
b525cd91
...
...
@@ -61,7 +61,7 @@ public class EikMeshPlots {
//roomLFS();
//cornerLFS();
uniformRing
(
0.3
);
//
uniformRing(0.3);
}
public
static
void
randomDelaunay
()
throws
IOException
{
...
...
VadereMeshing/src/org/vadere/meshing/examples/EikMeshPoly.java
View file @
b525cd91
...
...
@@ -35,8 +35,8 @@ public class EikMeshPoly {
//meshPoly("/poly/bridge.poly");
//meshPoly("/poly/room.poly");
//meshPoly("/poly/corner.poly");
//
meshPoly("/poly/railing.poly");
displayPolyFile
(
"/poly/muenchner_freiheit.poly"
);
meshPoly
(
"/poly/railing.poly"
);
//
displayPolyFile("/poly/muenchner_freiheit.poly");
}
public
static
void
meshPoly
(
@NotNull
final
String
fileName
)
throws
IOException
,
InterruptedException
{
...
...
VadereMeshing/src/org/vadere/meshing/mesh/triangulation/improver/eikmesh/gen/GenEikMesh.java
View file @
b525cd91
...
...
@@ -698,7 +698,7 @@ public class GenEikMesh<V extends IVertex, E extends IHalfEdge, F extends IFace>
}
private
boolean
isSlidePoint
(
@NotNull
V
vertex
)
{
return
getMesh
().
isAtBoundary
(
vertex
)
&&
!
isFixPoint
(
vertex
);
return
getMesh
().
isAtBoundary
(
vertex
)
&&
!
isFixPoint
(
vertex
)
&&
boundaryPointToLine
.
containsKey
(
vertex
)
;
}
/**
...
...
VadereSimulator/tests/org/vadere/simulator/models/potential/solver/TestFMMEikMesh.java
View file @
b525cd91
...
...
@@ -10,6 +10,7 @@ import org.vadere.meshing.mesh.gen.PMesh;
import
org.vadere.meshing.mesh.gen.PVertex
;
import
org.vadere.meshing.mesh.inter.IIncrementalTriangulation
;
import
org.vadere.meshing.utils.io.poly.MeshPolyReader
;
import
org.vadere.meshing.utils.io.poly.MeshPolyWriter
;
import
org.vadere.simulator.models.potential.solver.calculators.EikonalSolver
;
import
org.vadere.simulator.models.potential.solver.calculators.mesh.EikonalSolverFMMTriangulation
;
import
org.vadere.simulator.models.potential.solver.timecost.UnitTimeCostFunction
;
...
...
@@ -27,8 +28,8 @@ public class TestFMMEikMesh {
@Test
public
void
testTriangulationFMM
()
throws
IOException
{
final
InputStream
inputStream
=
MeshExamples
.
class
.
getResourceAsStream
(
"/poly/muenchner_freiheit.poly"
);
MeshPolyReader
<
PVertex
,
PHalfEdge
,
PFace
>
mesh
PolyWrit
er
=
new
MeshPolyReader
<>(()
->
new
PMesh
());
var
mesh
=
mesh
PolyWrit
er
.
readMesh
(
inputStream
);
MeshPolyReader
<
PVertex
,
PHalfEdge
,
PFace
>
mesh
Read
er
=
new
MeshPolyReader
<>(()
->
new
PMesh
());
var
mesh
=
mesh
Read
er
.
readMesh
(
inputStream
);
IIncrementalTriangulation
<
PVertex
,
PHalfEdge
,
PFace
>
triangulation
=
new
IncrementalTriangulation
<>(
mesh
);
...
...
@@ -50,6 +51,10 @@ public class TestFMMEikMesh {
log
.
info
(
"FFM finished"
);
log
.
info
(
"time: "
+
(
System
.
currentTimeMillis
()
-
ms
));
System
.
out
.
println
(
mesh
.
toPythonTriangulation
(
v
->
triangulation
.
getMesh
().
getDoubleData
(
v
,
"potential"
)));
MeshPolyWriter
<
PVertex
,
PHalfEdge
,
PFace
>
meshPolyWriter
=
new
MeshPolyWriter
<>();
System
.
out
.
println
(
meshPolyWriter
.
to2DPoly
(
triangulation
.
getMesh
(),
1
,
i
->
"potential"
,
v
->
false
));
//System.out.println(mesh.toPythonTriangulation(v -> triangulation.getMesh().getDoubleData(v, "potential")));
}
}
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