57 int screenHeight)
override;
63 inline const float*
getPosition()
const {
return m_screenPos; }
66 void clear(
bool ignoreDependencies =
false,
bool ignoreCaption =
true);
74 inline unsigned size()
const {
75 return static_cast<unsigned>(m_pickedPoints.size());
87 bool entityCenter =
false);
97 unsigned triangleIndex,
99 bool entityCenter =
false);
152 QString
prefix(
const char* pointTag)
const;
162 entityCenterPoint(false) {}
167 bool centerPoint =
false)
174 entityCenterPoint(centerPoint) {}
180 bool centerPoint =
false)
187 entityCenterPoint(centerPoint) {}
195 return m_pickedPoints[index];
199 return m_pickedPoints[index];
206 m_relMarkerScale = scale;
212 int& nearestPointIndex,
213 double& nearestSquareDist)
const;
240 sfValueIsShifted(false) {}
341 float m_screenPos[2];
344 int m_lastScreenPos[2];
float PointCoordinateType
Type of the coordinates of a (N-D) point.
int64_t CV_CLASS_ENUM
Type of object type flags (64 bits)
2D label (typically attached to points)
bool addPickedPoint(ccGenericPointCloud *cloud, unsigned pointIndex, bool entityCenter=false)
Adds a point to this label.
const PickedPoint & getPickedPoint(unsigned index) const
Returns a given point.
virtual CV_CLASS_ENUM getClassID() const override
Returns class ID.
cc2DLabel(QString name=QString("label"))
Default constructor.
QRect m_labelROI
label ROI
virtual bool acceptClick(int x, int y, Qt::MouseButton button) override
Called on mouse click.
bool m_dispIn2D
Whether to display the label in 2D.
virtual void drawMeOnly(CC_DRAW_CONTEXT &context) override
Draws the entity only (not its children)
float m_relMarkerScale
Relative marker scale.
QString getTitle(int precision) const
Returns the (3D) label title.
bool toFile_MeOnly(QFile &out, short dataVersion) const override
Save own object data.
void getLabelInfo2(LabelInfo2 &info) const
Gets two-points label info.
bool isCollapsed() const
Returns whether the label is collapsed or not.
QString getRawName() const
Returns 'raw' name (no replacement of default keywords)
void clear(bool ignoreDependencies=false, bool ignoreCaption=true)
Clears label.
short minimumFileVersion_MeOnly() const override
void setRelativeMarkerScale(float scale)
Sets marker (relative) scale.
virtual bool move2D(int x, int y, int dx, int dy, int screenWidth, int screenHeight) override
Called on mouse move (for 2D interactors)
const float * getPosition() const
Returns relative position.
PickedPoint & getPickedPoint(unsigned index)
Returns a given point.
void setCollapsed(bool state)
Whether to collapse label or not.
bool isPointLegendDisplayed() const
Returns whether the point(s) legend is displayed.
void setDisplayedIn2D(bool state)
Whether to display the label in 2D.
bool fromFile_MeOnly(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
Loads own object data.
unsigned size() const
Returns current size.
std::vector< PickedPoint > m_pickedPoints
Picked points.
virtual QString getName() const override
Returns object name.
static QString GetSFValueAsString(const LabelInfo1 &info, int precision)
Returns the SF value as a string.
void drawMeOnly2D(CC_DRAW_CONTEXT &context)
Draws the entity only (not its children) - 2D version.
bool addPickedPoint(ccGenericMesh *mesh, unsigned triangleIndex, const CCVector2d &uv, bool entityCenter=false)
Adds a point to this label.
void updateName()
Updates the label 'name'.
QStringList getLabelContent(int precision) const
Gets label content (as it will be displayed)
void getLabelInfo3(LabelInfo3 &info) const
Gets three-points label info.
void setPosition(float x, float y)
Sets relative position.
virtual void onDeletionOf(const ccHObject *obj) override
This method is called when another object is deleted.
bool m_dispPointsLegend
Whether to display the point(s) legend.
bool pointPicking(const CCVector2d &clickPos, const ccGLCameraParameters &camera, int &nearestPointIndex, double &nearestSquareDist) const
Point (marker) picking.
void update2DLabelView(CC_DRAW_CONTEXT &context, bool updateScreen=true)
void clearLabel(bool ignoreCaption=true)
void update3DLabelView(CC_DRAW_CONTEXT &context, bool updateScreen=true)
virtual bool isSerializable() const override
Returns whether object is serializable of not.
bool isDisplayedIn2D() const
Returns whether the label is displayed in 2D.
void getLabelInfo1(LabelInfo1 &info) const
Returns one-point label info.
void drawMeOnly3D(CC_DRAW_CONTEXT &context)
Draws the entity only (not its children) - 3D version.
QStringList m_historyMessage
bool m_showFullBody
Whether to show full label body or not.
bool addPickedPoint(const PickedPoint &pp)
Adds a point to this label (direct - handle with care)
void displayPointLegend(bool state)
Whether to display the point(s) legend (title only)
A 3D cloud interface with associated features (color, normals, octree, etc.)
Hierarchical CLOUDVIEWER Object.
Interactor interface (entity that can be dragged or clicked in a 3D view)
QString m_name
Object name.
QMultiMap< unsigned, unsigned > LoadedIDMap
Map of loaded unique IDs (old ID --> new ID)
ccGenericPointCloud * cloud
LabelInfo1()
Default constructor.
LabelInfo2()
Default constructor.
ccGenericPointCloud * cloud1
ccGenericPointCloud * cloud2
LabelInfo3()
Default constructor.
ccGenericPointCloud * cloud1
ccGenericPointCloud * cloud2
ccGenericPointCloud * cloud3
CCVector2d uv
Barycentric coordinates (for triangles)
CCVector3 getPointPosition() const
Returns the point position (3D)
PickedPoint()
Default constructor.
unsigned index
Point/triangle index.
QString itemTitle() const
PickedPoint(ccGenericPointCloud *_cloud, unsigned pointIndex, bool centerPoint=false)
Constructor from a point and its index.
ccGenericPointCloud * cloudOrVertices() const
Returns the cloud or the mesh vertices.
ccGenericMesh * mesh
Mesh.
ccHObject * entity() const
Returns the associated entity (cloud or mesh)
bool entityCenterPoint
Entity center mode (index will be invalid)
float markerScale
Last known marker scale.
CCVector3d pos2D
Last known '2D' position (i.e. in screen space)
ccGenericPointCloud * cloud
Cloud.
QString prefix(const char *pointTag) const
Returns the point prefix ('Point' or 'Point@Tri' or 'IDXX Center')
PickedPoint(ccGenericMesh *_mesh, unsigned triIindex, const CCVector2d &_uv, bool centerPoint=false)
Constructor from a triangle, its index and barycentric coordinates.
unsigned getUniqueID() const
Returns the cloud or the mesh unique ID.
OpenGL camera parameters.