All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fvarRefinement.h
Go to the documentation of this file.
1 //
2 // Copyright 2014 DreamWorks Animation LLC.
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 #ifndef VTR_FVAR_REFINEMENT_H
25 #define VTR_FVAR_REFINEMENT_H
26 
27 #include "../version.h"
28 
29 #include "../sdc/type.h"
30 #include "../sdc/crease.h"
31 #include "../vtr/types.h"
32 #include "../vtr/refinement.h"
33 #include "../vtr/fvarLevel.h"
34 
35 #include <vector>
36 #include <cassert>
37 #include <cstring>
38 
39 
40 namespace OpenSubdiv {
41 namespace OPENSUBDIV_VERSION {
42 
43 namespace Vtr {
44 
45 //
46 // FVarRefinement:
47 // A face-varying refinement is the subset of face-varying data required to
48 // support a "channel" of face-varying data. Just as Refinement represents a
49 // mapping between a parent and child Level, the face-varying analog represents
50 // a mapping between a parent and child FVarLevel.
51 //
52 // Its looking like this class may not be necessary... Enough information exits
53 // between the pair of FVarLevels and their Levels to do most of what we
54 // want without needing to retain state information within the FVarRefinement as
55 // is essential in Refinement (i.e. the parent-to-child mapping and vice versa).
56 //
57 
59 
60 public:
61  FVarRefinement(Refinement const& refinement, FVarLevel& parent, FVarLevel& child);
63 
64  // Const methods:
65  Refinement const& getRefinement() const { return _refinement; }
66 
67  int getChildValueParentSource(Index vIndex, int sibling) const {
69  }
70 
71  // Modifiers supporting application of the refinement:
72  void applyRefinement();
73 
75  void populateChildValues();
76  int populateChildValuesForEdgeVertex(Index cVert, Index pEdge, int offset);
77  int populateChildValuesForVertexVertex(Index cVert, Index pVert, int offset);
79 
80  void propagateEdgeTags();
81  void propagateValueTags();
82 
83 
84 public:
85  // The Refinement and familiar parent/child levels:
87 
90 
91  // When refinement is sparse, we need a mapping between siblings of a vertex
92  // value in the parent and child -- and for some child values, there will not
93  // be a parent value, in which case the source of the parent component will
94  // be stored. So we refer to the parent "source" rather than "sibling":
95  //
96  std::vector<LocalIndex> _childValueParentSource;
97 
98  //
99  // These members are needed during refine() but currently serve no purpose
100  // after -- so we may not need this class persistent in the refine tables.
101  //
104 };
105 
106 } // end namespace Vtr
107 
108 } // end namespace OPENSUBDIV_VERSION
109 using namespace OPENSUBDIV_VERSION;
110 } // end namespace OpenSubdiv
111 
112 #endif /* VTR_FVAR_REFINEMENT_H */
113 
FVarRefinement(Refinement const &refinement, FVarLevel &parent, FVarLevel &child)
int populateChildValuesForVertexVertex(Index cVert, Index pVert, int offset)
Index getVertexValueIndex(Index vIndex, Sibling sibling=0) const
Definition: fvarLevel.h:371
int populateChildValuesForEdgeVertex(Index cVert, Index pEdge, int offset)
int getChildValueParentSource(Index vIndex, int sibling) const