本文整理汇总了C++中pt1函数的典型用法代码示例。如果您正苦于以下问题:C++ pt1函数的具体用法?C++ pt1怎么用?C++ pt1使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pt1函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_homo_move_assign
static void
test_homo_move_assign ()
{
rw_info (0, __FILE__, __LINE__,
"move assignment operator (homogenous tuples)");
std::tuple<> et1, et2;
et2 = std::move (et1);
_RWSTD_UNUSED (et2);
int i = std::rand ();
std::tuple<int> it1 (i);
std::tuple<int> it2;
it2 = std::move (it1);
test (__LINE__, it2, i);
// move assignment ill-formed for constant element types
std::tuple<std::tuple<int> > nt1 (it2);
std::tuple<std::tuple<int> > nt2;
nt2 = std::move (nt1);
test (__LINE__, nt2, it2);
std::tuple<long, const char*> pt1 (1234567890L, "string");
std::tuple<long, const char*> pt2;
pt2 = std::move (pt1);
test (__LINE__, pt2, 1234567890L, (const char*) "string");
const UserDefined ud (i);
std::tuple<UserDefined> ut1 (ud);
std::tuple<UserDefined> ut2;
UserDefined::reset ();
ut2 = std::move (ut1); ++UserDefined::expect.move_asgn;
test (__LINE__, ut2, ud);
std::tuple<bool, char, int, double, void*, UserDefined>
bt1 (true, 'a', i, 3.14159, (void* const) &i, ud);
std::tuple<bool, char, int, double, void*, UserDefined> bt2;
UserDefined::reset ();
bt2 = std::move (bt1); ++UserDefined::expect.move_asgn;
test (__LINE__, bt2, true, 'a', i, 3.14159, (void* const) &i, ud);
}
示例2: QgsPolygonV2
QgsTriangle::QgsTriangle( const QPointF p1, const QPointF p2, const QPointF p3 )
: QgsPolygonV2()
{
mWkbType = QgsWkbTypes::Triangle;
QgsPointV2 pt1( p1 );
QgsPointV2 pt2( p2 );
QgsPointV2 pt3( p3 );
if ( !validateGeom( pt1, pt2, pt3 ) )
{
return;
}
QVector< double > x;
x << p1.x() << p2.x() << p3.x();
QVector< double > y;
y << p1.y() << p2.y() << p3.y();
QgsLineString *ext = new QgsLineString( x, y );
setExteriorRing( ext );
}
示例3: pt0
void CGuideRectODL::GetTopPointList( std::vector<gp_Pnt>& arrPoint )
{
m_arrTopPoint.clear();
//如果开始点大于结束点
Gdiplus::REAL fX0 = m_rtArea.GetLeft();
Gdiplus::REAL fY0 = m_rtArea.GetTop();
Gdiplus::REAL fX1 = m_rtArea.GetRight();
Gdiplus::REAL fY1 = m_rtArea.GetBottom();
gp_Pnt pt0(fX0, 0, fY0);
gp_Pnt pt1(fX1, 0, fY0);
gp_Pnt pt2(fX1, 0, fY1);
gp_Pnt pt3(fX0, 0, fY1);
m_arrTopPoint.push_back(pt0);
m_arrTopPoint.push_back(pt1);
m_arrTopPoint.push_back(pt2);
m_arrTopPoint.push_back(pt3);
m_arrTopPoint.push_back(pt0);
arrPoint = m_arrTopPoint;
}
示例4: pt1
bool CCoordTransService::Transform (double *pX, double *pY)
{
if (m_fIsInitialized) {
try {
CCSPoint pt1 (*pX, *pY);
THROW_FAILED_HRESULT(m_CTF -> Transform (&pt1, TRANSDIRECTION_FORWARD));
THROW_FAILED_HRESULT(pt1 -> get_X (pX));
THROW_FAILED_HRESULT(pt1 -> get_Y (pY));
return true;
} catch (_com_error &e) {
ShowError (_COM_ERROR(e), IDS_CSSERRORCAPTION, g_cbTransform);
return false;
}
}
ShowError (TRIAS02_E_CSSNOTINITIALIZED, IDS_CSSERRORCAPTION, g_cbTransform);
return false;
}
示例5: Surface
Surface* Building::extrude_envelope() const
{
Surface* envelope = new Surface(SurfaceType::Envelope,0,_length,_width,_height);
OGRLinearRing* ringFt = _footprint->getExteriorRing();
if(ringFt->isClockwise())
adjust_winding_ccw(ringFt);
envelope->addChild(new Surface(SurfaceType::Footprint,_footprint,_length,_width,0.));
//extrude roof
OGRLinearRing* ringRoof = new OGRLinearRing;
for(int i=0; i<ringFt->getNumPoints(); i++)
ringRoof->addPoint(ringFt->getX(i),ringFt->getY(i),_height);
OGRPolygon plyRoof;
plyRoof.addRingDirectly(ringRoof);
envelope->addChild(new Surface(SurfaceType::Roof,&plyRoof,_length,_width,0.));
//extrude walls
for(int i=0; i<ringFt->getNumPoints()-1; i++)
{
OGRLinearRing* ringWall = new OGRLinearRing;
ringWall->addPoint(ringFt->getX(i),ringFt->getY(i),0);
ringWall->addPoint(ringFt->getX(i+1),ringFt->getY(i+1),0);
ringWall->addPoint(ringFt->getX(i+1),ringFt->getY(i+1),_height);
ringWall->addPoint(ringFt->getX(i),ringFt->getY(i),_height);
ringWall->addPoint(ringFt->getX(i),ringFt->getY(i),0);
OGRPolygon plyWall;
plyWall.addRingDirectly(ringWall);
OGRPoint pt1(ringFt->getX(i),ringFt->getY(i),0);
OGRPoint pt2(ringFt->getX(i+1),ringFt->getY(i+1),0);
envelope->addChild(new Wall(&plyWall,pt1.Distance(&pt2),_height,&pt1,&pt2));
}
return envelope;
}
示例6: test_homo_move_ctor
static void
test_homo_move_ctor ()
{
rw_info (0, __FILE__, __LINE__,
"move constructor (homogenous tuples)");
std::tuple<> et (std::tuple<> ()); _RWSTD_UNUSED (et);
const int ci = std::rand ();
std::tuple<int> it1 (ci);
std::tuple<int> it2 (std::move (it1));
test (__LINE__, it2, ci);
std::tuple<const int> ct1 (ci);
std::tuple<const int> ct2 = std::move (ct1);
test (__LINE__, ct2, ci);
std::tuple<std::tuple<int> > nt1 (it1);
std::tuple<std::tuple<int> > nt2 = std::move (nt1);
test (__LINE__, nt2, it1);
std::tuple<long, const char*> pt1 (1234567890L, "string");
std::tuple<long, const char*> pt2 (std::move (pt1));
test (__LINE__, pt2, 1234567890L, (const char*) "string");
const UserDefined ud (ci);
std::tuple<UserDefined> ut1 (ud);
UserDefined::reset ();
std::tuple<UserDefined> ut2 (std::move (ut1));
++UserDefined::expect.move_ctor;
test (__LINE__, ut2, ud);
std::tuple<bool, char, int, double, void*, UserDefined>
bt1 (true, 'a', ci, 3.14159, (void*) &ci, ud);
++UserDefined::expect.copy_ctor;
std::tuple<bool, char, int, double, void*, UserDefined>
bt2 (std::move (bt1));
++UserDefined::expect.move_ctor;
test (__LINE__, bt2, true, 'a', ci, 3.14159, (void*) &ci, ud);
}
示例7: pt1
void displayopencv::DisplayBspline(const mathtools::application::Bspline<2> &bspline, cv::Mat &img, const mathtools::affine::Frame<2>::Ptr frame, const cv::Scalar &color, const unsigned int &nb_pts)
{
double inf = bspline.getInfBound(),
sup = bspline.getSupBound();
Eigen::Vector2d prev = mathtools::affine::Point<2>(bspline(inf)).getCoords(frame);
for(unsigned int i=1;i<nb_pts;i++)
{
double t = inf + (double)i*(sup-inf)/(double)(nb_pts-1);
Eigen::Vector2d curr = mathtools::affine::Point<2>(bspline(t)).getCoords(frame);
cv::Point pt1(prev.x(), prev.y()),
pt2(curr.x(), curr.y());
prev=curr;
cv::line(img,pt1,pt2,color);
}
}
示例8: mark
void mark(cv::Mat& img, PPoint2d &p, unsigned char l) {
int r = 10;
//draw_circle(img, p, r, l);
// draw_circle(img, p[0], p[1], 10, l);
// draw_line(img, p[0]-r/2, p[1]-r/2, p[0]+r/2, p[1]+r/2, l);
// draw_line(img, p[0]-r/2, p[1]+r/2, p[0]+r/2, p[1]-r/2, l);
double x = p.x();
double y = p.y();
cv::Point2d pt(x,y);
cv::Point2d pt1(x - r / 2, y - r / 2);
cv::Point2d pt2(x + r / 2, y + r / 2);
cv::Point2d pt3(x - r / 2, y + r / 2);
cv::Point2d pt4(x + r / 2, y - r / 2);
cout << p << endl;
if (x >= 0 && y >= 0 && x <= img.rows && y <= img.cols) {
cv::circle(img, pt, 10, l);
cv::line(img, pt1, pt2, l);
cv::line(img, pt3, pt4, l);
}
}
示例9: grp
void FixtureGroup_Test::swap()
{
FixtureGroup grp(m_doc);
grp.setSize(QSize(4, 4));
for (quint32 id = 0; id < 16; id++)
{
Fixture* fxi = new Fixture(m_doc);
fxi->setChannels(1);
m_doc->addFixture(fxi);
grp.assignFixture(fxi->id());
}
QCOMPARE(grp.headList().size(), 16);
QLCPoint pt1(0, 0);
QLCPoint pt2(2, 1);
QVERIFY(grp.headHash().contains(pt1) == true);
QVERIFY(grp.headHash().contains(pt2) == true);
QCOMPARE(grp.headHash()[pt1], GroupHead(0, 0));
QCOMPARE(grp.headHash()[pt2], GroupHead(6, 0));
// Switch places with two fixtures
grp.swap(pt1, pt2);
QVERIFY(grp.headHash().contains(pt1) == true);
QVERIFY(grp.headHash().contains(pt2) == true);
QCOMPARE(grp.headHash()[pt1], GroupHead(6, 0));
QCOMPARE(grp.headHash()[pt2], GroupHead(0, 0));
// Switch places with a fixture and an empty point
pt2 = QLCPoint(500, 500);
grp.swap(pt1, pt2);
QVERIFY(grp.headHash().contains(pt1) == false);
QVERIFY(grp.headHash().contains(pt2) == true);
QCOMPARE(grp.headHash()[pt2], GroupHead(6, 0));
// ...and back again
grp.swap(pt1, pt2);
QVERIFY(grp.headHash().contains(pt1) == true);
QVERIFY(grp.headHash().contains(pt2) == false);
QCOMPARE(grp.headHash()[pt1], GroupHead(6, 0));
}
示例10: check_are_mergable
void check_are_mergable()
{
Polycurve_conic_traits_2 traits;
Polycurve_conic_traits_2::Construct_x_monotone_curve_2
construct_x_monotone_curve_2 = traits.construct_x_monotone_curve_2_object();
Polycurve_conic_traits_2::Are_mergeable_2 are_mergeable_2 =
traits.are_mergeable_2_object();
//create a curve
Rat_point_2 ps1(1, 10);
Rat_point_2 pmid1(5, 4);
Rat_point_2 pt1(10, 1);
Conic_curve_2 c1(ps1, pmid1, pt1);
Rat_point_2 ps2(10, 1);
Rat_point_2 pmid2(15, 14);
Rat_point_2 pt2(20, 20);
Conic_curve_2 c2(ps2, pmid2, pt2);
Rat_point_2 ps3(Rational(1,4), 4);
Rat_point_2 pmid3(Rational(3,2), 2);
Rat_point_2 pt3(2, Rational(1,3));
Conic_curve_2 c3(ps3, pmid3, pt3);
//construct x-monotone curve(compatible with polyline class)
Polycurve_conic_traits_2::X_monotone_curve_2 polyline_xmc1 =
construct_x_monotone_curve_2(c1);
Polycurve_conic_traits_2::X_monotone_curve_2 polyline_xmc2 =
construct_x_monotone_curve_2(c2);
Polycurve_conic_traits_2::X_monotone_curve_2 polyline_xmc3 =
construct_x_monotone_curve_2(c3);
bool result = are_mergeable_2(polyline_xmc1, polyline_xmc2);
std::cout << "Are_mergable:: Mergable x-monotone polycurves are Computed as: "
<< ((result)? "Mergable" : "Not-Mergable") << std::endl;
result = are_mergeable_2(polyline_xmc1, polyline_xmc3);
std::cout << "Are_mergable:: Non-Mergable x-monotone polycurves are Computed as: "
<< ((result)? "Mergable" : "Not-Mergable") << std::endl;
}
示例11: DrawResult
void DrawResult(IplImage* image, windage::Matrix3 homography, CvScalar color = CV_RGB(255, 0, 0), int thickness = 1)
{
windage::Vector3 pt1(0.0, 0.0, 1.0);
windage::Vector3 pt2(TEMPLATE_WIDTH, 0.0, 1.0);
windage::Vector3 pt3(TEMPLATE_WIDTH, TEMPLATE_HEIGHT, 1.0);
windage::Vector3 pt4(0.0, TEMPLATE_HEIGHT, 1.0);
windage::Vector3 outPoint1 = homography * pt1;
windage::Vector3 outPoint2 = homography * pt2;
windage::Vector3 outPoint3 = homography * pt3;
windage::Vector3 outPoint4 = homography * pt4;
outPoint1 /= outPoint1.z;
outPoint2 /= outPoint2.z;
outPoint3 /= outPoint3.z;
outPoint4 /= outPoint4.z;
cvLine(image, cvPoint((int)outPoint1.x, (int)outPoint1.y), cvPoint((int)outPoint2.x, (int)outPoint2.y), color, thickness);
cvLine(image, cvPoint((int)outPoint2.x, (int)outPoint2.y), cvPoint((int)outPoint3.x, (int)outPoint3.y), color, thickness);
cvLine(image, cvPoint((int)outPoint3.x, (int)outPoint3.y), cvPoint((int)outPoint4.x, (int)outPoint4.y), color, thickness);
cvLine(image, cvPoint((int)outPoint4.x, (int)outPoint4.y), cvPoint((int)outPoint1.x, (int)outPoint1.y), color, thickness);
}
示例12: wxCHECK
// forward the message to the appropriate item
bool wxListBox::MSWOnDraw(WXDRAWITEMSTRUCT *item)
{
// only owner-drawn control should receive this message
wxCHECK( ((m_windowStyle & wxLB_OWNERDRAW) == wxLB_OWNERDRAW), false );
DRAWITEMSTRUCT *pStruct = (DRAWITEMSTRUCT *)item;
// the item may be -1 for an empty listbox
if ( pStruct->itemID == (UINT)-1 )
return false;
wxListBoxItem *pItem = (wxListBoxItem *)m_aItems[pStruct->itemID];
wxDCTemp dc((WXHDC)pStruct->hDC);
wxPoint pt1(pStruct->rcItem.left, pStruct->rcItem.top);
wxPoint pt2(pStruct->rcItem.right, pStruct->rcItem.bottom);
wxRect rect(pt1, pt2);
return pItem->OnDrawItem(dc, rect,
(wxOwnerDrawn::wxODAction)pStruct->itemAction,
(wxOwnerDrawn::wxODStatus)pStruct->itemState);
}
示例13: check_is_vertical
void check_is_vertical()
{
Polycurve_conic_traits_2 traits;
Polycurve_conic_traits_2::Construct_x_monotone_curve_2
construct_x_monotone_curve_2 = traits.construct_x_monotone_curve_2_object();
Polycurve_conic_traits_2::Is_vertical_2 is_vertical =
traits.is_vertical_2_object();
//create a curve
Rat_point_2 ps1(1, 10);
Rat_point_2 pmid1(5, 4);
Rat_point_2 pt1(10, 1);
Conic_curve_2 c1(ps1, pmid1, pt1);
//make x-monotone curve
Polycurve_conic_traits_2::X_monotone_curve_2 polyline_xmc1 =
construct_x_monotone_curve_2(c1);
bool result = is_vertical(polyline_xmc1);
std::cout << "Is_verticle:: Expected first result is not vertivle: Computed: "
<< ((result)? "vertical" : "not vertical") << std::endl;
}
示例14: CPPUNIT_ASSERT
void AABoxContainTest::testIsInVolumePt()
{
// Test empty box
gmtl::AABoxf box;
gmtl::Point3f origin;
CPPUNIT_ASSERT(! gmtl::isInVolume(box, origin));
// Test valid box with pt outside
gmtl::AABoxf box2(gmtl::Point3f(-1,-1,-1), gmtl::Point3f(1,1,1));
gmtl::Point3f pt1(2,2,2);
CPPUNIT_ASSERT(! gmtl::isInVolume(box2, pt1));
CPPUNIT_ASSERT(! gmtl::isInVolumeExclusive(box2, pt1));
//Test valid box with pt inside
CPPUNIT_ASSERT(gmtl::isInVolume(box2, origin));
CPPUNIT_ASSERT(gmtl::isInVolumeExclusive(box2, origin));
//Test valid box with pt on surface
gmtl::Point3f pt_on_surf(1,0,0);
CPPUNIT_ASSERT(gmtl::isInVolume(box2, pt_on_surf));
CPPUNIT_ASSERT(!gmtl::isInVolumeExclusive(box2, pt_on_surf));
}
示例15: check_construct_opposite
void check_construct_opposite()
{
Polycurve_conic_traits_2 traits;
Polycurve_conic_traits_2::Construct_x_monotone_curve_2
construct_x_monotone_curve_2 = traits.construct_x_monotone_curve_2_object();
Polycurve_conic_traits_2::Construct_opposite_2 construct_opposite_2 =
traits.construct_opposite_2_object();
//create a curve
Rat_point_2 ps1(1, 10);
Rat_point_2 pmid1(5, 4);
Rat_point_2 pt1(10, 1);
Conic_curve_2 c1(ps1, pmid1, pt1);
//construct x-monotone curve (compatible with polyline class)
Polycurve_conic_traits_2::X_monotone_curve_2 polyline_xmc1 =
construct_x_monotone_curve_2(c1);
Polycurve_conic_traits_2::X_monotone_curve_2 polyline_opposite_curve =
construct_opposite_2(polyline_xmc1);
std::cout<< "Construct_opposite_2:: Opposite curve created";
}