本文整理汇总了C++中NURBSSet::AppendObject方法的典型用法代码示例。如果您正苦于以下问题:C++ NURBSSet::AppendObject方法的具体用法?C++ NURBSSet::AppendObject怎么用?C++ NURBSSet::AppendObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NURBSSet
的用法示例。
在下文中一共展示了NURBSSet::AppendObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NURBSPointCurve
static void
AddObjectsForJoinTests(NURBSSet &nset, int &c1, int &c2, int &s1, int &s2)
{
NURBSIndependentPoint pt;
NURBSPointCurve *c = new NURBSPointCurve();
c->SetName(GetString(IDS_J_PT_CRV1));
c->SetNumPts(3);
pt.SetPosition(0, Point3(100, 0, -100));
c->SetPoint(0, pt);
pt.SetPosition(0, Point3(200, 0, -100));
c->SetPoint(1, pt);
pt.SetPosition(0, Point3(200, 100, -100));
c->SetPoint(2, pt);
c1 = nset.AppendObject(c);
c = new NURBSPointCurve();
c->SetName(GetString(IDS_J_PT_CRV2));
c->SetNumPts(3);
pt.SetPosition(0, Point3(210, 110, -100));
c->SetPoint(0, pt);
pt.SetPosition(0, Point3(300, 200, -100));
c->SetPoint(1, pt);
pt.SetPosition(0, Point3(300, 100, -100));
c->SetPoint(2, pt);
c2 = nset.AppendObject(c);
NURBSPointSurface *s = new NURBSPointSurface();
s->SetName(GetString(IDS_J_PT_SRF1));
s->SetNumPts(2, 2);
pt.SetPosition(0, Point3(200, 0, -100));
s->SetPoint(0, 0, pt);
pt.SetPosition(0, Point3(200, 100, -100));
s->SetPoint(0, 1, pt);
pt.SetPosition(0, Point3(300, 0, -100));
s->SetPoint(1, 0, pt);
pt.SetPosition(0, Point3(300, 100, -100));
s->SetPoint(1, 1, pt);
s1 = nset.AppendObject(s);
s = new NURBSPointSurface();
s->SetName(GetString(IDS_J_PT_SRF2));
s->SetNumPts(2, 2);
pt.SetPosition(0, Point3(310, 0, -100));
s->SetPoint(0, 0, pt);
pt.SetPosition(0, Point3(310, 100, -100));
s->SetPoint(0, 1, pt);
pt.SetPosition(0, Point3(400, 0, -100));
s->SetPoint(1, 0, pt);
pt.SetPosition(0, Point3(400, 100, -100));
s->SetPoint(1, 1, pt);
s2 = nset.AppendObject(s);
}
示例2: NURBSCVCurve
static void
AddObjectsForBreakTests(NURBSSet &nset, int &c1, int &s1)
{
NURBSCVCurve *c = new NURBSCVCurve();
c->SetName(GetString(IDS_BREAK_CURVE));
c->SetNumCVs(4);
c->SetOrder(4);
c->SetNumKnots(8);
for (int k = 0; k < 4; k++) {
c->SetKnot(k, 0.0);
c->SetKnot(k+4, 1.0);
}
NURBSControlVertex cv;
cv.SetPosition(0, Point3(200, 0, 50));
c->SetCV(0, cv);
cv.SetPosition(0, Point3(300, 0, 50));
c->SetCV(1, cv);
cv.SetPosition(0, Point3(300, -100, 50));
c->SetCV(2, cv);
cv.SetPosition(0, Point3(200, -100, 50));
c->SetCV(3, cv);
c1 = nset.AppendObject(c);
NURBSCVSurface *s = new NURBSCVSurface();
s->SetName(GetString(IDS_BREAK_SURFACE));
s->SetNumCVs(4, 4);
s->SetUOrder(4);
s->SetVOrder(4);
s->SetNumUKnots(8);
s->SetNumVKnots(8);
for (k = 0; k < 4; k++) {
s->SetUKnot(k, 0.0);
s->SetVKnot(k, 0.0);
s->SetUKnot(k+4, 1.0);
s->SetVKnot(k+4, 1.0);
}
for (int u = 0; u < 4; u++) {
float up = 100.0f * ((float)u/3.0f);
for (int v = 0; v < 4; v++) {
float vp = 100.0f * ((float)v/3.0f);
cv.SetPosition(0, Point3(-150.0f + up, -100.0f + vp, -200.0f));
s->SetCV(u, v, cv);
}
}
s1 = nset.AppendObject(s);
}
示例3: ScaleMatrix
int
APITestUtil::MakeTestUVLoftSurface(NURBSSet &nset)
{
Matrix3 scale = ScaleMatrix(Point3(50, 50, 50));
Matrix3 rotate = RotateZMatrix(PI/2.0f);
int cu0 = P1Curve(nset, scale * TransMatrix(Point3(0, 0, 0)));
int cu1 = P1Curve(nset, scale * TransMatrix(Point3(0, 0, 20)));
int cu2 = P1Curve(nset, scale * TransMatrix(Point3(0, 0, 40)));
int cv0 = P2Curve(nset, TransMatrix(Point3(50, 50, 0)));
int cv1 = P2Curve(nset, TransMatrix(Point3(-50, 50, 0)));
int cv2 = P2Curve(nset, TransMatrix(Point3(-50, -50, 0)));
int cv3 = P2Curve(nset, TransMatrix(Point3(50, -50, 0)));
NURBSUVLoftSurface *s = new NURBSUVLoftSurface();
s->SetName(GetString(IDS_UVLOFT_SURFACE));
s->SetNSet(&nset);
s->AppendUCurve(cu0);
s->AppendUCurve(cu1);
s->AppendUCurve(cu2);
s->AppendVCurve(cv0);
s->AppendVCurve(cv1);
s->AppendVCurve(cv2);
s->AppendVCurve(cv3);
return nset.AppendObject(s);
}
示例4: NURBSCVSurface
int
APITestUtil::MakeTestCVSurface(NURBSSet &nset, Matrix3 mat, BOOL rigid)
{
NURBSCVSurface *s = new NURBSCVSurface();
s->SetRigid(rigid);
s->SetName(GetString(IDS_CV_SURFACE));
s->SetNumCVs(4, 4);
s->SetUOrder(4);
s->SetVOrder(4);
s->SetNumUKnots(8);
s->SetNumVKnots(8);
for (int k = 0; k < 4; k++) {
s->SetUKnot(k, 0.0);
s->SetVKnot(k, 0.0);
s->SetUKnot(k+4, 1.0);
s->SetVKnot(k+4, 1.0);
}
NURBSControlVertex cv;
for (int u = 0; u < 4; u++) {
float up = 100.0f * ((float)u/3.0f);
for (int v = 0; v < 4; v++) {
float vp = 100.0f * ((float)v/3.0f);
cv.SetPosition(0, mat * Point3(-150.0f + up, -100.0f + vp, 0.0f));
TCHAR name[20];
_stprintf(name, _T("%s[%d,%d]"), GetString(IDS_CV), u, v);
cv.SetName(name);
s->SetCV(u, v, cv);
}
}
return nset.AppendObject(s);
}
示例5: NURBSPointSurface
int
APITestUtil::MakeTestPointSurface(NURBSSet &nset, Matrix3 mat)
{
NURBSPointSurface *s = new NURBSPointSurface();
s->SetName(GetString(IDS_POINT_SURFACE));
s->SetNumPts(2, 2);
NURBSIndependentPoint pt;
pt.SetPosition(0, mat * Point3(20, 0, 0));
TCHAR name[32];
_stprintf(name, _T("%s [%d,%d]"), GetString(IDS_POINT), 0, 0);
pt.SetName(name);
s->SetPoint(0, 0, pt);
pt.SetPosition(0, mat * Point3(20, 0, 100));
_stprintf(name, _T("%s [%d,%d]"), GetString(IDS_POINT), 0, 1);
pt.SetName(name);
s->SetPoint(0, 1, pt);
pt.SetPosition(0, mat * Point3(120, 0, 0));
_stprintf(name, _T("%s [%d,%d]"), GetString(IDS_POINT), 1, 0);
pt.SetName(name);
s->SetPoint(1, 0, pt);
pt.SetPosition(0, mat * Point3(120, 0, 100));
_stprintf(name, _T("%s [%d,%d]"), GetString(IDS_POINT), 1, 1);
pt.SetName(name);
s->SetPoint(1, 1, pt);
return nset.AppendObject(s);
}
示例6: NURBSIndependentPoint
int
APITestUtil::MakeTestPoint(NURBSSet &nset)
{
NURBSIndependentPoint *p = new NURBSIndependentPoint();
p->SetName(GetString(IDS_POINT));
p->SetPosition(0, Point3(75, -75, 0));
return nset.AppendObject(p);
}
示例7: NURBSOffsetSurface
int
APITestUtil::MakeTestOffsetSurface(NURBSSet &nset, int p)
{
NURBSOffsetSurface *s = new NURBSOffsetSurface();
s->SetName(GetString(IDS_OFFSET_SURFACE));
s->SetNSet(&nset);
s->SetParent(p);
s->SetDistance(0, 20.0);
return nset.AppendObject(s);
}
示例8: NURBSPointConstPoint
int
APITestUtil::MakeTestPointCPoint(NURBSSet &nset, int p1)
{
NURBSPointConstPoint *p = new NURBSPointConstPoint();
p->SetName(GetString(IDS_POINT_CONST_POINT));
p->SetParent(p1);
p->SetPointType(kNConstOffset);
p->SetOffset(0, Point3(20, -20, 20));
return nset.AppendObject(p);
}
示例9: NURBSCurveConstPoint
int
APITestUtil::MakeTestCurveCPoint(NURBSSet &nset, int p1)
{
NURBSCurveConstPoint *p = new NURBSCurveConstPoint();
p->SetName(GetString(IDS_CURVE_CONST_POINT));
p->SetParent(p1);
p->SetUParam(0, 0.5);
p->SetPointType(kNConstNormal);
p->SetNormal(0, 15.0f);
return nset.AppendObject(p);
}
示例10: NURBSIsoCurve
static int
AddTestIsoCurve(NURBSSet &nset, NURBSId id)
{
NURBSIsoCurve *c = new NURBSIsoCurve();
c->SetName(GetString(IDS_ADDED_ISO_CURVE));
c->SetNSet(&nset);
c->SetParentId(id);
c->SetParam(0, 0.6);
c->SetDirection(FALSE); // not U
return nset.AppendObject(c);
}
示例11: NURBSExtrudeSurface
int
APITestUtil::MakeTestExtrudeSurface(NURBSSet &nset, int p1)
{
NURBSExtrudeSurface *s = new NURBSExtrudeSurface();
s->SetName(GetString(IDS_EXTRUDE_SURFACE));
s->SetNSet(&nset);
s->SetParent(p1);
s->SetDistance(0, 50);
s->FlipNormals(TRUE);
return nset.AppendObject(s);
}
示例12: NURBSULoftSurface
int
APITestUtil::MakeTestULoftSurface(NURBSSet &nset, int p1, int p2, int p3)
{
NURBSULoftSurface *s = new NURBSULoftSurface();
s->SetName(GetString(IDS_ULOFT_SURFACE));
s->SetNSet(&nset);
s->AppendCurve(p1, FALSE);
s->AppendCurve(p2, FALSE);
s->AppendCurve(p3, FALSE);
s->FlipNormals(TRUE);
return nset.AppendObject(s);
}
示例13: NURBSRuledSurface
int
APITestUtil::MakeTestRuledSurface(NURBSSet &nset, int p1, int p2)
{
NURBSRuledSurface *s = new NURBSRuledSurface();
s->SetName(GetString(IDS_RULED_SURFACE));
s->SetNSet(&nset);
s->SetParent(0, p1);
s->SetParent(1, p2);
s->SetFlip(0, FALSE);
s->SetFlip(1, FALSE);
return nset.AppendObject(s);
}
示例14: NURBSBlendSurface
int
APITestUtil::MakeTestBlendSurface(NURBSSet &nset, int p1, int p2)
{
NURBSBlendSurface *s = new NURBSBlendSurface();
s->SetName(GetString(IDS_BLEND_SURFACE));
s->SetNSet(&nset);
s->SetParent(0, p1);
s->SetParent(1, p2);
s->SetEdge(0, 1); // make it the High U edge
return nset.AppendObject(s);
}
示例15: NURBSXFormSurface
int
APITestUtil::MakeTestXFormSurface(NURBSSet &nset, int p)
{
NURBSXFormSurface *s = new NURBSXFormSurface();
s->SetName(GetString(IDS_XFORM_SURFACE));
s->SetNSet(&nset);
s->SetParent(p);
Matrix3 mat;
mat.IdentityMatrix();
mat.SetTrans(Point3(-150, 150, 0));
s->SetXForm(0, mat);
return nset.AppendObject(s);
}