You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWTAI-Platform/Include/nmNum/nmRender/nmVTKRotationCenterMarkerLa...

57 lines
2.1 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#ifndef NMVTKROTATIONCENTERMARKERLAYER_H
#define NMVTKROTATIONCENTERMARKERLAYER_H
#include "nmVTKRenderLayer.h"
class nmVTKRotationCenterMarkerLayerPrivate;
class vtkRenderer;
/**
* @brief 以固定屏幕尺度显示当前相机旋转中心的三轴标记图层。
*
* 标记只包含 X/Y/Z 三条世界坐标轴线。逻辑中心由调用方显式设置,
* 不读取或修改 vtkCamera::FocalPoint。显示几何会沿观察方向轻微前移
* 以避免共面闪烁。图层不主动渲染,所有
* 接口只能在 Qt GUI 线程调用。
*/
class NM_RENDER_EXPORT nmVTKRotationCenterMarkerLayer
: public nmVTKRenderLayer
{
public:
/** @brief 创建初始隐藏的旋转中心标记图层。 */
explicit nmVTKRotationCenterMarkerLayer(const QString& sLayerId);
/** @brief 先解除相机观察关系,再释放标记渲染管线。 */
virtual ~nmVTKRotationCenterMarkerLayer();
/**
* @brief 绑定 Scene 已挂载的主 Renderer不增加其引用计数。
* @return Renderer 与当前图层挂载对象一致且相机观察关系建立成功时返回 true。
*/
bool bindRenderer(vtkRenderer* pRenderer);
/** @brief 幂等移除 Renderer/Camera 观察关系及其非所有权引用。 */
void unbindRenderer();
/**
* @brief 按已保存世界中心、当前相机方向和视口像素尺度更新标记几何。
* @note 本函数只更新 PolyData不主动触发 Render。
*/
bool synchronize();
/** @brief 保存独立世界坐标中心并更新已有几何,不主动渲染。 */
bool setWorldCenter(double dX, double dY, double dZ);
/** @brief 返回是否已经保存有效的独立世界坐标中心。 */
bool hasWorldCenter() const;
/** @brief 修改标记显隐;无有效中心时不会显示,也不主动渲染。 */
void setMarkerVisible(bool bVisible);
/** @brief 返回调用方最后设置的标记显隐状态。 */
bool isMarkerVisible() const;
private:
Q_DISABLE_COPY(nmVTKRotationCenterMarkerLayer)
nmVTKRotationCenterMarkerLayerPrivate* m_pPrivate; ///< 独占实现对象。
};
#endif // NMVTKROTATIONCENTERMARKERLAYER_H