本文整理汇总了C++中CurvePtr::getArea1方法的典型用法代码示例。如果您正苦于以下问题:C++ CurvePtr::getArea1方法的具体用法?C++ CurvePtr::getArea1怎么用?C++ CurvePtr::getArea1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CurvePtr
的用法示例。
在下文中一共展示了CurvePtr::getArea1方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doCreateTile
bool WaterElevationLayer::doCreateTile(int level, int tx, int ty, TileStorage::Slot *data)
{
if (Logger::DEBUG_LOGGER != NULL) {
ostringstream oss;
oss << "ElevationRoad tile " << getProducerId() << " " << level << " " << tx << " " << ty;
Logger::DEBUG_LOGGER->log("DEM", oss.str());
}
if (level >= displayLevel) {
TileCache::Tile *t = graphProducer->findTile(level, tx, ty);
assert(t != NULL);
ObjectTileStorage::ObjectSlot *graphData = dynamic_cast<ObjectTileStorage::ObjectSlot*>(t->getData());
GraphPtr g = graphData->data.cast<Graph>();
if (g->getCurveCount() == 0) {
return false;
}
ptr<FrameBuffer> fb = SceneManager::getCurrentFrameBuffer();
vec3d q = getTileCoords(level, tx, ty);
vec2d nx, ny, lx, ly;
getDeformParameters(q, nx, ny, lx, ly);
float scale = 2.0f * (getTileSize() - 1.0f - (2.0f * getTileBorder())) / q.z;
vec3d tileOffset = vec3d(q.x + q.z / 2.0f, q.y + q.z / 2.0f, scale / getTileSize());
//tileOffsetU->set(vec3f(q.x + q.z / 2.0f, q.y + q.z / 2.0f, scale / getTileSize()));
tileOffsetU->set(vec3f(0.0, 0.0, 1.0));
fb->clear(false, false, true);
if (g->getAreaCount() > 0) {
//fillOffsetU->set(vec3f(q.x + q.z / 2.0f, q.y + q.z / 2.0f, scale / getTileSize()));
fillOffsetU->set(vec3f(0.0, 0.0, 1.0));
depthU->set(0.02f);
colorU->set(vec4f(0.0f, 0.0f, 0.0f, 0.0f));
fb->setDepthTest(true, ALWAYS);
fb->setColorMask(false, false, false, true);
fb->setDepthMask(true);
mesh->setMode(TRIANGLES);
mesh->clear();
tess->beginPolygon(mesh);
ptr<Graph::AreaIterator> ai = g->getAreas();
while (ai->hasNext()) {
AreaPtr a = ai->next();
GraphLayer::drawArea(tileOffset, a, *tess);
}
tess->endPolygon();
fb->draw(fillProg, *mesh);
riverU->set(1);
ai = g->getAreas();
while (ai->hasNext()) {
AreaPtr a = ai->next();
bool island = true;
for (int j = 0; j < a->getCurveCount(); ++j) {
int o;
island &= (a->getCurve(j, o)->getType() == WaterElevationCurveData::ISLAND);
if (!island) {
break;
}
}
for (int j = 0; j < a->getCurveCount(); ++j) {
int orientation;
CurvePtr p = a->getCurve(j, orientation);
if (island) {
orientation = 1 - orientation;
} else {
if (p->getType() == WaterElevationCurveData::ISLAND) {
continue;
}
}
if (orientation != 0) {
GraphLayer::drawCurve(tileOffset, p, vec4f(0, 12, 1, 2), fb, layerProgram, *(meshuv), &nx, &ny, &lx, &ly);
} else {
GraphLayer::drawCurve(tileOffset, p, vec4f(0, -12, 1, 2), fb, layerProgram, *(meshuv), &nx, &ny, &lx, &ly);
}
}
}
fb->setDepthTest(true, NOTEQUAL);
fb->setColorMask(false, false, true, false);
fb->setDepthMask(false);
riverU->set(2);
ptr<Graph::CurveIterator> ci = g->getCurves();
while (ci->hasNext()) {
CurvePtr c = ci->next();
float w = c->getWidth();
float tw = w;
if (w * scale <= 1 || (c->getParent() == NULL && level != 0) || c->getType() == WaterElevationCurveData::LAKE || c->getType() == WaterElevationCurveData::RIVER || c->getArea1() != NULL) {//== WaterElevationCurveData::RIVER) {
continue;
}
ElevationCurveData *cData = dynamic_cast<ElevationCurveData*>(findCurveData(c));
ElevationGraphLayer::drawCurveAltitude(tileOffset, c, cData, tw, tw / w, max(1.0f, 1.0f / scale), false, fb, layerProgram, *meshuv, &nx, &ny, &lx, &ly);
//.........这里部分代码省略.........