Esempio n. 1
0
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);
}
Esempio n. 2
0
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);
}
Esempio n. 3
0
static int
AddTestPointSurface(NURBSSet &nset)
{
	NURBSPointSurface *s = new NURBSPointSurface();
	s->SetName(GetString(IDS_ADDED_POINT_SURF));
	s->SetNumPts(2, 2);
	NURBSIndependentPoint pt;
	pt.SetPosition(0, Point3(20, 0, -100));
	s->SetPoint(0, 0, pt);
	pt.SetPosition(0, Point3(20, 0, -200));
	s->SetPoint(0, 1, pt);
	pt.SetPosition(0, Point3(120, 0, -100));
	s->SetPoint(1, 0, pt);
	pt.SetPosition(0, Point3(120, 0, -200));
	s->SetPoint(1, 1, pt);

	s->FlipNormals(TRUE);

	return nset.AppendObject(s);
}