Rhino C++ API  8.13
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
CRhinoViewport Class Reference

#include <rhinoSdkViewport.h>

Public Member Functions

 CRhinoViewport ()
 
 ~CRhinoViewport ()
 
CRhinoDisplayPipelineAttachPipeline (CRhinoDisplayPipeline *)
 
unsigned int ChangeCounter () const
 
void ClearUndoInformation (bool bClearProjections=true, bool bClearCPlanes=true)
 
bool ClientToScreenPort (ON_2iPoint &pt) const
 
const ON_3dmConstructionPlaneConstructionPlane () const
 
void CopyFrom (const CRhinoViewport &src, bool copy_id, bool copy_parent_view)
 
void CopyFrom (const CRhinoViewport &src, bool copy_id=false)
 
bool DisplayModeIsShaded (void) const
 
CRhinoDisplayPipelineDisplayPipeline (void) const
 
unsigned int DocumentRuntimeSerialNumber () const
 
bool DollyExtents (ON_BoundingBox bbox, ON::coordinate_system cs)
 
bool DownUpDolly (double)
 down < 0 < up More...
 
bool DownUpRotate (double)
 down < 0 < up More...
 
void DrawActivePoint (const ON_3dPoint &)
 
void DrawArc (const ON_Arc &)
 
void DrawBezier (const ON_BezierCurve &)
 
void DrawBezierCage (const ON_BezierSurface &, int display_density=1)
 
void DrawBezierSurface (const ON_BezierSurface &, int display_density=1)
 
void DrawBoundingBox (const ON_BoundingBox &)
 
void DrawBox (const ON_3dPoint *box_corners)
 
void DrawBrep (const ON_Brep &, int display_density=1)
 
void DrawCircle (const ON_Circle &)
 
ON_Color DrawColor () const
 
void DrawCone (const ON_Cone &cone)
 
void DrawConstructionPlane (const ON_3dmConstructionPlane &cplane, BOOL32 bShowConstructionGrid, BOOL32 bShowConstructionAxes, BOOL32 bShowConstructionZAxis, COLORREF thin_line_color=ON_UNSET_COLOR, COLORREF thick_line_color=ON_UNSET_COLOR, COLORREF grid_x_axis_color=ON_UNSET_COLOR, COLORREF grid_y_axis_color=ON_UNSET_COLOR)
 
void DrawCurve (const ON_Curve &curve)
 
void DrawCylinder (const ON_Cylinder &cylinder)
 
void DrawDirectionArrow (const ON_3dPoint &, const ON_3dVector &, ON_3dPoint *head_point=NULL)
 
void DrawDot (int screen_x, int screen_y, const wchar_t *text=NULL, COLORREF dot_color=RGB(0, 0, 0), COLORREF text_color=ON_UNSET_COLOR)
 
void DrawDot (ON_3dPoint point, const wchar_t *text=NULL, COLORREF dot_color=RGB(0, 0, 0), COLORREF text_color=ON_UNSET_COLOR)
 
void DrawDottedLine (const ON_3dPoint &, const ON_3dPoint &)
 
void DrawExtrusion (const ON_Extrusion &)
 
void DrawFalseColorMesh (const ON_Mesh *, bool bCullCW, COLORREF edge_color=ON_UNSET_COLOR)
 
void DrawLight (const ON_Light &light, COLORREF wireframe_color)
 
void DrawLine (const ON_3dPoint &, const ON_3dPoint &)
 
void DrawNurbsCage (const ON_NurbsCage &, int display_density=1)
 
void DrawNurbsCurve (const ON_NurbsCurve &nurbs_curve)
 
void DrawNurbsSurface (const ON_NurbsSurface &, int display_density=1)
 
void DrawPoint (const ON_3dPoint &, const ON_3dVector *=nullptr)
 
void DrawPointCloud (int point_count, const ON_3dPoint *points, const ON_3dPoint &origin)
 
void DrawRenderPreviewMesh (const ON_Mesh *, const CRhinoMaterial &render_material, BOOL32 bCullCW, BOOL32 bHighlighted)
 
void DrawRhinoObject (const CRhinoObject *, ON_Xform xform, ON_Color color=ON_UNSET_COLOR)
 
void DrawShadedMesh (const ON_Mesh *, bool bCullCW, bool bFlatShade, bool bHighlighted)
 
void DrawSphere (const ON_Sphere &sphere)
 
void DrawString (const wchar_t *string, int slength, const ON_3dPoint &point, int bMiddle=false, int rotation=0, int height=12, const wchar_t *fontface=L"Arial")
 
void DrawSurface (const ON_Surface &, int display_density=1)
 
void DrawTangentBar (const ON_3dPoint &, const ON_3dVector &, ON_3dPoint *start_point=NULL, ON_3dPoint *end_point=NULL)
 
void DrawTorus (const ON_Torus &torus)
 
void DrawTriangle (const ON_3dPoint &p0, const ON_3dPoint &p1, const ON_3dPoint &p2)
 
void DrawTriangle (const ON_3dPoint corners[3])
 
void DrawWireframeMesh (const ON_Mesh *, BOOL32 bCullCW)
 
void EnableFlatShade (bool bFlatShade=true)
 
void EnableSelectedShade (bool bSelectedShade=true)
 
bool FlatShade () const
 
ON_DEPRECATED void GetDisplayXform (ON_Xform &display_xform) const
 
bool GetElevatorHeight (const ON_Line &world_line, const ON_3dPoint &elevator_basepoint, const ON_3dVector &elevator_axis, BOOL32 bGridSnap, double grid_snap_spacing, double *elevator_height) const
 
void GetMarkedObjectXform (int *mark_value, ON_Xform &marked_object_xform) const
 
void GetModelXform (ON_Xform &model_xform) const
 
bool GetPickXform (const ON_4iRect &, ON_Xform &) const
 
bool GetPickXform (int, int, ON_Xform &) const
 picking More...
 
const class CRhTraceImage * GetTraceImage (void) const
 
const class CRhWallpaper * GetWallpaperImage (void) const
 
bool GetZBuffer (class CRhinoZBuffer &) const
 
bool InOutDolly (double)
 out < 0 < in More...
 
bool InterruptDrawing () const
 
bool IsMainViewportTopViewOnly () const
 
bool IsModelView () const
 
bool IsNamedView (bool &modified)
 returns true if the view is very similar to an existing named view in the document More...
 
bool IsPageViewMainViewport () const
 
bool IsPlanView () const
 
bool IsThickDisplayActive (double *thickness_scale=nullptr) const
 
bool IsTraceImage ()
 
bool IsVisible (const ON_3dPoint &) const
 
bool IsVisible (const ON_BoundingBox &) const
 
bool IsWallpaperImage ()
 
bool IsXUp () const
 viewports are either x-up, y-up, or z-up More...
 
bool IsYUp () const
 
bool IsZUp () const
 
int Iteration () const
 
bool LateralDolly (double x, double y)
 left x < 0 < right x, down y < 0 < up y More...
 
bool LeftRightDolly (double)
 left < 0 < right More...
 
bool LeftRightRotate (double)
 keyboard arrow key interaction tools More...
 
bool Magnify (double, int, const ON_2iPoint *=nullptr)
 
bool MouseAdjustLensLength (const ON_2iPoint &mouse0, const ON_2iPoint &mouse1, bool bMoveTarget=false)
 
bool MouseDollyZoom (const ON_2iPoint &mouse0, const ON_2iPoint &mouse1)
 
bool MouseInOutDolly (const ON_2iPoint &mouse0, const ON_2iVector &mouse1)
 
bool MouseLateralDolly (const ON_2iPoint &mouse0, const ON_2iVector &mouse1)
 
bool MouseMagnify (const ON_2iPoint &mouse0, const ON_2iPoint &mouse1)
 
