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


C++ Cylinder::write方法代码示例

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


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

示例1: fixParCvCrossingCylinderSeem


//.........这里部分代码省略.........
	u_span = new_u_high - new_u_low;
	if (u_span > 2*M_PI)
	{
	    // We next run through all cvs setting the common translation.
	    MESSAGE("Moving of seem is not enough to handle this case, u_span = " << u_span);
	}
	// new_u_low will be the value used for moving the seem.
	for (size_t ki = 0; ki < par_bd_boxes.size(); ++ki)
	{
	    transl_u[ki] -= new_u_low;
	    cout << "transl_u[ki] = " << transl_u[ki] << endl;
	}

	// We then run through the par_cvs translating the u-values of the coefs.
	cout << "DEBUG: Soon we will handle this case!" << endl;
	// We rotate the cylinder by u_low - new_u_low.
	double rot_ang_deg = new_u_low;
	cyl->rotate(rot_ang_deg);
	// Finally we run through all curve segments and perfomr the translation in the u-dir.
	for (size_t ki = 0; ki < par_cvs.size(); ++ki)
	{
	    if (par_cvs[ki] != NULL)
	    {
		if (par_cvs[ki]->instanceType() == Class_SplineCurve)
		{
		    SplineCurve* spline_cv = dynamic_cast<SplineCurve*>(par_cvs[ki]);
		    vector<double>::iterator iter = spline_cv->coefs_begin();
		    while (iter != spline_cv->coefs_end())
		    {
			iter[0] += transl_u[ki];
			iter += 2;
		    }
		}
		else if (par_cvs[ki]->instanceType() == Class_Line)
		{
		    Line* line = dynamic_cast<Line*>(par_cvs[ki]);
		    Point transl_vec(2, 0.0);
		    transl_vec[0] = transl_u[ki];
		    line->translateCurve(transl_vec);
		}
		else
		{
		    THROW("Unsupported curve type: " << par_cvs[ki]->instanceType());
		}
	    }
	}

#ifndef NDEBUG
	std::ofstream debug("tmp/debug.g2");
	cyl->writeStandardHeader(debug);
	cyl->write(debug);
	for (size_t ki = 0; ki < outer_loop->size(); ++ki)
	{
	    shared_ptr<ParamCurve> cv = (*outer_loop)[ki];
	    if (cv->instanceType() == Class_CurveOnSurface)
	    {
		shared_ptr<CurveOnSurface> cv_on_sf =
		    dynamic_pointer_cast<CurveOnSurface, ParamCurve>(cv);
		if (cv_on_sf->parameterCurve() != NULL) {
		    shared_ptr<SplineCurve> pcv =
			dynamic_pointer_cast<SplineCurve, ParamCurve>
			(cv_on_sf->parameterCurve());
		    if (pcv.get() != NULL)
			SplineDebugUtils::writeSpaceParamCurve(*pcv, debug, 0.0);
		    else
		    {
			cv_on_sf->parameterCurve()->writeStandardHeader(debug);
			cv_on_sf->parameterCurve()->write(debug);
		    }
		}
		if (cv_on_sf->spaceCurve() != NULL)
		{
		    cv_on_sf->spaceCurve()->writeStandardHeader(debug);
		    cv_on_sf->spaceCurve()->write(debug);
		}
	    }
	    else
	    {
		cv->writeStandardHeader(debug);
		cv->write(debug);
	    }
	}
	double debug_val = 0.0;
#endif

#ifndef NDEBUG
	// CurveOnSurface* first_cv_on_sf = dynamic_cast<CurveOnSurface*>((*outer_loop)[0].get());
	// assert(first_cv_on_sf != NULL);
	Point new_space_cv_pt = first_cv_on_sf->spaceCurve()->point(first_cv_on_sf->spaceCurve()->startparam());
	Point new_par_cv_pt =
	    first_cv_on_sf->parameterCurve()->point(first_cv_on_sf->parameterCurve()->startparam());
	Point new_sf_pt = cyl->ParamSurface::point(new_par_cv_pt[0], new_par_cv_pt[1]);
#endif

	trimmed_cyl->analyzeLoops();
	return true;
    }

    return false;
}
开发者ID:heididahl,项目名称:GoTools,代码行数:101,代码来源:repairInvalidBoundedSurfaces.C


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