diff options
author | Julian Eisel <julian@blender.org> | 2022-11-10 15:17:42 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-11-10 15:17:42 +0300 |
commit | 7246c387435769a169ac24c91434c615df6434b4 (patch) | |
tree | 61842e3e0ce85e80720fdd7476d44d2e629f59fd /source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp | |
parent | c5f55d17096d373791363e46004176e3f7f7ae52 (diff) | |
parent | 0b4bd3ddc016298e868169a541cf6c132b10c587 (diff) |
Merge branch 'master' into asset-browser-grid-viewasset-browser-grid-view
Diffstat (limited to 'source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp')
-rw-r--r-- | source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp b/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp index cd36e4b0fe9..b7e805f8767 100644 --- a/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp +++ b/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp @@ -12,6 +12,8 @@ #include "../geometry/GeomUtils.h" #include "../geometry/normal_cycle.h" +#include "BLI_sys_types.h" + #include "BKE_global.h" namespace Freestyle { @@ -318,8 +320,8 @@ void FEdgeXDetector::ProcessSilhouetteEdge(WXEdge *iEdge) WXFace *fA = (WXFace *)iEdge->GetaOEdge()->GetaFace(); WXFace *fB = (WXFace *)iEdge->GetaOEdge()->GetbFace(); - if ((fA->front()) ^ - (fB->front())) { // fA->visible XOR fB->visible (true if one is 0 and the other is 1) + if (fA->front() ^ + fB->front()) { // fA->visible XOR fB->visible (true if one is 0 and the other is 1) // The only edges we want to set as silhouette edges in this way are the ones with 2 different // normals for 1 vertex for these two faces //-------------------- @@ -420,8 +422,8 @@ void FEdgeXDetector::ProcessRidgeFace(WXFace *iFace) WXFaceLayer *flayer = new WXFaceLayer(iFace, Nature::RIDGE | Nature::VALLEY, false); iFace->AddSmoothLayer(flayer); - unsigned int numVertices = iFace->numberOfVertices(); - for (unsigned int i = 0; i < numVertices; ++i) { + uint numVertices = iFace->numberOfVertices(); + for (uint i = 0; i < numVertices; ++i) { WVertex *wv = iFace->GetVertex(i); WXVertex *wxv = dynamic_cast<WXVertex *>(wv); flayer->PushDotP(wxv->curvatures()->K1); @@ -570,8 +572,8 @@ void FEdgeXDetector::ProcessSuggestiveContourFace(WXFace *iFace) WXFaceLayer *faceLayer = new WXFaceLayer(iFace, Nature::SUGGESTIVE_CONTOUR, true); iFace->AddSmoothLayer(faceLayer); - unsigned int numVertices = iFace->numberOfVertices(); - for (unsigned int i = 0; i < numVertices; ++i) { + uint numVertices = iFace->numberOfVertices(); + for (uint i = 0; i < numVertices; ++i) { WVertex *wv = iFace->GetVertex(i); WXVertex *wxv = dynamic_cast<WXVertex *>(wv); faceLayer->PushDotP(wxv->curvatures()->Kr); @@ -618,7 +620,7 @@ void FEdgeXDetector::postProcessSuggestiveContourFace(WXFace *iFace) // Compute the derivative value at each vertex of the face, and add it in a vector. vector<real> kr_derivatives; - unsigned vertices_nb = iFace->numberOfVertices(); + uint vertices_nb = iFace->numberOfVertices(); WXVertex *v, *opposite_vertex_a, *opposite_vertex_b; WXFace *wxf; WOEdge *opposite_edge; @@ -626,8 +628,8 @@ void FEdgeXDetector::postProcessSuggestiveContourFace(WXFace *iFace) GeomUtils::intersection_test res; real kr(0), kr1(0), kr2(0), t; - for (unsigned int i = 0; i < vertices_nb; ++i) { - v = (WXVertex *)(iFace->GetVertex(i)); + for (uint i = 0; i < vertices_nb; ++i) { + v = (WXVertex *)iFace->GetVertex(i); // v is a singular vertex, skip it. if (v->isBoundary()) { |