Rhino C++ API  8.6
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
CRhinoUiBlockPreview Class Reference

#include <RhinoSdkUiBlockPreview.h>

Inheritance diagram for CRhinoUiBlockPreview:

Public Types

enum  draw_decorations {
  draw_none = 0, draw_document_grid = 1, draw_grid = 2, draw_axes = 4,
  draw_world_axes = 8, draw_all = 0xFFFFFFFF
}
 
enum  view_type {
  top_view = 0, bottom_view, left_view, right_view,
  front_view, back_view, perspective_view, view_type_force_32bit = 0xFFFFFFFF
}
 

Public Member Functions

 CRhinoUiBlockPreview ()
 
virtual ~CRhinoUiBlockPreview ()
 
ON_UUID DisplayMode () const
 
unsigned int DrawDecorations () const
 
const CRhinoInstanceDefinitionInstanceDefinition () const
 
const CRhinoObjectInstanceDefinitionObject () const
 
CRhinoDibPreviewDib ()
 
void Redraw ()
 
void SetDisplayMode (ON_UUID dm, bool bRedraw=true)
 
void SetDrawDecorations (unsigned int dt, bool bRedraw=true)
 
void SetInstanceDefinition (const CRhinoInstanceDefinition *idef, bool bRedraw=true)
 
void SetInstanceDefinitionObject (const CRhinoObject *idef_obj, const ON_Xform &idef_xf, bool bRedraw=true)
 
void SetViewType (CRhinoUiBlockPreview::view_type vt, bool bRedraw=true)
 
CRhinoUiBlockPreview::view_type ViewType () const
 

Static Public Member Functions

static CRhinoUiBlockPreview::draw_decorations GetDrawDecorations (unsigned int n)
 
static bool GetInstanceDefinitionPreviewBitmap (const CRhinoInstanceDefinition &idef, ON_UUID idef_object_id, view_type view_type, const CDisplayPipelineAttributes &da, unsigned int draw_decorations, CSize size, bool applyDpiScaling, CRhinoDib &dib_out)
 
static bool GetInstanceDefinitionPreviewBitmap (const CRhinoInstanceDefinition &idef, view_type view_type, const CDisplayPipelineAttributes &da, unsigned int draw_decorations, CSize size, bool applyDpiScaling, CRhinoDib &dib_out)
 
static CRhinoUiBlockPreview::view_type GetViewType (int n)
 

Protected Member Functions

virtual void DrawItem (LPDRAWITEMSTRUCT lpDrawItemStruct)
 
afx_msg void OnContextMenu (CWnd *pWnd, CPoint point)
 
afx_msg BOOL32 OnEraseBkgnd (CDC *pDC)
 
afx_msg void OnSize (UINT nType, int cx, int cy)
 
virtual void PreSubclassWindow ()
 

Member Enumeration Documentation

◆ draw_decorations

Enumerator
draw_none 
draw_document_grid 
draw_grid 
draw_axes 
draw_world_axes 
draw_all 

◆ view_type

Enumerator
top_view 
bottom_view 
left_view 
right_view 
front_view 
back_view 
perspective_view 
view_type_force_32bit 

For internal use only.

Constructor & Destructor Documentation

◆ CRhinoUiBlockPreview()

CRhinoUiBlockPreview::CRhinoUiBlockPreview ( )

◆ ~CRhinoUiBlockPreview()

virtual CRhinoUiBlockPreview::~CRhinoUiBlockPreview ( )
virtual

Member Function Documentation

◆ DisplayMode()

ON_UUID CRhinoUiBlockPreview::DisplayMode ( ) const

Description: Returns the current display mode.

◆ DrawDecorations()

unsigned int CRhinoUiBlockPreview::DrawDecorations ( ) const

Description: Returns the current drawing decorations.

◆ DrawItem()

virtual void CRhinoUiBlockPreview::DrawItem ( LPDRAWITEMSTRUCT  lpDrawItemStruct)
protectedvirtual

◆ GetDrawDecorations()

static CRhinoUiBlockPreview::draw_decorations CRhinoUiBlockPreview::GetDrawDecorations ( unsigned int  n)
static

◆ GetInstanceDefinitionPreviewBitmap() [1/2]

static bool CRhinoUiBlockPreview::GetInstanceDefinitionPreviewBitmap ( const CRhinoInstanceDefinition idef,
ON_UUID  idef_object_id,
view_type  view_type,
const CDisplayPipelineAttributes da,
unsigned int  draw_decorations,
CSize  size,
bool  applyDpiScaling,
CRhinoDib dib_out 
)
static

