superclass for callback/observer methods

vtkCommand is an implementation of the observer/command design pattern. In this design pattern, any instance of vtkObject can be "observed" for any events it might invoke. For example, vtkRenderer invokes a StartEvent as it begins to render and a EndEvent when it finishes rendering. Filters (subclasses of vtkProcessObject) invoke StartEvent, ProgressEvent, and EndEvent as the filter processes data. Observers of events are added with the AddObserver() method found in vtkObject. AddObserver(), besides requiring an event id or name, also takes an instance of vtkCommand (or a subclasses). Note that vtkCommand is meant to be subclassed, so that you can package the information necessary to support your callback.

Event processing can be organized in priority lists, so it is possible to truncate the processing of a particular event by setting the AbortFlag variable. The priority is set using the AddObserver() method. By default the priority is 0, events of the same priority are processed in last-in-first-processed order. The ordering/aborting of events is important for things like 3D widgets, which handle an event if the widget is selected (and then aborting further processing of that event). Otherwise. the event is passed along for further processing.

When an instance of vtkObject invokes an event, it also passes an optional void pointer to a callData. This callData is NULL most of the time. The callData is not specific to a type of event but specific to a type of vtkObject invoking a specific event. For instance, vtkCommand::PickEvent is invoked by vtkProp with a NULL callData but is invoked by vtkInteractorStyleImage with a pointer to the vtkInteractorStyleImage object itself.

