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