Ejemplo n.º 1
0
 public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
 {
     base.OnHotSpotRender(hotSpot, view, mode);
     if (hotSpot == _hotSpotWindSpeed)
     {
         view.RenderArrow(this.RenderPosition, _hotSpotWindSpeed.CurrentPosition + RenderPosition, VisionColors.White, 1.0f, 4.0f);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Called every frame and per hotspot that belongs to the shape
        /// </summary>
        /// <param name="hotSpot"></param>
        /// <param name="view"></param>
        /// <param name="mode"></param>
        public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
        {
            base.OnHotSpotRender(hotSpot, view, mode);

            Vector3F vStart = _hotSpotFadeOutDist1.Position;
            Vector3F vEnd   = _hotSpotFadeOutDist2.Position;

            view.RenderLine(vStart, vEnd, VisionColors.Yellow, 1.0f);
        }
Ejemplo n.º 3
0
 void SafeRemoveHotSpot(HotSpotBase hotSpot)
 {
     if (hotSpot == null)
     {
         return;
     }
     EditorManager.ActiveView.HotSpots.Remove(hotSpot);
     hotSpot.Remove();
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Overridden function
        /// </summary>
        /// <param name="hotSpot"></param>
        /// <param name="view"></param>
        /// <param name="mode"></param>
        public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
        {
            base.OnHotSpotRender(hotSpot, view, mode);

            // render gravity as arrow
            if (hotSpot == _hotSpotGravity)
            {
                view.RenderArrow(Position, _hotSpotGravity.Position, VisionColors.Yellow, 4.0f, 2.0f * EditorManager.Settings.GlobalUnitScaling);
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Called every frame and per hotspot that belongs to the shape
 /// </summary>
 /// <param name="hotSpot"></param>
 public override void OnHotSpotEvaluatePosition(HotSpotBase hotSpot)
 {
     if (hotSpot == _hotSpotHeight)
     {
         if (!_hotSpotHeight.IsDragging)
         {
             _hotSpotHeight.StartDistance = Height;
         }
     }
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Overridden function
        /// </summary>
        /// <param name="hotSpot"></param>
        /// <param name="view"></param>
        /// <param name="mode"></param>
        public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
        {
            base.OnHotSpotRender(hotSpot, view, mode);

            if (_hotSpotVolume.Visible)
            {
                Vector3F vStart = Position;
                Vector3F vEnd   = _hotSpotVolume.Position;
                view.RenderLine(vStart, vEnd, VisionColors.Cyan, 1.0f);
            }
        }
Ejemplo n.º 7
0
        public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
        {
            base.OnHotSpotDrag(hotSpot, view, fDeltaX, fDeltaY);

            _fMinX = _hotspotMinX.CurrentDistance;
            _fMinY = _hotspotMinY.CurrentDistance;
            _fMaxX = _hotspotMaxX.CurrentDistance;
            _fMaxY = _hotspotMaxY.CurrentDistance;

            UpdateSelectionRect();
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Called when the user releases the mouse button on a hotspot
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
 {
     if (hotSpot == _hotSpotAngle)
     {
         if (_hotSpotAngle.HasChanged)
         {
             float fNewAngle = _hotSpotAngle.CurrentAngle;
             HotSpotAngleValue = _hotSpotAngle.StartAngle;                                           // set old angle for the action
             EditorManager.Actions.Add(new SetPropertyAction(this, "HotSpotAngleValue", fNewAngle)); // send an action which sets the property from old value to new one
         }
     }
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Called when the user releases the mouse button on a hotspot
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
 {
     if (hotSpot == _hotSpotHeight)
     {
         if (_hotSpotHeight.HasChanged)
         {
             float fNewHeight = _hotSpotHeight.CurrentDistance;
             Height = _hotSpotHeight.StartDistance;                                                            // set old value for the action
             EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "Height", fNewHeight)); // send an action which sets the property from old value to new one
         }
     }
 }
 public override void OnHotSpotEvaluatePosition(HotSpotBase hotSpot)
 {
     base.OnHotSpotEvaluatePosition(hotSpot);
     if (hotSpot == _hotSpotStartPoint && _hotSpotStartPoint.IsDragging)
     {
         StartPoint = _hotSpotStartPoint.CurrentPosition + Position;
     }
     else if (hotSpot == _hotSpotEndPoint && _hotSpotEndPoint.IsDragging)
     {
         EndPoint = _hotSpotEndPoint.CurrentPosition + Position;
     }
 }
Ejemplo n.º 11
0
 public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
 {
     base.OnHotSpotDrag(hotSpot, view, fDeltaX, fDeltaY);
     if (hotSpot == _hotSpotWindSpeed)
     {
         // set on engine instance while dragging to see the effect
         if (HasEngineInstance())
         {
             EnginePGroup.SetWindSpeed(_hotSpotWindSpeed.CurrentPosition, _bLocalSpaceWind);
         }
     }
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Called while the user drags a hotspot that belongs to this shape
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 /// <param name="fDeltaX"></param>
 /// <param name="fDeltaY"></param>
 public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
 {
     if (hotSpot == _hotSpotSizeX)
     {
         this.BoxSizeX = _hotSpotSizeX.CurrentDistance;
     }
     if (hotSpot == _hotSpotSizeY)
     {
         this.BoxSizeY = _hotSpotSizeY.CurrentDistance;
     }
     if (hotSpot == _hotSpotSizeZ)
     {
         this.BoxSizeZ = _hotSpotSizeZ.CurrentDistance;
     }
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Called when user starts dragging a hotspot that belongs to this shape
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 public override void OnHotSpotDragBegin(HotSpotBase hotSpot, VisionViewBase view)
 {
     if (hotSpot == _hotSpotSizeX)
     {
         _hotSpotSizeX.StartDistance = this.BoxSizeX;
     }
     if (hotSpot == _hotSpotSizeY)
     {
         _hotSpotSizeY.StartDistance = this.BoxSizeY;
     }
     if (hotSpot == _hotSpotSizeZ)
     {
         _hotSpotSizeZ.StartDistance = this.BoxSizeZ;
     }
 }
 public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
 {
     base.OnHotSpotDragEnd(hotSpot, view);
     if (hotSpot == _hotSpotStartPoint)
     {
         Vector3F vNewPos = _hotSpotStartPoint.CurrentPosition + Position;
         _vStartPoint = _hotSpotStartPoint.StartPosition;                                                   // set old value for the action
         EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "StartPoint", vNewPos)); // send an action which sets the property from old value to new one
     }
     else if (hotSpot == _hotSpotEndPoint)
     {
         Vector3F vNewPos = _hotSpotEndPoint.CurrentPosition + Position;
         _vEndPoint = _hotSpotEndPoint.StartPosition;                                                     // set old value for the action
         EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "EndPoint", vNewPos)); // send an action which sets the property from old value to new one
     }
 }
Ejemplo n.º 15
0
        /// <summary>
        /// Called when user starts dragging a hotspot that belongs to this shape
        /// </summary>
        /// <param name="hotSpot"></param>
        /// <param name="view"></param>
        public override void OnHotSpotDragBegin(HotSpotBase hotSpot, VisionViewBase view)
        {
            if (hotSpot == _hotSpotX)
            {
                _hotSpotX.StartDistance = Size.X;
            }

            if (hotSpot == _hotSpotY)
            {
                _hotSpotY.StartDistance = Size.Y;
            }

            if (hotSpot == _hotSpotXY)
            {
                _hotSpotXY.StartDistance = Size.GetLength();
            }
        }
Ejemplo n.º 16
0
    /// <summary>
    /// Called when user starts dragging a hotspot that belongs to this shape
    /// </summary>
    /// <param name="hotSpot"></param>
    /// <param name="view"></param>
    public override void OnHotSpotDragBegin(HotSpotBase hotSpot, VisionViewBase view)
    {
 #if (MESHGROUP_USE_LINKING)
        if (hotSpot == _hotSpotSizeX)
        {
            _hotSpotSizeX.StartDistance = this.BoxSizeX;
        }
        if (hotSpot == _hotSpotSizeY)
        {
            _hotSpotSizeY.StartDistance = this.BoxSizeY;
        }
        if (hotSpot == _hotSpotSizeZ)
        {
            _hotSpotSizeZ.StartDistance = this.BoxSizeZ;
        }
 #endif
    }
Ejemplo n.º 17
0
    /// <summary>
    /// Called while the user drags a hotspot that belongs to this shape
    /// </summary>
    /// <param name="hotSpot"></param>
    /// <param name="view"></param>
    /// <param name="fDeltaX"></param>
    /// <param name="fDeltaY"></param>
    public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
    {
 #if (MESHGROUP_USE_LINKING)
        if (hotSpot == _hotSpotSizeX)
        {
            this.BoxSizeX = _hotSpotSizeX.CurrentDistance;
        }
        if (hotSpot == _hotSpotSizeY)
        {
            this.BoxSizeY = _hotSpotSizeY.CurrentDistance;
        }
        if (hotSpot == _hotSpotSizeZ)
        {
            this.BoxSizeZ = _hotSpotSizeZ.CurrentDistance;
        }
 #endif
    }
Ejemplo n.º 18
0
        public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
        {
            base.OnHotSpotDragEnd(hotSpot, view);

            if (hotSpot == _hotSpotWindSpeed)
            {
                Vector3F vNewSpeed = _hotSpotWindSpeed.CurrentPosition;
                Vector3F vOldSpeed = _hotSpotWindSpeed.StartPosition;
                if (WindInLocalSpace)
                {
                    Matrix3F rot = Matrix3F.Transpose(RotationMatrix);
                    vNewSpeed = Matrix3F.Transform(rot, vNewSpeed);
                    vOldSpeed = Matrix3F.Transform(rot, vOldSpeed);
                }
                WindSpeed = vOldSpeed;                                                                              // set old value for the action
                EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "WindSpeed", vNewSpeed)); // send an action which sets the property from old value to new one
            }
        }
Ejemplo n.º 19
0
 public override void OnHotSpotEvaluatePosition(HotSpotBase hotSpot)
 {
     base.OnHotSpotEvaluatePosition(hotSpot);
     if (hotSpot == _hotSpotWindSpeed)
     {
         if (!_hotSpotWindSpeed.IsDragging)
         {
             if (WindInLocalSpace)
             {
                 _hotSpotWindSpeed.StartPosition = RotationMatrix * _windSpeed;
             }
             else
             {
                 _hotSpotWindSpeed.StartPosition = _windSpeed;
             }
         }
     }
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Called while the user drags a hotspot that belongs to this shape
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 /// <param name="fDeltaX"></param>
 /// <param name="fDeltaY"></param>
 public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
 {
     if (hotSpot == _hotSpotX)
     {
         Size = new Vector2F(_hotSpotX.CurrentDistance, Size.Y); // update for the view
     }
     if (hotSpot == _hotSpotY)
     {
         Size = new Vector2F(Size.X, _hotSpotY.CurrentDistance); // update for the view
     }
     if (hotSpot == _hotSpotXY)
     {
         float ratio = Size.Y / Size.X;
         float newX  = _hotSpotXY.CurrentDistance / (float)System.Math.Sqrt(ratio * ratio + 1.0f);
         float newY  = ratio * newX;
         Size = new Vector2F(newX, newY);
     }
 }
Ejemplo n.º 21
0
        /// <summary>
        /// Called when the user releases the mouse button on a hotspot
        /// </summary>
        /// <param name="hotSpot"></param>
        /// <param name="view"></param>
        public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
        {
            if (hotSpot == _hotSpotX)
            {
                if (_hotSpotX.HasChanged)
                {
                    float fNewX = _hotSpotX.CurrentDistance;
                    Size = new Vector2F(_hotSpotX.StartDistance, Size.Y);                                                            // set old value for the action
                    EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "Size", new Vector2F(fNewX, Size.Y))); // send an action which sets the property from old value to new one
                }
            }

            if (hotSpot == _hotSpotY)
            {
                if (_hotSpotY.HasChanged)
                {
                    float fNewY = _hotSpotY.CurrentDistance;
                    Size = new Vector2F(Size.X, _hotSpotY.StartDistance);                                                            // set old value for the action
                    EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "Size", new Vector2F(Size.X, fNewY))); // send an action which sets the property from old value to new one
                }
            }

            if (hotSpot == _hotSpotXY)
            {
                if (_hotSpotXY.HasChanged)
                {
                    float ratio = Size.Y / Size.X;
                    //compute old value
                    float oldX = _hotSpotXY.StartDistance / (float)System.Math.Sqrt(ratio * ratio + 1.0f);
                    float oldY = oldX * ratio;
                    Size = new Vector2F(oldX, oldY); // set old value for the action

                    //compute new value
                    float newX = _hotSpotXY.CurrentDistance / (float)System.Math.Sqrt(ratio * ratio + 1.0f);
                    float newY = ratio * newX;
                    EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "Size", new Vector2F(newX, newY))); // send an action which sets the property from old value to new one
                }
            }
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Called every frame and per hotspot that belongs to the shape
        /// </summary>
        /// <param name="hotSpot"></param>
        public override void OnHotSpotEvaluatePosition(HotSpotBase hotSpot)
        {
            if (hotSpot == _hotSpotX)
              {
            if (!_hotSpotX.IsDragging)
            {
              _hotSpotX.StartDistance = Size.X;
              _hotSpotX.Axis = this.XAxis;
            }
              }

              if (hotSpot == _hotSpotY)
              {
            if (!_hotSpotY.IsDragging)
            {
              _hotSpotY.StartDistance = Size.Y;
              _hotSpotY.Axis = this.YAxis;
            }
              }

              if (hotSpot == _hotSpotXY)
              {
            if (!_hotSpotXY.IsDragging)
            {
              _hotSpotXY.StartDistance = Size.GetLength();
              Vector3F axis = (this.YAxis * Size.Y + this.XAxis * Size.X);
              axis.Normalize();
              _hotSpotXY.Axis = axis;
            }
              }
        }
