本文整理汇总了C++中ControlPointList::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ ControlPointList::push_back方法的具体用法?C++ ControlPointList::push_back怎么用?C++ ControlPointList::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ControlPointList
的用法示例。
在下文中一共展示了ControlPointList::push_back方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sineTest
void sineTest( void ) {
title = "Sine Test";
ControlPoint cp;
cp = ControlPoint( Vector3(0.0, 0.0, 0.0), CONTROL_POINT_END );
cplist.push_back(cp);
cp = ControlPoint( Vector3(0.0, 0.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(PI/2.0, 1.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(PI*3.0/2.0, -1.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(2*PI, 0.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(2*PI, 0.0, 0.0), CONTROL_POINT_END );
cplist.push_back(cp);
camera.position = Vector3( PI, 0.0, 6.0 );
camera.viewpoint = Vector3( PI, 0.0, 5.0 );
}
示例2: lineTest
void lineTest( void ) {
title = "Line Test";
ControlPoint cp;
cp = ControlPoint( Vector3(-5.0, 0.0, 0.0), CONTROL_POINT_END );
cplist.push_back(cp);
cp = ControlPoint( Vector3(-5.0, 0.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(0.0, 0.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(5.0, 0.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(5.0, 0.0, 0.0), CONTROL_POINT_END );
cplist.push_back(cp);
camera.position = Vector3( 0.0, 0.0, 10.0 );
camera.viewpoint = Vector3( 0.0, 0.0, 9.0 );
}
示例3: immelmannTest
void immelmannTest( void ) {
title = "Immelmann Test";
ControlPoint cp;
cp = ControlPoint( Vector3(-1.0, -1.0, 0.0), CONTROL_POINT_END );
cplist.push_back(cp);
cp = ControlPoint( Vector3(-1.0, -1.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(0.0, -1.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(cos(PI/4), -sin(PI/4), 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(1.0, 0.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(cos(PI/4), sin(PI/4), 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(0.0, 1.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(-1.0, 1.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(-1.0, 1.0, 0.0), CONTROL_POINT_END );
cplist.push_back(cp);
camera.position = Vector3( 0.0, 0.0, 3.0 );
camera.viewpoint = Vector3( 0.0, 0.0, 2.0 );
}
示例4: compressedsineandsineTest
void compressedsineandsineTest( void ) {
title = "Compressed Sine And Sine Test";
ControlPoint cp;
cp = ControlPoint( Vector3(0.0, 0.0, 0.0), CONTROL_POINT_END );
cplist.push_back(cp);
// compressed amplitude sine
cp = ControlPoint( Vector3(0.0, 0.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(PI/4.0, 1.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(PI*3/4.0, -1.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
// remarked for better continuity over both catmullrom and bspline
//cp = ControlPoint( Vector3(PI, 0.0, 0.0), CONTROL_POINT_MIDDLE );
//cplist.push_back(cp);
// normal amplitude sine
cp = ControlPoint( Vector3(PI+PI/2.0, 1.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(PI+PI*3.0/2.0, -1.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(PI+2*PI, 0.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(PI+2*PI, 0.0, 0.0), CONTROL_POINT_END );
cplist.push_back(cp);
camera.position = Vector3( (PI+PI/2.0), 0.0, 8.0 );
camera.viewpoint = Vector3( (PI+PI/2.0), 0.0, 7.0 );
}
示例5: if
void
CQIllustratorShape::
getControlPoints(ControlPointList &points, ControlType type) const
{
if (type == ControlType::GEOMETRY) {
}
else if (type == ControlType::LGRADIENT) {
const CQIllustratorShapeFill &fill = getFill();
const CGenGradient *g = fill.getGradient();
const CLinearGradient *lg = dynamic_cast<const CLinearGradient *>(g);
if (! lg) return;
//CBBox2D bbox = getFlatBBox();
//double x1 = lg->getX1()*(bbox.getXMax() - bbox.getXMin()) + bbox.getXMin();
//double y1 = lg->getY1()*(bbox.getYMax() - bbox.getYMin()) + bbox.getYMin();
//double x2 = lg->getX2()*(bbox.getXMax() - bbox.getXMin()) + bbox.getXMin();
//double y2 = lg->getY2()*(bbox.getYMax() - bbox.getYMin()) + bbox.getYMin();
CPoint2D p1(lg->getX1(), lg->getY1());
CPoint2D p2(lg->getX2(), lg->getY2());
CQIllustratorShapeLGradientControlPoint *start =
new CQIllustratorShapeLGradientControlPoint(
CQIllustratorShapeLGradientControlPoint::Position::START, p1);
CQIllustratorShapeLGradientControlPoint *end =
new CQIllustratorShapeLGradientControlPoint(
CQIllustratorShapeLGradientControlPoint::Position::END , p2);
points.push_back(start);
points.push_back(end);
}
else if (type == ControlType::RGRADIENT) {
const CQIllustratorShapeFill &fill = getFill();
const CGenGradient *g = fill.getGradient();
const CRadialGradient *rg = dynamic_cast<const CRadialGradient *>(g);
if (! rg) return;
//CBBox2D bbox = getFlatBBox();
//double x1 = rg->getX1()*(bbox.getXMax() - bbox.getXMin()) + bbox.getXMin();
//double y1 = rg->getY1()*(bbox.getYMax() - bbox.getYMin()) + bbox.getYMin();
//double x2 = rg->getX2()*(bbox.getXMax() - bbox.getXMin()) + bbox.getXMin();
//double y2 = rg->getY2()*(bbox.getYMax() - bbox.getYMin()) + bbox.getYMin();
CPoint2D c(rg->getCenterX(), rg->getCenterY());
CPoint2D f(rg->getFocusX (), rg->getFocusY ());
double r1 = rg->getRadius()/sqrt(2);
CPoint2D rp(c.x + r1, c.y + r1);
CQIllustratorShapeRGradientControlPoint *center =
new CQIllustratorShapeRGradientControlPoint(
CQIllustratorShapeRGradientControlPoint::Position::CENTER, c);
CQIllustratorShapeRGradientControlPoint *focus =
new CQIllustratorShapeRGradientControlPoint(
CQIllustratorShapeRGradientControlPoint::Position::FOCUS , f);
CQIllustratorShapeRGradientControlPoint *radius =
new CQIllustratorShapeRGradientControlPoint(
CQIllustratorShapeRGradientControlPoint::Position::RADIUS, rp);
points.push_back(center);
points.push_back(focus);
points.push_back(radius);
}
}
示例6: dblimmelmannTest
void dblimmelmannTest( void ) {
title = "Double Immelmann Test";
ControlPoint cp;
// first immelmann
cp = ControlPoint( Vector3(-2.0, -1.0, 0.0), CONTROL_POINT_END );
cplist.push_back(cp);
cp = ControlPoint( Vector3(-2.0, -1.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(0.0, -1.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(cos(PI/4), -sin(PI/4), 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(1.0, 0.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(cos(PI/4), sin(PI/4), 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(0.0, 1.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
// second immelmann
cp = ControlPoint( Vector3(-cos(PI/4), 2.0-sin(PI/4), 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(-1.0, 2.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(-cos(PI/4), 2.0+sin(PI/4), 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(0.0, 3.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(2.0, 3.0, 0.0), CONTROL_POINT_MIDDLE );
cplist.push_back(cp);
cp = ControlPoint( Vector3(2.0, 3.0, 0.0), CONTROL_POINT_END );
cplist.push_back(cp);
camera.position = Vector3( 0.0, 1.0, 4.0 );
camera.viewpoint = Vector3( 0.0, 1.0, 3.0 );
}