Blender V4.3
VertexRep.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
12#include "Rep.h"
13
14namespace Freestyle {
15
16class VertexRep : public Rep {
17 public:
18 inline VertexRep() : Rep()
19 {
20 _vid = 0;
21 _PointSize = 0.0f;
22 }
23
24 inline VertexRep(real x, real y, real z, int id = 0) : Rep()
25 {
26 _coordinates[0] = x;
27 _coordinates[1] = y;
28 _coordinates[2] = z;
29
30 _vid = id;
31 _PointSize = 0.0f;
32 }
33
34 inline ~VertexRep() {}
35
37 virtual void accept(SceneVisitor &v)
38 {
40 v.visitVertexRep(*this);
41 }
42
44 virtual void ComputeBBox();
45
47 inline const int vid() const
48 {
49 return _vid;
50 }
51
52 inline const real *coordinates() const
53 {
54 return _coordinates;
55 }
56
57 inline real x() const
58 {
59 return _coordinates[0];
60 }
61
62 inline real y() const
63 {
64 return _coordinates[1];
65 }
66
67 inline real z() const
68 {
69 return _coordinates[2];
70 }
71
72 inline float pointSize() const
73 {
74 return _PointSize;
75 }
76
78 inline void setVid(int id)
79 {
80 _vid = id;
81 }
82
83 inline void setX(real x)
84 {
85 _coordinates[0] = x;
86 }
87
88 inline void setY(real y)
89 {
90 _coordinates[1] = y;
91 }
92
93 inline void setZ(real z)
94 {
95 _coordinates[2] = z;
96 }
97
98 inline void setCoordinates(real x, real y, real z)
99 {
100 _coordinates[0] = x;
101 _coordinates[1] = y;
102 _coordinates[2] = z;
103 }
104
105 inline void setPointSize(float iPointSize)
106 {
107 _PointSize = iPointSize;
108 }
109
110 private:
111 int _vid; // vertex id
112 real _coordinates[3];
113 float _PointSize;
114};
115
116} /* namespace Freestyle */
Base class for all shapes. Inherits from BasicObjects for references counter management (addRef,...
ATTR_WARN_UNUSED_RESULT const BMVert * v
virtual void accept(SceneVisitor &v)
Definition Rep.h:96
virtual void accept(SceneVisitor &v)
Definition VertexRep.h:37
void setX(real x)
Definition VertexRep.h:83
real x() const
Definition VertexRep.h:57
void setY(real y)
Definition VertexRep.h:88
const real * coordinates() const
Definition VertexRep.h:52
virtual void ComputeBBox()
Definition VertexRep.cpp:14
void setVid(int id)
Definition VertexRep.h:78
void setPointSize(float iPointSize)
Definition VertexRep.h:105
void setCoordinates(real x, real y, real z)
Definition VertexRep.h:98
float pointSize() const
Definition VertexRep.h:72
void setZ(real z)
Definition VertexRep.h:93
real y() const
Definition VertexRep.h:62
VertexRep(real x, real y, real z, int id=0)
Definition VertexRep.h:24
const int vid() const
Definition VertexRep.h:47
real z() const
Definition VertexRep.h:67
inherits from class Rep
Definition AppCanvas.cpp:20
double real
Definition Precision.h:14