Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
vtkSMTrace Class Reference

vtkSMTrace is used to produce Python trace in the ParaView application. More...

#include <vtkSMTrace.h>

Inheritance diagram for vtkSMTrace:
Inheritance graph
[legend]
Collaboration diagram for vtkSMTrace:
Collaboration graph
[legend]

Classes

class  TraceItem
 
class  TraceItemArgs
 

Public Types

enum  { RECORD_ALL_PROPERTIES = 0, RECORD_MODIFIED_PROPERTIES = 1, RECORD_USER_MODIFIED_PROPERTIES = 2 }
 
typedef vtkSMObject Superclass
 
- Public Types inherited from vtkSMObject
typedef vtkObject Superclass
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
virtual void SetPropertiesToTraceOnCreate (int)
 
virtual int GetPropertiesToTraceOnCreate ()
 
std::string GetCurrentTrace ()
 Return the current trace. More...
 
virtual void SetTraceXMLDefaults (bool)
 Get/Set whether all properties should be saved for a proxy, including the default values. More...
 
virtual bool GetTraceXMLDefaults ()
 Get/Set whether all properties should be saved for a proxy, including the default values. More...
 
virtual void SetLogTraceToStdout (bool)
 Log generated trace to stdout as the trace is being generated (useful for debugging). More...
 
virtual bool GetLogTraceToStdout ()
 Log generated trace to stdout as the trace is being generated (useful for debugging). More...
 
virtual void SetFullyTraceSupplementalProxies (bool)
 Supplemental proxies are proxies that not explicitly created by the user i.e. More...
 
virtual bool GetFullyTraceSupplementalProxies ()
 Supplemental proxies are proxies that not explicitly created by the user i.e. More...
 
virtual void SetSkipRenderingComponents (bool)
 Skip rendering components such as views, representations. More...
 
virtual bool GetSkipRenderingComponents ()
 Skip rendering components such as views, representations. More...
 
virtual void SetFullyTraceCameraAdjustments (bool)
 The trace will include camera interaction. More...
 
virtual bool GetFullyTraceCameraAdjustments ()
 The trace will include camera interaction. More...
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual vtkMTimeType GetMTime ()
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
void SetReferenceCount (int)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 
void PrintRevisions (ostream &)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 
void PrintRevisions (ostream &)
 

Static Public Member Functions

static vtkSMTraceNew ()
 
static int IsTypeOf (const char *type)
 
static vtkSMTraceSafeDownCast (vtkObject *o)
 
static vtkSMTraceGetActiveTracer ()
 Provides access to the "active" tracer. More...
 
static vtkSMTraceStartTrace (const char *preamble=nullptr)
 Methods to start/stop tracing. More...
 
static std::string StopTrace ()
 Stop trace and return the generated trace script. More...
 
static std::string GetState (vtkSMProxy *options)
 Generate a Python state for the application and return it. More...
 
- Static Public Member Functions inherited from vtkSMObject
static vtkSMObjectNew ()
 
static int IsTypeOf (const char *type)
 
static vtkSMObjectSafeDownCast (vtkObject *o)
 
static std::string CreatePrettyLabel (const std::string &name)
 Return a well-formated label using provided name by adding spaces between lower cases and upper cases: More...
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 
static vtkObjectBaseNew ()
 
bool TraceXMLDefaults
 Returns true of there's an error. More...
 
bool LogTraceToStdout
 Returns true of there's an error. More...
 
int PropertiesToTraceOnCreate
 Returns true of there's an error. More...
 
bool FullyTraceSupplementalProxies
 Returns true of there's an error. More...
 
bool SkipRenderingComponents
 Returns true of there's an error. More...
 
bool FullyTraceCameraAdjustments
 Returns true of there's an error. More...
 
class TraceItem
 Returns true of there's an error. More...
 
 vtkSMTrace ()
 Returns true of there's an error. More...
 
 ~vtkSMTrace () override
 Returns true of there's an error. More...
 
bool CheckForError ()
 Returns true of there's an error. More...
 

Additional Inherited Members

- Protected Member Functions inherited from vtkSMObject
 vtkSMObject ()
 
 ~vtkSMObject () override
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

vtkSMTrace is used to produce Python trace in the ParaView application.

