All Implemented Interfaces:
Argument

public class VolumeCmd extends Subcommand
* A subcommand of MeasureCmd that calculates and displays the volume of a solid Thing.

Aliases: volume, v

Typical Usages:

     measure volume "mySolidObject" - Measures the volume of the thing named "mySolidObject".
     m v 08415ef7-770b-4367-83d6-2dc0c64914b1 - Measures the volume of the thing with the given UUID.
     

This command also makes use of BlinkerSwingWorker to highlight the solid being measured.

Author:
Lehlogonolo Poole
  • Field Details

    • draw

      private boolean draw
  • Constructor Details

    • VolumeCmd

      public VolumeCmd()
  • Method Details

    • run

      public void run(Invoker invoker, SafeJLabel logLabel, String aliasUsed, Object[] args, ArrayList<TaggedArgValue<?>> taggedArgs)
      Description copied from class: Command
      The method to be overridden by subclasses to implement command functionality.
      Overrides:
      run in class Command
      Parameters:
      invoker - The invoker of this command
      logLabel - The JLabel to display log messages.
      aliasUsed - The alias of the command that was used to invoke it.
      args - The arguments passed to the command.
      taggedArgs - Tagged arguments passed to the command.
    • registerGhost

      private void registerGhost(Thing t, double volume)
    • ghost

      private void ghost(Thing t, Graphics2D graphics2D)
    • closestPoint

      private GPoint closestPoint(Thing t)
    • volume

      private double volume(Thing t)