theory

sans.perspectives.theory.theory

class sans.perspectives.theory.theory.PlotInfo
store some plotting field
class sans.perspectives.theory.theory.Plugin(standalone=True)

This class defines the interface for a Plugin class for calculator perspective

draw_model(model, data=None, smearer=None, enable1D=True, enable2D=False, qmin=0.001, qmax=0.13, qstep=50)

Draw model.

Parameters:
  • model – the model to draw
  • name – the name of the model to draw
  • data – the data on which the model is based to be drawn
  • description – model’s description
  • enable1D – if true enable drawing model 1D
  • enable2D – if true enable drawing model 2D
  • qmin – Range’s minimum value to draw model
  • qmax – Range’s maximum value to draw model
  • qstep – number of step to divide the x and y-axis
get_context_menu(graph=None)

This method is optional.

When the context menu of a plot is rendered, the get_context_menu method will be called to give you a chance to add a menu item to the context menu.

A ref to a Graph object is passed so that you can investigate the plot content and decide whether you need to add items to the context menu.

This method returns a list of menu items. Each item is itself a list defining the text to appear in the menu, a tool-tip help text, and a call-back method.

Parameters:
  • graph – the Graph object to which we attach the context menu
Returns:

a list of menu items with call-back function

get_panels(parent)

Create and return the list of wx.Panels for your plug-in. Define the plug-in perspective.

Panels should inherit from DefaultPanel defined below, or should present the same interface. They must define “window_caption” and “window_name”.

Parameters:
  • parent – parent window
Returns:

list of panels

get_perspective()
Get the list of panel names for this perspective
on_perspective(event)

Call back function for the perspective menu item. We notify the parent window that the perspective has changed.

Parameters:
  • event – menu event
populate_menu(id, owner)

Create and return the list of application menu items for the plug-in.

Parameters:
  • id – deprecated. Un-used.
  • parent – parent window
Returns:

plug-in menu

post_init()
Post initialization call back to close the loose ends

Table Of Contents

Previous topic

pagestate

This Page