casa
$Rev:20696$
|
Region Shape Manager. More...
#include <QtRegionShapeManager.qo.h>
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. | |
QtDisplayPanel * | panel () 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. | |
QtSingleRegionShape * | shapeWidget (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 | |
QtDisplayPanel * | m_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 |
Region Shape Manager.
Main interaction between region shapes and user. Provides functionality to:
Definition at line 56 of file QtRegionShapeManager.qo.h.
Constructor which takes the parent panel.
Destructor.
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 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.
void casa::QtRegionShapeManager::deleteAll | ( | ) | [slot] |
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.
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 | ( | ) | [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.
QtSingleRegionShape* casa::QtRegionShapeManager::shapeWidget | ( | RegionShape * | shape | ) | const |
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).
const 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 [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.
String casa::QtRegionShapeManager::m_lastFile [private] |
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.
vector<QtSingleRegionShape*> casa::QtRegionShapeManager::m_shapes [private] |
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.