Overte C++ Documentation
GizmoEntityItem.h
1 //
2 // Created by Sam Gondelman on 1/22/19
3 // Copyright 2019 High Fidelity, Inc.
4 //
5 // Distributed under the Apache License, Version 2.0.
6 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
7 //
8 
9 #ifndef hifi_GizmoEntityItem_h
10 #define hifi_GizmoEntityItem_h
11 
12 #include "EntityItem.h"
13 
14 #include "RingGizmoPropertyGroup.h"
15 
16 class GizmoEntityItem : public EntityItem {
17  using Pointer = std::shared_ptr<GizmoEntityItem>;
18 public:
19  static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties);
20 
21  GizmoEntityItem(const EntityItemID& entityItemID);
22 
23  ALLOW_INSTANTIATION // This class can be instantiated
24 
25  virtual void setUnscaledDimensions(const glm::vec3& value) override;
26 
27  // methods for getting/setting all properties of an entity
28  EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
29  bool setSubClassProperties(const EntityItemProperties& properties) override;
30 
31  EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
32 
33  void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
34  EntityTreeElementExtraEncodeDataPointer entityTreeElementExtraEncodeData,
35  EntityPropertyFlags& requestedProperties,
36  EntityPropertyFlags& propertyFlags,
37  EntityPropertyFlags& propertiesDidntFit,
38  int& propertyCount,
39  OctreeElement::AppendState& appendState) const override;
40 
41  int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
42  ReadBitstreamToTreeParams& args,
43  EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
44  bool& somethingChanged) override;
45 
46  bool supportsDetailedIntersection() const override;
47  bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
48  const glm::vec3& viewFrustumPos, OctreeElementPointer& element, float& distance,
49  BoxFace& face, glm::vec3& surfaceNormal,
50  QVariantMap& extraInfo, bool precisionPicking) const override;
51  bool findDetailedParabolaIntersection(const glm::vec3& origin, const glm::vec3& velocity,
52  const glm::vec3& acceleration, const glm::vec3& viewFrustumPos, OctreeElementPointer& element,
53  float& parabolicDistance, BoxFace& face, glm::vec3& surfaceNormal,
54  QVariantMap& extraInfo, bool precisionPicking) const override;
55  bool getRotateForPicking() const override { return getBillboardMode() != BillboardMode::NONE; }
56 
57  GizmoType getGizmoType() const;
58  void setGizmoType(GizmoType value);
59 
60  RingGizmoPropertyGroup getRingProperties() const;
61 
62 protected:
63  GizmoType _gizmoType;
64  RingGizmoPropertyGroup _ringProperties;
65 
66 };
67 
68 #endif // hifi_GizmoEntityItem_h
Definition: EntityItem.h:82
Abstract ID for editing model items. Used in EntityItem JS API.
Definition: EntityItemID.h:28
Definition: EntityItemProperties.h:106
Handles packing of the data portion of PacketType_OCTREE_DATA messages.
Definition: OctreePacketData.h:93