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

#include <Annotaion.h>

Public Member Functions

 Annotation (const std::vector< int > &slice, std::string type_)
 Annotation construct from slice which load from label file. More...
 
 Annotation (const BoxLabel &label, bool visible_=true, bool lock_=false)
 Annotation construct from boxlabel which load from label file. More...
 
 Annotation (const PointCloudI::Ptr cloud, std::vector< int > &slice, std::string type_)
 Annotation construct from part of cloud points. More...
 
 ~Annotation ()
 
BoxLabel getBoxLabel ()
 getBoxLabel get boxLabel from annotaion tranformation More...
 
void applyTransform (vtkSmartPointer< vtkTransform > t)
 apply transform to annotation More...
 
void picked (vtkRenderWindowInteractor *interactor)
 enter picked state, show boxwidget which allow to adjust annotation More...
 
void unpicked ()
 disable boxWidget More...
 
void adjustToAnchor ()
 keep current orientation, re-compute the center and scale to make annotation fit to selected point well enough More...
 
void setType (const std::string value)
 change the type of annotation, and color too More...
 
vtkSmartPointer< vtkActor > getActor () const
 
std::string getType () const
 
const std::vector< int > & getSlice () const
 

Static Public Member Functions

static std::vector< std::string > * GetTypes ()
 get types vector pointer More...
 
static std::size_t GetTypeIndex (std::string type_)
 GetTypeIndex auto add to vector map if has not. More...
 
static std::string GetTypeByIndex (size_t index)
 GetTypeByIndex auto add to vector map if has not. More...
 
static void ComputeOBB (const PointCloudI::Ptr cloud, std::vector< int > &slice, double p1[3], double p2[3])
 ComputeOBB compute max,min [x,y,z] aligned to xyz axis. More...
 

Protected Member Functions

void initial ()
 
void colorAnnotation (int color_index=-1)
 color the annotation with given color More...
 
void setAnchorPoint (const PointCloudI::Ptr cloud, const std::vector< int > &slice)
 copy selected points as anchor to current annotation More...
 
double computeScaleAndCenterShift (double o[3], double scs[2])
 computeScaleAndCenterShift More...
 

Static Protected Attributes

static std::vector< std::string > * types = nullptr
 types all annotation type here More...
 

Detailed Description

Definition at line 68 of file Annotaion.h.

Constructor & Destructor Documentation

◆ Annotation() [1/3]

Annotation::Annotation ( const std::vector< int > &  slice,
std::string  type_ 
)

Annotation construct from slice which load from label file.

Parameters
slice
type_

Definition at line 43 of file Annotaion.cpp.

References type.

◆ Annotation() [2/3]

Annotation::Annotation ( const BoxLabel label,
bool  visible_ = true,
bool  lock_ = false 
)

Annotation construct from boxlabel which load from label file.

Parameters
label
visible_
lock_

Definition at line 52 of file Annotaion.cpp.

References applyTransform(), BoxLabel::detail, initial(), Pi, and BoxLabel::type.

◆ Annotation() [3/3]

Annotation::Annotation ( const PointCloudI::Ptr  cloud,
std::vector< int > &  slice,
std::string  type_ 
)

Annotation construct from part of cloud points.

Parameters
cloud
slice
type_

Definition at line 73 of file Annotaion.cpp.

References applyTransform(), ComputeOBB(), BoxLabel::detail, initial(), Pi, and setAnchorPoint().

◆ ~Annotation()

Annotation::~Annotation ( )

Definition at line 104 of file Annotaion.cpp.

Member Function Documentation

◆ adjustToAnchor()

void Annotation::adjustToAnchor ( )

keep current orientation, re-compute the center and scale to make annotation fit to selected point well enough

Definition at line 283 of file Annotaion.cpp.

References applyTransform(), computeScaleAndCenterShift(), cloudViewer::ml::contrib::Cross(), x, y, and z.

Referenced by vtkBoxWidgetCallback1::Execute().

◆ applyTransform()

void Annotation::applyTransform ( vtkSmartPointer< vtkTransform >  t)

apply transform to annotation

Parameters
t

Definition at line 231 of file Annotaion.cpp.

Referenced by adjustToAnchor(), Annotation(), and vtkBoxWidgetCallback0::Execute().

◆ colorAnnotation()

