/// <summary>
        /// Overridden function
        /// </summary>
        public override void OnUnSelected()
        {
            // release the hotspots again:
            SafeRemoveHotSpot(_hotSpotConeAngleX);  _hotSpotConeAngleX = null;
            SafeRemoveHotSpot(_hotSpotConeAngleY);  _hotSpotConeAngleY = null;
            SafeRemoveHotSpot(_hotSpotNearClip); _hotSpotNearClip      = null;
            SafeRemoveHotSpot(_hotSpotFarClip); _hotSpotFarClip        = null;

            base.OnUnSelected();
        }
        /// <summary>
        /// Overridden function
        /// </summary>
        public override void OnUnSelected()
        {
            // release the hotspots again:
            SafeRemoveHotSpot(_hotSpotConeAngleX);  _hotSpotConeAngleX    = null;
            SafeRemoveHotSpot(_hotSpotConeAngleY);  _hotSpotConeAngleY    = null;
            SafeRemoveHotSpot(_hotSpotLength);      _hotSpotLength        = null;
            SafeRemoveHotSpot(_hotSpotFadeOutDist1); _hotSpotFadeOutDist1 = null;
            SafeRemoveHotSpot(_hotSpotFadeOutDist2); _hotSpotFadeOutDist2 = null;


            base.OnUnSelected();
        }
Exemple #3
0
        /// <summary>
        /// Overridden function
        /// </summary>
        public override void OnUnSelected()
        {
            // release the hotspots again:
            SafeRemoveHotSpot(_hotSpotVolume); _hotSpotVolume       = null;
            SafeRemoveHotSpot(_hotSpotFadeMin); _hotSpotFadeMin     = null;
            SafeRemoveHotSpot(_hotSpotFadeMax); _hotSpotFadeMax     = null;
            SafeRemoveHotSpot(_hotSpotPlaySound); _hotSpotPlaySound = null;
            SafeRemoveHotSpot(_hotSpotOuterCone); _hotSpotOuterCone = null;
            SafeRemoveHotSpot(_hotSpotInnerCone); _hotSpotInnerCone = null;

            base.OnUnSelected();
        }
        public override void OnUnSelected()
        {
            base.OnUnSelected();

            // release the hotspots again:
            EditorManager.ActiveView.HotSpots.Remove(_hotSpotAngle);
            EditorManager.ActiveView.HotSpots.Remove(_hotSpotColor);
            _hotSpotAngle.Remove();
            _hotSpotColor.Remove();
            _hotSpotAngle = null;
            _hotSpotColor = null;
        }
        HotSpotDistance _hotSpotFadeOutDist2; // a hotspot for the cone fade-out-dist

        /// <summary>
        /// Overridden function
        /// </summary>
        public override void OnSelected()
        {
            base.OnSelected();

            System.Diagnostics.Debug.Assert(_hotSpotConeAngleX == null);
            System.Diagnostics.Debug.Assert(_hotSpotConeAngleY == null);
            System.Diagnostics.Debug.Assert(_hotSpotLength == null);
            System.Diagnostics.Debug.Assert(_hotSpotFadeOutDist1 == null);
            System.Diagnostics.Debug.Assert(_hotSpotFadeOutDist2 == null);

            // create the hotspots:

            // hotspot for cone angle x
            _hotSpotConeAngleX             = new HotSpotConeAngle(this, @"textures\Hotspot_A.tga", VisionColors.Red, HotSpotBase.PickType.Square, 4.0f);
            _hotSpotConeAngleX.Distance    = 50.0f * EditorManager.Settings.GlobalUnitScaling;
            _hotSpotConeAngleX.StartAngle  = this.ConeAngleX;
            _hotSpotConeAngleX.ToolTipText = "cone angle x";
            EditorManager.ActiveView.HotSpots.Add(_hotSpotConeAngleX);

            // hotspot for cone angle y
            _hotSpotConeAngleY                     = new HotSpotConeAngle(this, @"textures\Hotspot_A.tga", VisionColors.Red, HotSpotBase.PickType.Square, 4.0f);
            _hotSpotConeAngleY.Distance            = 50.0f * EditorManager.Settings.GlobalUnitScaling;
            _hotSpotConeAngleY.UseOwnerUpDirection = true;
            _hotSpotConeAngleY.StartAngle          = this.ConeAngleY;
            _hotSpotConeAngleY.ToolTipText         = "cone angle y";
            EditorManager.ActiveView.HotSpots.Add(_hotSpotConeAngleY);

            // hotspot for cone length
            _hotSpotLength = new HotSpotDistance(this, @"textures\Hotspot_L.tga", VisionColors.Blue, HotSpotBase.PickType.Square, 4.0f);
            _hotSpotLength.StartDistance  = this.Length;
            _hotSpotLength.DisplayScaling = UniformScaling;
            _hotSpotLength.Axis           = this.XAxis;
            _hotSpotLength.ToolTipText    = "length";
            EditorManager.ActiveView.HotSpots.Add(_hotSpotLength);

            // hotspot for fade out distance
            _hotSpotFadeOutDist1 = new HotSpotDistance(this, @"textures\Hotspot_D.tga", VisionColors.Blue, HotSpotBase.PickType.Square, 4.0f);
            _hotSpotFadeOutDist1.StartDistance  = this.Length + this.FadeOutDistance;
            _hotSpotFadeOutDist1.Axis           = this.XAxis;
            _hotSpotFadeOutDist1.DisplayScaling = UniformScaling;
            _hotSpotFadeOutDist1.ToolTipText    = "fade out distance";
            EditorManager.ActiveView.HotSpots.Add(_hotSpotFadeOutDist1);

            // hotspot for fade out distance
            _hotSpotFadeOutDist2 = new HotSpotDistance(this, @"textures\Hotspot_D.tga", VisionColors.Blue, HotSpotBase.PickType.Square, 4.0f);
            _hotSpotFadeOutDist2.StartDistance  = this.Length - this.FadeOutDistance;
            _hotSpotFadeOutDist2.Axis           = this.XAxis;
            _hotSpotFadeOutDist2.DisplayScaling = UniformScaling;
            _hotSpotFadeOutDist2.ToolTipText    = "fade out distance";
            EditorManager.ActiveView.HotSpots.Add(_hotSpotFadeOutDist2);
        }
