diff options
| author | bob <bcz@cs.brown.edu> | 2019-03-29 16:18:55 -0400 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-03-29 16:18:55 -0400 |
| commit | a10bbd686a825ee38caceb7ecfc388715c14a817 (patch) | |
| tree | 9eea3acb2c10c8b9e633aeceea2fc4408eb53f51 /src/client/northstar/core | |
| parent | da7a12f9b49b43534658524b1da846948fbf3947 (diff) | |
added basic brushing placeholder
Diffstat (limited to 'src/client/northstar/core')
| -rw-r--r-- | src/client/northstar/core/brusher/BrushLinkModel.ts | 40 | ||||
| -rw-r--r-- | src/client/northstar/core/brusher/IBaseBrushable.ts | 4 |
2 files changed, 2 insertions, 42 deletions
diff --git a/src/client/northstar/core/brusher/BrushLinkModel.ts b/src/client/northstar/core/brusher/BrushLinkModel.ts deleted file mode 100644 index e3ac43367..000000000 --- a/src/client/northstar/core/brusher/BrushLinkModel.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { IBaseBrushable } from '../brusher/IBaseBrushable' -import { IBaseBrusher } from '../brusher/IBaseBrusher' -import { Utils } from '../../utils/Utils' -import { IEquatable } from '../../utils/IEquatable'; - -export class BrushLinkModel<T> implements IEquatable { - - public From: IBaseBrusher<T>; - - public To: IBaseBrushable<T>; - - public Color: number = 0; - - constructor(from: IBaseBrusher<T>, to: IBaseBrushable<T>) { - this.From = from; - this.To = to; - } - - public static overlaps(start: number, end: number, otherstart: number, otherend: number): boolean { - if (start > otherend || otherstart > end) - return false; - return true; - } - public static Connected<T>(from: IBaseBrusher<T>, to: IBaseBrushable<T>): boolean { - var connected = (Math.abs(from.Position.x + from.Size.x - to.Position.x) <= 60 && - this.overlaps(from.Position.y, from.Position.y + from.Size.y, to.Position.y, to.Position.y + to.Size.y) - ) || - (Math.abs(to.Position.x + to.Size.x - from.Position.x) <= 60 && - this.overlaps(to.Position.y, to.Position.y + to.Size.y, from.Position.y, from.Position.y + from.Size.y) - ); - return connected; - } - - public Equals(other: Object): boolean { - if (!Utils.EqualityHelper(this, other)) return false; - if (!this.From.Equals((other as BrushLinkModel<T>).From)) return false; - if (!this.To.Equals((other as BrushLinkModel<T>).To)) return false; - return true; - } -}
\ No newline at end of file diff --git a/src/client/northstar/core/brusher/IBaseBrushable.ts b/src/client/northstar/core/brusher/IBaseBrushable.ts index 07d4e7580..99a36636f 100644 --- a/src/client/northstar/core/brusher/IBaseBrushable.ts +++ b/src/client/northstar/core/brusher/IBaseBrushable.ts @@ -1,9 +1,9 @@ -import { BrushLinkModel } from '../brusher/BrushLinkModel' import { PIXIPoint } from '../../utils/MathUtil' import { IEquatable } from '../../utils/IEquatable'; +import { Document } from '../../../../fields/Document' export interface IBaseBrushable<T> extends IEquatable { - BrusherModels: Array<BrushLinkModel<T>>; + BrusherModels: Array<Document>; BrushColors: Array<number>; Position: PIXIPoint; Size: PIXIPoint; |
