14 #ifndef hifi_PolyLineEntityItem_h
15 #define hifi_PolyLineEntityItem_h
17 #include "EntityItem.h"
28 virtual EntityItemProperties getProperties(
const EntityPropertyFlags& desiredProperties,
bool allowEmptyDesiredProperties)
const override;
31 virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params)
const override;
33 virtual void appendSubclassData(
OctreePacketData* packetData, EncodeBitstreamParams& params,
34 EntityTreeElementExtraEncodeDataPointer modelTreeElementExtraEncodeData,
35 EntityPropertyFlags& requestedProperties,
36 EntityPropertyFlags& propertyFlags,
37 EntityPropertyFlags& propertiesDidntFit,
39 OctreeElement::AppendState& appendState)
const override;
41 virtual int readEntitySubclassDataFromBuffer(
const unsigned char* data,
int bytesLeftToRead,
42 ReadBitstreamToTreeParams& args,
43 EntityPropertyFlags& propertyFlags,
bool overwriteLocalData,
44 bool& somethingChanged)
override;
46 glm::u8vec3 getColor()
const;
47 void setColor(
const glm::u8vec3& value);
49 static const int MAX_POINTS_PER_LINE;
50 void setLinePoints(
const QVector<glm::vec3>& points);
51 QVector<glm::vec3> getLinePoints()
const;
53 static const float DEFAULT_LINE_WIDTH;
54 void setStrokeWidths(
const QVector<float>& strokeWidths);
55 QVector<float> getStrokeWidths()
const;
57 void setNormals(
const QVector<glm::vec3>& normals);
58 QVector<glm::vec3> getNormals()
const;
60 void setStrokeColors(
const QVector<glm::vec3>& strokeColors);
61 QVector<glm::vec3> getStrokeColors()
const;
63 void setIsUVModeStretch(
bool isUVModeStretch);
64 bool getIsUVModeStretch()
const{
return _isUVModeStretch; }
66 QString getTextures()
const;
67 void setTextures(
const QString& textures);
69 void setGlow(
bool glow);
70 bool getGlow()
const {
return _glow; }
72 void setFaceCamera(
bool faceCamera);
73 bool getFaceCamera()
const {
return _faceCamera; }
75 bool pointsChanged()
const {
return _pointsChanged; }
76 bool normalsChanged()
const {
return _normalsChanged; }
77 bool colorsChanged()
const {
return _colorsChanged; }
78 bool widthsChanged()
const {
return _widthsChanged; }
79 bool texturesChanged()
const {
return _texturesChanged; }
81 void resetTexturesChanged() { _texturesChanged =
false; }
82 void resetPolyLineChanged() { _colorsChanged = _widthsChanged = _normalsChanged = _pointsChanged =
false; }
85 virtual bool supportsDetailedIntersection()
const override {
return true; }
86 virtual bool findDetailedRayIntersection(
const glm::vec3& origin,
const glm::vec3& direction,
87 const glm::vec3& viewFrustumPos, OctreeElementPointer& element,
float& distance,
88 BoxFace& face, glm::vec3& surfaceNormal,
89 QVariantMap& extraInfo,
bool precisionPicking)
const override {
return false; }
90 virtual bool findDetailedParabolaIntersection(
const glm::vec3& origin,
const glm::vec3& velocity,
91 const glm::vec3& acceleration,
const glm::vec3& viewFrustumPos, OctreeElementPointer& element,
92 float& parabolicDistance, BoxFace& face, glm::vec3& surfaceNormal,
93 QVariantMap& extraInfo,
bool precisionPicking)
const override {
return false; }
95 void computeTightLocalBoundingBox(AABox& box)
const;
97 virtual void debugDump()
const override;
99 void computeAndUpdateDimensions();
103 QVector<glm::vec3> _points;
104 QVector<glm::vec3> _normals;
105 QVector<glm::vec3> _colors;
106 QVector<float> _widths;
108 bool _isUVModeStretch {
false };
109 bool _glow {
false };
110 bool _faceCamera {
false };
112 bool _pointsChanged {
false };
113 bool _normalsChanged {
false };
114 bool _colorsChanged {
false };
115 bool _widthsChanged {
false };
116 bool _texturesChanged {
false };
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