本文整理汇总了C++中AcGeVector3d类的典型用法代码示例。如果您正苦于以下问题:C++ AcGeVector3d类的具体用法?C++ AcGeVector3d怎么用?C++ AcGeVector3d使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AcGeVector3d类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheackTubeLenth
static bool CheackTubeLenth(AcDbObjectId& objId)
{
objId = ArxUtilHelper::SelectObject( _T( "请选择一条瓦斯管路:" ) );
if( objId.isNull() ) return false;
if( !ArxUtilHelper::IsEqualType( _T( "GasTube" ), objId ) ) return false;
AcTransaction *pTrans = actrTransactionManager->startTransaction();
if ( 0 == pTrans ) return false;
AcDbObject *pObj;
if (Acad::eOk != pTrans->getObject(pObj,objId,AcDb::kForRead)) return false;
GasTube *pGasTube = GasTube::cast(pObj);
if ( 0 == pGasTube)
{
actrTransactionManager->abortTransaction();
return false;
}
AcGePoint3d spt,ept;
pGasTube->getSEPoint(spt,ept);
//double angle = pGasTube->getAngle();
actrTransactionManager->endTransaction();
AcGeVector3d v = ept - spt;
double tubeLenth = v.length();
return true;
}
示例2: ASSERT
Acad::ErrorStatus
ArxDbgDbEntity::setNormal(const AcGeVector3d& nvec)
{
if (nvec.isZeroLength()) {
ASSERT(0);
return Acad::eInvalidInput;
}
if (nvec != m_zDir) {
assertWriteEnabled();
AcGeVector3d txdir, tydir;
AcGeVector3d txdiro, tydiro;
ArxDbgUtils::getEcsXAxis(nvec, txdir); // get AutoCAD's arbitrary X-Axis for this normal
ArxDbgUtils::getEcsXAxis(m_zDir, txdiro); // get AutoCAD's arbitrary X-Axis for this normal
tydir = nvec.crossProduct(txdir);
tydir.normalize();
tydiro = m_zDir.crossProduct(txdiro);
tydiro.normalize();
AcGeMatrix3d mat;
mat.setToAlignCoordSys(m_origin, txdiro, tydiro, m_zDir,
m_origin, txdir, tydir, nvec);
m_xDir.transformBy(mat);
m_zDir.transformBy(mat);
m_origin.transformBy(mat);
}
return Acad::eOk;
}
示例3: _T
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: extendByLength
void SingleTunnelDraw::extendByLength( double length )
{
AcGeVector3d v = m_endPt - m_startPt;
v.normalize();
m_endPt = m_endPt + v * length; // 修改末点坐标
}
示例5: ASSERT
void
ArxDbgUtils::getEcsToWcsMatrix(const AcGePoint3d& origin,
const AcGeVector3d& zAxis, AcGeMatrix3d& mat)
{
const double kArbBound = 0.015625; // 1/64th
// short circuit if in WCS already
if (zAxis == AcGeVector3d::kZAxis) {
mat.setToIdentity();
return;
}
AcGeVector3d xAxis, yAxis;
ASSERT(zAxis.isUnitLength());
if ((fabs(zAxis.x) < kArbBound) && (fabs(zAxis.y) < kArbBound))
xAxis = AcGeVector3d::kYAxis.crossProduct(zAxis);
else
xAxis = AcGeVector3d::kZAxis.crossProduct(zAxis);
xAxis.normalize();
yAxis = zAxis.crossProduct(xAxis);
yAxis.normalize();
mat.setCoordSystem(AcGePoint3d::kOrigin, xAxis, yAxis, zAxis);
}
示例6: assertReadEnabled
double LinkedGE::getAngle() const
{
assertReadEnabled();
AcGeVector3d v = m_endPt - m_startPt;
return v.angleTo( AcGeVector3d::kXAxis, -AcGeVector3d::kZAxis );
}
示例7: assertReadEnabled
AcGeVector3d PDEcone::getFaceVect() const
{
assertReadEnabled();
AcGeVector3d centerVect = m_ptEnd - m_ptStart;
AcGeVector3d tmpV1 = centerVect.crossProduct(m_vect);
return m_vect.crossProduct(tmpV1).normal();
}
示例8: DrawArc
void DrawArc( AcGiWorldDraw* mode, const AcGePoint3d& spt, const AcGePoint3d& pt, const AcGePoint3d& ept, bool fill )
{
AcGiSubEntityTraits& traits = mode->subEntityTraits();
AcGiFillType ft = traits.fillType();
traits.setFillType( fill ? kAcGiFillAlways : kAcGiFillNever );
AcGeCircArc3d arc( spt, pt, ept );
AcGePoint3d cnt = arc.center();
double radius = arc.radius();
AcGeVector3d sv = spt - cnt;
AcGeVector3d ev = ept - cnt;
double sa = sv.angleTo( AcGeVector3d::kXAxis, -AcGeVector3d::kZAxis );
double ea = ev.angleTo( AcGeVector3d::kXAxis, -AcGeVector3d::kZAxis );
if( arc.normal().z > 0 )
{
AcDbArc arcEnt( cnt, radius, sa, ea );
arcEnt.worldDraw( mode );
}
else
{
AcDbArc arcEnt( cnt, radius, ea, sa );
arcEnt.worldDraw( mode );
}
// 恢复属性
traits.setFillType( ft );
}
示例9: getEndPointInExtendAngle
AcGeVector3d DoubleLine::getEndPointInExtendAngle() const
{
AcGeVector3d v = m_endPt - m_startPt;
v.rotateBy( PI, AcGeVector3d::kZAxis ); // 旋转180度
return v;
}
示例10: update
void DoubleLine::update()
{
AcGeVector3d v = m_endPt - m_startPt;
double angle = v.angleTo( AcGeVector3d::kXAxis, -AcGeVector3d::kZAxis );
caclLeftPoint( angle, m_leftStartPt, m_rightStartPt );
caclRightPoint( angle, m_leftEndPt, m_rightEndPt );
}
示例11:
void
ArxDbgDbEntity::getEcs(AcGeMatrix3d& retVal) const
{
AcGeVector3d yDir = m_zDir.crossProduct(m_xDir);
retVal.setCoordSystem(m_origin, m_xDir, yDir.normal(), m_zDir);
}
示例12: createSmiley
void
createSmiley()
{
AcGePoint3d cen;
struct resbuf rbFrom, rbTo;
ads_getpoint( NULL, "\nCenter point: ", asDblArray( cen ));
rbFrom.restype = RTSHORT;
rbFrom.resval.rint = 1; // from UCS
rbTo.restype = RTSHORT;
rbTo.resval.rint = 0; // to WCS
ads_trans( asDblArray( cen ), &rbFrom, &rbTo, Adesk::kFalse, asDblArray( cen ));
AcGeVector3d x = acdbHostApplicationServices()->workingDatabase()->ucsxdir();
AcGeVector3d y = acdbHostApplicationServices()->workingDatabase()->ucsydir();
AcGeVector3d normalVec = x.crossProduct( y );
normalVec.normalize();
SmileyJig jig( cen, normalVec );
jig.start();
}
示例13: caclHeadPoint
AcGePoint3d DoubleTTunnelDraw::caclHeadPoint()
{
AcGeVector3d v = m_endPt - m_startPt;
v.normalize(); // 单位方向向量
v = v * m_distance;
return m_endPt + v;
}
示例14: extendByLength
void GasPumpGEDraw::extendByLength( double length )
{
AcGeVector3d v = m_endPt - m_startPt;
v.normalize();
m_endPt = m_endPt + v * length; // 更新末点坐标
update();
}
示例15: extendByLength
void DoubleTunnelDraw::extendByLength( double length )
{
AcGeVector3d v = m_endPt - m_startPt;
v.normalize();
m_endPt = m_endPt + v * length; // 更新末点坐标
update(); // 更新其它参数
}