DollyExtents - is it really read only?


#1

Dear RhinoCommoners,

I read the RhinoCommon class description for ViewportInfo and it appears that, as with Rhino.NET e.g:
RhUtil.RhinoDollyExtents(pageView, false);
one should be able to reference DollyExtents with RhinoCommon as well, but:
 Rhino.DocObjects.ViewportInfo.DollyExtents(pageView, false);
compiles with error "ViewportInfo does not contain a definition for DollyExtents"
as if DollyExtents were private or non-existent.

Any ideas?

Peter Schwenn
AMTC / Orca3D

p.s. here’s the relevant scrap of RhinoCommon documentation:

The ViewportInfo type exposes the following members.Constructors
 
NameDescriptionViewportInfo()
Initializes a new instance.
ViewportInfo(RhinoViewport)
Copies all of the ViewportInfo data from an existing RhinoViewport.
ViewportInfo(ViewportInfo)
Initializes a new instance by copying values from another instance.
Methods
 
NameDescriptionChangeToParallelProjection
Use this function to change projections of valid viewports
from parallel to perspective. It will make common additional
adjustments to the frustum and camera location so the resulting
views are similar. The camera direction and target point are
not be changed.
If the current projection is parallel and symmetricFrustum,
FrustumIsLeftRightSymmetric() and FrustumIsTopBottomSymmetric()
are all equal, then no changes are made and true is returned.
ChangeToPerspectiveProjection
Use this function to change projections of valid viewports
from parallel to perspective. It will make common additional
adjustments to the frustum and camera location so the resulting
views are similar. The camera direction and target point are
not changed.
If the current projection is perspective and symmetricFrustum,
IsFrustumIsLeftRightSymmetric, and IsFrustumIsTopBottomSymmetric
are all equal, then no changes are made and true is returned.
ChangeToSymmetricFrustum
If needed, adjusts the current frustum so it has the
specified symmetries and adjust the camera location
so the target plane remains visible.
ChangeToTwoPointPerspectiveProjection
Changes projections of valid viewports
to a two point perspective. It will make common additional
adjustments to the frustum and camera location and direction
so the resulting views are similar.
If the current projection is perspective and
IsFrustumIsLeftRightSymmetric is true and
IsFrustumIsTopBottomSymmetric is false, then no changes are
made and true is returned.
Dispose
Actively reclaims unmanaged resources that this instance uses.
DollyCamera
DollyCamera() does not update the frustum’s clipping planes.
To update the frustum’s clipping planes call DollyFrustum(d)
with d = dollyVector o cameraFrameZ. To convert screen locations
into a dolly vector, use GetDollyCameraVector().
Does not update frustum. To update frustum use DollyFrustum(d) with d = dollyVector o cameraFrameZ.
DollyExtents(BoundingBox, Double)
Dolly the camera location and so that the view frustum contains
all of the document objects that can be seen in view.
If the projection is perspective, the camera angle is not changed.
DollyExtents(IEnumerable(GeometryBase), Double)
Dolly the camera location and so that the view frustum contains
all of the document objects that can be seen in view.
If the projection is perspective, the camera angle is not changed.
DollyFrustum
Moves the frustum clipping planes.
Equals


(Dale Fugier) #2

Hi Peter,

What exactly are you trying to do?


#3

Dale,

Move the camera forward or back (for the MainViewport) such that all Selected Objects can be seen in that view.

Peter


(Dale Fugier) #4

Does this help?

protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
  RhinoView view = doc.Views.ActiveView;
  if (null == view)
    return Result.Failure;

  view.ActiveViewport.ZoomExtentsSelected();
  view.Redraw();

  return Result.Success;
}