aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterurldisplay.cpp
blob: e5f4d8112f781cccea1d3af10ba412d20df7e278 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/** 
 * @file llpreviewlandmark.cpp
 * @brief LLFloaterURLDisplayList class implementation
 *
 * $LicenseInfo:firstyear=2002&license=internal$
 * 
 * Copyright (c) 2002-2008, Linden Research, Inc.
 * 
 * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of
 * this source code is governed by the Linden Lab Source Code Disclosure
 * Agreement ("Agreement") previously entered between you and Linden
 * Lab. By accessing, using, copying, modifying or distributing this
 * software, you acknowledge that you have been informed of your
 * obligations under the Agreement and agree to abide by those obligations.
 * 
 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
 * COMPLETENESS OR PERFORMANCE.
 * $/LicenseInfo$
 */

#include "llviewerprecompiledheaders.h"

#include "llfloaterurldisplay.h"

#include "llpanelplace.h"
#include "llvieweruictrlfactory.h"

#include "v3dmath.h"

////////////////////////////////////////////////////////////////////////////
// LLFloaterURLDisplay


LLFloaterURLDisplay::LLFloaterURLDisplay(const LLSD& sd)
{	
	mFactoryMap["place_details_panel"] = LLCallbackMap(LLFloaterURLDisplay::createPlaceDetail, this);
	gUICtrlFactory->buildFloater(this, "floater_preview_url.xml", &getFactoryMap());
	this->setVisible(false);
}

LLFloaterURLDisplay::~LLFloaterURLDisplay()
{
}

void LLFloaterURLDisplay::displayParcelInfo(U64 region_handle, const LLVector3& pos_local)
{
	mRegionHandle = region_handle;
	mRegionPosition = pos_local;
	LLVector3d pos_global = from_region_handle(region_handle);
	pos_global += (LLVector3d)pos_local;

	LLUUID region_id;			// don't know this
	LLUUID landmark_asset_id;	// don't know this either
	mPlacePanel->displayParcelInfo(pos_local, landmark_asset_id, region_id, pos_global);

	this->setVisible(true);
	this->setFrontmost(true);
}

void LLFloaterURLDisplay::setSnapshotDisplay(const LLUUID& snapshot_id)
{
	mPlacePanel->setSnapshot(snapshot_id);
}

void LLFloaterURLDisplay::setName(const std::string& name)
{
	mPlacePanel->setName(name);
}

void LLFloaterURLDisplay::setLocationString(const std::string& name)
{
	mPlacePanel->setLocationString(name);
}

// static
void* LLFloaterURLDisplay::createPlaceDetail(void* userdata)
{
	LLFloaterURLDisplay *self = (LLFloaterURLDisplay*)userdata;
	self->mPlacePanel = new LLPanelPlace();
	gUICtrlFactory->buildPanel(self->mPlacePanel, "panel_place.xml");

	return self->mPlacePanel;
}