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


C++ AcDbIntArray类代码示例

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


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

示例1: GetIntStrList

bool IntStrListHelper::GetIntStrList( const CString& name, AcDbIntArray& intList, AcStringArray& strList )
{
    AcStringArray entries;
    if( !ArxDictHelper::GetAllEntries( INT_LIST_DICT, name, entries ) ) return false;

    int len = entries.length();
    bool ret = ( len > 0 && len % 2 == 0 );
    if( ret ) // 长度必须为偶数
    {
        intList.removeAll();
        strList.removeAll();

        for( int i = 0; i < len; i++ )
        {
            if( i % 2 == 0 ) // 偶数位置的元素为整数
            {
                intList.append( _ttoi( entries[i].kACharPtr() ) );
            }
            else       // 奇数位置的元素为字符串
            {
                strList.append( entries[i] );
            }
        }
    }
    return ret;
}
开发者ID:yuechuanbingzhi163,项目名称:GDES,代码行数:26,代码来源:DataListHelper.cpp

示例2: 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] );
        }
    }
}
开发者ID:kanbang,项目名称:myexercise,代码行数:34,代码来源:FindGasBoundary.cpp

示例3: subMoveGripPointsAt

Acad::ErrorStatus TailraceGEDraw::subMoveGripPointsAt( const AcDbIntArray& indices, const AcGeVector3d& offset )
{
	assertWriteEnabled () ;

	for( int i = 0; i < indices.length(); i++ )
	{
		int idx = indices.at( i );
		if ( idx == 0 )
		{
			m_insertPt += offset; 			// 插入点偏移
			caculPts();
		}

// 		if(idx == 1)
// 		{
// 			// 1) 计算x轴的端点坐标
// 			AcGeVector3d v(AcGeVector3d::kXAxis);
// 			v.rotateBy(m_angle,AcGeVector3d::kZAxis);
// 			v.rotateBy(3.1415926/2,AcGeVector3d::kZAxis);
// 			AcGePoint3d pt = m_insertPt + v*m_lenth;
// 
// 			// 2) 进行坐标偏移计算
// 			pt += offset;
// 
// 			// 坐标相减,得到一个向量,然后得到向量长度
// 			m_lenth = (pt - m_insertPt).length();
// 			caculPts();
// 		}

	}
	return Acad::eOk;
}
开发者ID:wyrover,项目名称:GDES,代码行数:32,代码来源:TailraceDraw.cpp

示例4: subMoveGripPointsAt

Acad::ErrorStatus DoubleArcTunnelDraw::subMoveGripPointsAt( const AcDbIntArray& indices, const AcGeVector3d& offset )
{
    assertWriteEnabled () ;

    for( int i = 0; i < indices.length(); i++ )
    {
        int idx = indices.at( i );
        if ( idx == 0 )
        {
            m_startPt += offset;
        }

        if ( idx == 1 )
        {
            m_endPt += offset;
        }

        // 弧的中点
        if ( idx == 2 )
        {
            m_thirdPt += offset;
        }
    }
    return Acad::eOk;
}
开发者ID:kanbang,项目名称:TIDS,代码行数:25,代码来源:SingleArcTunnelDraw.cpp

示例5: 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 );
        }
    }
}
开发者ID:kanbang,项目名称:myexercise,代码行数:55,代码来源:FindGasBoundary.cpp

示例6: subMoveGripPointsAt

Acad::ErrorStatus SimpleChimneyDraw::subMoveGripPointsAt ( const AcDbIntArray& indices, const AcGeVector3d& offset )
{
    assertWriteEnabled () ;

    for( int i = 0; i < indices.length(); i++ )
    {
        int idx = indices.at( i );

        m_pts[idx] += offset;
    }
    return Acad::eOk;
}
开发者ID:kanbang,项目名称:myexercise,代码行数:12,代码来源:SimpleChimneyDraw.cpp

示例7: subMoveGripPointsAt

Acad::ErrorStatus SimpleWindLibraryDraw::subMoveGripPointsAt ( const AcDbIntArray& indices, const AcGeVector3d& offset )
{
	assertWriteEnabled () ;

	for( int i = 0; i < indices.length(); i++ )
	{
		int idx = indices.at( i );
		// 始节点
		if ( idx == 0 ) m_insertPt += offset;
	}
	return Acad::eOk;
}
开发者ID:kanbang,项目名称:TIDS,代码行数:12,代码来源:SimpleWindLibraryDraw.cpp

示例8: ASSERT

void
ArxDbgUtils::collectVertices(const AcDb2dPolyline* pline, AcGePoint3dArray& pts,
                        AcDbIntArray& types, AcGeDoubleArray& bulges,
                        AcGeDoubleArray& startWidths, 
                        AcGeDoubleArray& endWidths, bool& hasWidth)
{
    ASSERT(pline != NULL);
    ASSERT(pts.isEmpty() && bulges.isEmpty());

    hasWidth = false;

    AcDbObjectIterator* vertexIter = pline->vertexIterator();
    ASSERT(vertexIter != NULL);
    if (vertexIter == NULL)
        return;

    AcDb2dVertex* vertex;
    for (; !vertexIter->done(); vertexIter->step()) {
        if (acdbOpenObject(vertex, vertexIter->objectId(), AcDb::kForRead) == Acad::eOk) {
            if (vertex->vertexType() != AcDb::k2dSplineCtlVertex) {
                pts.append(pline->vertexPosition(*vertex));        // returns WCS
                bulges.append(vertex->bulge());
                startWidths.append(vertex->startWidth());
                endWidths.append(vertex->endWidth());

                if (vertex->startWidth() || vertex->endWidth())
                    hasWidth = true;
                types.append(vertex->vertexType());
            }
            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);

        bulges.append(0.0);

        int tmpType = types[0];
        types.append(tmpType);

        double tmpWidth = startWidths[0];
        startWidths.append(tmpWidth);

        tmpWidth = endWidths[0];
        endWidths.append(tmpWidth);
    }
}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:52,代码来源:ArxDbgUtilsDb.cpp