Ejemplo n.º 23
0
 /// <summary>
 /// Called every frame and per hotspot that belongs to the shape
 /// </summary>
 /// <param name="hotSpot"></param>
 public override void OnHotSpotEvaluatePosition(HotSpotBase hotSpot)
 {
     if (hotSpot==_hotSpotSizeX)
       {
     _hotSpotSizeX.Axis = XAxis;
     if (!_hotSpotSizeX.IsDragging)
       _hotSpotSizeX.StartDistance = this.BoxSizeX;
       }
       if (hotSpot==_hotSpotSizeY)
       {
     _hotSpotSizeY.Axis = YAxis;
     if (!_hotSpotSizeY.IsDragging)
       _hotSpotSizeY.StartDistance = this.BoxSizeY;
       }
       if (hotSpot==_hotSpotSizeZ)
       {
     _hotSpotSizeZ.Axis = ZAxis;
     if (!_hotSpotSizeZ.IsDragging)
       _hotSpotSizeZ.StartDistance = this.BoxSizeZ;
       }
 }
Ejemplo n.º 24
0
 /// <summary>
 /// Called when user starts dragging a hotspot that belongs to this shape
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 public override void OnHotSpotDragBegin(HotSpotBase hotSpot, VisionViewBase view)
 {
     if (hotSpot==_hotSpotSizeX)
     _hotSpotSizeX.StartDistance = this.BoxSizeX;
       if (hotSpot==_hotSpotSizeY)
     _hotSpotSizeY.StartDistance = this.BoxSizeY;
       if (hotSpot==_hotSpotSizeZ)
     _hotSpotSizeZ.StartDistance = this.BoxSizeZ;
 }
