Blender  V3.3
COM_ChunkOrder.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2011 Blender Foundation. */
3 
4 #include <cfloat>
5 
6 #include "COM_ChunkOrder.h"
7 
8 namespace blender::compositor {
9 
10 void ChunkOrder::update_distance(ChunkOrderHotspot *hotspots, unsigned int len_hotspots)
11 {
12  double new_distance = DBL_MAX;
13  for (int index = 0; index < len_hotspots; index++) {
14  double distance_to_hotspot = hotspots[index].calc_distance(x, y);
15  if (distance_to_hotspot < new_distance) {
16  new_distance = distance_to_hotspot;
17  }
18  }
19  this->distance = new_distance;
20 }
21 
22 bool operator<(const ChunkOrder &a, const ChunkOrder &b)
23 {
24  return a.distance < b.distance;
25 }
26 
27 } // namespace blender::compositor
static unsigned a[3]
Definition: RandGen.cpp:78
bool operator<(const ChunkOrder &a, const ChunkOrder &b)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void update_distance(ChunkOrderHotspot *hotspots, unsigned int len_hotspots)