Here is the list of events that may be invoked with a non-NULL callData.

  • vtkCommand::ProgressEvent

    • most of the objects return a pointer to a double value ranged between 0.0 and 1.0
    • Infovis/vtkFixedWidthTextReader returns a pointer to a float value equal to the number of lines read so far.
  • vtkCommand::ErrorEvent
    • an error message as a const char * string
  • vtkCommand::WarningEvent
    • a warning message as a const char * string
  • vtkCommand::StartAnimationCueEvent
  • vtkCommand::EndAnimationCueEvent
  • vtkCommand::AnimationCueTickEvent
  • vtkCommand::PickEvent
    • Common/vtkProp returns NULL
    • Rendering/vtkInteractorStyleImage returns a pointer to itself
  • vtkCommand::StartPickEvent
    • Rendering/vtkPropPicker returns NULL
    • Rendering/vtkInteractorStyleImage returns a pointer to itself
  • vtkCommand::EndPickEvent
    • Rendering/vtkPropPicker returns NULL
    • Rendering/vtkInteractorStyleImage returns a pointer to itself
  • vtkCommand::WrongTagEvent
    • Parallel/vtkSocketCommunicator returns a received tag as a char *
  • vtkCommand::SelectionChangedEvent
  • vtkCommand::AnnotationChangedEvent
  • vtkCommand::PlacePointEvent
    • Widgets/vtkSeedWidget returns a pointer to an int, being the current handle number
  • vtkCommand::ResetWindowLevelEvent
    • Widgets/vtkImagePlaneWidget returns an array of 2 double values (window and level)
    • Rendering/vtkInteractorStyleImage returns a pointer to itself
  • vtkCommand::StartWindowLevelEvent
    • Widgets/vtkImagePlaneWidget returns an array of 2 double values (window and level)
    • Rendering/vtkInteractorStyleImage returns a pointer to itself
  • vtkCommand::EndWindowLevelEvent
    • Widgets/vtkImagePlaneWidget returns an array of 2 double values (window and level)
    • Rendering/vtkInteractorStyleImage returns a pointer to itself
  • vtkCommand::WindowLevelEvent
    • Widgets/vtkImagePlaneWidget returns an array of 2 double values (window and level)
    • Rendering/vtkInteractorStyleImage returns a pointer to itself
  • vtkCommand::CharEvent
    • most of the objects return NULL
    • GUISupport/Qt/QVTKWidget returns a QKeyEvent *
  • vtkCommand::TimerEvent
    • most of the objects return a to an int representing a timer id
    • Rendering/vtkXRenderWindowTclInteractor returns NULL
    • Widgets/vtkHoverWidget returns NULL
  • vtkCommand::CreateTimerEvent
    • Rendering/vtkGenericRenderWindowInteractor returns a to an int representing a timer id
  • vtkCommand::DestroyTimerEvent
    • Rendering/vtkGenericRenderWindowInteractor returns a to an int representing a timer id
  • vtkCommand::UserEvent
    • most of the objects return NULL
    • Infovis/vtkInteractorStyleTreeMapHover returns a pointer to a vtkIdType representing a pedigree id
  • vtkCommand::KeyPressEvent
    • most of the objects return NULL
    • GUISupport/Qt/QVTKWidget returns a QKeyEvent*
  • vtkCommand::KeyReleaseEvent
    • most of the objects return NULL
    • GUISupport/Qt/QVTKWidget returns a QKeyEvent*
  • vtkCommand::LeftButtonPressEvent
    • most of the objects return NULL
    • GUISupport/Qt/QVTKWidget returns a QMouseEvent*
  • vtkCommand::LeftButtonReleaseEvent
    • most of the objects return NULL
    • GUISupport/Qt/QVTKWidget returns a QMouseEvent*
  • vtkCommand::MouseMoveEvent
    • most of the objects return NULL
    • GUISupport/Qt/QVTKWidget returns a QMouseEvent*
  • vtkCommand::MouseWheelForwardEvent
    • most of the objects return NULL
    • GUISupport/Qt/QVTKWidget returns a QWheelEvent*
  • vtkCommand::MouseWheelBackwardEvent
    • most of the objects return NULL
    • GUISupport/Qt/QVTKWidget returns a QWheelEvent*
  • vtkCommand::RightButtonPressEvent
    • most of the objects return NULL
    • GUISupport/Qt/QVTKWidget returns a QMouseEvent*
  • vtkCommand::RightButtonReleaseEvent
    • most of the objects return NULL
    • GUISupport/Qt/QVTKWidget returns a QMouseEvent*
  • vtkCommand::MiddleButtonPressEvent
    • most of the objects return NULL
    • GUISupport/Qt/QVTKWidget returns a QMouseEvent*
  • vtkCommand::MiddleButtonReleaseEvent
    • most of the objects return NULL
    • GUISupport/Qt/QVTKWidget returns a QMouseEvent*
  • vtkCommand::CursorChangedEvent
    • most of the objects return a pointer to an int representing a shape
    • Rendering/vtkInteractorObserver returns NULL
  • vtkCommand::ResetCameraEvent
    • Rendering/vtkRenderer returns a pointer to itself
  • vtkCommand::ResetCameraClippingRangeEvent
    • Rendering/vtkRenderer returns a pointer to itself
  • vtkCommand::ActiveCameraEvent
    • Rendering/vtkRenderer returns a pointer to the active camera
  • vtkCommand::CreateCameraEvent
    • Rendering/vtkRenderer returns a pointer to the created camera
  • vtkCommand::EnterEvent
    • most of the objects return NULL
    • GUISupport/Qt/QVTKWidget returns a QEvent*
  • vtkCommand::LeaveEvent
    • most of the objects return NULL
    • GUISupport/Qt/QVTKWidget returns a QEvent*
  • vtkCommand::RenderWindowMessageEvent
    • Rendering/vtkWin32OpenGLRenderWindow return a pointer to a UINT message
  • vtkCommand::ComputeVisiblePropBoundsEvent
    • Rendering/vtkRenderer returns a pointer to itself
  • QVTKWidget::ContextMenuEvent
    • GUISupport/Qt/QVTKWidget returns a QContextMenuEvent*
  • QVTKWidget::DragEnterEvent
    • GUISupport/Qt/QVTKWidget returns a QDragEnterEvent*
  • QVTKWidget::DragMoveEvent
    • GUISupport/Qt/QVTKWidget returns a QDragMoveEvent*
  • QVTKWidget::DragLeaveEvent
    • GUISupport/Qt/QVTKWidget returns a QDragLeaveEvent*
  • QVTKWidget::DropEvent
    • GUISupport/Qt/QVTKWidget returns a QDropEvent*
  • vtkCommand::ViewProgressEvent
    • View/vtkView returns a ViewProgressEventCallData*
  • vtkCommand::VolumeMapperRenderProgressEvent
    • A pointer to a double value between 0.0 and 1.0
  • vtkCommand::VolumeMapperComputeGradientsProgressEvent
    • A pointer to a double value between 0.0 and 1.0
  • vtkCommand::TDxMotionEvent (TDx=3DConnexion)
    • A vtkTDxMotionEventInfo*
  • vtkCommand::TDxButtonPressEvent
    • A int* being the number of the button
  • vtkCommand::TDxButtonReleaseEvent
    • A int* being the number of the button
  • vtkCommand::UpdateShaderEvent
    • A vtkOpenGLHelper* currently being used

