Ignore:
Timestamp:
08/08/07 15:50:33 (17 years ago)
Author:
mattausch
Message:

fixed obj loading error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h

    r2387 r2539  
    547547        */ 
    548548        ViewCell *GetActiveViewCell(ViewCellLeaf *vc) const; 
    549  
    550549        /** Sets the leaves to be the currently active view cells. 
    551550        */ 
    552551    void SetActiveSetToLeaves(); 
    553  
    554552        /** Propagates pvs up the tree to the root and downwards the tree. 
    555553        */ 
    556554        void PropagatePvs(ViewCell *vc); 
    557  
    558555        /** Exports view cells to file. 
    559556        */ 
    560557        bool Export(OUT_STREAM &stream, const bool exportPvs = false); 
    561  
    562558        /** Export statistics of this view cell tree. 
    563559        */ 
    564560        void ExportStats(const std::string &mergeStats); 
    565  
    566561        /** Sets root of hierarchy. 
    567562        */ 
    568563        void SetRoot(ViewCell *root); 
    569  
    570564        /** Assignes unique ids to view cells. 
    571565        */ 
    572566        void CreateUniqueViewCellsIds(); 
    573  
    574567        /** Resets pvs of whole tree. 
    575568        */ 
    576569        void ResetPvs(); 
    577  
    578570        /** Counts pvs of the view cell taking the kd cells into account. 
    579571        */ 
    580572        int CountKdPvs(const ViewCellLeaf *vc) const; 
    581  
    582573        /** Sets pointer to view cells manager. 
    583574        */ 
    584575        void SetViewCellsManager(ViewCellsManager *vcm); 
    585576 
    586         void Update(); 
     577        ViewCellInterior *ImportBinInterior(IN_STREAM  &stream, ViewCellInterior *parent); 
     578 
     579        ViewCellLeaf *ImportBinLeaf(IN_STREAM &stream,  
     580                                        ViewCellInterior *parent, 
     581                                                                const ObjectContainer &pvsObjects); 
     582 
     583        void ExportBinInterior(OUT_STREAM &stream, ViewCellInterior *interior); 
     584 
     585        void ExportBinLeaf(OUT_STREAM &stream, ViewCell *leaf); 
     586 
     587        bool ExportBinary(OUT_STREAM &stream); 
     588         
     589        bool ImportBinary(IN_STREAM &stream, const ObjectContainer &pvsObjects); 
     590 
     591        ViewCell *ImportNextNode(IN_STREAM &stream,  
     592                                                         ViewCellInterior *parent, 
     593                                                         const ObjectContainer &objects); 
    587594 
    588595protected: 
     
    601608        */ 
    602609        float ComputeMergedPvsCost(const ObjectPvs &pvs1, const ObjectPvs &pvs2) const; 
    603  
    604610        /** Returns cost of this leaf according to current heuristics. 
    605611        */ 
    606612        float GetCostHeuristics(ViewCell *vc) const; 
    607  
    608613        /** Returns cost of leaf. 
    609614        */ 
    610615        float GetRenderCost(ViewCell *vc) const; 
    611  
    612616        /** Evaluates the merge cost of this merge candidate pair. 
    613617        */ 
    614618        void EvalMergeCost(MergeCandidate &mc) const; 
    615  
    616619        /** Variance of leaf. 
    617620        */ 
    618621        float GetVariance(ViewCell *vc) const; 
    619  
    620622        /** Standard deviation of leaf. 
    621623        */ 
    622624        float GetDeviation(ViewCell *vc) const; 
    623  
    624625        /** Tries to set this merge candidate to valid.  
    625626                @returns false if both view cells are the same 
    626627        */ 
    627628        bool ValidateMergeCandidate(MergeCandidate &mc) const; 
    628  
    629629        /** Merge view cells of leaves l1 and l2. 
    630630                @returns difference in pvs size 
    631631        */ 
    632632        ViewCellInterior *MergeViewCells(ViewCell *l, ViewCell *r, float &pvsDiff); 
    633  
    634633        /** Shuffles, i.e. takes border leaf from view cell 1 and adds it  
    635634                to view cell 2. 
    636635        */ 
    637636        void ShuffleLeaf(ViewCell *leaf, ViewCellInterior *vc1, ViewCellInterior *vc2) const;    
    638                  
    639637        /** Shuffles the leaves, i.e., tests if exchanging 
    640638                the leaves helps in improving the view cells. 
    641639        */ 
    642640        bool ShuffleLeaves(MergeCandidate &mc) const; 
    643  
    644641        /** Calculates cost for merge of view cell 1 and 2. 
    645642        */ 
     
    647644                                                  ViewCellInterior *vc1,  
    648645                                                  ViewCellInterior *vc2) const; 
    649  
    650646        /** Exports a snapshot of the merged view cells to disc. 
    651647        */ 
     
    653649                                                           const ObjectContainer &objects, 
    654650                                                           const int numNewViewCells); 
    655  
    656651        /** Merge queue must be reset after some time because expected value 
    657652                may not be valid. 
    658653        */ 
    659654        void ResetMergeQueue(); 
    660  
    661655        /** Updates the current cut of view cells. 
    662656                @returns number of newly merged view cells 
    663657        */ 
    664658        int UpdateActiveViewCells(ViewCellContainer &viewCells); 
    665  
    666659        /** Helper function pullling pvs as high up in the tree as possible. 
    667660        */  
    668661        void PullUpVisibility(ViewCellInterior *interior); 
    669  
    670662        /** Compress pvs of view cell and children. 
    671663        */ 
    672664        void CompressViewCellsPvs(ViewCell *root); 
    673  
    674665        /** Returns memory usage of view cells. 
    675666        */ 
    676667        float GetMemUsage() const; 
    677  
    678668        /**     Exports single view cell. 
    679669                NOTE: should be in exporter!! 
    680670        */ 
    681671        void ExportViewCell(ViewCell *viewCell, OUT_STREAM &stream, const bool exportPvs);       
    682  
    683672        /** Exports pvs of a view cell. 
    684673        */ 
    685674        void ExportPvs(ViewCell *viewCell, OUT_STREAM &stream); 
    686  
    687675        /** Counts the logical number of entries in the pvs this view cell. 
    688676                The pvs is assumed to be stored using lossless compression. 
    689677        */ 
    690678        int GetEntriesInPvsForCompressedStorage(ViewCell *vc) const; 
    691  
    692679        /** Computes pvs size of this view cell. 
    693680                The pvs is assumed to be stored using lossless compression. 
    694681        */ 
    695682        float GetPvsCostForCompressedStorage(ViewCell *vc) const; 
    696          
    697683        /** Computes pvs size of this view cell. 
    698684                The pvs is assumed to be stored in the leaves. 
    699685        */ 
    700686        float GetPvsCostForLeafStorage(ViewCell *vc) const; 
    701  
    702687        /** Counts the logical number of entries in the pvs this view cell. 
    703688                The pvs is assumed to be stored using the leaves. 
    704689        */ 
    705690        int GetEntriesInPvsForLeafStorage(ViewCell *vc) const; 
    706  
    707691        /** Update stats for the log. 
    708692        */ 
    709693        void UpdateStats(std::ofstream &stats, 
    710694                                         const ViewCellsTreeStats &vcStats); 
    711  
    712695         
    713696 
Note: See TracChangeset for help on using the changeset viewer.