casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Slots | Public Member Functions | Static Public Attributes | Private Slots | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
casa::QtRegionShapeManager Class Reference

Region Shape Manager. More...

#include <QtRegionShapeManager.qo.h>

Inheritance diagram for casa::QtRegionShapeManager:

Public Slots

void addShape (RegionShape *shape)
 Adds the given shape to the manager. More...
 
void addShapes (const std::vector< RegionShape * > &shapes)
 Adds the given shapes to the manager. More...
 
void removeShape (RegionShape *shape, bool deleteShape=true)
 Removes and (optionally) deletes the given shape from the manager. More...
 
void deleteAll ()
 Delete all loaded region shapes. More...
 
void enable ()
 Enables the manager. More...
 

Public Member Functions

 QtRegionShapeManager (QtDisplayPanel *panel)
 Constructor which takes the parent panel. More...
 
 ~QtRegionShapeManager ()
 Destructor. More...
 
QtDisplayPanelpanel () const
 Returns the parent panel. More...
 
void saveState (QDomDocument &document)
 Appends an XML state representation of loaded shapes to the given document. More...
 
void restoreState (QDomDocument &document)
 Restores loaded shapes from the given document. More...
 
unsigned int numShapes (bool includeComposites=true) const
 Returns the number of shapes in the manager. More...
 
std::vector< RegionShape * > shapes (bool includeComposites=true) const
 Returns the shapes in the manager. More...
 
QtSingleRegionShapeshapeWidget (RegionShape *shape) const
 Returns the QtSingleRegionShape wrapper for the given shape, or NULL for invalid. More...
 
void showSimpleError (const casacore::String &message, bool warn=true) const
 Shows the given error message (should be short). More...
 
void showDetailedError (const casacore::String &message, const casacore::String &details, bool warn=true) const
 Shows the given detailed error message. More...
 

Static Public Attributes

static const casacore::String DRAWERRORMSG
 Constant message used when a error was reported during a shape drawing. More...
 

Private Slots

void showHideAll (bool checked)
 Show or hide all loaded region shapes. More...
 
void load ()
 Load region shapes from a file. More...
 
void save ()
 Saves loaded region shapes from a file. More...
 
void newShape ()
 Create a new shape. More...
 
void dismiss ()
 Dismiss/close window. More...
 

Private Member Functions

void addShape (RegionShape *shape, RegionShape *compositeParent)
 Adds the given shape with the given composite parent (or NULL if the shape is not a composite child) to the manager. More...
 
void addShapes (const std::vector< RegionShape * > &shapes, const std::vector< RegionShape * > &compositeParents)
 Adds the given shapes with the given composite parents (or NULL if the shapes do not not parents) to the manager. More...
 

Private Attributes

QtDisplayPanelm_panel
 
vector< QtSingleRegionShape * > m_shapes
 
casacore::String m_lastDirectory
 
casacore::String m_lastFile
 
casacore::String m_lastFormat
 

Static Private Attributes

static const QString HIDDEN
 XML attributes. More...
 
static const QString LAST_DIRECTORY
 
static const QString LAST_FILE
 
static const QString LAST_FORMAT
 
static const QString WINDOW_VISIBLE
 

Detailed Description

Region Shape Manager.

Main interaction between region shapes and user. Provides functionality to:

Definition at line 56 of file QtRegionShapeManager.qo.h.

Constructor & Destructor Documentation

casa::QtRegionShapeManager::QtRegionShapeManager ( QtDisplayPanel panel)

Constructor which takes the parent panel.

casa::QtRegionShapeManager::~QtRegionShapeManager ( )

Destructor.

Member Function Documentation

void casa::QtRegionShapeManager::addShape ( RegionShape shape)
slot

Adds the given shape to the manager.

Should only be used for individual shapes, since the display panel will refresh after every call which can get very slow with many shapes. For multiple shapes, use addShapes(). The given shape becomes owned by the manager which is responsible for its deletion.

void casa::QtRegionShapeManager::addShape ( RegionShape shape,
RegionShape compositeParent 
)
private

Adds the given shape with the given composite parent (or NULL if the shape is not a composite child) to the manager.

void casa::QtRegionShapeManager::addShapes ( const std::vector< RegionShape * > &  shapes)
slot

Adds the given shapes to the manager.

