0
Purpose of EnableCurrentPosition property
What is the purpose of the EnableCurrentPosition property?
If we inspect the code we can see that it controls whether CurrentPosition is calculated or not:
[HelixViewport3D.cs]
protected override void OnMouseMove(MouseEventArgs e)
{
base.OnMouseMove(e);
if (this.EnableCurrentPosition)
{
var pt = e.GetPosition(this);
var pos = this.FindNearestPoint(pt);
if (pos != null)
{
this.CurrentPosition = pos.Value;
}
else
{
var p = this.Viewport.UnProject(pt);
if (p != null)
{
this.CurrentPosition = p.Value;
}
}
} }
So, each time OnMouseMove method is called the (Point3D) pos is calculated (by FindNearstPoint) and that may be a costly operation to perform each time the mouse is moved.
Why CurrentPosition is needed and why it is optional?
If we inspect the code we can see that it controls whether CurrentPosition is calculated or not:
[HelixViewport3D.cs]
protected override void OnMouseMove(MouseEventArgs e)
{
base.OnMouseMove(e);
if (this.EnableCurrentPosition)
{
var pt = e.GetPosition(this);
var pos = this.FindNearestPoint(pt);
if (pos != null)
{
this.CurrentPosition = pos.Value;
}
else
{
var p = this.Viewport.UnProject(pt);
if (p != null)
{
this.CurrentPosition = p.Value;
}
}
}
So, each time OnMouseMove method is called the (Point3D) pos is calculated (by FindNearstPoint) and that may be a costly operation to perform each time the mouse is moved.
Why CurrentPosition is needed and why it is optional?
Customer support service by UserEcho
If it is enabled, then CurrentPosition (Point3D) property can be used in order to know the 3D point that is under the mouse.
Kind regards,
Christof