summaryrefslogtreecommitdiffstats
path: root/tksao/frame/polygon.C
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-03-11 21:17:59 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-03-11 21:17:59 (GMT)
commiteef1b4e01cc3c5307188e1497e6b095081eef378 (patch)
treeb27c812b352c9024fe4a5b9dbab6f6102a581156 /tksao/frame/polygon.C
parentf7a9669c931c4da48dbc39d3f90b17ea2314ab9c (diff)
downloadblt-eef1b4e01cc3c5307188e1497e6b095081eef378.zip
blt-eef1b4e01cc3c5307188e1497e6b095081eef378.tar.gz
blt-eef1b4e01cc3c5307188e1497e6b095081eef378.tar.bz2
add region fill
Diffstat (limited to 'tksao/frame/polygon.C')
-rw-r--r--tksao/frame/polygon.C62
1 files changed, 55 insertions, 7 deletions
diff --git a/tksao/frame/polygon.C b/tksao/frame/polygon.C
index dd494db..2302f1b 100644
--- a/tksao/frame/polygon.C
+++ b/tksao/frame/polygon.C
@@ -7,32 +7,35 @@
#include "polygon.h"
#include "fitsimage.h"
-Polygon::Polygon(Base* p, const Vector& ctr,
- const Vector& b)
- : BasePolygon(p,ctr,b)
+Polygon::Polygon(const Polygon& a) : BasePolygon(a), BaseFill(a) {}
+
+Polygon::Polygon(Base* p, const Vector& ctr, const Vector& b, int fill)
+ : BasePolygon(p,ctr,b), BaseFill(fill)
{
strcpy(type_, "polygon");
reset(b);
}
Polygon::Polygon(Base* p, const Vector& ctr,
- const Vector& b,
+ const Vector& b, int fill,
const char* clr, int* dsh,
int wth, const char* fnt, const char* txt,
unsigned short prop, const char* cmt,
const List<Tag>& tg, const List<CallBack>& cb)
- : BasePolygon(p, ctr, b, clr, dsh, wth, fnt, txt, prop, cmt, tg, cb)
+ : BasePolygon(p, ctr, b, clr, dsh, wth, fnt, txt, prop, cmt, tg, cb),
+ BaseFill(fill)
{
strcpy(type_, "polygon");
reset(b);
}
-Polygon::Polygon(Base* p, const List<Vertex>& v,
+Polygon::Polygon(Base* p, const List<Vertex>& v, int fill,
const char* clr, int* dsh,
int wth, const char* fnt, const char* txt,
unsigned short prop, const char* cmt,
const List<Tag>& tg, const List<CallBack>& cb)
- : BasePolygon(p, v, clr, dsh, wth, fnt, txt, prop, cmt, tg, cb)
+ : BasePolygon(p, v, clr, dsh, wth, fnt, txt, prop, cmt, tg, cb),
+ BaseFill(fill)
{
strcpy(type_, "polygon");
@@ -368,6 +371,51 @@ void Polygon::list(ostream& str, Coord::CoordSystem sys, Coord::SkyFrame sky,
listPost(str, conj, strip);
}
+void Polygon::listPost(ostream& str, int conj, int strip)
+{
+ // no props for semicolons
+ if (!strip) {
+ if (conj)
+ str << " ||";
+
+ if (fill_)
+ str << " # fill=" << fill_;
+
+ listProperties(str, !fill_);
+ }
+ else {
+ if (conj)
+ str << "||";
+ else
+ str << ';';
+ }
+}
+
+void Polygon::listXML(ostream& str, Coord::CoordSystem sys,
+ Coord::SkyFrame sky, Coord::SkyFormat format)
+{
+ FitsImage* ptr = parent->findFits(sys,center);
+ Matrix mm = fwdMatrix();
+ Vector* vv = new Vector[vertex.count()];
+
+ XMLRowInit();
+ XMLRow(XMLSHAPE,type_);
+
+ vertex.head();
+ int cnt =0;
+ do
+ vv[cnt++] =vertex.current()->vector*mm;
+ while (vertex.next());
+ XMLRowPoint(ptr,sys,sky,format,vv,vertex.count());
+ delete [] vv;
+
+ if (fill_)
+ XMLRow(XMLPARAM,fill_);
+
+ XMLRowProps(ptr,sys);
+ XMLRowEnd(str);
+}
+
void Polygon::listCiao(ostream& str, Coord::CoordSystem sys, int strip)
{
FitsImage* ptr = parent->findFits();