这篇教程C++ AcGeVector3d类代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AcGeVector3d类的典型用法代码示例。如果您正苦于以下问题:C++ AcGeVector3d类的具体用法?C++ AcGeVector3d怎么用?C++ AcGeVector3d使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。 在下文中一共展示了AcGeVector3d类的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: CheackTubeLenthstatic 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;}
开发者ID:yuechuanbingzhi163,项目名称:GDES,代码行数:25,
示例2: ASSERTAcad::ErrorStatusArxDbgDbEntity::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;}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:34,
示例3: _Tvoid 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;}
开发者ID:yuechuanbingzhi163,项目名称:GDES,代码行数:31,
示例4: extendByLengthvoid SingleTunnelDraw::extendByLength( double length ){ AcGeVector3d v = m_endPt - m_startPt; v.normalize(); m_endPt = m_endPt + v * length; // 修改末点坐标}
开发者ID:kanbang,项目名称:myexercise,代码行数:7,
示例5: ASSERTvoidArxDbgUtils::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);}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:27,
示例6: assertReadEnableddouble LinkedGE::getAngle() const{ assertReadEnabled(); AcGeVector3d v = m_endPt - m_startPt; return v.angleTo( AcGeVector3d::kXAxis, -AcGeVector3d::kZAxis );}
开发者ID:kanbang,项目名称:myexercise,代码行数:7,
示例7: assertReadEnabledAcGeVector3d PDEcone::getFaceVect() const{ assertReadEnabled(); AcGeVector3d centerVect = m_ptEnd - m_ptStart; AcGeVector3d tmpV1 = centerVect.crossProduct(m_vect); return m_vect.crossProduct(tmpV1).normal();}
开发者ID:wangfeilong321,项目名称:PDMS_ExportModel,代码行数:7,
示例8: DrawArcvoid 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 );}
开发者ID:kanbang,项目名称:myexercise,代码行数:28,
示例9: getEndPointInExtendAngleAcGeVector3d DoubleLine::getEndPointInExtendAngle() const{ AcGeVector3d v = m_endPt - m_startPt; v.rotateBy( PI, AcGeVector3d::kZAxis ); // 旋转180度 return v;}
开发者ID:kanbang,项目名称:myexercise,代码行数:7,
示例10: updatevoid 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 );}
开发者ID:kanbang,项目名称:myexercise,代码行数:7,
示例11: voidArxDbgDbEntity::getEcs(AcGeMatrix3d& retVal) const{ AcGeVector3d yDir = m_zDir.crossProduct(m_xDir); retVal.setCoordSystem(m_origin, m_xDir, yDir.normal(), m_zDir);}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:7,
示例12: createSmileyvoidcreateSmiley(){ 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();}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:25,
示例13: caclHeadPointAcGePoint3d DoubleTTunnelDraw::caclHeadPoint(){ AcGeVector3d v = m_endPt - m_startPt; v.normalize(); // 单位方向向量 v = v * m_distance; return m_endPt + v;}
开发者ID:kanbang,项目名称:myexercise,代码行数:8,
示例14: extendByLengthvoid GasPumpGEDraw::extendByLength( double length ){ AcGeVector3d v = m_endPt - m_startPt; v.normalize(); m_endPt = m_endPt + v * length; // 更新末点坐标 update();}
开发者ID:wyrover,项目名称:GDES,代码行数:8,
示例15: extendByLengthvoid DoubleTunnelDraw::extendByLength( double length ){ AcGeVector3d v = m_endPt - m_startPt; v.normalize(); m_endPt = m_endPt + v * length; // 更新末点坐标 update(); // 更新其它参数}
开发者ID:kanbang,项目名称:myexercise,代码行数:8,
示例16: assertReadEnableddoubleArxDbgDbEntity::rotation() const{ assertReadEnabled(); AcGeVector3d xAxis; ArxDbgUtils::getEcsXAxis(m_zDir, xAxis); // get AutoCAD's arbitrary X-Axis return xAxis.angleTo(m_xDir, m_zDir);}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:9,
示例17: rx_makeArcAcad::ErrorStatus rx_makeArc(const AcGePoint3d pt1, const AcGePoint3d pt2, double bulge, const AcGeVector3d entNorm, AcGeCircArc3d& arc){ Acad::ErrorStatus es = Acad::eOk; // The points that are coming in are in ECS. These are actually // 2d points, may be with an elevation in the z coord. // // Therefore, let's create a 2d arc from these values and transform // the relevant data of the arc for creating a 3d arc. AcGeCircArc2d arc2d; AcGePoint2d p1, p2; assert(fabs(pt1[Z] - pt2[Z]) < 1.0e-10); p1.set(pt1[X], pt1[Y]); p2.set(pt2[X], pt2[Y]); arc2d.set(p1, p2, bulge); AcGePoint3d center((arc2d.center())[X], (arc2d.center())[Y], pt1[Z]); AcGePoint3d startPnt((arc2d.startPoint())[X], (arc2d.startPoint())[Y], pt1[Z]); AcGePoint3d endPnt((arc2d.endPoint())[X], (arc2d.endPoint())[Y], pt1[Z]); // If the arc is CW, flip the normal. AcGeVector3d norm; if (arc2d.startAng() > arc2d.endAng()) { norm.set(0, 0, -1); } else { norm.set(0, 0, 1); } double incAng = fabs(arc2d.endAng() - arc2d.startAng()); // Transform all the data to WCS. acdbEcs2Wcs(asDblArray(center), asDblArray(center), asDblArray(entNorm), Adesk::kFalse); acdbEcs2Wcs(asDblArray(startPnt), asDblArray(startPnt), asDblArray(entNorm), Adesk::kFalse); acdbEcs2Wcs(asDblArray(endPnt), asDblArray(endPnt), asDblArray(entNorm), Adesk::kFalse); acdbEcs2Wcs(asDblArray(norm), asDblArray(norm), asDblArray(entNorm), Adesk::kTrue); arc.set(center, norm, norm.perpVector(), (startPnt - center).length(), 0, incAng); return es;}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:56,
示例18: AddDirectionstatic 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 );}
开发者ID:kanbang,项目名称:myexercise,代码行数:10,
示例19: userToLocalAngle//===================================================================double userToLocalAngle(const AcGeVector3d& normal, const AcGeVector3d& ucsXdir){ AcGeMatrix3d wcsToLcs = AcGeMatrix3d::worldToPlane(normal); AcGeVector3d xDir = ucsXdir; xDir.transformBy(wcsToLcs); double angle = atan2(xDir.y, xDir.x); return angle; //return fixAngle(angle);}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:11,
示例20: arcAcGeVector3d 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;}
开发者ID:kanbang,项目名称:TIDS,代码行数:11,
示例21: _tstofvoid GasPumpGEDraw::readPropertyDataFromGE( const AcStringArray& values ){ CString strLenth; strLenth.Format(_T("%s"),values[0].kACharPtr()); m_radius = _tstof(strLenth); if( 0 >= m_radius ) m_radius = 3; AcGeVector3d v = m_endPt - m_startPt; v.normalize(); m_endPt = m_startPt + v * m_radius;}
开发者ID:wyrover,项目名称:GDES,代码行数:11,
示例22: caclEndPointvoid 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;}
开发者ID:hunanhd,项目名称:cbm,代码行数:11,
示例23: caclEndPointvoid 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;}
开发者ID:kanbang,项目名称:myexercise,代码行数:11,
示例24: assertWriteEnabledAcad::ErrorStatusArxDbgDbEntity::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;}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:13,
示例25: EffectRanDrawedstatic void EffectRanDrawed(AcDbObjectId ttunel){ AcTransaction *pTrans = actrTransactionManager->startTransaction(); if ( 0 == pTrans ) return; AcDbObject *pObj; if (Acad::eOk != pTrans->getObject(pObj,ttunel,AcDb::kForRead)) return; TTunnel *pTTunnel = TTunnel::cast(pObj); if ( 0 == pTTunnel) { actrTransactionManager->abortTransaction(); return; } AcGePoint3d spt,ept; pTTunnel->getSEPoint(spt,ept); double angle = pTTunnel->getAngle(); actrTransactionManager->endTransaction(); AcDbObjectIdArray eTags; DrawHelper::GetTagGEById2( ttunel, _T( "EffectRanTagGE" ), eTags ); if (!eTags.isEmpty()) { ArxEntityHelper::EraseObjects( eTags, true ); } AcGeVector3d v = ept - spt; double diatance = v.length(); CString area,way; if(!DataHelper::GetPropertyData(ttunel,_T("断面面积"),area)) return; if(!DataHelper::GetPropertyData(ttunel,_T("通风方法"),way)) return; double minDistan,maxDistan; if(way.IsEmpty()) return; if(area.IsEmpty()) return; if (_T("压入式") == way || _T("长压短抽") == way) { minDistan = 4*sqrtf(_tstof(area)); maxDistan = 5*sqrtf(_tstof(area)); } else { minDistan = 0; maxDistan = 1.5*sqrtf(_tstof(area)); } EffectRanTagGE *pTag = new EffectRanTagGE(ept,angle,minDistan,maxDistan,diatance*0.1); if (0 == pTag) return; pTag->setRelatedGE(ttunel); if( !ArxUtilHelper::PostToModelSpace( pTag ) ) delete pTag;}
开发者ID:yuechuanbingzhi163,项目名称:GDES,代码行数:51,
示例26: createEllipse// This function uses the AcEdJig mechanism to create and// drag an ellipse entity. The creation criteria are// slightly different from the AutoCAD command. In this// case, the user selects an ellipse center point and then,// drags to visually select the major and minor axes// lengths. This sample is somewhat limited; if the// minor axis ends up longer than the major axis, then the// ellipse will just be round because the radius ratio// cannot be greater than 1.0.//voidcreateEllipse(){ // First, have the user select the ellipse center point. // We don't use the jig for this because there is // nothing to see yet. // AcGePoint3d tempPt; struct resbuf rbFrom, rbTo; acedGetPoint(NULL, _T("/nEllipse center point: "), asDblArray(tempPt)); // The point we just got is in UCS coordinates, but // AcDbEllipse works in WCS, so convert the point. // rbFrom.restype = RTSHORT; rbFrom.resval.rint = 1; // from UCS rbTo.restype = RTSHORT; rbTo.resval.rint = 0; // to WCS acedTrans(asDblArray(tempPt), &rbFrom, &rbTo, Adesk::kFalse, asDblArray(tempPt)); // Now you need to get the current UCS z-Axis to be used // as the normal vector for the ellipse. // AcGeVector3d x = acdbHostApplicationServices()->workingDatabase() ->ucsxdir(); AcGeVector3d y = acdbHostApplicationServices()->workingDatabase() ->ucsydir(); AcGeVector3d normalVec = x.crossProduct(y); normalVec.normalize(); // Create an AsdkEllipseJig object passing in the // center point just selected by the user and the normal // vector just calculated. // AsdkEllipseJig *pJig = new AsdkEllipseJig(tempPt, normalVec); // Now start up the jig to interactively get the major // and minor axes lengths. // pJig->doIt(); // Now delete the jig object, since it is no longer needed. // delete pJig;}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:60,
示例27: acutPrintfvoid Additional_Class::RotateEnt( AcDbObjectId EntID, double RotateAng, AcGePoint3d InpPt){ AcDbEntity *pEnt_Temp; if (acdbOpenAcDbEntity(pEnt_Temp, EntID, AcDb::kForWrite) != Acad::eOk) { acutPrintf(_T("/nOPEN ERROR")); return; } AcGeMatrix3d tt; AcGeVector3d zAxis; zAxis.set(0,0,1); tt.setToRotation(RotateAng, zAxis, InpPt); pEnt_Temp->transformBy(tt); pEnt_Temp->close();}
开发者ID:TobeGodman,项目名称:AutoTrader,代码行数:15,
示例28: acdbHostApplicationServicesAcGeVector3dArxDbgUtils::wcsToUcs(const AcGeVector3d& vec){ AcDbDatabase* db = acdbHostApplicationServices()->workingDatabase(); ASSERT(db != NULL); AcGeMatrix3d m; getWcsToUcsMatrix(m, db); AcGeVector3d newv = vec; newv.transformBy(m); return newv;}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:15,
注:本文中的AcGeVector3d类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ AcStringArray类代码示例 C++ AcGePoint3dArray类代码示例 |