29 explicit ccPolyline(GenericIndexedCloudPersist* associatedCloud);
63 inline bool is2DMode()
const {
return m_mode2D; }
116 std::vector<ccPolyline*>& parts);
160 double samplingParameter,
169 unsigned iterationCount)
const;
186 unsigned resolution = 48);
195 const Eigen::Matrix4d& transformation)
override;
197 bool relative =
true)
override;
199 const Eigen::Vector3d& center)
override;
201 const Eigen::Vector3d& center)
override;
float PointCoordinateType
Type of the coordinates of a (N-D) point.
int64_t CV_CLASS_ENUM
Type of object type flags (64 bits)
virtual void enableTempColor(bool state)
Set temporary color activation state.
Float version of ccGLMatrixTpl.
A 3D cloud interface with associated features (color, normals, octree, etc.)
virtual void drawBB(CC_DRAW_CONTEXT &context, const ecvColor::Rgb &col)
Draws the entity (and its children) bounding-box.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
ccPolyline operator+(const ccPolyline &polyline) const
void setTransformFlag(bool state)
Defines if the polyline is considered as processed polyline.
ccPolyline & PaintUniformColor(const Eigen::Vector3d &color)
Assigns each line in the LineSet the same color.
PointCoordinateType computeLength() const
Computes the polyline length.
short minimumFileVersion_MeOnly() const override
PointCoordinateType getArrowLength() const
void setForeground(bool state)
Defines if the polyline is drawn in background or foreground.
bool m_needTransform
Whether polyline should be considered as processed polyline.
virtual void setGlobalShift(const CCVector3d &shift) override
Sets shift applied to original coordinates (information storage only)
virtual ~ccPolyline() override=default
Destructor.
virtual Eigen::Vector3d GetMaxBound() const override
Returns max bounds for geometry coordinates.
bool toFile_MeOnly(QFile &out, short dataVersion) const override
Save own object data.
bool fromFile_MeOnly(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
Loads own object data.
virtual ccPolyline & Translate(const Eigen::Vector3d &translation, bool relative=true) override
Apply translation to the geometry coordinates.
bool verticesShown() const
Whether the polyline vertices should be displayed or not.
virtual ccPolyline & Transform(const Eigen::Matrix4d &transformation) override
Apply transformation (4x4 matrix) to the geometry coordinates.
unsigned m_arrowIndex
Arrow index.
virtual Eigen::Vector3d GetCenter() const override
Returns the center of the geometry coordinates.
bool createNewPolylinesFromSelection(std::vector< ccPolyline * > &output)
Creates a polyline mesh with the selected vertices only.
void set2DMode(bool state)
Defines if the polyline is considered as 2D or 3D.
ccPolyline & operator=(const ccPolyline &polyline)
PointCoordinateType m_width
Width of the line.
bool needTransform() const
Returns whether the polyline is considered as 2D or 3D.
ccPointCloud * samplePoints(bool densityBased, double samplingParameter, bool withRGB)
Samples points on the polyline.
static QString MetaKeyPrefixDirection()
static QString MetaKeyUpDir()
bool is2DMode() const
Returns whether the polyline is considered as 2D or 3D.
bool m_showArrow
Whether to show an arrow or not.
ecvColor::Rgb m_rgbColor
Unique RGB color.
ccPolyline(const ccPolyline &poly)
Copy constructor.
ccPolyline * smoothChaikin(PointCoordinateType ratio, unsigned iterationCount) const
Smoothes the polyline (Chaikin algorithm)
void showArrow(bool state, unsigned vertIndex, PointCoordinateType length)
Shows an arrow in place of a given vertex.
static bool IsCloudVerticesOfPolyline(ccGenericPointCloud *cloud, ccPolyline **polyline=nullptr)
Helper to determine if the input cloud acts as vertices of a polyline.
virtual void drawMeOnly(CC_DRAW_CONTEXT &context) override
Draws the entity only (not its children)
virtual Eigen::Vector3d GetMinBound() const override
Returns min bounds for geometry coordinates.
const ecvColor::Rgb & getColor() const
Returns the polyline color.
virtual ccPolyline & 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...
ccPolyline(GenericIndexedCloudPersist *associatedCloud)
Default constructor.
void setVertexMarkerWidth(int width)
Sets the width of vertex markers.
void importParametersFrom(const ccPolyline &poly)
Copy the parameters from another polyline.
unsigned getArrowIndex() const
virtual ccBBox getOwnBB(bool withGLFeatures=false) override
Returns the entity's own bounding-box.
virtual ccPolyline & Rotate(const Eigen::Matrix3d &R, const Eigen::Vector3d ¢er) override
Apply rotation to the geometry coordinates and normals. Given a rotation matrix , and center ,...
virtual CV_CLASS_ENUM getClassID() const override
Returns class ID.
virtual bool isSerializable() const override
Returns whether object is serializable of not.
static QString MetaKeyConstAltitude()
Meta data key: contour plot constant altitude (for contour plots, etc.)
static QString MetaKeyAbscissa()
Meta data key: profile abscissa along generatrix.
void showVertices(bool state)
Sets whether to display or hide the polyline vertices.
bool add(const ccPointCloud &cloud)
Add another reference cloud.
static QString MetaKeyPrefixCenter()
unsigned segmentCount() const
Returns the number of segments.
virtual ecvOrientedBBox GetOrientedBoundingBox() const override
virtual bool IsEmpty() const override
PointCoordinateType m_arrowLength
Arrow length.
int m_vertMarkWidth
Vertex marker width.
bool m_showVertices
Whether vertices should be displayed or not.
virtual bool hasColors() const override
Returns whether colors are enabled or not.
PointCoordinateType getWidth() const
Returns the width of the line.
bool initWith(ccPointCloud *vertices, const ccPolyline &poly)
virtual ccBBox GetAxisAlignedBoundingBox() const override
Returns an axis-aligned bounding box of the geometry.
virtual void applyGLTransformation(const ccGLMatrix &trans) override
Applies a GL transformation to the entity.
ccPolyline(ccPointCloud &associatedCloud)
int getVertexMarkerWidth() const
Returns the width of vertex markers.
bool m_mode2D
Whether polyline should be considered as 2D (true) or 3D (false)
ccPolyline & operator+=(const ccPolyline &polyline)
bool split(PointCoordinateType maxEdgeLength, std::vector< ccPolyline * > &parts)
Splits the polyline into several parts based on a maximum edge length.
virtual void drawBB(CC_DRAW_CONTEXT &context, const ecvColor::Rgb &col) override
Draws the entity (and its children) bounding-box.
virtual void setGlobalScale(double scale) override
static ccPolyline * Circle(const CCVector3 ¢er, PointCoordinateType radius, unsigned resolution=48)
Creates a circle as a polyline.
void setColor(const ecvColor::Rgb &col)
Sets the polyline color.
void setWidth(PointCoordinateType width)
Sets the width of the line.
virtual unsigned getUniqueIDForDisplay() const override
Returns object unqiue ID used for display.
QMultiMap< unsigned, unsigned > LoadedIDMap
Map of loaded unique IDs (old ID --> new ID)
Shifted entity interface.
virtual bool hasPoints() const
constexpr static RgbTpl FromEigen(const Eigen::Vector3d &t)
__host__ __device__ float length(float2 v)
bool setColor(ccHObject::Container selectedEntities, bool colorize, QWidget *parent)