• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ STEPattribute类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中STEPattribute的典型用法代码示例。如果您正苦于以下问题:C++ STEPattribute类的具体用法?C++ STEPattribute怎么用?C++ STEPattribute使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: while

LIST_OF_SELECTS *
STEPWrapper::getListOfSelects(SDAI_Application_instance *sse, const char *name)
{
    LIST_OF_SELECTS *l = new LIST_OF_SELECTS;
    std::string attrval;

    sse->ResetAttributes();
    STEPattribute *attr;

    while ((attr = sse->NextAttribute()) != NULL) {
	std::string attrname = attr->Name();

	if (attrname.compare(name) == 0) {

	    SelectAggregate *sa = (SelectAggregate *)attr->ptr.a;
	    SelectNode *sn = (SelectNode *)sa->GetHead();
	    while (sn) {
		l->push_back(sn->node);
		sn = (SelectNode *)sn->NextNode();
	    }
	    break;
	}
    }

    return l;
}
开发者ID:kanzure,项目名称:brlcad,代码行数:26,代码来源:STEPWrapper.cpp


示例2: Create_Rational_Surface_Aggregate

STEPentity *
Create_Rational_Surface_Aggregate(ON_NurbsSurface *nsurface, ON_Brep_Info_AP203 *info) {
    STEPattribute *attr;
    STEPcomplex *stepcomplex;
    const char *entNmArr[8] = {"bounded_surface", "b_spline_surface", "b_spline_surface_with_knots",
	"surface", "geometric_representation_item", "rational_b_spline_surface", "representation_item", "*"};
    STEPcomplex *complex_entity = new STEPcomplex(info->registry, (const char **)entNmArr, info->registry->GetEntityCnt() + 1);
/*
    stepcomplex = complex_entity->head;
    stepcomplex->ResetAttributes();
    while (stepcomplex) {
	std::cout << stepcomplex->EntityName() << "\n";
	while ((attr = stepcomplex->NextAttribute()) != NULL) {
	    std::cout << "  " << attr->Name() << "," << attr->NonRefType() << "\n";
	}
	stepcomplex = stepcomplex->sc;
	stepcomplex->ResetAttributes();
    }
*/
    /* Set b_spline_surface data */
    stepcomplex = complex_entity->EntityPart("b_spline_surface");
    stepcomplex->ResetAttributes();
    while ((attr = stepcomplex->NextAttribute()) != NULL) {
	if (!bu_strcmp(attr->Name(), "u_degree")) attr->ptr.i = new SDAI_Integer(nsurface->Degree(0));
	if (!bu_strcmp(attr->Name(), "v_degree")) attr->ptr.i = new SDAI_Integer(nsurface->Degree(1));

	if (!bu_strcmp(attr->Name(), "control_points_list")) {
	    GenericAggregate *control_pnts= new GenericAggregate();
	    ON_NurbsSurfaceCV_Initialize(nsurface, complex_entity, info);
	    attr->ptr.a = control_pnts;
	    info->surf_genagg[(STEPentity*)complex_entity] = control_pnts;
	}
	if (!bu_strcmp(attr->Name(), "surface_form")) attr->ptr.e = new SdaiB_spline_surface_form_var(B_spline_surface_form__unspecified);
	if (!bu_strcmp(attr->Name(), "u_closed")) attr->ptr.e = new SDAI_LOGICAL((Logical)(nsurface->IsClosed(0)));
	if (!bu_strcmp(attr->Name(), "v_closed")) attr->ptr.e = new SDAI_LOGICAL((Logical)(nsurface->IsClosed(1)));
	if (!bu_strcmp(attr->Name(), "self_intersect")) attr->ptr.e = new SDAI_LOGICAL(LFalse);
    }

    /* Set knots */
    stepcomplex = complex_entity->EntityPart("b_spline_surface_with_knots");
    stepcomplex->ResetAttributes();
    IntAggregate *u_multiplicities = new IntAggregate();
    IntAggregate *v_multiplicities = new IntAggregate();
    RealAggregate *u_knots = new RealAggregate();
    RealAggregate *v_knots = new RealAggregate();

    ON_NurbsSurfaceKnots_to_Aggregates(u_multiplicities, v_multiplicities, u_knots, v_knots, nsurface);

    while ((attr = stepcomplex->NextAttribute()) != NULL) {

	if (!bu_strcmp(attr->Name(), "u_multiplicities")) attr->ptr.a = u_multiplicities;
	if (!bu_strcmp(attr->Name(), "v_multiplicities")) attr->ptr.a = v_multiplicities;

	if (!bu_strcmp(attr->Name(), "u_knots")) attr->ptr.a = u_knots;
	if (!bu_strcmp(attr->Name(), "v_knots")) attr->ptr.a = v_knots;

	if (!bu_strcmp(attr->Name(), "knot_spec")) attr->ptr.e = new SdaiKnot_type_var(Knot_type__unspecified);
    }

    /* Set weights */
    stepcomplex = complex_entity->EntityPart("rational_b_spline_surface");
    stepcomplex->ResetAttributes();
    while ((attr = stepcomplex->NextAttribute()) != NULL) {
	if (!bu_strcmp(attr->Name(), "weights_data")) {
	    GenericAggregate *weights = new GenericAggregate();
	    for (int i = 0; i < nsurface->CVCount(0); i++) {
		std::ostringstream ss;
		ss << "(";
		for (int j = 0; j < nsurface->CVCount(1); j++) {
		    if (j != 0) ss << ", ";
		    ss << nsurface->Weight(i,j);
		}
		ss << ")";
		std::string str = ss.str();
		weights->AddNode(new GenericAggrNode(str.c_str()));

	    }
	    attr->ptr.a = weights;
	}
    }

    /* Representation item */
    stepcomplex = complex_entity->EntityPart("representation_item");
    stepcomplex->ResetAttributes();
    while ((attr = stepcomplex->NextAttribute()) != NULL) {
	//std::cout << "  " << attr->Name() << "," << attr->NonRefType() << "\n";
	if (!bu_strcmp(attr->Name(), "name")) attr->StrToVal("''");
    }

    return (STEPentity *)complex_entity;
}
开发者ID:behollis,项目名称:brlcad-svn-rev65072-gsoc2015,代码行数:91,代码来源:ON_NurbsSurface.cpp