bool MouseRotateCamera (const ON_2iPoint &mouse0, const ON_2iPoint &mouse1)
 
bool MouseRotateView (const ON_2iPoint &mouse0, const ON_2iPoint &mouse1)
 mouse interaction tools More...
 
bool MouseTilt (const ON_2iPoint &mouse0, const ON_2iPoint &mouse1)
 
ON_3dVector MouseTrackballVector (int, int) const
 
ON_wString Name () const
 
bool NextConstructionPlane ()
 
bool NextViewProjection ()
 
void operator delete (void *)
 
void operator delete (void *, void *)
 
void operator delete[] (void *)
 
void * operator new (size_t)
 
void * operator new (size_t, void *)
 in place new/delete More...
 
void * operator new[] (size_t)
 array new/delete More...
 
CRhinoViewParentView () const
 
bool PopConstructionPlane ()
 
bool PopViewProjection ()
 
bool PrevConstructionPlane ()
 
bool PrevViewProjection ()
 
void PushConstructionPlane (const ON_3dmConstructionPlane &cplane)
 
void PushViewProjection ()
 
bool RestoreNamedView (const ON_3dmView &view, CRhinoDoc *pDoc=nullptr, bool bAspectRatio=false, bool bAnimate=false, bool bConstantSpeed=false, int frames=100, double units_per_frame=1.0, int delay=10)
 
unsigned int RuntimeSerialNumber () const
 
int ScreenHeight () const
 
int ScreenWidth () const
 
bool SelectedShade () const
 
void SetCameraDirection (ON_3dVector camera_direction, BOOL32 bUpdateTargetLocation=true)
 
void SetCameraLocation (ON_3dPoint camera_location, BOOL32 bUpdateTargetLocation=true)
 
void SetClippingPlanes (const ON_BoundingBox &)
 set optimal clipping planes to view objects in a world coordinate 3d bounding box More...
 
bool SetClippingRegionTransformation (const ON_4iRect &, class ON_ClippingRegion &clip_region) const
 
bool SetClippingRegionTransformation (int, int, class ON_ClippingRegion &clip_region) const
 
void SetConstructionPlane (const ON_3dmConstructionPlane &cplane)
 
bool SetDisplayMode (const ON_UUID &)
 
ON_DEPRECATED void SetDisplayXform (const ON_Xform &display_xform)
 
ON_Color SetDrawColor (COLORREF color)
 
void SetMarkedObjectXform (int mark_value, const ON_Xform &marked_object_xform)
 
void SetModelXform (const ON_Xform &model_xform)
 
bool SetName (const wchar_t *)
 viewport properties More...
 
void SetScreenSize (int width, int height, bool forceRegen=false)
 
void SetShowConstructionAxes (BOOL32)
 
void SetShowConstructionGrid (BOOL32)
 
void SetShowWorldAxes (BOOL32)
 
void SetTarget (ON_3dPoint target_location, BOOL32 bUpdateCameraLocation=true)
 
void SetTargetAndCameraLocation (ON_3dPoint target_location, ON_3dPoint camera_location, BOOL32 bUpdateCameraDirection=true, BOOL32 bAddToViewStack=true)
 
bool SetToBackView (const wchar_t *sViewName=nullptr, BOOL32 bUpdateConstructionPlane=true)
 
bool SetToBottomView (const wchar_t *sViewName=nullptr, BOOL32 bUpdateConstructionPlane=true)
 
bool SetToFrontView (const wchar_t *sViewName=nullptr, BOOL32 bUpdateConstructionPlane=true)
 
bool SetToLeftView (const wchar_t *sViewName=nullptr, BOOL32 bUpdateConstructionPlane=true)
 
bool SetToPerspectiveView (const wchar_t *sViewName=nullptr, BOOL32 bUpdateConstructionPlane=true)
 
bool SetToPlanView (const ON_3dPoint &, const ON_3dVector &, const ON_3dVector &, BOOL32=false)
 Default views. More...
 
bool SetToRightView (const wchar_t *sViewName=nullptr, BOOL32 bUpdateConstructionPlane=true)
 
bool SetToTopView (const wchar_t *sViewName=nullptr, BOOL32 bUpdateConstructionPlane=true)
 
bool SetToTwoPointPerspectiveView (const wchar_t *sViewName, bool bUpdateConstructionPlane=true)
 
bool SetTraceImage (const ON_3dmViewTraceImage &traceimage)
 
void SetView (const ON_3dmView &view)
 
bool SetVP (const ON_Viewport &, BOOL32 bUpdateTargetLocation, BOOL32 bAddToViewStack=true)
 
bool SetWallpaperImage (const ON_3dmWallpaperImage &wallpaper)
 
bool ShowConstructionAxes () const
 controls display of construction plane axes More...
 
bool ShowConstructionGrid () const
 controls display of construction plane grid More...
 
bool ShowWorldAxes () const
 controls display of world axes icon More...
 
ON_3dPoint Target () const
 viewport target point More...
 
bool UpdateTransforms (BOOL32 bForceUpdate=false)
 
const ON_3dmViewView () const
 
ON_UUID ViewportId () const
 
const ON_ViewportVP () const
 

Static Public Member Functions

static ON::active_space ActiveSpaceFromViewType (ON::view_type view_type)
 
static CRhinoViewportFromRuntimeSerialNumber (unsigned int rhino_viewport_sn)
 
static CRhinoViewportFromViewportId (ON_UUID rhino_viewport_id)
 
static unsigned int GetViewportList (unsigned int rhino_doc_sn, unsigned int rhino_view_sn, ON_SimpleArray< unsigned int > &rhino_viewport_sn_list)
 
static unsigned int GetViewportList (unsigned int rhino_doc_sn, unsigned int rhino_view_sn, unsigned int rhino_viewport_sn0, size_t rhino_viewport_sn_list_capacity, unsigned int *rhino_viewport_sn_list)
 
static unsigned int HeadRuntimeSerialNumber ()
 
static bool IsValidViewportPointer (const void *viewport)
 
static bool IsValidViewportReference (const CRhinoViewport &viewport)
 
static unsigned int RuntimeSerialNumber (const CRhinoViewport *viewport)
 
static unsigned int TailRuntimeSerialNumber ()
 
static ON::view_type ViewTypeFromActiveSpace (ON::active_space active_space)
 

Public Attributes

ON_3dmView m_v
 pretend these are private and you'll be happier. More...
 
ON_ClassArray< ON_3dmViewm_view_stack
 
int m_view_stack_index = -1
 -1 or index of view in use More...
 

Friends

class CRhinoDetailViewObject
 
class CRhinoView
 
class CRhViewportPrivate
 

Detailed Description

Copyright (c) 1993-2017 Robert McNeel & Associates. All rights reserved. Rhinoceros is a registered trademark of Robert McNeel & Associates.

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.

For complete Rhino SDK copyright information see http://www.rhino3d.com/developer.

Constructor & Destructor Documentation

◆ CRhinoViewport()

CRhinoViewport::CRhinoViewport ( )

◆ ~CRhinoViewport()

CRhinoViewport::~CRhinoViewport ( )

Member Function Documentation

◆ ActiveSpaceFromViewType()

static ON::active_space CRhinoViewport::ActiveSpaceFromViewType ( ON::view_type  view_type)
static

◆ AttachPipeline()

CRhinoDisplayPipeline* CRhinoViewport::AttachPipeline ( CRhinoDisplayPipeline )

◆ ChangeCounter()

unsigned int CRhinoViewport::ChangeCounter ( ) const

Description: The value of change counter is incremented every time the view projection or construction plane changes. The user can the mouse and nestable view manipulation commands to change a view at any time. The value value of change counter can be used to detect these changes in code that is sensitive to the view projection. Returns: current value of change counter. (m_vp_iteration) Example: change_counter0 = vp.ChangeCounter(). ... if ( change_counter0 != vp.ChangeCounter() ) { view projection changed }

