Skip to content

Commit

Permalink
fix: rename ArrowTool to ArrowAnnotate (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
sedghi authored May 3, 2022
1 parent 770d035 commit 9bd0cd8
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 32 deletions.
46 changes: 23 additions & 23 deletions common/reviews/api/tools.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,29 +221,7 @@ export abstract class AnnotationTool extends BaseTool {
}

// @public (undocumented)
interface ArrowAnnotation extends Annotation {
// (undocumented)
data: {
text: string;
handles: {
points: Types_2.Point3[];
activeHandleIndex: number | null;
textBox: {
hasMoved: boolean;
worldPosition: Types_2.Point3;
worldBoundingBox: {
topLeft: Types_2.Point3;
topRight: Types_2.Point3;
bottomLeft: Types_2.Point3;
bottomRight: Types_2.Point3;
};
};
};
};
}

// @public (undocumented)
export class ArrowTool extends AnnotationTool {
export class ArrowAnnotateTool extends AnnotationTool {
constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
// (undocumented)
_activateDraw: (element: HTMLDivElement) => void;
Expand Down Expand Up @@ -296,6 +274,28 @@ export class ArrowTool extends AnnotationTool {
touchDragCallback: any;
}

// @public (undocumented)
interface ArrowAnnotation extends Annotation {
// (undocumented)
data: {
text: string;
handles: {
points: Types_2.Point3[];
activeHandleIndex: number | null;
textBox: {
hasMoved: boolean;
worldPosition: Types_2.Point3;
worldBoundingBox: {
topLeft: Types_2.Point3;
topRight: Types_2.Point3;
bottomLeft: Types_2.Point3;
bottomRight: Types_2.Point3;
};
};
};
};
}

// @public (undocumented)
export abstract class BaseTool implements IBaseTool {
constructor(toolProps: PublicToolProps, defaultToolProps: ToolProps);
Expand Down
4 changes: 2 additions & 2 deletions packages/tools/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
EllipticalROITool,
BidirectionalTool,
PlanarFreehandROITool,
ArrowTool,
ArrowAnnotateTool,
CrosshairsTool,
RectangleScissorsTool,
CircleScissorsTool,
Expand Down Expand Up @@ -74,7 +74,7 @@ export {
EllipticalROITool,
BidirectionalTool,
PlanarFreehandROITool,
ArrowTool,
ArrowAnnotateTool,
// Segmentation Display
SegmentationDisplayTool,
// Segmentation Editing Tools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ import {
} from '../../types';
import { ArrowAnnotation } from '../../types/ToolSpecificAnnotationTypes';

class ArrowTool extends AnnotationTool {
static toolName = 'Arrow';
class ArrowAnnotateTool extends AnnotationTool {
static toolName = 'ArrowAnnotate';

public touchDragCallback: any;
public mouseDragCallback: any;
Expand Down Expand Up @@ -137,7 +137,7 @@ class ArrowTool extends AnnotationTool {
};

// Ensure settings are initialized after annotation instantiation
Settings.getObjectSettings(annotation, ArrowTool);
Settings.getObjectSettings(annotation, ArrowAnnotateTool);

addAnnotation(element, annotation);

Expand Down Expand Up @@ -573,7 +573,10 @@ class ArrowTool extends AnnotationTool {
// Draw SVG
for (let i = 0; i < annotations.length; i++) {
const annotation = annotations[i] as ArrowAnnotation;
const settings = Settings.getObjectSettings(annotation, ArrowTool);
const settings = Settings.getObjectSettings(
annotation,
ArrowAnnotateTool
);
const { annotationUID, data } = annotation;
const { handles, text } = data;
const { points, activeHandleIndex } = handles;
Expand Down Expand Up @@ -690,4 +693,4 @@ class ArrowTool extends AnnotationTool {
}
}

export default ArrowTool;
export default ArrowAnnotateTool;
4 changes: 2 additions & 2 deletions packages/tools/src/tools/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ProbeTool from './annotation/ProbeTool';
import RectangleROITool from './annotation/RectangleROITool';
import EllipticalROITool from './annotation/EllipticalROITool';
import PlanarFreehandROITool from './annotation/PlanarFreehandROITool';
import ArrowTool from './annotation/ArrowTool';
import ArrowAnnotateTool from './annotation/ArrowAnnotateTool';

// Segmentation DisplayTool
import SegmentationDisplayTool from './displayTools/SegmentationDisplayTool';
Expand Down Expand Up @@ -47,7 +47,7 @@ export {
RectangleROITool,
EllipticalROITool,
PlanarFreehandROITool,
ArrowTool,
ArrowAnnotateTool,
// Segmentations Display
SegmentationDisplayTool,
// Segmentations Tools
Expand Down

0 comments on commit 9bd0cd8

Please sign in to comment.