本文整理汇总了C++中AcGePoint3dArray::append方法的典型用法代码示例。如果您正苦于以下问题:C++ AcGePoint3dArray::append方法的具体用法?C++ AcGePoint3dArray::append怎么用?C++ AcGePoint3dArray::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcGePoint3dArray
的用法示例。
在下文中一共展示了AcGePoint3dArray::append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExplodeGoafPolygon
static void ExplodeGoafPolygon( const AcGePoint3dArray& polygon,
const AcGePoint3dArray& inner_polygon,
const AcGePoint3dArray& outer_polygon,
AcGePoint3dArray& spts, AcGePoint3dArray& epts )
{
int n = polygon.length();
for( int i = 0; i < n; i++ )
{
AcGePoint3d spt = polygon[i], ept = polygon[( i + 1 ) % n];
// 如果向外扩展的坐标没有发生变化
// 则使向内扩展坐标
if( spt == outer_polygon[2 * i] || ept == outer_polygon[2 * i + 1] )
{
spt = inner_polygon[i];
ept = inner_polygon[( i + 1 ) % n];
}
else
{
spt = outer_polygon[2 * i];
ept = outer_polygon[2 * i + 1];
}
spts.append( spt );
epts.append( ept );
}
}
示例2: ASSERT
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);
}
}
示例3: AppendNewGoafPolygon
static void AppendNewGoafPolygon( const AcGePoint3dArray& polygons,
const AcDbIntArray& polygon_counts,
const AcDbIntArray& colinearEdges,
const AcDbIntArray& parTypes,
const AcGePoint3dArray& ex_spts,
const AcGePoint3dArray& ex_epts,
const AcGeDoubleArray& ex_dirs,
const AcDbIntArray& linePos,
int k,
AcGePoint3dArray& spts,
AcGePoint3dArray& epts,
AcGeDoubleArray& dirs,
AcDbIntArray& gas_types,
AcDbIntArray& gas_linePos )
{
int s = 0;
for( int i = 0; i < k; i++ )
{
s += polygon_counts[i];
}
int t = s + polygon_counts[k];
for( int i = s; i < t; i++ )
{
if( colinearEdges[i] == 0 )
{
spts.append( ex_spts[i] );
epts.append( ex_epts[i] );
dirs.append( ex_dirs );
gas_types.append( parTypes[i] );
gas_linePos.append( linePos[i] );
}
}
}
示例4: subGetOsnapPoints
//- Osnap points protocol
Acad::ErrorStatus SingleTunnelDraw::subGetOsnapPoints (
AcDb::OsnapMode osnapMode,
int gsSelectionMark,
const AcGePoint3d& pickPoint,
const AcGePoint3d& lastPoint,
const AcGeMatrix3d& viewXform,
AcGePoint3dArray& snapPoints,
AcDbIntArray& geomIds ) const
{
assertReadEnabled () ;
// 只捕捉1种类型的点:端点
if( osnapMode != AcDb::kOsModeEnd )
return Acad::eOk;
Acad::ErrorStatus es = Acad::eOk;
if ( osnapMode == AcDb::kOsModeEnd )
{
snapPoints.append( m_startPt );
snapPoints.append( m_endPt );
}
return es;
}
示例5: 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 );
}
示例6: DividArc
static void DividArc( const AcGePoint3d& spt, const AcGePoint3d& ept, const AcGePoint3d& thirdPt,
int count, AcGePoint3dArray& pts )
{
pts.append( spt );
AcGeCircArc3d arc( spt, thirdPt, ept );
AcGePoint3d cnt = arc.center();
// double radius = arc.radius();
AcGeVector3d v1 = spt - cnt;
AcGeVector3d v2 = ept - cnt;
int c = ( arc.normal().z > 0 ? 1 : -1 ); // 弧线方向
double a1 = v1.angleTo( AcGeVector3d::kXAxis, -AcGeVector3d::kZAxis );
double a2 = v2.angleTo( AcGeVector3d::kXAxis, -AcGeVector3d::kZAxis );
double dq = abs( a2 - a1 ) / count;
//acutPrintf(_T("\na1:%.3f, a2:%.3f dq:%.3f c:%d"), a1, a2, dq, c);
for( int i = 1; i < count; i++ )
{
v1.rotateBy( c * dq, AcGeVector3d::kZAxis );
pts.append( cnt + v1 );
//acutPrintf(_T("\n点%d:(%d,%d)"),i,pts[i].x,pts[i].y);
}
pts.append( ept );
}
示例7: caclBackGroundMinPolygon
void DetermineHoleGEDraw::caclBackGroundMinPolygon( AcGePoint3dArray& pts )
{
pts.append(m_spt1);
pts.append(m_spt2);
pts.append(m_spt3);
pts.append(m_spt4);
}
示例8: xoff
Acad::ErrorStatus
AsdkSmiley::osnapQuad(
const AcGePoint3d& pickPoint,
AcGePoint3dArray& snapPoints) const
{
AcGeVector3d xoff(0,0,0);
AcGeVector3d yoff(0,0,0);
// Osnap quad to the face's quad points
//
xoff.x = yoff.y = radius();
AcGePoint3d center( center() );
snapPoints.append( center + xoff );
snapPoints.append( center + yoff );
snapPoints.append( center - xoff );
snapPoints.append( center - yoff );
// Osnap quad to the eyes' quad points
//
AcGePoint3dArray eyearray;
AcGePoint3d eyecen;
eyes( eyearray );
for( int i = 0; i < eyearray.length(); i++ ){
eyecen = eyearray.at( i );
xoff.x = meyesize;
yoff.y = meyesize;
snapPoints.append( eyecen + xoff );
snapPoints.append( eyecen + yoff );
snapPoints.append( eyecen - xoff );
snapPoints.append( eyecen - yoff );
}
return Acad::eOk;
}
示例9: acdbOpenObject
bool
ArxDbgUtils::collectVertices(const AcDbPolygonMesh* pmesh, AcGePoint3dArray& pts,
int& mSize, int& nSize)
{
AcDbObjectIterator* vertexIter = pmesh->vertexIterator();
if (vertexIter == NULL)
return false;
Acad::ErrorStatus es;
AcDbPolygonMeshVertex* pVertex;
AcGePoint3d tmpPt;
if (pmesh->polyMeshType() == AcDb::kSimpleMesh) {
mSize = pmesh->mSize();
nSize = pmesh->nSize();
}
else {
mSize = pmesh->mSurfaceDensity();
nSize = pmesh->nSurfaceDensity();
}
int nCount = 0;
int totalCount = 0;
for (; !vertexIter->done(); vertexIter->step()) {
es = acdbOpenObject(pVertex, vertexIter->objectId(), AcDb::kForRead);
if (es != Acad::eOk) {
ArxDbgUtils::rxErrorMsg(es);
delete vertexIter;
return false;
}
pts.append(pVertex->position());
nCount++;
totalCount++;
if (nCount == nSize) {
if (pmesh->isNClosed()) {
tmpPt = pts[totalCount - nSize]; // work around bug by making temp copy (not sure if still a bug??)
pts.append(tmpPt);
totalCount++;
}
nCount = 0;
}
}
delete vertexIter;
if (pmesh->isNClosed())
nSize++;
if (pmesh->isMClosed()) {
mSize++;
for (int i=0; i<nSize; i++) {
tmpPt = pts[i]; // see note above
pts.append(tmpPt);
}
}
return true;
}
示例10: subGetGripPoints
Acad::ErrorStatus DoubleArcTunnelDraw::subGetGripPoints( AcGePoint3dArray& gripPoints, AcDbIntArray& osnapModes, AcDbIntArray& geomIds ) const
{
assertReadEnabled () ;
gripPoints.append( m_startPt );
gripPoints.append( m_endPt );
gripPoints.append( m_thirdPt );
return Acad::eOk;
}
示例11: 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() );
}
}
示例12: subGetGripPoints
//- Grip points protocol
Acad::ErrorStatus SingleTunnelDraw::subGetGripPoints (
AcGePoint3dArray& gripPoints, AcDbIntArray& osnapModes, AcDbIntArray& geomIds ) const
{
assertReadEnabled () ;
//----- This method is never called unless you return eNotImplemented
//----- from the new getGripPoints() method below (which is the default implementation)
gripPoints.append( m_startPt );
gripPoints.append( m_endPt );
return Acad::eOk;
}
示例13: 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;
}
示例14: assertReadEnabled
void
AsdkSmiley::eyes(AcGePoint3dArray& array) const
{
assertReadEnabled();
// left eye
AcGePoint3d eye = center();
eye[X] -= meyesapart / 2;
eye[Y] += meyesheight;
array.append(eye);
// right eye
eye[X] += meyesapart;
array.append(eye);
} // smiley eyes
示例15: caclBackGroundMinPolygon
void TailraceGEDraw::caclBackGroundMinPolygon( AcGePoint3dArray& pts )
{
//AcGeCircArc3d arc( m_pt2, m_pt0, m_pt3 );
//AcGePoint3d cnt = arc.center();
//double radius = arc.radius();
//AcGeVector3d v = pt - cnt;
//v.normalize();
DividArc( m_pt2, m_pt3, m_pt0, 90, pts );
pts.append(m_pt8);
pts.append(m_pt5);
pts.append(m_pt4);
}