aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmath/llvolumemgr.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:44 -0500
committerJacek Antonelli2008-08-15 23:45:44 -0500
commitacfdcf2b1deeb04698174c78e8cb22b093445bb1 (patch)
tree811293650bcf81d01ea7c54d7c2cf263110aa329 /linden/indra/llmath/llvolumemgr.h
parentSecond Life viewer sources 1.20.2 (diff)
downloadmeta-impy-acfdcf2b1deeb04698174c78e8cb22b093445bb1.zip
meta-impy-acfdcf2b1deeb04698174c78e8cb22b093445bb1.tar.gz
meta-impy-acfdcf2b1deeb04698174c78e8cb22b093445bb1.tar.bz2
meta-impy-acfdcf2b1deeb04698174c78e8cb22b093445bb1.tar.xz
Second Life viewer sources 1.20.3
Diffstat (limited to '')
-rw-r--r--linden/indra/llmath/llvolumemgr.h46
1 files changed, 15 insertions, 31 deletions
diff --git a/linden/indra/llmath/llvolumemgr.h b/linden/indra/llmath/llvolumemgr.h
index 0a2249e..8f107f6 100644
--- a/linden/indra/llmath/llvolumemgr.h
+++ b/linden/indra/llmath/llvolumemgr.h
@@ -41,8 +41,10 @@
41class LLVolumeParams; 41class LLVolumeParams;
42class LLVolumeLODGroup; 42class LLVolumeLODGroup;
43 43
44class LLVolumeLODGroup : public LLThreadSafeRefCount 44class LLVolumeLODGroup
45{ 45{
46 LOG_CLASS(LLVolumeLODGroup);
47
46public: 48public:
47 enum 49 enum
48 { 50 {
@@ -50,29 +52,25 @@ public:
50 }; 52 };
51 53
52 LLVolumeLODGroup(const LLVolumeParams &params); 54 LLVolumeLODGroup(const LLVolumeParams &params);
55 ~LLVolumeLODGroup();
53 56
54 BOOL derefLOD(LLVolume *volumep);
55 static S32 getDetailFromTan(const F32 tan_angle); 57 static S32 getDetailFromTan(const F32 tan_angle);
56 static void getDetailProximity(const F32 tan_angle, F32 &to_lower, F32& to_higher); 58 static void getDetailProximity(const F32 tan_angle, F32 &to_lower, F32& to_higher);
57 static F32 getVolumeScaleFromDetail(const S32 detail); 59 static F32 getVolumeScaleFromDetail(const S32 detail);
58 60
59 LLVolume *getLOD(const S32 detail); 61 LLVolume* getLODVolume(const S32 detail);
60 const LLVolumeParams& getParams() const { return mParams; }; 62 BOOL derefLOD(LLVolume *volumep);
63 S32 getNumRefs() const { return mRefs; }
64
65 const LLVolumeParams* getVolumeParams() const { return &mVolumeParams; };
61 66
62 F32 dump(); 67 F32 dump();
63 friend std::ostream& operator<<(std::ostream& s, const LLVolumeLODGroup& volgroup); 68 friend std::ostream& operator<<(std::ostream& s, const LLVolumeLODGroup& volgroup);
64 69
65#ifdef DEBUG_VOLUME
66 S32 getTotalVolumeRefCount() const;
67#endif
68
69protected: 70protected:
70 virtual ~LLVolumeLODGroup(); 71 LLVolumeParams mVolumeParams;
71 void destroy();
72
73protected:
74 LLVolumeParams mParams;
75 72
73 S32 mRefs;
76 S32 mLODRefs[NUM_LODS]; 74 S32 mLODRefs[NUM_LODS];
77 LLPointer<LLVolume> mVolumeLODs[NUM_LODS]; 75 LLPointer<LLVolume> mVolumeLODs[NUM_LODS];
78 static F32 mDetailThresholds[NUM_LODS]; 76 static F32 mDetailThresholds[NUM_LODS];
@@ -82,10 +80,6 @@ protected:
82 80
83class LLVolumeMgr 81class LLVolumeMgr
84{ 82{
85//public:
86// static void initClass();
87// static BOOL cleanupClass();
88
89public: 83public:
90 LLVolumeMgr(); 84 LLVolumeMgr();
91 virtual ~LLVolumeMgr(); 85 virtual ~LLVolumeMgr();
@@ -96,36 +90,26 @@ public:
96 // whatever calls getVolume() never owns the LLVolume* and 90 // whatever calls getVolume() never owns the LLVolume* and
97 // cannot keep references for long since it may be deleted 91 // cannot keep references for long since it may be deleted
98 // later. For best results hold it in an LLPointer<LLVolume>. 92 // later. For best results hold it in an LLPointer<LLVolume>.
99 LLVolume *getVolume(const LLVolumeParams &volume_params, const S32 detail); 93 LLVolume *refVolume(const LLVolumeParams &volume_params, const S32 detail);
100 94 void unrefVolume(LLVolume *volumep);
101 void cleanupVolume(LLVolume *volumep);
102 95
103 void dump(); 96 void dump();
104 97
105 // manually call this for mutex magic 98 // manually call this for mutex magic
106 void useMutex(); 99 void useMutex();
107 100
108#ifdef DEBUG_VOLUME
109 S32 getTotalRefCount() const;
110 S32 getGroupCount() const;
111#endif
112 friend std::ostream& operator<<(std::ostream& s, const LLVolumeMgr& volume_mgr); 101 friend std::ostream& operator<<(std::ostream& s, const LLVolumeMgr& volume_mgr);
113 102
114protected: 103protected:
104 void insertGroup(LLVolumeLODGroup* volgroup);
105 // Overridden in llphysics/abstract/utils/llphysicsvolumemanager.h
115 virtual LLVolumeLODGroup* createNewGroup(const LLVolumeParams& volume_params); 106 virtual LLVolumeLODGroup* createNewGroup(const LLVolumeParams& volume_params);
116 107
117protected: 108protected:
118 typedef std::map<const LLVolumeParams*, LLVolumeLODGroup*, LLVolumeParams::compare> volume_lod_group_map_t; 109 typedef std::map<const LLVolumeParams*, LLVolumeLODGroup*, LLVolumeParams::compare> volume_lod_group_map_t;
119 typedef volume_lod_group_map_t::const_iterator volume_lod_group_map_iter;
120 volume_lod_group_map_t mVolumeLODGroups; 110 volume_lod_group_map_t mVolumeLODGroups;
121 111
122 LLMutex* mDataMutex; 112 LLMutex* mDataMutex;
123
124 // We need to be able to disable threadsafe checks to prevent
125 // some unit_tests from blocking on failure
126 bool mThreadSafe;
127}; 113};
128 114
129//extern LLVolumeMgr* gVolumeMgr;
130
131#endif // LL_LLVOLUMEMGR_H 115#endif // LL_LLVOLUMEMGR_H