Blender  V3.3
topology_refiner_impl.h
Go to the documentation of this file.
1 // Copyright 2016 Blender Foundation. All rights reserved.
2 //
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License
5 // as published by the Free Software Foundation; either version 2
6 // of the License, or (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software Foundation,
15 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 //
17 // Author: Sergey Sharybin
18 
19 #ifndef OPENSUBDIV_TOPOLOGY_REFINER_IMPL_H_
20 #define OPENSUBDIV_TOPOLOGY_REFINER_IMPL_H_
21 
22 #ifdef _MSC_VER
23 # include <iso646.h>
24 #endif
25 
26 #include <opensubdiv/far/topologyRefiner.h>
27 
28 #include "internal/base/memory.h"
31 
33 
34 namespace blender {
35 namespace opensubdiv {
36 
38  public:
39  // NOTE: Will return nullptr if topology refiner can not be created (for
40  // example, when topology is detected to be corrupted or invalid).
43 
46 
47  // Check whether this topology refiner defines same topology as the given
48  // converter.
49  // Covers options, geometry, and geometry tags.
50  bool isEqualToConverter(const OpenSubdiv_Converter *converter) const;
51 
52  OpenSubdiv::Far::TopologyRefiner *topology_refiner;
53 
54  // Subdivision settingsa this refiner is created for.
56 
57  // Topology of the mesh which corresponds to the base level.
58  //
59  // All the indices and values are kept exactly the same as user-defined
60  // converter provided them. This allows to easily compare values which might
61  // be touched by the refinement process.
62  //
63  // On a more technical note this allows to easier/faster to compare following
64  // things:
65  //
66  // - Face vertices, where OpenSubdiv could re-arrange them to keep winding
67  // uniform.
68  //
69  // - Vertex crease where OpenSubdiv will force crease for non-manifold or
70  // corner vertices.
72 
73  MEM_CXX_CLASS_ALLOC_FUNCS("TopologyRefinerImpl");
74 };
75 
76 } // namespace opensubdiv
77 } // namespace blender
78 
80 };
81 
82 #endif // OPENSUBDIV_TOPOLOGY_REFINER_IMPL_H_
MEM_CXX_CLASS_ALLOC_FUNCS("TopologyRefinerImpl")
OpenSubdiv::Far::TopologyRefiner * topology_refiner
OpenSubdiv_TopologyRefinerSettings settings
static TopologyRefinerImpl * createFromConverter(OpenSubdiv_Converter *converter, const OpenSubdiv_TopologyRefinerSettings &settings)
bool isEqualToConverter(const OpenSubdiv_Converter *converter) const