zoukankan      html  css  js  c++  java
  • 关于vtkCommand的各种事件的解释

    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
  • 相关阅读:
    mybatis动态查询,模糊查询
    Python 列表
    异步加载实现点赞功能($.load 出现post不支持)
    shiro多账号登录(用户名,手机号,邮箱)
    spring data jpa 级联操作的时候注意事项
    semantic UI 点击按钮自动提交表单原因
    上线日期
    有关弱类型意识、DOM、动态语言与函数式编程
    视频项目时长的存储和程序设计方案---单例模式节省内存空间以及自定义注解
    项目中整合第三方插件与SpringMVC数据格式化关于ip地址
  • 原文地址:https://www.cnblogs.com/phoenixdsg/p/6171169.html
Copyright © 2011-2022 走看看