Skip to content

Commit

Permalink
style(builders): make method visibility explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
HoloTheDrunk committed Oct 22, 2024
1 parent b984a1b commit b1ebae8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions src/Core/Prefab/Globe/BuilderEllipsoidTile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class BuilderEllipsoidTile implements TileBuilder<GlobeTileBuilderParams> {
return this._crs;
}

constructor(options: {
public constructor(options: {
crs: string,
uvCount: number,
}) {
Expand Down Expand Up @@ -74,7 +74,7 @@ class BuilderEllipsoidTile implements TileBuilder<GlobeTileBuilderParams> {

// prepare params
// init projected object -> params.projected
prepare(params: TileBuilderParams): GlobeTileBuilderParams {
public prepare(params: TileBuilderParams): GlobeTileBuilderParams {
const nbRow = 2 ** (params.level + 1.0);
let st1 = WGS84ToOneSubY(params.extent.south);

Expand Down Expand Up @@ -103,36 +103,36 @@ class BuilderEllipsoidTile implements TileBuilder<GlobeTileBuilderParams> {
}

// get center tile in cartesian 3D
center(extent: Extent) {
public center(extent: Extent) {
return extent.center(this._transform.coords[0])
.as(this.crs, this._transform.coords[1])
.toVector3();
}

// get position 3D cartesian
vertexPosition(position: THREE.Vector2): THREE.Vector3 {
public vertexPosition(position: THREE.Vector2): THREE.Vector3 {
return this._transform.coords[0]
.setFromValues(position.x, position.y)
.as(this.crs, this._transform.coords[1])
.toVector3(this._transform.position);
}

// get normal for last vertex
vertexNormal() {
public vertexNormal() {
return this._transform.coords[1].geodesicNormal;
}

// coord u tile to projected
uProject(u: number, extent: Extent): number {
public uProject(u: number, extent: Extent): number {
return extent.west + u * this._transform.dimension.x;
}

// coord v tile to projected
vProject(v: number, extent: Extent): number {
public vProject(v: number, extent: Extent): number {
return extent.south + v * this._transform.dimension.y;
}

computeShareableExtent(extent: Extent): ShareableExtent {
public computeShareableExtent(extent: Extent): ShareableExtent {
// Compute shareable extent to pool the geometries
// the geometry in common extent is identical to the existing input
// with a transformation (translation, rotation)
Expand Down
16 changes: 8 additions & 8 deletions src/Core/Prefab/Planar/PlanarTileBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class PlanarTileBuilder implements TileBuilder<PlanarTileBuilderParams> {
private _transform: Transform;
private _crs: string;

constructor(options: {
public constructor(options: {
projection?: string,
crs: string,
uvCount?: number,
Expand Down Expand Up @@ -60,41 +60,41 @@ class PlanarTileBuilder implements TileBuilder<PlanarTileBuilderParams> {

// prepare params
// init projected object -> params.projected
prepare(params: TileBuilderParams): PlanarTileBuilderParams {
public prepare(params: TileBuilderParams): PlanarTileBuilderParams {
const newParams = params as PlanarTileBuilderParams;
newParams.nbRow = 2 ** (params.zoom + 1.0);
newParams.projected = new Projected();
return newParams;
}

center(extent: Extent): THREE.Vector3 {
public center(extent: Extent): THREE.Vector3 {
extent.center(this._transform.coords);
center.set(this._transform.coords.x, this._transform.coords.y, 0);
return center;
}

// set position 3D cartesian
vertexPosition(position: THREE.Vector2): THREE.Vector3 {
public vertexPosition(position: THREE.Vector2): THREE.Vector3 {
this._transform.position.set(position.x, position.y, 0);
return this._transform.position;
}

// get normal for last vertex
vertexNormal(): THREE.Vector3 {
public vertexNormal(): THREE.Vector3 {
return this._transform.normal;
}

// coord u tile to projected
uProject(u: number, extent: Extent): number {
public uProject(u: number, extent: Extent): number {
return extent.west + u * (extent.east - extent.west);
}

// coord v tile to projected
vProject(v: number, extent: Extent): number {
public vProject(v: number, extent: Extent): number {
return extent.south + v * (extent.north - extent.south);
}

computeShareableExtent(extent: Extent): ShareableExtent {
public computeShareableExtent(extent: Extent): ShareableExtent {
// compute shareable extent to pool the geometries
// the geometry in common extent is identical to the existing input
// with a translation
Expand Down

0 comments on commit b1ebae8

Please sign in to comment.