Ejemplo n.º 25
0
 public override void OnHotSpotEvaluatePosition(HotSpotBase hotSpot)
 {
     base.OnHotSpotEvaluatePosition(hotSpot);
       if (hotSpot == _hotSpotWindSpeed)
       {
     if (!_hotSpotWindSpeed.IsDragging)
     {
       if (WindInLocalSpace)
     _hotSpotWindSpeed.StartPosition = RotationMatrix * _windSpeed;
       else
       _hotSpotWindSpeed.StartPosition = _windSpeed;
       }
     }
 }
Ejemplo n.º 26
0
        /// <summary>
        /// Overridden hot spot handle function
        /// </summary>
        /// <param name="hotSpot"></param>
        public override void OnHotSpotEvaluatePosition(HotSpotBase hotSpot)
        {
            base.OnHotSpotEvaluatePosition (hotSpot);

              if (hotSpot==_hotSpotLightGridOfs)
              {
            _hotSpotLightGridOfs.Visible = this.ShowLightgridWidget;

            if (_hotSpotLightGridOfs.IsDragging) // update while dragging
              LightGridSampleOfs = _hotSpotLightGridOfs.CurrentPosition;
            else
              _hotSpotLightGridOfs.StartPosition = LightGridSampleOfs;
              }
        }
