From 38a565f71a54aaa66300a0ab593e366731aac769 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Tue, 9 Oct 2012 12:30:38 -0700 Subject: Initial pass at getting a list of viewer objects with non-null material IDs. --- indra/llprimitive/llmaterialid.h | 62 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 indra/llprimitive/llmaterialid.h (limited to 'indra/llprimitive/llmaterialid.h') diff --git a/indra/llprimitive/llmaterialid.h b/indra/llprimitive/llmaterialid.h new file mode 100644 index 0000000000..4551550db5 --- /dev/null +++ b/indra/llprimitive/llmaterialid.h @@ -0,0 +1,62 @@ +/** +* @file llmaterialid.h +* @brief Header file for llmaterialid +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#ifndef LL_LLMATERIALID_H +#define LL_LLMATERIALID_H + +#define MATERIAL_ID_SIZE 16 + +class LLMaterialID +{ +public: + LLMaterialID(); + LLMaterialID(const LLSD& pMaterialID); + LLMaterialID(const LLSD::Binary& pMaterialID); + LLMaterialID(const LLMaterialID& pOtherMaterialID); + ~LLMaterialID(); + + bool operator == (const LLMaterialID& pOtherMaterialID) const; + bool operator != (const LLMaterialID& pOtherMaterialID) const; + LLMaterialID& operator = (const LLMaterialID& pOtherMaterialID); + + bool isNull() const; + + const U8* get() const; + void set(const void* pMemory); + void clear(); + + static const LLMaterialID null; + +private: + void parseFromBinary(const LLSD::Binary& pMaterialID); + void copyFromOtherMaterialID(const LLMaterialID& pOtherMaterialID); + int compareToOtherMaterialID(const LLMaterialID& pOtherMaterialID) const; + + U8 mID[MATERIAL_ID_SIZE]; +} ; + +#endif // LL_LLMATERIALID_H + -- cgit v1.2.3 From 4174e9be5ea6262d7ad27ab64805990fd13670ee Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Thu, 11 Oct 2012 11:51:16 -0700 Subject: Adding an additional conversion constructor. --- indra/llprimitive/llmaterialid.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llprimitive/llmaterialid.h') diff --git a/indra/llprimitive/llmaterialid.h b/indra/llprimitive/llmaterialid.h index 4551550db5..71c6e72478 100644 --- a/indra/llprimitive/llmaterialid.h +++ b/indra/llprimitive/llmaterialid.h @@ -35,6 +35,7 @@ public: LLMaterialID(); LLMaterialID(const LLSD& pMaterialID); LLMaterialID(const LLSD::Binary& pMaterialID); + LLMaterialID(const void* pMemory); LLMaterialID(const LLMaterialID& pOtherMaterialID); ~LLMaterialID(); -- cgit v1.2.3 From e2ce144129e53ca7c6f5309cab833d48cdb30b11 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Tue, 27 Nov 2012 16:56:53 -0800 Subject: First pass at re-implementing the POST functionality to query values for selected visible objects. --- indra/llprimitive/llmaterialid.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llprimitive/llmaterialid.h') diff --git a/indra/llprimitive/llmaterialid.h b/indra/llprimitive/llmaterialid.h index 71c6e72478..1578172aec 100644 --- a/indra/llprimitive/llmaterialid.h +++ b/indra/llprimitive/llmaterialid.h @@ -49,6 +49,8 @@ public: void set(const void* pMemory); void clear(); + LLSD asLLSD() const; + static const LLMaterialID null; private: -- cgit v1.2.3 From e2b5e11820cf234d035bdb07f4b145c397fdf67b Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Tue, 4 Dec 2012 15:46:10 -0800 Subject: Implementing string conversion and comparison operator overrides for the LLMaterialID class. --- indra/llprimitive/llmaterialid.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/llprimitive/llmaterialid.h') diff --git a/indra/llprimitive/llmaterialid.h b/indra/llprimitive/llmaterialid.h index 1578172aec..9db4065302 100644 --- a/indra/llprimitive/llmaterialid.h +++ b/indra/llprimitive/llmaterialid.h @@ -29,6 +29,8 @@ #define MATERIAL_ID_SIZE 16 +#include + class LLMaterialID { public: @@ -41,6 +43,12 @@ public: bool operator == (const LLMaterialID& pOtherMaterialID) const; bool operator != (const LLMaterialID& pOtherMaterialID) const; + + bool operator < (const LLMaterialID& pOtherMaterialID) const; + bool operator <= (const LLMaterialID& pOtherMaterialID) const; + bool operator > (const LLMaterialID& pOtherMaterialID) const; + bool operator >= (const LLMaterialID& pOtherMaterialID) const; + LLMaterialID& operator = (const LLMaterialID& pOtherMaterialID); bool isNull() const; @@ -50,6 +58,7 @@ public: void clear(); LLSD asLLSD() const; + std::string asString() const; static const LLMaterialID null; -- cgit v1.2.3 From 90bf22ef24fbb8ff3497dd271abc7f7555a4f758 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 1 Feb 2013 10:20:44 -0500 Subject: add debug logging, ostream support for material ids, and some minor cleanup --- indra/llprimitive/llmaterialid.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llprimitive/llmaterialid.h') diff --git a/indra/llprimitive/llmaterialid.h b/indra/llprimitive/llmaterialid.h index 9db4065302..0a95204085 100644 --- a/indra/llprimitive/llmaterialid.h +++ b/indra/llprimitive/llmaterialid.h @@ -60,6 +60,8 @@ public: LLSD asLLSD() const; std::string asString() const; + friend std::ostream& operator<<(std::ostream& s, const LLMaterialID &material_id); + static const LLMaterialID null; private: -- cgit v1.2.3