File: annotatePoints.cxx

package info (click to toggle)
imview 1.1.9c-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,068 kB
  • ctags: 3,686
  • sloc: cpp: 28,834; sh: 2,624; ansic: 1,818; makefile: 767; exp: 112; python: 88
file content (114 lines) | stat: -rw-r--r-- 2,159 bytes parent folder | download | duplicates (8)
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
109
110
111
112
113
114
/*------------------------------------------------------------------------
 *
 * The top-level code for point annotation.
 *
 * Hugues Talbot	13 Jan 2001
 *
 * Following discussions with PSL. 
 *      
 *-----------------------------------------------------------------------*/

#include "imview.hxx"
#include "annotatePoints.hxx"
#include "pointfile.hxx"

extern pointfile    *PtFileMngr;

annotatept::annotatept()
{
    dbgprintf("Point annotation dialog created\n");
    annotateWindow = 0; // fluid depends on this
    return;
}

annotatept::~annotatept()
{
    dbgprintf("Point annotation dialog destroyed\n");
    return;
}

void annotatept::setDefaults()
{
    return;
}

void annotatept::show()
{
    annotateWindow->show();
}

void annotatept::hide()
{
    annotateWindow->hide();
}

void annotatept::getPointParams(void)
{
    int          font, size, length;
    string       ann;
    Fl_Color     col;
    str_quadrant q;
    bool         h;
    int          ptsize;
    
	if (PtFileMngr->getNearestPointParameters(X_,Y_, ann, col, font, size, length, q, h, ptsize)) {
		setAnnotation(ann.c_str());
		fontChoice->value(font);
		fontColourChoice->value(col);
		fontSizeSlider->value(size);
		distanceValue->value(length);
		fontQuadrant = q;
		hide(h);
		setPointSize(ptsize);
	}
    // else do nothing.
}

// the annotatept callbacks

void setdistance_cb(Fl_Roller *r, annotatept *panel)
{
    panel->setDistance((int)(r->value())); // forward value to Value holder
}

void cancelbutton_cb(Fl_Button *b, annotatept *panel)
{
    panel->hide();
}

void okbutton_cb(Fl_Return_Button *b, annotatept *panel)
{
    int    xx, yy;
    
    panel->getXY(xx,yy);
    PtFileMngr->annotatePoint(xx, yy);
    
    panel->hide();
}

void annotateinput_cb(Fl_Input *, annotatept *)
{
    return;
}

void SE_cb(Fl_Round_Button *, annotatept *panel)
{
    panel->setFontQuadrant(STR_SE);
}

void NE_cb(Fl_Round_Button *, annotatept *panel)
{
    panel->setFontQuadrant(STR_NE);
}

void NW_cb(Fl_Round_Button *, annotatept *panel)
{
    panel->setFontQuadrant(STR_NW);
}

void SW_cb(Fl_Round_Button *, annotatept *panel)
{
    panel->setFontQuadrant(STR_SW);
}