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


C++ AcGePoint3dArray::setLogicalLength方法代码示例

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


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

示例1: printFirstInteriorPoints

void InteriorPointsConstructor::printFirstInteriorPoints(int color, bool flag)
{
	int i = 1;
	int j = 0;
		
		
		AcGePoint3dArray ptArr;
		ptArr.setLogicalLength(_interiorArray[i].length()+1);
		
		
		while (j < _interiorArray[i].length())
		{
			
			ptArr[j].set(_interiorArray[i][j].x, _interiorArray[i][j].y, _interiorArray[i][j].z);
			
			
		
			j++;
		}
		ptArr[j].set(_interiorArray[0][0].x, _interiorArray[0][0].y, _interiorArray[0][0].z);
			

		AcDb3dPolyline *pNewPline = new AcDb3dPolyline(AcDb::k3dSimplePoly , ptArr, Adesk::kFalse);
		
		pNewPline->setColorIndex(color);

		AcDbBlockTable *pBlockTable;
		AcDbBlockTableRecord *pBlockTableRecord;


		acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlockTable, AcDb::kForRead);

		
		
		pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite);


		AcDbObjectId plineObjId;
		pBlockTableRecord->appendAcDbEntity(plineObjId, pNewPline);
		
		pBlockTable->close();
		pBlockTableRecord->close();

		//pNewPline->setLayer(_T("0"));
		//pNewPline->setClosed(Adesk::kFalse);
		pNewPline->close();
		//}
		//delete pNewPline;
		
	
	
}
开发者ID:vpatrinica,项目名称:pernute,代码行数:52,代码来源:InteriorPointsConstructor.cpp

示例2: acdbHostApplicationServices

void
createPolyline()
{
    // Set four vertex locations for the pline.
    //
    AcGePoint3dArray ptArr;
    ptArr.setLogicalLength(4);
    for (int i = 0; i < 4; i++) {
        ptArr[i].set((double)(i/2), (double)(i%2), 0.0);
    }

    // Dynamically allocate an AcDb2dPolyline object,
    // given four vertex elements whose locations are supplied
    // in ptArr.  The polyline has no elevation, and is
    // explicitly set as closed.  The polyline is simple;
    // that is, not curve fit or a spline.  By default, the
    // widths are all 0.0 and there are no bulge factors.
    //
    AcDb2dPolyline *pNewPline = new AcDb2dPolyline(
        AcDb::k2dSimplePoly, ptArr, 0.0, Adesk::kTrue);

    pNewPline->setColorIndex(3);

    // Get a pointer to a Block Table object.
    //
    AcDbBlockTable *pBlockTable;
    acdbHostApplicationServices()->workingDatabase()
        ->getSymbolTable(pBlockTable, AcDb::kForRead);

    // Get a pointer to the MODEL_SPACE BlockTableRecord.
    //
    AcDbBlockTableRecord *pBlockTableRecord;
    pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord,
        AcDb::kForWrite);

    pBlockTable->close();

    // Append the pline object to the database and
    // obtain its Object ID.
    //
    AcDbObjectId plineObjId;
    pBlockTableRecord->appendAcDbEntity(plineObjId,
        pNewPline);

    pBlockTableRecord->close();

    // Make the pline object reside on layer "0".
    //
    pNewPline->setLayer("0");

    pNewPline->close();
}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:52,代码来源:complex.cpp

示例3: getVertices

//addded by linlin 20050819
Acad::ErrorStatus  PDSphere::getVertices(int Precision, AcGePoint3dArray& vertexArray, AcGeVector3dArray &vertexNors) const
{  
	assertReadEnabled();

	int actPrecision__1 = Precision + 1;   
	int actPrecision___2__1 = Precision * 2 + 1;   
	vertexArray.setLogicalLength(actPrecision__1*actPrecision___2__1);
	vertexNors.setLogicalLength(actPrecision__1*actPrecision___2__1);


	AcGePoint3d varPt = m_ptCenter;        //变截面的中心点
	double varR = 0;
	double deltaAngle = PI / Precision;

	/////////////////////////////////////////////////////////////
	///////		begin the division						/////////
	AcGePoint3d point;

	for(int i = 0; i < actPrecision__1; ++i)
	{
		varPt.z=m_ptCenter.z- m_dRadius*cos(deltaAngle*i);

		varR = m_dRadius * sin(deltaAngle * i);
		int j;
		for(j = 0; j <actPrecision___2__1; ++j)
		{		  
			if(i == 0)
			{
				point = m_ptCenter;
				point.z -= m_dRadius;
			}
			else	 if(i == actPrecision__1)
			{ 
				point = m_ptCenter;
				point.z += m_dRadius;
			}         
			else
			{ 
				point=varPt;
				point.x += varR;
				point.rotateBy(deltaAngle * j, AcGeVector3d(0, 0, 1), varPt);
			}  	
			vertexArray[i*actPrecision___2__1+j]=point;
			vertexNors[i*actPrecision___2__1+j] = point - m_ptCenter;
		}
	}
	return Acad::eOk;
}//addded by linlin 20050819
开发者ID:wangfeilong321,项目名称:PDMS_ExportModel,代码行数:49,代码来源:PDSphere.cpp

示例4: getVertices

