text: //
  //  Created by Bradley Austin Davis on 2015/05/12
  //  Copyright 2013 High Fidelity, Inc.
  //
  //  Distributed under the Apache License, Version 2.0.
  //  See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
  //
  
  #ifndef hifi_WebEntityItem_h
  #define hifi_WebEntityItem_h
  
  #include "EntityItem.h"
  
  class WebEntityItem : public EntityItem {
  public:
      static const QString DEFAULT_SOURCE_URL;
  
      static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties);
  
      WebEntityItem(const EntityItemID& entityItemID);
  
      ALLOW_INSTANTIATION // This class can be instantiated
  
      /// set dimensions in domain scale units (0.0 - 1.0) this will also reset radius appropriately
      virtual void setDimensions(const glm::vec3& value) override;
      virtual ShapeType getShapeType() const override { return SHAPE_TYPE_BOX; }
  
      // methods for getting/setting all properties of an entity
      virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override;
      virtual bool setProperties(const EntityItemProperties& properties) override;
  
      // TODO: eventually only include properties changed since the params.nodeData->getLastTimeBagEmpty() time
      virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
  
      virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
                                      EntityTreeElementExtraEncodeDataPointer modelTreeElementExtraEncodeData,
                                      EntityPropertyFlags& requestedProperties,
                                      EntityPropertyFlags& propertyFlags,
                                      EntityPropertyFlags& propertiesDidntFit,
                                      int& propertyCount,
                                      OctreeElement::AppendState& appendState) const override;
  
      virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
                                                  ReadBitstreamToTreeParams& args,
                                                  EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
                                                  bool& somethingChanged) override;
  
      virtual bool supportsDetailedRayIntersection() const override { return true; }
      virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
                           bool& keepSearching, OctreeElementPointer& element, float& distance,
                           BoxFace& face, glm::vec3& surfaceNormal,
                           void** intersectedObject, bool precisionPicking) const override;
  
      virtual void setSourceUrl(const QString& value);
      QString getSourceUrl() const;
  
      virtual bool wantsHandControllerPointerEvents() const override { return true; }
  
      void setDPI(uint16_t value);
      uint16_t getDPI() const;
  
      virtual QObject* getRootItem() { return nullptr; }
  
  protected:
      QString _sourceUrl;
      uint16_t _dpi;
  };
  
  #endif // hifi_WebEntityItem_h
  