Ejemplo n.º 27
0
 /// <summary>
 /// Overridden hot spot handle function
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 public override void OnHotSpotDragBegin(HotSpotBase hotSpot, VisionViewBase view)
 {
     base.OnHotSpotDragBegin (hotSpot, view);
 }
Ejemplo n.º 28
0
 /// <summary>
 /// Overridden function
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 /// <param name="mode"></param>
 public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
 {
     base.OnHotSpotRender (hotSpot, view, mode);
       if (hotSpot==_hotSpotTangentIn)
       {
     view.RenderLine(Position,Position+_hotSpotTangentIn.CurrentPosition, VisionColors.Grey, 2.0f);
     return;
       }
       if (hotSpot==_hotSpotTangentOut)
       {
     view.RenderLine(Position,Position+_hotSpotTangentOut.CurrentPosition, VisionColors.Grey, 2.0f);
     return;
       }
 }
Ejemplo n.º 29
0
 public override void OnHotSpotEvaluatePosition(HotSpotBase hotSpot)
 {
     base.OnHotSpotEvaluatePosition(hotSpot);
       if (hotSpot == _hotSpotWindSpeed)
       {
     hotSpot.Visible = ShowWindSpeedWidget;
     if (!_hotSpotWindSpeed.IsDragging)
     {
       if (WindInLocalSpace)
     _hotSpotWindSpeed.StartPosition = RotationMatrix * _windSpeed;
       else
     _hotSpotWindSpeed.StartPosition = _windSpeed;
     }
       }
       else if (hotSpot == _hotSpotLightSamplingOffset)
       {
     hotSpot.Visible = ShowLightSamplingOffsetWidget;
     if (!_hotSpotLightSamplingOffset.IsDragging)
       _hotSpotLightSamplingOffset.StartPosition = _lightSamplingOffset;
       }
 }
