summaryrefslogtreecommitdiffstats
path: root/tksao/frame/contour.h
blob: af06daef384212d86e4736b0f84632744ce087ee (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
// Copyright (C) 1999-2018
// Smithsonian Astrophysical Observatory, Cambridge, MA, USA
// For conditions of distribution and use, see copyright notice in "copyright"

#ifndef __contour_h__
#define __contour_h__

#include "util.h"
#include "vector3d.h"
#include "list.h"
#include "coord.h"

class FitsImage;
class Base;
class Contour;

class ContourLevel {
  friend class Contour;

 protected:
  Base* parent_;
  List<Contour> lcontour_;

  double level_;
  char* colorName_;
  unsigned long color_;
  int lineWidth_;
  int dash_;
  int dlist_[2];

  GC gc_;

  ContourLevel* previous_;
  ContourLevel* next_;

 public:
  ContourLevel(Base*, double, const char*, int, int, int*);
  virtual ~ContourLevel();

  List<Contour>& lcontour() {return lcontour_;}

  void list(ostream& str, FitsImage*, Coord::CoordSystem, Coord::SkyFrame);
  void render(Pixmap, Coord::InternalSystem, const BBox&);
  void ps(int);
  void updateCoords(const Matrix&);
#ifdef MAC_OSX_TK
  void macosx();
#endif
#ifdef __WIN32
  void win32();
#endif

  double level() {return level_;}

  const char* colorName() {return colorName_;}
  void setColor(const char*);
  int dash() {return dash_;}
  void setDash(int dd) {dash_ =dd;}
  int lineWidth() {return lineWidth_;}
  void setLineWidth(int ww) {lineWidth_ =ww;}

  ContourLevel* previous() {return previous_;}
  void setPrevious(ContourLevel* m) {previous_ = m;}
  ContourLevel* next() {return next_;}
  void setNext(ContourLevel* m) {next_ = m;}
};

class Contour {
 protected:
  ContourLevel* parent_;
  Base* base_;
  List<Vertex> lvertex_;

  Contour* previous_;
  Contour* next_;

 public:
  Contour(ContourLevel*);
  ~Contour();
  
  List<Vertex>& lvertex() {return lvertex_;}

  void list(ostream& str, FitsImage*, Coord::CoordSystem, Coord::SkyFrame);
  void render(Pixmap, Coord::InternalSystem, const BBox&);
  void ps(int);
  void updateCoords(const Matrix&);
#ifdef MAC_OSX_TK
  void macosx();
#endif
#ifdef __WIN32
  void win32();
#endif

  Contour* previous() {return previous_;}
  void setPrevious(Contour* m) {previous_ = m;}
  Contour* next() {return next_;}
  void setNext(Contour* m) {next_ = m;}
};

#endif