◆ ClearUndoInformation()

void CRhinoViewport::ClearUndoInformation ( bool  bClearProjections = true,
bool  bClearCPlanes = true 
)

Description: Clears saved view projections and cplanes. Parameters: bClearProjections - [in] if true, then saved view projections are cleared. bClearCPlanes - [in] if true, then saved construction planes are cleared. Remarks: This function should be used only in special circumstances, like when a new file is read. Calling this function destroys the information needed in commands likeUndoView and CPlaneNext/CPlanePrevious.

◆ ClientToScreenPort()

bool CRhinoViewport::ClientToScreenPort ( ON_2iPoint pt) const

Description: Convert a point in parent CRhinoView client window coordinates to the ON_Viewport screen port client coordinates. The screen port of a CRhinoViewport may not match the client area of the parent CRhinoView. This occurs in cases when the CRhinoViewport is a nested child viewport Parameters: pt [in/out]: point in client coordinates of parent CRhinoView window as input. This is converted to the screen port client coordinates of the ON_Viewport as output Returns: true if the point is inside of the CRhinoViewport's screen port rectangle

◆ ConstructionPlane()

const ON_3dmConstructionPlane& CRhinoViewport::ConstructionPlane ( ) const

Returns: Viewport construction plane

◆ CopyFrom() [1/2]

void CRhinoViewport::CopyFrom ( const CRhinoViewport src,
bool  copy_id,
bool  copy_parent_view 
)

◆ CopyFrom() [2/2]

void CRhinoViewport::CopyFrom ( const CRhinoViewport src,
bool  copy_id = false 
)

Description: Similar to an operator= except this will not modify the viewport id unless told to. Items not copied are: m_draw_step, m_vp_iteration, m_xform_iteration, m_dp m_cplane_stack, m_cplane_stack_index Parameters: src [in]: CRhinoViewport to copy information from copy_id [in]: If true, this viewport's id will be changed to match that of src. This is typically NOT something that you want to do. This set to true for operations like printing in order to work with a temporary CRhinoViewport that is an exact duplicate of the src viewport

◆ DisplayModeIsShaded()

bool CRhinoViewport::DisplayModeIsShaded ( void  ) const

Determine if this viewport's display attributes support "shading". This assumption here is that if shading is supported, then objects will be shaded.

◆ DisplayPipeline()

CRhinoDisplayPipeline* CRhinoViewport::DisplayPipeline ( void  ) const

◆ DocumentRuntimeSerialNumber()

unsigned int CRhinoViewport::DocumentRuntimeSerialNumber ( ) const

Returns: The serial number of the view's document, if one exists. Zero if there is no view or no document associated with this viewport.

◆ DollyExtents()

bool CRhinoViewport::DollyExtents ( ON_BoundingBox  bbox,
ON::coordinate_system  cs 
)

Description: Dolly the camera (change its location) so that the bbox is centered in the viewport and fills the central region of the viewport. The "target" point is updated to be the center of the bounding box. Parameters: bbox - [in] cs - [in] coordinates system of the bounding box. NOTE WELL: If cs is anything besides ON::world_cs, the the coordinates are with respect to the current projection returned by this->VP(). Note that the call to DollyExtents will change the projection so that any non-world coordinate bbox will not be valid after the function returns. If this is confusing, then restrict yourself to using world coordinate bounding boxes and cs = ON::world_cs. Remarks: The Rhino "ZoomExtents" command uses DollyExtents to calculate the view projection. Technically, "zoom" would leave the camera location fixed and modify the camera angle.

◆ DownUpDolly()

bool CRhinoViewport::DownUpDolly ( double  )

down < 0 < up

◆ DownUpRotate()

bool CRhinoViewport::DownUpRotate ( double  )

down < 0 < up

◆ DrawActivePoint()

void CRhinoViewport::DrawActivePoint ( const ON_3dPoint )

◆ DrawArc()

void CRhinoViewport::DrawArc ( const ON_Arc )

◆ DrawBezier()

void CRhinoViewport::DrawBezier ( const ON_BezierCurve )

◆ DrawBezierCage()

void CRhinoViewport::DrawBezierCage ( const ON_BezierSurface ,
int  display_density = 1 
)

◆ DrawBezierSurface()

void CRhinoViewport::DrawBezierSurface ( const ON_BezierSurface ,
int  display_density = 1 
)

◆ DrawBoundingBox()

void CRhinoViewport::DrawBoundingBox ( const ON_BoundingBox )

◆ DrawBox()

void CRhinoViewport::DrawBox ( const ON_3dPoint box_corners)

◆ DrawBrep()

void CRhinoViewport::DrawBrep ( const ON_Brep ,
int  display_density = 1 
)

◆ DrawCircle()

void CRhinoViewport::DrawCircle ( const ON_Circle )

◆ DrawColor()

ON_Color CRhinoViewport::DrawColor ( ) const

◆ DrawCone()

void CRhinoViewport::DrawCone ( const ON_Cone cone)

◆ DrawConstructionPlane()

void CRhinoViewport::DrawConstructionPlane ( const ON_3dmConstructionPlane cplane,
BOOL32  bShowConstructionGrid,
BOOL32  bShowConstructionAxes,
BOOL32  bShowConstructionZAxis,
COLORREF  thin_line_color = ON_UNSET_COLOR,
COLORREF  thick_line_color = ON_UNSET_COLOR,
COLORREF  grid_x_axis_color = ON_UNSET_COLOR,
COLORREF  grid_y_axis_color = ON_UNSET_COLOR 
)

◆ DrawCurve()

void CRhinoViewport::DrawCurve ( const ON_Curve curve)

◆ DrawCylinder()

void CRhinoViewport::DrawCylinder ( const ON_Cylinder cylinder)

◆ DrawDirectionArrow()

void CRhinoViewport::DrawDirectionArrow ( const ON_3dPoint ,
const ON_3dVector ,
ON_3dPoint head_point = NULL 
)

◆ DrawDot() [1/2]

void CRhinoViewport::DrawDot ( int  screen_x,
int  screen_y,
const wchar_t *  text = NULL,
COLORREF  dot_color = RGB(0, 0, 0),
COLORREF  text_color = ON_UNSET_COLOR 
)

◆ DrawDot() [2/2]

void CRhinoViewport::DrawDot ( ON_3dPoint  point,
const wchar_t *  text = NULL,
COLORREF  dot_color = RGB(0, 0, 0),
COLORREF  text_color = ON_UNSET_COLOR 
)

◆ DrawDottedLine()

void CRhinoViewport::DrawDottedLine ( const ON_3dPoint ,
const ON_3dPoint  
)

◆ DrawExtrusion()

void CRhinoViewport::DrawExtrusion ( const ON_Extrusion )

◆ DrawFalseColorMesh()

void CRhinoViewport::DrawFalseColorMesh ( const ON_Mesh ,
bool  bCullCW,
COLORREF  edge_color = ON_UNSET_COLOR 
)

◆ DrawLight()

void CRhinoViewport::DrawLight ( const ON_Light light,
COLORREF  wireframe_color 
)

◆ DrawLine()

void CRhinoViewport::DrawLine ( const ON_3dPoint ,
const ON_3dPoint  
)

◆ DrawNurbsCage()

void CRhinoViewport::DrawNurbsCage ( const ON_NurbsCage ,
int  display_density = 1 
)

◆ DrawNurbsCurve()

void CRhinoViewport::DrawNurbsCurve ( const ON_NurbsCurve nurbs_curve)

◆ DrawNurbsSurface()

void CRhinoViewport::DrawNurbsSurface ( const ON_NurbsSurface ,
int  display_density = 1 
)

◆ DrawPoint()

void CRhinoViewport::DrawPoint ( const ON_3dPoint ,
const ON_3dVector = nullptr 
)

◆ DrawPointCloud()

