//绘制坐标轴 private void DrawAxes() { m_RenderWindowInteractor = this.renderWindowControl1.RenderWindow.GetInteractor(); m_AxesActor = new vtkAxesActor(); m_OrientationMarkerWidget = new vtkOrientationMarkerWidget(); m_OrientationMarkerWidget.SetOrientationMarker(m_AxesActor); m_OrientationMarkerWidget.SetInteractor(m_RenderWindowInteractor); m_OrientationMarkerWidget.On(); m_OrientationMarkerWidget.SetInteractive(0); }
void DrawAxes() {// 设置坐标轴 if (null == m_marker) { vtkAxesActor axes = new vtkAxesActor(); axes.SetShaftTypeToLine(); axes.SetXAxisLabelText("x"); axes.SetYAxisLabelText("y"); axes.SetZAxisLabelText("z"); axes.SetTotalLength(0.6, 0.6, 0.6); m_marker = new vtkOrientationMarkerWidget(); m_marker.SetInteractor(m_iren); m_marker.SetOrientationMarker(axes); m_marker.SetViewport(-0.2, -0.2, 0.3, 0.3); m_marker.SetEnabled(1); m_marker.SetInteractive(0); } }