关于vtkCommand的各种事件的解释的更多相关文章

  1. 关于tkCommand的各种事件的解释

    superclass for callback/observer methods vtkCommand is an implementation of the observer/command des ...

  2. cocos2d-x 3.0 touch事件官方解释

    官方解释 http://www.cocos2d-x.org/docs/manual/framework/native/input/event-dispatcher/zh#_1

  3. Android ViewGroup拦截触摸事件具体解释

    前言 在自己定义ViewGroup中.有时候须要实现触摸事件拦截.比方ListView下拉刷新就是典型的触摸事件拦截的样例. 触摸事件拦截就是在触摸事件被parent view拦截,而不会分发给其ch ...

  4. .NET 开源工作流: Slickflow流程引擎高级开发(九) -- 条件事件模式解释及应用

    前言:在流程流转过程中,有时候需要条件模式的支持,这样可以使得流程流转更加灵活多变.比如在业务变量满足一定的条件时,可以启动特定配置的流程(或者位于主流程内部的子流程).本文主要描述条件启动和条件中间 ...

  5. 读w3c中文教程对键盘事件解释的感想 -遁地龙卷风

    写这篇博文源于w3c中文教程对键盘事件的解释, onkeydown 某个键盘按键被按下 onkeypress 某个键盘按键被按下并松开 onkeyup 某个键盘按键被松开 可在实践中发现 只注册key ...

  6. JS 预解释相关理解

    1.JS中的内存空间分为两种:栈内存.堆内存 栈内存:提供JS代码执行的环境;存储基本数据类型的值; ->全局作用域或者私有的作用域其实都是栈内存 堆内存:存储引用数据类型的值(对象是把属性名和 ...

  7. jquery实现拖拽以及jquery监听事件的写法

    很久之前写了一个jquery3D楼盘在线选择,这么一个插件,插件很简单,因为后期项目中没有实际用到,因此,有些地方不是很完善,后面也懒得再进行修改维护了.最近放到github上面,但是也少有人问津及s ...

  8. Android学习第六弹之Touch事件的处理

    在移动开发过程当中,我们经常会遇到手势处理和事件触摸的情况,如果不了解整个事件的处理机制,对于开发的同学和码农是非常痛苦的,但是事件触摸的处理确实是一个非常复杂的过程,细讲起来,估计我都能讲迷糊,这里 ...

  9. GridView事件DataBinding,DataBound,RowCreated,RowDataBound区别及执行顺序分析

    严格的说,DataBinding,DataBound并不是GridView特有的事件,其他的控件诸如ListBox等也有DataBinding,DataBound事件. DataBinding事件MS ...

随机推荐

  1. JS 转Boolean的两张方法

    // 1.Boolean() console.log(Boolean(123)); // true console.log(Boolean(undefined)); // false console. ...

  2. Angular2 父子组件通信方式

    https://www.jb51.net/article/133868.htm 这次给大家带来Angular2 父子组件通信方式,使用Angular2 父子组件通信方式的注意事项有哪些,下面就是实战案 ...

  3. ebay API属性

    Ebay Trading API整理 纠纷相关 AddDispute:创建一个未支付纠纷 或 取消 a single line item order AddDisputeResponse:回复/关闭d ...

  4. 使用GitHub(三):使用VSCode+GitHub进行版本控制

    使用GitHub(三):使用VSCode+GitHub进行版本控制 本文简单介绍使用VSCode+GitHub进行项目或者代码的版本控制.本文主要目的是对学习内容进行总结以及方便日后查阅. 详细教程和 ...

  5. Newsgroups数据集研究

    1.数据集介绍 20newsgroups数据集是用于文本分类.文本挖据和信息检索研究的国际标准数据集之一. 数据集收集了大约20,000左右的新闻组文档,均匀分为20个不同主题的新闻组集合. 一些新闻 ...

  6. 使用sql做迁移矩阵

    在数据分析数据差异的时候 经常用到一个图叫做迁移矩阵. 其中里面的值可以是数量也可以是百分比,我们可以从一个时间点明确的看到在另一个时间点或者另一个时间点 子类之间数量迁移. 比如这次我在公司与业务核 ...

  7. sklearn学习一

    转发说明:by majunman    from HIT    email:2192483210@qq.com 简介:scikit-learn是数据挖掘和数据分析的有效工具,它建立在 NumPy, S ...

  8. 什么情况下JVM会立即对类进行初始化

    虚拟机规范严格规定了有且只有5种情况必须立即对类进行“初始化”(加载.验证.准备等阶段在此之前开始). 遇到new.getstatic.putstatic.invokestatic等4条字节码指令时. ...

  9. 51 Nod 1134 最长递增子序列(经典问题回顾)

    1134 最长递增子序列  基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题  收藏  关注 给出长度为N的数组,找出这个数组的最长递增子序列.(递增子序列是指,子序列的元 ...

  10. 51 Nod 大鱼吃小鱼

    1289 大鱼吃小鱼  题目来源: Codility 基准时间限制:1 秒 空间限制:131072 KB 分值: 5 难度:1级算法题  收藏  关注 有N条鱼每条鱼的位置及大小均不同,他们沿着X轴游 ...