示例9: FindGoafPolygonLinePos

static void FindGoafPolygonLinePos( const AcDbVoidPtrArray& lines,
                                    const AcGePoint3dArray& polygons,
                                    const AcDbIntArray& polygon_counts,
                                    AcDbIntArray& linePos )
{
    int n = polygon_counts.length();
    for( int i = 0; i < n; i++ )
    {
        AcDbIntArray ex_linePos;
        FindPolygonLinePos( lines, polygons, polygon_counts, i, ex_linePos );
        linePos.append( ex_linePos );
    }
}
开发者ID:kanbang,项目名称:myexercise,代码行数:13,代码来源:FindGasBoundary.cpp

示例10: PartitionGoafPolygons

static void PartitionGoafPolygons( const AcDbVoidPtrArray& ws_lines,
                                   AcGePoint3dArray& polygons,
                                   AcDbIntArray& polygon_counts,
                                   AcDbIntArray& parTypes )
{
    for( int i = 0; i < polygon_counts.length(); i++ )
    {
        AcDbIntArray goaf_parTypes;
        PartitionGoafPolygon( ws_lines, polygons, polygon_counts, i, goaf_parTypes );

        parTypes.append( goaf_parTypes );
    }
}
开发者ID:kanbang,项目名称:myexercise,代码行数:13,代码来源:FindGasBoundary.cpp

示例11: subMoveGripPointsAt

Acad::ErrorStatus SphereNitrogenPipeDraw::subMoveGripPointsAt( const AcDbIntArray& indices, const AcGeVector3d& offset )
{
    assertWriteEnabled () ;

    for( int i = 0; i < indices.length(); i++ )
    {
        int idx = indices.at( i );
        if ( idx == 0 )
        {
            m_pt += offset; 			// 插入点偏移
        }
    }
    return Acad::eOk;
}
开发者ID:kanbang,项目名称:myexercise,代码行数:14,代码来源:SphereNitrogenPipeDraw.cpp

示例12: subMoveGripPointsAt

Acad::ErrorStatus PolyLineDirectionDraw::subMoveGripPointsAt( const AcDbIntArray& indices, const AcGeVector3d& offset )
{
    assertWriteEnabled () ;

    for( int i = 0; i < indices.length(); i++ )
    {
        int idx = indices.at( i );
        if ( idx == 0 )
        {
            m_insertPt += offset; 			// 插入点偏移
        }
    }
    return Acad::eOk;
}
开发者ID:wyrover,项目名称:GDES,代码行数:14,代码来源:PolyLineDirectionDraw.cpp

示例13: AddIntStrPair

bool IntStrListHelper::AddIntStrPair( const CString& name, int intValue, const CString& strValue )
{
    if( ( name.GetLength() == 0 ) || strValue.GetLength() == 0 ) return false;

    AcStringArray strList;
    AcDbIntArray intList;
    GetIntStrList( name, intList, strList );
    if( intList.contains( intValue ) || strList.contains( strValue ) ) return false;

    intList.append( intValue );
    strList.append( strValue );
    RemoveIntStrList( name );
    return AddIntStrList( name, intList, strList );
}
开发者ID:yuechuanbingzhi163,项目名称:GDES,代码行数:14,代码来源:DataListHelper.cpp

示例14: AdjustGoafPolygon

static void AdjustGoafPolygon( const AcDbVoidPtrArray& lines,
                               const AcGePoint3dArray& polygons,
                               const AcDbIntArray& polygon_counts,
                               const AcDbIntArray& colinearEdges,
                               const AcDbIntArray& parTypes,
                               AcGePoint3dArray& spts,
                               AcGePoint3dArray& epts,
                               AcGeDoubleArray& dirs,
                               AcDbIntArray& gas_types,
                               AcDbIntArray& gas_linePos )
{
    // 查找所有采空区边对应的直线
    AcDbIntArray goaf_linePos;
    FindGoafPolygonLinePos( lines, polygons, polygon_counts, goaf_linePos );

    // 分解所有的分支
    AcGePoint3dArray ex_spts, ex_epts;
    AcGeDoubleArray ex_dirs;
    AdjustAndExplodeGoafPolygons( lines, polygons, polygon_counts, ex_spts, ex_epts, ex_dirs );

    assert( ex_spts.length() == polygons.length() );

    for( int i = 0; i < polygon_counts.length(); i++ )
    {
        AppendNewGoafPolygon(
            polygons, polygon_counts,
            colinearEdges, parTypes,
            ex_spts, ex_epts, ex_dirs,
            goaf_linePos,
            i,
            spts, epts, dirs,
            gas_types,
            gas_linePos );
    }
}
开发者ID:kanbang,项目名称:myexercise,代码行数:35,代码来源:FindGasBoundary.cpp

示例15: 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] ) );
    }
}
开发者ID:kanbang,项目名称:myexercise,代码行数:25,代码来源:FindGasBoundary.cpp


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