|
[code]在下文中一共展示了AcGePoint3dArray::isEmpty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ASSERT
▲ 点赞 9 ▼
void
ArxDbgUtils::collectVertices(const AcDb3dPolyline* pline, AcGePoint3dArray& pts)
{
ASSERT(pline != NULL);
ASSERT(pts.isEmpty());
AcDbObjectIterator* vertexIter = pline->vertexIterator();
ASSERT(vertexIter != NULL);
if (vertexIter == NULL)
return;
AcDb3dPolylineVertex* vertex;
for (; !vertexIter->done(); vertexIter->step()) {
if (acdbOpenObject(vertex, vertexIter->objectId(), AcDb::kForRead) == Acad::eOk) {
if (vertex->vertexType() != AcDb::k3dControlVertex)
pts.append(vertex->position());
vertex->close();
}
}
delete vertexIter;
ASSERT(pts.isEmpty() == false);
if (pline->isClosed()) {
AcGePoint3d tmpPt = pts[0]; // used to be a bug in dynamic arrays (not sure if its still there??)
pts.append(tmpPt);
}
}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:28,代码来源:ArxDbgUtilsDb.cpp
示例2: OnBnClickedOk
▲ 点赞 7 ▼
void ContourColorDlg::OnBnClickedOk()
{
UpdateData( TRUE );
// 获取图层名称
CString layer;
if( !GetLayer( layer ) )
{
MessageBox( _T( "没有选择包含等值线的图层" ) );
return;
}
AcGeDoubleArray zValues;
AcArray<COLORREF> colors;
int n = m_colorList.GetItemCount();
for( int i = 0; i < n; i++ )
{
ColorListItemData* pData = ( ColorListItemData* )m_colorList.GetItemData( i );
zValues.append( pData->z );
colors.append( pData->rgb );
}
// 删除最后一个z值
zValues.removeLast();
// 删除color list上的附加数据
DeleteColorListItemDatas();
// 获取图层上的等值线信息图元
AcDbObjectId objId = GetContourInfoOnLayer( layer );
SetContourInfo( objId, zValues, colors, m_bFillColor );
// 获取边界坐标数据
AcGePoint3dArray bounds;
GetBoundaryPoints( bounds );
if( bounds.isEmpty() )
{
MessageBox( _T( "请添加一个闭合的井田边界" ) );
return;
}
// 获取点集数据
AcGePoint3dArray datas;
GetContourDatas( objId, datas );
//assert((colors.length()-zValues.length()) == 1);
// 绘制填充
DrawFill( layer, bounds, datas, zValues, colors, m_bFillColor );
OnOK();
}
开发者ID:kanbang,项目名称:myexercise,代码行数:50,代码来源:ContourColorDlg.cpp
示例3: DrawPolygonHatch
▲ 点赞 5 ▼
void DrawPolygonHatch( AcGiWorldDraw* mode, const AcGePoint3dArray& pts, const CString& patName, double scale )
{
if( pts.isEmpty() ) return;
AcDbHatch hatch;
// set color
//AcCmColor color;
//color.setRGB(r, g, b);
//pHatch->setColor(color);
CreatePreDefinedHatch( &hatch, patName, scale );
CreatePolygonLoop( &hatch, pts );
// Elaborate solid fill
hatch.evaluateHatch();
hatch.worldDraw( mode );
}
开发者ID:yuechuanbingzhi163,项目名称:GDES,代码行数:18,代码来源:DrawTool.cpp
示例4: FindInletBoundary
▲ 点赞 2 ▼
// 查找所有只关联一条直线的点坐标对应的分支以及方向
void FindInletBoundary( const AcDbObjectIdArray& objIds,
const AcDbVoidPtrArray& lines,
AcGePoint3dArray& inlet_spts,
AcGePoint3dArray& inlet_epts,
AcGeDoubleArray& inlet_dirs,
AcDbObjectIdArray& inlet_objIds )
{
// 查找所有的点
AcGePoint3dArray pts;
GetNodePoints( lines, pts );
if( pts.isEmpty() ) return;
for( int i = 0; i < pts.length(); i++ )
{
// 查找点关联的双线
AcDbIntArray linePos;
FindLinesByPoint( lines, pts[i], linePos );
if( linePos.length() != 1 ) continue;
// 获取双线的始末点坐标
int pos = linePos[0];
DoubleLine* pLine = ( DoubleLine* )lines[pos];
AcGePoint3d spt, ept;
pLine->getSEPoint( spt, ept );
// 判断当前点是始点还是末点
AcGePoint3d line_spt, line_ept;
if( spt == pts[i] )
{
pLine->getStartPoints( line_spt, line_ept );
}
else
{
pLine->getEndPoints( line_spt, line_ept );
}
inlet_spts.append( line_spt );
inlet_epts.append( line_ept );
inlet_dirs.append( pLine->getAngle() );
inlet_objIds.append( objIds[pos] );
}
}
开发者ID:kanbang,项目名称:myexercise,代码行数:44,代码来源:FindInletBoundary.cpp
示例5: getVertices
▲ 点赞 1 ▼
////////////////////////////////////////////////////////////////////////////////
/////// 将球在圆上分成m_nPrecision段,然后求相应处圆的半径 ///////
/////// 再将此圆分成m_nPrecision份。 ////////
/////// 所以共 (m_nPrecision+1)*(m_nPrecision+1)个点 ////
////////////////////////////////////////////////////////////////////////////////
Acad::ErrorStatus PDSphere::getVertices(int Precision, AcGePoint3dArray& vertexArray,
AcGeIntArray &stdIdx, int &actPrecision) const
{ assertReadEnabled();
while(!vertexArray.isEmpty())
vertexArray.removeLast();
AcGeDoubleArray dividDbl;
getActDivid(Precision, dividDbl, stdIdx);
int actPrecision__1 = dividDbl.length();
int actPrecision___2__1 = (dividDbl.length() - 1) * 2 + 1;
actPrecision = actPrecision__1 - 1;
vertexArray.setLogicalLength(actPrecision__1*actPrecision___2__1);
AcGePoint3d varPt = m_ptCenter; //变截面的中心点
double varR = 0;
double deltaAngle = PI / Precision;
/////////////////////////////////////////////////////////////
/////// begin the division /////////
AcGeCubicSplineCurve3d varcur;
AcGePoint3d point;
for(int i = 0; i < actPrecision__1; ++i)
{
varPt.z=m_ptCenter.z- m_dRadius*cos(deltaAngle*dividDbl[i]);
double tt = m_dRadius * m_dRadius - (m_ptCenter.z - varPt.z) *
(m_ptCenter.z - varPt.z);
if(tt < 0)
tt = 0;
varR = sqrt(tt);
int j;
for(j = 0; j <actPrecision__1; ++j)
{
if(i == 0)
{
point = m_ptCenter - AcGeVector3d(0, 0, 1) * m_dRadius;
vertexArray[i*actPrecision___2__1+j]=point;
}
else if(i == actPrecision__1)
{
point = m_ptCenter + AcGeVector3d(0, 0, 1) * m_dRadius;
vertexArray[i*actPrecision___2__1+j]=point;
}
else
{
point=varPt + AcGeVector3d(1, 0, 0) * varR;
point.rotateBy(deltaAngle * dividDbl[j], AcGeVector3d(0, 0, 1), varPt);
vertexArray[i*actPrecision__1+j]=point;
}
}
for(j = 1; j <actPrecision__1; ++j)
{
if(i == 0)
{
point = m_ptCenter - AcGeVector3d(0, 0, 1) * m_dRadius;
vertexArray[i*actPrecision__1 + j + actPrecision]=point;
}
else if(i == actPrecision__1)
{
point = m_ptCenter + AcGeVector3d(0, 0, 1) * m_dRadius;
vertexArray[i*actPrecision__1 + j + actPrecision]=point;
}
else
{
point=varPt + AcGeVector3d(1, 0, 0) * varR;
point.rotateBy(deltaAngle * dividDbl[j] + PI, AcGeVector3d(0, 0, 1), varPt);
vertexArray[i*actPrecision__1 + j + actPrecision]=point;
}
}
}
return Acad::eOk;
}[/code] |
|