本文整理汇总了C++中AcGePoint3dArray类的典型用法代码示例。如果您正苦于以下问题:C++ AcGePoint3dArray类的具体用法?C++ AcGePoint3dArray怎么用?C++ AcGePoint3dArray使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AcGePoint3dArray类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}
示例2: FindPolygonLinePos
static void FindPolygonLinePos( const AcDbVoidPtrArray& lines,
const AcGePoint3dArray& polygons,
const AcDbIntArray& polygon_counts,
int k,
AcDbIntArray& linePos )
{
int s = 0;
for( int i = 0; i < k; i++ )
{
s += polygon_counts[i];
}
int t = s + polygon_counts[k];
AcGePoint3dArray polygon;
for( int i = s; i < t; i++ )
{
polygon.append( polygons[i] );
}
int n = polygon.length();
for( int i = 0; i < n; i++ )
{
linePos.append( FindLineByPoints( lines, polygon[i], polygon[( i + 1 ) % n] ) );
}
}
示例3: 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 );
}
示例4: 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] );
}
}
}
示例5: 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 );
}
}
示例6: AdjustObturationPointSource
static void AdjustObturationPointSource( const AcGePoint3dArray& polygon, const AcGePoint3dArray& ext_polygon, AcGePoint3dArray& ob_pts )
{
bool isClockWise = ( ClockWise( polygon ) == -1 );
int n = ob_pts.length();
int m = polygon.length();
for( int i = 0; i < n; i++ )
{
int pos = FindPointOnPolygon( ob_pts[i], polygon );
//acutPrintf(_T("\n点源位置:%d"), pos);
if( pos != -1 )
{
int p1 = ( ( pos == 0 ) ? m - 1 : pos - 1 );
int p2 = pos;
int p3 = ( ( pos == m - 1 ) ? 0 : pos + 1 );
ob_pts[i] = ProjectPointOfTwoLine(
polygon[p2],
polygon[p3],
ext_polygon[p2],
ext_polygon[p3],
ob_pts[i] );
// 进行将点源坐标向采空区做微小的调整
ob_pts[i] = MinorAjustPointSource(
isClockWise,
polygon[p1], // 前一个点
polygon[p2], // 当前点
polygon[p3], // 下一个点
ob_pts[i] );
}
}
}
示例7: 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;
}
示例8: caclBackGroundMinPolygon
void DetermineHoleGEDraw::caclBackGroundMinPolygon( AcGePoint3dArray& pts )
{
pts.append(m_spt1);
pts.append(m_spt2);
pts.append(m_spt3);
pts.append(m_spt4);
}
示例9: acutPrintf
void DrawCmd::DrawChimney( void )
{
acutPrintf( _T( "\n绘制风筒测试..." ) );
AcDbObjectId objId = ArxUtilHelper::SelectObject( _T( "请选择一个掘进工作面:" ) );
if( objId.isNull() ) return;
if( !ArxUtilHelper::IsEqualType( _T( "TTunnel" ), objId ) ) return;
AcDbObjectIdArray objIds;
DrawHelper::GetTagGEById2( objId, _T( "Chimney" ), objIds );
if( !objIds.isEmpty() )
{
AfxMessageBox( _T( "该掘进工作面已设置了风筒!" ) );
return;
}
AcGePoint3dArray pts;
PolyLineJig jig;
if( !jig.doJig( pts ) ) return;
int len = pts.length();
acutPrintf( _T( "\n点个数:%d" ), len );
if( len < 2 ) return;
Chimney* pChimney = new Chimney();
pChimney->setRelatedGE( objId ); // 关联的图元必须是掘进工作面
for( int i = 0; i < len; i++ ) pChimney->addControlPoint( pts[i] );
// 初始化并提交到数据库
if( !ArxUtilHelper::PostToModelSpace( pChimney ) ) delete pChimney;
}
示例10: 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;
}
示例11: 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;
}
示例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: 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() );
}
}
示例14: FindGasBoundary
// 查找采空区的其它边
void FindGasBoundary( const AcDbObjectIdArray& objIds,
const AcDbVoidPtrArray& lines,
AcGePoint3dArray& spts,
AcGePoint3dArray& epts,
AcGeDoubleArray& dirs,
AcDbIntArray& gas_types,
AcDbObjectIdArray& gas_objIds )
{
// 查找所有的采空区
AcDbObjectIdArray goaf_objIds;
FindAllGoafs( goaf_objIds );
// 将采空区多边形转换成一个1维数组
AcGePoint3dArray polygons;
AcDbIntArray polygon_counts;
BuildGoafPolygonArray( goaf_objIds, polygons, polygon_counts );
// 标记采空区分支是否与其它采空区有共线边
AcDbIntArray colinearEdges;
FindPolygonColinearEdges( polygons, polygon_counts, colinearEdges );
// 查找所有的工作面
AcDbVoidPtrArray ws_lines;
FilterLines( lines, ws_lines, true );
// 划分采空区多边形(工作面、两帮、开切眼)
AcDbIntArray parTypes;
PartitionGoafPolygons( ws_lines, polygons, polygon_counts, parTypes );
assert( parTypes.length() == polygons.length() );
// 工作面需要特殊处理
AcDbIntArray gas_linePos;
AdjustGoafPolygon(
lines, polygons, polygon_counts,
colinearEdges, parTypes,
spts, epts, dirs,
gas_types, gas_linePos );
assert( gas_types.length() == gas_linePos.length() );
for( int i = 0; i < gas_linePos.length(); i++ )
{
int pos = gas_linePos[i];
if( pos != -1 )
{
gas_objIds.append( objIds[pos] );
}
else
{
gas_objIds.append( AcDbObjectId::kNull );
}
}
}
示例15: assertReadEnabled
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;
}