|
Revision 13041, 1.0 kB
(checked in by robert, 14 months ago)
|
|
Ran script to remove trailing spaces and tabs
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | #include "TXPSeamLOD.h" |
|---|
| 2 | #include "TXPArchive.h" |
|---|
| 3 | #include "TXPPagedLOD.h" |
|---|
| 4 | #include "TileMapper.h" |
|---|
| 5 | |
|---|
| 6 | using namespace txp; |
|---|
| 7 | using namespace osg; |
|---|
| 8 | |
|---|
| 9 | TXPSeamLOD::TXPSeamLOD() : |
|---|
| 10 | Group() |
|---|
| 11 | { |
|---|
| 12 | _dx = 0; |
|---|
| 13 | _dy = 0; |
|---|
| 14 | } |
|---|
| 15 | |
|---|
| 16 | TXPSeamLOD::TXPSeamLOD(int x, int y, int lod, int dx, int dy) : |
|---|
| 17 | Group() |
|---|
| 18 | { |
|---|
| 19 | _tid.x = x; |
|---|
| 20 | _tid.y = y; |
|---|
| 21 | _tid.lod = lod; |
|---|
| 22 | _dx = dx; |
|---|
| 23 | _dy = dy; |
|---|
| 24 | } |
|---|
| 25 | |
|---|
| 26 | TXPSeamLOD::TXPSeamLOD(const TXPSeamLOD& ttg,const osg::CopyOp& copyop) : |
|---|
| 27 | Group(ttg,copyop) |
|---|
| 28 | { |
|---|
| 29 | _tid = ttg._tid; |
|---|
| 30 | _dx = ttg._dx; |
|---|
| 31 | _dy = ttg._dy; |
|---|
| 32 | } |
|---|
| 33 | |
|---|
| 34 | void TXPSeamLOD::traverse(osg::NodeVisitor& nv) |
|---|
| 35 | { |
|---|
| 36 | if (nv.getVisitorType()==osg::NodeVisitor::CULL_VISITOR && getNumChildren()==2) |
|---|
| 37 | { |
|---|
| 38 | |
|---|
| 39 | TileMapper* tileMapper = dynamic_cast<TileMapper*>(nv.getUserData()); |
|---|
| 40 | |
|---|
| 41 | if (tileMapper && !tileMapper->isTileNeighbourALowerLODLevel(_tid,_dx,_dy)) |
|---|
| 42 | { |
|---|
| 43 | getChild(1)->accept(nv); |
|---|
| 44 | } |
|---|
| 45 | else |
|---|
| 46 | { |
|---|
| 47 | getChild(0)->accept(nv); |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | } |
|---|
| 51 | else |
|---|
| 52 | { |
|---|
| 53 | Group::traverse(nv); |
|---|
| 54 | } |
|---|
| 55 | } |
|---|