function addPoint(eventData) {
  var toolData = (0, _toolState.getToolState)(eventData.element, toolType);

  if (toolData === undefined) {
    return;
  }

  // Get the toolData from the last-drawn polygon
  var config = freehand.getConfiguration();
  var data = toolData.data[config.currentTool];

  if (data.handles.invalidHandlePlacement) {
    return;
  }

  var newHandleData = new _FreehandHandleData.FreehandHandleData(eventData.currentPoints.image);

  // If this is not the first handle
  if (data.handles.length) {
    // Add the line from the current handle to the new handle
    data.handles[config.currentHandle - 1].lines.push(eventData.currentPoints.image);
  }

  // Add the new handle
  data.handles.push(newHandleData);

  // Increment the current handle value
  config.currentHandle += 1;

  // Force onImageRendered to fire
  _externalModules2.default.cornerstone.updateImage(eventData.element);

  fireModified(eventData.element, data);
}
/**
* Adds a point on mouse click in polygon mode.
*
* @param {Object} eventData - data object associated with an event.
*/
Adds a point on mouse click in polygon mode.
Adds a point on mouse click in polygon mode .
function addPoint(eventData) {
  var toolData = (0, _toolState.getToolState)(eventData.element, toolType);
  if (toolData === undefined) {
    return;
  }
  var config = freehand.getConfiguration();
  var data = toolData.data[config.currentTool];
  if (data.handles.invalidHandlePlacement) {
    return;
  }
  var newHandleData = new _FreehandHandleData.FreehandHandleData(eventData.currentPoints.image);
  if (data.handles.length) {
    data.handles[config.currentHandle - 1].lines.push(eventData.currentPoints.image);
  }
  data.handles.push(newHandleData);
  config.currentHandle += 1;
  _externalModules2.default.cornerstone.updateImage(eventData.element);
  fireModified(eventData.element, data);
}
function addPoint ( eventData ) { var toolData = ( 0 , _toolState . getToolState ) ( eventData . element , toolType ) ; if ( toolData === undefined ) { return ; } var config = freehand . getConfiguration ( ) ; var data = toolData . data [ config . currentTool ] ; if ( data . handles . invalidHandlePlacement ) { return ; } var newHandleData = new _FreehandHandleData . FreehandHandleData ( eventData . currentPoints . image ) ; if ( data . handles . length ) { data . handles [ config . currentHandle - 1 ] . lines . push ( eventData . currentPoints . image ) ; } data . handles . push ( newHandleData ) ; config . currentHandle += 1 ; _externalModules2 . default . cornerstone . updateImage ( eventData . element ) ; fireModified ( eventData . element , data ) ; }
Adds a point on mouse click in polygon mode.
Adds a point on mouse click in polygon mode .
// Get the toolData from the last-drawn polygon // If this is not the first handle // Add the line from the current handle to the new handle // Add the new handle // Increment the current handle value // Force onImageRendered to fire