Changeset 1021 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
- Timestamp:
- 06/19/06 16:14:40 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
r1006 r1021 32 32 class MergeCandidate; 33 33 class BoundingBoxConverter; 34 class VspTree; 35 class OspTree; 36 class VspNode; 34 37 35 38 … … 66 69 67 70 /// view cell container types 68 enum {BSP, KD, VSP_KD, VSP_BSP };71 enum {BSP, KD, VSP_KD, VSP_BSP, VSP_OSP}; 69 72 70 73 /// render cost evaluation type … … 369 372 void CollectViewCells(const int n); 370 373 371 /** Returns true if this (logical) view cell is equal to a spatial node.372 */373 virtual bool EqualToSpatialNode(ViewCell *viewCell) const;374 375 374 /** Sets current view cells set to active, i.e., the sampling is done in this view cell set. 376 375 */ … … 472 471 473 472 473 /** Returns true if this view cell is equivalent to a node of the spatial hierarchy. 474 */ 475 virtual bool EqualToSpatialNode(ViewCell *viewCell) const; 476 474 477 protected: 475 478 /** Exports bounding boxes as xml stream … … 528 531 /** Sets exporter color. 529 532 */ 530 virtual void ExportColor(Exporter *exporter, ViewCell *vc) const = 0;533 virtual void ExportColor(Exporter *exporter, ViewCell *vc) const; 531 534 532 535 /** Returns volume of the view space. … … 619 622 /// if rays should be used to collect merge candidates 620 623 bool mUseRaysForMerge; 624 621 625 /// if there should be an additional merge step after the subdivision 622 626 bool mMergeViewCells; … … 718 722 protected: 719 723 720 721 724 void CollectViewCells(); 722 725 723 void ExportColor(Exporter *exporter, ViewCell *vc) const;724 726 725 727 /// the BSP tree. … … 799 801 KdNode *GetNodeForPvs(KdLeaf *leaf); 800 802 801 void ExportColor(Exporter *exporter, ViewCell *vc) const;802 803 803 804 804 /// the BSP tree. … … 880 880 BspNode *GetSpatialNode(ViewCell *viewCell) const; 881 881 882 /** Merges the view cells.882 /** Merges view cells according to some criteria 883 883 */ 884 884 void MergeViewCells(const VssRayContainer &rays, … … 895 895 896 896 897 void ExportColor(Exporter *exporter, ViewCell *vc) const;898 899 897 /** Prepare view cells for use after loading them from disc. 900 898 */ … … 921 919 void EvalFromPointQueries(); 922 920 921 /** Exports visualization of the BSP splits. 922 */ 923 void ExportSplits(const ObjectContainer &objects, 924 const VssRayContainer &rays); 925 926 /** Exports visualization of the BSP PVS. 927 */ 928 void ExportBspPvs(const ObjectContainer &objects, 929 const VssRayContainer &rays); 930 923 931 924 932 /// the view space partition BSP tree. … … 928 936 private: 929 937 930 /** Exports visualization of the BSP splits. 931 */ 932 void ExportSplits(const ObjectContainer &objects, 933 const VssRayContainer &rays); 938 /** test if subdivision is valid in terms of volume / area. 939 */ 940 void TestSubdivision(); 941 }; 942 943 944 /** 945 Manages different higher order operations on the view cells. 946 */ 947 class VspOspViewCellsManager: public ViewCellsManager 948 { 949 950 public: 951 952 VspOspViewCellsManager(VspTree *tree, OspTree *ospTree); 953 ~VspOspViewCellsManager(); 954 955 int ConstructSubdivision(const ObjectContainer &objects, 956 const VssRayContainer &rays); 957 958 int PostProcess(const ObjectContainer &objects, 959 const VssRayContainer &rays); 960 961 void Visualize(const ObjectContainer &objects, 962 const VssRayContainer &sampleRays); 963 964 int GetType() const; 965 966 ViewCell *GenerateViewCell(Mesh *mesh = NULL) const; 967 968 bool ViewCellsConstructed() const; 969 970 971 int CastLineSegment(const Vector3 &origin, 972 const Vector3 &termination, 973 ViewCellContainer &viewcells); 974 975 float GetProbability(ViewCell *viewCell); 976 977 ViewCell *GetViewCell(const Vector3 &point, const bool active = false) const; 978 979 bool GetViewPoint(Vector3 &viewPoint) const; 980 981 bool ViewPointValid(const Vector3 &viewPoint) const; 982 983 void CreateMesh(ViewCell *vc); 984 985 bool ExportViewCells(const string filename, const bool exportPvs, const ObjectContainer &objects); 986 987 int CastBeam(Beam &beam); 988 989 void ExportViewCellGeometry(Exporter *exporter, 990 ViewCell *vc, 991 const Plane3 *clipPlane = NULL) const; 992 993 void Finalize(ViewCell *viewCell, const bool createMesh); 994 995 996 protected: 997 998 int ComputeBoxIntersections(const AxisAlignedBox3 &box, ViewCellContainer &viewCells) const; 999 1000 void CollectViewCells(); 1001 1002 1003 /** Prepare view cells for use after loading them from disc. 1004 */ 1005 void PrepareLoadedViewCells(); 1006 1007 /** Constructs merge hierarchy which corresponds to the spatial hierarchy. 1008 */ 1009 ViewCell *ConstructSpatialMergeTree(VspNode *root); 1010 1011 void UpdatePvsForEvaluation(ViewCell *root, ObjectPvs &pvs); 934 1012 935 1013 /** Exports visualization of the BSP PVS. … … 938 1016 const VssRayContainer &rays); 939 1017 940 /** test if subdivision is valid in terms of volume / area. 941 */ 942 void TestSubdivision(); 1018 1019 /// the view space partition tree. 1020 VspTree *mVspTree; 1021 OspTree *mOspTree; 943 1022 }; 944 1023
Note: See TracChangeset
for help on using the changeset viewer.