 |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Go to the documentation of this file.
11 #include <vtkSmartPointer.h>
25 std::string type_ =
"unknown") {
27 this->
detail.center_x = (p1[0] + p2[0]) / 2;
28 this->
detail.center_y = (p1[1] + p2[1]) / 2;
29 this->
detail.center_z = (p1[2] + p2[2]) / 2;
31 this->
detail.length = p2[0] - p1[0];
32 this->
detail.width = p2[1] - p1[1];
33 this->
detail.height = p2[2] - p1[2];
51 sprintf(buffer,
"%s %f %f %f %f %f %f %f",
type.c_str(),
data[0],
53 return std::string(buffer);
57 class vtkBalloonWidget;
64 class vtkRenderWindowInteractor;
66 class vtkPolyDataMapper;
77 Annotation(
const std::vector<int>& slice, std::string type_);
94 std::vector<int>& slice,
116 void picked(vtkRenderWindowInteractor* interactor);
133 void setType(
const std::string value);
137 const std::vector<int>&
getSlice()
const;
156 const std::vector<int>& slice);
177 std::vector<double*> anchorPoints;
179 std::vector<int> m_slice;
192 static std::vector<std::string>*
GetTypes();
215 static void ComputeOBB(
const PointCloudI::Ptr cloud,
216 std::vector<int>& slice,
224 static std::vector<std::string>*
types;
229 explicit Annotaions(vtkRenderWindowInteractor* interactor =
nullptr);
263 std::vector<Annotation*>& annotations);
void add(Annotation *anno)
Definition: Annotaion.cpp:445
double center_z
Definition: Annotaion.h:41
void colorAnnotation(int color_index=-1)
color the annotation with given color
Definition: Annotaion.cpp:123
std::string filename
Definition: PointCloudIO.cpp:47
Annotaions(vtkRenderWindowInteractor *interactor=nullptr)
Definition: Annotaion.cpp:406
void setType(const std::string value)
change the type of annotation, and color too
Definition: Annotaion.cpp:324
map< size_t, std::vector< int > > AnnotationMap
Definition: Annotaion.cpp:516
normal_z x
Definition: my_point_types.h:165
void clear()
Definition: Annotaion.cpp:469
const float Pi
Definition: utils.cpp:15
double yaw
Definition: Annotaion.h:45
void remove(Annotation *anno)
Definition: Annotaion.cpp:458
std::vector< Annotation * > m_annotations
keep all annotation from current cloud
Definition: Annotaion.h:281
double center_y
Definition: Annotaion.h:40
void applyTransform(vtkSmartPointer< vtkTransform > t)
apply transform to annotation
Definition: Annotaion.cpp:231
Definition: Annotaion.h:227
static bool Print(const char *format,...)
Prints out a formatted message in console.
Definition: CVLog.cpp:113
BoxLabel(const double p1[3], const double p2[3], std::string type_="unknown")
Definition: Annotaion.h:23
double length
Definition: Annotaion.h:42
void initial()
Definition: Annotaion.cpp:112
long color_index
Definition: FileIOFactory.cpp:51
double center_x
Definition: Annotaion.h:39
double data[7]
Definition: Annotaion.h:37
void preserve(size_t num=0)
Definition: Annotaion.cpp:420
Type r
Definition: ecvColorTypes.h:54
static std::vector< std::string > * types
types all annotation type here
Definition: Annotaion.h:224
Definition: Annotaion.h:15
void release()
Definition: Annotaion.cpp:428
void updateLabels(Annotation *anno, bool resetFlag=false)
Definition: Annotaion.cpp:482
void updateBalloonByAnno(Annotation *anno)
Definition: Annotaion.cpp:717
static bool Error(const char *format,...)
Display an error dialog with formatted message.
Definition: CVLog.cpp:143
std::string type
Definition: Annotaion.h:35
Definition: vtkAnnotationBoxSource.h:14
normal_z y
Definition: my_point_types.h:168
Rgb at(size_t color_id)
Definition: ecvColorTypes.cpp:77
BoxLabel getBoxLabel()
getBoxLabel get boxLabel from annotaion tranformation
Definition: Annotaion.cpp:215
std::string toString()
Definition: Annotaion.h:49
std::vector< Annotation * > & getAnnotations()
Definition: Annotaion.cpp:667
~Annotation()
Definition: Annotaion.cpp:104
int * m_labeledCloudIndex
Definition: Annotaion.h:286
vtkSmartPointer< vtkActor > getActor() const
Definition: Annotaion.cpp:333
struct BoxLabel::@52::@54 detail
static std::size_t GetTypeIndex(std::string type_)
GetTypeIndex auto add to vector map if has not.
Definition: Annotaion.cpp:362
int getLabelByIndex(std::size_t index)
Definition: Annotaion.h:267
Type g
Definition: ecvColorTypes.h:54
void saveAnnotations(std::string filename, int mode)
save annotations to file
Definition: Annotaion.cpp:577
const std::vector< int > & getSlice() const
Definition: Annotaion.cpp:322
double computeScaleAndCenterShift(double o[3], double scs[2])
computeScaleAndCenterShift
Definition: Annotaion.cpp:335
a[190]
Definition: essential_matrix_poly.h:19
CLOUDVIEWER_HOST_DEVICE float Cross(const Point &a, const Point &b)
Definition: IoUImpl.h:39
std::size_t getSize()
Definition: Annotaion.cpp:480
static std::string GetTypeByIndex(size_t index)
GetTypeByIndex auto add to vector map if has not.
Definition: Annotaion.cpp:372
Type b
Definition: ecvColorTypes.h:54
void adjustToAnchor()
keep current orientation, re-compute the center and scale to make annotation fit to selected point we...
Definition: Annotaion.cpp:283
Annotation(const std::vector< int > &slice, std::string type_)
Annotation construct from slice which load from label file.
Definition: Annotaion.cpp:43
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
Definition: CVLog.cpp:133
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.
Definition: Annotaion.cpp:381
double height
Definition: Annotaion.h:44
RGB color structure.
Definition: ecvColorTypes.h:49
Annotation * getAnnotation(vtkActor *actor)
from annotatin box actor to find annotation itself
Definition: Annotaion.cpp:669
void loadAnnotations(std::string filename, int mode)
load annotations from file
Definition: Annotaion.cpp:518
static std::vector< std::string > * GetTypes()
get types vector pointer
Definition: Annotaion.cpp:354
size_t m_capacity
Definition: Annotaion.h:287
normal_z z
Definition: my_point_types.h:165
vtkRenderWindowInteractor * m_interactor
Definition: Annotaion.h:283
void unpicked()
disable boxWidget
Definition: Annotaion.cpp:277
void updateBalloonByIndex(std::size_t index)
Definition: Annotaion.cpp:705
Definition: Annotaion.h:68
int getAnnotationIndex(Annotation *anno)
Definition: Annotaion.cpp:678
void setAnchorPoint(const PointCloudI::Ptr cloud, const std::vector< int > &slice)
copy selected points as anchor to current annotation
Definition: Annotaion.cpp:167
std::string to_string(const T &n)
Definition: Common.h:20
void picked(vtkRenderWindowInteractor *interactor)
enter picked state, show boxwidget which allow to adjust annotation
Definition: Annotaion.cpp:240
std::string getType() const
Definition: Annotaion.cpp:320
char type
Definition: FileIOFactory.cpp:131
vtkSmartPointer< vtkBalloonWidget > m_balloonWidget
Definition: Annotaion.h:284
double width
Definition: Annotaion.h:43
BoxLabel()
Definition: Annotaion.h:16