本文整理汇总了C++中AcGeVector3d::angleTo方法的典型用法代码示例。如果您正苦于以下问题:C++ AcGeVector3d::angleTo方法的具体用法?C++ AcGeVector3d::angleTo怎么用?C++ AcGeVector3d::angleTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcGeVector3d
的用法示例。
在下文中一共展示了AcGeVector3d::angleTo方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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 );
}
示例2: getAngle
double LinkedGE::getAngle() const
{
assertReadEnabled();
AcGeVector3d v = m_endPt - m_startPt;
return v.angleTo( AcGeVector3d::kXAxis, -AcGeVector3d::kZAxis );
}
示例3: 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 );
}
示例4: assertReadEnabled
double
ArxDbgDbEntity::rotation() const
{
assertReadEnabled();
AcGeVector3d xAxis;
ArxDbgUtils::getEcsXAxis(m_zDir, xAxis); // get AutoCAD's arbitrary X-Axis
return xAxis.angleTo(m_xDir, m_zDir);
}
示例5: AddDirection
static void AddDirection( const AcDbObjectId& objId, const AcGePoint3d& spt, const AcGePoint3d& ept )
{
AcGeVector3d v = ept - spt;
if( v.length() < 100 ) return;
double angle = v.angleTo( AcGeVector3d::kXAxis, -AcGeVector3d::kZAxis );
WindDirection* pDir = new WindDirection( spt + v * 0.5, angle ); // 巷道中心位置
pDir->setRelatedGE( objId );
ArxUtilHelper::PostToModelSpace( pDir );
}
示例6:
// 原来的计算方法
static AcGeVector3d CaclAverageVector3( const AcGeVector3d& v1, const AcGeVector3d& v2 )
{
double angle = v2.angleTo( v1, -AcGeVector3d::kZAxis );
// 计算中心角向量
AcGeVector3d v3 = v1 + v2;
// 向量的"夹角"大于PI时,向量是反向的
if( angle > 3.1415926535897932384626433832795 )
{
//acutPrintf(_T("\n夹角:%.3f 向量反向..."), angle);
v3.negate();
}
return v3;
}
示例7: 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;
}
示例8: sin
// 新的计算方法
static AcGeVector3d CaclAverageVector2( const AcGeVector3d& v1, double w1, const AcGeVector3d& v2, double w2 )
{
// 从v1->v2的转角
double angle = v2.angleTo( v1, -AcGeVector3d::kZAxis );
// 计算向量v1的长度
double L1 = 0.5 * w1 / sin( angle );
// 计算向量L2的长度
double L2 = 0.5 * w2 / sin( angle );
// 计算中心角向量
AcGeVector3d v3 = v1 * L2 + v2 * L1;
// 向量的"夹角"大于PI时,向量是反向的
//if(angle >= PI)
//{
// //acutPrintf(_T("\n夹角:%.3f 向量反向..."), angle);
// v3.negate();
//}
return v3;
}
示例9: acutPrintf
//.........这里部分代码省略.........
acutPrintf (ACRX_T("%lf , "), majAxis.x);
acutPrintf (ACRX_T("%lf , "), majAxis.y);
acutPrintf (ACRX_T("%lf "), majAxis.z);
acutPrintf(ACRX_T(")\n"));
acutPrintf(ACRX_T(" Elliptic Cylinder minor axis is ("));
acutPrintf (ACRX_T("%lf , "), minAxis.x);
acutPrintf (ACRX_T("%lf , "), minAxis.y);
acutPrintf (ACRX_T("%lf "), minAxis.z);
acutPrintf(ACRX_T(")\n"));
acutPrintf(ACRX_T(" Elliptic Cylinder axis of symmetry is ("));
acutPrintf (ACRX_T("%lf , "), symAxis.x);
acutPrintf (ACRX_T("%lf , "), symAxis.y);
acutPrintf (ACRX_T("%lf "), symAxis.z);
acutPrintf(ACRX_T(")\n"));
acutPrintf(ACRX_T("Surface Definition Data End\n"));
break;
}
// NOTE: This surface is not yet supported in AcGe, so we infer the definition
// data by analysing evaluated data on the external bounded surface.
case(kEllipCone):
{
acutPrintf(ACRX_T("\nSurface Type: Elliptic Cone\n"));
AcGePoint3d p0 = surfaceGeometry->evalPoint(AcGePoint2d(0.0, 0.0));
AcGePoint3d p1 = surfaceGeometry->evalPoint(AcGePoint2d(0.0, kPi));
AcGePoint3d p2 = surfaceGeometry->evalPoint(AcGePoint2d(0.0, kHalfPi));
AcGePoint3d p3 = surfaceGeometry->evalPoint(AcGePoint2d(1.0, 0.0));
AcGePoint3d centre(((p0.x + p1.x) / 2.0),
((p0.y + p1.y) / 2.0),
((p0.z + p1.z) / 2.0));
AcGeVector3d majAxis = p0 - centre;
AcGeVector3d minAxis = p2 - centre;
AcGeVector3d symAxis = (majAxis.crossProduct(minAxis)).normalize();
double halfAng = kHalfPi - majAxis.angleTo(p3 - p0);
acutPrintf(ACRX_T("\nSurface Definition Data Begin:\n"));
acutPrintf(ACRX_T(" Elliptic Cone base centre is ("));
acutPrintf (ACRX_T("%lf , "), centre.x);
acutPrintf (ACRX_T("%lf , "), centre.y);
acutPrintf (ACRX_T("%lf "), centre.z);
acutPrintf(ACRX_T(")\n"));
acutPrintf(ACRX_T(" Elliptic Cone base major radius is %lf\n"), majAxis.length());
acutPrintf(ACRX_T(" Elliptic Cone base minor radius is %lf\n"), minAxis.length());
acutPrintf(ACRX_T(" Elliptic Cone major axis is ("));
acutPrintf (ACRX_T("%lf , "), majAxis.x);
acutPrintf (ACRX_T("%lf , "), majAxis.y);
acutPrintf (ACRX_T("%lf "), majAxis.z);
acutPrintf(ACRX_T(")\n"));
acutPrintf(ACRX_T(" Elliptic Cone minor axis is ("));
acutPrintf (ACRX_T("%lf , "), minAxis.x);
acutPrintf (ACRX_T("%lf , "), minAxis.y);
acutPrintf (ACRX_T("%lf "), minAxis.z);
acutPrintf(ACRX_T(")\n"));
acutPrintf(ACRX_T(" Elliptic Cone axis of symmetry is ("));
acutPrintf (ACRX_T("%lf , "), symAxis.x);
acutPrintf (ACRX_T("%lf , "), symAxis.y);
acutPrintf (ACRX_T("%lf "), symAxis.z);
acutPrintf(ACRX_T(")\n"));
acutPrintf(ACRX_T(" Elliptic Cone cosine of major half-angle is %lf\n"), cos(halfAng));
acutPrintf(ACRX_T(" Elliptic Cone sine of major half-angle is %lf\n"), sin(halfAng));
acutPrintf(ACRX_T("Surface Definition Data End\n"));
break;
}
default:
acutPrintf(ACRX_T("\nSurface Type: Unexpected Non Surface\n"));
return (AcBrErrorStatus)Acad::eInvalidInput;
示例10: update
void GasPumpGEDraw::update()
{
AcGeVector3d v = m_endPt - m_startPt;
v.normalize();
m_angle = v.angleTo( AcGeVector3d::kXAxis, -AcGeVector3d::kZAxis );
}
示例11: DrawDirection
void DrawCmd::DrawDirection( void )
{
AcDbObjectId objId = ArxUtilHelper::SelectObject( _T( "请选择一个需要标明方向的图元:" ) );
if( objId.isNull() ) return;
if( !ArxUtilHelper::IsEqualType( _T( "LinkedGE" ), objId ) ) return;
if( ArxUtilHelper::IsEqualType( _T( "DrillGE" ), objId ) ) return;
AcDbObject* pObj;
acdbOpenObject( pObj, objId, AcDb::kForRead );
AcGePoint3d pt;
if( !PromptInsertPt( objId, pt ) ) return;
//ArcTunnel *pArcTunnel = ArcTunnel::cast(pObj);
LinkedGE* pEdge = LinkedGE::cast( pObj );
//TTunnel* pTTunel = TTunnel::cast(pObj);
pObj->close();
int colorIndx = pEdge->colorIndex();
//acutPrintf(_T("\n颜色索引:%d"),colorIndx);
//CheakLayerExit(_T("流动方向"),colorIndx);
AcGePoint3d spt,ept;
pEdge->getSEPoint( spt, ept );
AcGeVector3d v = ept - spt;
double angle = v.angleTo(AcGeVector3d::kXAxis, -AcGeVector3d::kZAxis);
if( !GetClosePtAndAngle( objId, pt, angle ) ) return;
//bool isOppositeDir = false;
//CString method;
//CString name;
//DataHelper::GetPropertyData( objId, _T( "名称" ), name );
//if (ArxUtilHelper::IsEqualType( _T( "TTunnel" ), objId ))
//{
// DataHelper::GetPropertyData( objId, _T( "通风方法" ), method );
//}
//else
//{
// AcDbObjectId tWorkId = GetRelatedTW(objId);
// DataHelper::GetPropertyData( tWorkId, _T( "通风方法" ), method );
//}
//if ( _T("进风巷") != name && _T("回风巷") != name)
//{
// if (_T("压入式") == method || _T("长压短抽") == method)
// {
// isOppositeDir = true;
// }
//}
//if (true == isOppositeDir)
//{
// angle = PI + angle;
//}
angle = ControlDirByMethods(objId,angle);
CreateDirection( objId, pt, angle, colorIndx );
}
示例12: getFaceVect
/*---------------------------------------------------------------------------
* 名称: _make_eqovalpt
* 功能: 完成 "在设备椭球封头上画出点" 的功能
* 注意: 无
*/
int PDEcone:: _make_eqovalpt(double lengthR,AcGeVector3d vec,ads_point pt,ads_point normal)
{
double R1,R2;
R1=m_dDiameter1/2;
R2=m_dDiameter2/2;
double ang,H1;
AcGeVector3d vect1 = (m_ptEnd - m_ptStart).normal();
AcGeVector3d vect = getFaceVect();
H1=m_ptStart.distanceTo(m_ptEnd);
ang=vect.angleTo(vect1);
if(lengthR>=0)
if((lengthR <=R1 &&lengthR<= R2)||(lengthR>=R2 && lengthR>=R1))
return RTERROR;
if(lengthR<0)
if(-lengthR > H1*cos(ang))
return RTERROR;
AcGePoint3d point,center1,point1;
AcGeVector3d L,Lnormal,generatrix;
double z;
if(lengthR>=0)
{
z=H1*(R1-lengthR)/(R1-R2);
center1=m_ptStart+vect1*z;
point=center1+vec*lengthR;
}
else
{
if (R1>=R2)
{
z=-lengthR/cos(ang) ;
center1=m_ptStart+vect1*z;
point=center1+vec*(R1-z*(R1-R2)/H1);
}
else
{
vect=-vect;
vect1=-vect1;
ang=vect.angleTo(vect1);
z=-lengthR/cos(ang) ;
center1=m_ptEnd+vect1*z;
point=center1+vec*(R2-z*(R2-R1)/H1);
}
}
point1=m_ptStart+vec*R1;
generatrix=(point-point1).normalize();
L=generatrix.crossProduct(vec);
Lnormal=L.crossProduct(generatrix);
Lnormal.normalize();
pt[0]=point.x;
pt[1]=point.y;
pt[2]=point.z;
normal[0]=Lnormal.x;
normal[1]=Lnormal.y;
normal[2]=Lnormal.z;
return RTNORM;
}//added by linlin 20051012
示例13: getAngle
double DoubleLine::getAngle() const
{
AcGeVector3d v = m_endPt - m_startPt;
return v.angleTo( AcGeVector3d::kXAxis, -AcGeVector3d::kZAxis );
}