ParaView
Public Types | Public Member Functions | Protected Member Functions
pqDisplayPolicy Class Reference

Display policy defines the application specific policy for creating display proxies. More...

#include <pqDisplayPolicy.h>

List of all members.

Public Types

enum  VisibilityState { Visible, Hidden, NotApplicable }

Public Member Functions

 pqDisplayPolicy (QObject *p)
virtual ~pqDisplayPolicy ()
virtual pqDataRepresentationcreatePreferredRepresentation (pqOutputPort *port, pqView *view, bool dont_create_view) const
 Returns a new display for the given (source,view) pair, or NULL on failure.
virtual pqDataRepresentationsetRepresentationVisibility (pqOutputPort *opPort, pqView *view, bool visible) const
 Set the visibility of the source in the given view.
virtual QString getPreferredViewType (pqOutputPort *opPort, bool update_pipeline) const
 Returns the type for the view that is indicated as the preferred view for the given output port.
virtual bool getHideByDefault () const
 Apps can choose whether new filter outputs are hidden upon creation by overriding this method.
virtual VisibilityState getVisibility (pqView *view, pqOutputPort *port) const
 Returns the visibility state for port in the given view (view may be null for an empty view).

Protected Member Functions

virtual pqViewgetPreferredView (pqOutputPort *opPort, pqView *view) const
 Determines the type of view that's preferred by the source.
virtual pqDataRepresentationnewRepresentation (pqOutputPort *port, pqView *view) const
 Create a new representation. port and view cannot be null at this point.

Detailed Description

Display policy defines the application specific policy for creating display proxies.

Given a pair of a proxy to be displayed and a view proxy in which to display, this class must tell the type of display to create, if any. Custom applications can subclass this to define their own policy. The pqApplicationCore maintains an instance of the policy used by the application. Custom applications should set their own policy instance on the global application core instance.

Definition at line 52 of file pqDisplayPolicy.h.


Member Enumeration Documentation

Enumerator:
Visible 
Hidden 
NotApplicable 

Definition at line 113 of file pqDisplayPolicy.h.


Constructor & Destructor Documentation

pqDisplayPolicy::pqDisplayPolicy ( QObject *  p)
virtual pqDisplayPolicy::~pqDisplayPolicy ( ) [virtual]

Member Function Documentation

virtual pqDataRepresentation* pqDisplayPolicy::createPreferredRepresentation ( pqOutputPort port,
pqView view,
bool  dont_create_view 
) const [virtual]

Returns a new display for the given (source,view) pair, or NULL on failure.

If the view is not a preferred view to display the source this method will attempt to create a new view of the preferred type and create a display for that view. In other words, the argument view is merely a suggestion, it's not necessary that the new display will be added to the same view. In the current implementation the rules as as under:

  • If dont_create_view is true and view is non-null, then a display is created for the given view and returned. If view is null, then NULL is returned, since we can't create a new view.
  • If dont_create_view is false and view is non-null:
    • If view is of preferred type, we added display to view itself.
    • If view is not of preferred type, we create a a new view of the preferred type.
  • If dont_create_view is false and view is null, then a new view of the preferred type is created and the display added to that view.

or not of the type preferred by the source, it may create a new view and add the displayto new view. dont_create_view can be used to override this behavior.

virtual pqDataRepresentation* pqDisplayPolicy::setRepresentationVisibility ( pqOutputPort opPort,
pqView view,
bool  visible 
) const [virtual]

Set the visibility of the source in the given view.

Current implementation creates a new display for the source, if possible, if none exists. If view is NULL, then a new view of "suitable" type will be created for the source. Since custom applications may not necessarily create new views, we provide this as part of display policy which can be easily overridden by creating a new subclass.

virtual QString pqDisplayPolicy::getPreferredViewType ( pqOutputPort opPort,
bool  update_pipeline 
) const [virtual]

Returns the type for the view that is indicated as the preferred view for the given output port.

May return a null string if the no view type can be determined as the preferred view. If update_pipeline is set, then the pipeline will be update prior to fetching the data information from the port.

virtual bool pqDisplayPolicy::getHideByDefault ( ) const [inline, virtual]

Apps can choose whether new filter outputs are hidden upon creation by overriding this method.

The default behavior is to create a representation such that it obeys to the Visibility from rendering.xml.

Definition at line 109 of file pqDisplayPolicy.h.

virtual VisibilityState pqDisplayPolicy::getVisibility ( pqView view,
pqOutputPort port 
) const [virtual]

Returns the visibility state for port in the given view (view may be null for an empty view).

virtual pqView* pqDisplayPolicy::getPreferredView ( pqOutputPort opPort,
pqView view 
) const [protected, virtual]

Determines the type of view that's preferred by the source.

If view is of the preferred type, returns it. Otherwise a new view of the preferred type may be created and returned. A new 3D view will be created if the view has no preferred view type and the active view cannot show the data.

virtual pqDataRepresentation* pqDisplayPolicy::newRepresentation ( pqOutputPort port,
pqView view 
) const [protected, virtual]

Create a new representation. port and view cannot be null at this point.


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