MeshLib
 
Loading...
Searching...
No Matches
MR::RenderNameObject Class Reference

#include <MRRenderNameObject.h>

+ Inheritance diagram for MR::RenderNameObject:

Public Member Functions

 RenderNameObject (const VisualObject &object)
 
MRVIEWER_API void renderUi (const UiRenderParams &params) override
 
virtual MRVIEWER_API std::string getObjectNameString (const VisualObject &object, ViewportId viewportId) const
 
- Public Member Functions inherited from MR::IRenderObject
virtual ~IRenderObject ()=default
 
virtual bool render (const ModelRenderParams &params)=0
 
virtual void renderPicker (const ModelBaseRenderParams &params, unsigned geomId)=0
 
virtual size_t heapBytes () const =0
 returns the amount of memory this object occupies on heap
 
virtual size_t glBytes () const =0
 returns the amount of memory this object allocated in OpenGL
 
virtual void forceBindAll ()
 binds all data for this render object, not to bind ever again (until object becomes dirty)
 

Public Attributes

Vector3f nameUiPoint
 The line attachment point in model space.
 
Vector3f nameUiLocalOffset
 Which way the name is moved relative to the point, in model space. The length is respected.
 
Vector2f nameUiScreenOffset
 
std::optional< Vector3fnameUiRotateToScreenPlaneAroundSphereCenter
 
bool nameUiRotateLocalOffset90Degrees = false
 

Constructor & Destructor Documentation

◆ RenderNameObject()

MR::RenderNameObject::RenderNameObject ( const VisualObject & object)
inline

Member Function Documentation

◆ getObjectNameString()

virtual MRVIEWER_API std::string MR::RenderNameObject::getObjectNameString ( const VisualObject & object,
ViewportId viewportId ) const
virtual

◆ renderUi()

MRVIEWER_API void MR::RenderNameObject::renderUi ( const UiRenderParams & params)
overridevirtual

Render the UI. This is repeated for each viewport. Here you can either render immediately, or insert a task into params.tasks, which get Z-sorted.

  • params will remain alive as long as the tasks are used.
  • You'll have at most one living task at a time, so you can write a non-owning pointer to an internal task.

Reimplemented from MR::IRenderObject.

Member Data Documentation

◆ nameUiLocalOffset

Vector3f MR::RenderNameObject::nameUiLocalOffset

Which way the name is moved relative to the point, in model space. The length is respected.

◆ nameUiPoint

Vector3f MR::RenderNameObject::nameUiPoint

The line attachment point in model space.

◆ nameUiRotateLocalOffset90Degrees

bool MR::RenderNameObject::nameUiRotateLocalOffset90Degrees = false

If true, the localOffset is rotated 90 degrees CW after projecting it to screen space. This is great if you have some axis or line that you don't want the name to overlap.

◆ nameUiRotateToScreenPlaneAroundSphereCenter

std::optional<Vector3f> MR::RenderNameObject::nameUiRotateToScreenPlaneAroundSphereCenter

If set, the vector from this point to point is rotated to be in the screen plane. localOffset is also rotated by the same amount. Good for having the name on a spherical surface.

◆ nameUiScreenOffset

Vector2f MR::RenderNameObject::nameUiScreenOffset

Which way the name is moved relative to the point, in screen space (Y is down). The length is respected. This is automatically multiplied by the global GUI scale.


The documentation for this class was generated from the following file: