本文整理汇总了C++中AcGeMatrix3d::setCoordSystem方法的典型用法代码示例。如果您正苦于以下问题:C++ AcGeMatrix3d::setCoordSystem方法的具体用法?C++ AcGeMatrix3d::setCoordSystem怎么用?C++ AcGeMatrix3d::setCoordSystem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcGeMatrix3d
的用法示例。
在下文中一共展示了AcGeMatrix3d::setCoordSystem方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
ArxDbgDbEntity::getEcs(AcGeMatrix3d& retVal) const
{
AcGeVector3d yDir = m_zDir.crossProduct(m_xDir);
retVal.setCoordSystem(m_origin, m_xDir, yDir.normal(), m_zDir);
}
示例2: applyPartialUndo
Acad::ErrorStatus
AsdkBody::applyPartialUndo(AcDbDwgFiler* filer, AcRxClass* classObj)
{
if (AsdkBody::desc() != classObj)
return AcDbEntity::applyPartialUndo( filer, classObj );
Adesk::Int16 opCode;
filer->readItem( &opCode );
switch (opCode)
{
case 555: // It is a transformBy() operation
{
// filer->readBytes( &mat, sizeof AcGeMatrix3d );
AcGeMatrix3d mat;
AcGeVector3d x, y, z;
AcGePoint3d o;
filer->readItem( &o );
filer->readItem( &x );
filer->readItem( &y );
filer->readItem( &z );
mat.setCoordSystem( o, x, y, z );
mat.invert();
transformBy( mat );
}
break;
default:
break;
}
return Acad::eOk;
}
示例3: 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);
}
示例4: pos
Adesk::Boolean
AsdkTextStyleSamp::worldDraw(AcGiWorldDraw* pW)
{
AcGePoint3d pos(4.0, 4.0, 0.0);
AcGeVector3d norm(0.0, 0.0, 1.0);
AcGeVector3d dir(-1.0, -0.2, 0.0);
char *pStr = "This is a percent, '%%%'.";
int len = strlen(pStr);
AcGiTextStyle style;
AcGeVector3d vec = norm;
vec = vec.crossProduct(dir);
dir = vec.crossProduct(norm);
style.setFileName("txt.shx");
style.setBigFontFileName("");
int status;
if (!((status = style.loadStyleRec()) & 1))
pStr = "Font not found.";
pW->geometry().text(pos, norm, dir, pStr, len,
Adesk::kFalse, style);
pos.y += 2.0;
style.setTrackingPercent(0.8);
style.setObliquingAngle(0.5);
AcGePoint2d ext = style.extents(pStr, Adesk::kFalse,
strlen(pStr), Adesk::kFalse);
pW->geometry().text(pos, norm, dir, pStr, len,
Adesk::kFalse, style);
// Draw a rectangle around the last text drawn.
// First you have to create a polyline the size of the
// bounding box, then you have to transform it to the
// correct orientation, and then to the location of the
// text.
// Compute the matrix that orients the box.
//
AcGeMatrix3d textMat;
norm.normalize();
dir.normalize();
AcGeVector3d yAxis = norm;
yAxis = yAxis.crossProduct(dir);
yAxis.normalize();
textMat.setCoordSystem(AcGePoint3d(0.0, 0.0, 0.0), dir,
yAxis, norm);
// Create the bounding box and enlarge it somewhat.
//
double offset = ext.y / 2.0;
AcGePoint3d verts[5];
verts[0] = verts[4] = AcGePoint3d(-offset, -offset, 0.0);
verts[1] = AcGePoint3d(ext.x + offset, -offset, 0.0);
verts[2] = AcGePoint3d(ext.x + offset, ext.y + offset, 0.0);
verts[3] = AcGePoint3d(-offset, ext.y + offset, 0.0);
// Orient and then translate each point in the
// bounding box.
//
for (int i = 0; i < 5; i++) {
verts[i].transformBy(textMat);
verts[i].x += pos.x;
verts[i].y += pos.y;
verts[i].z += pos.z;
}
pW->geometry().polyline(5, verts);
return Adesk::kTrue;
}