Holds the drawing until all shapes have been added. The given shapes become owned by the manager which is responsible for their deletion.

void casa::QtRegionShapeManager::addShapes ( const std::vector< RegionShape * > &  shapes,
const std::vector< RegionShape * > &  compositeParents 
)
private

Adds the given shapes with the given composite parents (or NULL if the shapes do not not parents) to the manager.

void casa::QtRegionShapeManager::deleteAll ( )
slot

Delete all loaded region shapes.

void casa::QtRegionShapeManager::dismiss ( )
privateslot

Dismiss/close window.

void casa::QtRegionShapeManager::enable ( )
inlineslot

Enables the manager.

Definition at line 121 of file QtRegionShapeManager.qo.h.

void casa::QtRegionShapeManager::load ( )
privateslot

Load region shapes from a file.

void casa::QtRegionShapeManager::newShape ( )
privateslot

Create a new shape.

unsigned int casa::QtRegionShapeManager::numShapes ( bool  includeComposites = true) const

Returns the number of shapes in the manager.

If includeComposites is false, composites are not counted towards the return total. Composite children are not included.

QtDisplayPanel* casa::QtRegionShapeManager::panel ( ) const

Returns the parent panel.

void casa::QtRegionShapeManager::removeShape ( RegionShape shape,
bool  deleteShape = true 
)
slot

Removes and (optionally) deletes the given shape from the manager.

void casa::QtRegionShapeManager::restoreState ( QDomDocument &  document)

Restores loaded shapes from the given document.

void casa::QtRegionShapeManager::save ( )
privateslot

Saves loaded region shapes from a file.

void casa::QtRegionShapeManager::saveState ( QDomDocument &  document)

Appends an XML state representation of loaded shapes to the given document.

std::vector<RegionShape*> casa::QtRegionShapeManager::shapes ( bool  includeComposites = true) const

Returns the shapes in the manager.

If include composites is false, composites are not included. Composite children are not included.

QtSingleRegionShape* casa::QtRegionShapeManager::shapeWidget ( RegionShape shape) const

Returns the QtSingleRegionShape wrapper for the given shape, or NULL for invalid.

void casa::QtRegionShapeManager::showDetailedError ( const casacore::String message,
const casacore::String details,
bool  warn = true 
) const

Shows the given detailed error message.

"message" should contain a short overview while "details" should contain longer information.

void casa::QtRegionShapeManager::showHideAll ( bool  checked)
privateslot

Show or hide all loaded region shapes.

void casa::QtRegionShapeManager::showSimpleError ( const casacore::String message,
bool  warn = true 
) const

Shows the given error message (should be short).

Member Data Documentation

const casacore::String casa::QtRegionShapeManager::DRAWERRORMSG
static

Constant message used when a error was reported during a shape drawing.

Definition at line 61 of file QtRegionShapeManager.qo.h.

const QString casa::QtRegionShapeManager::HIDDEN
staticprivate

XML attributes.

Definition at line 144 of file QtRegionShapeManager.qo.h.

const QString casa::QtRegionShapeManager::LAST_DIRECTORY
staticprivate

Definition at line 145 of file QtRegionShapeManager.qo.h.

const QString casa::QtRegionShapeManager::LAST_FILE
staticprivate

Definition at line 146 of file QtRegionShapeManager.qo.h.

const QString casa::QtRegionShapeManager::LAST_FORMAT
staticprivate

Definition at line 147 of file QtRegionShapeManager.qo.h.

casacore::String casa::QtRegionShapeManager::m_lastDirectory
private

Definition at line 128 of file QtRegionShapeManager.qo.h.

casacore::String casa::QtRegionShapeManager::m_lastFile
private

Definition at line 128 of file QtRegionShapeManager.qo.h.

casacore::String casa::QtRegionShapeManager::m_lastFormat
private

Definition at line 128 of file QtRegionShapeManager.qo.h.

QtDisplayPanel* casa::QtRegionShapeManager::m_panel
private

Definition at line 126 of file QtRegionShapeManager.qo.h.

vector<QtSingleRegionShape*> casa::QtRegionShapeManager::m_shapes
private

Definition at line 127 of file QtRegionShapeManager.qo.h.

const QString casa::QtRegionShapeManager::WINDOW_VISIBLE
staticprivate

Definition at line 148 of file QtRegionShapeManager.qo.h.


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