All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
triRefinement.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_TRI_REFINEMENT_H
25 #define VTR_TRI_REFINEMENT_H
26 
27 #include "../version.h"
28 
29 #include "../vtr/refinement.h"
30 
31 
32 namespace OpenSubdiv {
33 namespace OPENSUBDIV_VERSION {
34 
35 namespace Vtr {
36 
37 //
38 // TriRefinement:
39 // A TriRefinement is a subclass of Refinement that splits all faces into tris.
40 // It provides the configuration of parent-to-child components and the population of
41 // all required topological relations in order to complete a valid Refinement.
42 //
43 class TriRefinement : public Refinement {
44 
45 public:
46  TriRefinement(Level const & parent, Level & child, Sdc::Options const & options);
48 
49 protected:
50  //
51  // Virtual methods to complete the configuration of the parent-to-child mapping:
52  //
53  virtual void allocateParentChildIndices();
54 
55  virtual void markSparseFaceChildren();
56 
57  //
58  // Virtual methods to populate the six topological relations:
59  //
60  virtual void populateFaceVertexRelation();
61  virtual void populateFaceEdgeRelation();
62  virtual void populateEdgeVertexRelation();
63  virtual void populateEdgeFaceRelation();
64  virtual void populateVertexFaceRelation();
65  virtual void populateVertexEdgeRelation();
66 
67  //
68  // Internal helper methods for populating the topology -- a few of these are
69  // identical to what is used for quad-splitting, so we may move them to the
70  // base class...
71  //
74 
76 
79 
82 
85 
88 
89 private:
90  //
91  // Unlike the quad-split, which can some vectors with the parent Level since
92  // child components correspond to face-vertices, the tri-split must define its
93  // own local vectors to identify the children for each parent component -- to
94  // be referenced within the base class for more immediate/inline access:
95  //
96  IndexVector _localFaceChildFaceCountsAndOffsets;
97 };
98 
99 } // end namespace Vtr
100 
101 } // end namespace OPENSUBDIV_VERSION
102 using namespace OPENSUBDIV_VERSION;
103 } // end namespace OpenSubdiv
104 
105 #endif /* VTR_REFINEMENT_H */
106 
TriRefinement(Level const &parent, Level &child, Sdc::Options const &options)
std::vector< Index > IndexVector
Definition: types.h:70