vtkSMTrace is used to produce Python trace in the ParaView application. To start/stop trace, use the static API vtkSMTrace::StartTrace() and vtkSMTrace::StopTrace(). That sets up the vtkSMTrace instance used as the ActiveTracer. You can setup configuration parameters on the vtkSMTrace instance returned by vtkSMTrace::StartTrace(). The configuration parameters control various aspects of the trace.

To effective tracing, the application logic should explicitly trace traceable actions by using the SM_SCOPED_TRACE() macro. This macro will have any effect only when there's an ActiveTracer setup i.e tracing is in effect. The result on using SM_SCOPED_TRACE() when tracing is active, is to crate a Python class instance. The name of the class is the argument to SM_SCOPED_TRACE() and the class is defined in paraview.smtrace module. There are various classes defined for tracing specific actions like Show, RegisterViewProxy, and generic actions like PropertiesModified. Keyword or positional arguments can be passed to the constructor using the following the syntax:

// pass keyword arguments.
SM_SCOPED_TRACE(PropertiesModified)
.arg("proxy", aProxy)
.arg("comment", "some comment");
// pass positional arguments.
SM_SCOPED_TRACE(PropertiesModified)
.arg(aProxy)
.arg("some comment");
// mixing positional and keyword arguments.
SM_SCOPED_TRACE(PropertiesModified)
.arg(aProxy)
.arg("comment", "some comment");

The constructed class instance is finalized and deleted when the temporary variable created by the macro goes out of scope (hence the name SM_SCOPED_TRACE).

Definition at line 59 of file vtkSMTrace.h.

Member Typedef Documentation

◆ Superclass

Definition at line 63 of file vtkSMTrace.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
RECORD_ALL_PROPERTIES 
RECORD_MODIFIED_PROPERTIES 
RECORD_USER_MODIFIED_PROPERTIES 

Definition at line 137 of file vtkSMTrace.h.

Constructor & Destructor Documentation

◆ vtkSMTrace()

vtkSMTrace::vtkSMTrace ( )
protected

Returns true of there's an error.

Otherwise, returns false.

◆ ~vtkSMTrace()

vtkSMTrace::~vtkSMTrace ( )
overrideprotected

Returns true of there's an error.

Otherwise, returns false.

Member Function Documentation

◆ New()

static vtkSMTrace* vtkSMTrace::New ( )
static

◆ GetClassName()

virtual const char* vtkSMTrace::GetClassName ( )
virtual

Reimplemented from vtkSMObject.

◆ IsTypeOf()

static int vtkSMTrace::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual int vtkSMTrace::IsA ( const char *  type)
virtual

Reimplemented from vtkSMObject.

◆ SafeDownCast()

static vtkSMTrace* vtkSMTrace::SafeDownCast ( vtkObject o)
static

◆ PrintSelf()

void vtkSMTrace::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

Reimplemented from vtkSMObject.

◆ GetActiveTracer()

static vtkSMTrace* vtkSMTrace::GetActiveTracer ( )
inlinestatic

Provides access to the "active" tracer.

There can only be one active tracer in the application currently.

Definition at line 70 of file vtkSMTrace.h.

◆ StartTrace()

static vtkSMTrace* vtkSMTrace::StartTrace ( const char *  preamble = nullptr)
static

Methods to start/stop tracing.

This will create a new instance of vtkSMTrace and set that up as the active tracer. If an active tracer is already present, then this will simply return the current active tracer.

  • preamble non-null string to use as the header for the generated trace. If nullptr, then a default preamble using ParaView version number will be used. If empty string, then no preamble will be added added.

◆ StopTrace()

static std::string vtkSMTrace::StopTrace ( )
static

Stop trace and return the generated trace script.

This will also destroy the active tracer.

◆ SetTraceXMLDefaults()

virtual void vtkSMTrace::SetTraceXMLDefaults ( bool  )
virtual

Get/Set whether all properties should be saved for a proxy, including the default values.

If false, only the properties that have been modified from the XML-defaults will be logged.

◆ GetTraceXMLDefaults()

virtual bool vtkSMTrace::GetTraceXMLDefaults ( )
virtual

Get/Set whether all properties should be saved for a proxy, including the default values.

If false, only the properties that have been modified from the XML-defaults will be logged.

◆ SetLogTraceToStdout()

virtual void vtkSMTrace::SetLogTraceToStdout ( bool  )
virtual

