src/glRenderer.cc

changeset 714
b4a990f59a5e
parent 713
46377d340c23
parent 662
2f1bd9112408
child 715
56f1b77951c8
--- a/src/glRenderer.cc	Thu Apr 17 20:48:31 2014 +0300
+++ b/src/glRenderer.cc	Thu Apr 17 20:50:43 2014 +0300
@@ -299,7 +299,7 @@
 {
 	QColor col (gl_maincolor);
 
-	if (!col.isValid())
+	if (not col.isValid())
 		return QColor (0, 0, 0);
 
 	col.setAlpha (gl_maincolor_alpha * 255.f);
@@ -312,7 +312,7 @@
 {
 	QColor col (gl_bgcolor);
 
-	if (!col.isValid())
+	if (not col.isValid())
 		return;
 
 	col.setAlpha (255);
@@ -362,7 +362,7 @@
 	if (document() == null)
 		return;
 
-	if (gl_wireframe && !isPicking())
+	if (gl_wireframe && not isPicking())
 		glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
 
 	glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -623,7 +623,7 @@
 			int numverts = 4;
 
 			// Calculate polygon data
-			if (!m_rectdraw)
+			if (not m_rectdraw)
 			{
 				numverts = m_drawedVerts.size() + 1;
 				int i = 0;
@@ -799,7 +799,7 @@
 	}
 
 	// Camera icons
-	if (!isPicking())
+	if (not isPicking())
 	{
 		// Draw a background for the selected camera
 		paint.setPen (m_thinBorderPen);
@@ -831,7 +831,7 @@
 		// Tool tips
 		if (m_drawToolTip)
 		{
-			if (m_cameraIcons[m_toolTipCamera].destRect.contains (m_pos) == false)
+			if (not m_cameraIcons[m_toolTipCamera].destRect.contains (m_pos))
 				m_drawToolTip = false;
 			else
 			{
@@ -858,7 +858,7 @@
 	}
 
 	// If we're range-picking, draw a rectangle encompassing the selection area.
-	if (m_rangepick && !isPicking() && m_totalmove >= 10)
+	if (m_rangepick && not isPicking() && m_totalmove >= 10)
 	{
 		int x0 = m_rangeStart.x(),
 			y0 = m_rangeStart.y(),
@@ -922,9 +922,9 @@
 //
 void GLRenderer::mouseReleaseEvent (QMouseEvent* ev)
 {
-	const bool wasLeft = (m_lastButtons & Qt::LeftButton) && ! (ev->buttons() & Qt::LeftButton),
-				   wasRight = (m_lastButtons & Qt::RightButton) && ! (ev->buttons() & Qt::RightButton),
-				   wasMid = (m_lastButtons & Qt::MidButton) && ! (ev->buttons() & Qt::MidButton);
+	const bool wasLeft = (m_lastButtons & Qt::LeftButton) && not (ev->buttons() & Qt::LeftButton),
+	   wasRight = (m_lastButtons & Qt::RightButton) && not (ev->buttons() & Qt::RightButton),
+	   wasMid = (m_lastButtons & Qt::MidButton) && not (ev->buttons() & Qt::MidButton);
 
 	if (m_panning)
 		m_panning = false;
@@ -932,7 +932,7 @@
 	if (wasLeft)
 	{
 		// Check if we selected a camera icon
-		if (!m_rangepick)
+		if (not m_rangepick)
 		{
 			for (CameraIcon & info : m_cameraIcons)
 			{
@@ -987,12 +987,12 @@
 
 			case ESelectMode:
 			{
-				if (!isDrawOnly())
+				if (not isDrawOnly())
 				{
 					if (m_totalmove < 10)
 						m_rangepick = false;
 
-					if (!m_rangepick)
+					if (not m_rangepick)
 						m_addpick = (m_keymods & Qt::ControlModifier);
 
 					if (m_totalmove < 10 || m_rangepick)
@@ -1041,7 +1041,7 @@
 			addDrawnVertex (closest);
 	}
 
-	if (wasRight && !m_drawedVerts.isEmpty())
+	if (wasRight && not m_drawedVerts.isEmpty())
 	{
 		// Remove the last vertex
 		m_drawedVerts.removeLast();
@@ -1091,7 +1091,8 @@
 		pan (X) += 0.03f * dx * (zoom() / 7.5f);
 		pan (Y) -= 0.03f * dy * (zoom() / 7.5f);
 		m_panning = true;
-	} elif (left && !m_rangepick && camera() == EFreeCamera)
+	}
+	elif (left && not m_rangepick && camera() == EFreeCamera)
 	{
 		rot (X) = rot (X) + dy;
 		rot (Y) = rot (Y) + dx;
@@ -1101,7 +1102,7 @@
 	}
 
 	// Start the tool tip timer
-	if (!m_drawToolTip)
+	if (not m_drawToolTip)
 		m_toolTipTimer->start (500);
 
 	// Update 2d position
@@ -1180,7 +1181,7 @@
 	glLineWidth (max<double> (gl_linethickness, 6.5f));
 
 	// Clear the selection if we do not wish to add to it.
-	if (!m_addpick)
+	if (not m_addpick)
 	{
 		LDObjectList oldsel = selection();
 		getCurrentDocument()->clearSelection();
@@ -1263,7 +1264,7 @@
 
 		// If this is an additive single pick and the object is currently selected,
 		// we remove it from selection instead.
-		if (!m_rangepick && m_addpick)
+		if (not m_rangepick && m_addpick)
 		{
 			if (obj->isSelected())
 			{
@@ -1353,7 +1354,7 @@
 	{
 		initOverlaysFromObjects();
 
-		if (currentDocumentData().init == false)
+		if (not currentDocumentData().init)
 		{
 			resetAllAngles();
 			currentDocumentData().init = true;
@@ -1871,14 +1872,14 @@
 			// If this is the first run, we don't know enough to determine
 			// whether the zoom was to fit, so we mark in our knowledge so
 			// far and start over.
-			inward = !filled;
+			inward = not filled;
 			firstrun = false;
 		}
 		else
 		{
 			// If this run filled the screen and the last one did not, the
 			// last run had ideal zoom - zoom a bit back and we should reach it.
-			if (filled && !lastfilled)
+			if (filled && not lastfilled)
 			{
 				zoomNotch (false);
 				break;
@@ -1886,10 +1887,10 @@
 
 			// If this run did not fill the screen and the last one did, we've
 			// now reached ideal zoom so we're done here.
-			if (!filled && lastfilled)
+			if (not filled && lastfilled)
 				break;
 
-			inward = !filled;
+			inward = not filled;
 		}
 
 		lastfilled = filled;
@@ -1919,7 +1920,7 @@
 //
 void GLRenderer::updateRectVerts()
 {
-	if (!m_rectdraw)
+	if (not m_rectdraw)
 		return;
 
 	if (m_drawedVerts.isEmpty())
@@ -1954,7 +1955,7 @@
 //
 void GLRenderer::mouseDoubleClickEvent (QMouseEvent* ev)
 {
-	if (!(ev->buttons() & Qt::LeftButton) || editMode() != ESelectMode)
+	if (not (ev->buttons() & Qt::LeftButton) || editMode() != ESelectMode)
 		return;
 
 	pick (ev->x(), ev->y());
@@ -2000,7 +2001,7 @@
 		LDGLOverlay& meta = currentDocumentData().overlays[cam];
 		LDOverlay* ovlobj = findOverlayObject (cam);
 
-		if (!ovlobj && meta.img)
+		if (not ovlobj && meta.img)
 		{
 			delete meta.img;
 			meta.img = null;
@@ -2075,7 +2076,7 @@
 			}
 		}
 
-		if (meta.img && ovlobj)
+		if (meta.img != null && ovlobj != null)
 		{
 			ovlobj->setCamera (cam);
 			ovlobj->setFileName (meta.fname);

mercurial