vtkCubeAxesActor2D的使用

使用Demo
vtkSmartPointer<vtkCubeAxesActor2D> cubeAxesActor = vtkSmartPointer<vtkCubeAxesActor2D>::New();
// 设置Camera
cubeAxesActor ->SetCamera(m_renderer->GetActiveCamera());
// 设置FlyMode
cubeAxesActor ->SetFlyMode(vtkCubeAxesActor2D::VTK_FLY_OUTER_EDGES);
// 设置 显示图象
cubeAxesActor ->SetViewProp(actor);
// renderer中添加坐标轴
renderer->AddActor(cubeAxesActor);
根据图像内容绘制坐标轴
根据输入的dataset绘制坐标轴
  //@{
  /**
   * Use the bounding box of this input dataset to draw the cube axes. If this
   * is not specified, then the class will attempt to determine the bounds from
   * the defined Prop or Bounds.
   */
  virtual void SetInputConnection(vtkAlgorithmOutput*);
  virtual void SetInputData(vtkDataSet*);
  virtual vtkDataSet* GetInput();
  //@}
指定prop绘制坐标轴
  //@{
  /**
   * Use the bounding box of this prop to draw the cube axes. The
   * ViewProp is used to determine the bounds only if the Input is not
   * defined.
   */
  void SetViewProp(vtkProp* prop);
  vtkGetObjectMacro(ViewProp, vtkProp);
  //@}

指定Bounds绘制坐标轴

当dataset和prop都没有被指定的时候使用Bounds

  //@{
  /**
   * Explicitly specify the region in space around which to draw the bounds.
   * The bounds is used only when no Input or Prop is specified. The bounds
   * are specified according to (xmin,xmax, ymin,ymax, zmin,zmax), making
   * sure that the min's are less than the max's.
   */
  vtkSetVector6Macro(Bounds,double);
  double *GetBounds() override;
  void GetBounds(double& xmin, double& xmax, double& ymin, double& ymax,
                 double& zmin, double& zmax);
  void GetBounds(double bounds[6]);
  //@}

设置坐标轴范围

使用 SetRanges(xmin,xmax, ymin,ymax, zmin,zmax) 设置坐标轴示数范围

  //@{
  /**
   * Explicitly specify the range of values used on the bounds.
   * The ranges are specified according to (xmin,xmax, ymin,ymax, zmin,zmax),
   * making sure that the min's are less than the max's.
   */
  vtkSetVector6Macro(Ranges,double);
  double *GetRanges();
  void GetRanges(double& xmin, double& xmax, double& ymin, double& ymax,
                 double& zmin, double& zmax);
  void GetRanges(double ranges[6]);
  //@}

设置和获取Camera
  //@{
  /**
   * Set/Get the camera to perform scaling and translation of the
   * vtkCubeAxesActor2D.
   */
  virtual void SetCamera(vtkCamera*);
  vtkGetObjectMacro(Camera,vtkCamera);
  //@}

FlyMode设置
  enum FlyMode
  {
    VTK_FLY_OUTER_EDGES = 0,
    VTK_FLY_CLOSEST_TRIAD = 1,
    VTK_FLY_NONE = 2
  };

  //@{
  /**
   * Specify a mode to control how the axes are drawn: either outer edges
   * or closest triad to the camera position, or you may also disable flying
   * of the axes.
   */
  vtkSetClampMacro(FlyMode, int, VTK_FLY_OUTER_EDGES, VTK_FLY_NONE);
  vtkGetMacro(FlyMode, int);
  void SetFlyModeToOuterEdges()
    {this->SetFlyMode(VTK_FLY_OUTER_EDGES);};
  void SetFlyModeToClosestTriad()
    {this->SetFlyMode(VTK_FLY_CLOSEST_TRIAD);};
  void SetFlyModeToNone()
    {this->SetFlyMode(VTK_FLY_NONE);};
  //@}

设置X,Y,Z标签
  //@{
  /**
   * Set/Get the labels for the x, y, and z axes. By default,
   * use "X", "Y" and "Z".
   */
  vtkSetStringMacro(XLabel);
  vtkGetStringMacro(XLabel);
  vtkSetStringMacro(YLabel);
  vtkGetStringMacro(YLabel);
  vtkSetStringMacro(ZLabel);
  vtkGetStringMacro(ZLabel);
  //@}

