当前位置: 首页>>代码示例>>C++>>正文


C++ NURBSSet类代码示例

本文整理汇总了C++中NURBSSet的典型用法代码示例。如果您正苦于以下问题:C++ NURBSSet类的具体用法?C++ NURBSSet怎么用?C++ NURBSSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了NURBSSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AddObjectsForJoinTests

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);
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:53,代码来源:srf_test.cpp

示例2: AddObjectsForBreakTests

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);
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:50,代码来源:srf_test.cpp

示例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);
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:28,代码来源:crt_srf.cpp

示例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);
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:33,代码来源:crt_srf.cpp

示例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);
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:27,代码来源:crt_srf.cpp

示例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);
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:9,代码来源:crt_pnt.cpp

示例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);
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:11,代码来源:crt_srf.cpp

示例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);
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:11,代码来源:crt_pnt.cpp

示例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);
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:12,代码来源:crt_pnt.cpp

示例10: AddTestIsoCurve

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);
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:12,代码来源:srf_test.cpp

示例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);
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:13,代码来源:crt_srf.cpp

示例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);
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:13,代码来源:crt_srf.cpp

示例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);
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:13,代码来源:crt_srf.cpp

示例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);
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:14,代码来源:crt_srf.cpp

示例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);
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:14,代码来源:crt_srf.cpp


注:本文中的NURBSSet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。