Rhino C++ API  8.13
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  isometric_type {
  isometric_none = 0, north_east = 1, north_west = 2, south_east = 3,
  south_west = 4, isometric_type_force_32bit = 0xFFFFFFFF
}
 
enum  view_type {
  top_view = 0, bottom_view = 1, left_view = 2, right_view = 3,
  front_view = 4, back_view = 5, perspective_view = 6, two_point_perspective = 7,
  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, ON_UUID idef_object_id, view_type view_type, isometric_type iso_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::isometric_type GetIsometricType (int n)
 
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 

◆ isometric_type

Enumerator
isometric_none 
north_east 
north_west 
south_east 
south_west 
isometric_type_force_32bit 

For internal use only.

◆ view_type

Enumerator
top_view 
bottom_view 
left_view 
right_view 
front_view 
back_view 
perspective_view 
two_point_perspective 
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/3]

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/3]

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

◆ GetInstanceDefinitionPreviewBitmap() [3/3]

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

◆ GetIsometricType()

static CRhinoUiBlockPreview::isometric_type CRhinoUiBlockPreview::GetIsometricType ( int  n)
static

◆ 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.