diff options
author | Justin Clark-Casey (justincc) | 2011-03-30 00:13:07 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-03-30 00:13:07 +0100 |
commit | 8b16f7d976dc60b06f6d08e9d9d853ae69de5fc9 (patch) | |
tree | 9cb7254d3731c28aca723a0c6745909319553c66 /OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs | |
parent | Merge branch 'primcounts' (diff) | |
download | opensim-SC_OLD-8b16f7d976dc60b06f6d08e9d9d853ae69de5fc9.zip opensim-SC_OLD-8b16f7d976dc60b06f6d08e9d9d853ae69de5fc9.tar.gz opensim-SC_OLD-8b16f7d976dc60b06f6d08e9d9d853ae69de5fc9.tar.bz2 opensim-SC_OLD-8b16f7d976dc60b06f6d08e9d9d853ae69de5fc9.tar.xz |
(re)implement selected prim count.
This does not currently count objects that are sat upon (which the viewer ui implies should be included in this count)
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs index d126b26..ab0e88e 100644 --- a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs | |||
@@ -45,13 +45,13 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
45 | public int Owner = 0; | 45 | public int Owner = 0; |
46 | public int Group = 0; | 46 | public int Group = 0; |
47 | public int Others = 0; | 47 | public int Others = 0; |
48 | public Dictionary <UUID, int> Users = | 48 | public int Selected = 0; |
49 | new Dictionary <UUID, int>(); | 49 | public Dictionary <UUID, int> Users = new Dictionary <UUID, int>(); |
50 | } | 50 | } |
51 | 51 | ||
52 | public class PrimCountModule : IPrimCountModule, INonSharedRegionModule | 52 | public class PrimCountModule : IPrimCountModule, INonSharedRegionModule |
53 | { | 53 | { |
54 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 54 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
55 | 55 | ||
56 | private Scene m_Scene; | 56 | private Scene m_Scene; |
57 | private Dictionary<UUID, PrimCounts> m_PrimCounts = | 57 | private Dictionary<UUID, PrimCounts> m_PrimCounts = |
@@ -219,6 +219,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
219 | else | 219 | else |
220 | parcelCounts.Others += partCount; | 220 | parcelCounts.Others += partCount; |
221 | } | 221 | } |
222 | |||
223 | if (obj.IsSelected) | ||
224 | parcelCounts.Selected += partCount; | ||
222 | } | 225 | } |
223 | } | 226 | } |
224 | 227 | ||
@@ -328,6 +331,32 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
328 | } | 331 | } |
329 | 332 | ||
330 | /// <summary> | 333 | /// <summary> |
334 | /// Get the number of selected prims. | ||
335 | /// </summary> | ||
336 | /// <param name="parcelID"></param> | ||
337 | /// <returns></returns> | ||
338 | public int GetSelectedCount(UUID parcelID) | ||
339 | { | ||
340 | int count = 0; | ||
341 | |||
342 | lock (m_TaintLock) | ||
343 | { | ||
344 | if (m_Tainted) | ||
345 | Recount(); | ||
346 | |||
347 | ParcelCounts counts; | ||
348 | if (m_ParcelCounts.TryGetValue(parcelID, out counts)) | ||
349 | count = counts.Selected; | ||
350 | } | ||
351 | |||
352 | // m_log.DebugFormat( | ||
353 | // "[PRIM COUNT MODULE]: GetSelectedCount for parcel {0} in {1} returning {2}", | ||
354 | // parcelID, m_Scene.RegionInfo.RegionName, count); | ||
355 | |||
356 | return count; | ||
357 | } | ||
358 | |||
359 | /// <summary> | ||
331 | /// Get the total count of owner, group and others prims on the parcel. | 360 | /// Get the total count of owner, group and others prims on the parcel. |
332 | /// FIXME: Need to do selected prims once this is reimplemented. | 361 | /// FIXME: Need to do selected prims once this is reimplemented. |
333 | /// </summary> | 362 | /// </summary> |
@@ -491,6 +520,14 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
491 | } | 520 | } |
492 | } | 521 | } |
493 | 522 | ||
523 | public int Selected | ||
524 | { | ||
525 | get | ||
526 | { | ||
527 | return m_Parent.GetSelectedCount(m_ParcelID); | ||
528 | } | ||
529 | } | ||
530 | |||
494 | public int Total | 531 | public int Total |
495 | { | 532 | { |
496 | get | 533 | get |