void CRhinoViewport::DrawPointCloud ( int  point_count,
const ON_3dPoint points,
const ON_3dPoint origin 
)

◆ DrawRenderPreviewMesh()

void CRhinoViewport::DrawRenderPreviewMesh ( const ON_Mesh ,
const CRhinoMaterial render_material,
BOOL32  bCullCW,
BOOL32  bHighlighted 
)

◆ DrawRhinoObject()

void CRhinoViewport::DrawRhinoObject ( const CRhinoObject ,
ON_Xform  xform,
ON_Color  color = ON_UNSET_COLOR 
)

◆ DrawShadedMesh()

void CRhinoViewport::DrawShadedMesh ( const ON_Mesh ,
bool  bCullCW,
bool  bFlatShade,
bool  bHighlighted 
)

◆ DrawSphere()

void CRhinoViewport::DrawSphere ( const ON_Sphere sphere)

◆ DrawString()

void CRhinoViewport::DrawString ( const wchar_t *  string,
int  slength,
const ON_3dPoint point,
int  bMiddle = false,
int  rotation = 0,
int  height = 12,
const wchar_t *  fontface = L"Arial" 
)

◆ DrawSurface()

void CRhinoViewport::DrawSurface ( const ON_Surface ,
int  display_density = 1 
)

◆ DrawTangentBar()

void CRhinoViewport::DrawTangentBar ( const ON_3dPoint ,
const ON_3dVector ,
ON_3dPoint start_point = NULL,
ON_3dPoint end_point = NULL 
)

◆ DrawTorus()

void CRhinoViewport::DrawTorus ( const ON_Torus torus)

◆ DrawTriangle() [1/2]

void CRhinoViewport::DrawTriangle ( const ON_3dPoint p0,
const ON_3dPoint p1,
const ON_3dPoint p2 
)

◆ DrawTriangle() [2/2]

void CRhinoViewport::DrawTriangle ( const ON_3dPoint  corners[3])

◆ DrawWireframeMesh()

void CRhinoViewport::DrawWireframeMesh ( const ON_Mesh ,
BOOL32  bCullCW 
)

◆ EnableFlatShade()

void CRhinoViewport::EnableFlatShade ( bool  bFlatShade = true)

Description: By default, shaded viewports can either use smooth shading. If flat shading is enabled, then mesh objects are flat shaded. Parameters: bFlatShade - [in] If true, all mesh objects in this viewport will be flat shaded.
See Also: CRhinoViewport::SetDisplayMode CRhinoViewport::EnableSelectedShade CRhinoViewport::FlatShade

◆ EnableSelectedShade()

void CRhinoViewport::EnableSelectedShade ( bool  bSelectedShade = true)

Description: By default, all surface and mesh objects are shaded in shaded viewports. If bSelectedShade is true, then only selected mesh and solid objects are shaded. Parameters: bSelectedShade - [in] If true, only selected mesh and surface objects are shaded in shaded. See Also: CRhinoViewport::SetDisplayMode CRhinoViewport::EnableFlatShade CRhinoViewport::SelectedShade

◆ FlatShade()

bool CRhinoViewport::FlatShade ( ) const

Returns: True if all mesh objects in this viewport will be flat shaded.
See Also: CRhinoViewport::EnableFlatShade

◆ FromRuntimeSerialNumber()

static CRhinoViewport* CRhinoViewport::FromRuntimeSerialNumber ( unsigned int  rhino_viewport_sn)
static

Parameters: rhino_viewport_sn - [out] CRhinoViewport runtime serial number Returns: A pointer to the CRhinoViewport class with the specified runtime serial number or null if none exists.

◆ FromViewportId()

static CRhinoViewport* CRhinoViewport::FromViewportId ( ON_UUID  rhino_viewport_id)
static

Parameters: rhino_doc_sn - [in] 0: iteration ignores the document a viewportport is associated with. >0: iteration is restricted to viewportports associated with a specific document. rhino_view_sn - [in] 0: iteration ignores the viewport a viewportport is associated with. >0: iteration is restricted to viewportports associated with the specified viewport. rhino_viewport_id - [in]

◆ GetDisplayXform()

ON_DEPRECATED void CRhinoViewport::GetDisplayXform ( ON_Xform display_xform) const

Description: Get the display transformation that is applied to the projected geometry immediately before it is drawn.
Parameters: display_xform - [out] Remarks: The default display transformation is the identity. The display transformation is intended to be used in printing applications. The camera and projection transformations are handled in the m_v settings. See Also: CRhinoViewport::SetDisplayXform

◆ GetElevatorHeight()

bool CRhinoViewport::GetElevatorHeight ( const ON_Line world_line,
const ON_3dPoint elevator_basepoint,
const ON_3dVector elevator_axis,
BOOL32  bGridSnap,
double  grid_snap_spacing,
double *  elevator_height 
) const

Description: Calculate elevator mode point Parameters: world_line - [in] line from near to far clipping plane that projects to mouse point. elevator_basepoint - [in] elevator_axis - [in] unit vector bGridSnap - [in] true if grid snap is enabled. When in doubt, use value of RhinoApp().AppSettings().GridSnap(). grid_snap_spacing - [in] grid snap distance. When in doubt, use value of ConstructionPlane().m_snap_spacing elevator_height -[out] elevator height returned here. Returns: true if point is successfully calculated. The 3d location is elevator_basepoint + elevator_height*elevator_axis.

◆ GetMarkedObjectXform()

void CRhinoViewport::GetMarkedObjectXform ( int *  mark_value,
ON_Xform marked_object_xform 
) const

Description: Get the display transformation that is applied to marked objects. Parameters: mark_value - [out] marked_object_xform - [out] See Also: CRhinoViewport::SetMarkedObjectXform

◆ GetModelXform()

void CRhinoViewport::GetModelXform ( ON_Xform model_xform) const

Description: Get the model transformation that is applied to geometry before it is drawn. Parameters: model_xform - [out] Remarks: The default model transformation is the identity. The model transformation is intended to be used for dynamic drawing of objects. The camera and projection transformations are handled in the m_v settings. See Also: CRhinoViewport::SetModelXform

◆ GetPickXform() [1/2]

bool CRhinoViewport::GetPickXform ( const ON_4iRect ,
ON_Xform  
) const

◆ GetPickXform() [2/2]

bool CRhinoViewport::GetPickXform ( int  ,
int  ,
ON_Xform  
) const

picking

GetPickXform takes a rectangle in screen coordinates and returns a transformation that maps the 3d frustum defined by the rectangle to a -1/+1 clipping coordinate box.

◆ GetTraceImage()

const class CRhTraceImage* CRhinoViewport::GetTraceImage ( void  ) const

◆ GetViewportList() [1/2]

static unsigned int CRhinoViewport::GetViewportList ( unsigned int  rhino_doc_sn,
unsigned int  rhino_view_sn,
ON_SimpleArray< unsigned int > &  rhino_viewport_sn_list 
)
static

Description: In most cases, it is easier, faster and more robust to use a CRhinoViewportIterator to go through the list of viewports. In the rare case when you really do want a list of all existing viewport serial numbers, use this function. Parameters: rhino_doc_sn - [in] 0: iteration ignores the document a viewportport is associated with. >0: iteration is restricted to viewportports associated with a specific document. rhino_view_sn - [in] 0: iteration ignores the viewport a viewportport is associated with. >0: iteration is restricted to viewportports associated with the specified viewport. rhino_viewport_sn_list - [out] list of rhino viewport serial numbers in increasing order. Returns: Number of rhino viewport serial numbers in rhino_viewport_sn_list[]. See Also: CRhinoViewportIterator

◆ GetViewportList() [2/2]

