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 };
cvConstrainedContourRepresentation::UpdateLabel
void UpdateLabel()
Update the label text and position.
Definition: cvConstrainedContourRepresentation.cpp:126
cvConstrainedContourRepresentation::SetShowLabel
void SetShowLabel(int show)
Show or hide the instance label.
Definition: cvConstrainedContourRepresentation.cpp:79
cvConstrainedContourRepresentation::cvConstrainedContourRepresentation
cvConstrainedContourRepresentation()
Definition: cvConstrainedContourRepresentation.cpp:22
vtkSmartPointer
Definition: WidgetMap.h:20
cvConstrainedContourRepresentation::SetVisibility
void SetVisibility(vtkTypeBool visible) override
Set visibility (override to control label visibility)
Definition: cvConstrainedContourRepresentation.cpp:106
vtkStandardNewMacro
vtkStandardNewMacro(cvConstrainedContourRepresentation)
cvConstrainedContourRepresentation::GetLabelSuffix
const char * GetLabelSuffix() const
Get the current label suffix.
Definition: cvConstrainedContourRepresentation.cpp:74
cvConstrainedContourRepresentation::SetRenderer
void SetRenderer(vtkRenderer *ren) override
Set the renderer (override to add label actor)
Definition: cvConstrainedContourRepresentation.cpp:90
cvConstrainedContourRepresentation::~cvConstrainedContourRepresentation
~cvConstrainedContourRepresentation() override
Definition: cvConstrainedContourRepresentation.cpp:44
cvConstrainedContourRepresentation::vtkTypeMacro
vtkTypeMacro(cvConstrainedContourRepresentation, vtkOrientedGlyphContourRepresentation)
cvConstrainedContourRepresentation::SetLabelSuffix
void SetLabelSuffix(const char *suffix)
Set the label suffix to identify this contour instance.
Definition: cvConstrainedContourRepresentation.cpp:57
cvConstrainedContourRepresentation
Extended contour representation with instance label support.
Definition: cvConstrainedContourRepresentation.h:21
cvConstrainedContourRepresentation::GetLabelActor
vtkTextActor * GetLabelActor()
Get the label actor (for property access)
Definition: cvConstrainedContourRepresentation.h:63
cvConstrainedContourRepresentation::New
static cvConstrainedContourRepresentation * New()
cvConstrainedContourRepresentation.h
cvConstrainedContourRepresentation::BuildRepresentation
void BuildRepresentation() override
Build the representation (override to update label position)
Definition: cvConstrainedContourRepresentation.cpp:117
cvConstrainedContourRepresentation::GetShowLabel
int GetShowLabel() const
Definition: cvConstrainedContourRepresentation.h:43