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; }
HotSpotColorButton _hotSpotAmbColor; // a color button public override void OnSelected() { base.OnSelected(); //color hotspots _hotSpotAmbColor = new HotSpotColorButton(this, "AmbientColor"); _hotSpotAmbColor.ToolTipText = "Change the ambient color"; _hotSpotAmbColor.Set2DOffset(10.0f, 10.0f); EditorManager.ActiveView.HotSpots.Add(_hotSpotAmbColor); _hotSpotDirColor = new HotSpotColorButton(this, "DirectionalLightColor"); _hotSpotDirColor.ToolTipText = "Change the light's color"; _hotSpotDirColor.Set2DOffset(10.0f, 24.0f); EditorManager.ActiveView.HotSpots.Add(_hotSpotDirColor); }
public override void OnUnSelected() { base.OnUnSelected(); if (_hotSpotAmbColor != null) { EditorManager.ActiveView.HotSpots.Remove(_hotSpotAmbColor); _hotSpotAmbColor.Remove(); _hotSpotAmbColor = null; } if (_hotSpotDirColor != null) { EditorManager.ActiveView.HotSpots.Remove(_hotSpotDirColor); _hotSpotDirColor.Remove(); _hotSpotDirColor = 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 }
public override void OnSelected() { base.OnSelected(); //color hotspots _hotSpotAmbColor = new HotSpotColorButton(this, "AmbientColor"); _hotSpotAmbColor.ToolTipText = "Change the ambient color"; _hotSpotAmbColor.Set2DOffset(10.0f, 10.0f); EditorManager.ActiveView.HotSpots.Add(_hotSpotAmbColor); _hotSpotDirColor = new HotSpotColorButton(this, "DirectionalLightColor"); _hotSpotDirColor.ToolTipText = "Change the light's color"; _hotSpotDirColor.Set2DOffset(10.0f, 24.0f); EditorManager.ActiveView.HotSpots.Add(_hotSpotDirColor); }
/// <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> /// 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 (); }