Description: Gets a CRhinoInstanceDefintion preview bitmap, see CRhinoUiBlockPreview for argument flag values Parameters: idef - [in] Instance definition to draw idef_object_id - [in] Id of one of the idef's definition objects you want to draw selected. view_type - [in] Type of view to draw, see CRhinoUiBlockPreview::view_type for options display_mode - [in] Display mode for block preview draw_decorations - [in] Bitwise file which specifies view decorations to draw, see CRhinoUiBlockPreview::draw_decorations for options size - [in] Size of output preview image applyDpiScaling - [in] Apply DPI scaling to the size. dib_out - [out] Output bitmap Returns: Returns true if dib_out is created otherwise false

◆ GetInstanceDefinitionPreviewBitmap() [2/2]

static bool CRhinoUiBlockPreview::GetInstanceDefinitionPreviewBitmap ( const CRhinoInstanceDefinition idef,
view_type  view_type,
const CDisplayPipelineAttributes da,
unsigned int  draw_decorations,
CSize  size,
bool  applyDpiScaling,
CRhinoDib dib_out 
)
static

Description: Gets a CRhinoInstanceDefintion preview bitmap, see CRhinoUiBlockPreview for argument flag values Parameters: idef - [in] Instance definition to draw view_type - [in] Type of view to draw, see CRhinoUiBlockPreview::view_type for options display_mode - [in] Display mode for block preview draw_decorations - [in] Bitwise file which specifies view decorations to draw, see CRhinoUiBlockPreview::draw_decorations for options size - [in] Size of output preview image applyDpiScaling - [in] Apply DPI scaling to the size. dib_out - [out] Output bitmap Returns: Returns true if dib_out is created otherwise false

◆ GetViewType()

static CRhinoUiBlockPreview::view_type CRhinoUiBlockPreview::GetViewType ( int  n)
static

◆ InstanceDefinition()

const CRhinoInstanceDefinition* CRhinoUiBlockPreview::InstanceDefinition ( ) const

Description: Returns the current instance definition (that is being previewed).

◆ InstanceDefinitionObject()

const CRhinoObject* CRhinoUiBlockPreview::InstanceDefinitionObject ( ) const

Description: Returns the current instance definition object (that is being previewed).

◆ OnContextMenu()

afx_msg void CRhinoUiBlockPreview::OnContextMenu ( CWnd *  pWnd,
CPoint  point 
)
protected

◆ OnEraseBkgnd()

afx_msg BOOL32 CRhinoUiBlockPreview::OnEraseBkgnd ( CDC *  pDC)
protected

◆ OnSize()

afx_msg void CRhinoUiBlockPreview::OnSize ( UINT  nType,
int  cx,
int  cy 
)
protected

◆ PreSubclassWindow()

virtual void CRhinoUiBlockPreview::PreSubclassWindow ( )
protectedvirtual

◆ PreviewDib()

CRhinoDib& CRhinoUiBlockPreview::PreviewDib ( )

Description: Call this method to get the preview image associated with the specified instance definition. Returns: Returns the preview image associated with the specified instance definition.

◆ Redraw()

void CRhinoUiBlockPreview::Redraw ( )

Description: Redraws the control based on the current settings.

◆ SetDisplayMode()

void CRhinoUiBlockPreview::SetDisplayMode ( ON_UUID  dm,
bool  bRedraw = true 
)

Description: Sets the current display mode. Parameters: dm - [in] The display mode UUID. bRedraw - [in] Forces the control to redraw.

◆ SetDrawDecorations()

void CRhinoUiBlockPreview::SetDrawDecorations ( unsigned int  dt,
bool  bRedraw = true 
)

Description: Sets the current drawing decorations. Parameters: dt - [in] The drawing decorations made by "or-ing" ( | ) values from the draw_decorations enum. If you pass 0, then no decorations will be drawn. bRedraw - [in] Forces the control to redraw.

◆ SetInstanceDefinition()

void CRhinoUiBlockPreview::SetInstanceDefinition ( const CRhinoInstanceDefinition idef,
bool  bRedraw = true 
)

Description: Sets the current instance definition (to be previewed). Parameters: idef - [in] The instance definition to preview. bRedraw - [in] Forces the control to redraw.

◆ SetInstanceDefinitionObject()

void CRhinoUiBlockPreview::SetInstanceDefinitionObject ( const CRhinoObject idef_obj,
const ON_Xform idef_xf,
bool  bRedraw = true 
)

Description: Sets the current instance definition object. Parameters: idef_obj - [in] The instance object to preview. idef_xf - [in] The instance object transformation (as if the block were exploded). bRedraw - [in] Forces the control to redraw. Remarks: Use this if you want to highlight objects inside of an instance definition.

◆ SetViewType()

void CRhinoUiBlockPreview::SetViewType ( CRhinoUiBlockPreview::view_type  vt,
bool  bRedraw = true 
)

Description: Sets the current view type. Parameters: vt - [in] The view type. bRedraw - [in] Forces the control to redraw.

◆ ViewType()

CRhinoUiBlockPreview::view_type CRhinoUiBlockPreview::ViewType ( ) const

Description: Returns the current view type.