Ejemplo n.º 30
0
        public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
        {
            base.OnHotSpotDrag(hotSpot, view, fDeltaX, fDeltaY);

              // set on engine instance while dragging to see the effect
              if (hotSpot == _hotSpotWindSpeed)
              {
            if (HasEngineInstance())
              EnginePGroup.SetWindSpeed(_hotSpotWindSpeed.CurrentPosition, _bLocalSpaceWind);
              }
              else if (hotSpot == _hotSpotLightSamplingOffset)
              {
            if (HasEngineInstance())
              EnginePGroup.SetLightSamplingOffset(_hotSpotLightSamplingOffset.CurrentPosition);
              }
        }
Ejemplo n.º 31
0
        /// <summary>
        /// Overridden function
        /// </summary>
        /// <param name="hotSpot"></param>
        /// <param name="view"></param>
        /// <param name="mode"></param>
        public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
        {
            base.OnHotSpotRender (hotSpot, view, mode);

              // render gravity as arrow
              if (hotSpot==_hotSpotGravity)
              {
            view.RenderArrow(Position, _hotSpotGravity.Position, VisionColors.Yellow, 4.0f, 2.0f * EditorManager.Settings.GlobalUnitScaling);
              }
        }
 public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
 {
     base.OnHotSpotRender(hotSpot, view, mode);
     view.RenderLine(_hotSpotStartPoint.CurrentPosition + Position, _hotSpotEndPoint.CurrentPosition + Position, VisionColors.Grey, 2.0f);
 }
Ejemplo n.º 33
0
 /// <summary>
 /// Called every frame and per hotspot that belongs to the shape
 /// </summary>
 /// <param name="hotSpot"></param>
 public override void OnHotSpotEvaluatePosition(HotSpotBase hotSpot)
 {
  #if (MESHGROUP_USE_LINKING)
   if (hotSpot==_hotSpotSizeX)
   {
     _hotSpotSizeX.Axis = Vector3F.XAxis;
     if (!_hotSpotSizeX.IsDragging)
       _hotSpotSizeX.StartDistance = this.BoxSizeX;
   }
   if (hotSpot==_hotSpotSizeY)
   {
     _hotSpotSizeY.Axis = Vector3F.YAxis;
     if (!_hotSpotSizeY.IsDragging)
       _hotSpotSizeY.StartDistance = this.BoxSizeY;
   }
   if (hotSpot==_hotSpotSizeZ)
   {
     _hotSpotSizeZ.Axis = Vector3F.ZAxis;
     if (!_hotSpotSizeZ.IsDragging)
       _hotSpotSizeZ.StartDistance = this.BoxSizeZ;
   }
  #endif
 }
Ejemplo n.º 34
0
 /// <summary>
 /// Called while the user drags a hotspot that belongs to this shape
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 /// <param name="fDeltaX"></param>
 /// <param name="fDeltaY"></param>
 public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
 {
  #if (MESHGROUP_USE_LINKING)
   if (hotSpot==_hotSpotSizeX)
     this.BoxSizeX = _hotSpotSizeX.CurrentDistance; 
   if (hotSpot==_hotSpotSizeY)
     this.BoxSizeY = _hotSpotSizeY.CurrentDistance; 
   if (hotSpot==_hotSpotSizeZ)
     this.BoxSizeZ = _hotSpotSizeZ.CurrentDistance; 
  #endif
 }