/////////////////////////////////////////////////////////////////
//////	求两端圆并进行剖分,将得到的离散放到引用树组中		/////
/////////////////////////////////////////////////////////////////
Acad::ErrorStatus PDEcone::getVertices(int Precision, AcGePoint3dArray& vertexArray, 
                                       AcGeIntArray &stdIdx, int &actPrecision) const
{
    assertReadEnabled();
    AcGeDoubleArray dividDbl;
    getActDivid(Precision, dividDbl, stdIdx);

    int actPrecision__1 = dividDbl.length();
    actPrecision = actPrecision__1 - 1;
    vertexArray.setLogicalLength(actPrecision__1 * 2);

    AcGeVector3d vect = getFaceVect();

    AcGeVector3d Wy(0, 1, 0), Wz(0, 0, 1), Ax;// Ay;
    if (fabs(vect[X]) <1.0/64 && fabs(vect[Y])<1.0/64) 
        Ax = Wy.crossProduct(vect);
    else
        Ax = Wz.crossProduct(vect);
    Ax.normalize();
    //Ay = vect.crossProduct(Ax);
    //Ay.normalize();

    AcGeVector3d AxE = Ax * m_dDiameter2 / 2.0;
    Ax *= m_dDiameter1 / 2.0;
    double rotateAngPre = PI * 2.0 / Precision;

    vertexArray[0] = m_ptStart + Ax;
    vertexArray[actPrecision__1] = m_ptEnd + AxE;
    AcGeVector3d VecSTemp, VecETemp;
    int i;
    for(i = 1; i < actPrecision; ++i)
    {
        VecSTemp = Ax;
        VecETemp = AxE;
        VecSTemp.rotateBy(rotateAngPre * dividDbl[i], vect);
        VecETemp.rotateBy(rotateAngPre * dividDbl[i], vect);
        vertexArray[i] = m_ptStart + VecSTemp;
        vertexArray[i + actPrecision__1] = m_ptEnd + VecETemp;
    }
    vertexArray[actPrecision] = vertexArray[0];
    vertexArray[actPrecision + actPrecision__1] = vertexArray[actPrecision__1];

	return Acad::eOk;
}
开发者ID:wangfeilong321,项目名称:PDMS_ExportModel,代码行数:47,代码来源:PDEcone.cpp

示例5: asdktest6

void asdktest6 () {
    int nPoints =8 ;
    int nTriangles =12 ;
    int nIndices =3 * nTriangles ;

    double p [] ={
        0, 0, 0,
        1, 0, 0,
        1, 1, 0,
        0, 1, 0,
        0, 0, 1,
        1, 0, 1,
        1, 1, 1,
        0, 1, 1
    } ;

    int i [] ={
        0, 1, 5,    0, 5, 4,
        1, 6, 5,    1, 2, 6,
        4, 5, 6,    4, 6, 7,
        7, 0, 4,    7, 3, 0,
        2, 0, 3,    2, 1, 0,
        7, 6, 3,    6, 2, 3
    } ;

    AcGeIntArray indices (nIndices) ;
    indices.setLogicalLength (nIndices) ;
    indices.setPhysicalLength (nIndices) ;
    memcpy (indices.asArrayPtr (), i, nIndices * sizeof (int)) ;

    AcGePoint3dArray gePts (nPoints) ;
    gePts.setLogicalLength (nPoints) ;
    gePts.setPhysicalLength (nPoints) ;
    memcpy (gePts.asArrayPtr (), p, nPoints * sizeof (AcGePoint3d)) ;

    void *acisBody =createBodyFromTriangles (gePts, indices) ;
    AcDb3dSolid *b =new AcDb3dSolid ;
    b->setASMBody(acisBody);
        
    AcDbObjectId id ;
    postToDatabase (NULL, b, id) ;
}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:42,代码来源:HlrArxSampleCommands.cpp

示例6: printInteriorPoints

void InteriorPointsConstructor::printInteriorPoints(int color, bool flag)
{
	int i = 0;

	

	while (i < _contourArray->length()/2 + 1)
	{
		int j = 0;
		
		
		AcGePoint3dArray ptArr;

		if ((flag)|| (_interiorArray[i].length() <2)) ptArr.setLogicalLength(_interiorArray[i].length());
		else  ptArr.setLogicalLength(_interiorArray[i].length()-1);
		
		if ((flag)|| (_interiorArray[i].length() < 2))
		while (j < _interiorArray[i].length())
		{
			
			ptArr[j].set(_interiorArray[i][j].x, _interiorArray[i][j].y, _interiorArray[i][j].z);
			

		
			j++;
		}
		else
		{
				while (j < _interiorArray[i].length()-2)
				{
			
						ptArr[j].set(_interiorArray[i][j].x, _interiorArray[i][j].y, _interiorArray[i][j].z);
						if (sqrt(_interiorArray[i][j].x*_interiorArray[i][j].x + _interiorArray[i][j].y*_interiorArray[i][j].y + _interiorArray[i][j].z*_interiorArray[i][j].z) < 100)
							acutPrintf(_T("The shitty: %d, %d\n"), i, j);

		
				j++;
				}
				j++;
				ptArr[j].set(_interiorArray[i][j].x, _interiorArray[i][j].y, _interiorArray[i][j].z);
			
		}
		//if (i == 10){
		AcDb3dPolyline *pNewPline = new AcDb3dPolyline(AcDb::k3dSimplePoly , ptArr, Adesk::kFalse);
		
		pNewPline->setColorIndex(color);

		AcDbBlockTable *pBlockTable;
		AcDbBlockTableRecord *pBlockTableRecord;


		acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlockTable, AcDb::kForRead);

		
		
		pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite);


		AcDbObjectId plineObjId;
		pBlockTableRecord->appendAcDbEntity(plineObjId, pNewPline);
		
		pBlockTable->close();
		pBlockTableRecord->close();

		//pNewPline->setLayer(_T("0"));
		//pNewPline->setClosed(Adesk::kFalse);
		pNewPline->close();
		//}
		//delete pNewPline;
		
		i++;
	}
}
开发者ID:vpatrinica,项目名称:pernute,代码行数:73,代码来源:InteriorPointsConstructor.cpp


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