private static uint getSliderValueFromCommand(AnatomyCommand command)
        {
            float range = command.NumericValueMax - command.NumericValueMin;
            float normalizedCommandValue = (command.NumericValue - command.NumericValueMin) / range;

            return((uint)(normalizedCommandValue * SCROLL_MAX) - 1);
        }
 public override void addCommand(AnatomyCommand command)
 {
     if (commands.Count == 0)
     {
         button.Caption = command.UIText;
     }
     commands.Add(command);
 }
 public void addCommand(AnatomyCommand command)
 {
     if (transparencyCommands.Count == 0)
     {
         command.NumericValueChanged += command_NumericValueChanged;
         slider.ScrollPosition        = getSliderValueFromCommand(command);
     }
     transparencyCommands.Add(command);
 }
 public override void addCommand(AnatomyCommand command)
 {
     if (commands.Count == 0)
     {
         checkButton.Caption  = command.UIText;
         checkButton.Selected = command.BooleanValue;
     }
     commands.Add(command);
     command.BooleanValueChanged += command_BooleanValueChanged;
 }
Example #5
0
 public override void addCommand(AnatomyCommand command)
 {
     if (commands.Count == 0)
     {
         caption.Caption       = command.UIText;
         slider.ScrollPosition = getSliderValueFromCommand(command);
     }
     commands.Add(command);
     command.NumericValueChanged += command_NumericValueChanged;
 }
 void transparencyAnatomyCommand_NumericValueChanged(AnatomyCommand command, float value)
 {
     if (trackingTransparency)
     {
         transparencyInterface.CurrentAlpha = value;
     }
     else
     {
         transparencyInterface.CurrentAlpha = 0.0f;
     }
 }
 void command_NumericValueChanged(AnatomyCommand command, float value)
 {
     slider.ScrollPosition = getSliderValueFromCommand(command);
 }
 void command_BooleanValueChanged(AnatomyCommand command, bool value)
 {
     checkButton.Selected = value;
 }
Example #9
0
 public void addCommand(AnatomyCommand command)
 {
     additionalCommands.Add(command);
 }
Example #10
0
 public abstract void addCommand(AnatomyCommand command);
 public void removeCommand(AnatomyCommand command)
 {
     commands.Remove(command);
     editInterface.safeRemoveSubInterfaceForObject(commands, command);
 }
 public void addCommand(AnatomyCommand command)
 {
     commands.Add(command);
     editInterface.safeAddSubInterfaceForObject(commands, command);
 }