Ejemplo n.º 35
0
 /// <summary>
 /// Called when user starts dragging a hotspot that belongs to this shape
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 public override void OnHotSpotDragBegin(HotSpotBase hotSpot, VisionViewBase view)
 {
  #if (MESHGROUP_USE_LINKING)
   if (hotSpot==_hotSpotSizeX)
     _hotSpotSizeX.StartDistance = this.BoxSizeX;
   if (hotSpot==_hotSpotSizeY)
     _hotSpotSizeY.StartDistance = this.BoxSizeY;
   if (hotSpot==_hotSpotSizeZ)
     _hotSpotSizeZ.StartDistance = this.BoxSizeZ;
  #endif
 }
Ejemplo n.º 36
0
 public override void OnHotSpotEvaluatePosition(HotSpotBase hotSpot)
 {
     // nothing to update here...
 }
Ejemplo n.º 37
0
 /// <summary>
 /// Overridden function
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 /// <param name="mode"></param>
 public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
 {
     base.OnHotSpotRender(hotSpot, view, mode);
     UpdateHotspotVisibility();
 }
 public override void OnHotSpotDragBegin(HotSpotBase hotSpot, VisionViewBase view)
 {
     base.OnHotSpotDragBegin(hotSpot, view);
 }
Ejemplo n.º 39
0
 /// <summary>
 /// Overridden hot spot handle function
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 /// <param name="fDeltaX"></param>
 /// <param name="fDeltaY"></param>
 public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
 {
     base.OnHotSpotDrag (hotSpot, view, fDeltaX, fDeltaY);
 }
Ejemplo n.º 40
0
        /// <summary>
        /// Called when user starts dragging a hotspot that belongs to this shape
        /// </summary>
        /// <param name="hotSpot"></param>
        /// <param name="view"></param>
        public override void OnHotSpotDragBegin(HotSpotBase hotSpot, VisionViewBase view)
        {
            if (hotSpot == _hotSpotX)
            _hotSpotX.StartDistance = Size.X;

              if (hotSpot == _hotSpotY)
            _hotSpotY.StartDistance = Size.Y;

              if (hotSpot == _hotSpotXY)
            _hotSpotXY.StartDistance = Size.GetLength();
        }
Ejemplo n.º 41
0
 /// <summary>
 /// Overridden hot spot handle function
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
 {
     base.OnHotSpotDragEnd (hotSpot, view);
       if (hotSpot==_hotSpotLightGridOfs)
       {
     Vector3F vNewPos = _hotSpotLightGridOfs.CurrentPosition;
     LightGridSampleOfs = _hotSpotLightGridOfs.StartPosition; // set old value for the action
     EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this,"LightGridSampleOfs",vNewPos)); // send an action which sets the property from old value to new one
       }
 }
Ejemplo n.º 42
0
 /// <summary>
 /// Called while the user drags a hotspot that belongs to this shape
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 /// <param name="fDeltaX"></param>
 /// <param name="fDeltaY"></param>
 public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
 {
     if (hotSpot == _hotSpotX)
     Size = new Vector2F(_hotSpotX.CurrentDistance, Size.Y); // update for the view
       if (hotSpot == _hotSpotY)
     Size = new Vector2F(Size.X, _hotSpotY.CurrentDistance); // update for the view
       if(hotSpot == _hotSpotXY)
       {
     float ratio = Size.Y / Size.X;
     float newX = _hotSpotXY.CurrentDistance / (float)System.Math.Sqrt(ratio * ratio + 1.0f);
     float newY = ratio * newX;
     Size = new Vector2F(newX, newY);
       }
 }
 /// <summary>
 /// Called every frame and per hotspot that belongs to the shape
 /// </summary>
 /// <param name="hotSpot"></param>
 public override void OnHotSpotEvaluatePosition(HotSpotBase hotSpot)
 {
     if (hotSpot==_hotSpotSizeX)
       {
     _hotSpotSizeX.Axis = this.XAxis;
     _hotSpotSizeX.Visible = true;
     if (!_hotSpotSizeX.IsDragging)
       _hotSpotSizeX.StartDistance = this.SizeX;
       }
       if (hotSpot==_hotSpotSizeY)
       {
     _hotSpotSizeY.Axis = this.YAxis;
     _hotSpotSizeY.Visible = true;
     if (!_hotSpotSizeY.IsDragging)
       _hotSpotSizeY.StartDistance = this.SizeY;
       }
       if (hotSpot==_hotSpotSizeZ)
       {
     _hotSpotSizeZ.Axis = this.ZAxis;
     _hotSpotSizeZ.Visible = true;
     if (!_hotSpotSizeZ.IsDragging)
       _hotSpotSizeZ.StartDistance = this.SizeZ;
       }
 }
 public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
 {
     base.OnHotSpotRender(hotSpot, view, mode);
 }
