-
Notifications
You must be signed in to change notification settings - Fork 19
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 #14 from Gaia3D/develop
Release mago-3d-tiler 1.5.5
- Loading branch information
Showing
112 changed files
with
3,921 additions
and
702 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 @@ | ||
rootProject.name = 'mago-common' |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
66 changes: 66 additions & 0 deletions
66
common/src/main/java/com/gaia3d/basic/types/FormatType.java
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,66 @@ | ||
package com.gaia3d.basic.types; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import java.util.Arrays; | ||
|
||
/** | ||
* Enum for the different types of formats that can be used in the application. | ||
* Each format has a corresponding extension. | ||
* The extension is used to determine the type of the file. | ||
* The extension is also used to determine the type of the file that is being downloaded. | ||
* @Author znkim | ||
* @Since 1.0.1 | ||
* @See GaiaSet | ||
*/ | ||
@Getter | ||
@RequiredArgsConstructor | ||
public enum FormatType { | ||
// 3D Formats | ||
KML("kml", "kml", false), | ||
GLTF("gltf", "glb", false), | ||
GLB("glb", "gltf", false), | ||
COLLADA("dae", "dae", true), | ||
MAX_3DS("3ds", "3ds",false), | ||
MAX_ASE("ase", "ase", false), | ||
FBX("fbx", "fbx", true), | ||
OBJ("obj","obj", false), | ||
IFC("ifc", "ifc",false), | ||
CITYGML("gml","xml", false), | ||
INDOORGML("gml","xml", false), | ||
MODO("lxo", "lxo", false), | ||
LWO("lwo", "lwo", false), | ||
LWS("lws", "lws", false), | ||
DirectX("x", "x", false), | ||
// 2D Formats, | ||
SHP("shp", "shp",false), | ||
GEOJSON("geojson", "json", false), | ||
//JSON("json", "", false), | ||
LAS("las", "laz", false), | ||
LAZ("laz", "las", false), | ||
// OUTPUT Formats | ||
B3DM("b3dm", "gltf", true), | ||
I3DM("i3dm", "gltf",true), | ||
PNTS("pnts", "gltf",true), | ||
TEMP("tmp", "tmp", false); | ||
|
||
private final String extension; | ||
private final String subExtension; | ||
private final boolean yUpAxis; | ||
|
||
public static FormatType fromExtension(String extension) { | ||
if (extension == null || extension.isEmpty()) { | ||
return null; | ||
} | ||
return Arrays.stream(FormatType.values()) | ||
.filter((type) -> { | ||
boolean compareName = type.name().equalsIgnoreCase(extension); | ||
boolean compareExtension = type.getExtension().equals(extension.toLowerCase()); | ||
boolean compareSubExtension = type.getSubExtension().equals(extension.toLowerCase()); | ||
return compareName || compareExtension || compareSubExtension; | ||
}) | ||
.findFirst() | ||
.orElse(null); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package com.gaia3d.util; | ||
|
||
import com.gaia3d.basic.geometry.GaiaBoundingBox; | ||
import com.gaia3d.basic.geometry.GaiaRectangle; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.joml.Vector2d; | ||
import org.joml.Vector3d; | ||
|
||
@Slf4j | ||
public class VectorUtils { | ||
public static double cross(Vector2d v1, Vector2d v2, Vector2d v3) { | ||
Vector2d v1v2 = v1.sub(v2, new Vector2d()); | ||
v1v2.normalize(); | ||
Vector2d v2v3 = v2.sub(v3, new Vector2d()); | ||
v2v3.normalize(); | ||
return cross(v1v2, v2v3); | ||
} | ||
|
||
public static double cross(Vector2d a, Vector2d b) { | ||
return (a.x * b.y) - (a.y * b.x); | ||
} | ||
|
||
public static boolean isIntersection(Vector2d a, Vector2d b, Vector2d u, Vector2d v) { | ||
GaiaRectangle rect1 = new GaiaRectangle(a, b); | ||
GaiaRectangle rect2 = new GaiaRectangle(u, v); | ||
if (!rect1.intersects(rect2, 0.0)) { | ||
// Intersection check with bounding box | ||
return false; | ||
} else if (a.equals(u) && b.equals(v) || a.equals(v) && b.equals(u)){ | ||
// Same line case; | ||
return true; | ||
} else if (a.equals(u) || a.equals(v) || b.equals(u) || b.equals(v)) { | ||
// Same point case; | ||
return false; | ||
} | ||
|
||
|
||
double cross1 = cross(a, b, u); | ||
double cross2 = cross(a, b, v); | ||
if (cross1 == 0 && cross2 == 0) { | ||
return true; | ||
} | ||
boolean isIntersectA = cross1 * cross2 < 0; | ||
|
||
double cross3 = cross(u, v, a); | ||
double cross4 = cross(u, v, b); | ||
if (cross3 == 0 && cross4 == 0) { | ||
return true; | ||
} | ||
boolean isIntersectB = cross3 * cross4 < 0; | ||
return isIntersectA == isIntersectB; | ||
} | ||
|
||
public static boolean isIntersection(Vector2d v1, Vector2d v2, Vector2d v3) { | ||
if (v1.equals(v3) || v2.equals(v3)) { | ||
return false; | ||
} | ||
double cross1 = cross(v1, v2, v3); | ||
return cross1 == 0; | ||
} | ||
|
||
public static double calcAngle(Vector2d a, Vector2d b, Vector2d c) { | ||
Vector2d v1 = new Vector2d(); | ||
Vector2d v2 = new Vector2d(); | ||
b.sub(a, v1); | ||
c.sub(b, v2); | ||
v1.normalize(); | ||
v2.normalize(); | ||
return Math.toDegrees(v1.angle(v2)); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.