本文整理汇总了C++中TPoint类的典型用法代码示例。如果您正苦于以下问题:C++ TPoint类的具体用法?C++ TPoint怎么用?C++ TPoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TPoint类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: operator
inline double operator()(const TPoint& x, const TPoint& y) const {
VectorType xv = x.GetVnlVector();
VectorType yv = y.GetVnlVector();
VectorType r = yv - xv;
return exp(-dot_product(r, r) / m_sigma2);
}
开发者ID:arnaudgelas,项目名称:statismo,代码行数:7,代码来源:lowRankGaussianProcessImageToImageRegistration.cpp
示例2: GetPoint
TPoint TBisector::GetPoint(double t) const {
TPoint tmp;
tmp.SetCoord(t * *U);
tmp = tmp + *X0;
return tmp;
}
开发者ID:jstebel,项目名称:flow123d,代码行数:8,代码来源:bisector.cpp
示例3: return
//
// equality operator
//
bool TPoint::operator==(const TPoint &inPt) const {
if ((inPt.X() == m_X) &&
(inPt.Y() == m_Y))
{
return (true);
}
return (false);
}
开发者ID:colonelqubit,项目名称:halyard,代码行数:11,代码来源:TPoint.cpp
示例4: Intersects
bool Intersects(const TSegment<T> &segment) const
{
TPoint<T> p1=Point1();
TPoint<T> p2=Point2();
TPoint<T> p3=segment.Point1();
TPoint<T> p4=segment.Point2();
return(BoundingBox(p1.X(),p2.X(),p3.X(),p4.X())&&BoundingBox(p1.Y(),p2.Y(),p3.Y(),p4.Y())&&((Area(p1,p2,p3)*Area(p1,p2,p4))<=0)&&((Area(p3,p4,p1)*Area(p3,p4,p2))<=0));
}
开发者ID:divyang4481,项目名称:mipt-hw,代码行数:8,代码来源:geom.cpp
示例5: GetScroll
void TWindow::SimulateMouseMoved()
{
TPoint mouse;
const TPoint& scroll = GetScroll();
mouse.Set(fLastMouseMovedLocation.h + scroll.h, fLastMouseMovedLocation.v + scroll.v);
HandleMouseMoved(mouse, fLastMouseMovedModifiers);
}
开发者ID:mikevoydanoff,项目名称:zoinks,代码行数:8,代码来源:TWindow.cpp
示例6: scroll
void WebScrollingDeceleratorGH::scroll()
{
if (!m_decelelatorSwitch) return;
// X = Vst*t - 0.5*a*(t * t)
TPoint dist;
TReal32 intervalInSec = static_cast<TReal32>(KScrollIntervalTimeout) / 1000000;
TReal32 t = (m_numscrollsteps++) * intervalInSec;
TReal32 dx = 0.0;
TReal32 dy = 0.0;
TReal32 vx = 0.0;
TReal32 vy = 0.0;
TReal32 accelX = 0.0;
TReal32 accelY = 0.0;
if (m_initSpeed.iX) {
accelX = (m_initSpeed.iX > 0) ? KDecceleration : (-1) * KDecceleration;
vx = m_initSpeed.iX + accelX * t;
dx = m_initSpeed.iX * t + 0.5 * accelX * (t * t);
}
if (m_initSpeed.iY) {
accelY = (m_initSpeed.iY > 0) ? KDecceleration : (-1) * KDecceleration;
vy = m_initSpeed.iY + accelY * t;
dy = m_initSpeed.iY * t + 0.5 * accelY * (t * t);
}
dist.SetXY(static_cast<TInt>(dx), static_cast<TInt>(dy));
WebFrameView* scrollingView = m_webView.pageScrollHandler()->currentScrollingFrameView();
TPoint cpos = scrollingView->contentPos();
dist = scrollingView->toDocCoords(dist);
TPoint pos = m_startPos + dist;
WebPageScrollHandler* handler = m_webView.pageScrollHandler();
if ((vx * m_initSpeed.iX < 0) || (vy * m_initSpeed.iY < 0) || (vx + vy == 0) ||
(m_numscrollsteps > 1 && !scrollingView->needScroll(pos) &&
!handler->currentScrollingElement())) {
if (m_scrollbarDrawer) {
m_scrollbarDrawer->fadeScrollbar();
}
m_decelTimer->Cancel();
handler->clearScrollingElement();
m_webView.setViewIsScrolling(false);
m_webView.toggleRepaintTimer(true);
}
else {
TPoint scrollDelta = pos - m_lastPos;
handler->scrollContent(scrollDelta);
m_lastPos = pos;
}
}
开发者ID:gvsurenderreddy,项目名称:symbiandump-mw4,代码行数:52,代码来源:WebScrollingDeceleratorGH.cpp
示例7: ExtendWithProducts
int ExtendWithProducts(TMatrix input, unsigned int upToPower, TMatrix *output){
unsigned int n = input.size();
output->resize(n);
for (unsigned int i = 0; i < n; i++){
for(unsigned int j = 1; j <= upToPower; j++){
TPoint extension;
GetProducts(input[i], j, &extension);
TPoint::iterator it;
it = (*output)[i].end();
(*output)[i].insert(it, extension.begin(), extension.end());
}
}
return 0;
}
开发者ID:cran,项目名称:ddalpha,代码行数:14,代码来源:AlphaProcedure.cpp
示例8: distance
double TLine :: distance ( TPoint & P )
{
double Min , l;
l = A.distance ( B );
Min = fabs ( ( A.x - P.x ) * ( B.y - P.y ) - ( A.y - P.y ) * ( B.x - P.x ) );
return Min / l;
}
开发者ID:programmingduo,项目名称:ACMsteps,代码行数:7,代码来源:p2710_计算几何_DP.cpp
示例9: GetProducts
static int GetProducts(TPoint values, unsigned int power, TPoint *output){
int d = values.size();
if (power == 1){
output->resize(d);
for (int i = 0; i < d; i++){(*output)[i] = values[i];}
return 0;
}
output->resize(0);
TVariables indices(power);
unsigned int counter = 0;
while(indices[0] < d){
output->push_back(1);
for (unsigned int i = 0; i < power; i++){
(*output)[counter] *= values[indices[i]];
}
counter++;
int lastArray = power - 1;
while(lastArray > 0 && indices[lastArray] == d - 1){lastArray--;}
indices[lastArray]++;
for (unsigned int i = lastArray; i < power; i++){
indices[i] = indices[lastArray];
}
}
return 0;
}
开发者ID:cran,项目名称:ddalpha,代码行数:26,代码来源:AlphaProcedure.cpp
示例10: CALLSTACKITEM_N
void CRecognizerContainer::PictureUpdateL(
CFbsBitmap& aBitmap,
RPointerArray<CCodeInfo>* aCodes,
const TPoint& aTranslation,
TInt /*aMinDiffTranslation*/,
TInt /*aRotation*/,
TInt /*aMinDiffRotation*/)
{
CALLSTACKITEM_N(_CL("CRecognizerContainer"), _CL("PictureUpdateL"));
iTranslation.SetXY(aTranslation.iX, aTranslation.iY);
if (aCodes != NULL) {
iCurrentCode = iVCS->FindClosestCode(iTarget);
if (iCurrentCode >= 0) {
CCodeInfo* ci = (*aCodes)[iCurrentCode];
TPoint p = ci->GetTilting();
iTilting.SetXY(p.iX, p.iY);
if (ci->IsCodeValid()) {
iInvalid=false;
delete iCurrentCodeInfo; iCurrentCodeInfo=0;
iCurrentCodeInfo=new (ELeave) CCodeInfo;
iCurrentCodeInfo->ConstructL(*ci);
} else {
iInvalid=true;
}
}
}
iBitmap=&aBitmap;
DrawImage(&aBitmap);
}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:32,代码来源:RecognizerView.cpp
示例11: minor2Pot
CGameSpriteFrame::CGameSpriteFrame(const TFileName& filename, TUint32 id, const CGameRect& r, CFbsBitmap* loader){
loader->Load(filename, id, 0);
TInt i,j;
TInt h = loader->SizeInPixels().iHeight;
TInt w = loader->SizeInPixels().iWidth;
h = (h<r.h)?h:r.h;
w = (w<r.w)?w:r.w;
TInt H = minor2Pot(h);
TInt W = minor2Pot(w);
if(H>W)W=H;
else H=W;
this->texDim = H;
TRgb color;
TPoint point;
this->pixels = new TUint32[W*H];
for(i=0;i<w;i++){
for(j=0;j<h;j++){
point.SetXY(i,j);
loader->GetPixel(color,point);
this->pixels[i+j*W] = color.Value();
}
}
glGenTextures(1, &(this->texId));
glBindTexture(GL_TEXTURE_2D, this->texId);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
GLint format = GL_RGBA;
glTexImage2D(GL_TEXTURE_2D, 0, format, W, H, 0,
format, GL_UNSIGNED_BYTE, this->pixels);
}
开发者ID:Juanma-lach,项目名称:battletamagotchi,代码行数:44,代码来源:CGameSprite.cpp
示例12: XTranslateCoordinates
void TWindow::LocalToRoot(TPoint& point) const
{
int x, y;
Window childWindow;
XTranslateCoordinates(sDisplay, fWindow, gApplication->GetRootWindow(),
0, 0, &x, &y, &childWindow);
const TPoint& scroll = GetScroll();
point.Offset(x - scroll.h, y - scroll.v);
}
开发者ID:mikevoydanoff,项目名称:zoinks,代码行数:10,代码来源:TWindow.cpp
示例13: objectUtil
void TDrawer::DrawReturnArrow(CWsBitmap* aBackUpBitmap, CWsBitmap* aResourceBitmap, TRect aWorldPointRect,
TRect aBitMapRect)
{
//根据WorldPointRect大小 和 aBitMapRect的大小 设置新的returnRect的大小
TPoint center;
center.SetXY((aWorldPointRect.iBr.iX + aWorldPointRect.iTl.iX) / 2, (aWorldPointRect.iBr.iY
+ aWorldPointRect.iTl.iY) / 2);
TInt iHalfHigh = (aBitMapRect.iBr.iY - aBitMapRect.iTl.iY) / 2;
TInt iHalfWidth = (aBitMapRect.iBr.iX - aBitMapRect.iTl.iX) / 2;
TRect centerRect;
centerRect.SetRect(center.iX - iHalfWidth, center.iY - iHalfHigh, center.iX + iHalfWidth, center.iY + iHalfHigh);
TBitmapUtil objectUtil(aResourceBitmap);
TBitmapUtil backUpUtil(aBackUpBitmap);
//
objectUtil.Begin(TPoint(0, 0));
backUpUtil.Begin(TPoint(0, 0));
R8G8B8* addr1 = (R8G8B8*) aResourceBitmap->DataAddress();// 对象
R8G8B8* addr2 = (R8G8B8*) aBackUpBitmap->DataAddress();// 背景
TSize desSize = aBackUpBitmap->SizeInPixels();
TSize srcSize = aResourceBitmap->SizeInPixels();
R8G8B8* addr22;
R8G8B8* addr11;
addr22 = addr2 + (centerRect.iTl.iY - 1) * desSize.iWidth + centerRect.iTl.iX;
TSize newSize = centerRect.Size();
addr11 = addr1 + aBitMapRect.iTl.iY * srcSize.iWidth + aBitMapRect.iTl.iX;
//每画完一行,arrd11要前进的距离
TInt iWidthSpan = srcSize.iWidth - newSize.iWidth;
TInt iScreenWidthSpan = desSize.iWidth - newSize.iWidth;
for (TInt j = 0; j < newSize.iHeight; j++)
{
for (TInt i = 0; i < newSize.iWidth; i++)
{
*addr22 = *addr11;
addr22++;
addr11++;
}
addr11 = addr11 + iWidthSpan;
addr22 = addr22 + iScreenWidthSpan;
}
backUpUtil.End();
objectUtil.End();
}
开发者ID:jinhuafeng,项目名称:RS-MAN,代码行数:43,代码来源:Drawer.cpp
示例14: TPoint
void CAwardContainer::SetGameState()
{
//iData->iGameState = TEnum::EControlMainMenu;
//设置MainMenu下的对象初始状态
TRect iLeftTopRect = iData->ipBitMapPosition->GetPosition(TBitMapPosition::HighlightReturnEdge, 0);
TPoint point;
point.SetXY(FIRST_MENU_POSITION, FIRST_MENU_HEIGHT);
point.iY = 610;
iReturn.SetBitMapRect(iData->ipBitMapPosition->GetPosition(TBitMapPosition::FontReturn, 0));
iReturn.SetStartAndEndPoint(point, TPoint(270, point.iY));
iReturn.SetHighLightRect(iLeftTopRect, TRect(180, 610 - 27, 359, 610 + 27));
iReturn.ReSet();
point.SetXY(180, 60);
iNavAward.SetBitMapRect(iData->ipBitMapPosition->GetPosition(TBitMapPosition::FontAward, 0));
iNavAward.SetStartAndEndPoint(point, point);
iNavAward.ReSet();
iNavAward.UpdateObjectByCenter();
}
开发者ID:jinhuafeng,项目名称:RS-MAN,代码行数:19,代码来源:AwardContainer.cpp
示例15: Print_Line
void TFuncSpecView::Print_Line(TDC& dc, TPoint origin, const TFuncSpecView::XPosVector& xpos, char* data) const
{
XPosVector::size_type i, count=xpos.size()-1; // subtract one for end marker
char text[]="+";
for(i=0; i<count; i++) {
text[0]=data[i];
dc.TextOut(origin.OffsetBy(xpos[i].x, 0), text, 1);
}
}
开发者ID:double16,项目名称:switchmin-w32,代码行数:10,代码来源:funcspecview.cpp
示例16: TPoint
void CPausedContainer::SetGameState()
{
//iData->iGameState = TEnum::EControlMainMenu;
//设置MainMenu下的对象初始状态
TRect iLeftTopRect = iData->ipBitMapPosition->GetPosition(TBitMapPosition::HighlightEdge, 0);
TPoint point;
point.SetXY(FIRST_MENU_POSITION, FIRST_MENU_HEIGHT);
//1
iResume.SetBitMapRect(iData->ipBitMapPosition->GetPosition(TBitMapPosition::FontResume, 0));
iResume.SetStartAndEndPoint(point, TPoint(180, point.iY));
iResume.ReSet();
iResume.SetHighLightRect(iLeftTopRect, TRect(0, point.iY - 27, SCREEN_WIDTH - 1, point.iY + 27));
//2
point.iX += MENU_WIGTH_SPAN;
point.iY += MENU_HEIGHT_SPAN;
iNewGame.SetBitMapRect(iData->ipBitMapPosition->GetPosition(TBitMapPosition::FontNewGame, 0));
iNewGame.SetStartAndEndPoint(point, TPoint(180, point.iY));
iNewGame.ReSet();
iNewGame.SetHighLightRect(iLeftTopRect, TRect(0, point.iY - 27, SCREEN_WIDTH - 1, point.iY + 27));
//3
point.iX += MENU_WIGTH_SPAN;
point.iY += MENU_HEIGHT_SPAN;
iOption.SetBitMapRect(iData->ipBitMapPosition->GetPosition(TBitMapPosition::FontOption, 0));
iOption.SetStartAndEndPoint(point, TPoint(180, point.iY));
iOption.ReSet();
iOption.SetHighLightRect(iLeftTopRect, TRect(0, point.iY - 27, SCREEN_WIDTH - 1, point.iY + 27));
//4
point.iX += MENU_WIGTH_SPAN;
point.iY += MENU_HEIGHT_SPAN;
iHelp.SetBitMapRect(iData->ipBitMapPosition->GetPosition(TBitMapPosition::FontHelp, 0));
iHelp.SetStartAndEndPoint(point, TPoint(180, point.iY));
iHelp.ReSet();
iHelp.SetHighLightRect(iLeftTopRect, TRect(0, point.iY - 27, SCREEN_WIDTH - 1, point.iY + 27));
//5
point.iX += MENU_WIGTH_SPAN;
point.iY += MENU_HEIGHT_SPAN;
iReturn.SetBitMapRect(iData->ipBitMapPosition->GetPosition(TBitMapPosition::FontMainMenu, 0));
iReturn.SetStartAndEndPoint(point, TPoint(180, point.iY));
iReturn.ReSet();
iReturn.SetHighLightRect(iLeftTopRect, TRect(0, point.iY - 27, SCREEN_WIDTH - 1, point.iY + 27));
}
开发者ID:jinhuafeng,项目名称:RS-MAN,代码行数:42,代码来源:PausedContainer.cpp
示例17: InitComponentArrayL
void CComponentControl::ConstructL(TInt aChildren, TInt aOwners, TPoint aPt, TSize aSize, TRgb aPenColor, TRgb aBrushColor, CGraphicsContext::TBrushStyle aBrushStyle)
{
//Construct the base window of the control
CTestRectGc::ConstructL(aPt, aSize, aPenColor, aBrushColor, aBrushStyle);
InitComponentArrayL();
TSize ChildSize(aSize.iWidth/2, aSize.iHeight/2);
TPoint Offset;
if (aOwners&1)
Offset.SetXY(0,0);
else
Offset = aPt;
CreateChildControlL(aChildren, aOwners>>1, Offset, ChildSize, aPenColor, aBrushColor, aBrushStyle);
CreateChildControlL(aChildren, aOwners>>1, Offset+TSize(ChildSize.iWidth, 0), ChildSize, aPenColor, aBrushColor, aBrushStyle);
CreateChildControlL(aChildren, aOwners>>1, Offset+TSize(0, ChildSize.iHeight), ChildSize, aPenColor, aBrushColor, aBrushStyle);
CreateChildControlL(aChildren, aOwners>>1, Offset+TSize(ChildSize.iWidth, ChildSize.iHeight), ChildSize, aPenColor, aBrushColor, aBrushStyle);
}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:20,代码来源:TConeInvalidate.cpp
示例18: PreTestSetupL
void CGdiPolygon::PreTestSetupL(const TRect &aRect, TInt )
{
iPnts.Reset();
TPoint pnt;
TInt maxPoints=Min((TInt)KMaxPolygonPoints,Min(aRect.Width(),aRect.Height())/KPolygonStep);
TInt numPoints=0;
if (maxPoints>0)
{
iPnts.AppendL(aRect.iTl);
while(numPoints<maxPoints)
{
if (numPoints&1)
pnt.SetXY(aRect.iTl.iX+(numPoints+1)*KPolygonStep,aRect.iTl.iY+numPoints*KPolygonStep);
else
pnt.SetXY(aRect.iTl.iX+numPoints*KPolygonStep,aRect.iTl.iY+(numPoints+1)*KPolygonStep);
iPnts.AppendL(pnt);
numPoints++;
}
pnt.SetXY(aRect.iTl.iX+numPoints*KPolygonStep,aRect.iTl.iY+numPoints*KPolygonStep);
iPnts.AppendL(pnt);
while(numPoints>0)
{
numPoints--;
if (numPoints&1)
pnt.SetXY(aRect.iTl.iX+numPoints*KPolygonStep,aRect.iTl.iY+(numPoints+1)*KPolygonStep);
else
pnt.SetXY(aRect.iTl.iX+(numPoints+1)*KPolygonStep,aRect.iTl.iY+numPoints*KPolygonStep);
iPnts.AppendL(pnt);
}
}
}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:31,代码来源:TGDI.CPP
示例19: PaintButton
//
/// Paints a minimize box on the tiny caption bar.
//
void
TTinyCaption::PaintMinBox(TDC& dc, TRect& boxRect, bool pressed)
{
// Fill the box with light gray & draw bevel if possible
//
PaintButton(dc, boxRect, pressed);
if (pressed)
boxRect.Offset(1,1);
int bh = boxRect.Height();
int bw = boxRect.Width();
TPoint begPt = boxRect.TopLeft().OffsetBy((bw+1)/4, (bh+2)/3);
TPoint endPt = begPt.OffsetBy((bw+1)/2,0);
while (begPt.x < endPt.x) {
dc.MoveTo(begPt);
dc.LineTo(endPt);
begPt.Offset(1,1);
endPt.Offset(-1,1);
}
}
开发者ID:bowlofstew,项目名称:Meridian59,代码行数:25,代码来源:tinycapt.cpp
示例20: Classify
int Classify(TMatrix input, TPoint weights, TVariables *output){
/* 0. Initialization */
unsigned int l = input.size(); if (l == 0){return -1;}
unsigned int p = weights.size(); if (p == 0){return -1;} if (p > input[0].size()){return -1;}
output->resize(l);
/* 1. Classification of each point by comparison of their projections to 0 */
for (unsigned int i = 0; i < l; i++){
double curSum = 0;
for (unsigned int j = 0; j < p; j++){curSum += weights[j]*input[i][j];}
(*output)[i] = (curSum > 0) ? 1 : -1;
}
return 0;
}
开发者ID:cran,项目名称:ddalpha,代码行数:13,代码来源:AlphaProcedure.cpp
注:本文中的TPoint类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论