40 const std::vector<Eigen::Vector2i> &lines,
41 const char *
name =
"LineSet")
61 inline virtual bool IsEmpty()
const override {
return !HasPoints(); }
69 bool relative =
true)
override;
71 const Eigen::Vector3d ¢er)
override;
73 const Eigen::Vector3d ¢er)
override;
79 bool HasPoints()
const {
return points_.size() > 0; }
82 bool HasLines()
const {
return HasPoints() && lines_.size() > 0; }
86 return HasLines() && colors_.size() == lines_.size();
93 size_t line_index)
const {
95 points_[lines_[line_index][1]]);
102 ResizeAndPaintUniformColor(colors_, lines_.size(),
color);
115 const std::vector<std::pair<int, int>> &correspondences);
150 const Eigen::Matrix3d &intrinsic,
151 const Eigen::Matrix4d &extrinsic,
int64_t CV_CLASS_ENUM
Type of object type flags (64 bits)
Hierarchical CLOUDVIEWER Object.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
LineSet define a sets of lines in 3D. A typical application is to display the point cloud corresponde...
bool HasColors() const
Returns true if the objects lines contains colors.
virtual LineSet & Rotate(const Eigen::Matrix3d &R, const Eigen::Vector3d ¢er) override
Apply rotation to the geometry coordinates and normals. Given a rotation matrix , and center ,...
LineSet & operator+=(const LineSet &lineset)
virtual Eigen::Vector3d GetCenter() const override
Returns the center of the geometry coordinates.
std::pair< Eigen::Vector3d, Eigen::Vector3d > GetLineCoordinate(size_t line_index) const
Returns the coordinates of the line at the given index.
virtual bool IsEmpty() const override
virtual ccBBox GetAxisAlignedBoundingBox() const override
Returns an axis-aligned bounding box of the geometry.
static std::shared_ptr< LineSet > CreateFromTetraMesh(const TetraMesh &mesh)
virtual bool isSerializable() const override
Returns whether object is serializable of not.
virtual Eigen::Vector3d GetMinBound() const override
Returns min bounds for geometry coordinates.
static std::shared_ptr< LineSet > CreateCameraVisualization(int view_width_px, int view_height_px, const Eigen::Matrix3d &intrinsic, const Eigen::Matrix4d &extrinsic, double scale=1.0)
std::vector< Eigen::Vector3d > points_
Points coordinates.
std::vector< Eigen::Vector3d > colors_
RGB colors of lines.
virtual LineSet & Translate(const Eigen::Vector3d &translation, bool relative=true) override
Apply translation to the geometry coordinates.
LineSet(const char *name="LineSet")
Default Constructor.
virtual ccBBox getOwnBB(bool withGLFeatures=false) override
Returns the entity's own bounding-box.
bool HasLines() const
Returns true if the object contains lines.
virtual LineSet & Scale(const double s, const Eigen::Vector3d ¢er) override
Apply scaling to the geometry coordinates. Given a scaling factor , and center , a given point is tr...
virtual CV_CLASS_ENUM getClassID() const override
Returns unique class ID.
LineSet operator+(const LineSet &lineset) const
std::vector< Eigen::Vector2i > lines_
Lines denoted by the index of points forming the line.
virtual ecvOrientedBBox GetOrientedBoundingBox() const override
LineSet(const std::vector< Eigen::Vector3d > &points, const std::vector< Eigen::Vector2i > &lines, const char *name="LineSet")
Parameterized Constructor.
virtual LineSet & Transform(const Eigen::Matrix4d &transformation) override
Apply transformation (4x4 matrix) to the geometry coordinates.
static std::shared_ptr< LineSet > CreateFromOrientedBoundingBox(const ecvOrientedBBox &box)
Factory function to create a LineSet from an OrientedBoundingBox.
static std::shared_ptr< LineSet > CreateFromPointCloudCorrespondences(const ccPointCloud &cloud0, const ccPointCloud &cloud1, const std::vector< std::pair< int, int >> &correspondences)
Factory function to create a LineSet from two PointClouds (cloud0, cloud1) and a correspondence set.
static std::shared_ptr< LineSet > CreateFromTriangleMesh(const ccMesh &mesh)
static std::shared_ptr< LineSet > CreateFromAxisAlignedBoundingBox(const ccBBox &box)
Factory function to create a LineSet from an ccBBox.
LineSet & PaintUniformColor(const Eigen::Vector3d &color)
Assigns each line in the LineSet the same color.
virtual Eigen::Vector3d GetMaxBound() const override
Returns max bounds for geometry coordinates.
virtual void drawMeOnly(CC_DRAW_CONTEXT &context) override
Draws the entity only (not its children)
bool HasPoints() const
Returns true if the object contains points.
Tetra mesh contains vertices and tetrahedra represented by the indices to the vertices.
CLOUDVIEWER_HOST_DEVICE Pair< First, Second > make_pair(const First &_first, const Second &_second)
Generic file read and write utility for python interface.