Skip to content

Commit

Permalink
Formatted with astyle
Browse files Browse the repository at this point in the history
  • Loading branch information
rtownson authored and ftessier committed Aug 23, 2018
1 parent 98fd37a commit 560cd86
Show file tree
Hide file tree
Showing 9 changed files with 379 additions and 329 deletions.
4 changes: 2 additions & 2 deletions HEN_HOUSE/egs++/egs_base_geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ class EGS_LOCAL EGS_GeometryPrivate {
j = 0;
++iloop;

for(int i=0; i<nnow; ++i) {
if(!geoms[i]->deref()) {
for (int i=0; i<nnow; ++i) {
if (!geoms[i]->deref()) {
removeGeometry(geoms[i]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion HEN_HOUSE/egs++/sources/egs_fano_source/egs_fano_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class EGS_FANO_SOURCE_EXPORT EGS_FanoSource :
while (!okfano);
u.z = buf_1 - rndm->getUniform()*(buf_1 - buf_2);
EGS_Float sinz = 1-u.z*u.z;
if ( sinz > epsilon ) {
if (sinz > epsilon) {
sinz = sqrt(sinz);
EGS_Float cphi, sphi;
EGS_Float phi = min_phi + (max_phi - min_phi)*rndm->getUniform();
Expand Down
16 changes: 8 additions & 8 deletions HEN_HOUSE/egs++/view/clippingplanes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ int ClippingPlanesWidget::numPlanes() {
return planeTable->rowCount();
}

QTableWidgetItem* ClippingPlanesWidget::getItem(int i, int j) {
QTableWidgetItem *ClippingPlanesWidget::getItem(int i, int j) {
QTableWidgetItem *item = planeTable->item(i,j);
return item;
}
Expand All @@ -73,10 +73,10 @@ QTableWidgetItem* ClippingPlanesWidget::getItem(int i, int j) {
bool ClippingPlanesWidget::getPlane(int j, EGS_Vector &a, EGS_Float &d) {
// check if all row items exist and are selected.
QTableWidgetItem *itemAx = planeTable->item(j,0),
*itemAy = planeTable->item(j,1),
*itemAz = planeTable->item(j,2),
*itemD = planeTable->item(j,3),
*itemApplied = planeTable->item(j,4);
*itemAy = planeTable->item(j,1),
*itemAz = planeTable->item(j,2),
*itemD = planeTable->item(j,3),
*itemApplied = planeTable->item(j,4);

// Make sure all parameters for a plane exist
if (!itemAx || !itemAy || !itemAz || !itemD || !itemApplied) {
Expand Down Expand Up @@ -119,7 +119,7 @@ bool ClippingPlanesWidget::getPlane(int j, EGS_Vector &a, EGS_Float &d) {
void ClippingPlanesWidget::setCell(int i, int j, EGS_Float val) {
QTableWidgetItem *item = planeTable->item(i,j);

if(!item) {
if (!item) {
item = new QTableWidgetItem();
planeTable->setItem(i,j,item);
}
Expand All @@ -130,7 +130,7 @@ void ClippingPlanesWidget::setCell(int i, int j, EGS_Float val) {
void ClippingPlanesWidget::setCell(int i, int j, Qt::CheckState checked) {
QTableWidgetItem *item = planeTable->item(i,j);

if(!item) {
if (!item) {
item = new QTableWidgetItem();
planeTable->setItem(i,j,item);
}
Expand All @@ -141,7 +141,7 @@ void ClippingPlanesWidget::setCell(int i, int j, Qt::CheckState checked) {
void ClippingPlanesWidget::clearCell(int i, int j) {
QTableWidgetItem *item = planeTable->item(i,j);

if(item) {
if (item) {
delete item;
}
}
2 changes: 1 addition & 1 deletion HEN_HOUSE/egs++/view/clippingplanes.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ClippingPlanesWidget : public QWidget, public Ui::ClippingPlanesWidget {
virtual void setCell(int i, int j, EGS_Float val);
virtual void setCell(int i, int j, Qt::CheckState checked);
virtual void clearCell(int i, int j);
virtual QTableWidgetItem* getItem(int i, int j);
virtual QTableWidgetItem *getItem(int i, int j);

signals:

Expand Down
29 changes: 15 additions & 14 deletions HEN_HOUSE/egs++/view/egs_track_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,12 @@ bool EGS_TrackView::renderTracks(int nx, int ny, EGS_Vector *image,
EGS_Float color = (k+1);

int min, max;
if(trackIndices.size()) {
if (trackIndices.size()) {
min = trackIndices[2*k];
// Avoid out of bounds error, max out at m_tracks
max = trackIndices[2*k+1] > m_tracks[k] ? m_tracks[k] : trackIndices[2*k+1];
} else {
}
else {
min = 0;
max = m_tracks[k];
}
Expand Down Expand Up @@ -403,7 +404,7 @@ void EGS_TrackView::renderTrack(EGS_ParticleTrack::Vertex *const vs, int len, EG
xxx1 = r1.x;
yyy1 = r1.y;
dst1 = f1.length();
if(energyScaling) {
if (energyScaling) {
e1 = v1.e / m_maxE;
}
}
Expand All @@ -427,7 +428,7 @@ void EGS_TrackView::renderTrack(EGS_ParticleTrack::Vertex *const vs, int len, EG
xxx1 = xxx2;
yyy1 = yyy2;
dst1 = dst2;
if(energyScaling) {
if (energyScaling) {
e1 = e2;
}
}
Expand All @@ -436,7 +437,7 @@ void EGS_TrackView::renderTrack(EGS_ParticleTrack::Vertex *const vs, int len, EG
xxx2 = r2.x;
yyy2 = r2.y;
dst2 = f2.length();
if(energyScaling) {
if (energyScaling) {
e2 = v2.e / m_maxE;
}

Expand Down Expand Up @@ -469,7 +470,7 @@ void EGS_TrackView::renderTrack(EGS_ParticleTrack::Vertex *const vs, int len, EG
double gd = dst1;
double de, ge;

if(energyScaling) {
if (energyScaling) {
de = (e2 - e1);
ge = e1;
}
Expand All @@ -480,7 +481,7 @@ void EGS_TrackView::renderTrack(EGS_ParticleTrack::Vertex *const vs, int len, EG
ddy = ddy / abs(ddx);
int di = (xxx1 > xxx2) ? -1 : 1;
dd = dd / abs(ddx);
if(energyScaling) {
if (energyScaling) {
de = de / abs(ddx);
}

Expand All @@ -495,13 +496,13 @@ void EGS_TrackView::renderTrack(EGS_ParticleTrack::Vertex *const vs, int len, EG
if (color > tmpv3.x) {
tmpv3.x = color; // put "important" particles in front [warning: may teleport particles through a sheet of lesser particles]
}
if(energyScaling) {
if (energyScaling) {
tmpv3.y += (1-tmpv3.y)*e2; // compound transparency values
}
}
else {
tmpv3.x = color;
if(energyScaling) {
if (energyScaling) {
tmpv3.y=e2;
}
tmpv3.z=-gd; // just update with current track info
Expand All @@ -510,7 +511,7 @@ void EGS_TrackView::renderTrack(EGS_ParticleTrack::Vertex *const vs, int len, EG
image[cx + ((int)(cy))*nx] = tmpv3;
cy += ddy;
gd += dd;
if(energyScaling) {
if (energyScaling) {
ge += de;
}
}
Expand All @@ -521,7 +522,7 @@ void EGS_TrackView::renderTrack(EGS_ParticleTrack::Vertex *const vs, int len, EG
cx = xxx1;
ddx = ddx / abs(ddy);
dd = dd / abs(ddy);
if(energyScaling) {
if (energyScaling) {
de = de / abs(ddy);
}

Expand All @@ -536,13 +537,13 @@ void EGS_TrackView::renderTrack(EGS_ParticleTrack::Vertex *const vs, int len, EG
if (color > tmpv3.x) {
tmpv3.x = color; // put "important" particles in front
}
if(energyScaling) {
if (energyScaling) {
tmpv3.y += (1-tmpv3.y)*e2; // compound transparency values
}
}
else {
tmpv3.x = color;
if(energyScaling) {
if (energyScaling) {
tmpv3.y=e2;
}
tmpv3.z=-gd; // just update with current track info
Expand All @@ -552,7 +553,7 @@ void EGS_TrackView::renderTrack(EGS_ParticleTrack::Vertex *const vs, int len, EG

cx += ddx;
gd += dd;
if(energyScaling) {
if (energyScaling) {
ge += de;
}
}
Expand Down
Loading

0 comments on commit 560cd86

Please sign in to comment.