casa
$Rev:20696$
|
Subclass of RegionShape used for drawing composite regions. More...
#include <RegionShapes.h>
Public Member Functions | |
RSComposite (MDirection::Types worldSys, bool dependent=true, String customName="") | |
Non-Static Members //. | |
RSComposite (bool dependent=true, String customName="") | |
Pixel constructor. | |
RSComposite (const RecordInterface &properties) | |
Record Constructor. | |
~RSComposite () | |
Destructor. | |
void | addShape (RegionShape *shape) |
Adds the given shape(s) to this composite. | |
void | addShapes (const vector< RegionShape * > shapes) |
bool | childrenAreDependent () const |
Returns true if the children are dependent, false otherwise. | |
void | setChildrenAreDependent (bool dependent=true) |
Sets whether children are dependent or not. | |
vector< RegionShape * > | children () |
Returns the composite's children. | |
vector< const RegionShape * > | children () const |
void | setLineColor (const String &newColor, bool alsoSetLabel=true) |
Overrides RegionShape methods in the case of dependent children. | |
void | setLineWidth (double width) |
void | setLineStyle (LineStyle style) |
void | setLabel (const RegionShapeLabel &label) |
bool | drawAndUpdateBoundingBox (WorldCanvasHolder &wch, String *err=NULL) |
Implements RegionShape::drawAndUpdateBoundingBox. | |
String | type () const |
Implements RegionShape::type. | |
String | oneWordType () const |
Overrides RegionShape::oneWordType. | |
double | getAngle (String toSystem="") const |
Returns 0 degrees pixel/screen in the given coordinate system (own system if toSystem is empty, otherwise see the constraints listed in RegionShape::coordParameterValues(String). | |
void | getCompositeCoordinates (double ¢erX, double ¢erY, String toSystem="") const |
Gets composite-specific coordinates, to avoid dependence on coordParameterValues() when the shape type is known. | |
vector< double > | coordParameterValues () const |
Implements RegionShape::coordParameterValues. | |
vector< double > | coordParameterValues (String toSystem) const |
Implements RegionShape::coordParameterValues. | |
vector< String > | coordParameterNames () const |
Implements RegionShape::coordParameterNames. | |
vector< CoordinateParameterType > | coordParameterTypes () const |
Implements RegionShape::coordParameterPositions. | |
void | setCoordParameters (const vector< double > &vals) |
Implements RegionShape::setCoordParameters. | |
void | setCoordParameters (const vector< double > &vals, String valSystem) |
Implements RegionShape::setCoordParameters. | |
void | move (double dx, double dy, String system="") |
Implements RegionShape::move. | |
RSHandle | getHandle () const |
Implements RegionShape::getHandle. | |
vector< String > | optionNames () const |
Implements RegionShape::optionNames. | |
vector< OptionType > | optionTypes () const |
Implements RegionShape::optionTypes. | |
vector< RSOption > | optionValues () const |
Implements RegionShape::optionValues. | |
void | setOptionValues (const vector< RSOption > &options) |
Implements RegionShape::setOptions. | |
Static Public Attributes | |
static const String | PROPDEPENDENTCHILDREN |
Static Members //. | |
static const String | PROPCHILDREN |
Protected Member Functions | |
void | getShapeSpecificProperties (Record &properties) const |
to children or not. | |
void | setShapeSpecificProperties (const RecordInterface &properties) |
Implements RegionShape::setShapeSpecificProperties. | |
void | updateMinMax () |
Update m_xMin, m_xMax, m_yMin, and m_yMax. | |
Protected Attributes | |
String | m_custName |
bool | m_dependentChildren |
vector< RegionShape * > | m_shapes |
double | m_centerX |
double | m_centerY |
bool | m_syncAngleDepChildren |
double | m_syncAngle |
1) are dependent 2) have angles (rectangle, ellipse, vector, text) 3) all have synched (same) angle | |
bool | m_applyChangesToChildren |
Private Member Functions | |
bool | addShapeHelper (RegionShape *shape) |
Adds the given child but does not perform upkeep. | |
void | addShapeUpkeep () |
Does upkeep after adding shapes. | |
void | convertMinMax (double &xmin, double &xmax, double &ymin, double &ymax, unsigned int index) const |
Gets the min/max of the child at the given index, in the composite's coordinate system. |
Subclass of RegionShape used for drawing composite regions.
A composite region consists of zero or more children RegionShapes. A RSComposite can either see its children as dependent, in which the parent controls the properties for each shape, or independent in which each child's properties must be set individually. An RSComposite can have a custom name/type. NOTE: xMin, xMax, yMin, and yMax values are ONLY valid if all children shapes have the same coordinate system as the parent composite. The following properties are also available:
Definition at line 966 of file RegionShapes.h.
RSComposite::RSComposite | ( | MDirection::Types | worldSys, |
bool | dependent = true , |
||
String | customName = "" |
||
) |
Non-Static Members //.
World constructor. Initially empty composite. The dependent flag controls whether the children are dependent or independent. If customName is set, it will be returned on type(). The given world system is only used for displaying/setting the center of the composite and does not affect the coordinate systems of the children.
RSComposite::RSComposite | ( | bool | dependent = true , |
String | customName = "" |
||
) |
Pixel constructor.
Initially empty composite. The dependent flag controls whether the children are dependent or independent. If custonName is set, it will be returned on type().
RSComposite::RSComposite | ( | const RecordInterface & | properties | ) |
Record Constructor.
Destructor.
void RSComposite::addShape | ( | RegionShape * | shape | ) |
Adds the given shape(s) to this composite.
Note that in the case of depdendent children, line properties, linethrough properties, and label properties of the individual shapes are discarded in favor of those of the parent RSComposite.
bool RSComposite::addShapeHelper | ( | RegionShape * | shape | ) | [private] |
Adds the given child but does not perform upkeep.
Returns true if the shape was added, false otherwise.
void RSComposite::addShapes | ( | const vector< RegionShape * > | shapes | ) |
void RSComposite::addShapeUpkeep | ( | ) | [private] |
Does upkeep after adding shapes.
vector<RegionShape*> RSComposite::children | ( | ) |
Returns the composite's children.
vector<const RegionShape*> RSComposite::children | ( | ) | const |
bool RSComposite::childrenAreDependent | ( | ) | const |
Returns true if the children are dependent, false otherwise.
void RSComposite::convertMinMax | ( | double & | xmin, |
double & | xmax, | ||
double & | ymin, | ||
double & | ymax, | ||
unsigned int | index | ||
) | const [private] |
Gets the min/max of the child at the given index, in the composite's coordinate system.
vector<String> RSComposite::coordParameterNames | ( | ) | const |
Implements RegionShape::coordParameterNames.
vector<CoordinateParameterType> RSComposite::coordParameterTypes | ( | ) | const |
Implements RegionShape::coordParameterPositions.
vector<double> RSComposite::coordParameterValues | ( | ) | const |
Implements RegionShape::coordParameterValues.
vector<double> RSComposite::coordParameterValues | ( | String | toSystem | ) | const |
Implements RegionShape::coordParameterValues.
bool RSComposite::drawAndUpdateBoundingBox | ( | WorldCanvasHolder & | wch, |
String * | err = NULL |
||
) |
Implements RegionShape::drawAndUpdateBoundingBox.
double RSComposite::getAngle | ( | String | toSystem = "" | ) | const |
Returns 0 degrees pixel/screen in the given coordinate system (own system if toSystem is empty, otherwise see the constraints listed in RegionShape::coordParameterValues(String).
void RSComposite::getCompositeCoordinates | ( | double & | centerX, |
double & | centerY, | ||
String | toSystem = "" |
||
) | const |
Gets composite-specific coordinates, to avoid dependence on coordParameterValues() when the shape type is known.
If toSystem is empty, no conversion is done; otherwise see the constraints listed in RegionShape::coordParameterValues(String).
RSHandle RSComposite::getHandle | ( | ) | const |
Implements RegionShape::getHandle.
void RSComposite::getShapeSpecificProperties | ( | Record & | properties | ) | const [protected] |
to children or not.
Implements RegionShape::getShapeSpecificProperties.
void RSComposite::move | ( | double | dx, |
double | dy, | ||
String | system = "" |
||
) |
Implements RegionShape::move.
String RSComposite::oneWordType | ( | ) | const [inline] |
Overrides RegionShape::oneWordType.
Definition at line 1038 of file RegionShapes.h.
vector<String> RSComposite::optionNames | ( | ) | const |
Implements RegionShape::optionNames.
vector<OptionType> RSComposite::optionTypes | ( | ) | const |
Implements RegionShape::optionTypes.
vector<RSOption> RSComposite::optionValues | ( | ) | const |
Implements RegionShape::optionValues.
void RSComposite::setChildrenAreDependent | ( | bool | dependent = true | ) |
Sets whether children are dependent or not.
NOTE: This should never be called AFTER the composite has already been added to the QtRegionShapeManager. Preferably it should be done before adding any children either.
void RSComposite::setCoordParameters | ( | const vector< double > & | vals | ) |
Implements RegionShape::setCoordParameters.
void RSComposite::setCoordParameters | ( | const vector< double > & | vals, |
String | valSystem | ||
) |
Implements RegionShape::setCoordParameters.
void RSComposite::setLabel | ( | const RegionShapeLabel & | label | ) |
void RSComposite::setLineColor | ( | const String & | newColor, |
bool | alsoSetLabel = true |
||
) |
Overrides RegionShape methods in the case of dependent children.
void RSComposite::setLineStyle | ( | LineStyle | style | ) |
void RSComposite::setLineWidth | ( | double | width | ) |
void RSComposite::setOptionValues | ( | const vector< RSOption > & | options | ) |
Implements RegionShape::setOptions.
void RSComposite::setShapeSpecificProperties | ( | const RecordInterface & | properties | ) | [protected] |
Implements RegionShape::setShapeSpecificProperties.
String RSComposite::type | ( | ) | const |
Implements RegionShape::type.
void RSComposite::updateMinMax | ( | ) | [protected] |
Update m_xMin, m_xMax, m_yMin, and m_yMax.
bool RSComposite::m_applyChangesToChildren [protected] |
Definition at line 1099 of file RegionShapes.h.
double RSComposite::m_centerX [protected] |
Definition at line 1092 of file RegionShapes.h.
double RSComposite::m_centerY [protected] |
Definition at line 1092 of file RegionShapes.h.
String RSComposite::m_custName [protected] |
Definition at line 1089 of file RegionShapes.h.
bool RSComposite::m_dependentChildren [protected] |
Definition at line 1090 of file RegionShapes.h.
vector<RegionShape*> RSComposite::m_shapes [protected] |
Definition at line 1091 of file RegionShapes.h.
double RSComposite::m_syncAngle [protected] |
1) are dependent 2) have angles (rectangle, ellipse, vector, text) 3) all have synched (same) angle
Definition at line 1098 of file RegionShapes.h.
bool RSComposite::m_syncAngleDepChildren [protected] |
Definition at line 1093 of file RegionShapes.h.
const String RSComposite::PROPCHILDREN [static] |
Definition at line 973 of file RegionShapes.h.
const String RSComposite::PROPDEPENDENTCHILDREN [static] |
Static Members //.
Properties. (See class descriptions of RegionShape and RSComposite.)
Definition at line 972 of file RegionShapes.h.