casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Slots | Public Member Functions | Static Public Attributes | Private Slots | Private Member Functions | Private Attributes | Static Private Attributes
casa::QtRegionShapeManager Class Reference

Region Shape Manager. More...

#include <QtRegionShapeManager.qo.h>

List of all members.

Public Slots

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

Public Member Functions

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

Static Public Attributes

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

Private Slots

void showHideAll (bool checked)
 
     

void load ()
 Load region shapes from a file.
void save ()
 Saves loaded region shapes from a file.
void newShape ()
 Create a new shape.
void dismiss ()
 Dismiss/close window.

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.
void addShapes (const vector< RegionShape * > &shapes, const vector< RegionShape * > &compositeParents)
 Adds the given shapes with the given composite parents (or NULL if the shapes do not not parents) to the manager.

Private Attributes

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

Static Private Attributes

static const QString HIDDEN
 XML attributes.
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

Constructor which takes the parent panel.

Destructor.


Member Function Documentation

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 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 vector< RegionShape * > &  shapes,
const 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.

Delete all loaded region shapes.

void casa::QtRegionShapeManager::dismiss ( ) [private, slot]

Dismiss/close window.

void casa::QtRegionShapeManager::enable ( ) [inline, slot]

Enables the manager.

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

void casa::QtRegionShapeManager::load ( ) [private, slot]

Load region shapes from a file.

void casa::QtRegionShapeManager::newShape ( ) [private, slot]

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.

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 ( ) [private, slot]

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.

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.

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

void casa::QtRegionShapeManager::showDetailedError ( const String message,
const 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) [private, slot]

     

Show or hide all loaded region shapes.

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

Shows the given error message (should be short).


Member Data Documentation

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 [static, private]

XML attributes.

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

const QString casa::QtRegionShapeManager::LAST_DIRECTORY [static, private]

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

const QString casa::QtRegionShapeManager::LAST_FILE [static, private]

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

const QString casa::QtRegionShapeManager::LAST_FORMAT [static, private]

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

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

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

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

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

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

const QString casa::QtRegionShapeManager::WINDOW_VISIBLE [static, private]

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


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