コード例 #1
0
void DoubleTunnelDraw::caclEndPoint( AcGePoint3d& endPt1, AcGePoint3d& endPt2 )
{
    AcGeVector3d v = m_endPt - m_startPt;
    v.normalize();

    v.rotateBy( PI * 0.5, AcGeVector3d::kZAxis );
    endPt1 = m_endPt + v * m_width * 0.5;

    v.rotateBy( PI, AcGeVector3d::kZAxis );
    endPt2 = m_endPt + v * m_width * 0.5;
}
コード例 #2
0
ファイル: DoubleLine.cpp プロジェクト: hunanhd/cbm
void DoubleLine::caclEndPoint( AcGePoint3d& endPt1, AcGePoint3d& endPt2 )
{
    AcGeVector3d v = m_ept - m_spt;
    v.normalize();

    v.rotateBy( PI * 0.5, AcGeVector3d::kZAxis );
    endPt1 = m_ept + v * m_width * 0.5;

    v.rotateBy( PI, AcGeVector3d::kZAxis );
    endPt2 = m_ept + v * m_width * 0.5;
}
コード例 #3
0
ファイル: DrawVent.cpp プロジェクト: yuechuanbingzhi163/GDES
void DrawCmd::DrawWindLibrary( void )
{
	AcDbObjectId objId = ArxUtilHelper::SelectObject( _T( "请选择一条巷道:" ) );
	if( objId.isNull() ) return;
	if( !ArxUtilHelper::IsEqualType( _T( "LinkedGE" ), objId ) ) return;


	AcGePoint3d pt,insertPt;

	double angle;

	if( !ArxUtilHelper::PromptPt( _T( "\n请指定风库的插入点坐标:" ), pt ) ) return;

	if( !GetClosePtAndAngle( objId, pt, angle ) ) return;

	AcGeVector3d v = AcGeVector3d(AcGeVector3d::kXAxis);
	v.rotateBy(angle - PI/2,AcGeVector3d::kZAxis);
	v.normalize();

	insertPt = pt + v * 60;

	WindLibrary* pWindLib = new WindLibrary( insertPt, angle ); 	
	if( pWindLib == 0 ) return;


	pWindLib->setRelatedGE( objId ); // 关联巷道

	// 初始化并提交到数据库
	if( !ArxUtilHelper::PostToModelSpace( pWindLib ) ) delete pWindLib;

}
コード例 #4
0
ファイル: TunnelDragJig.cpp プロジェクト: kanbang/myexercise
Adesk::Boolean TunnelDragJig::update()
{
    AcGePlane plane;
    AcGeVector3d v = ept - spt;
    v.normalize();

    v.rotateBy( 0.5 * PI, AcGeVector3d::kZAxis );

    AcGeVector3d offset = curPt - basePt;
    double L = offset.dotProduct( v );
    if( L == 0 ) return false;

    if( L < 0 )
    {
        v.negate();
        L = -1 * L;
    }

    AcGePoint3d newSpt = spt + v * L, newEpt = ept + v * L;

    // 更新工作面坐标
    m_pWS->setSEPoint( newSpt, newEpt );
    m_pWS->updateDraw();

    return Adesk::kTrue;
}
コード例 #5
0
ファイル: DoubleLine.cpp プロジェクト: kanbang/myexercise
AcGeVector3d DoubleLine::getEndPointInExtendAngle() const
{
    AcGeVector3d v = m_endPt - m_startPt;
    v.rotateBy( PI, AcGeVector3d::kZAxis ); // 旋转180度

    return v;
}
コード例 #6
0
static void DrawSegment( AcGiWorldDraw* mode, const AcGePoint3d& spt, const AcGeVector3d& v, double length, double width, double lineWidth )
{
    AcGePoint3d ept = spt + v * length;
    DrawPolyLine( mode, spt, ept, lineWidth );

    AcGeVector3d vv = v;
    vv.rotateBy( PI / 2, AcGeVector3d::kZAxis );
    AcGePoint3d spt1, spt2;
    spt1 = spt + vv * width * 0.5;
    vv.rotateBy( PI, AcGeVector3d::kZAxis );
    spt2 = spt + vv * width * 0.5;
    DrawPolyLine( mode, spt1, spt2, lineWidth );

    AcGePoint3d ept1, ept2;
    ept1 = ept + vv * width * 0.5;
    vv.rotateBy( PI, AcGeVector3d::kZAxis );
    ept2 = ept + vv * width * 0.5;
    DrawPolyLine( mode, ept1, ept2, lineWidth );
}
コード例 #7
0
ファイル: SingleArcTunnelDraw.cpp プロジェクト: kanbang/TIDS
AcGeVector3d DoubleArcTunnelDraw::getEndPointInExtendAngle() const
{
    AcGeCircArc3d arc( m_startPt, m_thirdPt, m_endPt );
    AcGePoint3d cenPt = arc.center();
    AcGeVector3d v = m_endPt - cenPt;
    AcGeVector3d v2 = m_startPt - m_endPt;
    AcGeVector3d v3 = v.crossProduct( v2 );
    int c = ( v3.z > 0 ? 1 : -1 );
    v.rotateBy( c * PI / 2, AcGeVector3d::kZAxis );
    return v;
}
コード例 #8
0
Acad::ErrorStatus
ArxDbgDbEntity::setRotation(double rot)
{
    assertWriteEnabled();

    AcGeVector3d xAxis;
    ArxDbgUtils::getEcsXAxis(m_zDir, xAxis);	// get AutoCAD's arbitrary X-Axis

    m_xDir = xAxis.rotateBy(rot, m_zDir);		// factor in rotation angle
    m_xDir.normalize();

    return Acad::eOk;
}
コード例 #9
0
ファイル: SingleArcTunnelDraw.cpp プロジェクト: kanbang/TIDS
void DoubleArcTunnelDraw::extendByLength( double length )
{
    AcGeCircArc3d arc( m_startPt, m_thirdPt, m_endPt );
    AcGePoint3d cenPt = arc.center();
    double radius = arc.radius();
    AcGeVector3d v = m_endPt - cenPt;
    AcGeVector3d v2 = m_startPt - m_endPt;
    AcGeVector3d v3 = v.crossProduct( v2 );
    int c = ( v3.z > 0 ? 1 : -1 );

    v.rotateBy( c * length / radius, AcGeVector3d::kZAxis );

    m_endPt = cenPt + v; // 修改圆弧的末点
}