Exemple #6
0
        /// <summary>
        /// Overridden function
        /// </summary>
        public override void OnSelected()
        {
            base.OnSelected();

            System.Diagnostics.Debug.Assert(_hotSpotVolume == null);

            // hotspot for sound volume
            _hotSpotVolume = new HotSpotDistance(this, @"textures\Hotspot_V.tga", VisionColors.Cyan, HotSpotBase.PickType.Square, 10.0f);
            _hotSpotVolume.DisplayScaling = 100.0f;
            _hotSpotVolume.StartDistance  = Volume;
            _hotSpotVolume.Axis           = this.ZAxis;
            _hotSpotVolume.ToolTipText    = "Volume";
            _hotSpotVolume.SetRange(0.0f, 1.0f);
            EditorManager.ActiveView.HotSpots.Add(_hotSpotVolume);

            // hotspots for distance fading
            _hotSpotFadeMin = new HotSpotDistance(this, @"textures\Hotspot_D.tga", VisionColors.Blue, HotSpotBase.PickType.Square, 4.0f);
            _hotSpotFadeMin.StartDistance  = MinDistance;
            _hotSpotFadeMin.Axis           = this.XAxis;
            _hotSpotFadeMin.DisplayScaling = UniformScaling;
            _hotSpotFadeMin.ToolTipText    = "min distance";
            EditorManager.ActiveView.HotSpots.Add(_hotSpotFadeMin);
            _hotSpotFadeMax = new HotSpotDistance(this, @"textures\Hotspot_D.tga", VisionColors.Blue, HotSpotBase.PickType.Square, 4.0f);
            _hotSpotFadeMax.StartDistance  = MaxDistance;
            _hotSpotFadeMax.Axis           = this.XAxis;
            _hotSpotFadeMax.DisplayScaling = UniformScaling;
            _hotSpotFadeMax.ToolTipText    = "max distance";
            EditorManager.ActiveView.HotSpots.Add(_hotSpotFadeMax);

            // hotspots for cone angles
            _hotSpotOuterCone             = new HotSpotConeAngle(this, @"textures\Hotspot_A.tga", VisionColors.Red, HotSpotBase.PickType.Square, 4.0f);
            _hotSpotOuterCone.Distance    = 120.0f * EditorManager.Settings.GlobalUnitScaling;
            _hotSpotOuterCone.StartAngle  = this.ConeOutside;
            _hotSpotOuterCone.ToolTipText = "Outer cone angle";
            EditorManager.ActiveView.HotSpots.Add(_hotSpotOuterCone);
            _hotSpotInnerCone             = new HotSpotConeAngle(this, @"textures\Hotspot_A.tga", VisionColors.Red, HotSpotBase.PickType.Square, 4.0f);
            _hotSpotInnerCone.Distance    = 100.0f * EditorManager.Settings.GlobalUnitScaling;
            _hotSpotInnerCone.StartAngle  = this.ConeInside;
            _hotSpotInnerCone.ToolTipText = "Inner cone angle";
            EditorManager.ActiveView.HotSpots.Add(_hotSpotInnerCone);

            // hotspot for playing sound
            _hotSpotPlaySound             = new HotSpotPlayButton(this, @"textures\Media_play.TGA", VisionColors.RGBA(200, 200, 200, 255), VisionColors.White, 15.0f);
            _hotSpotPlaySound.ToolTipText = "Play sound";
            _hotSpotPlaySound.Set2DOffset(0.0f, 30.0f);
            EditorManager.ActiveView.HotSpots.Add(_hotSpotPlaySound);

            UpdateHotspotVisibility();
        }
        /// <summary>
        /// Called when the shape is selected
        /// </summary>
        public override void OnSelected()
        {
            base.OnSelected();

            // create the hotspots:

            // hotspot for spotangle
            _hotSpotAngle             = new HotSpotConeAngle(this, @"textures\Hotspot_A.tga", VisionColors.Red, HotSpotBase.PickType.Square, 4.0f);
            _hotSpotAngle.Distance    = 200.0f;
            _hotSpotAngle.StartAngle  = HotSpotAngleValue;
            _hotSpotAngle.ToolTipText = "cone angle";
            EditorManager.ActiveView.HotSpots.Add(_hotSpotAngle); // register it so vForge can respond to it

            //hotspot for color
            _hotSpotColor             = new HotSpotColorButton(this, "ShapeColor");
            _hotSpotColor.ToolTipText = "color";
            EditorManager.ActiveView.HotSpots.Add(_hotSpotColor); // register it so vForge can respond to it
        }
        HotSpotDistance _hotSpotFarClip;     // a hotspot for the cone fade-out-dist

        /// <summary>
        /// Overridden function
        /// </summary>
        public override void OnSelected()
        {
            base.OnSelected();

            System.Diagnostics.Debug.Assert(_hotSpotConeAngleX == null);
            System.Diagnostics.Debug.Assert(_hotSpotConeAngleY == null);
            System.Diagnostics.Debug.Assert(_hotSpotNearClip == null);
            System.Diagnostics.Debug.Assert(_hotSpotFarClip == null);

            // create the hotspots:

            // hotspot for cone angle x
            _hotSpotConeAngleX             = new HotSpotConeAngle(this, @"textures\Hotspot_A.tga", VisionColors.Red, HotSpotBase.PickType.Square, 4.0f);
            _hotSpotConeAngleX.Distance    = 50.0f * EditorManager.Settings.GlobalUnitScaling;
            _hotSpotConeAngleX.StartAngle  = this.CameraAngleX;
            _hotSpotConeAngleX.ToolTipText = "FOV x";
            EditorManager.ActiveView.HotSpots.Add(_hotSpotConeAngleX);

            // hotspot for cone angle y
            _hotSpotConeAngleY                     = new HotSpotConeAngle(this, @"textures\Hotspot_A.tga", VisionColors.Red, HotSpotBase.PickType.Square, 4.0f);
            _hotSpotConeAngleY.Distance            = 50.0f * EditorManager.Settings.GlobalUnitScaling;
            _hotSpotConeAngleY.UseOwnerUpDirection = true;
            _hotSpotConeAngleY.StartAngle          = this.CameraAngleY;
            _hotSpotConeAngleY.ToolTipText         = "FOV y";
            EditorManager.ActiveView.HotSpots.Add(_hotSpotConeAngleY);

            // hotspot for fade out distance
            _hotSpotNearClip = new HotSpotDistance(this, @"textures\Hotspot_D.tga", VisionColors.Blue, HotSpotBase.PickType.Square, 4.0f);
            _hotSpotNearClip.StartDistance = this.NearClipDistance;
            _hotSpotNearClip.Axis          = this.XAxis;
            _hotSpotNearClip.ToolTipText   = "Near clip distance";
            EditorManager.ActiveView.HotSpots.Add(_hotSpotNearClip);

            // hotspot for fade out distance
            _hotSpotFarClip = new HotSpotDistance(this, @"textures\Hotspot_D.tga", VisionColors.Blue, HotSpotBase.PickType.Square, 4.0f);
            _hotSpotFarClip.StartDistance = this.FarClipDistance;
            _hotSpotFarClip.Axis          = this.XAxis;
            _hotSpotFarClip.ToolTipText   = "Far clip distance";
            EditorManager.ActiveView.HotSpots.Add(_hotSpotFarClip);
        }
        public override void OnUnSelected()
        {
            base.OnUnSelected();

              // release the hotspots again:
              EditorManager.ActiveView.HotSpots.Remove(_hotSpotAngle);
              EditorManager.ActiveView.HotSpots.Remove(_hotSpotColor);
              _hotSpotAngle.Remove();
              _hotSpotColor.Remove();
              _hotSpotAngle = null;
              _hotSpotColor = null;
        }
        /// <summary>
        /// Called when the shape is selected
        /// </summary>
        public override void OnSelected()
        {
            base.OnSelected();

              // create the hotspots:

              // hotspot for spotangle
              _hotSpotAngle = new HotSpotConeAngle(this, @"textures\Hotspot_A.tga", VisionColors.Red, HotSpotBase.PickType.Square, 4.0f);
              _hotSpotAngle.Distance = 200.0f;
              _hotSpotAngle.StartAngle = HotSpotAngleValue;
              _hotSpotAngle.ToolTipText = "cone angle";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotAngle); // register it so vForge can respond to it

              //hotspot for color
              _hotSpotColor = new HotSpotColorButton(this, "ShapeColor");
              _hotSpotColor.ToolTipText = "color";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotColor); // register it so vForge can respond to it
        }
        /// <summary>
        /// Overridden function
        /// </summary>
        public override void OnUnSelected()
        {
            // release the hotspots again:
              SafeRemoveHotSpot(_hotSpotConeAngleX);  _hotSpotConeAngleX = null;
              SafeRemoveHotSpot(_hotSpotConeAngleY);  _hotSpotConeAngleY = null;
              SafeRemoveHotSpot(_hotSpotNearClip); _hotSpotNearClip = null;
              SafeRemoveHotSpot(_hotSpotFarClip); _hotSpotFarClip = null;

              base.OnUnSelected ();
        }
        /// <summary>
        /// Overridden function
        /// </summary>
        public override void OnSelected()
        {
            base.OnSelected ();

              System.Diagnostics.Debug.Assert(_hotSpotConeAngleX==null);
              System.Diagnostics.Debug.Assert(_hotSpotConeAngleY==null);
              System.Diagnostics.Debug.Assert(_hotSpotNearClip==null);
              System.Diagnostics.Debug.Assert(_hotSpotFarClip==null);

              // create the hotspots:

              // hotspot for cone angle x
              _hotSpotConeAngleX = new HotSpotConeAngle(this,@"textures\Hotspot_A.tga",VisionColors.Red,HotSpotBase.PickType.Square,4.0f);
              _hotSpotConeAngleX.Distance = 50.0f * EditorManager.Settings.GlobalUnitScaling;
              _hotSpotConeAngleX.StartAngle = this.CameraAngleX;
              _hotSpotConeAngleX.ToolTipText = "FOV x";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotConeAngleX);

              // hotspot for cone angle y
              _hotSpotConeAngleY = new HotSpotConeAngle(this,@"textures\Hotspot_A.tga",VisionColors.Red,HotSpotBase.PickType.Square,4.0f);
              _hotSpotConeAngleY.Distance = 50.0f * EditorManager.Settings.GlobalUnitScaling;
              _hotSpotConeAngleY.UseOwnerUpDirection = true;
              _hotSpotConeAngleY.StartAngle = this.CameraAngleY;
              _hotSpotConeAngleY.ToolTipText = "FOV y";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotConeAngleY);

              // hotspot for fade out distance
              _hotSpotNearClip = new HotSpotDistance(this,@"textures\Hotspot_D.tga",VisionColors.Blue,HotSpotBase.PickType.Square,4.0f);
              _hotSpotNearClip.StartDistance = this.NearClipDistance;
              _hotSpotNearClip.Axis = this.XAxis;
              _hotSpotNearClip.ToolTipText = "Near clip distance";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotNearClip);

              // hotspot for fade out distance
              _hotSpotFarClip = new HotSpotDistance(this,@"textures\Hotspot_D.tga",VisionColors.Blue,HotSpotBase.PickType.Square,4.0f);
              _hotSpotFarClip.StartDistance = this.FarClipDistance;
              _hotSpotFarClip.Axis = this.XAxis;
              _hotSpotFarClip.ToolTipText = "Far clip distance";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotFarClip);
        }
 /// <summary>
 /// Called when the shape is unselected
 /// </summary>
 public override void OnUnSelected()
 {
     // release the hotspots again:
     EditorManager.ActiveView.HotSpots.Remove(_hotSpotAngle);
       EditorManager.ActiveView.HotSpots.Remove(_hotSpotIntensity);
       if(EditorManager.ActiveView.HotSpots.Contains(_hotSpotColor))
     EditorManager.ActiveView.HotSpots.Remove(_hotSpotColor);
       _hotSpotAngle.Remove();
       _hotSpotIntensity.Remove();
       _hotSpotColor.Remove();
     _hotSpotAngle = null;
     _hotSpotIntensity = null;
       _hotSpotColor = null;
     base.OnUnSelected ();
 }
        /// <summary>
        /// Overridden function
        /// </summary>
        public override void OnUnSelected()
        {
            // release the hotspots again:
              SafeRemoveHotSpot(_hotSpotVolume); _hotSpotVolume = null;
              SafeRemoveHotSpot(_hotSpotFadeMin); _hotSpotFadeMin = null;
              SafeRemoveHotSpot(_hotSpotFadeMax); _hotSpotFadeMax = null;
              SafeRemoveHotSpot(_hotSpotPlaySound); _hotSpotPlaySound = null;
              SafeRemoveHotSpot(_hotSpotOuterCone); _hotSpotOuterCone = null;
              SafeRemoveHotSpot(_hotSpotInnerCone); _hotSpotInnerCone = null;

              base.OnUnSelected();
        }
        /// <summary>
        /// Called when the shape is selected
        /// </summary>
        public override void OnSelected()
        {
            base.OnSelected ();
              System.Diagnostics.Debug.Assert(_hotSpotFanAngle==null);
              System.Diagnostics.Debug.Assert(_hotSpotFanIntensity==null);
              System.Diagnostics.Debug.Assert(_hotSpotRadius==null);
              System.Diagnostics.Debug.Assert(_hotSpotLength==null);
              System.Diagnostics.Debug.Assert(_hotSpotSizeX==null);
              System.Diagnostics.Debug.Assert(_hotSpotSizeY==null);
              System.Diagnostics.Debug.Assert(_hotSpotSizeZ==null);

              // create the hotspots:

              // hotspot for fan cone angle
              _hotSpotFanAngle = new HotSpotConeAngle(this,@"textures\Hotspot_A.tga",VisionColors.Red,HotSpotBase.PickType.Square,4.0f);
              _hotSpotFanAngle.Distance = 50.0f * EditorManager.Settings.GlobalUnitScaling;
              _hotSpotFanAngle.StartAngle = this.ConeAngle;
              _hotSpotFanAngle.ToolTipText = "cone angle";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotFanAngle);

              // hotspot for fan intensity
              _hotSpotFanIntensity = new HotSpotDistance(this,@"textures\Hotspot_I.tga",VisionColors.Yellow,HotSpotBase.PickType.Square,4.0f);
              _hotSpotFanIntensity.StartDistance = this.Intensity;
              _hotSpotFanIntensity.Axis = this.XAxis;
              _hotSpotFanIntensity.DisplayScaling = EditorManager.Settings.GlobalUnitScaling * UniformScaling;
              _hotSpotFanIntensity.ToolTipText = "intensity";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotFanIntensity);

              // hotspot for radius
              _hotSpotRadius = new HotSpotDistance(this,@"textures\Hotspot_R.tga",VisionColors.Green,HotSpotBase.PickType.Square,4.0f);
              _hotSpotRadius.StartDistance = this.Radius;
              _hotSpotRadius.Axis = this.ZAxis;
              _hotSpotRadius.DisplayScaling = UniformScaling;
              _hotSpotRadius.ToolTipText = "radius";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotRadius);

              // hotspot for length
              _hotSpotLength = new HotSpotDistance(this,@"textures\Hotspot_L.tga",VisionColors.Blue,HotSpotBase.PickType.Square,4.0f);
              _hotSpotLength.StartDistance = this.Length;
              _hotSpotLength.Axis = this.XAxis;
              _hotSpotLength.DisplayScaling = UniformScaling;
              _hotSpotLength.ToolTipText = "length";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotLength);

              float fBoxScaleXY = ConstraintType == EngineInstanceConstraint.ConstraintType_e.Plane ? 1.0f : 0.5f;
              // hotspot for size X
              _hotSpotSizeX = new HotSpotDistance(this,@"textures\Hotspot_Rect.dds",VisionColors.Yellow,HotSpotBase.PickType.Square,4.0f);
              _hotSpotSizeX.StartDistance = this.BoxSizeX;
              _hotSpotSizeX.DisplayScaling = fBoxScaleXY * ScaleX;
              _hotSpotSizeX.Axis = this.XAxis;
              _hotSpotSizeX.ToolTipText = "size x direction";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotSizeX);

              // hotspot for size Y
              _hotSpotSizeY = new HotSpotDistance(this,@"textures\Hotspot_Rect.dds",VisionColors.Yellow,HotSpotBase.PickType.Square,4.0f);
              _hotSpotSizeY.StartDistance = this.BoxSizeY;
              _hotSpotSizeY.DisplayScaling = fBoxScaleXY * ScaleY;
              _hotSpotSizeY.Axis = this.YAxis;
              _hotSpotSizeY.ToolTipText = "size y direction";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotSizeY);

              // hotspot for size Z
              _hotSpotSizeZ = new HotSpotDistance(this,@"textures\Hotspot_Rect.dds",VisionColors.Yellow,HotSpotBase.PickType.Square,4.0f);
              _hotSpotSizeZ.StartDistance = this.BoxSizeZ;
              _hotSpotSizeZ.DisplayScaling = 0.5f * ScaleZ;
              _hotSpotSizeZ.Axis = this.ZAxis;
              _hotSpotSizeZ.ToolTipText = "size z direction";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotSizeZ);

              // add more hotspots here...
        }
        /// <summary>
        /// Overridden function
        /// </summary>
        public override void OnSelected()
        {
            base.OnSelected ();

              System.Diagnostics.Debug.Assert(_hotSpotConeAngleX==null);
              System.Diagnostics.Debug.Assert(_hotSpotConeAngleY==null);
              System.Diagnostics.Debug.Assert(_hotSpotLength==null);
              System.Diagnostics.Debug.Assert(_hotSpotFadeOutDist1==null);
              System.Diagnostics.Debug.Assert(_hotSpotFadeOutDist2==null);

              // create the hotspots:

              // hotspot for cone angle x
              _hotSpotConeAngleX = new HotSpotConeAngle(this,@"textures\Hotspot_A.tga",VisionColors.Red,HotSpotBase.PickType.Square,4.0f);
              _hotSpotConeAngleX.Distance = 50.0f * EditorManager.Settings.GlobalUnitScaling;
              _hotSpotConeAngleX.StartAngle = this.ConeAngleX;
              _hotSpotConeAngleX.ToolTipText = "cone angle x";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotConeAngleX);

              // hotspot for cone angle y
              _hotSpotConeAngleY = new HotSpotConeAngle(this,@"textures\Hotspot_A.tga",VisionColors.Red,HotSpotBase.PickType.Square,4.0f);
              _hotSpotConeAngleY.Distance = 50.0f * EditorManager.Settings.GlobalUnitScaling;
              _hotSpotConeAngleY.UseOwnerUpDirection = true;
              _hotSpotConeAngleY.StartAngle = this.ConeAngleY;
              _hotSpotConeAngleY.ToolTipText = "cone angle y";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotConeAngleY);

              // hotspot for cone length
              _hotSpotLength = new HotSpotDistance(this,@"textures\Hotspot_L.tga",VisionColors.Blue,HotSpotBase.PickType.Square,4.0f);
              _hotSpotLength.StartDistance = this.Length;
              _hotSpotLength.DisplayScaling = UniformScaling;
              _hotSpotLength.Axis = this.XAxis;
              _hotSpotLength.ToolTipText = "length";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotLength);

              // hotspot for fade out distance
              _hotSpotFadeOutDist1 = new HotSpotDistance(this,@"textures\Hotspot_D.tga",VisionColors.Blue,HotSpotBase.PickType.Square,4.0f);
              _hotSpotFadeOutDist1.StartDistance = this.Length + this.FadeOutDistance;
              _hotSpotFadeOutDist1.Axis = this.XAxis;
              _hotSpotFadeOutDist1.DisplayScaling = UniformScaling;
              _hotSpotFadeOutDist1.ToolTipText = "fade out distance";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotFadeOutDist1);

              // hotspot for fade out distance
              _hotSpotFadeOutDist2 = new HotSpotDistance(this,@"textures\Hotspot_D.tga",VisionColors.Blue,HotSpotBase.PickType.Square,4.0f);
              _hotSpotFadeOutDist2.StartDistance = this.Length - this.FadeOutDistance;
              _hotSpotFadeOutDist2.Axis = this.XAxis;
              _hotSpotFadeOutDist2.DisplayScaling = UniformScaling;
              _hotSpotFadeOutDist2.ToolTipText = "fade out distance";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotFadeOutDist2);
        }
        /// <summary>
        /// Called when the shape is unselected
        /// </summary>
        public override void OnUnSelected()
        {
            // release the hotspots again:
              SafeRemoveHotSpot(_hotSpotFanAngle);_hotSpotFanAngle=null;
              SafeRemoveHotSpot(_hotSpotFanIntensity);_hotSpotFanIntensity=null;
              SafeRemoveHotSpot(_hotSpotRadius);_hotSpotRadius=null;
              SafeRemoveHotSpot(_hotSpotLength);_hotSpotLength=null;
              SafeRemoveHotSpot(_hotSpotSizeX);_hotSpotSizeX=null;
              SafeRemoveHotSpot(_hotSpotSizeY);_hotSpotSizeY=null;
              SafeRemoveHotSpot(_hotSpotSizeZ);_hotSpotSizeZ=null;

              base.OnUnSelected ();
        }
        /// <summary>
        /// Called when the shape is selected
        /// </summary>
        public override void OnSelected()
        {
            base.OnSelected ();

            // create the hotspots:

            // hotspot for spotangle
            _hotSpotAngle = new HotSpotConeAngle(this,@"textures\Hotspot_A.tga",VisionColors.Red,HotSpotBase.PickType.Square,4.0f);
              _hotSpotAngle.Distance = 200.0f * EditorManager.Settings.GlobalUnitScaling;
            _hotSpotAngle.StartAngle = SpotAngle;
              _hotSpotAngle.ToolTipText = "cone angle";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotAngle);

            // hotspot for intensity
            _hotSpotIntensity = new HotSpotDistance(this,@"textures\Hotspot_R.tga",VisionColors.Yellow,HotSpotBase.PickType.Square,4.0f);
            _hotSpotIntensity.StartDistance = this.Intensity;
              _hotSpotIntensity.DisplayScaling = UniformScaling;
            _hotSpotIntensity.Axis = this.XAxis;
              _hotSpotIntensity.ToolTipText = "light influence radius";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotIntensity);

              //color
              _hotSpotColor = new HotSpotColorButton(this,"LightColor");
              _hotSpotColor.ToolTipText = "Change the light's color";
              _hotSpotColor.Set2DOffset(10.0f,10.0f);
              EditorManager.ActiveView.HotSpots.Add(_hotSpotColor);

            // add more hotspots here...
        }
        /// <summary>
        /// Overridden function
        /// </summary>
        public override void OnUnSelected()
        {
            // release the hotspots again:
              SafeRemoveHotSpot(_hotSpotConeAngleX);  _hotSpotConeAngleX = null;
              SafeRemoveHotSpot(_hotSpotConeAngleY);  _hotSpotConeAngleY = null;
              SafeRemoveHotSpot(_hotSpotLength);      _hotSpotLength = null;
              SafeRemoveHotSpot(_hotSpotFadeOutDist1); _hotSpotFadeOutDist1 = null;
              SafeRemoveHotSpot(_hotSpotFadeOutDist2); _hotSpotFadeOutDist2 = null;

              base.OnUnSelected ();
        }
        /// <summary>
        /// Overridden function
        /// </summary>
        public override void OnSelected()
        {
            base.OnSelected ();

              System.Diagnostics.Debug.Assert(_hotSpotVolume==null);

              // hotspot for sound volume
              _hotSpotVolume = new HotSpotDistance(this, @"textures\Hotspot_V.tga", VisionColors.Cyan, HotSpotBase.PickType.Square, 10.0f);
              _hotSpotVolume.DisplayScaling = 100.0f;
              _hotSpotVolume.StartDistance = Volume;
              _hotSpotVolume.Axis = this.ZAxis;
              _hotSpotVolume.ToolTipText = "Volume";
              _hotSpotVolume.SetRange(0.0f, 1.0f);
              EditorManager.ActiveView.HotSpots.Add(_hotSpotVolume);

              // hotspots for distance fading
              _hotSpotFadeMin = new HotSpotDistance(this, @"textures\Hotspot_D.tga", VisionColors.Blue, HotSpotBase.PickType.Square, 4.0f);
              _hotSpotFadeMin.StartDistance = MinDistance;
              _hotSpotFadeMin.Axis = this.XAxis;
              _hotSpotFadeMin.DisplayScaling = UniformScaling;
              _hotSpotFadeMin.ToolTipText = "min distance";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotFadeMin);
              _hotSpotFadeMax = new HotSpotDistance(this, @"textures\Hotspot_D.tga", VisionColors.Blue, HotSpotBase.PickType.Square, 4.0f);
              _hotSpotFadeMax.StartDistance = MaxDistance;
              _hotSpotFadeMax.Axis = this.XAxis;
              _hotSpotFadeMax.DisplayScaling = UniformScaling;
              _hotSpotFadeMax.ToolTipText = "max distance";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotFadeMax);

              // hotspots for cone angles
              _hotSpotOuterCone = new HotSpotConeAngle(this, @"textures\Hotspot_A.tga", VisionColors.Red, HotSpotBase.PickType.Square, 4.0f);
              _hotSpotOuterCone.Distance = 120.0f * EditorManager.Settings.GlobalUnitScaling;
              _hotSpotOuterCone.StartAngle = this.ConeOutside;
              _hotSpotOuterCone.ToolTipText = "Outer cone angle";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotOuterCone);
              _hotSpotInnerCone = new HotSpotConeAngle(this, @"textures\Hotspot_A.tga", VisionColors.Red, HotSpotBase.PickType.Square, 4.0f);
              _hotSpotInnerCone.Distance = 100.0f * EditorManager.Settings.GlobalUnitScaling;
              _hotSpotInnerCone.StartAngle = this.ConeInside;
              _hotSpotInnerCone.ToolTipText = "Inner cone angle";
              EditorManager.ActiveView.HotSpots.Add(_hotSpotInnerCone);

              // hotspot for playing sound
              _hotSpotPlaySound = new HotSpotPlayButton(this, @"textures\Media_play.TGA", VisionColors.RGBA(200,200,200,255), VisionColors.White, 15.0f);
              _hotSpotPlaySound.ToolTipText = "Play sound";
              _hotSpotPlaySound.Set2DOffset(0.0f, 30.0f);
              EditorManager.ActiveView.HotSpots.Add(_hotSpotPlaySound);

              UpdateHotspotVisibility();
        }