[Bf-blender-cvs] [47ae1835d23] opensubdiv_compare: OpenSubdiv: Cleanup, move utility function to base type conversion
Sergey Sharybin
noreply at git.blender.org
Tue May 26 11:13:26 CEST 2020
Commit: 47ae1835d234d5c81764807ea9dac566a680dbd0
Author: Sergey Sharybin
Date: Tue May 19 10:52:35 2020 +0200
Branches: opensubdiv_compare
https://developer.blender.org/rB47ae1835d234d5c81764807ea9dac566a680dbd0
OpenSubdiv: Cleanup, move utility function to base type conversion
===================================================================
M intern/opensubdiv/internal/base/type_convert.cc
M intern/opensubdiv/internal/base/type_convert.h
M intern/opensubdiv/internal/topology/topology_refiner_capi.cc
M intern/opensubdiv/internal/topology/topology_refiner_factory.cc
===================================================================
diff --git a/intern/opensubdiv/internal/base/type_convert.cc b/intern/opensubdiv/internal/base/type_convert.cc
index 43412a66f33..08778ab3877 100644
--- a/intern/opensubdiv/internal/base/type_convert.cc
+++ b/intern/opensubdiv/internal/base/type_convert.cc
@@ -86,5 +86,22 @@ OpenSubdiv_FVarLinearInterpolation getCAPIFVarLinearInterpolationFromOSD(
return OSD_FVAR_LINEAR_INTERPOLATION_NONE;
}
+OpenSubdiv::Sdc::Options::VtxBoundaryInterpolation getVtxBoundaryInterpolationFromCAPI(
+ OpenSubdiv_VtxBoundaryInterpolation boundary_interpolation)
+{
+ using OpenSubdiv::Sdc::Options;
+
+ switch (boundary_interpolation) {
+ case OSD_VTX_BOUNDARY_NONE:
+ return Options::VTX_BOUNDARY_NONE;
+ case OSD_VTX_BOUNDARY_EDGE_ONLY:
+ return Options::VTX_BOUNDARY_EDGE_ONLY;
+ case OSD_VTX_BOUNDARY_EDGE_AND_CORNER:
+ return Options::VTX_BOUNDARY_EDGE_AND_CORNER;
+ }
+ assert(!"Unknown veretx boundary interpolation.");
+ return Options::VTX_BOUNDARY_EDGE_ONLY;
+}
+
} // namespace opensubdiv
} // namespace blender
diff --git a/intern/opensubdiv/internal/base/type_convert.h b/intern/opensubdiv/internal/base/type_convert.h
index 52989a4bef9..b0de0d8fc54 100644
--- a/intern/opensubdiv/internal/base/type_convert.h
+++ b/intern/opensubdiv/internal/base/type_convert.h
@@ -26,7 +26,7 @@
#include <opensubdiv/sdc/options.h>
#include <opensubdiv/sdc/types.h>
-#include "opensubdiv_converter_capi.h"
+#include "opensubdiv_capi_type.h"
struct OpenSubdiv_Converter;
@@ -45,6 +45,9 @@ OpenSubdiv::Sdc::Options::FVarLinearInterpolation getFVarLinearInterpolationFrom
OpenSubdiv_FVarLinearInterpolation getCAPIFVarLinearInterpolationFromOSD(
OpenSubdiv::Sdc::Options::FVarLinearInterpolation linear_interpolation);
+OpenSubdiv::Sdc::Options::VtxBoundaryInterpolation getVtxBoundaryInterpolationFromCAPI(
+ OpenSubdiv_VtxBoundaryInterpolation boundary_interpolation);
+
} // namespace opensubdiv
} // namespace blender
diff --git a/intern/opensubdiv/internal/topology/topology_refiner_capi.cc b/intern/opensubdiv/internal/topology/topology_refiner_capi.cc
index 928fe49114e..fbca43065b4 100644
--- a/intern/opensubdiv/internal/topology/topology_refiner_capi.cc
+++ b/intern/opensubdiv/internal/topology/topology_refiner_capi.cc
@@ -23,6 +23,7 @@
#include "internal/base/type_convert.h"
#include "internal/opensubdiv_util.h"
#include "internal/topology/topology_refiner_impl.h"
+#include "opensubdiv_converter_capi.h"
using blender::opensubdiv::vector;
diff --git a/intern/opensubdiv/internal/topology/topology_refiner_factory.cc b/intern/opensubdiv/internal/topology/topology_refiner_factory.cc
index ae97797f214..b35b0cf1f82 100644
--- a/intern/opensubdiv/internal/topology/topology_refiner_factory.cc
+++ b/intern/opensubdiv/internal/topology/topology_refiner_factory.cc
@@ -251,23 +251,6 @@ namespace opensubdiv {
namespace {
-OpenSubdiv::Sdc::Options::VtxBoundaryInterpolation getVtxBoundaryInterpolationFromCAPI(
- OpenSubdiv_VtxBoundaryInterpolation boundary_interpolation)
-{
- using OpenSubdiv::Sdc::Options;
-
- switch (boundary_interpolation) {
- case OSD_VTX_BOUNDARY_NONE:
- return Options::VTX_BOUNDARY_NONE;
- case OSD_VTX_BOUNDARY_EDGE_ONLY:
- return Options::VTX_BOUNDARY_EDGE_ONLY;
- case OSD_VTX_BOUNDARY_EDGE_AND_CORNER:
- return Options::VTX_BOUNDARY_EDGE_AND_CORNER;
- }
- assert(!"Unknown veretx boundary interpolation.");
- return Options::VTX_BOUNDARY_EDGE_ONLY;
-}
-
OpenSubdiv::Sdc::Options getSDCOptions(OpenSubdiv_Converter *converter)
{
using OpenSubdiv::Sdc::Options;
More information about the Bf-blender-cvs
mailing list