summaryrefslogtreecommitdiff
path: root/indra/newview/llpathfindingpathtool.h
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-04-09 18:53:52 -0700
committerTodd Stinson <stinson@lindenlab.com>2012-04-09 18:53:52 -0700
commit2115211328261d875dc0ccacdc2021f1c501a36d (patch)
tree0cc143ed25cfadc2b54f37a8895523bcf44e1582 /indra/newview/llpathfindingpathtool.h
parent4888f7d34969b596e2b37ef72576118e1c0c27ac (diff)
Re-implementing the path testing functionality as a proper LLTool.
Diffstat (limited to 'indra/newview/llpathfindingpathtool.h')
-rw-r--r--indra/newview/llpathfindingpathtool.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/indra/newview/llpathfindingpathtool.h b/indra/newview/llpathfindingpathtool.h
new file mode 100644
index 0000000000..80d3b4cceb
--- /dev/null
+++ b/indra/newview/llpathfindingpathtool.h
@@ -0,0 +1,102 @@
+/**
+ * @file llpathfindingpathtool.h
+ * @author William Todd Stinson
+ * @brief XXX
+ *
+ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, 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_LLPATHFINDINGPATHTOOL_H
+#define LL_LLPATHFINDINGPATHTOOL_H
+
+#include "llsingleton.h"
+#include "lltool.h"
+#include "llpathinglib.h"
+
+#include <boost/function.hpp>
+#include <boost/signals2.hpp>
+
+class LLPathfindingPathTool : public LLTool, public LLSingleton<LLPathfindingPathTool>
+{
+public:
+ typedef enum
+ {
+ kPathStatusUnknown,
+ kPathStatusChooseStartAndEndPoints,
+ kPathStatusChooseStartPoint,
+ kPathStatusChooseEndPoint,
+ kPathStatusHasValidPath,
+ kPathStatusHasInvalidPath,
+ kPathStatusNotEnabled,
+ kPathStatusNotImplemented,
+ kPathStatusError
+ } EPathStatus;
+
+ typedef enum
+ {
+ kCharacterTypeNone,
+ kCharacterTypeA,
+ kCharacterTypeB,
+ kCharacterTypeC,
+ kCharacterTypeD
+ } ECharacterType;
+
+ typedef
+
+ LLPathfindingPathTool();
+ virtual ~LLPathfindingPathTool();
+
+ typedef boost::function<void (void)> path_event_callback_t;
+ typedef boost::signals2::signal<void (void)> path_event_signal_t;
+ typedef boost::signals2::connection path_event_slot_t;
+
+ virtual BOOL handleMouseDown(S32 pX, S32 pY, MASK pMask);
+ virtual BOOL handleHover(S32 pX, S32 pY, MASK pMask);
+
+ EPathStatus getPathStatus() const;
+
+ F32 getCharacterWidth() const;
+ void setCharacterWidth(F32 pCharacterWidth);
+
+ ECharacterType getCharacterType() const;
+ void setCharacterType(ECharacterType pCharacterType);
+
+ bool isRenderPath() const;
+ void clearPath();
+
+ path_event_slot_t registerPathEventListener(path_event_callback_t pPathEventCallback);
+
+protected:
+
+private:
+ void computePath();
+
+ LLPathingLib::PathingPacket mPathData;
+ LLPathingLib::LLPLResult mPathResult;
+ bool mHasStartPoint;
+ bool mHasEndPoint;
+ F32 mCharacterWidth;
+ ECharacterType mCharacterType;
+ path_event_signal_t mPathEventSignal;
+};
+
+#endif // LL_LLPATHFINDINGPATHTOOL_H