summaryrefslogtreecommitdiffstats
path: root/tksao/frame/point.h
blob: ccead2fc5fa9b1c97fe8d960a5d986122bca62fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// Copyright (C) 1999-2018
// Smithsonian Astrophysical Observatory, Cambridge, MA, USA
// For conditions of distribution and use, see copyright notice in "copyright"

#ifndef __point_h__
#define __point_h__

#include "marker.h"

class Point : public Marker {
 public:
  enum PointShape {CIRCLE,BOX,DIAMOND,CROSS,EX,ARROW,BOXCIRCLE};

 protected:
  PointShape shape_;
  char* shapestr_;
  int size_;

 protected:
  Vector* generateCircle(Coord::InternalSystem, int);
  Vector* generateBox(Coord::InternalSystem);
  Vector* generateDiamond(Coord::InternalSystem);
  Vector* generateCross(Coord::InternalSystem);
  Vector* generateEx(Coord::InternalSystem);
  Vector* generateArrow(Coord::InternalSystem);

  void renderXCircle(Drawable, Coord::InternalSystem, RenderMode, int);
  void renderXBox(Drawable drawable, Coord::InternalSystem sys, RenderMode mode);
  void renderXLineDash(GC lgc);

  void renderPSCircle(int,int);
  void renderPSBox(int);
  void renderPSLineDash();

#ifdef MAC_OSX_TK
  void renderMACOSXCircle(int);
  void renderMACOSXBox();
  void renderMACOSXLineDash();
#endif

#ifdef __WIN32
  void renderWIN32Circle(int);
  void renderWIN32Box();
  void renderWIN32LineDash();
#endif

  void shapeStr(PointShape);
  void updateHandles();

  int isInRef(const Vector&);

 public:
  Point(Base* p, const Vector& ctr);
  Point(Base* p, const Vector& ctr, 
	PointShape shape, int size,
	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);
  Point(const Point&);
  virtual ~Point();

  virtual Marker* dup() {return new Point(*this);}

  void renderX(Drawable, Coord::InternalSystem, RenderMode);
  void renderPS(int mode);

#ifdef MAC_OSX_TK
  void renderMACOSX();
#endif

#ifdef __WIN32
  void renderWIN32();
#endif

  const char* shape() {return shapestr_;}
  void setShape(PointShape);

  int size() {return size_;}
  void setSize(int);

  void editBegin(int) {}
  void edit(const Vector& v, int h) {}
  void editEnd() {}

  void rotateBegin() {}
  void rotate(const Vector& v, int h) {}
  void rotateEnd() {}

  void analysis(AnalysisTask, int);
  void analysisPlot3d(char*, char*, Coord::CoordSystem sys, Coord::SkyFrame sky,
		      Marker::AnalysisMethod);

  int isIn(const Vector& vv, Coord::InternalSystem sys)
  {return isInRef(bckMap(vv,sys));}
  int isIn(const Vector& vv, const Matrix& bck)
  {return isInRef(vv*bck);}

  void list(ostream&, Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat, int, int);
  void listXML(ostream&, Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat);
  void listPost(ostream&, int, int);
  virtual void listCiao(ostream&, Coord::CoordSystem, int);
  virtual void listPros(ostream&, Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat, int);
  virtual void listSAOtng(ostream&, Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat, int);
  virtual void listSAOimage(ostream&, int);
};

#endif