forked from equinor/webviz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b60aed1
commit 43575bb
Showing
14 changed files
with
619 additions
and
347 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { AtomStoreMaster } from "./AtomStoreMaster"; | ||
import { IntersectionPolylines } from "./userCreatedItems/IntersectionPolylines"; | ||
|
||
export interface UserCreatedItemSet { | ||
serialize(): string; | ||
populateFromData(data: string): void; | ||
} | ||
|
||
export class UserCreatedItems { | ||
private _intersectionPolylines: IntersectionPolylines; | ||
|
||
constructor() { | ||
this._intersectionPolylines = new IntersectionPolylines(); | ||
} | ||
|
||
getIntersectionPolylines(): IntersectionPolylines { | ||
return this._intersectionPolylines; | ||
} | ||
|
||
isEqual(other: UserCreatedItems): boolean { | ||
return this._intersectionPolylines.serialize() === other._intersectionPolylines.serialize(); | ||
} | ||
} |
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
51 changes: 51 additions & 0 deletions
51
frontend/src/framework/userCreatedItems/IntersectionPolylines.ts
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,51 @@ | ||
import { UserCreatedItemSet } from "@framework/UserCreatedItems"; | ||
|
||
import { v4 } from "uuid"; | ||
|
||
export type IntersectionPolyline = { | ||
id: string; | ||
name: string; | ||
points: number[][]; | ||
}; | ||
|
||
export type IntersectionPolylineWithoutId = Omit<IntersectionPolyline, "id">; | ||
|
||
export class IntersectionPolylines implements UserCreatedItemSet { | ||
private _polylines: IntersectionPolyline[] = []; | ||
|
||
serialize(): string { | ||
return JSON.stringify(this._polylines); | ||
} | ||
|
||
populateFromData(data: string): void { | ||
this._polylines = JSON.parse(data); | ||
} | ||
|
||
add(polyline: IntersectionPolylineWithoutId): void { | ||
const id = v4(); | ||
this._polylines.push({ | ||
id, | ||
...polyline, | ||
}); | ||
} | ||
|
||
remove(id: string): void { | ||
this._polylines = this._polylines.filter((polyline) => polyline.id !== id); | ||
} | ||
|
||
getPolylines(): IntersectionPolyline[] { | ||
return this._polylines; | ||
} | ||
|
||
getPolyline(id: string): IntersectionPolyline | undefined { | ||
return this._polylines.find((polyline) => polyline.id === id); | ||
} | ||
|
||
updatePolyline(id: string, polyline: IntersectionPolylineWithoutId): void { | ||
const index = this._polylines.findIndex((polyline) => polyline.id === id); | ||
this._polylines[index] = { | ||
id, | ||
...polyline, | ||
}; | ||
} | ||
} |
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
15 changes: 15 additions & 0 deletions
15
frontend/src/modules/Grid3DIntersection/utils/IntersectionBacksampling.ts
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,15 @@ | ||
import { PolylineIntersection_trans } from "../view/queries/queryDataTransforms"; | ||
|
||
export function backsampleIntersectionPolyline( | ||
completeWellborePath: number[][], | ||
polylineIntersection: PolylineIntersection_trans | ||
) { | ||
/* | ||
const backsampledIntersectionPolyline: number[][] = []; | ||
for (const point of polylineIntersection) { | ||
const closestPoint = findClosestPoint(completeWellborePath, point); | ||
backsampledIntersectionPolyline.push(closestPoint); | ||
} | ||
return backsampledIntersectionPolyline; | ||
*/ | ||
} |
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
Oops, something went wrong.