本文整理汇总了C++中AcGePoint3dArray::asArrayPtr方法的典型用法代码示例。如果您正苦于以下问题:C++ AcGePoint3dArray::asArrayPtr方法的具体用法?C++ AcGePoint3dArray::asArrayPtr怎么用?C++ AcGePoint3dArray::asArrayPtr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcGePoint3dArray
的用法示例。
在下文中一共展示了AcGePoint3dArray::asArrayPtr方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawRect
void DrawRect( AcGiWorldDraw* mode, const AcGePoint3d& insertPt, double angle, double width, double height, bool fill )
{
AcGiSubEntityTraits& traits = mode->subEntityTraits();
AcGeVector3d v1( AcGeVector3d::kXAxis ), v2( AcGeVector3d::kXAxis );
v1.rotateBy( angle, AcGeVector3d::kZAxis );
v2.rotateBy( angle + PI / 2, AcGeVector3d::kZAxis );
AcGePoint3dArray pts;
pts.append( CaclPt( insertPt, v1, width, v2, height ) );
v1.rotateBy( PI, AcGeVector3d::kZAxis );
pts.append( CaclPt( insertPt, v1, width, v2, height ) );
v2.rotateBy( PI, AcGeVector3d::kZAxis );
pts.append( CaclPt( insertPt, v1, width, v2, height ) );
v1.rotateBy( PI, AcGeVector3d::kZAxis );
pts.append( CaclPt( insertPt, v1, width, v2, height ) );
// 是否填充
AcGiFillType ft = traits.fillType();
traits.setFillType( fill ? kAcGiFillAlways : kAcGiFillNever );
mode->geometry().polygon( pts.length(), pts.asArrayPtr() );
traits.setFillType( ft );
}
示例2: subWorldDraw
Adesk::Boolean SingleTunnelDraw::subWorldDraw( AcGiWorldDraw* mode )
{
assertReadEnabled () ;
AcGePoint3dArray pts;
pts.append( m_startPt );
pts.append( m_endPt );
mode->geometry().worldLine( pts.asArrayPtr() );
return Adesk::kTrue;
}
示例3: DrawLinePoints
static void DrawLinePoints( AcGiWorldDraw* mode, const AcGePoint3dArray& pts )
{
int len = pts.length();
for( int i = 0; i < len - 1; i++ )
{
AcGePoint3dArray tpts;
tpts.append( pts[i] );
tpts.append( pts[i + 1] );
mode->geometry().worldLine( tpts.asArrayPtr() );
}
}
示例4: DrawPolygon
void DrawPolygon( AcGiWorldDraw* mode, const AcGePoint3dArray& polygon, bool fill )
{
AcGiSubEntityTraits& traits = mode->subEntityTraits();
// 是否填充
AcGiFillType ft = traits.fillType();
traits.setFillType( fill ? kAcGiFillAlways : kAcGiFillNever );
mode->geometry().polygon( polygon.length(), polygon.asArrayPtr() );
traits.setFillType( ft );
}
示例5: DrawCross
void DrawCross( AcGiWorldDraw* mode, const AcGePoint3d& pt, double radius )
{
AcGeVector3d v( AcGeVector3d::kXAxis );
v *= radius;
for( int i = 0; i < 4; i++ )
{
AcGePoint3dArray pts;
pts.append( pt );
pts.append( pt + v );
mode->geometry().worldLine( pts.asArrayPtr() );
v.rotateBy( PI / 2, AcGeVector3d::kZAxis );
}
}
示例6: DrawRect
void DrawRect( AcGiWorldDraw* mode, const AcGePoint3d& pt, double angle, double width, double height, bool fill )
{
AcGiSubEntityTraits& traits = mode->subEntityTraits();
AcGePoint3dArray pts;
BuildRect( pt, angle, width, height, pts );
// 是否填充
AcGiFillType ft = traits.fillType();
traits.setFillType( fill ? kAcGiFillAlways : kAcGiFillNever );
mode->geometry().polygon( pts.length(), pts.asArrayPtr() );
traits.setFillType( ft );
}
示例7: 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) ;
}
示例8: worldDraw
//.........这里部分代码省略.........
int i, j;
for(i = 0; i < edgeDataLen; ++i)
edgeVisibility[i] = kAcGiInvisible;//kAcGiSilhouette;
// int actPrecision___2 = Precision * 2;
// for (i =0; i < actPrecision__1; i += PreStep )
// {
// for(j = 0; j < actPrecision___2; j++)
// {
// edgeVisibility[i * actPrecision___2 + j] = kAcGiVisible;
// }
// }
// int PrecisionArc___Cir = actPrecision__1 * Precision * 2;
// for (i = 0; i < actPrecision___2; i += PreStep)
// {
// for(j = 0; j < Precision; j ++)
// {
// edgeVisibility[PrecisionArc___Cir + i * Precision + j] = kAcGiVisible;
// }
// }
int actPrecision___2 = Precision * 2;
for (i = Precision / 4; i < Precision; i += Precision / 4 )
{
for(j = 0; j < actPrecision___2; j++)
{
edgeVisibility[i * actPrecision___2 + j] = kAcGiVisible;
}
}
int PrecisionArc___Cir = actPrecision__1 * Precision * 2;
for (i = 0; i < actPrecision___2; i += actPrecision___2 / 8)
{
for(j = 0; j < Precision; j ++)
{
edgeVisibility[PrecisionArc___Cir + i * Precision + j] = kAcGiVisible;
}
}
edgeData.setVisibility(edgeVisibility);
// 因为下面代码会导致球体的render效果图不正确,所以将其注释。
//AcGiVertexData vertexData;
//vertexData.setNormals(vertexNors.asArrayPtr());
//vertexData.setOrientationFlag(kAcGiCounterClockwise);
//添加球面的GS标记,与线框模型的GS标记分开处理
//added by szw 2009.11.18 : begin
int gsIndex = 8;
mode->subEntityTraits().setSelectionMarker(gsIndex);
//added by szw 2009.11.18 : end
mode->geometry().mesh(actPrecision__1,actPrecision___2 + 1,pArray.asArrayPtr(),&edgeData/*, NULL, &vertexData*/);
delete [] edgeVisibility;
}
#ifndef _ALWAYSSHOWWIRE_
break;
case kAcGiStandardDisplay:
case kAcGiSaveWorldDrawForR12:
case kAcGiSaveWorldDrawForProxy:
#endif
{
//Precision = PRIMARY3D_WIREFRAME_LINENUM;
//getVertices(Precision, pArray, vertexNors);
//actPrecision__1 = Precision + 1;
int gsIndex = 0;
mode->subEntityTraits().setSelectionMarker(++gsIndex);
if(mode -> geometry().circle( m_ptCenter,m_dRadius,AcGeVector3d(1,0,0)))
return Adesk::kTrue;
mode->subEntityTraits().setSelectionMarker(++gsIndex);
if(mode -> geometry().circle( m_ptCenter,m_dRadius,AcGeVector3d(1,1,0)))
return Adesk::kTrue;
mode->subEntityTraits().setSelectionMarker(++gsIndex);
if(mode -> geometry().circle( m_ptCenter,m_dRadius,AcGeVector3d(0,1,0)))
return Adesk::kTrue;
mode->subEntityTraits().setSelectionMarker(++gsIndex);
if(mode -> geometry().circle( m_ptCenter,m_dRadius,AcGeVector3d(-1,1,0)))
{
return Adesk::kTrue;
}
mode->subEntityTraits().setSelectionMarker(++gsIndex);
if(mode -> geometry().circle( m_ptCenter,m_dRadius,AcGeVector3d(0,0,1)))
{
return Adesk::kTrue;
}
mode->subEntityTraits().setSelectionMarker(++gsIndex);
if(mode -> geometry().circle( m_ptCenter - AcGeVector3d(0, 0, 1) * m_dRadius * cos(PI / 4.0),m_dRadius * sin(PI / 4.0),AcGeVector3d(0,0,1)))
{
return Adesk::kTrue;
}
mode->subEntityTraits().setSelectionMarker(++gsIndex);
mode -> geometry().circle( m_ptCenter + AcGeVector3d(0, 0, 1) * m_dRadius * cos(PI / 4.0),m_dRadius * sin(PI / 4.0),AcGeVector3d(0,0,1));
}
#ifndef _ALWAYSSHOWWIRE_
break;
default:
break;
}
#endif
#endif
return Adesk::kTrue;
}//added by linlin 20050819
示例9: worldDraw
//.........这里部分代码省略.........
{
case kAcGiStandardDisplay:
case kAcGiSaveWorldDrawForR12:
case kAcGiSaveWorldDrawForProxy:
#endif
{
int gsIndex = 0;
AcGeVector3d faceVect = getFaceVect();
//统一线框模型和实体模型的GS标记
//modified by szw 2009.11.18 : begin
mode->subEntityTraits().setSelectionMarker(++gsIndex);
if(mode->geometry().circle(m_ptStart, m_dDiameter1 / 2.0, faceVect))
return Adesk::kTrue;
mode->subEntityTraits().setSelectionMarker(++gsIndex);
if(mode->geometry().circle(m_ptEnd, m_dDiameter2 / 2.0, faceVect))
return Adesk::kTrue;
actPrecision = PRIMARY3D_WIREFRAME_LINENUM;
getVertices(actPrecision,pArray);
actPrecision__1 = actPrecision + 1;
AcGePoint3d pt[2];
++gsIndex;
for(i = 0; i < actPrecision; i += PreStep)
{
pt[0] = pArray[i];
pt[1] = pArray[i + actPrecision__1];
mode->subEntityTraits().setSelectionMarker(gsIndex);
if(mode->geometry().polyline(2, pt))
return Adesk::kTrue;
}
//modified by szw 2009.11.18 : end
}
#ifndef _ALWAYSSHOWWIRE_
break;
case kAcGiHideOrShadeCommand:
case kAcGiRenderCommand:
#endif
{
int gsIndex = 0;
mode->subEntityTraits().setFillType(kAcGiFillAlways);
if(actPrecision < PRIMARY3D_WIREFRAME_LINENUM * 2)
actPrecision = PRIMARY3D_WIREFRAME_LINENUM;
else
{
if(actPrecision > m_dDividPrecision)
actPrecision = m_dDividPrecision;
PreStep = actPrecision / PRIMARY3D_WIREFRAME_LINENUM;
actPrecision = PreStep * PRIMARY3D_WIREFRAME_LINENUM;
}
getVertices(actPrecision,pArray);
actPrecision__1 = actPrecision + 1;
///////////////////////////////////////////////////////
/////// 画两端面
///////////////////////////////////////////////////////
//添加实体模型各面的GS标记
//added by szw 2009.11.18 : begin
mode->subEntityTraits().setSelectionMarker(++gsIndex);
//added by szw 2009.11.18 : end
if(mode->geometry().polygon(actPrecision, &pArray[0]))
return Adesk::kTrue;
//added by szw 2009.11.18 : begin
mode->subEntityTraits().setSelectionMarker(++gsIndex);
//added by szw 2009.11.18 : end
if(mode->geometry().polygon(actPrecision, &pArray[actPrecision__1]))
return Adesk::kTrue;
AcGiEdgeData edgeData;
int edgeDataLen = actPrecision__1 * 3 - 2;
Adesk::UInt8* edgeVisibility = new Adesk::UInt8[edgeDataLen];
for(i = 0; i < edgeDataLen; ++i)
edgeVisibility[i] = kAcGiInvisible;//kAcGiSilhouette;
int actPrecision___2 = actPrecision * 2;
for(i = actPrecision___2;i < edgeDataLen; i += PreStep)
{
edgeVisibility[i] = kAcGiVisible;
if(PreStep > 1 && i != edgeDataLen - 1)
{
for(int j = 1; j < PreStep; ++j)
edgeVisibility[i + j] = kAcGiInvisible;
}
}
edgeData.setVisibility(edgeVisibility);
///////////////////////////////////////////////////////////
///////画旋转曲面
///////////////////////////////////////////////////////////
//added by szw 2009.11.18 : begin
mode->subEntityTraits().setSelectionMarker(++gsIndex);
//added by szw 2009.11.18 : end
mode->geometry().mesh(2, actPrecision__1, pArray.asArrayPtr(), &edgeData);
delete [] edgeVisibility;
}
#ifndef _ALWAYSSHOWWIRE_
break;
default:
break;
}
#endif
#endif
return Adesk::kTrue;
}