Blender  V3.3
TriangleRep.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
11 #include "Rep.h"
12 
13 namespace Freestyle {
14 
16 class TriangleRep : public Rep {
17  public:
22  };
23 
24  private:
25  TRIANGLE_STYLE _Style;
26  Vec3r _vertices[3];
27  Vec3r _colors[3];
28 
29  public:
30  inline TriangleRep() : Rep()
31  {
32  _Style = FILL;
33  }
34 
43  inline TriangleRep(const Vec3r &v0, const Vec3r &v1, const Vec3r &v2) : Rep()
44  {
45  _vertices[0] = v0;
46  _vertices[1] = v1;
47  _vertices[2] = v2;
48  _Style = FILL;
49  }
50 
51  inline TriangleRep(const Vec3r &v0,
52  const Vec3r &c0,
53  const Vec3r &v1,
54  const Vec3r &c1,
55  const Vec3r &v2,
56  const Vec3r &c2)
57  : Rep()
58  {
59  _vertices[0] = v0;
60  _vertices[1] = v1;
61  _vertices[2] = v2;
62  _colors[0] = c0;
63  _colors[1] = c1;
64  _colors[2] = c2;
65  _Style = FILL;
66  }
67 
68  virtual ~TriangleRep()
69  {
70  }
71 
73  inline const TRIANGLE_STYLE style() const
74  {
75  return _Style;
76  }
77 
78  inline const Vec3r &vertex(int index) const
79  {
80  return _vertices[index];
81  }
82 
83  inline const Vec3r &color(int index) const
84  {
85  return _colors[index];
86  }
87 
89  inline void setStyle(const TRIANGLE_STYLE iStyle)
90  {
91  _Style = iStyle;
92  }
93 
94  inline void setVertex(int index, const Vec3r &iVertex)
95  {
96  _vertices[index] = iVertex;
97  }
98 
99  inline void setColor(int index, const Vec3r &iColor)
100  {
101  _colors[index] = iColor;
102  }
103 
104  inline void setVertices(const Vec3r &v0, const Vec3r &v1, const Vec3r &v2)
105  {
106  _vertices[0] = v0;
107  _vertices[1] = v1;
108  _vertices[2] = v2;
109  }
110 
111  inline void setColors(const Vec3r &c0, const Vec3r &c1, const Vec3r &c2)
112  {
113  _colors[0] = c0;
114  _colors[1] = c1;
115  _colors[2] = c2;
116  }
117 
119  virtual void accept(SceneVisitor &v)
120  {
121  Rep::accept(v);
122  v.visitTriangleRep(*this);
123  }
124 
126  virtual void ComputeBBox();
127 };
128 
129 } /* namespace Freestyle */
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Base class for all shapes. Inherits from BasicObjects for references counter management (addRef,...
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert * v
virtual void accept(SceneVisitor &v)
Definition: Rep.h:94
void setColor(int index, const Vec3r &iColor)
Definition: TriangleRep.h:99
const Vec3r & vertex(int index) const
Definition: TriangleRep.h:78
TriangleRep(const Vec3r &v0, const Vec3r &v1, const Vec3r &v2)
Definition: TriangleRep.h:43
void setStyle(const TRIANGLE_STYLE iStyle)
Definition: TriangleRep.h:89
TriangleRep(const Vec3r &v0, const Vec3r &c0, const Vec3r &v1, const Vec3r &c1, const Vec3r &v2, const Vec3r &c2)
Definition: TriangleRep.h:51
virtual void ComputeBBox()
Definition: TriangleRep.cpp:12
const TRIANGLE_STYLE style() const
Definition: TriangleRep.h:73
void setColors(const Vec3r &c0, const Vec3r &c1, const Vec3r &c2)
Definition: TriangleRep.h:111
void setVertices(const Vec3r &v0, const Vec3r &v1, const Vec3r &v2)
Definition: TriangleRep.h:104
virtual void accept(SceneVisitor &v)
Definition: TriangleRep.h:119
const Vec3r & color(int index) const
Definition: TriangleRep.h:83
void setVertex(int index, const Vec3r &iVertex)
Definition: TriangleRep.h:94
inherits from class Rep
Definition: AppCanvas.cpp:18