00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef REGIONSHAPES_H_
00028 #define REGIONSHAPES_H_
00029
00030 #include <display/RegionShapes/RegionShape.h>
00031
00032 #include <cctype>
00033
00034 #include <casa/namespace.h>
00035
00036 namespace casa {
00037
00038
00039
00040
00041
00042
00043 class RSEllipse : public RegionShape {
00044 public:
00045
00046
00047
00048
00049 RSEllipse(double x, double y, double xRadius, double yRadius,
00050 MDirection::Types worldSystem, double angle = 0);
00051
00052
00053 RSEllipse(double x, double y, double xRadius, double yRadius,
00054 double angle = 0);
00055
00056
00057 RSEllipse(const RecordInterface& properties);
00058
00059
00060 virtual ~RSEllipse();
00061
00062
00063 virtual bool drawAndUpdateBoundingBox(WorldCanvasHolder& wch,
00064 String* error = NULL);
00065
00066
00067 virtual String type() const { return "ellipse"; }
00068
00069
00070
00071
00072
00073 void getEllipseCoordinates(double& x, double& y, double& xRadius,
00074 double& yRadius, double& angle,
00075 String toSystem = "") const;
00076
00077
00078 virtual vector<double> coordParameterValues() const;
00079
00080
00081 virtual vector<double> coordParameterValues(String toSystem) const;
00082
00083
00084 virtual vector<String> coordParameterNames() const;
00085
00086
00087 virtual vector<CoordinateParameterType> coordParameterTypes() const;
00088
00089
00090 virtual void setCoordParameters(const vector<double>& vals);
00091
00092
00093 virtual void setCoordParameters(const vector<double>& vals, String system);
00094
00095
00096 virtual void move(double dx, double dy, String system = "");
00097
00098
00099 virtual RSHandle getHandle() const;
00100
00101
00102
00103
00104 virtual vector<String> optionNames() const { return vector<String>(); }
00105 virtual vector<OptionType> optionTypes() const {
00106 return vector<OptionType>(); }
00107 virtual vector<RSOption> optionValues() const { return vector<RSOption>();}
00108 virtual void setOptionValues(const vector<RSOption>& options) { }
00109
00110
00111 protected:
00112 vector<double> m_spec;
00113
00114 vector<double> m_screenSpec;
00115
00116
00117
00118 virtual void getShapeSpecificProperties(Record& properties) const {
00119 properties.define(PROPTYPE, PROPTYPE_ELLIPSE);
00120 }
00121
00122
00123 virtual void setShapeSpecificProperties(const RecordInterface& props) { }
00124
00125
00126 virtual bool updateScreenCoordinates(WorldCanvasHolder& wch, String* err);
00127
00128
00129 virtual void updateMinMax();
00130 };
00131
00132
00133
00134
00135 class RSCircle : public RSEllipse {
00136 public:
00137
00138
00139 RSCircle(double x, double y, double xRadius, MDirection::Types worldSys);
00140
00141
00142 RSCircle(double x, double y, double xRadius);
00143
00144
00145 RSCircle(const RecordInterface& properties);
00146
00147
00148 ~RSCircle();
00149
00150
00151 String type() const { return "circle"; }
00152
00153
00154
00155
00156
00157 void getCircleCoordinates(double& x, double& y, double& xRadius,
00158 String toSystem = "") const;
00159
00160
00161 vector<double> coordParameterValues() const;
00162
00163
00164 vector<double> coordParameterValues(String toSystem) const;
00165
00166
00167 vector<String> coordParameterNames() const;
00168
00169
00170 vector<CoordinateParameterType> coordParameterTypes() const;
00171
00172
00173 void setCoordParameters(const vector<double>& vals);
00174
00175
00176 void setCoordParameters(const vector<double>& vals, String valSystem);
00177
00178 protected:
00179
00180 void getShapeSpecificProperties(Record& properties) const {
00181 properties.define(PROPTYPE, PROPTYPE_CIRCLE);
00182 }
00183
00184
00185 bool updateScreenCoordinates(WorldCanvasHolder& wch, String* err);
00186 };
00187
00188
00189
00190
00191
00192
00193 class RSRectangle : public RegionShape {
00194 public:
00195
00196
00197
00198
00199
00200
00201
00202 static bool getRectanglePoints(double centerX, double centerY,
00203 double radiusX, double radiusY,
00204 double angle, Vector<double>& xPoints,
00205 Vector<double>& yPoints);
00206
00207
00208
00209
00210
00211
00212
00213
00214 RSRectangle(double x, double y, double width, double height,
00215 MDirection::Types worldSystem, double angle = 0);
00216
00217
00218 RSRectangle(double x, double y, double width, double height,
00219 double angle = 0);
00220
00221
00222 RSRectangle(const RecordInterface& properties);
00223
00224
00225 ~RSRectangle();
00226
00227
00228 bool drawAndUpdateBoundingBox(WorldCanvasHolder& wch, String* err = NULL);
00229
00230
00231 String type() const { return "rectangle"; }
00232
00233
00234
00235
00236
00237 void getRectangleCoordinates(double& x, double& y, double& width,
00238 double& height, double& angle,
00239 String toSystem = "") const;
00240
00241
00242 vector<double> coordParameterValues() const;
00243
00244
00245 vector<double> coordParameterValues(String toSystem) const;
00246
00247
00248 vector<String> coordParameterNames() const;
00249
00250
00251 vector<CoordinateParameterType> coordParameterTypes() const;
00252
00253
00254 void setCoordParameters(const vector<double>& vals);
00255
00256
00257 void setCoordParameters(const vector<double>& vals, String valSystem);
00258
00259
00260 void move(double dx, double dy, String system = "");
00261
00262
00263 RSHandle getHandle() const;
00264
00265
00266
00267
00268 vector<String> optionNames() const { return vector<String>(); }
00269 vector<OptionType> optionTypes() const { return vector<OptionType>(); }
00270 vector<RSOption> optionValues() const { return vector<RSOption>();}
00271 void setOptionValues(const vector<RSOption>& options) { }
00272
00273
00274 protected:
00275 vector<double> m_spec;
00276
00277 Vector<double> m_x, m_y;
00278
00279 Vector<double> m_screenX, m_screenY;
00280
00281
00282
00283 void getShapeSpecificProperties(Record& properties) const {
00284 properties.define(PROPTYPE, PROPTYPE_RECTANGLE);
00285 }
00286
00287
00288 void setShapeSpecificProperties(const RecordInterface& properties) { }
00289
00290
00291 bool updateScreenCoordinates(WorldCanvasHolder& wch, String* err);
00292
00293
00294 void updatePoints();
00295
00296
00297 void updateMinMax();
00298 };
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312 class RSPolygon : public RegionShape {
00313 public:
00314
00315
00316
00317
00318 static const String PROPXCOORDINATES;
00319 static const String PROPYCOORDINATES;
00320
00321
00322
00323
00324
00325
00326
00327
00328 RSPolygon(const Vector<double>& x, const Vector<double>& y,
00329 MDirection::Types worldSystem, String custName = "");
00330
00331
00332 RSPolygon(const Vector<double>& x, const Vector<double>& y,
00333 String custName = "");
00334
00335
00336 RSPolygon(const RecordInterface& properties);
00337
00338
00339 ~RSPolygon();
00340
00341
00342 void setPolygonCoordinates(const Vector<double>& x,
00343 const Vector<double>& y);
00344
00345
00346 bool drawAndUpdateBoundingBox(WorldCanvasHolder& wch, String* err = NULL);
00347
00348
00349 String type() const {
00350 if(!m_custName.empty()) return m_custName;
00351 else return "polygon";
00352 }
00353
00354
00355 String oneWordType() const { return "polygon"; }
00356
00357
00358
00359
00360
00361 void getPolygonCoordinates(double& centerX, double& centerY,
00362 String toSystem = "") const;
00363
00364
00365
00366
00367 void getPolygonCoordinates(vector<double>& x, vector<double>& y,
00368 String toSystem = "") const;
00369
00370
00371 vector<double> coordParameterValues() const;
00372
00373
00374 vector<double> coordParameterValues(String toSystem) const;
00375
00376
00377 vector<String> coordParameterNames() const;
00378
00379
00380 vector<CoordinateParameterType> coordParameterTypes() const;
00381
00382
00383 void setCoordParameters(const vector<double>& vals);
00384
00385
00386 void setCoordParameters(const vector<double>& vals, String valSystem);
00387
00388
00389 void move(double dx, double dy, String system = "");
00390
00391
00392 RSHandle getHandle() const;
00393
00394
00395 vector<String> optionNames() const;
00396
00397
00398 vector<OptionType> optionTypes() const;
00399
00400
00401 vector<RSOption> optionValues() const;
00402
00403
00404 void setOptionValues(const vector<RSOption>& options);
00405
00406 protected:
00407 Vector<Double> m_x, m_y;
00408 double m_centerX, m_centerY;
00409 Vector<Double> m_screenX, m_screenY;
00410 unsigned int m_n;
00411 String m_custName;
00412
00413
00414 void getShapeSpecificProperties(Record& properties) const;
00415
00416
00417 void setShapeSpecificProperties(const RecordInterface& properties);
00418
00419
00420 bool updateScreenCoordinates(WorldCanvasHolder& wch, String* err);
00421
00422
00423 void updateMinMax();
00424 };
00425
00426
00427
00428
00429
00430
00431
00432 class RSLine : public RegionShape {
00433 public:
00434
00435
00436
00437 enum ArrowType {
00438 FilledTriangle, Triangle, V, FilledDoubleV
00439 };
00440
00441
00442
00443 static vector<ArrowType> allArrowTypes() {
00444 static vector<ArrowType> v(4);
00445 v[0] = FilledTriangle; v[1] = Triangle;
00446 v[2] = V; v[3] = FilledDoubleV;
00447 return v;
00448 }
00449
00450 static vector<String> allArrowTypesStrings() {
00451 vector<ArrowType> types = allArrowTypes();
00452 vector<String> v(types.size());
00453 for(unsigned int i = 0; i < v.size(); i++) v[i] = arrowType(types[i]);
00454 return v;
00455 }
00456
00457
00458
00459
00460 static String arrowType(ArrowType type) {
00461 switch(type) {
00462 case FilledTriangle: return "filled triangle";
00463 case Triangle: return "triangle";
00464 case V: return "v";
00465 case FilledDoubleV: return "filled double v";
00466
00467 default: return "";
00468 }
00469 }
00470
00471 static ArrowType arrowType(const String& type) {
00472 String t = type;
00473 for(unsigned int i = 0; i < t.size(); i++) t[i] = tolower(t[i]);
00474 if(t == "filled triangle") return FilledTriangle;
00475 else if(t == "triangle") return Triangle;
00476 else if(t == "v") return V;
00477 else if(t == "filled double v") return FilledDoubleV;
00478
00479 else return FilledTriangle;
00480 }
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490 RSLine(double x1, double y1, double x2, double y2,
00491 MDirection::Types worldSystem, int arrowLength, bool arrow1 = false,
00492 bool arrow2 = false, ArrowType type1 = FilledDoubleV,
00493 ArrowType type2 = FilledDoubleV);
00494
00495
00496
00497 RSLine(double x1, double y1, double x2, double y2, int arrowLength,
00498 bool arrow1 = false, bool arrow2 = false,
00499 ArrowType type1 = FilledDoubleV, ArrowType type2 = FilledDoubleV);
00500
00501
00502 RSLine(const RecordInterface& properties);
00503
00504
00505 virtual ~RSLine();
00506
00507
00508
00509 bool p1Arrow() const { return m_arrow1; }
00510 bool p2Arrow() const { return m_arrow2; }
00511
00512
00513
00514 virtual bool drawAndUpdateBoundingBox(WorldCanvasHolder& wch,
00515 String* error = NULL);
00516
00517
00518 virtual String type() const { return "line"; }
00519
00520
00521
00522
00523
00524 void getLineCoordinates(double& x1, double& y1, double& x2, double& y2,
00525 int& arrowLength, String toSystem = "") const;
00526
00527
00528 virtual vector<double> coordParameterValues() const;
00529
00530
00531 vector<double> coordParameterValues(String toSystem) const;
00532
00533
00534 virtual vector<String> coordParameterNames() const;
00535
00536
00537 virtual vector<CoordinateParameterType> coordParameterTypes() const;
00538
00539
00540 virtual void setCoordParameters(const vector<double>& vals);
00541
00542
00543 virtual void setCoordParameters(const vector<double>& vals, String System);
00544
00545
00546 virtual void move(double dx, double dy, String system = "");
00547
00548
00549 virtual RSHandle getHandle() const;
00550
00551
00552 virtual vector<String> optionNames() const;
00553
00554
00555 virtual vector<OptionType> optionTypes() const;
00556
00557
00558 virtual vector<vector<String> > optionChoices() const;
00559
00560
00561 virtual vector<RSOption> optionValues() const;
00562
00563
00564 virtual void setOptionValues(const vector<RSOption>& options);
00565
00566 protected:
00567 vector<double> m_spec;
00568 vector<double> m_screenSpec;
00569 int m_arrowLength;
00570 bool m_arrow1, m_arrow2;
00571 ArrowType m_aType1, m_aType2;
00572
00573
00574 virtual void getShapeSpecificProperties(Record& properties) const {
00575 properties.define(PROPTYPE, PROPTYPE_LINE);
00576 }
00577
00578
00579 virtual void setShapeSpecificProperties(const RecordInterface& props) { }
00580
00581
00582 virtual bool updateScreenCoordinates(WorldCanvasHolder& wch, String* err);
00583
00584
00585 void updateMinMax();
00586
00587
00588
00589 static bool arrowPoints(double x1, double y1, double x2, double y2,
00590 double length, double& resX1, double& resY1,
00591 double& resX2, double& resY2);
00592
00593
00594 static bool arrowPointsHelper(double x1, double y1, double x2, double y2,
00595 double length, double& resX1, double& resY1,
00596 double& resX2, double& resY2);
00597 };
00598
00599
00600
00601 class RSVector : public RSLine {
00602 public:
00603
00604
00605
00606
00607
00608 RSVector(double x, double y, double length, double angle,
00609 MDirection::Types worldSystem, int arrowLength,
00610 bool arrow = true, ArrowType arrowType = FilledDoubleV);
00611
00612
00613
00614 RSVector(double x, double y, double length, double angle, int arrowLength,
00615 bool arrow = true, ArrowType arrowType = FilledDoubleV);
00616
00617
00618 RSVector(const RecordInterface& properties);
00619
00620
00621 ~RSVector();
00622
00623
00624 bool arrow() const { return p2Arrow(); }
00625
00626
00627 String type() const { return "vector"; }
00628
00629
00630
00631
00632
00633 void getVectorCoordinates(double& x, double& y, double& angle,
00634 double& length, int& arrowLength,
00635 String toSystem = "") const;
00636
00637
00638 vector<double> coordParameterValues() const;
00639
00640
00641 vector<double> coordParameterValues(String toSystem) const;
00642
00643
00644 vector<String> coordParameterNames() const;
00645
00646
00647 vector<CoordinateParameterType> coordParameterTypes() const;
00648
00649
00650 void setCoordParameters(const vector<double>& vals);
00651
00652
00653 void setCoordParameters(const vector<double>& vals, String valSystem);
00654
00655
00656 vector<String> optionNames() const;
00657
00658
00659 vector<OptionType> optionTypes() const;
00660
00661
00662 vector<vector<String> > optionChoices() const;
00663
00664
00665 vector<RSOption> optionValues() const;
00666
00667
00668 void setOptionValues(const vector<RSOption>& options);
00669
00670 protected:
00671 double m_length;
00672 double m_angle;
00673
00674
00675 void getShapeSpecificProperties(Record& properties) const {
00676 properties.define(PROPTYPE, PROPTYPE_VECTOR);
00677 }
00678 };
00679
00680
00681
00682
00683
00684
00685
00686 class RSMarker : public RegionShape {
00687 public:
00688
00689
00690
00691 RSMarker(double x, double y, Display::Marker marker, int pixelHeight,
00692 MDirection::Types worldSystem);
00693
00694
00695
00696
00697 RSMarker(double x, double y, const vector<Display::Marker>& markers,
00698 int pixelHeight, MDirection::Types worldSystem);
00699
00700
00701
00702 RSMarker(double x, double y, Display::Marker marker, int pixelHeight);
00703
00704
00705
00706 RSMarker(double x, double y, const vector<Display::Marker>& markers,
00707 int pixelHeight);
00708
00709
00710 RSMarker(const RecordInterface& properties);
00711
00712
00713 ~RSMarker();
00714
00715
00716
00717 vector<Display::Marker> markers() const;
00718 void setMarker(Display::Marker marker);
00719 void setMarkers(const vector<Display::Marker>& markers);
00720
00721
00722
00723
00724 bool drawAndUpdateBoundingBox(WorldCanvasHolder& wch, String* err = NULL);
00725
00726
00727 String type() const;
00728
00729
00730 String oneWordType() const { return "marker"; }
00731
00732
00733
00734
00735
00736 void getMarkerCoordinates(double& x, double& y, int& pixelHeight,
00737 String toSystem = "") const;
00738
00739
00740 vector<double> coordParameterValues() const;
00741
00742
00743 vector<double> coordParameterValues(String toSystem) const;
00744
00745
00746 vector<String> coordParameterNames() const;
00747
00748
00749 vector<CoordinateParameterType> coordParameterTypes() const;
00750
00751
00752 void setCoordParameters(const vector<double>& vals);
00753
00754
00755 void setCoordParameters(const vector<double>& vals, String valSystem);
00756
00757
00758 void move(double dx, double dy, String system = "");
00759
00760
00761 RSHandle getHandle() const;
00762
00763
00764 vector<String> optionNames() const;
00765
00766
00767 vector<OptionType> optionTypes() const;
00768
00769
00770 vector<vector<String> > optionChoices() const;
00771
00772
00773 vector<RSOption> optionValues() const;
00774
00775
00776 void setOptionValues(const vector<RSOption>& options);
00777
00778 protected:
00779 double m_x, m_y;
00780 double m_screenX, m_screenY;
00781 vector<Display::Marker> m_markers;
00782 int m_pixelHeight;
00783
00784
00785 void getShapeSpecificProperties(Record& properties) const {
00786 properties.define(PROPTYPE, PROPTYPE_MARKER);
00787 }
00788
00789
00790 void setShapeSpecificProperties(const RecordInterface& properties) { }
00791
00792
00793 bool updateScreenCoordinates(WorldCanvasHolder& wch, String* err);
00794
00795
00796 void updateMinMax();
00797
00798
00799 static String markerToString(Display::Marker marker) {
00800 switch(marker) {
00801 case Display::Cross: return "cross";
00802 case Display::X: return "x";
00803 case Display::Diamond: return "diamond";
00804 case Display::Circle: return "circle";
00805 case Display::Square: return "square";
00806 case Display::Triangle: return "triangle";
00807 case Display::InvertedTriangle: return "inverted triangle";
00808 case Display::FilledCircle: return "filled circle";
00809 case Display::FilledSquare: return "filled square";
00810 case Display::FilledDiamond: return "filled diamond";
00811 case Display::FilledTriangle: return "filled triangle";
00812 case Display::FilledInvertedTriangle:return "filled inverted triangle";
00813 case Display::CircleAndCross: return "circle and cross";
00814 case Display::CircleAndX: return "circle and x";
00815 case Display::CircleAndDot: return "circle and dot";
00816
00817 default: return "";
00818 }
00819 }
00820
00821 static bool stringToMarker(const String& str, Display::Marker& marker) {
00822 String m = str;
00823 for(unsigned int i = 0; i < m.size(); i++) m[i] = tolower(str[i]);
00824
00825 if(m == "cross") marker = Display::Cross;
00826 else if(m == "x") marker = Display::X;
00827 else if(m == "diamond") marker = Display::Diamond;
00828 else if(m == "circle") marker = Display::Circle;
00829 else if(m == "square") marker = Display::Square;
00830 else if(m == "triangle") marker = Display::Triangle;
00831 else if(m == "inverted triangle") marker = Display::InvertedTriangle;
00832 else if(m == "filled circle") marker = Display::FilledCircle;
00833 else if(m == "filled square") marker = Display::FilledSquare ;
00834 else if(m == "filled diamond") marker = Display::FilledDiamond;
00835 else if(m == "filled triangle") marker = Display::FilledTriangle;
00836 else if(m == "filled inverted triangle")
00837 marker = Display::FilledInvertedTriangle;
00838 else if(m == "circle and cross") marker = Display::CircleAndCross;
00839 else if(m == "circle and x") marker = Display::CircleAndX;
00840 else if(m == "circle and dot") marker = Display::CircleAndDot;
00841 else return false;
00842 return true;
00843 }
00844
00845 static vector<Display::Marker> allMarkers() {
00846 static vector<Display::Marker> v(15);
00847 v[0] = Display::Cross; v[1] = Display::X;
00848 v[2] = Display::Diamond; v[3] = Display::Circle;
00849 v[4] = Display::Square; v[5] = Display::Triangle;
00850 v[6] = Display::InvertedTriangle; v[7] = Display::FilledCircle;
00851 v[8] = Display::FilledSquare; v[9] = Display::FilledDiamond;
00852 v[10] = Display::FilledTriangle; v[11]=Display::FilledInvertedTriangle;
00853 v[12] = Display::CircleAndCross; v[13] = Display::CircleAndX;
00854 v[14] = Display::CircleAndDot;
00855 return v;
00856 }
00857 };
00858
00859
00860
00861
00862 class RSText : public RegionShape {
00863 public:
00864
00865
00866
00867 RSText(double x, double y, const String& text, MDirection::Types worldSys,
00868 double angle = 0);
00869
00870
00871 RSText(double x, double y, const String& text, double angle = 0);
00872
00873
00874 RSText(const RecordInterface& properties);
00875
00876
00877 ~RSText();
00878
00879
00880 bool drawAndUpdateBoundingBox(WorldCanvasHolder& wch, String* err = NULL);
00881
00882
00883 String type() const { return "text"; }
00884
00885
00886
00887
00888
00889 void getTextCoordinates(double& x, double& y, double& angle,
00890 String toSystem = "") const;
00891
00892
00893 vector<double> coordParameterValues() const;
00894
00895
00896 vector<double> coordParameterValues(String toSystem) const;
00897
00898
00899 vector<String> coordParameterNames() const;
00900
00901
00902 vector<CoordinateParameterType> coordParameterTypes() const;
00903
00904
00905 void setCoordParameters(const vector<double>& vals);
00906
00907
00908 void setCoordParameters(const vector<double>& vals, String valSystem);
00909
00910
00911 void move(double dx, double dy, String system = "");
00912
00913
00914 RSHandle getHandle() const;
00915
00916
00917
00918
00919 vector<String> optionNames() const { return vector<String>(); }
00920 vector<OptionType> optionTypes() const { return vector<OptionType>(); }
00921 vector<RSOption> optionValues() const { return vector<RSOption>();}
00922 void setOptionValues(const vector<RSOption>& options) { }
00923
00924
00925 protected:
00926 double m_x, m_y;
00927 double m_angle;
00928 double m_wWidth;
00929
00930 double m_screenX, m_screenY;
00931
00932
00933 void getShapeSpecificProperties(Record& properties) const {
00934 properties.define(PROPTYPE, PROPTYPE_TEXT);
00935 }
00936
00937
00938 void setShapeSpecificProperties(const RecordInterface& properties) { }
00939
00940
00941 bool updateScreenCoordinates(WorldCanvasHolder& wch, String* err);
00942
00943
00944
00945 void updateMinMax();
00946 };
00947
00948
00949
00950
00951
00952
00953
00954
00955
00956
00957
00958
00959
00960
00961
00962
00963
00964
00965
00966 class RSComposite : public RegionShape {
00967 public:
00968
00969
00970
00971
00972 static const String PROPDEPENDENTCHILDREN;
00973 static const String PROPCHILDREN;
00974
00975
00976
00977
00978
00979
00980
00981
00982
00983
00984 RSComposite(MDirection::Types worldSys, bool dependent = true,
00985 String customName = "");
00986
00987
00988
00989
00990 RSComposite(bool dependent = true, String customName = "");
00991
00992
00993 RSComposite(const RecordInterface& properties);
00994
00995
00996 ~RSComposite();
00997
00998
00999
01000
01001
01002
01003 void addShape(RegionShape* shape);
01004 void addShapes(const vector<RegionShape*> shapes);
01005
01006
01007
01008 bool childrenAreDependent() const;
01009
01010
01011
01012
01013
01014 void setChildrenAreDependent(bool dependent = true);
01015
01016
01017
01018 vector<RegionShape*> children();
01019 vector<const RegionShape*> children() const;
01020
01021
01022
01023
01024
01025 void setLineColor(const String& newColor, bool alsoSetLabel = true);
01026 void setLineWidth(double width);
01027 void setLineStyle(LineStyle style);
01028 void setLabel(const RegionShapeLabel& label);
01029
01030
01031
01032 bool drawAndUpdateBoundingBox(WorldCanvasHolder& wch, String* err = NULL);
01033
01034
01035 String type() const;
01036
01037
01038 String oneWordType() const { return "composite"; }
01039
01040
01041
01042
01043 double getAngle(String toSystem = "") const;
01044
01045
01046
01047
01048
01049 void getCompositeCoordinates(double& centerX, double& centerY,
01050 String toSystem = "") const;
01051
01052
01053 vector<double> coordParameterValues() const;
01054
01055
01056 vector<double> coordParameterValues(String toSystem) const;
01057
01058
01059 vector<String> coordParameterNames() const;
01060
01061
01062 vector<CoordinateParameterType> coordParameterTypes() const;
01063
01064
01065 void setCoordParameters(const vector<double>& vals);
01066
01067
01068 void setCoordParameters(const vector<double>& vals, String valSystem);
01069
01070
01071 void move(double dx, double dy, String system = "");
01072
01073
01074 RSHandle getHandle() const;
01075
01076
01077 vector<String> optionNames() const;
01078
01079
01080 vector<OptionType> optionTypes() const;
01081
01082
01083 vector<RSOption> optionValues() const;
01084
01085
01086 void setOptionValues(const vector<RSOption>& options);
01087
01088 protected:
01089 String m_custName;
01090 bool m_dependentChildren;
01091 vector<RegionShape*> m_shapes;
01092 double m_centerX, m_centerY;
01093 bool m_syncAngleDepChildren;
01094
01095
01096
01097
01098 double m_syncAngle;
01099 bool m_applyChangesToChildren;
01100
01101
01102
01103 void getShapeSpecificProperties(Record& properties) const;
01104
01105
01106 void setShapeSpecificProperties(const RecordInterface& properties);
01107
01108
01109 void updateMinMax();
01110
01111 private:
01112
01113
01114 bool addShapeHelper(RegionShape* shape);
01115
01116
01117 void addShapeUpkeep();
01118
01119
01120
01121 void convertMinMax(double& xmin, double& xmax, double& ymin, double& ymax,
01122 unsigned int index) const;
01123 };
01124
01125 }
01126
01127 #endif