Blender  V3.3
subd/patch.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2011-2022 Blender Foundation */
3 
4 #ifndef __SUBD_PATCH_H__
5 #define __SUBD_PATCH_H__
6 
7 #include "util/boundbox.h"
8 #include "util/types.h"
9 
11 
12 class Patch {
13  public:
14  Patch() : patch_index(0), shader(0), from_ngon(false)
15  {
16  }
17 
18  virtual ~Patch() = default;
19 
20  virtual void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v) = 0;
21 
23  int shader;
24  bool from_ngon;
25 };
26 
27 /* Linear Quad Patch */
28 
29 class LinearQuadPatch : public Patch {
30  public:
33 
34  void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v);
35  BoundBox bound();
36 };
37 
38 /* Bicubic Patch */
39 
40 class BicubicPatch : public Patch {
41  public:
42  float3 hull[16];
43 
44  void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v);
45  BoundBox bound();
46 };
47 
49 
50 #endif /* __SUBD_PATCH_H__ */
ATTR_WARN_UNUSED_RESULT const BMVert * v
BoundBox bound()
Definition: patch.cpp:98
float3 hull[16]
Definition: subd/patch.h:42
void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v)
Definition: patch.cpp:80
float3 hull[4]
Definition: subd/patch.h:31
BoundBox bound()
Definition: patch.cpp:68
float3 normals[4]
Definition: subd/patch.h:32
void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v)
Definition: patch.cpp:50
int shader
Definition: subd/patch.h:23
bool from_ngon
Definition: subd/patch.h:24
int patch_index
Definition: subd/patch.h:22
Patch()
Definition: subd/patch.h:14
virtual void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v)=0
virtual ~Patch()=default
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
static float P(float k)
Definition: math_interp.c:25
#define N