[447] | 1 | // ================================================================
|
---|
| 2 | // $Id$
|
---|
| 3 | // ****************************************************************
|
---|
| 4 | //
|
---|
| 5 | // Initial coding by
|
---|
| 6 | /**
|
---|
| 7 | @author Jiri Bittner
|
---|
| 8 | */
|
---|
| 9 |
|
---|
| 10 | #ifndef __RSSTREE_H__
|
---|
| 11 | #define __RSSTREE_H__
|
---|
| 12 |
|
---|
| 13 | // Standard headers
|
---|
| 14 | #include <iomanip>
|
---|
| 15 | #include <vector>
|
---|
| 16 | #include <functional>
|
---|
| 17 | #include <stack>
|
---|
| 18 |
|
---|
| 19 |
|
---|
| 20 | // User headers
|
---|
| 21 | #include "VssRay.h"
|
---|
| 22 | #include "AxisAlignedBox3.h"
|
---|
[492] | 23 | #include "Halton.h"
|
---|
[511] | 24 | #include "Beam.h"
|
---|
| 25 | #include "Statistics.h"
|
---|
| 26 | #include "Ray.h"
|
---|
[447] | 27 |
|
---|
[511] | 28 | #include "Containers.h"
|
---|
| 29 |
|
---|
[860] | 30 | namespace GtpVisibilityPreprocessor {
|
---|
| 31 |
|
---|
[447] | 32 | #define USE_KDNODE_VECTORS 1
|
---|
| 33 | #define _RSS_STATISTICS
|
---|
| 34 | #define _RSS_TRAVERSAL_STATISTICS
|
---|
| 35 |
|
---|
| 36 |
|
---|
| 37 | // --------------------------------------------------------------
|
---|
| 38 | // Static statistics for kd-tree search
|
---|
| 39 | // --------------------------------------------------------------
|
---|
| 40 | class RssStatistics :
|
---|
| 41 | public StatisticsBase
|
---|
| 42 | {
|
---|
| 43 | public:
|
---|
| 44 | // total number of nodes
|
---|
| 45 | int nodes;
|
---|
[569] | 46 | // number of leaves
|
---|
| 47 | int leaves;
|
---|
[447] | 48 | // number of splits along each of the axes
|
---|
| 49 | int splits[7];
|
---|
| 50 | // totals number of rays
|
---|
| 51 | int rays;
|
---|
| 52 | // initial size of the pvs
|
---|
| 53 | int initialPvsSize;
|
---|
| 54 | // total number of query domains
|
---|
| 55 | int queryDomains;
|
---|
| 56 | // total number of ray references
|
---|
| 57 | int rayRefs;
|
---|
| 58 |
|
---|
| 59 | // max depth nodes
|
---|
| 60 | int maxDepthNodes;
|
---|
| 61 | // max depth nodes
|
---|
| 62 | int minPvsNodes;
|
---|
| 63 | int minRaysNodes;
|
---|
| 64 | // max ray contribution nodes
|
---|
| 65 | int maxRayContribNodes;
|
---|
| 66 | // max depth nodes
|
---|
| 67 | int minSizeNodes;
|
---|
| 68 | int maxCostRatioNodes;
|
---|
| 69 |
|
---|
| 70 | // max number of rays per node
|
---|
| 71 | int maxRayRefs;
|
---|
| 72 | // number of dynamically added ray refs
|
---|
| 73 | int addedRayRefs;
|
---|
| 74 | // number of dynamically removed ray refs
|
---|
| 75 | int removedRayRefs;
|
---|
[492] | 76 |
|
---|
| 77 |
|
---|
| 78 |
|
---|
| 79 | // dynamically updated values
|
---|
| 80 | float avgPvsSize;
|
---|
| 81 | float avgRays;
|
---|
| 82 | float avgRayContribution;
|
---|
| 83 | float avgPvsEntropy;
|
---|
| 84 | float avgRayLengthEntropy;
|
---|
| 85 | float avgImportance;
|
---|
| 86 |
|
---|
| 87 | float avgWeightedRayContribution;
|
---|
| 88 |
|
---|
[447] | 89 | // Constructor
|
---|
| 90 | RssStatistics() {
|
---|
| 91 | Reset();
|
---|
| 92 | }
|
---|
| 93 |
|
---|
| 94 | int Nodes() const {return nodes;}
|
---|
| 95 | int Interior() const { return nodes/2; }
|
---|
[569] | 96 | int Leaves() const { return Nodes() - Interior(); }
|
---|
[447] | 97 |
|
---|
| 98 | void Reset() {
|
---|
| 99 | nodes = 0;
|
---|
| 100 | for (int i=0; i<7; i++)
|
---|
| 101 | splits[i] = 0;
|
---|
| 102 | rays = queryDomains = 0;
|
---|
| 103 | rayRefs = 0;
|
---|
| 104 | maxDepthNodes = 0;
|
---|
| 105 | minPvsNodes = 0;
|
---|
| 106 | minRaysNodes = 0;
|
---|
| 107 | maxRayRefs = 0;
|
---|
| 108 | addedRayRefs = removedRayRefs = 0;
|
---|
| 109 | initialPvsSize = 0;
|
---|
| 110 | maxRayContribNodes = 0;
|
---|
| 111 | minSizeNodes = 0;
|
---|
| 112 | maxCostRatioNodes = 0;
|
---|
| 113 | }
|
---|
| 114 |
|
---|
| 115 |
|
---|
| 116 | void
|
---|
| 117 | Print(ostream &app) const;
|
---|
| 118 |
|
---|
| 119 | friend ostream &operator<<(ostream &s, const RssStatistics &stat) {
|
---|
| 120 | stat.Print(s);
|
---|
| 121 | return s;
|
---|
| 122 | }
|
---|
| 123 |
|
---|
| 124 | };
|
---|
| 125 |
|
---|
| 126 |
|
---|
| 127 |
|
---|
| 128 |
|
---|
| 129 | class RssTreeInterior;
|
---|
| 130 |
|
---|
| 131 |
|
---|
| 132 | // --------------------------------------------------------------
|
---|
| 133 | // KD-tree node - abstract class
|
---|
| 134 | // --------------------------------------------------------------
|
---|
| 135 | class RssTreeNode
|
---|
| 136 | {
|
---|
| 137 | public:
|
---|
| 138 |
|
---|
| 139 | struct RayInfo
|
---|
| 140 | {
|
---|
| 141 | // pointer to the actual ray
|
---|
| 142 | VssRay *mRay;
|
---|
| 143 |
|
---|
| 144 | RayInfo():mRay(NULL) {}
|
---|
| 145 |
|
---|
| 146 | RayInfo(VssRay *r):mRay(r)
|
---|
| 147 | {}
|
---|
| 148 |
|
---|
| 149 | enum {
|
---|
| 150 | SOURCE_RAY = 0,
|
---|
| 151 | TERMINATION_RAY,
|
---|
| 152 | PASSING_RAY,
|
---|
| 153 | CONTAINED_RAY
|
---|
| 154 | };
|
---|
| 155 |
|
---|
| 156 | int GetRayClass() const {
|
---|
| 157 | return SOURCE_RAY;
|
---|
| 158 | }
|
---|
| 159 |
|
---|
| 160 | friend bool operator<(const RayInfo &a, const RayInfo &b) {
|
---|
| 161 | return a.mRay < b.mRay;
|
---|
| 162 | }
|
---|
[492] | 163 |
|
---|
[1112] | 164 | #define USE_ORIGIN 1
|
---|
[447] | 165 |
|
---|
| 166 | Vector3 GetOrigin() const {
|
---|
[492] | 167 | #if USE_ORIGIN
|
---|
[447] | 168 | return mRay->GetOrigin();
|
---|
[492] | 169 | #else
|
---|
| 170 | return mRay->GetTermination();
|
---|
| 171 | #endif
|
---|
[447] | 172 | }
|
---|
| 173 |
|
---|
[492] | 174 | Vector3 GetTermination() const {
|
---|
| 175 | #if USE_ORIGIN
|
---|
| 176 | return mRay->GetTermination();
|
---|
| 177 | #else
|
---|
| 178 | return mRay->GetOrigin();
|
---|
| 179 | #endif
|
---|
| 180 | }
|
---|
| 181 |
|
---|
| 182 | float GetOrigin(const int axis) const {
|
---|
| 183 | #if USE_ORIGIN
|
---|
[447] | 184 | return mRay->GetOrigin(axis);
|
---|
[492] | 185 | #else
|
---|
[447] | 186 | return mRay->GetTermination(axis);
|
---|
[492] | 187 | #endif
|
---|
[447] | 188 | }
|
---|
| 189 |
|
---|
[492] | 190 | Vector3 GetDir() const {
|
---|
| 191 | #if USE_ORIGIN
|
---|
| 192 | return mRay->GetDir();
|
---|
| 193 | #else
|
---|
| 194 | return -mRay->GetDir();
|
---|
| 195 | #endif
|
---|
[447] | 196 | }
|
---|
[492] | 197 |
|
---|
| 198 | float GetDirParametrization(const int axis) const {
|
---|
| 199 | #if USE_ORIGIN
|
---|
| 200 | return mRay->GetDirParametrization(axis);
|
---|
| 201 | #else
|
---|
| 202 | return mRay->GetOpositeDirParametrization(axis);
|
---|
| 203 | #endif
|
---|
| 204 | }
|
---|
| 205 |
|
---|
[447] | 206 |
|
---|
[492] | 207 | // Vector3 GetTermination() const {
|
---|
| 208 | // return mRay->GetOrigin();
|
---|
| 209 | // }
|
---|
| 210 |
|
---|
| 211 | // float GetTermination(const int axis) const {
|
---|
| 212 | // return mRay->GetTermination(axis);
|
---|
| 213 | // }
|
---|
| 214 |
|
---|
| 215 | Intersectable *GetObject() const {
|
---|
| 216 | #if USE_ORIGIN
|
---|
| 217 | return mRay->mTerminationObject;
|
---|
| 218 | #else
|
---|
| 219 | return mRay->mOriginObject;
|
---|
| 220 | #endif
|
---|
| 221 | }
|
---|
| 222 |
|
---|
| 223 | Intersectable *GetSourceObject() const {
|
---|
| 224 | #if USE_ORIGIN
|
---|
| 225 | return mRay->mOriginObject;
|
---|
| 226 | #else
|
---|
| 227 | return mRay->mTerminationObject;
|
---|
| 228 | #endif
|
---|
| 229 | }
|
---|
| 230 |
|
---|
| 231 | // Vector3 Extrap(const float t) const {
|
---|
| 232 | // return mRay->Extrap(t);
|
---|
| 233 | // }
|
---|
| 234 |
|
---|
[447] | 235 | int
|
---|
| 236 | ComputeRaySide(const int axis,
|
---|
| 237 | const float position
|
---|
| 238 | ) const {
|
---|
| 239 |
|
---|
| 240 | // only compare the side of the origin
|
---|
[492] | 241 | float rpos = (axis < 3) ? GetOrigin(axis) : GetDirParametrization(axis - 3);
|
---|
[447] | 242 | return (rpos <= position) ? -1 : 1;
|
---|
| 243 | }
|
---|
[492] | 244 |
|
---|
| 245 | static bool GreaterWeightedPvsContribution(const RayInfo &a,
|
---|
| 246 | const RayInfo &b) {
|
---|
| 247 | return a.mRay->mWeightedPvsContribution > b.mRay->mWeightedPvsContribution;
|
---|
| 248 | }
|
---|
| 249 |
|
---|
| 250 | static float Distance(const RayInfo &a,
|
---|
| 251 | const RayInfo &b)
|
---|
| 252 | {
|
---|
| 253 | if (a.mRay->mTerminationObject == b.mRay->mTerminationObject)
|
---|
| 254 | return MAX_FLOAT;
|
---|
| 255 |
|
---|
| 256 | return Min(a.mRay->SqrDistance(b.GetTermination()),
|
---|
| 257 | b.mRay->SqrDistance(a.GetTermination()));
|
---|
| 258 | }
|
---|
| 259 |
|
---|
[447] | 260 |
|
---|
[492] | 261 | static float SqrDistance5D(const RayInfo &a,
|
---|
| 262 | const RayInfo &b,
|
---|
| 263 | const Vector3 &spatialDerivative,
|
---|
| 264 | const Vector3 &directionalDerivative
|
---|
| 265 | )
|
---|
| 266 | {
|
---|
| 267 | Vector3 spatialDiff = b.GetOrigin() - a.GetOrigin();
|
---|
| 268 | Vector3 directionalDiff = b.GetDir() - a.GetDir();
|
---|
| 269 |
|
---|
| 270 | return DotProd(spatialDiff, spatialDerivative) +
|
---|
| 271 | DotProd(directionalDiff, directionalDerivative);
|
---|
| 272 | }
|
---|
| 273 |
|
---|
| 274 |
|
---|
[447] | 275 | };
|
---|
[492] | 276 |
|
---|
| 277 | struct SilhouetteRays {
|
---|
| 278 | RayInfo *a;
|
---|
| 279 | RayInfo *b;
|
---|
| 280 | SilhouetteRays() {}
|
---|
| 281 | SilhouetteRays(RayInfo *_a, RayInfo *_b):a(_a), b(_b) {
|
---|
| 282 | }
|
---|
| 283 | };
|
---|
[447] | 284 |
|
---|
| 285 | typedef vector<RayInfo> RayInfoContainer;
|
---|
| 286 |
|
---|
| 287 | enum { EInterior, ELeaf };
|
---|
| 288 |
|
---|
| 289 | /////////////////////////////////
|
---|
| 290 | // The actual data goes here
|
---|
| 291 |
|
---|
| 292 | // link to the parent
|
---|
| 293 | RssTreeInterior *parent;
|
---|
| 294 |
|
---|
| 295 | enum {SPLIT_X=0, SPLIT_Y, SPLIT_Z, SPLIT_DIRX, SPLIT_DIRY, SPLIT_DIRZ};
|
---|
| 296 |
|
---|
| 297 | // splitting axis
|
---|
| 298 | char axis;
|
---|
| 299 |
|
---|
| 300 | // depth
|
---|
| 301 | unsigned char depth;
|
---|
| 302 |
|
---|
| 303 | // short depth;
|
---|
| 304 | //
|
---|
| 305 | /////////////////////////////////
|
---|
[516] | 306 |
|
---|
| 307 |
|
---|
| 308 | // the bbox of the node
|
---|
| 309 | AxisAlignedBox3 bbox;
|
---|
[447] | 310 |
|
---|
[516] | 311 | // the bbox of the node
|
---|
| 312 | AxisAlignedBox3 dirBBox;
|
---|
| 313 |
|
---|
| 314 |
|
---|
[447] | 315 | inline RssTreeNode(RssTreeInterior *p);
|
---|
| 316 |
|
---|
| 317 |
|
---|
| 318 | virtual ~RssTreeNode() {};
|
---|
| 319 | virtual int Type() const = 0;
|
---|
| 320 |
|
---|
| 321 |
|
---|
| 322 | bool IsLeaf() const { return axis == -1; }
|
---|
| 323 |
|
---|
| 324 | virtual void Print(ostream &s) const = 0;
|
---|
| 325 |
|
---|
| 326 | virtual int GetAccessTime() {
|
---|
| 327 | return 0x7FFFFFF;
|
---|
| 328 | }
|
---|
| 329 |
|
---|
| 330 |
|
---|
| 331 |
|
---|
| 332 | };
|
---|
| 333 |
|
---|
| 334 | // --------------------------------------------------------------
|
---|
| 335 | // KD-tree node - interior node
|
---|
| 336 | // --------------------------------------------------------------
|
---|
| 337 | class RssTreeInterior :
|
---|
| 338 | public RssTreeNode
|
---|
| 339 | {
|
---|
| 340 | public:
|
---|
| 341 | // plane in local modelling coordinates
|
---|
| 342 | float position;
|
---|
| 343 |
|
---|
| 344 | // pointers to children
|
---|
| 345 | RssTreeNode *back, *front;
|
---|
| 346 |
|
---|
[463] | 347 |
|
---|
[447] | 348 | // data for caching
|
---|
| 349 | long accesses;
|
---|
| 350 | long lastAccessTime;
|
---|
| 351 |
|
---|
| 352 | RssTreeInterior(RssTreeInterior *p):RssTreeNode(p),
|
---|
| 353 | back(NULL),
|
---|
| 354 | front(NULL),
|
---|
| 355 | accesses(0),
|
---|
| 356 | lastAccessTime(-1)
|
---|
| 357 | { }
|
---|
| 358 |
|
---|
| 359 | virtual int GetAccessTime() {
|
---|
| 360 | return lastAccessTime;
|
---|
| 361 | }
|
---|
| 362 |
|
---|
| 363 | void SetupChildLinks(RssTreeNode *b, RssTreeNode *f) {
|
---|
| 364 | back = b;
|
---|
| 365 | front = f;
|
---|
| 366 | b->parent = f->parent = this;
|
---|
| 367 | }
|
---|
| 368 |
|
---|
| 369 | void ReplaceChildLink(RssTreeNode *oldChild, RssTreeNode *newChild) {
|
---|
| 370 | if (back == oldChild)
|
---|
| 371 | back = newChild;
|
---|
| 372 | else
|
---|
| 373 | front = newChild;
|
---|
| 374 | }
|
---|
| 375 |
|
---|
| 376 | virtual int Type() const { return EInterior; }
|
---|
| 377 |
|
---|
| 378 | virtual ~RssTreeInterior() {
|
---|
| 379 | if (back)
|
---|
| 380 | delete back;
|
---|
| 381 | if (front)
|
---|
| 382 | delete front;
|
---|
| 383 | }
|
---|
| 384 |
|
---|
| 385 | virtual void Print(ostream &s) const {
|
---|
| 386 | if (axis == 0)
|
---|
| 387 | s<<"x ";
|
---|
| 388 | else
|
---|
| 389 | if (axis == 1)
|
---|
| 390 | s<<"y ";
|
---|
| 391 | else
|
---|
| 392 | s<<"z ";
|
---|
| 393 | s<<position<<" ";
|
---|
| 394 | back->Print(s);
|
---|
| 395 | front->Print(s);
|
---|
| 396 | }
|
---|
| 397 |
|
---|
| 398 |
|
---|
| 399 |
|
---|
| 400 | int ComputeRaySide(const
|
---|
| 401 | RayInfo &rayData
|
---|
| 402 | ) {
|
---|
| 403 | return rayData.ComputeRaySide(axis, position);
|
---|
| 404 | }
|
---|
| 405 |
|
---|
| 406 | };
|
---|
| 407 |
|
---|
| 408 |
|
---|
| 409 | // --------------------------------------------------------------
|
---|
| 410 | // KD-tree node - leaf node
|
---|
| 411 | // --------------------------------------------------------------
|
---|
| 412 | class RssTreeLeaf :
|
---|
| 413 | public RssTreeNode
|
---|
| 414 | {
|
---|
| 415 | private:
|
---|
| 416 | int mPvsSize;
|
---|
| 417 | public:
|
---|
| 418 | static int mailID;
|
---|
| 419 | int mailbox;
|
---|
| 420 |
|
---|
| 421 | RayInfoContainer rays;
|
---|
[492] | 422 | int mTotalRays;
|
---|
[447] | 423 |
|
---|
| 424 | bool mValidPvs;
|
---|
[492] | 425 | float mImportance;
|
---|
[447] | 426 |
|
---|
[492] | 427 | HaltonSequence halton;
|
---|
[507] | 428 |
|
---|
[512] | 429 | Beam mBeam;
|
---|
[492] | 430 |
|
---|
[447] | 431 | RssTreeLeaf(RssTreeInterior *p,
|
---|
| 432 | const int nRays
|
---|
[492] | 433 | ):RssTreeNode(p), rays(), mPvsSize(0), mTotalRays(0), mValidPvs(false) {
|
---|
[447] | 434 | rays.reserve(nRays);
|
---|
| 435 | }
|
---|
| 436 |
|
---|
| 437 | virtual ~RssTreeLeaf() { }
|
---|
| 438 |
|
---|
| 439 | virtual int Type() const { return ELeaf; }
|
---|
| 440 |
|
---|
| 441 | virtual void Print(ostream &s) const {
|
---|
| 442 | s<<
|
---|
[469] | 443 | "L: rays="<<(int)rays.size()<<
|
---|
[492] | 444 | " pvs="<<mPvsSize<<" importance="<<mImportance<<endl;
|
---|
[447] | 445 | };
|
---|
| 446 |
|
---|
| 447 | void AddRay(const RayInfo &data) {
|
---|
| 448 | mValidPvs = false;
|
---|
| 449 | rays.push_back(data);
|
---|
[492] | 450 | mTotalRays++;
|
---|
| 451 | data.mRay->Ref();
|
---|
[447] | 452 | }
|
---|
| 453 |
|
---|
| 454 | int GetPvsSize() const {
|
---|
| 455 | return mPvsSize;
|
---|
| 456 | }
|
---|
| 457 |
|
---|
| 458 | void SetPvsSize(const int s) {
|
---|
| 459 | mPvsSize = s;
|
---|
| 460 | mValidPvs = true;
|
---|
| 461 | }
|
---|
| 462 |
|
---|
| 463 |
|
---|
| 464 | float
|
---|
[492] | 465 | ComputePvsEntropy() const;
|
---|
[447] | 466 |
|
---|
| 467 | float
|
---|
[492] | 468 | ComputeRayLengthEntropy() const;
|
---|
[447] | 469 |
|
---|
| 470 | float
|
---|
[492] | 471 | ComputeRayTerminationEntropy() const;
|
---|
[447] | 472 |
|
---|
| 473 |
|
---|
[492] | 474 | float
|
---|
| 475 | ComputeEntropyImportance() const;
|
---|
| 476 |
|
---|
| 477 | float
|
---|
| 478 | ComputeRayContributionImportance() const;
|
---|
| 479 |
|
---|
[447] | 480 | void Mail() { mailbox = mailID; }
|
---|
| 481 | static void NewMail() { mailID++; }
|
---|
| 482 | bool Mailed() const { return mailbox == mailID; }
|
---|
| 483 |
|
---|
| 484 | bool Mailed(const int mail) {
|
---|
| 485 | return mailbox >= mailID + mail;
|
---|
| 486 | }
|
---|
| 487 |
|
---|
| 488 | float GetAvgRayContribution() const {
|
---|
| 489 | return GetPvsSize()/((float)rays.size() + Limits::Small);
|
---|
| 490 | }
|
---|
| 491 |
|
---|
| 492 | float GetImportance() const;
|
---|
| 493 |
|
---|
| 494 | float GetSqrRayContribution() const {
|
---|
| 495 | return sqr(GetPvsSize()/((float)rays.size() + Limits::Small));
|
---|
| 496 | }
|
---|
| 497 |
|
---|
| 498 | // comparator for the
|
---|
| 499 | struct less_contribution : public
|
---|
| 500 | binary_function<const RssTreeLeaf *, const RssTreeLeaf *, bool> {
|
---|
| 501 |
|
---|
| 502 | bool operator()(const RssTreeLeaf * a, const RssTreeLeaf *b) {
|
---|
| 503 | return a->GetAvgRayContribution() < b->GetAvgRayContribution();
|
---|
| 504 | }
|
---|
| 505 | };
|
---|
| 506 |
|
---|
| 507 | struct greater_contribution : public
|
---|
| 508 | binary_function<const RssTreeLeaf *, const RssTreeLeaf *, bool> {
|
---|
| 509 |
|
---|
| 510 | bool operator()(const RssTreeLeaf * a, const RssTreeLeaf *b) {
|
---|
| 511 | return a->GetAvgRayContribution() > b->GetAvgRayContribution();
|
---|
| 512 | }
|
---|
| 513 | };
|
---|
| 514 |
|
---|
| 515 | friend bool GreaterContribution(const RssTreeLeaf * a, const RssTreeLeaf *b) {
|
---|
| 516 | return a->GetAvgRayContribution() > b->GetAvgRayContribution();
|
---|
| 517 | }
|
---|
[492] | 518 |
|
---|
[447] | 519 |
|
---|
| 520 | };
|
---|
| 521 |
|
---|
| 522 | // Inline functions
|
---|
| 523 | inline
|
---|
| 524 | RssTreeNode::RssTreeNode(RssTreeInterior *p):
|
---|
| 525 | parent(p), axis(-1), depth(p ? p->depth + 1 : 0) {}
|
---|
| 526 |
|
---|
| 527 |
|
---|
| 528 |
|
---|
| 529 | // ---------------------------------------------------------------
|
---|
| 530 | // Main LSDS search class
|
---|
| 531 | // ---------------------------------------------------------------
|
---|
| 532 | class RssTree
|
---|
| 533 | {
|
---|
| 534 | struct TraversalData
|
---|
| 535 | {
|
---|
| 536 | RssTreeNode *node;
|
---|
| 537 | AxisAlignedBox3 bbox;
|
---|
| 538 | int depth;
|
---|
| 539 | float priority;
|
---|
| 540 |
|
---|
| 541 | TraversalData() {}
|
---|
| 542 |
|
---|
| 543 | TraversalData(RssTreeNode *n, const float p):
|
---|
| 544 | node(n), priority(p)
|
---|
| 545 | {}
|
---|
| 546 |
|
---|
| 547 | TraversalData(RssTreeNode *n,
|
---|
| 548 | const AxisAlignedBox3 &b,
|
---|
| 549 | const int d):
|
---|
| 550 | node(n), bbox(b), depth(d) {}
|
---|
| 551 |
|
---|
| 552 |
|
---|
| 553 | // comparator for the
|
---|
| 554 | struct less_priority : public
|
---|
| 555 | binary_function<const TraversalData, const TraversalData, bool> {
|
---|
| 556 |
|
---|
| 557 | bool operator()(const TraversalData a, const TraversalData b) {
|
---|
| 558 | return a.priority < b.priority;
|
---|
| 559 | }
|
---|
| 560 |
|
---|
| 561 | };
|
---|
| 562 |
|
---|
| 563 | // ~TraversalData() {}
|
---|
| 564 | // TraversalData(const TraversalData &s):node(s.node), bbox(s.bbox), depth(s.depth) {}
|
---|
| 565 |
|
---|
| 566 | friend bool operator<(const TraversalData &a,
|
---|
| 567 | const TraversalData &b) {
|
---|
| 568 | // return a.node->queries.size() < b.node->queries.size();
|
---|
| 569 | RssTreeLeaf *leafa = (RssTreeLeaf *) a.node;
|
---|
| 570 | RssTreeLeaf *leafb = (RssTreeLeaf *) b.node;
|
---|
| 571 | #if 0
|
---|
| 572 | return
|
---|
| 573 | leafa->rays.size()*a.bbox.GetVolume()
|
---|
| 574 | <
|
---|
| 575 | leafb->rays.size()*b.bbox.GetVolume();
|
---|
| 576 | #endif
|
---|
| 577 | #if 0
|
---|
| 578 | return
|
---|
| 579 | leafa->GetPvsSize()*a.bbox.GetVolume()
|
---|
| 580 | <
|
---|
| 581 | leafb->GetPvsSize()*b.bbox.GetVolume();
|
---|
| 582 | #endif
|
---|
| 583 | #if 0
|
---|
| 584 | return
|
---|
| 585 | leafa->GetPvsSize()
|
---|
| 586 | <
|
---|
| 587 | leafb->GetPvsSize();
|
---|
| 588 | #endif
|
---|
| 589 | #if 0
|
---|
| 590 | return
|
---|
| 591 | leafa->GetPvsSize()/(leafa->rays.size()+1)
|
---|
| 592 | >
|
---|
| 593 | leafb->GetPvsSize()/(leafb->rays.size()+1);
|
---|
| 594 | #endif
|
---|
| 595 | #if 1
|
---|
| 596 | return
|
---|
| 597 | leafa->GetPvsSize()*leafa->rays.size()
|
---|
| 598 | <
|
---|
| 599 | leafb->GetPvsSize()*leafb->rays.size();
|
---|
| 600 | #endif
|
---|
| 601 | }
|
---|
| 602 | };
|
---|
| 603 |
|
---|
| 604 | // simplified data for ray traversal only...
|
---|
| 605 |
|
---|
| 606 | struct RayTraversalData {
|
---|
| 607 |
|
---|
| 608 | RssTreeNode::RayInfo rayData;
|
---|
| 609 | RssTreeNode *node;
|
---|
| 610 |
|
---|
| 611 | RayTraversalData() {}
|
---|
| 612 | RayTraversalData(RssTreeNode *n,
|
---|
| 613 | const RssTreeNode::RayInfo &data):
|
---|
| 614 | rayData(data), node(n) {}
|
---|
| 615 | };
|
---|
| 616 |
|
---|
| 617 | public:
|
---|
| 618 | /////////////////////////////
|
---|
| 619 | // The core pointer
|
---|
[516] | 620 | vector<RssTreeNode *> mRoots;
|
---|
[447] | 621 |
|
---|
[516] | 622 |
|
---|
| 623 |
|
---|
[447] | 624 | /////////////////////////////
|
---|
| 625 | // Basic properties
|
---|
| 626 |
|
---|
| 627 | // total number of nodes of the tree
|
---|
| 628 | int nodes;
|
---|
[516] | 629 |
|
---|
[447] | 630 | // axis aligned bounding box of the scene
|
---|
| 631 | AxisAlignedBox3 bbox;
|
---|
| 632 |
|
---|
| 633 | // axis aligned bounding box of directions
|
---|
| 634 | AxisAlignedBox3 dirBBox;
|
---|
[463] | 635 |
|
---|
| 636 | // forced bounding box for from viewcell visibility
|
---|
[516] | 637 | // AxisAlignedBox3 *mForcedBoundingBox;
|
---|
[463] | 638 |
|
---|
[447] | 639 | /////////////////////////////
|
---|
| 640 | // Construction parameters
|
---|
| 641 |
|
---|
| 642 | // epsilon used for the construction
|
---|
| 643 | float epsilon;
|
---|
| 644 |
|
---|
| 645 | // ratio between traversal and intersection costs
|
---|
| 646 | float ct_div_ci;
|
---|
| 647 | // max depth of the tree
|
---|
| 648 | int termMaxDepth;
|
---|
| 649 | // minimal ratio of the volume of the cell and the query volume
|
---|
| 650 | float termMinSize;
|
---|
| 651 |
|
---|
| 652 | // minimal pvs per node to still get subdivided
|
---|
| 653 | int termMinPvs;
|
---|
| 654 |
|
---|
| 655 | // minimal ray number per node to still get subdivided
|
---|
| 656 | int termMinRays;
|
---|
| 657 |
|
---|
| 658 | // maximal cost ration to subdivide a node
|
---|
| 659 | float termMaxCostRatio;
|
---|
| 660 |
|
---|
| 661 | // maximal contribution per ray to subdivide the node
|
---|
| 662 | float termMaxRayContribution;
|
---|
| 663 |
|
---|
| 664 | // randomized construction
|
---|
| 665 | bool randomize;
|
---|
[516] | 666 |
|
---|
| 667 | // use a root per object in the tree
|
---|
| 668 | bool mPerObjectTree;
|
---|
[447] | 669 |
|
---|
| 670 | // type of the splitting to use fo rthe tree construction
|
---|
| 671 | enum {ESplitRegular, ESplitHeuristic, ESplitHybrid };
|
---|
| 672 | int splitType;
|
---|
| 673 |
|
---|
| 674 | bool mSplitUseOnlyDrivingAxis;
|
---|
| 675 |
|
---|
| 676 |
|
---|
| 677 | // interleave directional and spatial splits based on their costs
|
---|
| 678 | // if false directional splits are only performed after spatial splits
|
---|
| 679 | bool mInterleaveDirSplits;
|
---|
| 680 |
|
---|
| 681 | // depth at which directional splits are performed if mInterleaveDirSplits is false
|
---|
| 682 | int mDirSplitDepth;
|
---|
[492] | 683 |
|
---|
[1199] | 684 | // depth till which the regular splits are applied for hybrid split type
|
---|
| 685 | int mHybridDepth;
|
---|
| 686 |
|
---|
[492] | 687 | // maximal number of rays maintained in the rss tree
|
---|
| 688 | int mMaxRays;
|
---|
[447] | 689 |
|
---|
| 690 | // maximal size of the box on which the refdir splitting can be performed
|
---|
| 691 | // (relative to the scene bbox
|
---|
| 692 | float refDirBoxMaxSize;
|
---|
| 693 |
|
---|
| 694 | // maximum alovable memory in MB
|
---|
| 695 | float maxTotalMemory;
|
---|
| 696 |
|
---|
| 697 | // maximum alovable memory for static kd tree in MB
|
---|
| 698 | float maxStaticMemory;
|
---|
| 699 |
|
---|
| 700 | // this is used during the construction depending
|
---|
| 701 | // on the type of the tree and queries...
|
---|
| 702 | float maxMemory;
|
---|
| 703 |
|
---|
| 704 |
|
---|
| 705 | // minimal acess time for collapse
|
---|
| 706 | int accessTimeThreshold;
|
---|
| 707 |
|
---|
| 708 | // minimal depth at which to perform collapse
|
---|
| 709 | int minCollapseDepth;
|
---|
| 710 |
|
---|
[492] | 711 | bool mImportanceBasedCost;
|
---|
| 712 |
|
---|
| 713 | // sampling pass
|
---|
| 714 | int mCurrentPass;
|
---|
[447] | 715 |
|
---|
| 716 | // reusable array of split candidates
|
---|
| 717 | vector<SortableEntry> *splitCandidates;
|
---|
| 718 | /////////////////////////////
|
---|
| 719 |
|
---|
| 720 | RssStatistics stat;
|
---|
| 721 |
|
---|
| 722 |
|
---|
| 723 | RssTree();
|
---|
| 724 | virtual ~RssTree();
|
---|
| 725 |
|
---|
| 726 | virtual void
|
---|
| 727 | Construct(
|
---|
[516] | 728 | ObjectContainer &objects,
|
---|
| 729 | VssRayContainer &rays
|
---|
| 730 | // AxisAlignedBox3 *forcedBoundingBox = NULL
|
---|
[447] | 731 | );
|
---|
| 732 |
|
---|
| 733 | // incemental construction
|
---|
| 734 | virtual void UpdateRays(VssRayContainer &remove,
|
---|
| 735 | VssRayContainer &add
|
---|
| 736 | );
|
---|
| 737 |
|
---|
| 738 | virtual void AddRays(
|
---|
| 739 | VssRayContainer &add
|
---|
| 740 | )
|
---|
| 741 | {
|
---|
| 742 | VssRayContainer remove;
|
---|
| 743 | UpdateRays(remove, add);
|
---|
| 744 | }
|
---|
| 745 |
|
---|
| 746 |
|
---|
| 747 |
|
---|
| 748 | RssTreeNode *
|
---|
| 749 | Locate(const Vector3 &v);
|
---|
| 750 |
|
---|
| 751 | RssTreeNode *
|
---|
| 752 | SubdivideNode(RssTreeLeaf *leaf,
|
---|
| 753 | const AxisAlignedBox3 &box,
|
---|
| 754 | AxisAlignedBox3 &backBox,
|
---|
| 755 | AxisAlignedBox3 &frontBox
|
---|
| 756 | );
|
---|
| 757 |
|
---|
| 758 | RssTreeNode *
|
---|
| 759 | Subdivide(const TraversalData &tdata);
|
---|
| 760 |
|
---|
| 761 |
|
---|
| 762 | void
|
---|
[1233] | 763 | SortSubdivisionCandidates(
|
---|
[447] | 764 | RssTreeLeaf *node,
|
---|
| 765 | const int axis
|
---|
| 766 | );
|
---|
| 767 |
|
---|
| 768 |
|
---|
| 769 | // return memory usage in MB
|
---|
| 770 | float GetMemUsage() const {
|
---|
| 771 | return
|
---|
| 772 | (sizeof(RssTree) +
|
---|
| 773 | stat.Leaves()*sizeof(RssTreeLeaf) +
|
---|
| 774 | stat.Interior()*sizeof(RssTreeInterior) +
|
---|
| 775 | stat.rayRefs*sizeof(RssTreeNode::RayInfo))/(1024.0f*1024.0f);
|
---|
| 776 | }
|
---|
| 777 |
|
---|
| 778 | float GetRayMemUsage() const {
|
---|
| 779 | return
|
---|
| 780 | stat.rays*(sizeof(VssRay))/(1024.0f*1024.0f);
|
---|
| 781 | }
|
---|
| 782 |
|
---|
[492] | 783 | struct SplitInfo {
|
---|
| 784 |
|
---|
| 785 | int axis;
|
---|
| 786 | float position;
|
---|
| 787 | float costRatio;
|
---|
| 788 |
|
---|
| 789 | int rays;
|
---|
| 790 | int raysBack;
|
---|
| 791 | int raysFront;
|
---|
[447] | 792 |
|
---|
[492] | 793 | int pvs;
|
---|
| 794 | int pvsBack;
|
---|
| 795 | int pvsFront;
|
---|
| 796 |
|
---|
| 797 | float contribution;
|
---|
| 798 | float contributionBack;
|
---|
| 799 | float contributionFront;
|
---|
| 800 |
|
---|
| 801 | int viewCells;
|
---|
| 802 | int viewCellsBack;
|
---|
| 803 | int viewCellsFront;
|
---|
| 804 |
|
---|
| 805 | float volume;
|
---|
| 806 | float volumeBack;
|
---|
| 807 | float volumeFront;
|
---|
| 808 |
|
---|
| 809 | };
|
---|
| 810 |
|
---|
| 811 | void
|
---|
[447] | 812 | BestCostRatio(
|
---|
| 813 | RssTreeLeaf *node,
|
---|
[492] | 814 | SplitInfo &info
|
---|
| 815 | // int &axis,
|
---|
| 816 | // float &position,
|
---|
| 817 | // int &raysBack,
|
---|
| 818 | // int &raysFront,
|
---|
| 819 | // int &pvsBack,
|
---|
| 820 | // int &pvsFront
|
---|
[447] | 821 | );
|
---|
| 822 |
|
---|
[492] | 823 |
|
---|
| 824 | void
|
---|
[447] | 825 | EvalCostRatio(
|
---|
| 826 | RssTreeLeaf *node,
|
---|
[492] | 827 | SplitInfo &info
|
---|
| 828 | // const int axis,
|
---|
| 829 | // const float position,
|
---|
| 830 | // int &raysBack,
|
---|
| 831 | // int &raysFront,
|
---|
| 832 | // int &pvsBack,
|
---|
| 833 | // int &pvsFront
|
---|
[447] | 834 | );
|
---|
| 835 |
|
---|
[492] | 836 | void
|
---|
[447] | 837 | EvalCostRatioHeuristic(
|
---|
| 838 | RssTreeLeaf *node,
|
---|
[492] | 839 | SplitInfo &info
|
---|
| 840 | // const int axis,
|
---|
| 841 | // float &position,
|
---|
| 842 | // int &raysBack,
|
---|
| 843 | // int &raysFront,
|
---|
| 844 | // int &pvsBack,
|
---|
| 845 | // int &pvsFront
|
---|
[447] | 846 | );
|
---|
| 847 |
|
---|
[492] | 848 | int
|
---|
| 849 | SelectPlane(RssTreeLeaf *leaf,
|
---|
| 850 | const AxisAlignedBox3 &box,
|
---|
| 851 | SplitInfo &info
|
---|
| 852 | );
|
---|
| 853 |
|
---|
| 854 | void
|
---|
[447] | 855 | GetCostRatio(
|
---|
| 856 | RssTreeLeaf *leaf,
|
---|
[492] | 857 | SplitInfo &info
|
---|
| 858 | // const int axis,
|
---|
| 859 | // const float position,
|
---|
| 860 | // const int raysBack,
|
---|
| 861 | // const int raysFront,
|
---|
| 862 | // const int pvsBack,
|
---|
| 863 | // const int pvsFront
|
---|
[447] | 864 | );
|
---|
[492] | 865 |
|
---|
[447] | 866 | AxisAlignedBox3 GetBBox(const RssTreeNode *node) const {
|
---|
[516] | 867 | return node->bbox;
|
---|
[447] | 868 |
|
---|
[516] | 869 | // if (node->parent == NULL)
|
---|
| 870 | // return bbox;
|
---|
[447] | 871 |
|
---|
[516] | 872 | // if (!node->IsLeaf())
|
---|
| 873 | // return ((RssTreeInterior *)node)->bbox;
|
---|
| 874 |
|
---|
| 875 | // if (node->parent->axis >= 3)
|
---|
| 876 | // return node->parent->bbox;
|
---|
[447] | 877 |
|
---|
[516] | 878 | // AxisAlignedBox3 box(node->parent->bbox);
|
---|
| 879 | // if (node->parent->front == node)
|
---|
| 880 | // box.SetMin(node->parent->axis, node->parent->position);
|
---|
| 881 | // else
|
---|
| 882 | // box.SetMax(node->parent->axis, node->parent->position);
|
---|
| 883 | // return box;
|
---|
[447] | 884 | }
|
---|
| 885 |
|
---|
| 886 | AxisAlignedBox3 GetShrankedBBox(const RssTreeNode *node) const;
|
---|
| 887 |
|
---|
| 888 | AxisAlignedBox3 GetDirBBox(const RssTreeNode *node) const {
|
---|
[516] | 889 | return node->dirBBox;
|
---|
| 890 | // if (node->parent == NULL)
|
---|
| 891 | // return dirBBox;
|
---|
[447] | 892 |
|
---|
[516] | 893 | // if (!node->IsLeaf() )
|
---|
| 894 | // return ((RssTreeInterior *)node)->dirBBox;
|
---|
[447] | 895 |
|
---|
[516] | 896 | // if (node->parent->axis < 3)
|
---|
| 897 | // return node->parent->dirBBox;
|
---|
[447] | 898 |
|
---|
[516] | 899 | // AxisAlignedBox3 dBBox(node->parent->dirBBox);
|
---|
[447] | 900 |
|
---|
[516] | 901 | // if (node->parent->front == node)
|
---|
| 902 | // dBBox.SetMin(node->parent->axis - 3, node->parent->position);
|
---|
| 903 | // else
|
---|
| 904 | // dBBox.SetMax(node->parent->axis - 3, node->parent->position);
|
---|
| 905 | // return dBBox;
|
---|
[447] | 906 | }
|
---|
| 907 |
|
---|
| 908 | int
|
---|
| 909 | ReleaseMemory(const int time);
|
---|
| 910 |
|
---|
| 911 | int
|
---|
| 912 | CollapseSubtree(RssTreeNode *node, const int time);
|
---|
| 913 |
|
---|
| 914 | void
|
---|
| 915 | CountAccess(RssTreeInterior *node, const long time) {
|
---|
| 916 | node->accesses++;
|
---|
| 917 | node->lastAccessTime = time;
|
---|
| 918 | }
|
---|
| 919 |
|
---|
| 920 | RssTreeNode *
|
---|
| 921 | SubdivideLeaf(
|
---|
| 922 | RssTreeLeaf *leaf
|
---|
| 923 | );
|
---|
| 924 |
|
---|
| 925 | void
|
---|
| 926 | RemoveRay(VssRay *ray,
|
---|
| 927 | vector<RssTreeLeaf *> *affectedLeaves,
|
---|
| 928 | const bool removeAllScheduledRays
|
---|
| 929 | );
|
---|
| 930 |
|
---|
| 931 | // void
|
---|
| 932 | // AddRay(VssRay *ray);
|
---|
| 933 | void
|
---|
| 934 | AddRay(RssTreeNode::RayInfo &info);
|
---|
| 935 |
|
---|
| 936 | void
|
---|
| 937 | TraverseInternalNode(
|
---|
| 938 | RayTraversalData &data,
|
---|
| 939 | stack<RayTraversalData> &tstack);
|
---|
| 940 |
|
---|
| 941 | void
|
---|
| 942 | EvaluateLeafStats(const TraversalData &data);
|
---|
| 943 |
|
---|
| 944 |
|
---|
| 945 | int
|
---|
| 946 | GetRootPvsSize() const {
|
---|
| 947 | return GetPvsSize(bbox);
|
---|
| 948 | }
|
---|
| 949 |
|
---|
| 950 | int
|
---|
| 951 | GetPvsSize(const AxisAlignedBox3 &box) const;
|
---|
| 952 |
|
---|
| 953 | int
|
---|
| 954 | CollectPvs(const AxisAlignedBox3 &box,
|
---|
| 955 | ObjectContainer &pvs
|
---|
| 956 | ) const;
|
---|
| 957 |
|
---|
| 958 | int
|
---|
| 959 | CollectRootPvs(
|
---|
| 960 | ObjectContainer &pvs
|
---|
| 961 | ) const
|
---|
| 962 | {
|
---|
| 963 | return CollectPvs(bbox, pvs);
|
---|
| 964 | }
|
---|
| 965 |
|
---|
| 966 |
|
---|
| 967 | void
|
---|
[492] | 968 | UpdateTreeStatistics();
|
---|
[447] | 969 |
|
---|
| 970 |
|
---|
| 971 | int
|
---|
| 972 | GenerateRays(const float ratioPerLeaf,
|
---|
| 973 | SimpleRayContainer &rays);
|
---|
| 974 |
|
---|
| 975 | int
|
---|
| 976 | GenerateRays(const int numberOfRays,
|
---|
| 977 | const int numberOfLeaves,
|
---|
| 978 | SimpleRayContainer &rays);
|
---|
| 979 |
|
---|
| 980 | float
|
---|
| 981 | GetAvgPvsSize();
|
---|
| 982 |
|
---|
| 983 | int
|
---|
| 984 | UpdateSubdivision();
|
---|
| 985 |
|
---|
| 986 | bool
|
---|
| 987 | TerminationCriteriaSatisfied(RssTreeLeaf *leaf);
|
---|
| 988 |
|
---|
| 989 | void
|
---|
| 990 | CollectLeaves(vector<RssTreeLeaf *> &leaves);
|
---|
| 991 |
|
---|
| 992 | bool
|
---|
| 993 | ClipRay(
|
---|
| 994 | RssTreeNode::RayInfo &rayInfo,
|
---|
| 995 | const AxisAlignedBox3 &box
|
---|
| 996 | );
|
---|
| 997 |
|
---|
[516] | 998 | RssTreeNode *GetRoot(Intersectable *object = NULL) const;
|
---|
[447] | 999 |
|
---|
| 1000 | bool
|
---|
| 1001 | ValidLeaf(RssTreeLeaf *leaf) const;
|
---|
| 1002 |
|
---|
| 1003 | void
|
---|
| 1004 | GenerateLeafRays(RssTreeLeaf *leaf,
|
---|
| 1005 | const int numberOfRays,
|
---|
| 1006 | SimpleRayContainer &rays);
|
---|
| 1007 |
|
---|
| 1008 |
|
---|
[464] | 1009 | void
|
---|
| 1010 | PickEdgeRays(RssTreeLeaf *leaf,
|
---|
| 1011 | int &r1,
|
---|
| 1012 | int &r2
|
---|
| 1013 | );
|
---|
| 1014 |
|
---|
[466] | 1015 | int
|
---|
| 1016 | CollectRays(VssRayContainer &rays,
|
---|
| 1017 | const int number);
|
---|
| 1018 |
|
---|
| 1019 | int
|
---|
| 1020 | CollectRays(VssRayContainer &rays
|
---|
| 1021 | );
|
---|
| 1022 |
|
---|
[492] | 1023 | void
|
---|
| 1024 | UpdatePvsSize(RssTreeLeaf *leaf);
|
---|
| 1025 |
|
---|
| 1026 | void
|
---|
| 1027 | ComputeImportance(RssTreeLeaf *leaf);
|
---|
| 1028 |
|
---|
| 1029 | void
|
---|
| 1030 | SetPass(const int p) {
|
---|
| 1031 | mCurrentPass = p;
|
---|
| 1032 | }
|
---|
| 1033 |
|
---|
| 1034 | void GetRayContribution(const RssTreeNode::RayInfo &info,
|
---|
| 1035 | float &weight,
|
---|
| 1036 | float &contribution);
|
---|
| 1037 |
|
---|
| 1038 | float
|
---|
| 1039 | GetSampleWeight(const int pass);
|
---|
| 1040 |
|
---|
| 1041 | int
|
---|
| 1042 | RemoveInteriorRays(
|
---|
| 1043 | RssTreeLeaf *leaf
|
---|
| 1044 | );
|
---|
| 1045 |
|
---|
| 1046 | bool
|
---|
| 1047 | IsRayConvexCombination(const RssTreeNode::RayInfo &ray,
|
---|
| 1048 | const RssTreeNode::RayInfo &r1,
|
---|
| 1049 | const RssTreeNode::RayInfo &r2,
|
---|
| 1050 | const RssTreeNode::RayInfo &r3);
|
---|
| 1051 |
|
---|
| 1052 | int
|
---|
| 1053 | PruneRays(RssTreeLeaf *leaf,
|
---|
| 1054 | const float contributionThreshold);
|
---|
| 1055 | int
|
---|
| 1056 | PruneRaysRandom(RssTreeLeaf *leaf,
|
---|
| 1057 | const float ratio);
|
---|
| 1058 |
|
---|
| 1059 | int
|
---|
| 1060 | PruneRaysContribution(RssTreeLeaf *leaf,
|
---|
| 1061 | const float ratio);
|
---|
| 1062 |
|
---|
| 1063 | int
|
---|
| 1064 | PruneRays(
|
---|
| 1065 | const int desired
|
---|
| 1066 | );
|
---|
| 1067 |
|
---|
| 1068 |
|
---|
| 1069 | void
|
---|
| 1070 | FindSilhouetteRays(RssTreeLeaf *leaf,
|
---|
| 1071 | vector<RssTreeLeaf::SilhouetteRays> &rays
|
---|
| 1072 | );
|
---|
[516] | 1073 |
|
---|
| 1074 | void
|
---|
| 1075 | PushRoots(priority_queue<TraversalData> &stack) const;
|
---|
| 1076 |
|
---|
| 1077 | void
|
---|
| 1078 | PushRoots(stack<RssTreeNode *> &st) const;
|
---|
| 1079 |
|
---|
| 1080 | void
|
---|
| 1081 | PushRoots(stack<RayTraversalData> &st, RssTreeNode::RayInfo &info) const;
|
---|
| 1082 |
|
---|
| 1083 |
|
---|
[447] | 1084 | };
|
---|
| 1085 |
|
---|
[863] | 1086 | };
|
---|
[447] | 1087 |
|
---|
[863] | 1088 | #endif // __RSSTREE_H__
|
---|
[447] | 1089 |
|
---|