Change trajectory package

This commit is contained in:
Alexander Nozik 2023-04-16 20:50:51 +03:00
parent 3fc52dd60f
commit cdaa17a3b9
18 changed files with 30 additions and 40 deletions

View File

@ -10,7 +10,7 @@ val kmathVersion: String by extra("0.3.1-dev-RC")
allprojects { allprojects {
group = "center.sciprog" group = "center.sciprog"
version = "0.2.2-dev-11" version = "0.2.2-dev-12"
repositories { repositories {
mavenLocal() mavenLocal()

View File

@ -9,9 +9,7 @@ val ktorVersion: String by rootProject.extra
kotlin { kotlin {
jvmToolchain(11) jvmToolchain(11)
jvm { jvm()
withJava()
}
sourceSets { sourceSets {
val jvmMain by getting { val jvmMain by getting {
dependencies { dependencies {

View File

@ -8,12 +8,8 @@ plugins {
val ktorVersion: String by rootProject.extra val ktorVersion: String by rootProject.extra
kotlin { kotlin {
jvm { jvm()
compilations.all { jvmToolchain(11)
kotlinOptions.jvmTarget = "11"
}
withJava()
}
sourceSets { sourceSets {
val jvmMain by getting { val jvmMain by getting {
dependencies { dependencies {

View File

@ -8,12 +8,8 @@ plugins {
val ktorVersion: String by rootProject.extra val ktorVersion: String by rootProject.extra
kotlin { kotlin {
jvm { jvm()
compilations.all { jvmToolchain(11)
kotlinOptions.jvmTarget = "11"
}
withJava()
}
sourceSets { sourceSets {
val jvmMain by getting { val jvmMain by getting {
dependencies { dependencies {

View File

@ -25,7 +25,7 @@ public fun SchemeView(
state: XYViewScope, state: XYViewScope,
features: FeatureGroup<XY>, features: FeatureGroup<XY>,
modifier: Modifier = Modifier.fillMaxSize(), modifier: Modifier = Modifier.fillMaxSize(),
) = key(state, features) { ): Unit = key(state, features) {
with(state) { with(state) {
//Can't do that inside canvas //Can't do that inside canvas
val painterCache: Map<PainterFeature<XY>, Painter> = val painterCache: Map<PainterFeature<XY>, Painter> =

View File

@ -18,7 +18,7 @@ import java.awt.Color as AWTColor
public class SvgDrawScope( public class SvgDrawScope(
private val graphics: SVGGraphics2D, private val graphics: SVGGraphics2D,
size: Size, size: Size,
val defaultStrokeWidth: Float = 1f, private val defaultStrokeWidth: Float = 1f,
) : DrawScope { ) : DrawScope {
override val layoutDirection: LayoutDirection override val layoutDirection: LayoutDirection
@ -459,7 +459,7 @@ public class SvgDrawScope(
} }
} }
fun drawText( public fun drawText(
text: String, text: String,
x: Float, x: Float,
y: Float, y: Float,

View File

@ -18,18 +18,18 @@ import java.awt.Font.PLAIN
import kotlin.math.abs import kotlin.math.abs
class FeatureStateSnapshot<T : Any>( public class FeatureStateSnapshot<T : Any>(
val features: Map<String, Feature<T>>, public val features: Map<String, Feature<T>>,
val painterCache: Map<PainterFeature<T>, Painter>, internal val painterCache: Map<PainterFeature<T>, Painter>,
) )
@Composable @Composable
fun <T : Any> FeatureGroup<T>.snapshot(): FeatureStateSnapshot<T> = FeatureStateSnapshot( public fun <T : Any> FeatureGroup<T>.snapshot(): FeatureStateSnapshot<T> = FeatureStateSnapshot(
featureMap, featureMap,
features.filterIsInstance<PainterFeature<T>>().associateWith { it.getPainter() } features.filterIsInstance<PainterFeature<T>>().associateWith { it.getPainter() }
) )
fun FeatureStateSnapshot<XY>.generateSvg( public fun FeatureStateSnapshot<XY>.generateSvg(
viewPoint: ViewPoint<XY>, viewPoint: ViewPoint<XY>,
width: Double, width: Double,
height: Double, height: Double,
@ -174,7 +174,7 @@ fun FeatureStateSnapshot<XY>.generateSvg(
return svgGraphics2D.getSVGElement(id) return svgGraphics2D.getSVGElement(id)
} }
fun FeatureStateSnapshot<XY>.exportToSvg( public fun FeatureStateSnapshot<XY>.exportToSvg(
viewPoint: ViewPoint<XY>, viewPoint: ViewPoint<XY>,
width: Double, width: Double,
height: Double, height: Double,

View File

@ -3,11 +3,11 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/ */
package space.kscience.kmath.trajectory package space.kscience.trajectory
import space.kscience.kmath.geometry.* import space.kscience.kmath.geometry.*
import space.kscience.kmath.geometry.Euclidean2DSpace.distanceTo import space.kscience.kmath.geometry.Euclidean2DSpace.distanceTo
import space.kscience.kmath.trajectory.Trajectory2D.* import space.kscience.trajectory.Trajectory2D.*
import kotlin.math.acos import kotlin.math.acos
internal fun DubinsPose2D.getLeftCircle(radius: Double): Circle2D = getTangentCircles(radius).first internal fun DubinsPose2D.getLeftCircle(radius: Double): Circle2D = getTangentCircles(radius).first

View File

@ -4,7 +4,7 @@
*/ */
@file:UseSerializers(Euclidean2DSpace.VectorSerializer::class) @file:UseSerializers(Euclidean2DSpace.VectorSerializer::class)
package space.kscience.kmath.trajectory package space.kscience.trajectory
import kotlinx.serialization.KSerializer import kotlinx.serialization.KSerializer
import kotlinx.serialization.SerialName import kotlinx.serialization.SerialName

View File

@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/ */
package space.kscience.kmath.trajectory package space.kscience.trajectory
import space.kscience.kmath.geometry.* import space.kscience.kmath.geometry.*
import space.kscience.kmath.geometry.Euclidean2DSpace.distanceTo import space.kscience.kmath.geometry.Euclidean2DSpace.distanceTo

View File

@ -4,7 +4,7 @@
*/ */
@file:UseSerializers(Euclidean2DSpace.VectorSerializer::class) @file:UseSerializers(Euclidean2DSpace.VectorSerializer::class)
package space.kscience.kmath.trajectory package space.kscience.trajectory
import kotlinx.serialization.SerialName import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable

View File

@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/ */
package space.kscience.kmath.trajectory package space.kscience.trajectory
import space.kscience.kmath.geometry.Euclidean2DSpace import space.kscience.kmath.geometry.Euclidean2DSpace
import space.kscience.kmath.geometry.equalsFloat import space.kscience.kmath.geometry.equalsFloat

View File

@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/ */
package space.kscience.kmath.trajectory package space.kscience.trajectory
import space.kscience.kmath.geometry.Circle2D import space.kscience.kmath.geometry.Circle2D
import space.kscience.kmath.geometry.Euclidean2DSpace.vector import space.kscience.kmath.geometry.Euclidean2DSpace.vector

View File

@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/ */
package space.kscience.kmath.trajectory package space.kscience.trajectory
import space.kscience.kmath.geometry.Circle2D import space.kscience.kmath.geometry.Circle2D
import space.kscience.kmath.geometry.Euclidean2DSpace import space.kscience.kmath.geometry.Euclidean2DSpace

View File

@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/ */
package space.kscience.kmath.trajectory package space.kscience.trajectory
import space.kscience.kmath.geometry.Euclidean2DSpace import space.kscience.kmath.geometry.Euclidean2DSpace
import space.kscience.kmath.geometry.equalsFloat import space.kscience.kmath.geometry.equalsFloat

View File

@ -3,14 +3,14 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/ */
package space.kscience.kmath.trajectory.segments package space.kscience.trajectory.segments
import space.kscience.kmath.geometry.Circle2D import space.kscience.kmath.geometry.Circle2D
import space.kscience.kmath.geometry.Euclidean2DSpace import space.kscience.kmath.geometry.Euclidean2DSpace
import space.kscience.kmath.geometry.circumference import space.kscience.kmath.geometry.circumference
import space.kscience.kmath.geometry.degrees import space.kscience.kmath.geometry.degrees
import space.kscience.kmath.trajectory.CircleTrajectory2D import space.kscience.trajectory.CircleTrajectory2D
import space.kscience.kmath.trajectory.Trajectory2D import space.kscience.trajectory.Trajectory2D
import kotlin.test.Test import kotlin.test.Test
import kotlin.test.assertEquals import kotlin.test.assertEquals

View File

@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/ */
package space.kscience.kmath.trajectory.segments package space.kscience.trajectory.segments
import space.kscience.kmath.geometry.Circle2D import space.kscience.kmath.geometry.Circle2D
import space.kscience.kmath.geometry.Euclidean2DSpace import space.kscience.kmath.geometry.Euclidean2DSpace

View File

@ -3,11 +3,11 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/ */
package space.kscience.kmath.trajectory.segments package space.kscience.trajectory.segments
import space.kscience.kmath.geometry.Euclidean2DSpace import space.kscience.kmath.geometry.Euclidean2DSpace
import space.kscience.kmath.geometry.degrees import space.kscience.kmath.geometry.degrees
import space.kscience.kmath.trajectory.StraightTrajectory2D import space.kscience.trajectory.StraightTrajectory2D
import kotlin.math.pow import kotlin.math.pow
import kotlin.math.sqrt import kotlin.math.sqrt
import kotlin.test.Test import kotlin.test.Test