Rhino C++ API  8.14
Public Member Functions | List of all members
CRhinoDrawCallback Class Reference

#include <rhinoSdkView.h>

Inheritance diagram for CRhinoDrawCallback:
CRhinoDisplayConduit

Public Member Functions

 CRhinoDrawCallback ()
 
virtual ~CRhinoDrawCallback (void)
 
virtual ON_BoundingBox BoundingBox (CRhinoViewport &vp, CRhinoDoc &doc)
 
virtual void DrawBackground (CRhinoViewport &vp, CRhinoDoc &doc)
 
virtual void DrawDecorations (CRhinoView *pVP, CDC *pDC, CRhinoViewport &vp, CRhinoDoc &doc)
 
virtual bool DrawEverything (CRhinoView &view, ON_BoundingBox bbox, CDC *pDC, CRhinoViewport &vp, CRhinoDoc &doc)
 Obsolete. More...
 
virtual void DrawForeground (CRhinoViewport &vp, CRhinoDoc &doc)
 
virtual void DrawMiddleground (CRhinoViewport &vp, CRhinoDoc &doc)
 
- Public Member Functions inherited from CRhinoDisplayConduit
 CRhinoDisplayConduit (CSupportChannels channel_mask)
 
 CRhinoDisplayConduit (CSupportChannels channel_mask, bool enable)
 
virtual ~CRhinoDisplayConduit ()
 
bool Bind (const CRhinoDisplayPipeline &pipeline)
 Binding methods... More...
 
bool Bind (const CRhinoView &view)
 See: bool CRhinoDisplayConduit::Bind(const CRhinoDisplayPipeline& pipeline);. More...
 
bool Bind (const CRhinoViewport &viewport)
 See: bool CRhinoDisplayConduit::Bind(const CRhinoDisplayPipeline& pipeline);. More...
 
bool Bind (const ON_Viewport &viewport)
 See: bool CRhinoDisplayConduit::Bind(const CRhinoDisplayPipeline& pipeline);. More...
 
int BindingCount () const
 
bool BindingsExist () const
 
bool ChannelSupported (UINT channel) const
 Attributes... More...
 
bool ConstantBinding () const
 
void Disable ()
 
class CRhinoDocDocument () const
 
unsigned int DocumentSerialNumber () const
 
void Enable ()
 
void Enable (unsigned int docSerialNumber)
 
void EnableConstantBinding (bool enable=true)
 
unsigned int GetGeometryFilter () const
 
ON_UuidList GetObjectFilter () const
 
void GetSelectedFilter (bool &on, bool &checkSubObjects) const
 
bool InterestedInObject (const CRhinoObject *) const
 
bool IsBound (const CRhinoDisplayPipeline &pipeline, bool ignore_state=false) const
 
bool IsBound (const CRhinoView &view, bool ignore_state=false) const
 See: CRhinoDisplayConduit::IsBound( const CRhinoDisplayPipeline& pipeline, bool ignore_state = false) const;. More...
 
bool IsBound (const CRhinoViewport &viewport, bool ignore_state=false) const
 See: CRhinoDisplayConduit::IsBound( const CRhinoDisplayPipeline& pipeline, bool ignore_state = false) const;. More...
 
bool IsBound (const ON_Viewport &viewport, bool ignore_state=false) const
 See: CRhinoDisplayConduit::IsBound( const CRhinoDisplayPipeline& pipeline, bool ignore_state = false) const;. More...
 
bool IsEnabled () const
 
bool IsEnabled (unsigned int docSerialNumber) const
 
virtual void NotifyConduit (EConduitNotifiers notification_event, CRhinoDisplayPipeline &pipeline)
 Notifications... More...
 
class CRhinoPageViewPageView () const
 
unsigned int PageViewSerialNumber () const
 
bool ReplaceBinding (const CRhinoDisplayPipeline &old_pipeline, const CRhinoDisplayPipeline &new_pipeline)
 
bool ReplaceBinding (const CRhinoView &old_view, const CRhinoView &new_view)
 See: bool CRhinoDisplayConduit::ReplaceBinding(const CRhinoDisplayPipeline& old_pipeline, const CRhinoDisplayPipeline& new_pipeline);. More...
 
bool ReplaceBinding (const CRhinoViewport &old_viewport, const CRhinoViewport &new_viewport)
 See: bool CRhinoDisplayConduit::ReplaceBinding(const CRhinoDisplayPipeline& old_pipeline, const CRhinoDisplayPipeline& new_pipeline);. More...
 
bool ReplaceBinding (const ON_Viewport &old_viewport, const ON_Viewport &new_viewport)
 See: bool CRhinoDisplayConduit::ReplaceBinding(const CRhinoDisplayPipeline& old_pipeline, const CRhinoDisplayPipeline& new_pipeline);. More...
 
void SetGeometryFilter (unsigned int geometry_filter)
 
void SetObjectFilter (const ON_SimpleArray< ON_UUID > &objectIds)
 
void SetObjectFilter (ON_UUID objectId)
 
void SetSelectedFilter (bool on, bool checkSubObjects)
 
bool ToggleBinding (const CRhinoDisplayPipeline &pipeline)
 
bool ToggleBinding (const CRhinoView &view)
 See: bool CRhinoDisplayConduit::ToggleBinding(const CRhinoDisplayPipeline& pipeline);. More...
 
bool ToggleBinding (const CRhinoViewport &viewport)
 See: bool CRhinoDisplayConduit::ToggleBinding(const CRhinoDisplayPipeline& pipeline);. More...
 
bool ToggleBinding (const ON_Viewport &viewport)
 See: bool CRhinoDisplayConduit::ToggleBinding(const CRhinoDisplayPipeline& pipeline);. More...
 
