All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
stencilTablesFactory.h
Go to the documentation of this file.
1 //
2 // Copyright 2013 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 
25 #ifndef FAR_STENCILTABLE_FACTORY_H
26 #define FAR_STENCILTABLE_FACTORY_H
27 
28 #include "../version.h"
29 
30 #include "../far/kernelBatch.h"
31 
32 namespace OpenSubdiv {
33 namespace OPENSUBDIV_VERSION {
34 
35 namespace Far {
36 
37 class Stencil;
38 class StencilTables;
39 class TopologyRefiner;
40 
47 // XXXX manuelk remap table creation not implemented yet !
48 //
50 
51 public:
52 
53  enum Mode {
56  };
57 
58  struct Options {
59 
61  generateOffsets(false),
62  generateAllLevels(true),
63  sortBySize(false) { }
64 
66  generateOffsets : 1,
67  generateAllLevels : 1,
68  sortBySize : 1;
69  };
70 
82  static StencilTables const * Create(TopologyRefiner const & refiner,
83  Options options = Options());
84 
90  static KernelBatch Create(StencilTables const &stencilTables);
91 
92 private:
93 
94  // Copy a stencil into StencilTables
95  template <class T> static void copyStencil(T const & src, Stencil & dst);
96 
97  // (Sort &) Copy a vector of stencils into StencilTables
98  template <class T> static void copyStencils(std::vector<T> & src,
99  Stencil & dst, bool sortBySize);
100 
101  std::vector<int> _remap;
102 };
103 
104 
105 } // end namespace Far
106 
107 } // end namespace OPENSUBDIV_VERSION
108 using namespace OPENSUBDIV_VERSION;
109 
110 } // end namespace OpenSubdiv
111 
112 #endif // FAR_STENCILTABLE_FACTORY_H
113 
int generateOffsets
populate optional &quot;_offsets&quot; field
A GP Compute Kernel descriptor.
Definition: kernelBatch.h:44
static StencilTables const * Create(TopologyRefiner const &refiner, Options options=Options())
Instantiates StencilTables from TopologyRefiner that have been refined uniformly or adaptively...
Stores topology data for a specified set of refinement options.