Blender
V2.93
intern
cycles
subd
subd_patch.h
Go to the documentation of this file.
1
/*
2
* Copyright 2011-2013 Blender Foundation
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#ifndef __SUBD_PATCH_H__
18
#define __SUBD_PATCH_H__
19
20
#include "
util/util_boundbox.h
"
21
#include "
util/util_types.h
"
22
23
CCL_NAMESPACE_BEGIN
24
25
class
Patch
{
26
public
:
27
Patch
() :
patch_index
(0),
shader
(0),
from_ngon
(false)
28
{
29
}
30
31
virtual
~Patch
() =
default
;
32
33
virtual
void
eval
(
float3
*
P
,
float3
*dPdu,
float3
*dPdv,
float3
*
N
,
float
u,
float
v
) = 0;
34
35
int
patch_index
;
36
int
shader
;
37
bool
from_ngon
;
38
};
39
40
/* Linear Quad Patch */
41
42
class
LinearQuadPatch
:
public
Patch
{
43
public
:
44
float3
hull
[4];
45
float3
normals
[4];
46
47
void
eval
(
float3
*
P
,
float3
*dPdu,
float3
*dPdv,
float3
*
N
,
float
u,
float
v
);
48
BoundBox
bound
();
49
};
50
51
/* Bicubic Patch */
52
53
class
BicubicPatch
:
public
Patch
{
54
public
:
55
float3
hull
[16];
56
57
void
eval
(
float3
*
P
,
float3
*dPdu,
float3
*dPdv,
float3
*
N
,
float
u,
float
v
);
58
BoundBox
bound
();
59
};
60
61
CCL_NAMESPACE_END
62
63
#endif
/* __SUBD_PATCH_H__ */
v
ATTR_WARN_UNUSED_RESULT const BMVert * v
Definition:
bmesh_query_inline.h:29
BicubicPatch
Definition:
subd_patch.h:53
BicubicPatch::bound
BoundBox bound()
Definition:
subd_patch.cpp:111
BicubicPatch::hull
float3 hull[16]
Definition:
subd_patch.h:55
BicubicPatch::eval
void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v)
Definition:
subd_patch.cpp:93
LinearQuadPatch
Definition:
subd_patch.h:42
LinearQuadPatch::hull
float3 hull[4]
Definition:
subd_patch.h:44
LinearQuadPatch::bound
BoundBox bound()
Definition:
subd_patch.cpp:81
LinearQuadPatch::normals
float3 normals[4]
Definition:
subd_patch.h:45
LinearQuadPatch::eval
void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v)
Definition:
subd_patch.cpp:63
Patch
Definition:
subd_patch.h:25
Patch::shader
int shader
Definition:
subd_patch.h:36
Patch::from_ngon
bool from_ngon
Definition:
subd_patch.h:37
Patch::patch_index
int patch_index
Definition:
subd_patch.h:35
Patch::Patch
Patch()
Definition:
subd_patch.h:27
Patch::eval
virtual void eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v)=0
Patch::~Patch
virtual ~Patch()=default
CCL_NAMESPACE_END
#define CCL_NAMESPACE_END
Definition:
kernel_compat_cuda.h:23
P
static float P(float k)
Definition:
math_interp.c:41
CCL_NAMESPACE_BEGIN
Definition:
blender_python.cpp:54
N
params N
Definition:
osl_closures.cpp:106
BoundBox
Definition:
DNA_object_types.h:104
float3
Definition:
sky_float3.h:34
util_boundbox.h
util_types.h
Generated on Tue Jan 31 2023 14:37:24 for Blender by
doxygen
1.9.1