This repository has been archived by the owner on Jul 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #600 from JuliaPlots/sd/geo
add Point transform type
- Loading branch information
Showing
6 changed files
with
58 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ | |
include("liftmacro.jl") | ||
include("makielayout.jl") | ||
include("figures.jl") | ||
include("transformations.jl") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using AbstractPlotting: PointTrans, xyz_boundingbox | ||
|
||
@testset "Basic transforms" begin | ||
function point2(x::Point2) | ||
return Point2f0(x[1] + 10, x[2] - 77) | ||
end | ||
|
||
function point3(x::Point3) | ||
return Point3f0(x[1] + 10, x[2] - 77, x[3] / 4) | ||
end | ||
trans2 = PointTrans{2}(point2) | ||
trans3 = PointTrans{3}(point3) | ||
points = [Point2f0(0, 0), Point2f0(0, 1)] | ||
bb = xyz_boundingbox(trans2, points) | ||
@test bb == Rect(Vec3f0(10, -77, 0), Vec3f0(0, 1, 0)) | ||
bb = xyz_boundingbox(trans3, points) | ||
@test bb == Rect(Vec3f0(10, -77, 0), Vec3f0(0, 1, 0)) | ||
|
||
points = [Point3f0(0, 0, 4), Point3f0(0, 1, -8)] | ||
bb = xyz_boundingbox(trans2, points) | ||
@test bb == Rect(Vec3f0(10, -77, -8), Vec3f0(0, 1, 12)) | ||
bb = xyz_boundingbox(trans3, points) | ||
@test bb == Rect(Vec3f0(10, -77, -2.0), Vec3f0(0, 1, 3.0)) | ||
end |