Measure.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2010-2025, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of the Universite de Sherbrooke nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #ifndef MEASURE_H_
29 #define MEASURE_H_
30 
31 #include <opencv2/opencv.hpp>
32 
33 class Measure
34 {
35 public:
37  const cv::Point3f & pt1,
38  const cv::Point3f & pt2,
39  const cv::Vec3f & n1,
40  const cv::Vec3f & n2) :
41  pt1_(pt1),
42  pt2_(pt2),
43  n1_(n1),
44  n2_(n2)
45  {
46  length_ = cv::norm(pt2_ - pt1_);
47  }
48  virtual ~Measure() {}
49 
50  float length() const {return length_;}
51  const cv::Point3f & pt1() const {return pt1_;}
52  const cv::Point3f & pt2() const {return pt2_;}
53  const cv::Vec3f & n1() const {return n1_;}
54  const cv::Vec3f & n2() const {return n2_;}
55 
56 private:
57  cv::Point3f pt1_;
58  cv::Point3f pt2_;
59  cv::Vec3f n1_;
60  cv::Vec3f n2_;
61  float length_;
62 };
63 
64 
65 #endif /* MEASURE_H_ */
Measure::pt1
const cv::Point3f & pt1() const
Definition: Measure.h:51
Measure::length
float length() const
Definition: Measure.h:50
Measure::pt2
const cv::Point3f & pt2() const
Definition: Measure.h:52
Measure::pt1_
cv::Point3f pt1_
Definition: Measure.h:57
Measure::n2
const cv::Vec3f & n2() const
Definition: Measure.h:54
Measure::~Measure
virtual ~Measure()
Definition: Measure.h:48
Measure::pt2_
cv::Point3f pt2_
Definition: Measure.h:58
Measure::length_
float length_
Definition: Measure.h:61
Measure::n1_
cv::Vec3f n1_
Definition: Measure.h:59
Measure::n2_
cv::Vec3f n2_
Definition: Measure.h:60
Measure
Definition: Measure.h:33
Measure::Measure
Measure(const cv::Point3f &pt1, const cv::Point3f &pt2, const cv::Vec3f &n1, const cv::Vec3f &n2)
Definition: Measure.h:36
Measure::n1
const cv::Vec3f & n1() const
Definition: Measure.h:53


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Apr 28 2025 02:45:57