VTK
9.3.20240831
|
Provides a 2D scene for vtkContextItem objects. More...
#include <vtkContextScene.h>
Public Types | |
enum | SelectionModifier { SELECTION_DEFAULT = 0 , SELECTION_ADDITION , SELECTION_SUBTRACTION , SELECTION_TOGGLE } |
Enum of valid selection modes for charts in the scene. More... | |
typedef vtkObject | Superclass |
Public Member Functions | |
virtual vtkTypeBool | IsA (const char *type) |
Return 1 if this class is the same type of (or a subclass of) the named class. | |
vtkContextScene * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. | |
virtual bool | Paint (vtkContext2D *painter) |
Paint event for the chart, called whenever the chart needs to be drawn. | |
unsigned int | AddItem (vtkAbstractContextItem *item) |
Add child items to this item. | |
bool | RemoveItem (vtkAbstractContextItem *item) |
Remove child item from this item. | |
bool | RemoveItem (unsigned int index) |
Remove child item from this item. | |
vtkAbstractContextItem * | GetItem (unsigned int index) |
Get the item at the specified index. | |
unsigned int | GetNumberOfItems () |
Get the number of child items. | |
void | ClearItems () |
Remove all child items from this item. | |
void | RemoveAllItems () |
virtual void | SetAnnotationLink (vtkAnnotationLink *link) |
Set the vtkAnnotationLink for the chart. | |
virtual int | GetViewWidth () |
Get the width of the view (render window) containing this scene. | |
virtual int | GetViewHeight () |
Get the height of the view (render window) containing this scene. | |
virtual int | GetSceneLeft () |
Get the left of the scene in screen coordinates. | |
virtual int | GetSceneBottom () |
Get the bottom of the scene in screen coordinates. | |
int | GetSceneWidth () |
Get the width of the scene. | |
int | GetSceneHeight () |
Get the height of the scene. | |
vtkVector2i | GetLogicalTileScale () |
The tile scale of the target vtkRenderWindow. | |
void | ReleaseGraphicsResources () |
Release graphics resources hold by the scene. | |
vtkWeakPointer< vtkContext2D > | GetLastPainter () |
Last painter used. | |
vtkAbstractContextBufferId * | GetBufferId () |
Return buffer id. | |
virtual void | SetTransform (vtkTransform2D *transform) |
Set the transform for the scene. | |
vtkTransform2D * | GetTransform () |
Get the transform for the scene. | |
bool | HasTransform () |
Check whether the scene has a transform. | |
vtkIdType | GetPickedItem (int x, int y) |
Return the item id under mouse cursor at position (x,y). | |
vtkAbstractContextItem * | GetPickedItem () |
Return the item under the mouse. | |
virtual vtkAnnotationLink * | GetAnnotationLink () |
Get the vtkAnnotationLink for the chart. | |
virtual void | SetOrigin (int, int) |
Get/Set the origin (bottom-left) coordinate of the scene in pixels (screen coordinates). | |
void | SetOrigin (int[2]) |
Get/Set the origin (bottom-left) coordinate of the scene in pixels (screen coordinates). | |
virtual int * | GetOrigin () |
Get/Set the origin (bottom-left) coordinate of the scene in pixels (screen coordinates). | |
virtual void | GetOrigin (int &, int &) |
Get/Set the origin (bottom-left) coordinate of the scene in pixels (screen coordinates). | |
virtual void | GetOrigin (int[2]) |
Get/Set the origin (bottom-left) coordinate of the scene in pixels (screen coordinates). | |
virtual void | SetGeometry (int, int) |
Set the width and height of the scene in pixels. | |
void | SetGeometry (int[2]) |
Set the width and height of the scene in pixels. | |
virtual int * | GetGeometry () |
Get the width and height of the scene in pixels. | |
virtual void | GetGeometry (int &, int &) |
Get the width and height of the scene in pixels. | |
virtual void | GetGeometry (int[2]) |
Get the width and height of the scene in pixels. | |
virtual void | SetUseBufferId (bool) |
Set whether the scene should use the color buffer. | |
virtual bool | GetUseBufferId () |
Get whether the scene is using the color buffer. | |
virtual void | SetScaleTiles (bool) |
Whether to scale the scene transform when tiling, for example when using vtkWindowToImageFilter to take a large screenshot. | |
virtual bool | GetScaleTiles () |
Whether to scale the scene transform when tiling, for example when using vtkWindowToImageFilter to take a large screenshot. | |
virtual void | ScaleTilesOn () |
Whether to scale the scene transform when tiling, for example when using vtkWindowToImageFilter to take a large screenshot. | |
virtual void | ScaleTilesOff () |
Whether to scale the scene transform when tiling, for example when using vtkWindowToImageFilter to take a large screenshot. | |
virtual void | SetRenderer (vtkRenderer *renderer) |
This should not be necessary as the context view should take care of rendering. | |
virtual vtkRenderer * | GetRenderer () |
This should not be necessary as the context view should take care of rendering. | |
void | SetDirty (bool isDirty) |
Inform the scene that something changed that requires a repaint of the scene. | |
bool | GetDirty () const |
Inform the scene that something changed that requires a repaint of the scene. | |
![]() | |
vtkBaseTypeMacro (vtkObject, vtkObjectBase) | |
virtual void | DebugOn () |
Turn debugging output on. | |
virtual void | DebugOff () |
Turn debugging output off. | |
bool | GetDebug () |
Get the value of the debug flag. | |
void | SetDebug (bool debugFlag) |
Set the value of the debug flag. | |
virtual void | Modified () |
Update the modification time for this object. | |
virtual vtkMTimeType | GetMTime () |
Return this object's modified time. | |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. | |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
vtkTypeBool | HasObserver (unsigned long event) |
vtkTypeBool | HasObserver (const char *event) |
vtkTypeBool | InvokeEvent (unsigned long event) |
vtkTypeBool | InvokeEvent (const char *event) |
std::string | GetObjectDescription () const override |
The object description printed in messages and PrintSelf output. | |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
vtkCommand * | GetCommand (unsigned long tag) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
void | RemoveObserver (vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
void | RemoveObservers (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
void | RemoveObservers (const char *event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
vtkTypeBool | HasObserver (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
vtkTypeBool | HasObserver (const char *event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
Overloads to AddObserver that allow developers to add class member functions as callbacks for events. | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
Overloads to AddObserver that allow developers to add class member functions as callbacks for events. | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
Allow user to set the AbortFlagOn() with the return value of the callback method. | |
vtkTypeBool | InvokeEvent (unsigned long event, void *callData) |
This method invokes an event and return whether the event was aborted or not. | |
vtkTypeBool | InvokeEvent (const char *event, void *callData) |
This method invokes an event and return whether the event was aborted or not. | |
virtual void | SetObjectName (const std::string &objectName) |
Set/get the name of this object for reporting purposes. | |
virtual std::string | GetObjectName () const |
Set/get the name of this object for reporting purposes. | |
![]() | |
const char * | GetClassName () const |
Return the class name as a string. | |
virtual std::string | GetObjectDescription () const |
The object description printed in messages and PrintSelf output. | |
virtual vtkTypeBool | IsA (const char *name) |
Return 1 if this class is the same type of (or a subclass of) the named class. | |
virtual vtkIdType | GetNumberOfGenerationsFromBase (const char *name) |
Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). | |
virtual void | Delete () |
Delete a VTK object. | |
virtual void | FastDelete () |
Delete a reference to this object. | |
void | InitializeObjectBase () |
void | Print (ostream &os) |
Print an object to an ostream. | |
void | Register (vtkObjectBase *o) |
Increase the reference count (mark as used by another object). | |
virtual void | UnRegister (vtkObjectBase *o) |
Decrease the reference count (release by another object). | |
int | GetReferenceCount () |
Return the current reference count of this object. | |
void | SetReferenceCount (int) |
Sets the reference count. | |
bool | GetIsInMemkind () const |
A local state flag that remembers whether this object lives in the normal or extended memory space. | |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
Methods invoked by print to print information about the object including superclasses. | |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
Methods invoked by print to print information about the object including superclasses. | |
virtual bool | UsesGarbageCollector () const |
Indicate whether the class uses vtkGarbageCollector or not. | |
Static Public Member Functions | |
static vtkTypeBool | IsTypeOf (const char *type) |
static vtkContextScene * | SafeDownCast (vtkObjectBase *o) |
static vtkContextScene * | New () |
Creates a 2D Painter object. | |
![]() | |
static vtkObject * | New () |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on. | |
static void | BreakOnError () |
This method is called when vtkErrorMacro executes. | |
static void | SetGlobalWarningDisplay (vtkTypeBool val) |
This is a global flag that controls whether any debug, warning or error messages are displayed. | |
static void | GlobalWarningDisplayOn () |
This is a global flag that controls whether any debug, warning or error messages are displayed. | |
static void | GlobalWarningDisplayOff () |
This is a global flag that controls whether any debug, warning or error messages are displayed. | |
static vtkTypeBool | GetGlobalWarningDisplay () |
This is a global flag that controls whether any debug, warning or error messages are displayed. | |
![]() | |
static vtkTypeBool | IsTypeOf (const char *name) |
Return 1 if this class type is the same type of (or a subclass of) the named class. | |
static vtkIdType | GetNumberOfGenerationsFromBaseType (const char *name) |
Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). | |
static vtkObjectBase * | New () |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on. | |
static void | SetMemkindDirectory (const char *directoryname) |
The name of a directory, ideally mounted -o dax, to memory map an extended memory space within. | |
static bool | GetUsingMemkind () |
A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space. | |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkContextScene () | |
~vtkContextScene () override | |
virtual bool | ProcessSelectionEvent (unsigned int rect[5]) |
Process a rubber band selection event. | |
virtual bool | MouseMoveEvent (const vtkContextMouseEvent &event) |
Process a mouse move event. | |
virtual bool | ButtonPressEvent (const vtkContextMouseEvent &event) |
Process a mouse button press event. | |
virtual bool | ButtonReleaseEvent (const vtkContextMouseEvent &event) |
Process a mouse button release event. | |
virtual bool | DoubleClickEvent (const vtkContextMouseEvent &event) |
Process a mouse button double click event. | |
virtual bool | MouseWheelEvent (int delta, const vtkContextMouseEvent &event) |
Process a mouse wheel event where delta is the movement forward or back. | |
virtual bool | KeyPressEvent (const vtkContextKeyEvent &keyEvent) |
Process a key press event. | |
virtual bool | KeyReleaseEvent (const vtkContextKeyEvent &keyEvent) |
Process a key release event. | |
virtual void | PaintIds () |
Paint the scene in a special mode to build a cache for picking. | |
void | TestBufferIdSupport () |
Test if BufferId is supported by the OpenGL context. | |
void | UpdateBufferId () |
Make sure the buffer id used for picking is up-to-date. | |
![]() | |
vtkObject () | |
~vtkObject () override | |
void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) override |
void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr) |
These methods allow a command to exclusively grab all events. | |
void | InternalReleaseFocus () |
These methods allow a command to exclusively grab all events. | |
![]() | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) |
virtual void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) |
virtual void | ReportReferences (vtkGarbageCollector *) |
virtual void | ObjectFinalize () |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Protected Attributes | |
vtkAnnotationLink * | AnnotationLink |
int | Origin [2] |
int | Geometry [2] |
vtkContextScenePrivate * | Children |
This structure provides a list of children, along with convenience functions to paint the children etc. | |
vtkWeakPointer< vtkContext2D > | LastPainter |
vtkWeakPointer< vtkRenderer > | Renderer |
vtkAbstractContextBufferId * | BufferId |
bool | BufferIdDirty |
bool | UseBufferId |
bool | BufferIdSupportTested |
bool | BufferIdSupported |
bool | ScaleTiles |
vtkTransform2D * | Transform |
The scene level transform. | |
Private * | Storage |
![]() | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
std::string | ObjectName |
![]() | |
std::atomic< int32_t > | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
Friends | |
class | vtkContextInteractorStyle |
The vtkContextInteractorStyle class delegates all of the events to the scene, accessing protected API. | |
Additional Inherited Members | |
![]() | |
static vtkMallocingFunction | GetCurrentMallocFunction () |
static vtkReallocingFunction | GetCurrentReallocFunction () |
static vtkFreeingFunction | GetCurrentFreeFunction () |
static vtkFreeingFunction | GetAlternateFreeFunction () |
Provides a 2D scene for vtkContextItem objects.
Provides a 2D scene that vtkContextItem objects can be added to. Manages the items, ensures that they are rendered at the right times and passes on mouse events.
Definition at line 112 of file vtkContextScene.h.
typedef vtkObject vtkContextScene::Superclass |
Definition at line 115 of file vtkContextScene.h.
Enum of valid selection modes for charts in the scene.
Enumerator | |
---|---|
SELECTION_DEFAULT | |
SELECTION_ADDITION | |
SELECTION_SUBTRACTION | |
SELECTION_TOGGLE |
Definition at line 339 of file vtkContextScene.h.
|
protected |
|
overrideprotected |
|
static |
|
virtual |
Return 1 if this class is the same type of (or a subclass of) the named class.
Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkObjectBase.
|
static |
|
protectedvirtual |
vtkContextScene * vtkContextScene::NewInstance | ( | ) | const |
|
overridevirtual |
Methods invoked by print to print information about the object including superclasses.
Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkObjectBase.
|
static |
Creates a 2D Painter object.
|
virtual |
Paint event for the chart, called whenever the chart needs to be drawn.
unsigned int vtkContextScene::AddItem | ( | vtkAbstractContextItem * | item | ) |
Add child items to this item.
Increments reference count of item.
bool vtkContextScene::RemoveItem | ( | vtkAbstractContextItem * | item | ) |
Remove child item from this item.
Decrements reference count of item.
item | the item to be removed. |
bool vtkContextScene::RemoveItem | ( | unsigned int | index | ) |
Remove child item from this item.
Decrements reference count of item.
index | of the item to be removed. |
vtkAbstractContextItem * vtkContextScene::GetItem | ( | unsigned int | index | ) |
Get the item at the specified index.
unsigned int vtkContextScene::GetNumberOfItems | ( | ) |
Get the number of child items.
void vtkContextScene::ClearItems | ( | ) |
Remove all child items from this item.
|
inline |
Definition at line 163 of file vtkContextScene.h.
|
virtual |
Set the vtkAnnotationLink for the chart.
|
virtual |
Get the vtkAnnotationLink for the chart.
|
virtual |
Get/Set the origin (bottom-left) coordinate of the scene in pixels (screen coordinates).
void vtkContextScene::SetOrigin | ( | int | [2] | ) |
Get/Set the origin (bottom-left) coordinate of the scene in pixels (screen coordinates).
|
virtual |
Get/Set the origin (bottom-left) coordinate of the scene in pixels (screen coordinates).
|
virtual |
Get/Set the origin (bottom-left) coordinate of the scene in pixels (screen coordinates).
|
virtual |
Get/Set the origin (bottom-left) coordinate of the scene in pixels (screen coordinates).
|
virtual |
Set the width and height of the scene in pixels.
void vtkContextScene::SetGeometry | ( | int | [2] | ) |
Set the width and height of the scene in pixels.
|
virtual |
Get the width and height of the scene in pixels.
|
virtual |
Get the width and height of the scene in pixels.
|
virtual |
Get the width and height of the scene in pixels.
|
virtual |
Set whether the scene should use the color buffer.
Default is true.
|
virtual |
Get whether the scene is using the color buffer.
Default is true.
|
virtual |
Get the width of the view (render window) containing this scene.
Note that this might be larger than the scene width, which can be retrieved using the GetSceneWidth method, when multiple viewports are defined in the render window.
|
virtual |
Get the height of the view (render window) containing this scene.
Note that this might be larger than the scene height, which can be retrieved using the GetSceneHeight method, when multiple viewports are defined in the render window.
|
virtual |
Get the left of the scene in screen coordinates.
This is equivalent to GetOrigin[0].
|
virtual |
Get the bottom of the scene in screen coordinates.
This is equivalent to GetOrigin[1].
int vtkContextScene::GetSceneWidth | ( | ) |
Get the width of the scene.
int vtkContextScene::GetSceneHeight | ( | ) |
Get the height of the scene.
|
virtual |
Whether to scale the scene transform when tiling, for example when using vtkWindowToImageFilter to take a large screenshot.
The default is true.
|
virtual |
Whether to scale the scene transform when tiling, for example when using vtkWindowToImageFilter to take a large screenshot.
The default is true.
|
virtual |
Whether to scale the scene transform when tiling, for example when using vtkWindowToImageFilter to take a large screenshot.
The default is true.
|
virtual |
Whether to scale the scene transform when tiling, for example when using vtkWindowToImageFilter to take a large screenshot.
The default is true.
vtkVector2i vtkContextScene::GetLogicalTileScale | ( | ) |
The tile scale of the target vtkRenderWindow.
Hardcoded pixel offsets, etc should properly account for these <x, y> scale factors. This will simply return vtkVector2i(1, 1) if ScaleTiles is false or if this->Renderer is NULL.
|
virtual |
This should not be necessary as the context view should take care of rendering.
|
virtual |
This should not be necessary as the context view should take care of rendering.
void vtkContextScene::SetDirty | ( | bool | isDirty | ) |
Inform the scene that something changed that requires a repaint of the scene.
This should only be used by the vtkContextItem derived objects in a scene in their event handlers.
bool vtkContextScene::GetDirty | ( | ) | const |
Inform the scene that something changed that requires a repaint of the scene.
This should only be used by the vtkContextItem derived objects in a scene in their event handlers.
void vtkContextScene::ReleaseGraphicsResources | ( | ) |
Release graphics resources hold by the scene.
vtkWeakPointer< vtkContext2D > vtkContextScene::GetLastPainter | ( | ) |
Last painter used.
Not part of the end-user API. Can be used by context items to create their own colorbuffer id (when a context item is a container).
vtkAbstractContextBufferId * vtkContextScene::GetBufferId | ( | ) |
Return buffer id.
Not part of the end-user API. Can be used by context items to initialize their own colorbuffer id (when a context item is a container).
|
virtual |
Set the transform for the scene.
vtkTransform2D * vtkContextScene::GetTransform | ( | ) |
Get the transform for the scene.
|
inline |
Check whether the scene has a transform.
Definition at line 321 of file vtkContextScene.h.
vtkIdType vtkContextScene::GetPickedItem | ( | int | x, |
int | y | ||
) |
Return the item id under mouse cursor at position (x,y).
Return -1 if there is no item under the mouse cursor.
vtkAbstractContextItem * vtkContextScene::GetPickedItem | ( | ) |
Return the item under the mouse.
If no item is under the mouse, the method returns a null pointer.
|
protectedvirtual |
Process a rubber band selection event.
|
protectedvirtual |
Process a mouse move event.
|
protectedvirtual |
Process a mouse button press event.
|
protectedvirtual |
Process a mouse button release event.
|
protectedvirtual |
Process a mouse button double click event.
|
protectedvirtual |
Process a mouse wheel event where delta is the movement forward or back.
|
protectedvirtual |
Process a key press event.
|
protectedvirtual |
Process a key release event.
|
protectedvirtual |
Paint the scene in a special mode to build a cache for picking.
Use internally.
|
protected |
Test if BufferId is supported by the OpenGL context.
|
protected |
Make sure the buffer id used for picking is up-to-date.
|
friend |
The vtkContextInteractorStyle class delegates all of the events to the scene, accessing protected API.
Definition at line 418 of file vtkContextScene.h.
|
protected |
Definition at line 407 of file vtkContextScene.h.
|
protected |
Definition at line 410 of file vtkContextScene.h.
|
protected |
Definition at line 412 of file vtkContextScene.h.
|
protected |
Definition at line 425 of file vtkContextScene.h.
|
protected |
This structure provides a list of children, along with convenience functions to paint the children etc.
It is derived from std::vector<vtkAbstractContextItem>, defined in a private header.
Definition at line 433 of file vtkContextScene.h.
|
protected |
Definition at line 435 of file vtkContextScene.h.
|
protected |
Definition at line 437 of file vtkContextScene.h.
|
protected |
Definition at line 439 of file vtkContextScene.h.
|
protected |
Definition at line 440 of file vtkContextScene.h.
|
protected |
Definition at line 442 of file vtkContextScene.h.
|
protected |
Definition at line 444 of file vtkContextScene.h.
|
protected |
Definition at line 445 of file vtkContextScene.h.
|
protected |
Definition at line 447 of file vtkContextScene.h.
|
protected |
The scene level transform.
Definition at line 452 of file vtkContextScene.h.