Log generated trace to stdout as the trace is being generated (useful for debugging).

◆ GetLogTraceToStdout()

virtual bool vtkSMTrace::GetLogTraceToStdout ( )
virtual

Log generated trace to stdout as the trace is being generated (useful for debugging).

◆ SetFullyTraceSupplementalProxies()

virtual void vtkSMTrace::SetFullyTraceSupplementalProxies ( bool  )
virtual

Supplemental proxies are proxies that not explicitly created by the user i.e.

proxies such as lookup tables, scalar bars, animation scene, etc. When set to true (default is false), the first time such a proxy is encountered in the trace, the trace will log the property values on that proxy using the PropertiesToTraceOnCreate rules.

◆ GetFullyTraceSupplementalProxies()

virtual bool vtkSMTrace::GetFullyTraceSupplementalProxies ( )
virtual

Supplemental proxies are proxies that not explicitly created by the user i.e.

proxies such as lookup tables, scalar bars, animation scene, etc. When set to true (default is false), the first time such a proxy is encountered in the trace, the trace will log the property values on that proxy using the PropertiesToTraceOnCreate rules.

◆ SetSkipRenderingComponents()

virtual void vtkSMTrace::SetSkipRenderingComponents ( bool  )
virtual

Skip rendering components such as views, representations.

◆ GetSkipRenderingComponents()

virtual bool vtkSMTrace::GetSkipRenderingComponents ( )
virtual

Skip rendering components such as views, representations.

◆ SetFullyTraceCameraAdjustments()

virtual void vtkSMTrace::SetFullyTraceCameraAdjustments ( bool  )
virtual

The trace will include camera interaction.

(default false)

◆ GetFullyTraceCameraAdjustments()

virtual bool vtkSMTrace::GetFullyTraceCameraAdjustments ( )
virtual

The trace will include camera interaction.

(default false)

◆ SetPropertiesToTraceOnCreate()

virtual void vtkSMTrace::SetPropertiesToTraceOnCreate ( int  )
virtual

◆ GetPropertiesToTraceOnCreate()

virtual int vtkSMTrace::GetPropertiesToTraceOnCreate ( )
virtual

◆ GetCurrentTrace()

std::string vtkSMTrace::GetCurrentTrace ( )

Return the current trace.

◆ GetState()

static std::string vtkSMTrace::GetState ( vtkSMProxy options)
static

Generate a Python state for the application and return it.

Note this cannot be called when Python tracing is active.

options is a proxy with options to customize the state generation such as `('pythontracing', 'PythonStateOptions')`.

◆ CheckForError()

bool vtkSMTrace::CheckForError ( )
protected

Returns true of there's an error.

Otherwise, returns false.

Friends And Related Function Documentation

◆ TraceItem

friend class TraceItem
friend

Returns true of there's an error.

Otherwise, returns false.

Definition at line 243 of file vtkSMTrace.h.

Member Data Documentation

◆ TraceXMLDefaults

bool vtkSMTrace::TraceXMLDefaults
protected

Returns true of there's an error.

Otherwise, returns false.

Definition at line 228 of file vtkSMTrace.h.

◆ LogTraceToStdout

bool vtkSMTrace::LogTraceToStdout
protected

Returns true of there's an error.

Otherwise, returns false.

Definition at line 229 of file vtkSMTrace.h.

◆ PropertiesToTraceOnCreate

int vtkSMTrace::PropertiesToTraceOnCreate
protected

Returns true of there's an error.

Otherwise, returns false.

Definition at line 230 of file vtkSMTrace.h.

◆ FullyTraceSupplementalProxies

bool vtkSMTrace::FullyTraceSupplementalProxies
protected

Returns true of there's an error.

Otherwise, returns false.

Definition at line 231 of file vtkSMTrace.h.

◆ SkipRenderingComponents

bool vtkSMTrace::SkipRenderingComponents
protected

Returns true of there's an error.

Otherwise, returns false.

Definition at line 232 of file vtkSMTrace.h.

◆ FullyTraceCameraAdjustments

bool vtkSMTrace::FullyTraceCameraAdjustments
protected

Returns true of there's an error.

Otherwise, returns false.

Definition at line 233 of file vtkSMTrace.h.


The documentation for this class was generated from the following file: