本文整理汇总了C++中GeoBounds::IsValid方法的典型用法代码示例。如果您正苦于以下问题:C++ GeoBounds::IsValid方法的具体用法?C++ GeoBounds::IsValid怎么用?C++ GeoBounds::IsValid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeoBounds
的用法示例。
在下文中一共展示了GeoBounds::IsValid方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
/**
* Checks if the size difference of any dimension is more than a
* factor of two. This is used to check whether the terrain has to be
* redrawn after zooming in.
*/
static bool
IsLargeSizeDifference(const GeoBounds &a, const GeoBounds &b)
{
assert(a.IsValid());
assert(b.IsValid());
return a.GetWidth().Native() > Double(b.GetWidth().Native()) ||
a.GetHeight().Native() > Double(b.GetHeight().Native());
}
示例2: vp
void
DrawGeoBitmap(const RawBitmap &bitmap, PixelSize bitmap_size,
const GeoBounds &bounds,
const Projection &projection)
{
assert(bounds.IsValid());
const BulkPixelPoint vertices[] = {
projection.GeoToScreen(bounds.GetNorthWest()),
projection.GeoToScreen(bounds.GetNorthEast()),
projection.GeoToScreen(bounds.GetSouthWest()),
projection.GeoToScreen(bounds.GetSouthEast()),
};
const ScopeVertexPointer vp(vertices);
const GLTexture &texture = bitmap.BindAndGetTexture();
const PixelSize allocated = texture.GetAllocatedSize();
const GLfloat src_x = 0, src_y = 0, src_width = bitmap_size.cx,
src_height = bitmap_size.cy;
GLfloat x0 = src_x / allocated.cx;
GLfloat y0 = src_y / allocated.cy;
GLfloat x1 = (src_x + src_width) / allocated.cx;
GLfloat y1 = (src_y + src_height) / allocated.cy;
const GLfloat coord[] = {
x0, y0,
x1, y0,
x0, y1,
x1, y1,
};
#ifdef USE_GLSL
OpenGL::texture_shader->Use();
glEnableVertexAttribArray(OpenGL::Attribute::TEXCOORD);
glVertexAttribPointer(OpenGL::Attribute::TEXCOORD, 2, GL_FLOAT, GL_FALSE,
0, coord);
#else
const GLEnable<GL_TEXTURE_2D> scope;
OpenGL::glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, 0, coord);
#endif
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
#ifdef USE_GLSL
glDisableVertexAttribArray(OpenGL::Attribute::TEXCOORD);
OpenGL::solid_shader->Use();
#else
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
#endif
}
示例3: assert
const GeoBounds &GetBounds() const {
assert(bounds.IsValid());
return bounds;
}
示例4: IsValid
bool IsValid() const {
return bounds.IsValid();
}
示例5: SetBounds
void SetBounds(const GeoBounds &_bounds) {
assert(_bounds.IsValid());
bounds = _bounds;
}