ODIN
geoeditlabel.h
1 /***************************************************************************
2  geoeditlabel.h - description
3  -------------------
4  begin : Tue Apr 16 2002
5  copyright : (C) 2000-2021 by Thies H. Jochimsen
6  email : thies@jochimsen.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef GEOEDITLABEL_H
19 #define GEOEDITLABEL_H
20 
21 #include <odinqt/float3d.h>
22 
23 #include <odinpara/geometry.h>
24 
25 #include <odindata/image.h>
26 
27 #define REL_READVEC_LENGTH 0.2
28 #define READVEC_ARROW_LENGTH 0.1
29 #define CROSSSECT_COLOR "Red"
30 #define PROJECTION_COLOR "Green"
31 
32 
33 
35 
36 
37 // for debugging geoedit component
38 class GeoEditComp {
39  public:
40  static const char* get_compName();
41 };
42 
43 
45 
46 
47 class GeoEditLabel : public floatBox3D {
48  Q_OBJECT
49 
50 public:
51  GeoEditLabel(const Image& background, unsigned int coarseFactor, QWidget *parent);
52 
53  void drawImagingArea(const Geometry& ia, bool drawProj, bool drawCross);
54 
55 private:
56  int xcoord2labelxpos(double pos) { return label->xpos2labelxpos(int((double)label->get_nx()*(0.5+secureDivision(pos,backgr.get_geometry().get_FOV(readDirection)))));}
57  int ycoord2labelypos(double pos) { return label->ypos2labelypos(int((double)label->get_ny()*(0.5+secureDivision(pos,backgr.get_geometry().get_FOV(phaseDirection)))));}
58 
59  void drawSliceProjection(const darray& cornersProj, GuiPainter& painter);
60  void drawSliceCrossSection(const darray& connectPoints, double slicethick, GuiPainter& painter, unsigned int slice);
61 
62  void drawVoxelProjection(const darray& cornersProj, GuiPainter& painter);
63 
64  void drawReadVector(const dvector& readvecstart_proj, const dvector& readvec_proj, GuiPainter& painter);
65 
66  // overloading virtual function of floatBox3D
67  void repaint() {if(ia_cache) drawImagingArea(*ia_cache,drawProj_cache,drawCross_cache);}
68 
69  Image backgr;
70  unsigned int coarse;
71 
72  const Geometry* ia_cache;
73  bool drawProj_cache;
74  bool drawCross_cache;
75 };
76 
77 
78 #endif
Geometry Settings.
Definition: geometry.h:179
Definition: image.h:37
double secureDivision(double numerator, double denominator)