Rectangle2D Triangle2D::boundingBox() const { Point2D pmin = min(p1, p2, p3) ; Point2D pmax = max(p1, p2, p3) ; return Rectangle2D(pmin, pmax) ; }
IsoCurveParameters::IsoCurveParameters() { m_cellSize = 0.25; m_boundingBox = Rectangle2D(-5,-5,10,10); m_machineCode = true; m_includeTime = false; m_tInterval = DoubleInterval(0,10); m_frameCount = 20; }
Rectangle2D Context::GetPixelCoord(const Rectangle2D& i_virtual_screen_coord) { uint32_t width = screen_width(); uint32_t height = screen_height(); return Rectangle2D( i_virtual_screen_coord.left() * width, i_virtual_screen_coord.right() * width, i_virtual_screen_coord.top() * height, i_virtual_screen_coord.bottom() * height ); }
//----------------------------------------------------------------------- Renderable *CompositorManager::_getTexturedRectangle2D() { if(!mRectangle) { /// 2D rectangle, to use for render_quad passes mRectangle = OGRE_NEW Rectangle2D(true, HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE); } RenderSystem* rs = Root::getSingleton().getRenderSystem(); Viewport* vp = rs->_getViewport(); Real hOffset = rs->getHorizontalTexelOffset() / (0.5f * vp->getActualWidth()); Real vOffset = rs->getVerticalTexelOffset() / (0.5f * vp->getActualHeight()); mRectangle->setCorners(-1 + hOffset, 1 - vOffset, 1 + hOffset, -1 - vOffset); return mRectangle; }
Rectangle2D operator-(const int16_t a, const Rectangle2D &b) { return Rectangle2D(a - b.Top, a - b.Left, a - b.Bottom, a - b.Right); }
Rectangle2D Rectangle2D::operator-(const int16_t other) const { return Rectangle2D(Top - other, Left - other, Bottom - other, Right - other); }
Rectangle2D Rectangle2D::operator-(const Rectangle2D &other) const { return Rectangle2D(Top - other.Top, Left - other.Left, Bottom - other.Bottom, Right - other.Right); }
Rectangle2D Rectangle2D::operator+(const int16_t other) const { return Rectangle2D(Top + other, Left + other, Bottom + other, Right + other); }
Rectangle2D Rectangle2D::operator+(const Rectangle2D &other) const { return Rectangle2D(Top + other.Top, Left + other.Left, Bottom + other.Bottom, Right + other.Right); }
Rectangle2D Rectangle2D::operator/(const int16_t other) const { return Rectangle2D(Top / other, Left / other, Bottom / other, Right / other); }
Rectangle2D Rectangle2D::operator/(const Rectangle2D &other) const { return Rectangle2D(Top / other.Top, Left / other.Left, Bottom / other.Bottom, Right / other.Right); }
Rectangle2D Rectangle2D::operator*(const int16_t other) const { return Rectangle2D(Top * other, Left * other, Bottom * other, Right * other); }
Rectangle2D Rectangle2D::operator*(const Rectangle2D &other) const { return Rectangle2D(Top * other.Top, Left * other.Left, Bottom * other.Bottom, Right * other.Right); }