Blender  V3.3
LineRep.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
8 #include "LineRep.h"
9 
10 namespace Freestyle {
11 
13 {
14  real XMax = _vertices.front()[0];
15  real YMax = _vertices.front()[1];
16  real ZMax = _vertices.front()[2];
17 
18  real XMin = _vertices.front()[0];
19  real YMin = _vertices.front()[1];
20  real ZMin = _vertices.front()[2];
21 
22  // parse all the coordinates to find
23  // the XMax, YMax, ZMax
24  vector<Vec3r>::iterator v;
25  for (v = _vertices.begin(); v != _vertices.end(); ++v) {
26  // X
27  if ((*v)[0] > XMax) {
28  XMax = (*v)[0];
29  }
30  if ((*v)[0] < XMin) {
31  XMin = (*v)[0];
32  }
33 
34  // Y
35  if ((*v)[1] > YMax) {
36  YMax = (*v)[1];
37  }
38  if ((*v)[1] < YMin) {
39  YMin = (*v)[1];
40  }
41 
42  // Z
43  if ((*v)[2] > ZMax) {
44  ZMax = (*v)[2];
45  }
46  if ((*v)[2] < ZMin) {
47  ZMin = (*v)[2];
48  }
49  }
50 
51  setBBox(BBox<Vec3r>(Vec3r(XMin, YMin, ZMin), Vec3r(XMax, YMax, ZMax)));
52 }
53 
54 } /* namespace Freestyle */
Class to define the representation of 3D Line.
ATTR_WARN_UNUSED_RESULT const BMVert * v
virtual void ComputeBBox()
Definition: LineRep.cpp:12
virtual void setBBox(const BBox< Vec3f > &iBox)
Definition: Rep.h:135
VecMat::Vec3< real > Vec3r
Definition: Geom.h:28
inherits from class Rep
Definition: AppCanvas.cpp:18
double real
Definition: Precision.h:12