Ejemplo n.º 45
0
 /// <summary>
 /// Called while the user drags a hotspot that belongs to this shape
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 /// <param name="fDeltaX"></param>
 /// <param name="fDeltaY"></param>
 public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
 {
     if (hotSpot==_hotSpotSizeX)
     this.BoxSizeX = _hotSpotSizeX.CurrentDistance;
       if (hotSpot==_hotSpotSizeY)
     this.BoxSizeY = _hotSpotSizeY.CurrentDistance;
       if (hotSpot==_hotSpotSizeZ)
     this.BoxSizeZ = _hotSpotSizeZ.CurrentDistance;
 }
Ejemplo n.º 46
0
 public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
 {
     // nothing to update here...
 }
Ejemplo n.º 47
0
 /// <summary>
 /// Called when the user releases the mouse button on a hotspot
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
 {
     if (hotSpot==_hotSpotSizeX)
       {
     if (_hotSpotSizeX.HasChanged)
     {
       float fNewSize = _hotSpotSizeX.CurrentDistance;
       this.BoxSizeX = _hotSpotSizeX.StartDistance; // set old value for the action
       EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this,"BoxSizeX",fNewSize)); // send an action which sets the property from old value to new one
     }
       }
       if (hotSpot==_hotSpotSizeY)
       {
     if (_hotSpotSizeY.HasChanged)
     {
       float fNewSize = _hotSpotSizeY.CurrentDistance;
       this.BoxSizeY = _hotSpotSizeY.StartDistance; // set old value for the action
       EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this,"BoxSizeY",fNewSize)); // send an action which sets the property from old value to new one
     }
       }
       if (hotSpot==_hotSpotSizeZ)
       {
     if (_hotSpotSizeZ.HasChanged)
     {
       float fNewSize = _hotSpotSizeZ.CurrentDistance;
       this.BoxSizeZ = _hotSpotSizeZ.StartDistance; // set old value for the action
       EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this,"BoxSizeZ",fNewSize)); // send an action which sets the property from old value to new one
     }
       }
 }
Ejemplo n.º 48
0
 public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
 {
     // nothing to update here...
 }
 public override void OnHotSpotDrag(HotSpotBase hotSpot, VisionViewBase view, float fDeltaX, float fDeltaY)
 {
     base.OnHotSpotDrag(hotSpot, view, fDeltaX, fDeltaY);
 }
Ejemplo n.º 50
0
        /// <summary>
        /// Called when the user releases the mouse button on a hotspot
        /// </summary>
        /// <param name="hotSpot"></param>
        /// <param name="view"></param>
        public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
        {
            if (hotSpot == _hotSpotX)
              {
            if (_hotSpotX.HasChanged)
            {
              float fNewX = _hotSpotX.CurrentDistance;
              Size = new Vector2F(_hotSpotX.StartDistance, Size.Y); // set old value for the action
              EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "Size", new Vector2F(fNewX, Size.Y))); // send an action which sets the property from old value to new one
            }
              }

              if (hotSpot == _hotSpotY)
              {
            if (_hotSpotY.HasChanged)
            {
              float fNewY = _hotSpotY.CurrentDistance;
              Size = new Vector2F(Size.X, _hotSpotY.StartDistance); // set old value for the action
              EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "Size", new Vector2F(Size.X, fNewY))); // send an action which sets the property from old value to new one
            }
              }

              if (hotSpot == _hotSpotXY)
              {
            if (_hotSpotXY.HasChanged)
            {
              float ratio = Size.Y / Size.X;
              //compute old value
              float oldX = _hotSpotXY.StartDistance / (float)System.Math.Sqrt(ratio * ratio + 1.0f);
              float oldY = oldX * ratio;
              Size = new Vector2F(oldX, oldY); // set old value for the action

              //compute new value
              float newX = _hotSpotXY.CurrentDistance / (float)System.Math.Sqrt(ratio * ratio + 1.0f);
              float newY = ratio * newX;
              EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "Size", new Vector2F(newX, newY))); // send an action which sets the property from old value to new one
            }
              }
        }
 public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
 {
     base.OnHotSpotDragEnd(hotSpot, view);
     if (hotSpot == _hotSpotStartPoint)
     {
         Vector3F vNewPos = _hotSpotStartPoint.CurrentPosition + Position;
         _vStartPoint = _hotSpotStartPoint.StartPosition; // set old value for the action
         EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "StartPoint", vNewPos)); // send an action which sets the property from old value to new one
     }
     else if (hotSpot == _hotSpotEndPoint)
     {
         Vector3F vNewPos = _hotSpotEndPoint.CurrentPosition + Position;
         _vEndPoint = _hotSpotEndPoint.StartPosition; // set old value for the action
         EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "EndPoint", vNewPos)); // send an action which sets the property from old value to new one
     }
 }
