Issue with Redrawing Custom Entity in Orthographic Mode

Issue with Redrawing Custom Entity in Orthographic Mode

el-mehdi_slaoui9UZHZ
Explorer Explorer
719 Views
1 Reply
Message 1 of 2

Issue with Redrawing Custom Entity in Orthographic Mode

el-mehdi_slaoui9UZHZ
Explorer
Explorer

Hi everyone,


I’ve created a custom entity by inheriting from the AcDbEntity class. As part of the implementation, I overrode the subWorldDraw and subViewportDraw methods to handle dynamic rendering based on the current view parameters.


In perspective mode, everything works as expected, the rendering updates dynamically when the view changes (e.g., zoom, pan, orbit). Both subWorldDraw and subViewportDraw methods are triggered correctly to reflect these changes.

 

However, in orthographic mode, I’ve noticed an issue:

  • These methods are only triggered when performing an orbit motion with the mouse.
  • They are not invoked during zoom or pan operations, which causes the rendering to remain static until an orbit action is performed.

Does anyone have insights or suggestions on how to ensure these methods are triggered during zoom and pan actions in orthographic mode ?


Thank you in advance for your help!

0 Likes
720 Views
1 Reply
Reply (1)
Message 2 of 2

tbrammer
Advisor
Advisor

Zoom and pan should not require viewportDraw() or even wordDraw() to be called to update the graphic primitives if the entity didn't change. Why is it an issue to you? 

 

If you want to force an update of an entity you can open the entity for write and call

ent->recordGraphicsModified(). But this won't work during zoom or pan.

You could try to overwrite:

  virtual Adesk::UInt32 subViewportDrawLogicalFlags (AcGiViewportDraw *vd)

The return value is a sum of all desired AcGiDrawable::SetAttributesFlags flags.
Try to return AcGiDrawable::kDrawableRegenDraw and / or  AcGiDrawable::kDrawableViewDependentViewportDraw. But I'm afraid this would not help.


Thomas Brammer ● Software Developer ● imos AG ● LinkedIn ●
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

0 Likes