Blender  V3.3
VertexRep.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
10 #include "Rep.h"
11 
12 namespace Freestyle {
13 
14 class VertexRep : public Rep {
15  public:
16  inline VertexRep() : Rep()
17  {
18  _vid = 0;
19  _PointSize = 0.0f;
20  }
21 
22  inline VertexRep(real x, real y, real z, int id = 0) : Rep()
23  {
24  _coordinates[0] = x;
25  _coordinates[1] = y;
26  _coordinates[2] = z;
27 
28  _vid = id;
29  _PointSize = 0.0f;
30  }
31 
32  inline ~VertexRep()
33  {
34  }
35 
37  virtual void accept(SceneVisitor &v)
38  {
39  Rep::accept(v);
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:94
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:12
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:22
const int vid() const
Definition: VertexRep.h:47
real z() const
Definition: VertexRep.h:67
inherits from class Rep
Definition: AppCanvas.cpp:18
double real
Definition: Precision.h:12