static unsigned int CRhinoViewport::GetViewportList ( unsigned int  rhino_doc_sn,
unsigned int  rhino_view_sn,
unsigned int  rhino_viewport_sn0,
size_t  rhino_viewport_sn_list_capacity,
unsigned int *  rhino_viewport_sn_list 
)
static

Description: In most cases, it is easier, faster and more robust to use a CRhinoViewportIterator to go through the list of viewports. In the rare case when you really do want a list of existing viewport serial numbers, use this function. Parameters: rhino_doc_sn - [in] 0: iteration ignores the document a viewportport is associated with. >0: iteration is restricted to viewportports associated with a specific document. rhino_view_sn - [in] 0: iteration ignores the viewport a viewportport is associated with. >0: iteration is restricted to viewportports associated with the specified viewport. rhino_viewport_sn0 - [in] Serial numbers <= rhino_viewport_sn0 will not be added to rhino_viewport_sn_list[]. rhino_viewport_sn_list_capacity - [in] maximum number of elements in rhino_viewport_sn_list[] array. rhino_viewport_sn_list - [out] list of rhino viewport serial numbers > rhino_viewport_sn0. Returns: Number of rhino viewports set in rhino_viewport_sn_list[]. See Also: CRhinoViewportIterator

◆ GetWallpaperImage()

const class CRhWallpaper* CRhinoViewport::GetWallpaperImage ( void  ) const

◆ GetZBuffer()

bool CRhinoViewport::GetZBuffer ( class CRhinoZBuffer ) const

Description: Retrieves the exact contents of this viewport's entire z-buffer. Meaning, what you see is what you get...If you want to change the output contents of the z-buffer, (ie. forced shading) then you should construct your own CRhinoZBuffer
object using this viewport, make the appropirate CRhinoZBuffer method calls, and then "Capture()" the z-buffer (see CRhinoZBuffer for details). Parameters: CRhinoZBuffer& : output parameter that will contain all captured z-buffer info. Returns: true: If z-buffer was successfully captured... false: If no z-buffer was captured (or some other failure occurred).

Examples:

CRhinoZBuffer   zbuffer;

/ Test contents of entire zbuffer... if ( pView->Viewport().GetZBuffer( zbuffer ) )

for (int y = 0; y < zbuffer.Height(); y++) for (int x = 0; x < zbuffer.Width(); x++) { float z = zbuffer.ZValue( x, y );

if ( (z > 0.0) && (z < 1.0) ) { / Then point (x,y) 'hit' something... } }

/ Test contents of a rectangular area within the z-buffer and convert / the hit points to 3D world coordinates... CRhinoZBuffer zbuffer; CRect rect = some rectangular portion of the viewport... ON_SimpleArray<ON_3dPoint> points;

if ( pView->Viewport().GetZBuffer( zbuffer ) ) for (int y = rect.top; y < rect.bottom; y++) for (int x = rect.left; x < rect.right; x++) { float z = zbuffer.ZValue( x, y );

if ( (z > 0.0) && (z < 1.0) ) { points.Append( zbuffer.WorldPoint( x, y ) ); } }

◆ HeadRuntimeSerialNumber()

static unsigned int CRhinoViewport::HeadRuntimeSerialNumber ( )
static

Returns: The serial number of the oldest viewport that exists or 0 if no viewports exist. This will be the smallest serial number of any viewport that currently exits.

◆ InOutDolly()

bool CRhinoViewport::InOutDolly ( double  )

out < 0 < in

◆ InterruptDrawing()

bool CRhinoViewport::InterruptDrawing ( ) const

◆ IsMainViewportTopViewOnly()

bool CRhinoViewport::IsMainViewportTopViewOnly ( ) const

Description: Determines if this viewport is should be able to be panned and zoomed, but not rotated or changed to a different camera view vector. This is used by functions that attempt to set the viewport's projection. If the projection is not compatible with a page view / UV Editor view and IsMainViewportTopViewOnly() == true, then the setting of the projection is not allowed Return: true if thie viewport is the main viewport for a CRhinoPageView

◆ IsModelView()

bool CRhinoViewport::IsModelView ( ) const

Description: Return true if m_v.m_view_type == ON::model_view_type.

◆ IsNamedView()

bool CRhinoViewport::IsNamedView ( bool &  modified)

returns true if the view is very similar to an existing named view in the document

◆ IsPageViewMainViewport()

bool CRhinoViewport::IsPageViewMainViewport ( ) const

Description: Determines if this viewport is the main viewport for a page view. Page views should be able to be panned and zoomed, but not rotated or changed to a different camera view vector. This is used by functions that attempt to set the viewport's projection. If the projection is not compatible with a page view and IsPageViewMainViewport() == true, then the setting of the projection is not allowed Return: true if thie viewport is the main viewport for a CRhinoPageView

◆ IsPlanView()

bool CRhinoViewport::IsPlanView ( ) const

returns true if construction plane z axis is parallel to camera direction.

◆ IsThickDisplayActive()

bool CRhinoViewport::IsThickDisplayActive ( double *  thickness_scale = nullptr) const

Description: Determines if printing or "print display" is active for this viewport Parameters: thickness_scale [out] - optional. Scale applied to an object's plot thickness for displaying on the screen or printing Returns: true if printing or print display is active for this viewport

◆ IsTraceImage()

bool CRhinoViewport::IsTraceImage ( )

Description: Verifies the existence of background bitmap. Parameters: None. Returns: True if a background bitmap exists. False otherwise Remarks: THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN THE FUTURE. If you require similar functionality, use RhinoCreatePictureFrame(). See rhinoSdkObject.h for details.

◆ IsValidViewportPointer()

static bool CRhinoViewport::IsValidViewportPointer ( const void *  viewport)
static

Returns: True if rhino_viewport is null or points to an existing CRhinoViewport.

◆ IsValidViewportReference()

static bool CRhinoViewport::IsValidViewportReference ( const CRhinoViewport viewport)
static

◆ IsVisible() [1/2]

bool CRhinoViewport::IsVisible ( const ON_3dPoint ) const

Description: returns true if the world coordinate point is visible in the viewing frustum.

◆ IsVisible() [2/2]

bool CRhinoViewport::IsVisible ( const ON_BoundingBox ) const

Description: returns true if some portion world coordinate bounding box is potentially visible in the viewing frustum.

◆ IsWallpaperImage()

bool CRhinoViewport::IsWallpaperImage ( )

Description: Verifies the existence of a wallpaper. Parameters: None. Returns: True if a wallpaper exists. False otherwise

◆ IsXUp()

bool CRhinoViewport::IsXUp ( ) const

viewports are either x-up, y-up, or z-up

◆ IsYUp()

bool CRhinoViewport::IsYUp ( ) const

◆ IsZUp()

bool CRhinoViewport::IsZUp ( ) const

◆ Iteration()

int CRhinoViewport::Iteration ( ) const
inline

◆ LateralDolly()

bool CRhinoViewport::LateralDolly ( double  x,
double  y 
)

left x < 0 < right x, down y < 0 < up y

◆ LeftRightDolly()

bool CRhinoViewport::LeftRightDolly ( double  )

left < 0 < right

◆ LeftRightRotate()

bool CRhinoViewport::LeftRightRotate ( double  )

keyboard arrow key interaction tools

left < 0 < right

◆ Magnify()

bool CRhinoViewport::Magnify ( double  ,
int  ,
const ON_2iPoint = nullptr 
)

◆ MouseAdjustLensLength()

bool CRhinoViewport::MouseAdjustLensLength ( const ON_2iPoint mouse0,
const ON_2iPoint mouse1,
bool  bMoveTarget = false 
)

◆ MouseDollyZoom()

bool CRhinoViewport::MouseDollyZoom ( const ON_2iPoint mouse0,
const ON_2iPoint mouse1 
)

◆ MouseInOutDolly()

bool CRhinoViewport::MouseInOutDolly ( const ON_2iPoint mouse0,
const ON_2iVector mouse1 
)

