summaryrefslogtreecommitdiff
path: root/indra/newview/llselectmgr.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llselectmgr.h')
-rw-r--r--indra/newview/llselectmgr.h56
1 files changed, 26 insertions, 30 deletions
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index 9e02170d74..26ac95060f 100644
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -35,7 +35,6 @@
#include "llcharacter.h"
#include "lleditmenuhandler.h"
-#include "llstring.h"
#include "llundo.h"
#include "lluuid.h"
#include "llpointer.h"
@@ -48,14 +47,15 @@
#include "llframetimer.h"
#include "llbbox.h"
#include "llpermissions.h"
-#include "llviewerobject.h"
#include "llcontrol.h"
+#include "llviewerobject.h" // LLObjectSelection::getSelectedTEValue template
+
#include <deque>
-#include "boost/iterator/filter_iterator.hpp"
+#include <boost/iterator/filter_iterator.hpp>
+#include <boost/signals2.hpp>
class LLMessageSystem;
class LLViewerTexture;
-class LLViewerObject;
class LLColor4;
class LLVector3;
class LLSelectNode;
@@ -203,13 +203,9 @@ class LLObjectSelection : public LLRefCount
protected:
~LLObjectSelection();
- // List
public:
typedef std::list<LLSelectNode*> list_t;
-private:
- list_t mList;
-public:
// Iterators
struct is_non_null
{
@@ -235,11 +231,7 @@ public:
struct is_root
{
- bool operator()(LLSelectNode* node)
- {
- LLViewerObject* object = node->getObject();
- return (object != NULL) && !node->mIndividualSelection && (object->isRootEdit() || object->isJointChild());
- }
+ bool operator()(LLSelectNode* node);
};
typedef boost::filter_iterator<is_root, list_t::iterator > root_iterator;
root_iterator root_begin() { return root_iterator(mList.begin(), mList.end()); }
@@ -247,11 +239,7 @@ public:
struct is_valid_root
{
- bool operator()(LLSelectNode* node)
- {
- LLViewerObject* object = node->getObject();
- return (object != NULL) && node->mValid && !node->mIndividualSelection && (object->isRootEdit() || object->isJointChild());
- }
+ bool operator()(LLSelectNode* node);
};
typedef boost::filter_iterator<is_root, list_t::iterator > valid_root_iterator;
valid_root_iterator valid_root_begin() { return valid_root_iterator(mList.begin(), mList.end()); }
@@ -259,11 +247,7 @@ public:
struct is_root_object
{
- bool operator()(LLSelectNode* node)
- {
- LLViewerObject* object = node->getObject();
- return (object != NULL) && (object->isRootEdit() || object->isJointChild());
- }
+ bool operator()(LLSelectNode* node);
};
typedef boost::filter_iterator<is_root_object, list_t::iterator > root_object_iterator;
root_object_iterator root_object_begin() { return root_object_iterator(mList.begin(), mList.end()); }
@@ -326,6 +310,7 @@ public:
ESelectType getSelectType() const { return mSelectType; }
private:
+ list_t mList;
const LLObjectSelection &operator=(const LLObjectSelection &);
LLPointer<LLViewerObject> mPrimaryObject;
@@ -398,13 +383,16 @@ public:
// Add
////////////////////////////////////////////////////////////////
- // For when you want just a child object.
- LLObjectSelectionHandle selectObjectOnly(LLViewerObject* object, S32 face = SELECT_ALL_TES);
-
// This method is meant to select an object, and then select all
- // of the ancestors and descendents. This should be the normal behavior.
+ // of the ancestors and descendants. This should be the normal behavior.
+ //
+ // *NOTE: You must hold on to the object selection handle, otherwise
+ // the objects will be automatically deselected in 1 frame.
LLObjectSelectionHandle selectObjectAndFamily(LLViewerObject* object, BOOL add_to_end = FALSE);
+ // For when you want just a child object.
+ LLObjectSelectionHandle selectObjectOnly(LLViewerObject* object, S32 face = SELECT_ALL_TES);
+
// Same as above, but takes a list of objects. Used by rectangle select.
LLObjectSelectionHandle selectObjectAndFamily(const std::vector<LLViewerObject*>& object_list, BOOL send_to_sim = TRUE);
@@ -691,7 +679,13 @@ private:
static void packPermissionsHead(void* user_data);
static void packGodlikeHead(void* user_data);
static bool confirmDelete(const LLSD& notification, const LLSD& response, LLObjectSelectionHandle handle);
-
+
+public:
+ // Observer/callback support for when object selection changes or
+ // properties are received/updated
+ typedef boost::signals2::signal< void ()> update_signal_t;
+ update_signal_t mUpdateSignal;
+
private:
LLPointer<LLViewerTexture> mSilhouetteImagep;
LLObjectSelectionHandle mSelectedObjects;
@@ -723,8 +717,10 @@ private:
LLAnimPauseRequest mPauseRequest;
};
-// Utilities
-void dialog_refresh_all(); // Update subscribers to the selection list
+// *DEPRECATED: For callbacks or observers, use
+// LLSelectMgr::getInstance()->mUpdateSignal.connect( callback )
+// Update subscribers to the selection list
+void dialog_refresh_all();
// Templates
//-----------------------------------------------------------------------------