I need a Plotcube with fixed display area and a double click handler that restores this view. For that I derived a class from ILPlotcude and put the following code for setting the limits in its constructor:
:
float max = 1000f;
Limits.YMax = max;
Limits.XMax = max;
Limits.ZMax = max;
Limits.YMin = -max;
Limits.XMin = -max;
Limits.ZMin = -max;
AspectRatioMode = AspectRatioMode.MaintainRatios;
:
I have also installed a doubleClick-handler in this class with the code above and a additional line to reset the rotation:
:
if (args.Cancel) return;
if (!args.DirectionUp) return;
Rotation = Matrix4.Identity;
float max = 1000f;
Limits.YMax = max;
Limits.XMax = max;
Limits.ZMax = max;
Limits.YMin = -max;
Limits.XMin = -max;
Limits.ZMin = -max;
AspectRatioMode = AspectRatioMode.MaintainRatios;
args.Refresh = true;
args.Cancel = true;
:
The handler is executed but nothing happens. For testing purposes, I put the same code directly into the function OnMouseDoubleClick of of base class ILPlotCube (instead of the function call reset ()). This works as expected, but it cannot be the final solution.
Has anyone an idea, what's wrong ?