Changeset 2146 in ntrip
- Timestamp:
- Dec 31, 2009, 11:39:06 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/BNC/bncfigureppp.cpp ¶
r2145 r2146 88 88 } 89 89 90 update();90 repaint(); 91 91 } 92 92 … … 118 118 painter.drawLine(xMin+60, int((yMax-yMin)*xLine), xMin+60, yMin+10); 119 119 120 // Plot XY 121 // ------- 122 if (_pos.size() > 1) { 123 124 double posXmin = _pos[0]->xyz[0]; 125 double posXmax = _pos[0]->xyz[0]; 126 double posYmin = _pos[0]->xyz[1]; 127 double posYmax = _pos[0]->xyz[1]; 128 for (int ii = 1; ii < _pos.size(); ++ii) { 129 if (_pos[ii]->xyz[0] < posXmin) { 130 posXmin = _pos[ii]->xyz[0]; 131 } 132 if (_pos[ii]->xyz[0] > posXmax) { 133 posXmax = _pos[ii]->xyz[0]; 134 } 135 if (_pos[ii]->xyz[1] < posYmin) { 136 posYmin = _pos[ii]->xyz[1]; 137 } 138 if (_pos[ii]->xyz[1] > posYmax) { 139 posYmax = _pos[ii]->xyz[1]; 140 } 141 } 142 double rangeX = posXmax - posXmin; 143 double rangeY = posYmax - posYmin; 144 145 for (int ii = 0; ii < _pos.size(); ++ii) { 146 const static int width = 10; 147 const static int height = 10; 148 int xx = int( (_pos[ii]->xyz[0] - posXmin) * (xMax - xMin) / rangeX) ; 149 int yy = int( (_pos[ii]->xyz[1] - posYmin) * (yMax - yMin) / rangeY) ; 150 painter.drawEllipse(xx, yy, width, height); 151 } 152 } 120 153 } 121 154
Note:
See TracChangeset
for help on using the changeset viewer.