◆ MouseLateralDolly()

bool CRhinoViewport::MouseLateralDolly ( const ON_2iPoint mouse0,
const ON_2iVector mouse1 
)

◆ MouseMagnify()

bool CRhinoViewport::MouseMagnify ( const ON_2iPoint mouse0,
const ON_2iPoint mouse1 
)

◆ MouseRotateCamera()

bool CRhinoViewport::MouseRotateCamera ( const ON_2iPoint mouse0,
const ON_2iPoint mouse1 
)

Description: Rotate view around camera location.

◆ MouseRotateView()

bool CRhinoViewport::MouseRotateView ( const ON_2iPoint mouse0,
const ON_2iPoint mouse1 
)

mouse interaction tools

Description: Rotate view around target.

◆ MouseTilt()

bool CRhinoViewport::MouseTilt ( const ON_2iPoint mouse0,
const ON_2iPoint mouse1 
)

◆ MouseTrackballVector()

ON_3dVector CRhinoViewport::MouseTrackballVector ( int  ,
int   
) const

◆ Name()

ON_wString CRhinoViewport::Name ( ) const

◆ NextConstructionPlane()

bool CRhinoViewport::NextConstructionPlane ( )

Description: Sets the construction plane to the plane that was active before the last call to PrevConstructionPlane. Returns: true if a construction plane was popped. See Also: CRhinoViewport::PushConstructionPlane, CRhinoViewport::SetConstructionPlane CRhinoViewport::ConstructionPlane

◆ NextViewProjection()

bool CRhinoViewport::NextViewProjection ( )

Description: Sets the view projection and target to the settings that were active before the last call to PrevView. Returns: true if the view stack was popped.

◆ operator delete() [1/2]

void CRhinoViewport::operator delete ( void *  )

◆ operator delete() [2/2]

void CRhinoViewport::operator delete ( void *  ,
void *   
)

◆ operator delete[]()

void CRhinoViewport::operator delete[] ( void *  )

◆ operator new() [1/2]

void* CRhinoViewport::operator new ( size_t  )

Override operator new/delete to make sure allocate/deallocate occurs in same memory manager See comments at the top of opennurbs_object.cpp for details. new/delete

◆ operator new() [2/2]

void* CRhinoViewport::operator new ( size_t  ,
void *   
)

in place new/delete

◆ operator new[]()

void* CRhinoViewport::operator new[] ( size_t  )

array new/delete

◆ ParentView()

CRhinoView* CRhinoViewport::ParentView ( ) const

Description: Gets the parent view, if there is one. Returns: A pointer to the parent view or NULL. Remarks: Every CRhinoView has an associated CRhinoViewport that does all the 3d display work. Those associated viewports return the CRhinoView as their parent view. However, CRhinoViewports are used in other image creating contexts that do not have a parent CRhinoView. If you call ParentView, you MUST check for NULL return values.

◆ PopConstructionPlane()

bool CRhinoViewport::PopConstructionPlane ( )

Description: Sets the construction plane to the plane that was active before the last call to PushConstructionPlane. Returns: true if a construction plane was popped. See Also: CRhinoViewport::PushConstructionPlane, CRhinoViewport::SetConstructionPlane CRhinoViewport::ConstructionPlane

◆ PopViewProjection()

bool CRhinoViewport::PopViewProjection ( )

Description: Sets the view projection and target to the settings at the top of the view stack and removes those settings from the view stack.

◆ PrevConstructionPlane()

bool CRhinoViewport::PrevConstructionPlane ( )

Description: Sets the construction plane to the plane that was active before the last call to NextConstructionPlane or SetConstructionPlane. Returns: true if a construction plane was popped. See Also: CRhinoViewport::PushConstructionPlane, CRhinoViewport::SetConstructionPlane CRhinoViewport::ConstructionPlane

◆ PrevViewProjection()

bool CRhinoViewport::PrevViewProjection ( )

Description: Sets the view projection and target to the settings that were active before the last call to NextViewProjection. Returns: true if the view stack was popped.

◆ PushConstructionPlane()

void CRhinoViewport::PushConstructionPlane ( const ON_3dmConstructionPlane cplane)

Description: Pushes the current construction plane on the viewport's construction plane stack and sets the construction plane to cplane. Parameters: cplane - [in] Returns: true if a construction plane was popped. See Also: CRhinoViewport::PopConstructionPlane, CRhinoViewport::SetConstructionPlane CRhinoViewport::ConstructionPlane

◆ PushViewProjection()

void CRhinoViewport::PushViewProjection ( )

Description: Appends the current view projection and target to the viewport's view stack.

◆ RestoreNamedView()

bool CRhinoViewport::RestoreNamedView ( const ON_3dmView view,
CRhinoDoc pDoc = nullptr,
bool  bAspectRatio = false,
bool  bAnimate = false,
bool  bConstantSpeed = false,
int  frames = 100,
double  units_per_frame = 1.0,
int  delay = 10 
)

Description: Expert user function to set viewport projection, target location, name, display mode, window location in the Rhino mainframe, construction plane and wallpaper bitmap using the same code used by the NamedView command - including support for animation fixed-aspect ratio and so on. Parameters: view - [in] The view to set. pDoc - [in] The document is only used to retrieve information about other affected objects and data, including clipping planes. Can be nullptr.

◆ RuntimeSerialNumber() [1/2]

unsigned int CRhinoViewport::RuntimeSerialNumber ( ) const

◆ RuntimeSerialNumber() [2/2]

static unsigned int CRhinoViewport::RuntimeSerialNumber ( const CRhinoViewport viewport)
static

◆ ScreenHeight()

int CRhinoViewport::ScreenHeight ( ) const

◆ ScreenWidth()

int CRhinoViewport::ScreenWidth ( ) const

◆ SelectedShade()

bool CRhinoViewport::SelectedShade ( ) const

Returns: True if only selected objects are shaded. See Also: CRhinoViewport::EnableSelectedShade

◆ SetCameraDirection()

void CRhinoViewport::SetCameraDirection ( ON_3dVector  camera_direction,
BOOL32  bUpdateTargetLocation = true 
)

Description: Set viewport camera direction. By default the target location is changed so that the vector from the camera location to the target is parallel to the camera direction. Parameters: camera_direction - [in] new camera direction bUpdateTarget - [in] if true, the target location is changed so that the vector from the camera location to the target is parallel to the camera direction. If false, the target location is not changed. See the remarks section of CRhinoViewport::SetTarget for important details. Remarks: See the remarks section of CRhinoViewport::SetTarget for important details. See Also: CRhinoViewport::Target CRhinoViewport::SetTarget CRhinoViewport::SetTargetAndCameraLocation CRhinoViewport::SetCameraLocation CRhinoViewport::SetCameraDirection CRhinoViewport::SetVP CRhinoViewport::SetView

◆ SetCameraLocation()

void CRhinoViewport::SetCameraLocation ( ON_3dPoint  camera_location,
BOOL32  bUpdateTargetLocation = true 
)

Description: Set viewport camera location. By default the target location is changed so that the vector from the camera location to the target is parallel to the camera direction vector. Parameters: camera_location - [in] new target location bUpdateTarget - [in] if true, the target location is changed so that the vector from the camera location to the target is parallel to the camera direction vector.
If false, the target location is not changed. See the remarks section of CRhinoViewport::SetTarget for important details. Remarks: See the remarks section of CRhinoViewport::SetTarget for important details. See Also: CRhinoViewport::Target CRhinoViewport::SetTarget CRhinoViewport::SetTargetAndCameraLocation CRhinoViewport::SetCameraLocation CRhinoViewport::SetCameraDirection CRhinoViewport::SetVP CRhinoViewport::SetView

◆ SetClippingPlanes()

void CRhinoViewport::SetClippingPlanes ( const ON_BoundingBox )