示例3: switch

STEPcomplex * STEPutil::Geometric_Context( const LenEnum & len, const AngEnum & angle, const char * tolstr )
{
    int instance_cnt = 0;
    STEPattribute * attr;
    STEPcomplex * stepcomplex;

    SdaiDimensional_exponents * dimensional_exp = new SdaiDimensional_exponents();
    dimensional_exp->length_exponent_( 0.0 );
    dimensional_exp->mass_exponent_( 0.0 );
    dimensional_exp->time_exponent_( 0.0 );
    dimensional_exp->electric_current_exponent_( 0.0 );
    dimensional_exp->thermodynamic_temperature_exponent_( 0.0 );
    dimensional_exp->amount_of_substance_exponent_( 0.0 );
    dimensional_exp->luminous_intensity_exponent_( 0.0 );
    instance_list->Append( ( SDAI_Application_instance * ) dimensional_exp, completeSE );
    instance_cnt++;

    STEPcomplex * ua_length;
    // First set up metric units if appropriate.  Default to mm.
    // If imperial units, set up mm to be used as base to define imperial units.
    Si_prefix pfx = Si_prefix__milli;
    switch( len )
    {
    case u_CM:
        pfx = Si_prefix__centi;
        break;
    case u_M:
        pfx = Si_prefix_unset;
        break;
    case u_MM:
    case u_IN:
    case u_FT:
    case u_YD:
        break;
    }

    const char * ua_length_types[4] = { "length_unit", "named_unit", "si_unit", "*" };
    ua_length = new STEPcomplex( registry, ( const char ** ) ua_length_types, instance_cnt );
    stepcomplex = ua_length->head;
    while( stepcomplex )
    {
        if( !strcmp( stepcomplex->EntityName(), "Si_Unit" ) )
        {
            stepcomplex->ResetAttributes();
            while( ( attr = stepcomplex->NextAttribute() ) != NULL )
            {
                if( !strcmp( attr->Name(), "prefix" ) )
                {
                    attr->Raw()->e = new SdaiSi_prefix_var( pfx );
                }
                if( !strcmp( attr->Name(), "name" ) )
                {
                    attr->Raw()->e = new SdaiSi_unit_name_var( Si_unit_name__metre );
                }
            }
        }
        stepcomplex = stepcomplex->sc;
    }
    instance_list->Append( ( SDAI_Application_instance * ) ua_length, completeSE );
    instance_cnt++;

    // If imperial, create conversion based unit.
    if( len >= u_IN )
    {
        STEPcomplex * len_mm = ua_length;

        char lenname[10];
        lenname[0] = '\0';
        double lenconv;

        switch( len )
        {
        case u_IN:
            strcat( lenname, "'INCH'\0" );
            lenconv = 25.4;
            break;
        case u_FT:
            strcat( lenname, "'FOOT'\0" );
            lenconv = 25.4 * 12.0;
            break;
        case u_YD:
            strcat( lenname, "'YARD'\0" );
            lenconv = 25.4 * 36.0;
            break;
        case u_MM:
        case u_CM:
        case u_M:
            break;
        }

        SdaiUnit * len_unit = new SdaiUnit( ( SdaiNamed_unit * ) len_mm );

        SdaiMeasure_value * len_measure_value = new SdaiMeasure_value( lenconv, config_control_design::t_measure_value );
        len_measure_value->SetUnderlyingType( config_control_design::t_length_measure );

        SdaiLength_measure_with_unit * len_measure_with_unit = new SdaiLength_measure_with_unit();
        len_measure_with_unit->value_component_( len_measure_value );
        len_measure_with_unit->unit_component_( len_unit );
        instance_list->Append( ( SDAI_Application_instance * ) len_measure_with_unit, completeSE );
        instance_cnt++;
//.........这里部分代码省略.........
开发者ID:aeromedia,项目名称:OpenVSP,代码行数:101,代码来源:STEPutil.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ STKPeer类代码示例发布时间:2022-05-31
下一篇:
C++ STAmount类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap