当前位置: 首页>>代码示例>>C++>>正文


C++ Chart::unifiedMesh方法代码示例

本文整理汇总了C++中Chart::unifiedMesh方法的典型用法代码示例。如果您正苦于以下问题:C++ Chart::unifiedMesh方法的具体用法?C++ Chart::unifiedMesh怎么用?C++ Chart::unifiedMesh使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Chart的用法示例。


在下文中一共展示了Chart::unifiedMesh方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: parameterizeCharts

void Atlas::parameterizeCharts()
{
    ParameterizationQuality globalParameterizationQuality;

    // Paramterize the charts.
    uint diskCount = 0;
    const uint chartCount = m_chartArray.count();
    for (uint i = 0; i < chartCount; i++)\
    {
        Chart * chart = m_chartArray[i];

        bool isValid = false;

        if (chart->isDisk())
        {
            diskCount++;

            ParameterizationQuality chartParameterizationQuality;

            if (chart->faceCount() == 1) {
                computeSingleFaceMap(chart->unifiedMesh());

                chartParameterizationQuality = ParameterizationQuality(chart->unifiedMesh());
            }
            else {
                computeOrthogonalProjectionMap(chart->unifiedMesh());
                ParameterizationQuality orthogonalQuality(chart->unifiedMesh());

                computeLeastSquaresConformalMap(chart->unifiedMesh());
                ParameterizationQuality lscmQuality(chart->unifiedMesh());
                
                // If the orthogonal projection produces better results, just use that. @@ Make sure the orthogonal map is valid has no overlaps.
                /*if (orthogonalQuality.rmsStretchMetric() < lscmQuality.rmsStretchMetric()) {
                    computeOrthogonalProjectionMap(chart->unifiedMesh());
                    chartParameterizationQuality = orthogonalQuality;
                }
                else*/ {
                    chartParameterizationQuality = lscmQuality;
                }

                // If conformal map failed, 

                // @@ Experiment with other parameterization methods.
                //computeCircularBoundaryMap(chart->unifiedMesh());
                //computeConformalMap(chart->unifiedMesh());
                //computeNaturalConformalMap(chart->unifiedMesh());
                //computeGuidanceGradientMap(chart->unifiedMesh());
            }

            //ParameterizationQuality chartParameterizationQuality(chart->unifiedMesh());

            isValid = chartParameterizationQuality.isValid();

            if (!isValid)
            {
                nvDebug("*** Invalid parameterization.\n");
#if 0
                // Dump mesh to inspect problem:
                static int pieceCount = 0;
            
                StringBuilder fileName;
                fileName.format("invalid_chart_%d.obj", pieceCount++);
                exportMesh(chart->unifiedMesh(), fileName.str()); 
#endif
            }

            // @@ Check that parameterization quality is above a certain threshold.

            // @@ Detect boundary self-intersections.

            globalParameterizationQuality += chartParameterizationQuality;
        }

        if (!isValid)
        {
            //nvDebugBreak();
            // @@ Run the builder again, but only on this chart.
            //AtlasBuilder builder(chart->chartMesh());
        }

        // Transfer parameterization from unified mesh to chart mesh.
        chart->transferParameterization();

    }

    nvDebug("  Parameterized %d/%d charts.\n", diskCount, chartCount);
    nvDebug("  RMS stretch metric: %f\n", globalParameterizationQuality.rmsStretchMetric());
    nvDebug("  MAX stretch metric: %f\n", globalParameterizationQuality.maxStretchMetric());
    nvDebug("  RMS conformal metric: %f\n", globalParameterizationQuality.rmsConformalMetric());
    nvDebug("  RMS authalic metric: %f\n", globalParameterizationQuality.maxAuthalicMetric());
}
开发者ID:maleiwhat,项目名称:thekla_atlas,代码行数:91,代码来源:Atlas.cpp


注:本文中的Chart::unifiedMesh方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。