83 const Eigen::Vector3d ¢er) {
89 if (lineset.
IsEmpty())
return (*
this);
90 size_t old_point_num =
points_.size();
91 size_t add_point_num = lineset.
points_.size();
92 size_t new_point_num = old_point_num + add_point_num;
93 size_t old_line_num =
lines_.size();
94 size_t add_line_num = lineset.
lines_.size();
95 size_t new_line_num = old_line_num + add_line_num;
99 for (
size_t i = 0; i < add_line_num; i++) {
106 for (
size_t i = 0; i < add_point_num; i++) {
109 lines_.resize(new_line_num);
110 for (
size_t i = 0; i < add_line_num; i++) {
111 lines_[old_line_num + i] =
113 lineset.
lines_[i](1) + (
int)old_point_num);
119 return (
LineSet(*
this) += lineset);
static ccBBox CreateFromPoints(const std::vector< CCVector3 > &points)
virtual bool isColorOverridden() const
virtual const ecvColor::Rgb & getTempColor() const
Returns current temporary (unique) color.
static Eigen::Vector3d ComputeMinBound(const std::vector< Eigen::Vector3d > &points)
Compute min bound of a list points.
static Eigen::Vector3d ComputeCenter(const std::vector< Eigen::Vector3d > &points)
Computer center of a list of points.
static void TranslatePoints(const Eigen::Vector3d &translation, std::vector< Eigen::Vector3d > &points, bool relative)
Apply translation to the geometry coordinates.
static void RotatePoints(const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &points, const Eigen::Vector3d ¢er)
Rotate all points with the rotation matrix R.
static void TransformPoints(const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &points)
Transforms all points with the transformation matrix.
static void ScalePoints(const double scale, std::vector< Eigen::Vector3d > &points, const Eigen::Vector3d ¢er)
Scale the coordinates of all points by the scaling factor scale.
static Eigen::Vector3d ComputeMaxBound(const std::vector< Eigen::Vector3d > &points)
Compute max bound of a list points.
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 void drawMeOnly(CC_DRAW_CONTEXT &context) override
Draws the entity only (not its children)
virtual bool IsEmpty() const override
LineSet & operator+=(const LineSet &lineset)
virtual ecvOrientedBBox GetOrientedBoundingBox() const override
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 ,...
std::vector< Eigen::Vector3d > points_
Points coordinates.
std::vector< Eigen::Vector3d > colors_
RGB colors of lines.
LineSet(const char *name="LineSet")
Default Constructor.
bool HasLines() const
Returns true if the object contains lines.
virtual Eigen::Vector3d GetCenter() const override
Returns the center of the geometry coordinates.
LineSet operator+(const LineSet &lineset) const
std::vector< Eigen::Vector2i > lines_
Lines denoted by the index of points forming the line.
virtual Eigen::Vector3d GetMaxBound() const override
Returns max bounds for geometry coordinates.
virtual ccBBox getOwnBB(bool withGLFeatures=false) override
Returns the entity's own bounding-box.
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 LineSet & Translate(const Eigen::Vector3d &translation, bool relative=true) override
Apply translation to the geometry coordinates.
virtual LineSet & Transform(const Eigen::Matrix4d &transformation) override
Apply transformation (4x4 matrix) to the geometry coordinates.
virtual ccBBox GetAxisAlignedBoundingBox() const override
Returns an axis-aligned bounding box of the geometry.
bool HasPoints() const
Returns true if the object contains points.
virtual Eigen::Vector3d GetMinBound() const override
Returns min bounds for geometry coordinates.
static ecvOrientedBBox CreateFromPoints(const std::vector< Eigen::Vector3d > &points)
#define MACRO_Draw3D(context)
Generic file read and write utility for python interface.
Eigen::Matrix< Index, 2, 1 > Vector2i