[Bf-blender-cvs] [4f61843a7e2] master: Cleanup: remove *.orig file from 6a9d7139f7d05e0c51827a3a4b862c0547dc0513

Campbell Barton noreply at git.blender.org
Thu Aug 12 06:40:41 CEST 2021


Commit: 4f61843a7e2fc7d92a630379c14cc87a6e892d6f
Author: Campbell Barton
Date:   Thu Aug 12 14:34:39 2021 +1000
Branches: master
https://developer.blender.org/rB4f61843a7e2fc7d92a630379c14cc87a6e892d6f

Cleanup: remove *.orig file from 6a9d7139f7d05e0c51827a3a4b862c0547dc0513

===================================================================

D	source/blender/blenkernel/intern/mesh_normals.cc.orig

===================================================================

diff --git a/source/blender/blenkernel/intern/mesh_normals.cc.orig b/source/blender/blenkernel/intern/mesh_normals.cc.orig
deleted file mode 100644
index 18d384e8589..00000000000
--- a/source/blender/blenkernel/intern/mesh_normals.cc.orig
+++ /dev/null
@@ -1,2217 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- */
-
-/** \file
- * \ingroup bke
- *
- * Mesh normal calculation functions.
- *
- * \see bmesh_mesh_normals.c for the equivalent #BMesh functionality.
- */
-
-#include <climits>
-
-#include "CLG_log.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-
-#include "BLI_alloca.h"
-#include "BLI_bitmap.h"
-
-#include "BLI_linklist.h"
-#include "BLI_linklist_stack.h"
-#include "BLI_math.h"
-#include "BLI_memarena.h"
-#include "BLI_stack.h"
-#include "BLI_task.h"
-#include "BLI_utildefines.h"
-
-#include "BKE_customdata.h"
-#include "BKE_editmesh_cache.h"
-#include "BKE_global.h"
-#include "BKE_mesh.h"
-
-<<<<<<< Updated upstream
-#include "atomic_ops.h"
-
-// #define DEBUG_TIME
-=======
-#define DEBUG_TIME
->>>>>>> Stashed changes
-
-#ifdef DEBUG_TIME
-#  include "PIL_time.h"
-#  include "PIL_time_utildefines.h"
-#endif
-
-static CLG_LogRef LOG = {"bke.mesh_normals"};
-
-/* -------------------------------------------------------------------- */
-/** \name Private Utility Functions
- * \{ */
-
-/**
- * A thread-safe version of #add_v3_v3 that uses a spin-lock.
- *
- * \note Avoid using this when the chance of contention is high.
- */
-static void add_v3_v3_atomic(float r[3], const float a[3])
-{
-#define FLT_EQ_NONAN(_fa, _fb) (*((const uint32_t *)&_fa) == *((const uint32_t *)&_fb))
-
-  float virtual_lock = r[0];
-  while (true) {
-    /* This loops until following conditions are met:
-     * - `r[0]` has same value as virtual_lock (i.e. it did not change since last try).
-     * - `r[0]` was not `FLT_MAX`, i.e. it was not locked by another thread. */
-    const float test_lock = atomic_cas_float(&r[0], virtual_lock, FLT_MAX);
-    if (_ATOMIC_LIKELY(FLT_EQ_NONAN(test_lock, virtual_lock) && (test_lock != FLT_MAX))) {
-      break;
-    }
-    virtual_lock = test_lock;
-  }
-  virtual_lock += a[0];
-  r[1] += a[1];
-  r[2] += a[2];
-
-  /* Second atomic operation to 'release'
-   * our lock on that vector and set its first scalar value. */
-  /* Note that we do not need to loop here, since we 'locked' `r[0]`,
-   * nobody should have changed it in the mean time. */
-  virtual_lock = atomic_cas_float(&r[0], FLT_MAX, virtual_lock);
-  BLI_assert(virtual_lock == FLT_MAX);
-
-#undef FLT_EQ_NONAN
-}
-
-/** \} */
-
-/* -------------------------------------------------------------------- */
-/** \name Mesh Normal Calculation
- * \{ */
-
-void BKE_mesh_normals_tag_dirty(Mesh *mesh)
-{
-  mesh->runtime.cd_dirty_vert |= CD_MASK_NORMAL;
-  mesh->runtime.cd_dirty_poly |= CD_MASK_NORMAL;
-}
-
-/**
- * Call when there are no polygons.
- */
-static void mesh_calc_normals_vert_fallback(MVert *mverts, int numVerts)
-{
-  for (int i = 0; i < numVerts; i++) {
-    MVert *mv = &mverts[i];
-    float no[3];
-
-    normalize_v3_v3(no, mv->co);
-    normal_float_to_short_v3(mv->no, no);
-  }
-}
-
-/* TODO(Sybren): we can probably rename this to BKE_mesh_calc_normals_mapping(),
- * and remove the function of the same name below, as that one doesn't seem to be
- * called anywhere. */
-void BKE_mesh_calc_normals_mapping_simple(struct Mesh *mesh)
-{
-  const bool only_face_normals = CustomData_is_referenced_layer(&mesh->vdata, CD_MVERT);
-
-  BKE_mesh_calc_normals_mapping_ex(mesh->mvert,
-                                   mesh->totvert,
-                                   mesh->mloop,
-                                   mesh->mpoly,
-                                   mesh->totloop,
-                                   mesh->totpoly,
-                                   nullptr,
-                                   mesh->mface,
-                                   mesh->totface,
-                                   nullptr,
-                                   nullptr,
-                                   only_face_normals);
-}
-
-/* Calculate vertex and face normals, face normals are returned in *r_faceNors if non-nullptr
- * and vertex normals are stored in actual mverts.
- */
-void BKE_mesh_calc_normals_mapping(MVert *mverts,
-                                   int numVerts,
-                                   const MLoop *mloop,
-                                   const MPoly *mpolys,
-                                   int numLoops,
-                                   int numPolys,
-                                   float (*r_polyNors)[3],
-                                   const MFace *mfaces,
-                                   int numFaces,
-                                   const int *origIndexFace,
-                                   float (*r_faceNors)[3])
-{
-  BKE_mesh_calc_normals_mapping_ex(mverts,
-                                   numVerts,
-                                   mloop,
-                                   mpolys,
-                                   numLoops,
-                                   numPolys,
-                                   r_polyNors,
-                                   mfaces,
-                                   numFaces,
-                                   origIndexFace,
-                                   r_faceNors,
-                                   false);
-}
-/* extended version of 'BKE_mesh_calc_normals_poly' with option not to calc vertex normals */
-void BKE_mesh_calc_normals_mapping_ex(MVert *mverts,
-                                      int numVerts,
-                                      const MLoop *mloop,
-                                      const MPoly *mpolys,
-                                      int numLoops,
-                                      int numPolys,
-                                      float (*r_polyNors)[3],
-                                      const MFace *mfaces,
-                                      int numFaces,
-                                      const int *origIndexFace,
-                                      float (*r_faceNors)[3],
-                                      const bool only_face_normals)
-{
-  float(*pnors)[3] = r_polyNors, (*fnors)[3] = r_faceNors;
-
-  if (numPolys == 0) {
-    if (only_face_normals == false) {
-      mesh_calc_normals_vert_fallback(mverts, numVerts);
-    }
-    return;
-  }
-
-  /* if we are not calculating verts and no verts were passes then we have nothing to do */
-  if ((only_face_normals == true) && (r_polyNors == nullptr) && (r_faceNors == nullptr)) {
-    CLOG_WARN(&LOG, "called with nothing to do");
-    return;
-  }
-
-  if (!pnors) {
-    pnors = (float(*)[3])MEM_calloc_arrayN((size_t)numPolys, sizeof(float[3]), __func__);
-  }
-  /* NO NEED TO ALLOC YET */
-  /* if (!fnors) fnors = MEM_calloc_arrayN(numFaces, sizeof(float[3]), "face nors mesh.c"); */
-
-  if (only_face_normals == false) {
-    /* vertex normals are optional, they require some extra calculations,
-     * so make them optional */
-    BKE_mesh_calc_normals_poly(
-        mverts, nullptr, numVerts, mloop, mpolys, numLoops, numPolys, pnors, false);
-  }
-  else {
-    /* only calc poly normals */
-    const MPoly *mp = mpolys;
-    for (int i = 0; i < numPolys; i++, mp++) {
-      BKE_mesh_calc_poly_normal(mp, mloop + mp->loopstart, mverts, pnors[i]);
-    }
-  }
-
-  if (origIndexFace &&
-      /* fnors == r_faceNors */ /* NO NEED TO ALLOC YET */
-          fnors != nullptr &&
-      numFaces) {
-    const MFace *mf = mfaces;
-    for (int i = 0; i < numFaces; i++, mf++, origIndexFace++) {
-      if (*origIndexFace < numPolys) {
-        copy_v3_v3(fnors[i], pnors[*origIndexFace]);
-      }
-      else {
-        /* eek, we're not corresponding to polys */
-        CLOG_ERROR(&LOG, "tessellation face indices are incorrect.  normals may look bad.");
-      }
-    }
-  }
-
-  if (pnors != r_polyNors) {
-    MEM_freeN(pnors);
-  }
-  /* if (fnors != r_faceNors) MEM_freeN(fnors); */ /* NO NEED TO ALLOC YET */
-
-  fnors = pnors = nullptr;
-}
-
-struct MeshCalcNormalsData {
-  const MPoly *mpolys;
-  const MLoop *mloop;
-  MVert *mverts;
-  float (*pnors)[3];
-  float (*vnors)[3];
-};
-
-static void mesh_calc_normals_poly_cb(void *__restrict userdata,
-                                      const int pidx,
-                                      const TaskParallelTLS *__restrict UNUSED(tls))
-{
-  MeshCalcNormalsData *data = (MeshCalcNormalsData *)userdata;
-  const MPoly *mp = &data->mpolys[pidx];
-
-  BKE_mesh_calc_poly_normal(mp, data->mloop + mp->loopstart, data->mverts, data->pnors[pidx]);
-}
-
-static void mesh_calc_normals_poly_and_accum_cb(void *__restrict userdata,
-                                                const int pidx,
-                                                const TaskParallelTLS *__restrict UNUSED(tls))
-{
-  const MeshCalcNormalsData *data = (MeshCalcNormalsData *)userdata;
-  const MPoly *mp = &data->mpolys[pidx];
-  const MLoop *ml = &data->mloop[mp->loopstart];
-  const MVert *mverts = data->mverts;
-  float(*vnors)[3] = data->vnors;
-
-  float pnor_temp[3];
-  float *pnor = data->pnors ? data->pnors[pidx] : pnor_temp;
-
-  const int i_end = mp->totloop - 1;
-
-  /* Polygon Normal and edge-vector */
-  /* inline version of #BKE_mesh_calc_poly_normal, also does edge-vectors */
-  {
-    zero_v3(pnor);
-    /* Newell's M

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list