Ejemplo n.º 52
0
        /// <summary>
        /// Called every frame and per hotspot that belongs to the shape
        /// </summary>
        /// <param name="hotSpot"></param>
        /// <param name="view"></param>
        /// <param name="mode"></param>
        public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
        {
            base.OnHotSpotRender (hotSpot, view, mode);

              Vector3F vStart = _hotSpotFadeOutDist1.Position;
              Vector3F vEnd = _hotSpotFadeOutDist2.Position;

              view.RenderLine(vStart, vEnd, VisionColors.Yellow, 1.0f);
        }
Ejemplo n.º 53
0
 void SafeRemoveHotSpot(HotSpotBase hotSpot)
 {
     if (hotSpot==null) return;
       EditorManager.ActiveView.HotSpots.Remove(hotSpot);
       hotSpot.Remove();
 }
 public override void OnHotSpotEvaluatePosition(HotSpotBase hotSpot)
 {
     base.OnHotSpotEvaluatePosition(hotSpot);
     if (hotSpot == _hotSpotStartPoint && _hotSpotStartPoint.IsDragging)
     {
         StartPoint = _hotSpotStartPoint.CurrentPosition + Position;
     }
     else if (hotSpot == _hotSpotEndPoint && _hotSpotEndPoint.IsDragging)
     {
         EndPoint = _hotSpotEndPoint.CurrentPosition + Position;
     }
 }
Ejemplo n.º 55
0
        public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
        {
            base.OnHotSpotDragEnd(hotSpot, view);

              if (hotSpot == _hotSpotWindSpeed)
              {
            Vector3F vNewSpeed = _hotSpotWindSpeed.CurrentPosition;
            Vector3F vOldSpeed = _hotSpotWindSpeed.StartPosition;
            if (WindInLocalSpace)
            {
              Matrix3F rot = Matrix3F.Transpose(RotationMatrix);
              vNewSpeed = Matrix3F.Transform(rot, vNewSpeed);
              vOldSpeed = Matrix3F.Transform(rot, vOldSpeed);
            }
            WindSpeed = vOldSpeed; // set old value for the action
            EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "WindSpeed", vNewSpeed)); // send an action which sets the property from old value to new one
              }
              else if (hotSpot == _hotSpotLightSamplingOffset)
              {
            Vector3F vNewOffset = _hotSpotLightSamplingOffset.CurrentPosition;
            Vector3F vOldOffset = _hotSpotLightSamplingOffset.StartPosition;

            LightSamplingOffset = vOldOffset; // set old value for the action
            EditorManager.Actions.Add(SetPropertyAction.CreateSetPropertyAction(this, "LightSamplingOffset", vNewOffset)); // send an action which sets the property from old value to new one
              }
        }
 public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
 {
     base.OnHotSpotRender(hotSpot, view, mode);
     view.RenderLine(_hotSpotStartPoint.CurrentPosition + Position, _hotSpotEndPoint.CurrentPosition + Position, VisionColors.Grey, 2.0f);
 }
Ejemplo n.º 57
0
 public override void OnHotSpotRender(HotSpotBase hotSpot, VisionViewBase view, ShapeRenderMode mode)
 {
     base.OnHotSpotRender(hotSpot, view, mode);
       if (hotSpot == _hotSpotWindSpeed)
       {
     view.RenderArrow(this.RenderPosition, _hotSpotWindSpeed.CurrentPosition + RenderPosition, VisionColors.White, 1.0f, 4.0f);
       }
 }
Ejemplo n.º 58
0
 /// <summary>
 /// Called when the user releases the mouse button on a hotspot
 /// </summary>
 /// <param name="hotSpot"></param>
 /// <param name="view"></param>
 public override void OnHotSpotDragEnd(HotSpotBase hotSpot, VisionViewBase view)
 {
     if (hotSpot == _hotSpotAngle)
       {
     if (_hotSpotAngle.HasChanged)
     {
       float fNewAngle = _hotSpotAngle.CurrentAngle;
       HotSpotAngleValue = _hotSpotAngle.StartAngle; // set old angle for the action
       EditorManager.Actions.Add(new SetPropertyAction(this, "HotSpotAngleValue", fNewAngle)); // send an action which sets the property from old value to new one
     }
       }
 }