aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llparcelselection.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/newview/llparcelselection.cpp
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/newview/llparcelselection.cpp')
-rw-r--r--linden/indra/newview/llparcelselection.cpp105
1 files changed, 105 insertions, 0 deletions
diff --git a/linden/indra/newview/llparcelselection.cpp b/linden/indra/newview/llparcelselection.cpp
new file mode 100644
index 0000000..cec2c48
--- /dev/null
+++ b/linden/indra/newview/llparcelselection.cpp
@@ -0,0 +1,105 @@
1/**
2 * @file llparcelselection.cpp
3 * @brief Information about the currently selected parcel
4 *
5 * $LicenseInfo:firstyear=2007&license=viewergpl$
6 *
7 * Copyright (c) 2007-2008, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 *
22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above,
24 * and agree to abide by those obligations.
25 *
26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
30 */
31
32#include "llviewerprecompiledheaders.h"
33
34#include "llparcelselection.h"
35
36#include "llparcel.h"
37
38
39// static
40LLPointer<LLParcelSelection> LLParcelSelection::sNullSelection;
41
42template<>
43 const LLSafeHandle<LLParcelSelection>::NullFunc
44 LLSafeHandle<LLParcelSelection>::sNullFunc = LLParcelSelection::getNullParcelSelection;
45
46//
47// LLParcelSelection
48//
49LLParcelSelection::LLParcelSelection() :
50 mParcel(NULL),
51 mSelectedMultipleOwners(FALSE),
52 mWholeParcelSelected(FALSE),
53 mSelectedSelfCount(0),
54 mSelectedOtherCount(0),
55 mSelectedPublicCount(0)
56{
57}
58
59LLParcelSelection::LLParcelSelection(LLParcel* parcel) :
60 mParcel(parcel),
61 mSelectedMultipleOwners(FALSE),
62 mWholeParcelSelected(FALSE),
63 mSelectedSelfCount(0),
64 mSelectedOtherCount(0),
65 mSelectedPublicCount(0)
66{
67}
68
69LLParcelSelection::~LLParcelSelection()
70{
71}
72
73BOOL LLParcelSelection::getMultipleOwners() const
74{
75 return mSelectedMultipleOwners;
76}
77
78
79BOOL LLParcelSelection::getWholeParcelSelected() const
80{
81 return mWholeParcelSelected;
82}
83
84
85S32 LLParcelSelection::getClaimableArea() const
86{
87 const S32 UNIT_AREA = S32( PARCEL_GRID_STEP_METERS * PARCEL_GRID_STEP_METERS );
88 return mSelectedPublicCount * UNIT_AREA;
89}
90
91bool LLParcelSelection::hasOthersSelected() const
92{
93 return mSelectedOtherCount != 0;
94}
95
96// static
97LLParcelSelection* LLParcelSelection::getNullParcelSelection()
98{
99 if (sNullSelection.isNull())
100 {
101 sNullSelection = new LLParcelSelection;
102 }
103
104 return sNullSelection;
105}