diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-05-19 11:52:35 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-05-27 13:07:16 +0300 |
commit | be03a756e5f8b691c8b25e52fed63816ca02add1 (patch) | |
tree | 1db47324c95171c53ac7a121d356a5076fc5d8ca /intern | |
parent | 0ff665e4cedc74a81a3b657263a31ac8169a476f (diff) |
OpenSubdiv: Cleanup, move utility function to base type conversion
Diffstat (limited to 'intern')
4 files changed, 22 insertions, 18 deletions
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; |