获取X,Y,Z轴的vtkAxisActor2D对象
  /**
   * Retrieve handles to the X, Y and Z axis (so that you can set their text
   * properties for example)
   */
  vtkAxisActor2D *GetXAxisActor2D()
    {return this->XAxis;}
  vtkAxisActor2D *GetYAxisActor2D()
    {return this->YAxis;}
  vtkAxisActor2D *GetZAxisActor2D()
    {return this->ZAxis;}

  //@{

设置Title和Label属性
  //@{
  /**
   * Set/Get the title text property of all axes. Note that each axis can
   * be controlled individually through the GetX/Y/ZAxisActor2D() methods.
   */
  virtual void SetAxisTitleTextProperty(vtkTextProperty *p);
  vtkGetObjectMacro(AxisTitleTextProperty,vtkTextProperty);
  //@}

  //@{
  /**
   * Set/Get the labels text property of all axes. Note that each axis can
   * be controlled individually through the GetX/Y/ZAxisActor2D() methods.
   */
  virtual void SetAxisLabelTextProperty(vtkTextProperty *p);
  vtkGetObjectMacro(AxisLabelTextProperty,vtkTextProperty);
  //@}

设置x,y,z轴标签的显示格式
  //@{
  /**
   * Set/Get the format with which to print the labels on each of the
   * x-y-z axes.
   */
  vtkSetStringMacro(LabelFormat);
  vtkGetStringMacro(LabelFormat);
  //@}

设置影响label和title大小的参数
  //@{
  /**
   * Set/Get the factor that controls the overall size of the fonts used
   * to label and title the axes.
   */
  vtkSetClampMacro(FontFactor, double, 0.1, 2.0);
  vtkGetMacro(FontFactor, double);
  //@}

设置轴切换位置的频率
  //@{
  /**
   * Set/Get the inertial factor that controls how often (i.e, how
   * many renders) the axes can switch position (jump from one axes
   * to another).
   */
  vtkSetClampMacro(Inertia, int, 1, VTK_INT_MAX);
  vtkGetMacro(Inertia, int);
  //@}

设置轴是否可见
  //@{
  /**
   * Turn on and off the visibility of each axis.
   */
  vtkSetMacro(XAxisVisibility,int);
  vtkGetMacro(XAxisVisibility,int);
  vtkBooleanMacro(XAxisVisibility,int);
  vtkSetMacro(YAxisVisibility,int);
  vtkGetMacro(YAxisVisibility,int);
  vtkBooleanMacro(YAxisVisibility,int);
  vtkSetMacro(ZAxisVisibility,int);
  vtkGetMacro(ZAxisVisibility,int);
  vtkBooleanMacro(ZAxisVisibility,int);
  //@}