void Annotation::colorAnnotation ( int  color_index = -1)
protected

color the annotation with given color

Parameters
color_indexif color_index>=0,refer to pcl::GlasbeyLUT otherwise use color already mapped by type

Definition at line 123 of file Annotaion.cpp.

References ecvColor::LookUpTable::at(), ecvColor::RgbTpl< Type >::b, color_index, ecvColor::RgbTpl< Type >::g, GetTypeIndex(), and ecvColor::RgbTpl< Type >::r.

Referenced by initial(), and setType().

◆ ComputeOBB()

void Annotation::ComputeOBB ( const PointCloudI::Ptr  cloud,
std::vector< int > &  slice,
double  p1[3],
double  p2[3] 
)
static

ComputeOBB compute max,min [x,y,z] aligned to xyz axis.

Parameters
cloud
slice
p1min [x,y,z]
p2max [x,y,z]

Definition at line 381 of file Annotaion.cpp.

Referenced by Annotation().

◆ computeScaleAndCenterShift()

double Annotation::computeScaleAndCenterShift ( double  o[3],
double  scs[2] 
)
protected

computeScaleAndCenterShift

Parameters
odirection
scs["scale", "center shift"]
Returns
scale

Definition at line 335 of file Annotaion.cpp.

References a, and x.

Referenced by adjustToAnchor().

◆ getActor()

vtkSmartPointer< vtkActor > Annotation::getActor ( ) const

◆ getBoxLabel()

BoxLabel Annotation::getBoxLabel ( )

getBoxLabel get boxLabel from annotaion tranformation

Returns

Definition at line 215 of file Annotaion.cpp.

References BoxLabel::data, BoxLabel::detail, Pi, and BoxLabel::type.

◆ getSlice()

const std::vector< int > & Annotation::getSlice ( ) const

◆ getType()

std::string Annotation::getType ( ) const

◆ GetTypeByIndex()

std::string Annotation::GetTypeByIndex ( size_t  index)
static

GetTypeByIndex auto add to vector map if has not.

Parameters
index
Returns

Definition at line 372 of file Annotaion.cpp.

References types.

Referenced by Annotaions::loadAnnotations().

◆ GetTypeIndex()

std::size_t Annotation::GetTypeIndex ( std::string  type_)
static

GetTypeIndex auto add to vector map if has not.

Parameters
type_
Returns

Definition at line 362 of file Annotaion.cpp.

References types.

Referenced by colorAnnotation(), PclAnnotationTool::initAnnotationLabels(), and Annotaions::updateLabels().

◆ GetTypes()

std::vector< std::string > * Annotation::GetTypes ( )
static

get types vector pointer

Returns

Definition at line 354 of file Annotaion.cpp.

References types.

Referenced by PclAnnotationTool::getAnnotationLabels(), PclAnnotationTool::initAnnotationLabels(), and Annotaions::release().

◆ initial()

void Annotation::initial ( )
protected

Definition at line 112 of file Annotaion.cpp.

References colorAnnotation().

Referenced by Annotation().

◆ picked()

void Annotation::picked ( vtkRenderWindowInteractor *  interactor)

enter picked state, show boxwidget which allow to adjust annotation

Parameters
interactor

Definition at line 240 of file Annotaion.cpp.

Referenced by PclAnnotationTool::pickedEventProcess().

◆ setAnchorPoint()

void Annotation::setAnchorPoint ( const PointCloudI::Ptr  cloud,
const std::vector< int > &  slice 
)
protected

copy selected points as anchor to current annotation

Parameters
cloud
slice

Definition at line 167 of file Annotaion.cpp.

Referenced by Annotation().

◆ setType()

void Annotation::setType ( const std::string  value)

change the type of annotation, and color too

Parameters
value

Definition at line 324 of file Annotaion.cpp.

References colorAnnotation().

◆ unpicked()

void Annotation::unpicked ( )

disable boxWidget

Definition at line 277 of file Annotaion.cpp.

Referenced by PclAnnotationTool::pickedEventProcess().

Member Data Documentation

◆ types

std::vector< std::string > * Annotation::types = nullptr
staticprotected

types all annotation type here

Definition at line 224 of file Annotaion.h.

Referenced by GetTypeByIndex(), GetTypeIndex(), GetTypes(), and Annotaions::release().


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