Blender V5.0
patch.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#pragma once
6
7#include "util/boundbox.h"
8#include "util/types.h"
9
11
12class Patch {
13 public:
14 Patch() = default;
15 virtual ~Patch() = default;
16
17 virtual void eval(
18 float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, const float u, float v) const = 0;
19
20 int patch_index = 0;
21 int shader = 0;
22 bool smooth = true;
23 bool from_ngon = false;
24};
25
26/* Linear Quad Patch */
27
28class LinearQuadPatch final : public Patch {
29 public:
31
32 void eval(
33 float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, const float u, float v) const override;
35};
36
37/* Bicubic Patch */
38
39class BicubicPatch final : public Patch {
40 public:
42
43 void eval(
44 float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, const float u, float v) const override;
46};
47
#define final(a, b, c)
Definition BLI_hash.h:19
ATTR_WARN_UNUSED_RESULT const BMVert * v
BoundBox bound()
Definition patch.cpp:108
float3 hull[16]
Definition patch.h:41
void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, const float u, float v) const override
Definition patch.cpp:88
float3 hull[4]
Definition patch.h:30
void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, const float u, float v) const override
Definition patch.cpp:52
BoundBox bound()
Definition patch.cpp:75
virtual void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, const float u, float v) const =0
int shader
Definition patch.h:21
bool smooth
Definition patch.h:22
bool from_ngon
Definition patch.h:23
int patch_index
Definition patch.h:20
virtual ~Patch()=default
Patch()=default
#define CCL_NAMESPACE_END
#define N