ParaView
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)
 
virtual void SetPropertiesToTraceOnCreate (int)
 
virtual int GetPropertiesToTraceOnCreate ()
 
vtkStdString 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...
 
- Public Member Functions inherited from vtkSMObject
void PrintSelf (ostream &os, vtkIndent indent)
 

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 ()
 Methods to start/stop tracing. More...
 
static vtkStdString StopTrace ()
 Stop trace and return the generated trace script. More...
 
static vtkStdString GetState (int propertiesToTraceOnCreate, bool skipHiddenRepresentations)
 Save 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)
 
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...
 
class TraceItem
 Returns true of there's an error. More...
 
 vtkSMTrace ()
 Returns true of there's an error. More...
 
virtual ~vtkSMTrace ()
 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 ()
 

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 70 of file vtkSMTrace.h.

Member Typedef Documentation

◆ Superclass

Definition at line 74 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 127 of file vtkSMTrace.h.

Constructor & Destructor Documentation

◆ vtkSMTrace()

vtkSMTrace::vtkSMTrace ( )
protected

Returns true of there's an error.

Otherwise, returns false.

◆ ~vtkSMTrace()

virtual vtkSMTrace::~vtkSMTrace ( )
protectedvirtual

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 
)

◆ 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 81 of file vtkSMTrace.h.

◆ StartTrace()

static vtkSMTrace* vtkSMTrace::StartTrace ( )
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.

◆ StopTrace()

static vtkStdString 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.

◆ SetPropertiesToTraceOnCreate()

virtual void vtkSMTrace::SetPropertiesToTraceOnCreate ( int  )
virtual

◆ GetPropertiesToTraceOnCreate()

virtual int vtkSMTrace::GetPropertiesToTraceOnCreate ( )
virtual

◆ GetCurrentTrace()

vtkStdString vtkSMTrace::GetCurrentTrace ( )

Return the current trace.

◆ GetState()

static vtkStdString vtkSMTrace::GetState ( int  propertiesToTraceOnCreate,
bool  skipHiddenRepresentations 
)
static

Save a Python state for the application and return it.

Note this cannot be called when tracing is active.

◆ 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 223 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 210 of file vtkSMTrace.h.

◆ LogTraceToStdout

bool vtkSMTrace::LogTraceToStdout
protected

Returns true of there's an error.

Otherwise, returns false.

Definition at line 211 of file vtkSMTrace.h.

◆ PropertiesToTraceOnCreate

int vtkSMTrace::PropertiesToTraceOnCreate
protected

Returns true of there's an error.

Otherwise, returns false.

Definition at line 212 of file vtkSMTrace.h.

◆ FullyTraceSupplementalProxies

bool vtkSMTrace::FullyTraceSupplementalProxies
protected

Returns true of there's an error.

Otherwise, returns false.

Definition at line 213 of file vtkSMTrace.h.


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