ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
Annotaions Class Reference

#include <Annotaion.h>

Collaboration diagram for Annotaions:

Public Member Functions

 Annotaions (vtkRenderWindowInteractor *interactor=nullptr)
 
void preserve (size_t num=0)
 
void release ()
 
void add (Annotation *anno)
 
void remove (Annotation *anno)
 
void clear ()
 
std::size_t getSize ()
 
void updateLabels (Annotation *anno, bool resetFlag=false)
 
void loadAnnotations (std::string filename, int mode)
 load annotations from file More...
 
void saveAnnotations (std::string filename, int mode)
 save annotations to file More...
 
bool getAnnotations (std::vector< int > &annos) const
 
AnnotationgetAnnotation (vtkActor *actor)
 from annotatin box actor to find annotation itself More...
 
AnnotationgetAnnotation (std::size_t index)
 
void getAnnotations (const std::string &type, std::vector< Annotation * > &annotations)
 
int getAnnotationIndex (Annotation *anno)
 
std::vector< Annotation * > & getAnnotations ()
 
int getLabelByIndex (std::size_t index)
 
void updateBalloonByIndex (std::size_t index)
 
void updateBalloonByAnno (Annotation *anno)
 

Protected Attributes

std::vector< Annotation * > m_annotations
 keep all annotation from current cloud More...
 
vtkRenderWindowInteractor * m_interactor
 
vtkSmartPointer< vtkBalloonWidget > m_balloonWidget
 
int * m_labeledCloudIndex = nullptr
 
size_t m_capacity = 0
 

Detailed Description

Definition at line 227 of file Annotaion.h.

Constructor & Destructor Documentation

◆ Annotaions()

Annotaions::Annotaions ( vtkRenderWindowInteractor *  interactor = nullptr)
explicit

Definition at line 406 of file Annotaion.cpp.

References m_balloonWidget.

Member Function Documentation

◆ add()

void Annotaions::add ( Annotation anno)

◆ clear()

void Annotaions::clear ( )

Definition at line 469 of file Annotaion.cpp.

References m_annotations, m_balloonWidget, and preserve().

◆ getAnnotation() [1/2]

Annotation * Annotaions::getAnnotation ( std::size_t  index)

Definition at line 691 of file Annotaion.cpp.

References getSize(), and m_annotations.

◆ getAnnotation() [2/2]

Annotation * Annotaions::getAnnotation ( vtkActor *  actor)

from annotatin box actor to find annotation itself

Parameters
actor
Returns

Definition at line 669 of file Annotaion.cpp.

References m_annotations.

Referenced by updateBalloonByIndex().

◆ getAnnotationIndex()

int Annotaions::getAnnotationIndex ( Annotation anno)

Definition at line 678 of file Annotaion.cpp.

References Annotation::getActor(), and m_annotations.

Referenced by updateBalloonByAnno().

◆ getAnnotations() [1/3]

std::vector< Annotation * > & Annotaions::getAnnotations ( )

Definition at line 667 of file Annotaion.cpp.

References m_annotations.

◆ getAnnotations() [2/3]

void Annotaions::getAnnotations ( const std::string &  type,
std::vector< Annotation * > &  annotations 
)

Definition at line 696 of file Annotaion.cpp.

References m_annotations, and type.

◆ getAnnotations() [3/3]

bool Annotaions::getAnnotations ( std::vector< int > &  annos) const

Definition at line 658 of file Annotaion.cpp.

References m_capacity, and m_labeledCloudIndex.

◆ getLabelByIndex()

int Annotaions::getLabelByIndex ( std::size_t  index)
inline

Definition at line 267 of file Annotaion.h.

References m_capacity, and m_labeledCloudIndex.

◆ getSize()

std::size_t Annotaions::getSize ( )

Definition at line 480 of file Annotaion.cpp.

References m_annotations.

Referenced by getAnnotation(), and updateBalloonByIndex().

◆ loadAnnotations()

void Annotaions::loadAnnotations ( std::string  filename,
int  mode 
)

◆ preserve()

void Annotaions::preserve ( size_t  num = 0)

Definition at line 420 of file Annotaion.cpp.

References m_capacity, and m_labeledCloudIndex.

Referenced by clear().

◆ release()

void Annotaions::release ( )

◆ remove()

void Annotaions::remove ( Annotation anno)

Definition at line 458 of file Annotaion.cpp.

References Annotation::getActor(), m_annotations, m_balloonWidget, and updateLabels().

◆ saveAnnotations()

void Annotaions::saveAnnotations ( std::string  filename,
int  mode 
)

◆ updateBalloonByAnno()

void Annotaions::updateBalloonByAnno ( Annotation anno)

◆ updateBalloonByIndex()

void Annotaions::updateBalloonByIndex ( std::size_t  index)

Definition at line 705 of file Annotaion.cpp.

References getAnnotation(), getSize(), and m_balloonWidget.

Referenced by updateBalloonByAnno().

◆ updateLabels()

void Annotaions::updateLabels ( Annotation anno,
bool  resetFlag = false 
)

Member Data Documentation

◆ m_annotations

std::vector<Annotation*> Annotaions::m_annotations
protected

keep all annotation from current cloud

Definition at line 281 of file Annotaion.h.

Referenced by add(), clear(), getAnnotation(), getAnnotationIndex(), getAnnotations(), getSize(), loadAnnotations(), remove(), and saveAnnotations().

◆ m_balloonWidget

vtkSmartPointer<vtkBalloonWidget> Annotaions::m_balloonWidget
protected

◆ m_capacity

size_t Annotaions::m_capacity = 0
protected

◆ m_interactor

vtkRenderWindowInteractor* Annotaions::m_interactor
protected

Definition at line 283 of file Annotaion.h.

◆ m_labeledCloudIndex

int* Annotaions::m_labeledCloudIndex = nullptr
protected

The documentation for this class was generated from the following files: