本文整理汇总了C++中Point::Position方法的典型用法代码示例。如果您正苦于以下问题:C++ Point::Position方法的具体用法?C++ Point::Position怎么用?C++ Point::Position使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point
的用法示例。
在下文中一共展示了Point::Position方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawPoint
void Renderer::DrawPoint(Point point, int subWindow)
{
int pixelStart = PosToIndex((point.Position()));
Color color = point.GetColor();
if(pixelStart >= 0 && pixelStart + 2 <= (sSubwindowSize.mX) * (sSubwindowSize.mY) * 3)
{
if(subWindow == sSubWindow1)
{
sPixelBuffer1[pixelStart] = color.GetRed();
sPixelBuffer1[pixelStart + 1] = color.GetGreen();
sPixelBuffer1[pixelStart + 2] = color.GetBlue();
}
else if(subWindow == sSubWindow2)
{
sPixelBuffer2[pixelStart] = color.GetRed();
sPixelBuffer2[pixelStart + 1] = color.GetGreen();
sPixelBuffer2[pixelStart + 2] = color.GetBlue();
}
else if(subWindow == sSubWindow3)
{
sPixelBuffer3[pixelStart] = color.GetRed();
sPixelBuffer3[pixelStart + 1] = color.GetGreen();
sPixelBuffer3[pixelStart + 2] = color.GetBlue();
}
}
else
{
throw out_of_range("Point outside of pixel buffer range");
}
}
示例2: test_three
void test_three()
{
Circle *circle ;
Point *point ;
Shape *shape ;
IMethod *ptr ;
double area = 0.0 ;
circle = New(Circle) ;
circle->Set(circle , 10.0 , 20.0) ;
circle->Move(circle , 100.0 , 300.0) ;
circle->Position(circle) ;
circle->SetRadius(circle , 30.0) ;
area = circle->Area(circle) ;
circle->SetCircle(circle , 1.0 , 2.0 , 3.0) ;
shape = (Shape*)circle ;
shape->Position(shape) ;
area = shape->Area(shape) ;
point = (Point*)circle ;
point->Move(point , 1000.0 , 2000.0) ;
point->Position(point) ;
circle->AddRadius(circle , 50.0) ;
area = point->Area(point) ;
ptr = (IMethod*)circle ;
// area = ptr->Area() ;
ptr->GetClassName() ;
Delete(ptr) ;
}