diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-05-31 15:51:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-05-31 15:55:15 +0300 |
commit | d8dbd49a2f23b7637f05fc058f39bdf6ab706624 (patch) | |
tree | 0805b9372c82ae6505d87e879824efe1d3e32f8e /source/blender/freestyle/intern/application | |
parent | 8987f7987d8160e1f6e79e8c85d6ce65b885ab25 (diff) |
Cleanup: style, use braces in source/
Automated using clang-tidy.
Diffstat (limited to 'source/blender/freestyle/intern/application')
-rw-r--r-- | source/blender/freestyle/intern/application/AppCanvas.cpp | 21 | ||||
-rw-r--r-- | source/blender/freestyle/intern/application/Controller.cpp | 39 |
2 files changed, 40 insertions, 20 deletions
diff --git a/source/blender/freestyle/intern/application/AppCanvas.cpp b/source/blender/freestyle/intern/application/AppCanvas.cpp index ab1da79a77f..b9f1d915e34 100644 --- a/source/blender/freestyle/intern/application/AppCanvas.cpp +++ b/source/blender/freestyle/intern/application/AppCanvas.cpp @@ -104,8 +104,9 @@ void AppCanvas::init() void AppCanvas::postDraw() { for (unsigned int i = 0; i < _StyleModules.size(); i++) { - if (!_StyleModules[i]->getDisplayed() || !_Layers[i]) + if (!_StyleModules[i]->getDisplayed() || !_Layers[i]) { continue; + } _Layers[i]->ScaleThickness(thickness()); } Canvas::postDraw(); @@ -152,12 +153,14 @@ void AppCanvas::readColorPixels(int x, int y, int w, int h, RGBImage &oImage) co int ii, jj; for (int j = 0; j < h; j++) { jj = (int)((y - ymin + j) * yfac); - if (jj < 0 || jj >= recty) + if (jj < 0 || jj >= recty) { continue; + } for (int i = 0; i < w; i++) { ii = (int)((x - xmin + i) * xfac); - if (ii < 0 || ii >= rectx) + if (ii < 0 || ii >= rectx) { continue; + } memcpy( rgb + (w * j + i) * 3, _pass_diffuse.buf + (rectx * jj + ii) * 3, sizeof(float) * 3); } @@ -200,12 +203,14 @@ void AppCanvas::readDepthPixels(int x, int y, int w, int h, GrayImage &oImage) c int ii, jj; for (int j = 0; j < h; j++) { jj = (int)((y - ymin + j) * yfac); - if (jj < 0 || jj >= recty) + if (jj < 0 || jj >= recty) { continue; + } for (int i = 0; i < w; i++) { ii = (int)((x - xmin + i) * xfac); - if (ii < 0 || ii >= rectx) + if (ii < 0 || ii >= rectx) { continue; + } z[w * j + i] = _pass_z.buf[rectx * jj + ii]; } } @@ -215,10 +220,12 @@ void AppCanvas::readDepthPixels(int x, int y, int w, int h, GrayImage &oImage) c void AppCanvas::RenderStroke(Stroke *iStroke) { - if (_basic) + if (_basic) { iStroke->RenderBasic(_Renderer); - else + } + else { iStroke->Render(_Renderer); + } } void AppCanvas::update() diff --git a/source/blender/freestyle/intern/application/Controller.cpp b/source/blender/freestyle/intern/application/Controller.cpp index 4d5ffda5f38..654c0cb30c8 100644 --- a/source/blender/freestyle/intern/application/Controller.cpp +++ b/source/blender/freestyle/intern/application/Controller.cpp @@ -136,8 +136,9 @@ Controller::~Controller() { if (NULL != _RootNode) { int ref = _RootNode->destroy(); - if (0 == ref) + if (0 == ref) { delete _RootNode; + } } #if 0 @@ -184,8 +185,9 @@ Controller::~Controller() void Controller::setView(AppView *iView) { - if (NULL == iView) + if (NULL == iView) { return; + } _pView = iView; _Canvas->setViewer(_pView); @@ -279,16 +281,19 @@ int Controller::LoadMesh(Render *re, ViewLayer *view_layer, Depsgraph *depsgraph _pView->setModel(_RootNode); //_pView->FitBBox(); - if (_pRenderMonitor->testBreak()) + if (_pRenderMonitor->testBreak()) { return 0; + } if (_EnableViewMapCache) { NodeCamera *cam; - if (g_freestyle.proj[3][3] != 0.0) + if (g_freestyle.proj[3][3] != 0.0) { cam = new NodeOrthographicCamera; - else + } + else { cam = new NodePerspectiveCamera; + } double proj[16]; for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { @@ -389,8 +394,9 @@ void Controller::ClearRootNode() _pView->DetachModel(); if (NULL != _RootNode) { int ref = _RootNode->destroy(); - if (0 == ref) + if (0 == ref) { _RootNode->addRef(); + } _RootNode->clearBBox(); } } @@ -460,8 +466,9 @@ void Controller::DeleteViewMap(bool freeCache) void Controller::ComputeViewMap() { - if (!_ListOfModels.size()) + if (!_ListOfModels.size()) { return; + } DeleteViewMap(true); @@ -520,8 +527,9 @@ void Controller::ComputeViewMap() } int viewport[4]; - for (int i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { viewport[i] = g_freestyle.viewport[i]; + } #if 0 if (G.debug & G_DEBUG_FREESTYLE) { @@ -554,8 +562,9 @@ void Controller::ComputeViewMap() printf("Feature lines : %lf\n", duration); } - if (_pRenderMonitor->testBreak()) + if (_pRenderMonitor->testBreak()) { return; + } // Builds the view map structure from the flagged WSEdge structure: //---------------------------------------------------------- @@ -863,8 +872,9 @@ bool Controller::getComputeSteerableViewMapFlag() const int Controller::DrawStrokes() { - if (_ViewMap == 0) + if (_ViewMap == 0) { return 0; + } if (G.debug & G_DEBUG_FREESTYLE) { cout << "\n=== Stroke drawing ===" << endl; @@ -1047,15 +1057,17 @@ string Controller::getModulesDir() const void Controller::resetInterpreter() { - if (_inter) + if (_inter) { _inter->reset(); + } } void Controller::displayDensityCurves(int x, int y) { SteerableViewMap *svm = _Canvas->getSteerableViewMap(); - if (!svm) + if (!svm) { return; + } unsigned int i, j; typedef vector<Vec3r> densityCurve; @@ -1065,8 +1077,9 @@ void Controller::displayDensityCurves(int x, int y) // collect the curves values unsigned nbCurves = svm->getNumberOfOrientations() + 1; unsigned nbPoints = svm->getNumberOfPyramidLevels(); - if (!nbPoints) + if (!nbPoints) { return; + } // build the density/nbLevels curves for each orientation for (i = 0; i < nbCurves; ++i) { |