ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cvConstrainedContourRepresentation.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <vtkOrientedGlyphContourRepresentation.h>
11 #include <vtkSmartPointer.h>
12 #include <vtkTextActor.h> // Full include required for vtkSmartPointer template instantiation
13 
22  : public vtkOrientedGlyphContourRepresentation {
23 public:
26  vtkOrientedGlyphContourRepresentation);
27 
32  void SetLabelSuffix(const char* suffix);
33 
37  const char* GetLabelSuffix() const;
38 
42  void SetShowLabel(int show);
43  int GetShowLabel() const { return this->ShowLabel; }
44 
48  void BuildRepresentation() override;
49 
53  void SetRenderer(vtkRenderer* ren) override;
54 
58  void SetVisibility(vtkTypeBool visible) override;
59 
63  vtkTextActor* GetLabelActor() { return this->LabelActor; }
64 
65 protected:
68 
72  void UpdateLabel();
73 
74 private:
76  const cvConstrainedContourRepresentation&) = delete;
77  void operator=(const cvConstrainedContourRepresentation&) = delete;
78 
80  char* LabelSuffix;
81  int ShowLabel;
82 };
Extended contour representation with instance label support.
const char * GetLabelSuffix() const
Get the current label suffix.
void SetShowLabel(int show)
Show or hide the instance label.
vtkTextActor * GetLabelActor()
Get the label actor (for property access)
vtkTypeMacro(cvConstrainedContourRepresentation, vtkOrientedGlyphContourRepresentation)
void SetRenderer(vtkRenderer *ren) override
Set the renderer (override to add label actor)
void UpdateLabel()
Update the label text and position.
void SetLabelSuffix(const char *suffix)
Set the label suffix to identify this contour instance.
void BuildRepresentation() override
Build the representation (override to update label position)
void SetVisibility(vtkTypeBool visible) override
Set visibility (override to control label visibility)
static cvConstrainedContourRepresentation * New()