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


C++ STEPattribute::StrToVal方法代码示例

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


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

示例1: switch


//.........这里部分代码省略.........

        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++;

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

        const char * ua_conv_len_types[4] = { "conversion_based_unit", "named_unit", "length_unit", "*" };
        ua_length = new STEPcomplex( registry, ( const char ** ) ua_conv_len_types, instance_cnt );
        stepcomplex = ua_length->head;
        while( stepcomplex )
        {
            if( !strcmp( stepcomplex->EntityName(), "Conversion_Based_Unit" ) )
            {
                stepcomplex->ResetAttributes();
                while( ( attr = stepcomplex->NextAttribute() ) != NULL )
                {
                    if( !strcmp( attr->Name(), "name" ) )
                    {
                        attr->StrToVal( lenname );
                    }
                    if( !strcmp( attr->Name(), "conversion_factor" ) )
                    {
                        attr->Raw()->c = new( STEPentity * );
                        *( attr->Raw()->c ) = ( STEPentity * )( len_measure_with_unit );
                    }
                }
            }
            if( !strcmp( stepcomplex->EntityName(), "Named_Unit" ) )
            {
                stepcomplex->ResetAttributes();
                while( ( attr = stepcomplex->NextAttribute() ) != NULL )
                {
                    if( !strcmp( attr->Name(), "dimensions" ) )
                    {
                        attr->Raw()->c = new( STEPentity * );
                        *( attr->Raw()->c ) = ( STEPentity * )( dimensional_exp_len );
                    }
                }
            }
            stepcomplex = stepcomplex->sc;
        }

        instance_list->Append( ( SDAI_Application_instance * ) ua_length, completeSE );
        instance_cnt++;
    }

    SdaiUncertainty_measure_with_unit * uncertainty = ( SdaiUncertainty_measure_with_unit * )registry->ObjCreate( "UNCERTAINTY_MEASURE_WITH_UNIT" );
    uncertainty->name_( "'DISTANCE_ACCURACY_VALUE'" );
    uncertainty->description_( "'Threshold below which geometry imperfections (such as overlaps) are not considered errors.'" );
    SdaiUnit * tol_unit = new SdaiUnit( ( SdaiNamed_unit * ) ua_length );
    uncertainty->ResetAttributes();
开发者ID:aeromedia,项目名称:OpenVSP,代码行数:67,代码来源:STEPutil.cpp

示例2: STEPcomplex

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


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