Changeset 1912 for GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h
- Timestamp:
- 12/20/06 00:26:02 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h
r1845 r1912 372 372 373 373 VspTraversalData(): 374 mNode(NULL), 375 mDepth(0), 376 mRays(NULL), 377 mPvs(0), 378 mProbability(0.0), 379 mMaxCostMisses(0), 380 mPriority(0) 374 mNode(NULL), 375 mDepth(0), 376 mRays(NULL), 377 mPvs(0), 378 mProbability(0.0), 379 mMaxCostMisses(0), 380 mPriority(0), 381 mCorrectedPvs(0) 381 382 {} 382 383 … … 387 388 const float p, 388 389 const AxisAlignedBox3 &box): 389 mNode(node), 390 mDepth(depth), 391 mRays(rays), 392 mPvs(pvs), 393 mProbability(p), 394 mBoundingBox(box), 395 mMaxCostMisses(0), 396 mPriority(0) 390 mNode(node), 391 mDepth(depth), 392 mRays(rays), 393 mProbability(p), 394 mBoundingBox(box), 395 mMaxCostMisses(0), 396 mPriority(0), 397 mCorrectedPvs(0), 398 mPvs(pvs), 399 mRenderCost(0), 400 mCorrectedRenderCost(0) 397 401 {} 398 402 … … 400 404 RayInfoContainer *rays, 401 405 const AxisAlignedBox3 &box): 402 mNode(NULL), 403 mDepth(depth), 404 mRays(rays), 405 mPvs(0), 406 mProbability(0), 407 mMaxCostMisses(0), 408 mBoundingBox(box) 406 mNode(NULL), 407 mDepth(depth), 408 mRays(rays), 409 mProbability(0), 410 mMaxCostMisses(0), 411 mBoundingBox(box), 412 mCorrectedPvs(0), 413 mPvs(0) , 414 mRenderCost(0), 415 mCorrectedRenderCost(0) 409 416 {} 410 417 … … 425 432 // delete old view cell 426 433 delete mNode->GetViewCell(); 434 427 435 delete mNode; 428 436 mNode = NULL; … … 440 448 /// the bounding box of the node 441 449 AxisAlignedBox3 mBoundingBox; 442 /// pvs size443 float mPvs;444 450 /// how often this branch has missed the max-cost ratio 445 451 int mMaxCostMisses; 446 452 // current priority 447 453 float mPriority; 448 449 454 /// pvs size 455 float mPvs; 456 /// the correction factor for this pvs 457 float mCorrectedPvs; 458 /// pvs size 459 float mRenderCost; 460 /// the correction factor for this pvs 461 float mCorrectedRenderCost; 462 450 463 friend bool operator<(const VspTraversalData &a, const VspTraversalData &b) 451 464 { … … 460 473 public: 461 474 462 static VspTree* sVspTree;463 464 /// the current split plane465 AxisAlignedPlane mSplitPlane;466 /// parent node traversal data467 VspTraversalData mParentData;468 469 475 VspSubdivisionCandidate(const VspTraversalData &tData): mParentData(tData) 470 476 {}; … … 502 508 } 503 509 504 505 mSplitPlane(plane), mParentData(tData)510 VspSubdivisionCandidate(const AxisAlignedPlane &plane, const VspTraversalData &tData): 511 mSplitPlane(plane), mParentData(tData) 506 512 {} 507 513 … … 510 516 return mPriority; 511 517 } 518 519 //////////////////// 520 521 static VspTree* sVspTree; 522 523 /// the current split plane 524 AxisAlignedPlane mSplitPlane; 525 /// parent node traversal data 526 VspTraversalData mParentData; 527 528 float mCorrectedFrontPvs; 529 float mCorrectedBackPvs; 530 531 float mCorrectedFrontRenderCost; 532 float mCorrectedBackRenderCost; 512 533 }; 513 534 … … 729 750 /** Evaluates render cost decrease of next split. 730 751 */ 731 float EvalRenderCostDecrease(const AxisAlignedPlane &candidatePlane, 732 const VspTraversalData &data, 752 float EvalRenderCostDecrease(VspSubdivisionCandidate &splitData, 733 753 float &normalizedOldRenderCost) const; 734 754 … … 790 810 @returns the root of the subdivision 791 811 */ 792 VspInterior *SubdivideNode(const AxisAlignedPlane &splitPlane, 793 VspTraversalData &tData, 812 VspInterior *SubdivideNode(const VspSubdivisionCandidate &sc, 794 813 VspTraversalData &frontData, 795 814 VspTraversalData &backData); … … 813 832 */ 814 833 void SortSubdivisionCandidates(const RayInfoContainer &rays, 815 const int axis,816 float minBand,817 float maxBand);834 const int axis, 835 float minBand, 836 float maxBand); 818 837 819 838 /** Evaluate render cost of this pvs.
Note: See TracChangeset
for help on using the changeset viewer.