set optimal clipping planes to view objects in a world coordinate 3d bounding box

◆ SetClippingRegionTransformation() [1/2]

bool CRhinoViewport::SetClippingRegionTransformation ( const ON_4iRect ,
class ON_ClippingRegion clip_region 
) const

◆ SetClippingRegionTransformation() [2/2]

bool CRhinoViewport::SetClippingRegionTransformation ( int  ,
int  ,
class ON_ClippingRegion clip_region 
) const

◆ SetConstructionPlane()

void CRhinoViewport::SetConstructionPlane ( const ON_3dmConstructionPlane cplane)

Description: Sets the construction plane to cplane. Parameters: cplane - [in] See Also: CRhinoViewport::PushConstructionPlane, CRhinoViewport::PopConstructionPlane CRhinoViewport::ConstructionPlane

◆ SetDisplayMode()

bool CRhinoViewport::SetDisplayMode ( const ON_UUID )

A viewport's display mode can be determined by using the uuid of one of the predefined or user defined display attributes, (see CDisplayPipelineAttributes)...

◆ SetDisplayXform()

ON_DEPRECATED void CRhinoViewport::SetDisplayXform ( const ON_Xform display_xform)

Description: Set the display transformation that is applied to the projected geometry immediately before it is drawn.
Parameters: display_xform - [in] Remarks: The default display transformation is the identity. The display transformation is intended to be used in printing applications. The camera and projection transformations are handled in the m_v settings. See Also: CRhinoViewport::SetModelXform CRhinoViewport::GetDisplayXform

◆ SetDrawColor()

ON_Color CRhinoViewport::SetDrawColor ( COLORREF  color)

◆ SetMarkedObjectXform()

void CRhinoViewport::SetMarkedObjectXform ( int  mark_value,
const ON_Xform marked_object_xform 
)

Description: Set the display transformation that is applied to marked objects. Parameters: mark_value - [in] if not zero, then objects with this mark value are displayed using the marked_object_xform. marked_object_xform - [in] Remarks: The default marked object transformation is the identity. The marked object transformation is intended to be used when inserting models. See Also: CRhinoViewport::SetModelXform CRhinoViewport::GetMarkedObjectXform

◆ SetModelXform()

void CRhinoViewport::SetModelXform ( const ON_Xform model_xform)

Description: Set the model transformation that is applied to geometry before it is drawn. Parameters: model_xform - [in] Remarks: The default model transformation is the identity. The model transformation is intended to be used for dynamic drawing of objects. The camera and projection transformations are handled in the m_v settings. See Also: CRhinoViewport::SetDisplayXform CRhinoViewport::GetModelXform

◆ SetName()

bool CRhinoViewport::SetName ( const wchar_t *  )

viewport properties

◆ SetScreenSize()

void CRhinoViewport::SetScreenSize ( int  width,
int  height,
bool  forceRegen = false 
)

Drawing controls

◆ SetShowConstructionAxes()

void CRhinoViewport::SetShowConstructionAxes ( BOOL32  )

◆ SetShowConstructionGrid()

void CRhinoViewport::SetShowConstructionGrid ( BOOL32  )

◆ SetShowWorldAxes()

void CRhinoViewport::SetShowWorldAxes ( BOOL32  )

◆ SetTarget()

void CRhinoViewport::SetTarget ( ON_3dPoint  target_location,
BOOL32  bUpdateCameraLocation = true 
)

Description: Set viewport target point. By default the camera location is translated so that the camera direction vector is parallel to the vector from the camera location to the target location. Parameters: target_location - [in] new target location bUpdateCameraLocation - [in] if true, the camera location is translated so that the camera direction vector is parallel to the vector from the camera location to the target location.
If false, the camera location is not changed. See the remarks section for important details. Remarks: In general, Rhino users expect to have the camera direction vector and the vector from the camera location to the target location to be parallel. If you use the CRhinoViewport functions listed in the see also section to set the camera location, camera direction, and target point, then the relationship between these three points and vectors is automatically maintained. If you directly manipulate the camera by using the CRhinoViewport::SetVP member function, then you should carefully set the target by calling SetTarget() with bUpdateCameraLocation=false. See Also: CRhinoViewport::Target CRhinoViewport::SetTarget CRhinoViewport::SetTargetAndCameraLocation CRhinoViewport::SetCameraLocation CRhinoViewport::SetCameraDirection CRhinoViewport::SetVP CRhinoViewport::SetView

◆ SetTargetAndCameraLocation()

void CRhinoViewport::SetTargetAndCameraLocation ( ON_3dPoint  target_location,
ON_3dPoint  camera_location,
BOOL32  bUpdateCameraDirection = true,
BOOL32  bAddToViewStack = true 
)

Description: Set viewport camera location and target location. By default the camera direction vector is changed so that it is parallel to the vector from the camera location to the target location. Parameters: target_location - [in] new target location camera_location - [in] new camera location bUpdateCameraDirection - [in] if true, the camera direction vector is changed so that it is parallel to the vector from the camera location to the target location. If false, the camera direction vector is not changed. See the remarks section of CRhinoViewport::SetTarget for important details. bAddToViewStack - [in] if true, the new viewport is added to view stack so UndoView will restore the previous one. If false, the viewport is not added to view stack, which is useful if this is called from dynamic view manipulation. Remarks: See the remarks section of CRhinoViewport::SetTarget for important details. See Also: CRhinoViewport::Target CRhinoViewport::SetTarget CRhinoViewport::SetTargetAndCameraLocation CRhinoViewport::SetCameraLocation CRhinoViewport::SetCameraDirection CRhinoViewport::SetVP CRhinoViewport::SetView

◆ SetToBackView()

bool CRhinoViewport::SetToBackView ( const wchar_t *  sViewName = nullptr,
BOOL32  bUpdateConstructionPlane = true 
)

Description: Set view to parallel projection with world Z pointing up and world X pointing to the left. Parameters: sViewName - [in] if not NULL, the view name is set Parameters: sViewName - [in] if not NULL, then view name is also set bUpdateConstructionPlane - [in] if true, then the construction plane is set to the view plane. Returns: true if successful See Also CRhinoViewport::SetConstructionPlane, CRhinoViewport::SetName, CRhinoViewport::IsXUp, CRhinoViewport::IsYUp, CRhinoViewport::IsZUp

◆ SetToBottomView()

bool CRhinoViewport::SetToBottomView ( const wchar_t *  sViewName = nullptr,
BOOL32  bUpdateConstructionPlane = true 
)

Description: Set view to parallel projection with world Y pointing down and world X pointing to the right. Parameters: sViewName - [in] if not NULL, the view name is set Parameters: sViewName - [in] if not NULL, then view name is also set bUpdateConstructionPlane - [in] if true, then the construction plane is set to the view plane. Returns: true if successful See Also CRhinoViewport::SetConstructionPlane, CRhinoViewport::SetName, CRhinoViewport::IsXUp, CRhinoViewport::IsYUp, CRhinoViewport::IsZUp

◆ SetToFrontView()

bool CRhinoViewport::SetToFrontView ( const wchar_t *  sViewName = nullptr,
BOOL32  bUpdateConstructionPlane = true 
)

Description: Set view to parallel projection with world Z pointing up and world X pointing to the right. Parameters: sViewName - [in] if not NULL, the view name is set Parameters: sViewName - [in] if not NULL, then view name is also set bUpdateConstructionPlane - [in] if true, then the construction plane is set to the view plane. Returns: true if successful See Also CRhinoViewport::SetConstructionPlane, CRhinoViewport::SetName, CRhinoViewport::IsXUp, CRhinoViewport::IsYUp, CRhinoViewport::IsZUp

◆ SetToLeftView()

bool CRhinoViewport::SetToLeftView ( const wchar_t *  sViewName = nullptr,
BOOL32  bUpdateConstructionPlane = true 
)

