本文整理汇总了C++中AcGeVector3d::set方法的典型用法代码示例。如果您正苦于以下问题:C++ AcGeVector3d::set方法的具体用法?C++ AcGeVector3d::set怎么用?C++ AcGeVector3d::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcGeVector3d
的用法示例。
在下文中一共展示了AcGeVector3d::set方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: extractEntityInfo
static int extractEntityInfo(struct resbuf *rb,
int& sel_method,
ads_name ename,
ads_name subname,
short& marker,
AcGePoint3d& pickpnt,
AcGeVector3d& pickvec)
{
if ( rb == NULL || rb->restype != RTLB )
{
assert(0);
return 0;
}
// Get the selection method.
//
rb = rb->rbnext; // Bump up to the selection method, always after RTLB.
sel_method = rb->resval.rint;
// Get the first ename (could be either the actual entity name or
// subentity name).
//
rb = rb->rbnext; // Bump up to the first name, always after sel method.
ename[0] = rb->resval.rlname[0];
ename[1] = rb->resval.rlname[1];
subname[0] = rb->resval.rlname[0];
subname[1] = rb->resval.rlname[1];
// Get marker info.
//
rb = rb->rbnext;
marker = rb->resval.rint;
// Get the pick location and vector, only for PICK and FENCE. For FENCE,
// we take the first intersection with the entity as the pick location.
//
if ( sel_method == PICK_METH ||
sel_method == FENCE_METH)
{
rb = rb->rbnext; // Skip to RTLB for pick location.
rb = rb->rbnext; // Skip to point description info.
rb = rb->rbnext; // Skip to the pick location.
pickpnt.set( rb->resval.rpoint[0],
rb->resval.rpoint[1],
rb->resval.rpoint[2] );
rb = rb->rbnext; // Will be normal vector if we're not in XY view.
// Otherwise, it'll be an RTLE for pick location.
if ( rb->restype == RT3DPOINT )
{
pickvec.set( rb->resval.rpoint[0],
rb->resval.rpoint[1],
rb->resval.rpoint[2] );
rb = rb->rbnext; // Make it point to the RTLE for the pick location.
}
}
return CONTINUE;
}
示例3: RotateEnt
void 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();
}
示例4: hardErrMsg
Adesk::Boolean
AecUiPrSubentity::retrievePickDataAt(long index)
{
AecRmCString hardErrMsg(GetAecUiBaseAppName(), AECU_STR_RETRIEVEPICKDATAAT_AECUIPRSUBENTITY_ERROR_COULD_NOT, TRUE); //~ "\nERROR: could not retreive pick data!"
resbuf* rb;
ads_name selSet;
m_ss.asAdsName(selSet);
if (ads_ssnamex(&rb, selSet, index) != RTNORM)
return Adesk::kFalse;
// find out the objectId of the item picked
AcDbObjectId mainId;
ads_name ent;
ads_ssname(selSet, index, ent);
if (Aec::enameToObjId(ent, mainId) != Acad::eOk) {
ads_printf(hardErrMsg);
return Adesk::kFalse;
}
resbuf* tmp = rb;
if ((tmp == NULL) || (tmp->restype != RTLB)) { // should start with this
AEC_ASSERT(0);
ads_relrb(rb);
ads_printf(hardErrMsg);
return Adesk::kFalse;
}
// second element is selection method, which should always be pickPt=1
tmp = tmp->rbnext;
if ((tmp == NULL) || (tmp->restype != RTSHORT) || (tmp->resval.rint != 1)) {
AEC_ASSERT(0);
ads_relrb(rb);
ads_printf(hardErrMsg);
return Adesk::kFalse;
}
// third element is entity name of object selected
tmp = tmp->rbnext;
if ((tmp == NULL) || (tmp->restype != RTENAME)) {
AEC_ASSERT(0);
ads_relrb(rb);
ads_printf(hardErrMsg);
return Adesk::kFalse;
}
// fourth element is the gsMarker
tmp = tmp->rbnext;
if ((tmp == NULL) || (tmp->restype != RTSHORT)) {
AEC_ASSERT(0);
ads_relrb(rb);
ads_printf(hardErrMsg);
return Adesk::kFalse;
}
int gsMarker = tmp->resval.rint;
// fifth element is start of list for pickPt
tmp = tmp->rbnext;
if ((tmp == NULL) || (tmp->restype != RTLB)) {
AEC_ASSERT(0);
ads_relrb(rb);
ads_printf(hardErrMsg);
return Adesk::kFalse;
}
// sixth element is point descriptor
tmp = tmp->rbnext;
if ((tmp == NULL) || (tmp->restype != RTSHORT)) {
AEC_ASSERT(0);
ads_relrb(rb);
ads_printf(hardErrMsg);
return Adesk::kFalse;
}
// seventh element is pick point
tmp = tmp->rbnext;
if ((tmp == NULL) || (tmp->restype != RT3DPOINT)) {
AEC_ASSERT(0);
ads_relrb(rb);
ads_printf(hardErrMsg);
return Adesk::kFalse;
}
AcGePoint3d pickPt(tmp->resval.rpoint[0], tmp->resval.rpoint[1], tmp->resval.rpoint[2]);
// eigth element is either end of list or the direction vector
tmp = tmp->rbnext;
if (tmp == NULL) {
AEC_ASSERT(0);
ads_relrb(rb);
ads_printf(hardErrMsg);
return Adesk::kFalse;
}
AcGeVector3d pickVector;
if (tmp->restype == RT3DPOINT)
pickVector.set(tmp->resval.rpoint[0], tmp->resval.rpoint[1], tmp->resval.rpoint[2]);
else
//.........这里部分代码省略.........