bool Unbind (const CRhinoDisplayPipeline &pipeline)
 
bool Unbind (const CRhinoView &view)
 See: bool CRhinoDisplayConduit::Unbind(const CRhinoDisplayPipeline& pipeline);. More...
 
bool Unbind (const CRhinoViewport &viewport)
 See: bool CRhinoDisplayConduit::Unbind(const CRhinoDisplayPipeline& pipeline);. More...
 
bool Unbind (const ON_Viewport &viewport)
 See: bool CRhinoDisplayConduit::Unbind(const CRhinoDisplayPipeline& pipeline);. More...
 
void UnbindAll ()
 
class CRhinoViewView () const
 
class CRhinoViewportViewport () const
 
unsigned int ViewportSerialNumber () const
 
unsigned int ViewSerialNumber () const
 

Additional Inherited Members

- Static Public Member Functions inherited from CRhinoDisplayConduit
static CRhinoDisplayConduitFromRuntimeSerialNumber (unsigned int display_conduit_sn)
 
static bool IsValidDisplayConduitPointer (const void *display_conduit)
 
static bool IsValidDisplayConduitReference (const CRhinoDisplayConduit &display_conduit)
 
static unsigned int RuntimeSerialNumber (const CRhinoDisplayConduit *conduit)
 
- Protected Attributes inherited from CRhinoDisplayConduit
const CSupportChannels m_Channels
 The channels that this class was constructed with. More...
 
class CChannelAttributesm_pChannelAttrs = nullptr
 
CDisplayPipelineAttributesm_pDisplayAttrs = nullptr
 
unsigned int m_rhino_doc_sn = 0
 
unsigned int m_rhino_view_sn = 0
 
unsigned int m_rhino_viewport_sn = 0
 

Detailed Description

Description: If you need to add custom drawing code to Rhino, derive a class from CRhinoDrawCallback and override the virtual function where you want to draw something.

To enable, call: CRhinoDrawCallback::Enable(); When you are done, call: CRhinoDrawCallback::Disable();

Remarks: This is a refactored version of the legacy CRhinoDrawCallback class found in previous versions of Rhino. As this temporary helper class will go away in future releases, you should replace your usage of this with your own class that inherits from CRhinoDisplayConduit.

Constructor & Destructor Documentation

◆ CRhinoDrawCallback()

CRhinoDrawCallback::CRhinoDrawCallback ( )

◆ ~CRhinoDrawCallback()

virtual CRhinoDrawCallback::~CRhinoDrawCallback ( void  )
virtual

Member Function Documentation

◆ BoundingBox()

virtual ON_BoundingBox CRhinoDrawCallback::BoundingBox ( CRhinoViewport vp,
CRhinoDoc doc 
)
virtual

Description: Called when a view is regenerated and can be used to specify a box you want to make sure is included in the view frustum. This is a good way to make sure temporary geometry drawn by DrawBackground, DrawMiddleground, and DrawForeground is inside of the near and far clipping planes. Parameters: vp - [in] The active viewport doc - [in] - The active document Returns: A bounding box

Deprecated:
use a custom CRhinoDisplayConduit

◆ DrawBackground()

virtual void CRhinoDrawCallback::DrawBackground ( CRhinoViewport vp,
CRhinoDoc doc 
)
virtual

Description: Called when a view is regenerated and should be used for things like drawing background images into the "back" buffer. Parameters: vp - [in] The active viewport doc - [in] - The active document

Deprecated:
use a custom CRhinoDisplayConduit

◆ DrawDecorations()

virtual void CRhinoDrawCallback::DrawDecorations ( CRhinoView pVP,
CDC *  pDC,
CRhinoViewport vp,
CRhinoDoc doc 
)
virtual

Description: Called right after the "back" buffer is blitted to the screen and should be used for drawing things like tracking lines or rubber bands. Parameters: vp - [in] The active viewport doc - [in] - The active document

Deprecated:
use a custom CRhinoDisplayConduit

◆ DrawEverything()

virtual bool CRhinoDrawCallback::DrawEverything ( CRhinoView view,
ON_BoundingBox  bbox,
CDC *  pDC,
CRhinoViewport vp,
CRhinoDoc doc 
)
virtual

Obsolete.

Deprecated:
use a custom CRhinoDisplayConduit

◆ DrawForeground()

virtual void CRhinoDrawCallback::DrawForeground ( CRhinoViewport vp,
CRhinoDoc doc 
)
virtual

Description: Called when a view is regenerated and should be used for drawing "decorations" like the world axis icon into the "back" buffer. Wireframe objects drawn in DrawForeground are not depth clipped or depth buffered. Parameters: vp - [in] The active viewport doc - [in] - The active document Remarks: DrawMiddleground is a good place to draw shaded objects. If you want to draw wireframe objects, then you should do it in a DrawForeground override.

Deprecated:
use a custom CRhinoDisplayConduit

◆ DrawMiddleground()

virtual void CRhinoDrawCallback::DrawMiddleground ( CRhinoViewport vp,
CRhinoDoc doc 
)
virtual

Description: Called when a view is regenerated and should be used for things like drawing temporary geometry into the "back" buffer. Objects drawn in DrawMiddleground are depth clipped and depth buffered. If your objects are getting clipped and you don't want them to be clipped, the draw them in DrawForeground. Parameters: vp - [in] The active viewport doc - [in] - The active document Remarks: DrawMiddleground is a good place to draw shaded objects. If you want to draw wireframe objects, then you should do it in a DrawForeground override.

Deprecated:
use a custom CRhinoDisplayConduit