Description: Set view to parallel projection with world Z pointing up and world Y pointing to the left. Parameters: sViewName - [in] if not NULL, the view name is set Parameters: sViewName - [in] if not NULL, then view name is also set bUpdateConstructionPlane - [in] if true, then the construction plane is set to the view plane. Returns: true if successful See Also CRhinoViewport::SetConstructionPlane, CRhinoViewport::SetName, CRhinoViewport::IsXUp, CRhinoViewport::IsYUp, CRhinoViewport::IsZUp

◆ SetToPerspectiveView()

bool CRhinoViewport::SetToPerspectiveView ( const wchar_t *  sViewName = nullptr,
BOOL32  bUpdateConstructionPlane = true 
)

Description: Set view to bird's eye perspective projection. Parameters: sViewName - [in] if not NULL, the view name is set Parameters: sViewName - [in] if not NULL, then view name is also set bUpdateConstructionPlane - [in] if true, then the construction plane is set to the world XY plane Returns: true if successful See Also CRhinoViewport::SetConstructionPlane, CRhinoViewport::SetName, CRhinoViewport::IsXUp, CRhinoViewport::IsYUp, CRhinoViewport::IsZUp

◆ SetToPlanView()

bool CRhinoViewport::SetToPlanView ( const ON_3dPoint ,
const ON_3dVector ,
const ON_3dVector ,
BOOL32  = false 
)

Default views.

◆ SetToRightView()

bool CRhinoViewport::SetToRightView ( const wchar_t *  sViewName = nullptr,
BOOL32  bUpdateConstructionPlane = true 
)

Description: Set view to parallel projection with world Z pointing up and world Y pointing to the right. Parameters: sViewName - [in] if not NULL, the view name is set Parameters: sViewName - [in] if not NULL, then view name is also set bUpdateConstructionPlane - [in] if true, then the construction plane is set to the view plane. Returns: true if successful See Also CRhinoViewport::SetConstructionPlane, CRhinoViewport::SetName, CRhinoViewport::IsXUp, CRhinoViewport::IsYUp, CRhinoViewport::IsZUp

◆ SetToTopView()

bool CRhinoViewport::SetToTopView ( const wchar_t *  sViewName = nullptr,
BOOL32  bUpdateConstructionPlane = true 
)

Description: Set view to parallel top view projection. Parameters: sViewName - [in] if not NULL, then view name is also set bUpdateConstructionPlane - [in] if true, then the construction plane is set to the view plane. Returns: true if successful See Also CRhinoViewport::SetConstructionPlane, CRhinoViewport::SetName, CRhinoViewport::IsXUp, CRhinoViewport::IsYUp, CRhinoViewport::IsZUp

◆ SetToTwoPointPerspectiveView()

bool CRhinoViewport::SetToTwoPointPerspectiveView ( const wchar_t *  sViewName,
bool  bUpdateConstructionPlane = true 
)

Description: Set view to the Rhino default two point perspective projection. Parameters: sViewName - [in] if not NULL, the view name is set bUpdateConstructionPlane - [in] Set construction plane to be parallel to ground plane. Returns: true if successful

◆ SetTraceImage()

bool CRhinoViewport::SetTraceImage ( const ON_3dmViewTraceImage traceimage)

Description: Sets the background bitmap. Parameters: traceimage - [in] Returns: True if successful. Remarks: THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED IN THE FUTURE. If you require similar functionality, use RhinoCreatePictureFrame(). See rhinoSdkObject.h for details.

◆ SetView()

void CRhinoViewport::SetView ( const ON_3dmView view)

Description: Expert user function to set viewport projection, target location, name, display mode, window location in the Rhino mainframe, construction plane, background bitmap and wallpaper bitmap. Parameters: view - [in] Remarks: This function is primarily used to save and restore view settings. If you want to modify specific viewport settings, use the functions listed in the see also section. See Also: CRhinoViewport::Target CRhinoViewport::SetTarget CRhinoViewport::SetTargetAndCameraLocation CRhinoViewport::SetCameraLocation CRhinoViewport::SetCameraDirection CRhinoViewport::SetVP CRhinoViewport::SetView

◆ SetVP()

bool CRhinoViewport::SetVP ( const ON_Viewport ,
BOOL32  bUpdateTargetLocation,
BOOL32  bAddToViewStack = true 
)

Description: Set viewport camera projection. Parameters: camera_location - [in] new target location bUpdateTargetLocation - [in] if true, the target location is changed so that the vector from the camera location to the target is parallel to the camera direction vector.
If false, the target location is not changed. See the remarks section of CRhinoViewport::SetTarget for important details. bAddToViewStack - [in] if true, the new viewport is added to view stack so UndoView will restore the previous one. If false, the viewport is not added to view stack, which is useful if this is called from dynamic view manipulation. Remarks: See the remarks section of CRhinoViewport::SetTarget for important details. See Also: CRhinoViewport::Target CRhinoViewport::SetTarget CRhinoViewport::SetTargetAndCameraLocation CRhinoViewport::SetCameraLocation CRhinoViewport::SetCameraDirection CRhinoViewport::SetVP CRhinoViewport::SetView

◆ SetWallpaperImage()

bool CRhinoViewport::SetWallpaperImage ( const ON_3dmWallpaperImage wallpaper)

Description: Sets the wallpaper bitmap. Parameters: wallpaper - [in] Returns: True if successful.

◆ ShowConstructionAxes()

bool CRhinoViewport::ShowConstructionAxes ( ) const

controls display of construction plane axes

◆ ShowConstructionGrid()

bool CRhinoViewport::ShowConstructionGrid ( ) const

controls display of construction plane grid

◆ ShowWorldAxes()

bool CRhinoViewport::ShowWorldAxes ( ) const

controls display of world axes icon

◆ TailRuntimeSerialNumber()

static unsigned int CRhinoViewport::TailRuntimeSerialNumber ( )
static

Returns: The serial number of the newest viewport that exists or 0 if no viewports exist. This will be the largest serial number of any viewport that currently exits. Remarks: Other viewports may have been created and deleted after this viewport.

◆ Target()

ON_3dPoint CRhinoViewport::Target ( ) const

viewport target point

◆ UpdateTransforms()

bool CRhinoViewport::UpdateTransforms ( BOOL32  bForceUpdate = false)

Description: Update the transform cache. If m_xform_iteration != m_vp_iteration or bForceUpdate is true, the cache is updated. Returns: true if the transformations are set.

◆ View()

const ON_3dmView& CRhinoViewport::View ( ) const

Description: Get complete information about the viewport projection, target location, name, display mode, window location in the Rhino mainframe, construction plane, background bitmap and wallpaper bitmap. Returns: view information as an ON_3dmView. See Also: CRhinoViewport::SetView

◆ ViewportId()

ON_UUID CRhinoViewport::ViewportId ( ) const

Returns: m_v.m_vp.ViewportId().

◆ ViewTypeFromActiveSpace()

static ON::view_type CRhinoViewport::ViewTypeFromActiveSpace ( ON::active_space  active_space)
static

◆ VP()

const ON_Viewport& CRhinoViewport::VP ( ) const

Description: Get viewport projection information. Returns: viewport projection information as an ON_Viewport. See Also: CRhinoViewport::SetVP

Friends And Related Function Documentation

◆ CRhinoDetailViewObject

friend class CRhinoDetailViewObject
friend

◆ CRhinoView

friend class CRhinoView
friend

◆ CRhViewportPrivate

friend class CRhViewportPrivate
friend

Member Data Documentation

◆ m_v

ON_3dmView CRhinoViewport::m_v

pretend these are private and you'll be happier.

viewport settings

◆ m_view_stack

ON_ClassArray<ON_3dmView> CRhinoViewport::m_view_stack

◆ m_view_stack_index

int CRhinoViewport::m_view_stack_index = -1

-1 or index of view in use