Blender  V2.93
subd_patch_table.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2016 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_TABLE_H__
18 #define __SUBD_PATCH_TABLE_H__
19 
20 #include "util/util_array.h"
21 #include "util/util_types.h"
22 
23 #ifdef WITH_OPENSUBDIV
24 # ifdef _MSC_VER
25 # include "iso646.h"
26 # endif
27 
28 # include <opensubdiv/far/patchTable.h>
29 #endif
30 
32 
33 #ifdef WITH_OPENSUBDIV
34 using namespace OpenSubdiv;
35 #else
36 /* forward declare for when OpenSubdiv is unavailable */
37 namespace Far {
38 struct PatchTable;
39 }
40 #endif
41 
42 #define PATCH_ARRAY_SIZE 4
43 #define PATCH_PARAM_SIZE 2
44 #define PATCH_HANDLE_SIZE 3
45 #define PATCH_NODE_SIZE 1
46 
49 
50  size_t num_arrays;
51  size_t num_indices;
52  size_t num_patches;
53  size_t num_nodes;
54 
55  /* calculated size from num_* members */
56  size_t total_size();
57 
58  void pack(Far::PatchTable *patch_table, int offset = 0);
59  void copy_adjusting_offsets(uint *dest, int doffset);
60 };
61 
63 
64 #endif /* __SUBD_PATCH_TABLE_H__ */
unsigned int uint
Definition: BLI_sys_types.h:83
#define CCL_NAMESPACE_END
array< uint > table