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/nmVTKBoundsGridLayer.h

63 lines
1.9 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 NMVTKBOUNDSGRIDLAYER_H
#define NMVTKBOUNDSGRIDLAYER_H
#include "nmVTKRenderLayer.h"
#include <vtkSmartPointer.h>
class vtkCamera;
class vtkCubeAxesActor;
/**
* @brief 按数值边界显示坐标刻度和比例网格的通用图层。
*
* 图层只复制六个边界数值,不引用业务数据对象。零厚度容差仅写入
* vtkCubeAxesActor不修改调用方的网格几何和原始边界。
*/
class NM_RENDER_EXPORT nmVTKBoundsGridLayer : public nmVTKRenderLayer
{
public:
enum Mode
{
Mode_PlanarXY = 0, ///< 只显示 X/Y 轴及平面比例网格。
Mode_Box3D ///< 显示 X/Y/Z 三轴包围盒比例网格。
};
explicit nmVTKBoundsGridLayer(const QString& sLayerId);
virtual ~nmVTKBoundsGridLayer();
/** @brief 绑定相机Actor 通过 VTK 引用计数保持相机有效。 */
void setCamera(vtkCamera* pCamera);
/** @brief 返回当前相机非所有权指针。 */
vtkCamera* getCamera() const;
/** @brief 设置显示模式,不主动渲染。 */
void setMode(Mode eMode);
Mode getMode() const;
/** @brief 校验并复制六个有限、有序边界值。 */
bool setBounds(double dXMinimum,
double dXMaximum,
double dYMinimum,
double dYMaximum,
double dZMinimum,
double dZMaximum);
/** @brief 返回未经显示容差扩展的原始边界副本。 */
bool getBounds(double dBounds[6]) const;
/** @brief 返回图层独占的 CubeAxes Actor 非所有权指针。 */
vtkCubeAxesActor* getActor() const;
private:
Q_DISABLE_COPY(nmVTKBoundsGridLayer)
void applyMode();
vtkSmartPointer<vtkCubeAxesActor> m_pActor;
Mode m_eMode;
double m_dBounds[6]; ///< 原始边界,不含仅供显示使用的容差。
bool m_bHasBounds;
};
#endif // NMVTKBOUNDSGRIDLAYER_H