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


C++ AcGePoint3dArray::length方法代码示例

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


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

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

示例2: CreatePLine

int CArxHelper::CreatePLine(AcDbPolyline*& pPolyline, const AcGePoint3dArray& arrPt, double dWith, BOOL bClose)
{
	pPolyline = new AcDbPolyline(arrPt.length());
	for(int i = 0; i < arrPt.length(); i++)
	{
		pPolyline->addVertexAt(i,arrPt.at(i).convert2d(AcGePlane::kXYPlane),0.0);
	}
	pPolyline->setConstantWidth(dWith);
	pPolyline->setClosed(bClose);
	return 0;
}
开发者ID:ninuo,项目名称:ArxWorkspace,代码行数:11,代码来源:ArxHelper2.cpp

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

示例4: 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;
}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:34,代码来源:AsdkSmileyNew.cpp

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

示例6: DrawChimney

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;
}
开发者ID:kanbang,项目名称:myexercise,代码行数:32,代码来源:DrawVent.cpp

示例7: ClockWise

// 返回值:
//		0  -- 错误
//		1  -- 顺时针
//	   -1  -- 逆时针
int ClockWise( const AcGePoint3dArray& polygon )
{
    int n = polygon.length();
    if ( n < 3 ) return 0;

    int count = 0;
    for( int i = 0; i < n; i++ )
    {
        int j = ( i + 1 ) % n;
        int k = ( i + 2 ) % n;
        double z  = ( polygon[j].x - polygon[i].x ) * ( polygon[k].y - polygon[j].y );
        z -= ( polygon[j].y - polygon[i].y ) * ( polygon[k].x - polygon[j].x );
        if ( z < 0 )
        {
            count--;
        }
        else if ( z > 0 )
        {
            count++;
        }
    }
    if ( count > 0 )
        return -1;
    else if ( count < 0 )
        return 1;
    else
        return 0;
}
开发者ID:yuechuanbingzhi163,项目名称:GDES,代码行数:32,代码来源:DrawTool.cpp

示例8: 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

示例9: 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

示例10: write_back_data

static void write_back_data( Vector<double>& fnew, AcGePoint3dArray& datas )
{
    int n = datas.length();
    for( int i = 0; i < n; i++ )
    {
        datas[i].z = fnew( i );
    }
}
开发者ID:kanbang,项目名称:myexercise,代码行数:8,代码来源:RadialInterpolate.cpp

示例11: offset

Adesk::Boolean
AsdkSmiley::worldDraw(AcGiWorldDraw *wd)
{
    assertReadEnabled();

    AcGeVector3d offset(0,0,0);
    AcGeCircArc3d face = mfacecircle;

    // If dragging, don't fill the smiley
    //
    if( wd->isDragging() ){
        wd->subEntityTraits().setColor( colorIndex() );
        wd->subEntityTraits().setFillType( kAcGiFillNever );
    }
    else
        wd->subEntityTraits().setFillType( kAcGiFillAlways );

    // Give the circle a GS marker of 1
    //
    wd->subEntityTraits().setSelectionMarker( 1 );
    wd->geometry().circle( face.center(), face.radius(), mnormal );

    if( !wd->isDragging() )
        wd->subEntityTraits().setColor( 250 );

    // Give the eyes GS markers of 2 etc.
    //
    AcGePoint3dArray eyearray;

    eyes( eyearray );
    for( int i = 0; i < eyearray.length(); i++ ){
        wd->subEntityTraits().setSelectionMarker( i + 2 );
        wd->geometry().circle( eyearray.at(i) + offset, meyesize, mnormal );
    }

    AcGePoint3d smilecen( mouthCenter() + offset ),
                startpt( mouthLeft() + offset ),
                endpt( mouthRight() + offset );
    AcGeVector3d startvec = startpt - smilecen,
                 endvec = endpt - smilecen;
    double mouthangle = startvec.angleTo( endvec );

    wd->subEntityTraits().setSelectionMarker( eyearray.length() + 2 );
    wd->geometry().circularArc( smilecen, mouthRadius(), mnormal, startvec, mouthangle, kAcGiArcChord );
    return Adesk::kTrue;
}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:46,代码来源:AsdkSmileyNew.cpp

示例12: rx_makeSpline

Acad::ErrorStatus rx_makeSpline(const AcGePoint3dArray&  pts,
			              AcDbSpline*&       pSpline)
{
    Acad::ErrorStatus es = Acad::eOk;

    AcGeDoubleArray knots, weights;
    for (int i = 0; i < pts.length(); i++) {
        weights.append(1.0);
    }

    getUniformKnots(pts.length(), 1, 0, knots);

    pSpline = new AcDbSpline(1, Adesk::kFalse, Adesk::kFalse,
                                Adesk::kFalse, pts, knots, weights);
 
    return es;
}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:17,代码来源:utilobj.cpp

示例13: setPoints

void ContourLabel::setPoints( const AcGePoint3dArray& cnpts )
{
    assertWriteEnabled();
    if( cnpts.length() > 2 )
    {
        m_pts.removeAll();
        m_pts.append( cnpts );
    }
}
开发者ID:kanbang,项目名称:myexercise,代码行数:9,代码来源:ContourLabel+-+副本.cpp

示例14: WritePressFacility

static void WritePressFacility( CStdioFile& outfile,
                                const AcGePoint3dArray& press_spts,
                                const AcGePoint3dArray& press_epts,
                                const AcGeDoubleArray press_dirs )
{
    CString str;
    str.Format( _T( "%d\n" ), press_spts.length() );
    outfile.WriteString( str );
}
开发者ID:kanbang,项目名称:myexercise,代码行数:9,代码来源:WriteDataFile.cpp

示例15: GetMINPt

int Additional_Class::GetMINPt( int pos, AcGePoint3dArray PtList )
{
	AcGePoint3d tempPT;
	if (PtList.length() == 0)
	{
		return 0;
	}
	tempPT = PtList[0];
	int res;
	for (int i = 0; i<PtList.length(); i++)
	{
		if(PtList[i][pos] < tempPT[pos])
		{
			tempPT = PtList[i];
			res = i;
		}
	}
	return res;
}
开发者ID:TobeGodman,项目名称:AutoTrader,代码行数:19,代码来源:Additional_Class.cpp


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