Changeset 1027 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.h
- Timestamp:
- 06/21/06 09:44:39 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.h
r1012 r1027 278 278 279 279 /** Determines whether this node is a root 280 @return true if root 281 */ 282 virtual bool IsRoot() const; 280 @return true if root 281 */ 282 virtual bool IsRoot() const 283 { 284 return mParent == NULL; 285 } 283 286 284 287 /** Returns parent node. 285 288 */ 286 BspInterior *GetParent(); 289 inline BspInterior *GetParent() 290 { 291 return mParent; 292 } 287 293 288 294 /** Sets parent node. 289 295 */ 290 void SetParent(BspInterior *parent); 296 inline void BspNode::SetParent(BspInterior *parent) 297 { 298 mParent = parent; 299 } 300 291 301 292 302 /** Returns true if this node is a sibling of node n. … … 334 344 BspInterior(const Plane3 &plane); 335 345 ~BspInterior(); 346 336 347 /** @return false since it is an interior node 337 348 */ 338 bool IsLeaf() const; 339 340 BspNode *GetBack(); 341 BspNode *GetFront(); 342 349 bool IsLeaf() const 350 { 351 return false; 352 } 353 BspNode *GetBack() 354 { 355 return mBack; 356 } 357 358 BspNode *GetFront() 359 { 360 return mFront; 361 } 362 343 363 /** Returns split plane. 344 364 */ 345 Plane3 GetPlane() const; 365 Plane3 BspInterior::GetPlane() const 366 { 367 return mPlane; 368 } 346 369 347 370 /** Replace front or back child with new child. 348 371 */ 349 void ReplaceChildLink(BspNode *oldChild, BspNode *newChild); 372 inline void ReplaceChildLink(BspNode *oldChild, BspNode *newChild) 373 { 374 if (mBack == oldChild) 375 mBack = newChild; 376 else 377 mFront = newChild; 378 } 379 350 380 /** Replace front and back child. 351 381 */ … … 383 413 ~BspLeaf(); 384 414 415 /** Returns pointer of view cell. 416 */ 417 inline ViewCellLeaf *GetViewCell() const 418 { 419 return mViewCell; 420 } 421 422 /** Sets pointer to view cell. 423 */ 424 inline void SetViewCell(ViewCellLeaf *viewCell) 425 { 426 mViewCell = viewCell; 427 } 428 385 429 /** @return true since it is an interior node 386 430 */ 387 bool IsLeaf() const; 388 389 /** Returns pointer of view cell. 390 */ 391 ViewCellLeaf *GetViewCell() const; 392 393 /** Sets pointer to view cell. 394 */ 395 void SetViewCell(ViewCellLeaf *viewCell); 431 bool BspLeaf::IsLeaf() const 432 { 433 return true; 434 } 435 396 436 397 437 /// Rays piercing this leaf. … … 403 443 /// Probability that the view point lies in this leaf 404 444 float mProbability; 445 405 446 406 447 protected:
Note: See TracChangeset
for help on using the changeset viewer.