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


C++ AcDbVoidPtrArray::isEmpty方法代码示例

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


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

示例1: sCir

//  [9/5/2007 suzhiyong]
Acad::ErrorStatus PDEcone::explodeTo3DSolid(AcDb3dSolid* &p3dSolid) const
{
	assertReadEnabled();

#ifdef _OBJECTARX2004_
	Acad::ErrorStatus es = Acad::eOk;
	int i = 0;
	AcGeVector3d faceVect = getFaceVect();

	AcDbCurve *pCurve = NULL;
	AcDbVoidPtrArray curveSegments;
	double pathLen = m_ptStart.distanceTo(m_ptEnd);

	AcGePoint3d sp, ep;
	double d1, d2;
	if(m_dDiameter1 >= m_dDiameter2)
	{
		sp = m_ptStart;
		ep = m_ptEnd;
		d1 = m_dDiameter1;
		d2 = m_dDiameter2;
	}
	else
	{
		sp = m_ptEnd;
		ep = m_ptStart;
		d1 = m_dDiameter2;
		d2 = m_dDiameter1;
	}

	//extrudeAlongPath函数在由较大region拉成较小region时容易产生自交问题,所以
	//炸开时选择由小的region拉成大的region
	AcDbLine *pLine = new AcDbLine(ep, sp);
    pLine->setPropertiesFrom(this);
	pCurve = pLine;

	if(pCurve != NULL)
	{
		if((es = addToDb(pCurve)) == Acad::eOk)
		{
			AcDbObjectId id;
			id = pCurve->objectId();
			pCurve->close();
			if((es = acdbOpenObject((AcDbCurve*&)pCurve, id, AcDb::kForRead)) != Acad::eOk)
				return Acad::eNotApplicable;
		}
		else
		{
			if(pCurve != NULL)
				delete pCurve;
			return Acad::eNotApplicable;
		}
	}

	AcDbCircle sCir(ep, faceVect, d2 / 2.0);
	curveSegments.append(&sCir);

	AcDbVoidPtrArray regions;
	es = AcDbRegion::createFromCurves(curveSegments, regions);

	if(es == Acad::eOk && !regions.isEmpty())
	{
		AcDb3dSolid *pBody;
		pBody = new AcDb3dSolid;

		////求taper Angle
		//AcGeVector3d vec1 = (m_ptStart-m_ptEnd);//.normal();

		////m_dDiameter1和m_dDiameter2的大小问题
		//AcGeVector3d perpVec = faceVect.perpVector()*((m_dDiameter1/2-m_dDiameter2/2));
		//AcGePoint3d point2(m_ptStart.x+perpVec.x, m_ptStart.y+perpVec.y, m_ptStart.z+perpVec.z);
		//AcGeVector3d vec2 = (point2 - m_ptEnd);//.normal();

		////taperAngle为负时表示放大region,反之为缩小
		//double angle = -1*vec1.angleTo(vec2);
		////angle没有到达最大值时仍然有问题,建议不使用extrudeAlongPath函数

		//taperAngle是指两个圆心连线垂直于圆面时的角度,大于0时表示缩小,小于0时表示放大
		es = pBody->extrudeAlongPath((AcDbRegion*)(regions[0]), pCurve,//angle);
			-1*atan((d1 / 2.0 - d2 / 2.0) / pathLen));

		if(es != Acad::eOk)
		{
			if(pCurve != NULL)
			{
				pCurve->upgradeOpen();
				pCurve->erase();
				pCurve->close();
			}
			delete pBody;
			for(i = 0; i < regions.length(); i++)
				delete (AcRxObject*)regions[i];
			return Acad::eNotApplicable;
		}
		pBody->setPropertiesFrom(this);
		p3dSolid = pBody;
	}
	else
	{
//.........这里部分代码省略.........
开发者ID:wangfeilong321,项目名称:PDMS_ExportModel,代码行数:101,代码来源:PDEcone.cpp


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