SL-6109 Implemented LLDrawFrustum
parent
0b80218703
commit
0147a8c989
|
|
@ -179,6 +179,7 @@ set(viewer_SOURCE_FILES
|
|||
lldonotdisturbnotificationstorage.cpp
|
||||
lldndbutton.cpp
|
||||
lldrawable.cpp
|
||||
lldrawfrustum.cpp
|
||||
lldrawpool.cpp
|
||||
lldrawpoolalpha.cpp
|
||||
lldrawpoolavatar.cpp
|
||||
|
|
@ -810,6 +811,7 @@ set(viewer_HEADER_FILES
|
|||
lldonotdisturbnotificationstorage.h
|
||||
lldndbutton.h
|
||||
lldrawable.h
|
||||
lldrawfrustum.h
|
||||
lldrawpool.h
|
||||
lldrawpoolalpha.h
|
||||
lldrawpoolavatar.h
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback,
|
|||
floater->mNearMeListComplete = FALSE;
|
||||
floater->mCloseOnSelect = closeOnSelect;
|
||||
floater->mExcludeAgentFromSearchResults = skip_agent;
|
||||
floater->setFrustumOrigin(frustumOrigin);
|
||||
|
||||
if (!closeOnSelect)
|
||||
{
|
||||
|
|
@ -91,10 +92,6 @@ LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback,
|
|||
floater->getChild<LLButton>("cancel_btn")->setLabel(close_string);
|
||||
}
|
||||
|
||||
if(frustumOrigin)
|
||||
{
|
||||
floater->mFrustumOrigin = frustumOrigin->getHandle();
|
||||
}
|
||||
|
||||
return floater;
|
||||
}
|
||||
|
|
@ -104,17 +101,9 @@ LLFloaterAvatarPicker::LLFloaterAvatarPicker(const LLSD& key)
|
|||
: LLFloater(key),
|
||||
mNumResultsReturned(0),
|
||||
mNearMeListComplete(FALSE),
|
||||
mCloseOnSelect(FALSE),
|
||||
mContextConeOpacity (0.f),
|
||||
mContextConeInAlpha(0.f),
|
||||
mContextConeOutAlpha(0.f),
|
||||
mContextConeFadeTime(0.f)
|
||||
mCloseOnSelect(FALSE)
|
||||
{
|
||||
mCommitCallbackRegistrar.add("Refresh.FriendList", boost::bind(&LLFloaterAvatarPicker::populateFriend, this));
|
||||
|
||||
mContextConeInAlpha = gSavedSettings.getF32("ContextConeInAlpha");
|
||||
mContextConeOutAlpha = gSavedSettings.getF32("ContextConeOutAlpha");
|
||||
mContextConeFadeTime = gSavedSettings.getF32("ContextConeFadeTime");
|
||||
}
|
||||
|
||||
BOOL LLFloaterAvatarPicker::postBuild()
|
||||
|
|
@ -359,66 +348,10 @@ void LLFloaterAvatarPicker::populateFriend()
|
|||
friends_scroller->sortByColumnIndex(0, TRUE);
|
||||
}
|
||||
|
||||
void LLFloaterAvatarPicker::drawFrustum()
|
||||
{
|
||||
if(mFrustumOrigin.get())
|
||||
{
|
||||
LLView * frustumOrigin = mFrustumOrigin.get();
|
||||
LLRect origin_rect;
|
||||
frustumOrigin->localRectToOtherView(frustumOrigin->getLocalRect(), &origin_rect, this);
|
||||
// draw context cone connecting color picker with color swatch in parent floater
|
||||
LLRect local_rect = getLocalRect();
|
||||
if (hasFocus() && frustumOrigin->isInVisibleChain() && mContextConeOpacity > 0.001f)
|
||||
{
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
LLGLEnable(GL_CULL_FACE);
|
||||
gGL.begin(LLRender::QUADS);
|
||||
{
|
||||
gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity);
|
||||
gGL.vertex2i(origin_rect.mLeft, origin_rect.mTop);
|
||||
gGL.vertex2i(origin_rect.mRight, origin_rect.mTop);
|
||||
gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity);
|
||||
gGL.vertex2i(local_rect.mRight, local_rect.mTop);
|
||||
gGL.vertex2i(local_rect.mLeft, local_rect.mTop);
|
||||
|
||||
gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity);
|
||||
gGL.vertex2i(local_rect.mLeft, local_rect.mTop);
|
||||
gGL.vertex2i(local_rect.mLeft, local_rect.mBottom);
|
||||
gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity);
|
||||
gGL.vertex2i(origin_rect.mLeft, origin_rect.mBottom);
|
||||
gGL.vertex2i(origin_rect.mLeft, origin_rect.mTop);
|
||||
|
||||
gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity);
|
||||
gGL.vertex2i(local_rect.mRight, local_rect.mBottom);
|
||||
gGL.vertex2i(local_rect.mRight, local_rect.mTop);
|
||||
gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity);
|
||||
gGL.vertex2i(origin_rect.mRight, origin_rect.mTop);
|
||||
gGL.vertex2i(origin_rect.mRight, origin_rect.mBottom);
|
||||
|
||||
gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity);
|
||||
gGL.vertex2i(local_rect.mLeft, local_rect.mBottom);
|
||||
gGL.vertex2i(local_rect.mRight, local_rect.mBottom);
|
||||
gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity);
|
||||
gGL.vertex2i(origin_rect.mRight, origin_rect.mBottom);
|
||||
gGL.vertex2i(origin_rect.mLeft, origin_rect.mBottom);
|
||||
}
|
||||
gGL.end();
|
||||
}
|
||||
|
||||
if (gFocusMgr.childHasMouseCapture(getDragHandle()))
|
||||
{
|
||||
mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLSmoothInterpolation::getInterpolant(mContextConeFadeTime));
|
||||
}
|
||||
else
|
||||
{
|
||||
mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLSmoothInterpolation::getInterpolant(mContextConeFadeTime));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterAvatarPicker::draw()
|
||||
{
|
||||
drawFrustum();
|
||||
LLRect local_rect = getLocalRect();
|
||||
drawFrustum(local_rect, this, getDragHandle(), hasFocus());
|
||||
|
||||
// sometimes it is hard to determine when Select/Ok button should be disabled (see LLAvatarActions::shareWithAvatars).
|
||||
// lets check this via mOkButtonValidateSignal callback periodically.
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#define LLFLOATERAVATARPICKER_H
|
||||
|
||||
#include "llfloater.h"
|
||||
#include "lldrawfrustum.h"
|
||||
#include "lleventcoro.h"
|
||||
#include "llcoros.h"
|
||||
|
||||
|
|
@ -36,7 +37,7 @@
|
|||
class LLAvatarName;
|
||||
class LLScrollListCtrl;
|
||||
|
||||
class LLFloaterAvatarPicker :public LLFloater
|
||||
class LLFloaterAvatarPicker :public LLFloater, public LLDrawFrustum
|
||||
{
|
||||
public:
|
||||
typedef boost::signals2::signal<bool(const uuid_vec_t&), boost_boolean_combiner> validate_signal_t;
|
||||
|
|
@ -91,7 +92,6 @@ private:
|
|||
void setAllowMultiple(BOOL allow_multiple);
|
||||
LLScrollListCtrl* getActiveList();
|
||||
|
||||
void drawFrustum();
|
||||
virtual void draw();
|
||||
virtual BOOL handleKeyHere(KEY key, MASK mask);
|
||||
|
||||
|
|
@ -100,11 +100,6 @@ private:
|
|||
BOOL mNearMeListComplete;
|
||||
BOOL mCloseOnSelect;
|
||||
BOOL mExcludeAgentFromSearchResults;
|
||||
LLHandle <LLView> mFrustumOrigin;
|
||||
F32 mContextConeOpacity;
|
||||
F32 mContextConeInAlpha;
|
||||
F32 mContextConeOutAlpha;
|
||||
F32 mContextConeFadeTime;
|
||||
|
||||
validate_signal_t mOkButtonValidateSignal;
|
||||
select_callback_t mSelectionCallback;
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@
|
|||
|
||||
LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show_apply_immediate )
|
||||
: LLFloater(LLSD()),
|
||||
LLDrawFrustum(swatch),
|
||||
mComponents ( 3 ),
|
||||
mMouseDownInLumRegion ( FALSE ),
|
||||
mMouseDownInHueRegion ( FALSE ),
|
||||
|
|
@ -100,11 +101,7 @@ LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show
|
|||
mPaletteRegionHeight ( 40 ),
|
||||
mSwatch ( swatch ),
|
||||
mActive ( TRUE ),
|
||||
mCanApplyImmediately ( show_apply_immediate ),
|
||||
mContextConeOpacity ( 0.f ),
|
||||
mContextConeInAlpha ( 0.f ),
|
||||
mContextConeOutAlpha ( 0.f ),
|
||||
mContextConeFadeTime ( 0.f )
|
||||
mCanApplyImmediately ( show_apply_immediate )
|
||||
{
|
||||
buildFromFile ( "floater_color_picker.xml");
|
||||
|
||||
|
|
@ -116,10 +113,6 @@ LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show
|
|||
mApplyImmediateCheck->setEnabled(FALSE);
|
||||
mApplyImmediateCheck->set(FALSE);
|
||||
}
|
||||
|
||||
mContextConeInAlpha = gSavedSettings.getF32("ContextConeInAlpha");
|
||||
mContextConeOutAlpha = gSavedSettings.getF32("ContextConeOutAlpha");
|
||||
mContextConeFadeTime = gSavedSettings.getF32("ContextConeFadeTime");
|
||||
}
|
||||
|
||||
LLFloaterColorPicker::~LLFloaterColorPicker()
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include <vector>
|
||||
|
||||
#include "llfloater.h"
|
||||
#include "lldrawfrustum.h"
|
||||
#include "llpointer.h"
|
||||
#include "llcolorswatch.h"
|
||||
#include "llspinctrl.h"
|
||||
|
|
@ -41,7 +42,7 @@ class LLCheckBoxCtrl;
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
// floater class
|
||||
class LLFloaterColorPicker
|
||||
: public LLFloater
|
||||
: public LLFloater, public LLDrawFrustum
|
||||
{
|
||||
public:
|
||||
LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show_apply_immediate = FALSE);
|
||||
|
|
@ -63,7 +64,7 @@ class LLFloaterColorPicker
|
|||
void destroyUI ();
|
||||
void cancelSelection ();
|
||||
LLColorSwatchCtrl* getSwatch () { return mSwatch; };
|
||||
void setSwatch( LLColorSwatchCtrl* swatch) { mSwatch = swatch; }
|
||||
void setSwatch(LLColorSwatchCtrl* swatch) { mSwatch = swatch; setFrustumOrigin(mSwatch); }
|
||||
|
||||
// mutator / accessor for original RGB value
|
||||
void setOrigRgb ( F32 origRIn, F32 origGIn, F32 origBIn );
|
||||
|
|
@ -196,12 +197,6 @@ class LLFloaterColorPicker
|
|||
LLButton* mCancelBtn;
|
||||
|
||||
LLButton* mPipetteBtn;
|
||||
|
||||
F32 mContextConeOpacity;
|
||||
F32 mContextConeInAlpha;
|
||||
F32 mContextConeOutAlpha;
|
||||
F32 mContextConeFadeTime;
|
||||
|
||||
};
|
||||
|
||||
#endif // LL_LLFLOATERCOLORPICKER_H
|
||||
|
|
|
|||
|
|
@ -64,10 +64,7 @@ LLFloaterExperiencePicker* LLFloaterExperiencePicker::show( select_callback_t ca
|
|||
floater->mSearchPanel->filterContent();
|
||||
}
|
||||
|
||||
if(frustumOrigin)
|
||||
{
|
||||
floater->mFrustumOrigin = frustumOrigin->getHandle();
|
||||
}
|
||||
floater->setFrustumOrigin(frustumOrigin);
|
||||
|
||||
return floater;
|
||||
}
|
||||
|
|
@ -80,21 +77,15 @@ void LLFloaterExperiencePicker::drawFrustum()
|
|||
|
||||
void LLFloaterExperiencePicker::draw()
|
||||
{
|
||||
drawFrustum();
|
||||
LLRect local_rect = getLocalRect();
|
||||
drawFrustum(local_rect, this, getDragHandle(), hasFocus());
|
||||
LLFloater::draw();
|
||||
}
|
||||
|
||||
LLFloaterExperiencePicker::LLFloaterExperiencePicker( const LLSD& key )
|
||||
:LLFloater(key)
|
||||
,mSearchPanel(NULL)
|
||||
,mContextConeOpacity(0.f)
|
||||
,mContextConeInAlpha(0.f)
|
||||
,mContextConeOutAlpha(0.f)
|
||||
,mContextConeFadeTime(0.f)
|
||||
{
|
||||
mContextConeInAlpha = gSavedSettings.getF32("ContextConeInAlpha");
|
||||
mContextConeOutAlpha = gSavedSettings.getF32("ContextConeOutAlpha");
|
||||
mContextConeFadeTime = gSavedSettings.getF32("ContextConeFadeTime");
|
||||
}
|
||||
|
||||
LLFloaterExperiencePicker::~LLFloaterExperiencePicker()
|
||||
|
|
|
|||
|
|
@ -28,13 +28,14 @@
|
|||
#define LL_LLFLOATEREXPERIENCEPICKER_H
|
||||
|
||||
#include "llfloater.h"
|
||||
#include "lldrawfrustum.h"
|
||||
|
||||
class LLScrollListCtrl;
|
||||
class LLLineEditor;
|
||||
class LLPanelExperiencePicker;
|
||||
|
||||
|
||||
class LLFloaterExperiencePicker : public LLFloater
|
||||
class LLFloaterExperiencePicker : public LLFloater, public LLDrawFrustum
|
||||
{
|
||||
public:
|
||||
|
||||
|
|
@ -54,13 +55,6 @@ public:
|
|||
private:
|
||||
|
||||
LLPanelExperiencePicker* mSearchPanel;
|
||||
|
||||
void drawFrustum();
|
||||
LLHandle <LLView> mFrustumOrigin;
|
||||
F32 mContextConeOpacity;
|
||||
F32 mContextConeInAlpha;
|
||||
F32 mContextConeOutAlpha;
|
||||
F32 mContextConeFadeTime;
|
||||
};
|
||||
|
||||
#endif // LL_LLFLOATEREXPERIENCEPICKER_H
|
||||
|
|
|
|||
|
|
@ -109,7 +109,6 @@ LLFloaterTexturePicker::LLFloaterTexturePicker(
|
|||
mImmediateFilterPermMask(immediate_filter_perm_mask),
|
||||
mDnDFilterPermMask(dnd_filter_perm_mask),
|
||||
mNonImmediateFilterPermMask(non_immediate_filter_perm_mask),
|
||||
mContextConeOpacity(0.f),
|
||||
mSelectedItemPinned( FALSE ),
|
||||
mCanApply(true),
|
||||
mCanPreview(true),
|
||||
|
|
@ -123,6 +122,7 @@ LLFloaterTexturePicker::LLFloaterTexturePicker(
|
|||
buildFromFile("floater_texture_ctrl.xml");
|
||||
mCanApplyImmediately = can_apply_immediately;
|
||||
setCanMinimize(FALSE);
|
||||
setFrustumOrigin(mOwner);
|
||||
}
|
||||
|
||||
LLFloaterTexturePicker::~LLFloaterTexturePicker()
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#define LL_LLTEXTURECTRL_H
|
||||
|
||||
#include "llcoord.h"
|
||||
#include "lldrawfrustum.h"
|
||||
#include "llfiltereditor.h"
|
||||
#include "llfloater.h"
|
||||
#include "llfolderview.h"
|
||||
|
|
@ -249,7 +250,7 @@ typedef boost::function<void()> floater_close_callback;
|
|||
typedef boost::function<void(const LLUUID& asset_id)> set_image_asset_id_callback;
|
||||
typedef boost::function<void(LLPointer<LLViewerTexture> texture)> set_on_update_image_stats_callback;
|
||||
|
||||
class LLFloaterTexturePicker : public LLFloater
|
||||
class LLFloaterTexturePicker : public LLFloater, public LLDrawFrustum
|
||||
{
|
||||
public:
|
||||
LLFloaterTexturePicker(
|
||||
|
|
@ -291,7 +292,7 @@ public:
|
|||
void setActive(BOOL active);
|
||||
|
||||
LLView* getOwner() const { return mOwner; }
|
||||
void setOwner(LLView* owner) { mOwner = owner; }
|
||||
void setOwner(LLView* owner) { mOwner = owner; setFrustumOrigin(owner); }
|
||||
void stopUsingPipette();
|
||||
PermissionMask getFilterPermMask();
|
||||
|
||||
|
|
@ -363,7 +364,6 @@ protected:
|
|||
PermissionMask mNonImmediateFilterPermMask;
|
||||
BOOL mCanApplyImmediately;
|
||||
BOOL mNoCopyTextureSelected;
|
||||
F32 mContextConeOpacity;
|
||||
LLSaveFolderState mSavedFolderState;
|
||||
BOOL mSelectedItemPinned;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue