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


C++ Geom::GetSurfPtr方法代码示例

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


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

示例1: Update

//==== Update Method ===//
void SSControlSurf::Update()
{
    // Build Control Surface as a rectangle with the points counter clockwise

    vec3d c_uws_upper, c_uws_lower, c_uwe_upper, c_uwe_lower;
    vector< vec3d > pnt_vec;
    double u, w;

    Geom* geom = VehicleMgr.GetVehicle()->FindGeom( m_CompID );
    if ( !geom ) { return; }

    VspSurf* surf = geom->GetSurfPtr();
    if ( !surf ) { return; }

    m_UWStart.clear();
    m_UWEnd.clear();

    VspCurve startcrv;
    surf->GetU01ConstCurve( startcrv, m_UStart() );

    piecewise_curve_type c = startcrv.GetCurve();

    double vmin = c.get_parameter_min(); // Really must be 0.0
    double vmax = c.get_parameter_max(); // Really should be 4.0

    double vle = ( vmin + vmax ) * 0.5;

    double vtelow = vmin + TMAGIC;
    double vteup = vmax - TMAGIC;
    double vlelow = vle - TMAGIC;
    double vleup = vle + TMAGIC;

    curve_point_type te, le;
    te = c.f( vmin );
    le = c.f( vle );

    double chord, d;
    chord = dist( le, te );

    if ( m_AbsRelFlag() == vsp::REL )
    {
        d = chord * m_StartLenFrac();
        m_StartLength.Set( d );
    }
    else
    {
        d = m_StartLength();
        m_StartLenFrac.Set( d / chord );
    }

    if ( m_ConstFlag.Get() )
    {
        if ( m_AbsRelFlag() == vsp::REL )
        {
            m_EndLenFrac.Set( d / chord );
        }
        else
        {
            m_EndLength.Set( d );
        }
    }

    curve_point_type telow, teup;
    telow = c.f( vtelow );
    teup = c.f( vteup );

    curve_point_type lelow, leup;
    lelow = c.f( vlelow );
    leup = c.f( vleup );

    piecewise_curve_type clow, cup;
    c.split( clow, cup, vle );


    double vlow, vup;

    if ( m_SurfType() != LOWER_SURF )
    {
        if ( !m_LEFlag() )
        {
            eli::geom::intersect::specified_distance( vup, cup, teup, d );
        }
        else
        {
            eli::geom::intersect::specified_distance( vup, cup, leup, d );
        }
        c_uws_upper = vec3d( m_UStart(), vup / vmax, 0 );
        m_UWStart.push_back( c_uws_upper );
    }

    if ( m_SurfType() != UPPER_SURF )
    {
        if ( !m_LEFlag() )
        {
            eli::geom::intersect::specified_distance( vlow, clow, telow, d );
        }
        else
        {
            eli::geom::intersect::specified_distance( vlow, clow, lelow, d );
//.........这里部分代码省略.........
开发者ID:cptdime,项目名称:OpenVSP,代码行数:101,代码来源:SubSurface.cpp


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