r228 - branches/work_303/core

jls17 at arinside.org jls17 at arinside.org
Tue Oct 4 02:32:15 CDT 2011


Author: jls17
Date: Tue Oct  4 02:32:13 2011
New Revision: 228
URL: http://arinside.org/changeset/228

Log:
- added some overlay helper functions to CARServerObject

Modified:
   branches/work_303/core/ARServerObject.cpp
   branches/work_303/core/ARServerObject.h

Modified: branches/work_303/core/ARServerObject.cpp
==============================================================================
--- branches/work_303/core/ARServerObject.cpp	Mon Oct  3 14:23:52 2011	(r227)
+++ branches/work_303/core/ARServerObject.cpp	Tue Oct  4 02:32:13 2011	(r228)
@@ -17,6 +17,55 @@
 #include "stdafx.h"
 #include "ARServerObject.h"
 #include "../output/WebUtil.h"
+#include "../ARInside.h"
 
 using namespace OUTPUT;
 
+int CARServerObject::GetOverlayType() const
+{
+#if AR_CURRENT_API_VERSION >= AR_API_VERSION_764
+	if (CARInside::GetInstance()->appConfig.bOverlaySupport)
+	{
+		ARValueStruct* overlayProp = CARProplistHelper::Find(GetPropList(), AR_SMOPROP_OVERLAY_PROPERTY);
+		if (overlayProp != NULL && overlayProp->dataType == AR_DATA_TYPE_INTEGER)
+		{
+			return overlayProp->u.intVal;
+		}
+	}
+#endif
+	return 0; // AR_ORIGINAL_OBJECT
+}
+
+int CARServerObject::GetOverlayGroup() const
+{
+#if AR_CURRENT_API_VERSION >= AR_API_VERSION_764
+	if (CARInside::GetInstance()->appConfig.bOverlaySupport)
+	{
+		ARValueStruct* overlayProp = CARProplistHelper::Find(GetPropList(), AR_SMOPROP_OVERLAY_GROUP);
+		if (overlayProp != NULL && overlayProp->dataType == AR_DATA_TYPE_INTEGER)
+		{
+			return overlayProp->u.intVal;
+		}
+	}
+#endif
+	return -1; // No Overlay Group / Base
+}
+
+// NOTE: those functions couldn't be used for sub-objects like fields or views.
+string CARServerObject::GetOverlayBaseName() const
+{
+#if AR_CURRENT_API_VERSION >= AR_API_VERSION_764
+	return GetName() + (CARInside::GetInstance()->overlayMode == 0 ? AR_RESERV_OVERLAY_STRING : "");
+#else
+	return "";
+#endif
+}
+
+string CARServerObject::GetOverlayName() const
+{
+#if AR_CURRENT_API_VERSION >= AR_API_VERSION_764
+	return GetName() + (CARInside::GetInstance()->overlayMode == 1 ? AR_RESERV_OVERLAY_STRING : "");
+#else
+	return "";
+#endif
+}

Modified: branches/work_303/core/ARServerObject.h
==============================================================================
--- branches/work_303/core/ARServerObject.h	Mon Oct  3 14:23:52 2011	(r227)
+++ branches/work_303/core/ARServerObject.h	Tue Oct  4 02:32:13 2011	(r228)
@@ -36,4 +36,11 @@
 
 	virtual CARServerObject* Clone() const = 0;
 	virtual bool IsClonable() const = 0;
+
+	// declarations for overlay support
+
+	virtual int GetOverlayType() const;        // returns the type of the overlay (AR_OVERLAID_OBJECT, AR_OVERLAY_OBJECT, AR_CUSTOM_OBJECT)
+	virtual int GetOverlayGroup() const;       // returns the level of the overlay (as of 7.6.04 there are: -1 (base), 0 (overlaid) and 1 (custom/overlay))
+	virtual string GetOverlayBaseName() const; // returns the "internal" object name overlayed by the current object
+	virtual string GetOverlayName() const;     // returns the "internal" object name, which overlays this object 
 };


More information about the arinside-src mailing list