本文整理汇总了C++中AcGeVector3d::perpVector方法的典型用法代码示例。如果您正苦于以下问题:C++ AcGeVector3d::perpVector方法的具体用法?C++ AcGeVector3d::perpVector怎么用?C++ AcGeVector3d::perpVector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcGeVector3d
的用法示例。
在下文中一共展示了AcGeVector3d::perpVector方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: center
Acad::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;
}
示例2: es
void
AcCircle::gripDimensionCbackfn( AcDbGripData* pThis,
const AcDbObjectId& entId,
double dimScale,
AcDbDimDataPtrArray& dimData)
{
std::string *pszAppData = static_cast<std::string *>(pThis->appData());
AcDbEntity *pEnt = NULL;
Acad::ErrorStatus es(Acad::eNotImplementedYet);
if( Acad::eOk != acdbOpenAcDbEntity(pEnt,entId,AcDb::kForRead) ){
acutPrintf("\n Error in returning valid pointer to an Entity");
return;
}
AcCircle *pCircle = static_cast<AcCircle *>(pEnt);
mentId = entId;
AcGeVector3d mNormal = pCircle->normal();
AcGeVector3d NormalDir = pCircle->normal();
AcGeVector3d horizDir = mNormal.perpVector();
AcGeVector3d vertDir = mNormal.crossProduct(horizDir);
AcGePoint3d center = pCircle->Center();
double radius = pCircle->radius();
int dimIndex1(0);
AcGePoint3d points[5] =
{
center,
center + radius * horizDir,
center + radius * vertDir,
center - radius * horizDir,
center - radius * vertDir
};
AcGePoint3d dimPt1,dimPt2;
AcDb2LineAngularDimension *pDim1 = new AcDb2LineAngularDimension ();
pDim1->setDatabaseDefaults();
pDim1->setNormal(NormalDir);
if( *pszAppData == "First")
{
dimIndex1 =1;
dimPt1 = center + (1.5 * radius + 0.5 * dimScale) * horizDir;
pDim1->setXLine1Start(points[0]);
pDim1->setXLine1End(points[1]);
pDim1->setXLine2Start(points[0]);
pDim1->setXLine2End(points[2]);
pDim1->setArcPoint(dimPt1);
}
else if( *pszAppData == "Second")
{
dimIndex1=2;
dimPt1 = center + (1.5* radius + 0.5 * dimScale) * vertDir;
pDim1->setXLine1Start(points[0]);
pDim1->setXLine1End(points[2]);
pDim1->setXLine2Start(center);
pDim1->setXLine2End(points[3]);
pDim1->setArcPoint(dimPt1);
}
else if(*pszAppData == "Third")
{
dimIndex1=3;
dimPt1 = center - (1.5*radius + 0.5 * dimScale) * horizDir;
pDim1->setXLine1Start(points[0]);
pDim1->setXLine1End(points[3]);
pDim1->setXLine2Start(points[0]);
pDim1->setXLine2End(points[4]);
pDim1->setArcPoint(dimPt1);
}
else if( *pszAppData == "Fourth")
{
dimIndex1=4;
dimPt1 = center - (1.5 * radius + 0.5 * dimScale) * vertDir;
pDim1->setXLine1Start(points[0]);
pDim1->setXLine1End(points[4]);
pDim1->setXLine2Start(points[0]);
pDim1->setXLine2End(points[1]);
pDim1->setArcPoint(dimPt1);
}
unsigned int bitFlags(0);
//.........这里部分代码省略.........