参考
vtkCubeAxesActor2D.h
vtkCubeAxesActor2D.cxx

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: tecplot 2d是一款强大的二维可视化软件,广泛应用于工程、科学领域的数据分析与可视化。下面是tecplot 2d使用教程简介。 首先,打开tecplot 2d软件,进入主界面。在主界面上方有菜单栏和工具栏,供用户使用不同的功能和工具。 其次,导入数据。在菜单栏中选择"文件",点击"导入",选择数据文件并确定。tecplot 2d支持多种数据格式,如ASCII、二进制等。导入数据后,可以在左侧的数据列表中查看导入的数据。 接下来,选择绘制区域。在菜单栏中选择"图形",点击"绘制区域"。通过拖动鼠标在绘图区域框选,并确定绘图区域的大小和位置。 然后,选择绘制类型。在菜单栏中选择"图形",点击"线图"、"等高线图"、"矢量图"等绘图类型。根据数据类型和需求选择合适的绘图类型。 接着,设置绘图参数。在菜单栏中选择"属性",点击"线条"、"填充"、"箭头"等选项,根据需求设置线条颜色、填充方式、箭头样式等绘图参数。 最后,保存和输出图像。在菜单栏中选择"文件",点击"保存"或"输出图像",选择图像格式(如JPEG、PNG)和保存路径,点击确定即可保存图像。 除了上述基本操作,tecplot 2d还提供了许多高级功能,如数据处理、剖面分析、动画制作等。用户可以通过查阅官方教程或使用帮助手册来学习更多功能和操作方法。 总之,tecplot 2d是一款功能全面的二维可视化软件,通过掌握基本操作和高级功能,用户可以轻松实现对数据的分析和可视化。希望以上简要介绍能对您使用tecplot 2d提供一些帮助。 ### 回答2: Tecplot 2D是一款功能强大的二维可视化软件,它被广泛用于工程和科学领域中的数据可视化和分析。 Tecplot 2D使用教程如下: 1. 安装和启动软件:首先,你需要从Tecplot官方网站下载并安装Tecplot 2D软件。安装完成后,通过双击桌面上的软件图标来启动软件。 2. 导入数据:在导入数据之前,你需要确保数据源文件已准备好并符合Tecplot 2D的格式要求。在软件界面上方的工具栏中找到“数据”选项,并选择“导入数据”。在弹出的对话框中,选择你的数据文件并点击“打开”按钮。 3. 数据预处理:在导入数据后,你可以使用Tecplot 2D的工具进行数据预处理。例如,你可以选择绘制的变量、创建新的变量、在图表中应用网格和曲线等等。 4. 绘图操作:一旦数据准备好,你可以使用Tecplot 2D的绘图工具来创建视觉化图表。你可以选择绘制的图表类型(如曲线、散点图、等值线图等),并在工具栏中选择适当的绘图选项。 5. 标注和注释:Tecplot 2D允许你在图表上添加标题、坐标轴标签和其他注释。你可以通过单击图表上的文本编辑器来编辑注释内容。另外,你还可以更改图表的颜色、线型和线宽等属性。 6. 分析和调整:除了数据可视化,Tecplot 2D还提供了一些分析和调整工具来进一步处理数据。例如,你可以进行数据剖面分析、数据插值和拟合等。 7. 输出和保存:完成图表设计后,你可以选择将图表输出为图像文件或打印出来。通过单击工具栏上的“文件”选项,选择“保存”选项来保存工作。 总之,Tecplot 2D是一款功能强大、易于使用的二维可视化软件,它为用户提供了丰富的数据分析和调整工具,可以帮助科学家和工程师更好地理解和展示他们的数据。 ### 回答3: Tecplot是一种流体动力学和计算流体力学(CFD)后处理软件,可用于绘制、分析和可视化二维和三维数据。下面是Tecplot 2D使用教程的简要介绍。 首先,下载并安装Tecplot软件。根据操作系统的要求,选择适当的版本。安装完成后,启动软件。 在界面上方的菜单栏中,可以找到各种功能和选项。首先,选择文件菜单中的“打开”选项,以加载要处理的数据文件。 一旦数据文件被加载,可以在视图中看到它。使用鼠标右键可以旋转、缩放和平移视图,使其适应所需的角度和大小。 要创建二维图表,首先选择数据文件中感兴趣的变量。使用鼠标左键在图形区域中拖动创建一个矩形,以选择要绘制的区域。 选择“Plot”菜单并在下拉菜单中选择合适的图表类型,如线图、轮廓图或向量图等。 在出现的对话框中,可以选择要在坐标轴上显示的变量和图表的标题。根据需要,可以对轴标签、刻度线等进行设置。 绘制完成后,可以对图表进行进一步的定制。选择“Edit”菜单中的相应选项,例如修改线条颜色、设置符号大小等。 如果需要添加注释或文本框,可以选择“Annotation”菜单并选择合适的选项。 保存图表时,选择“File”菜单中的“Save As”选项,并选择适当的格式和文件名。 除了绘制二维图表,Tecplot还提供其他高级功能和选项,如剖面绘制、动画制作和结果分析等。这些功能可以通过浏览Tecplot的帮助文档或在其网站上查找教程来进一步探索和学习。 总之,Tecplot 2D使用教程提供了一些基本步骤,帮助用户加载数据,选择变量并绘制二维图表,以便在流体动力学和计算流体力学研究中进行数据可视化和分析。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值