ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccPolyline Class Reference

Colored polyline. More...

#include <ecvPolyline.h>

Inheritance diagram for ccPolyline:
Collaboration diagram for ccPolyline:

Public Member Functions

 ccPolyline (GenericIndexedCloudPersist *associatedCloud)
 Default constructor. More...
 
 ccPolyline (ccPointCloud &associatedCloud)
 
 ccPolyline (const ccPolyline &poly)
 Copy constructor. More...
 
virtual ~ccPolyline () override=default
 Destructor. More...
 
virtual CV_CLASS_ENUM getClassID () const override
 Returns class ID. More...
 
virtual bool isSerializable () const override
 Returns whether object is serializable of not. More...
 
virtual void applyGLTransformation (const ccGLMatrix &trans) override
 Applies a GL transformation to the entity. More...
 
virtual unsigned getUniqueIDForDisplay () const override
 Returns object unqiue ID used for display. More...
 
virtual bool hasColors () const override
 Returns whether colors are enabled or not. More...
 
virtual void setGlobalShift (const CCVector3d &shift) override
 Sets shift applied to original coordinates (information storage only) More...
 
virtual void setGlobalScale (double scale) override
 
void set2DMode (bool state)
 Defines if the polyline is considered as 2D or 3D. More...
 
bool is2DMode () const
 Returns whether the polyline is considered as 2D or 3D. More...
 
void setTransformFlag (bool state)
 Defines if the polyline is considered as processed polyline. More...
 
bool needTransform () const
 Returns whether the polyline is considered as 2D or 3D. More...
 
void setForeground (bool state)
 Defines if the polyline is drawn in background or foreground. More...
 
void setColor (const ecvColor::Rgb &col)
 Sets the polyline color. More...
 
void setWidth (PointCoordinateType width)
 Sets the width of the line. More...
 
PointCoordinateType getWidth () const
 Returns the width of the line. More...
 
const ecvColor::RgbgetColor () const
 Returns the polyline color. More...
 
virtual ccBBox getOwnBB (bool withGLFeatures=false) override
 Returns the entity's own bounding-box. More...
 
virtual void drawBB (CC_DRAW_CONTEXT &context, const ecvColor::Rgb &col) override
 Draws the entity (and its children) bounding-box. More...
 
bool split (PointCoordinateType maxEdgeLength, std::vector< ccPolyline * > &parts)
 Splits the polyline into several parts based on a maximum edge length. More...
 
bool add (const ccPointCloud &cloud)
 Add another reference cloud. More...
 
PointCoordinateType computeLength () const
 Computes the polyline length. More...
 
void showVertices (bool state)
 Sets whether to display or hide the polyline vertices. More...
 
bool verticesShown () const
 Whether the polyline vertices should be displayed or not. More...
 
bool arrowShown () const
 
unsigned getArrowIndex () const
 
PointCoordinateType getArrowLength () const
 
void setVertexMarkerWidth (int width)
 Sets the width of vertex markers. More...
 
int getVertexMarkerWidth () const
 Returns the width of vertex markers. More...
 
bool initWith (ccPointCloud *vertices, const ccPolyline &poly)
 
void importParametersFrom (const ccPolyline &poly)
 Copy the parameters from another polyline. More...
 
void showArrow (bool state, unsigned vertIndex, PointCoordinateType length)
 Shows an arrow in place of a given vertex. More...
 
unsigned segmentCount () const
 Returns the number of segments. More...
 
ccPointCloudsamplePoints (bool densityBased, double samplingParameter, bool withRGB)
 Samples points on the polyline. More...
 
ccPolylinesmoothChaikin (PointCoordinateType ratio, unsigned iterationCount) const
 Smoothes the polyline (Chaikin algorithm) More...
 
bool createNewPolylinesFromSelection (std::vector< ccPolyline * > &output)
 Creates a polyline mesh with the selected vertices only. More...
 
virtual bool IsEmpty () const override
 
virtual Eigen::Vector3d GetMinBound () const override
 Returns min bounds for geometry coordinates. More...
 
virtual Eigen::Vector3d GetMaxBound () const override
 Returns max bounds for geometry coordinates. More...
 
virtual Eigen::Vector3d GetCenter () const override
 Returns the center of the geometry coordinates. More...
 
virtual ccBBox GetAxisAlignedBoundingBox () const override
 Returns an axis-aligned bounding box of the geometry. More...
 
virtual ecvOrientedBBox GetOrientedBoundingBox () const override
 
virtual ccPolylineTransform (const Eigen::Matrix4d &transformation) override
 Apply transformation (4x4 matrix) to the geometry coordinates. More...
 
virtual ccPolylineTranslate (const Eigen::Vector3d &translation, bool relative=true) override
 Apply translation to the geometry coordinates. More...
 
virtual ccPolylineScale (const double s, const Eigen::Vector3d &center) override
 Apply scaling to the geometry coordinates. Given a scaling factor $s$, and center $c$, a given point $p$ is transformed according to $s (p - c) + c$. More...
 
virtual ccPolylineRotate (const Eigen::Matrix3d &R, const Eigen::Vector3d &center) override
 Apply rotation to the geometry coordinates and normals. Given a rotation matrix $R$, and center $c$, a given point $p$ is transformed according to $R (p - c) + c$. More...
 
ccPolylineoperator+= (const ccPolyline &polyline)
 
ccPolylineoperator= (const ccPolyline &polyline)
 
ccPolyline operator+ (const ccPolyline &polyline) const
 
ccPolylinePaintUniformColor (const Eigen::Vector3d &color)
 Assigns each line in the LineSet the same color. More...
 
- Public Member Functions inherited from cloudViewer::Polyline
 Polyline (GenericIndexedCloudPersist *associatedCloud)
 Polyline constructor. More...
 
bool isClosed () const
 Returns whether the polyline is closed or not. More...
 
void setClosed (bool state)
 Sets whether the polyline is closed or not. More...
 
void clear (bool unusedParam=true) override
 Clears the cloud. More...
 
- Public Member Functions inherited from cloudViewer::ReferenceCloud
 ReferenceCloud (GenericIndexedCloudPersist *associatedCloud)
 Default constructor. More...
 
 ReferenceCloud (const ReferenceCloud &refCloud)
 Copy constructor. More...
 
 ~ReferenceCloud () override=default
 Destructor. More...
 
unsigned size () const override
 Returns the number of points. More...
 
void forEach (genericPointAction action) override
 Fast iteration mechanism. More...
 
void getBoundingBox (CCVector3 &bbMin, CCVector3 &bbMax) override
 Returns the cloud bounding box. More...
 
unsigned char testVisibility (const CCVector3 &P) const override
 
void placeIteratorAtBeginning () override
 Sets the cloud iterator at the beginning. More...
 
const CCVector3getNextPoint () override
 Returns the next point (relatively to the global iterator position) More...
 
bool enableScalarField () override
 Enables the scalar field associated to the cloud. More...
 
bool isScalarFieldEnabled () const override
 Returns true if the scalar field is enabled, false otherwise. More...
 
void setPointScalarValue (unsigned pointIndex, ScalarType value) override
 Sets the ith point associated scalar value. More...
 
ScalarType getPointScalarValue (unsigned pointIndex) const override
 Returns the ith point associated scalar value. More...
 
const CCVector3getPoint (unsigned index) const override
 Returns the ith point. More...
 
void getPoint (unsigned index, CCVector3 &P) const override
 Returns the ith point. More...
 
void getPoint (unsigned index, double P[3]) const override
 
const CCVector3getPointPersistentPtr (unsigned index) override
 Returns the ith point as a persistent pointer. More...
 
virtual unsigned getPointGlobalIndex (unsigned localIndex) const
 
virtual const CCVector3getCurrentPointCoordinates () const
 Returns the coordinates of the point pointed by the current element. More...
 
virtual unsigned getCurrentPointGlobalIndex () const
 Returns the global index of the point pointed by the current element. More...
 
virtual ScalarType getCurrentPointScalarValue () const
 Returns the current point associated scalar value. More...
 
virtual void setCurrentPointScalarValue (ScalarType value)
 Sets the current point associated scalar value. More...
 
virtual void forwardIterator ()
 Forwards the local element iterator. More...
 
virtual bool addPointIndex (unsigned globalIndex)
 Point global index insertion mechanism. More...
 
virtual bool addPointIndex (unsigned firstIndex, unsigned lastIndex)
 Point global index insertion mechanism (range) More...
 
virtual void setPointIndex (unsigned localIndex, unsigned globalIndex)
 Sets global index for a given element. More...
 
virtual bool reserve (unsigned n)
 Reserves some memory for hosting the point references. More...
 
virtual bool resize (unsigned n)
 Presets the size of the vector used to store point references. More...
 
virtual unsigned capacity () const
 Returns max capacity. More...
 
virtual void swap (unsigned i, unsigned j)
 Swaps two point references. More...
 
virtual void removeCurrentPointGlobalIndex ()
 Removes current element. More...
 
virtual void removePointGlobalIndex (unsigned localIndex)
 Removes a given element. More...
 
virtual GenericIndexedCloudPersistgetAssociatedCloud ()
 Returns the associated (source) cloud. More...
 
virtual const GenericIndexedCloudPersistgetAssociatedCloud () const
 Returns the associated (source) cloud (const version) More...
 
virtual void setAssociatedCloud (GenericIndexedCloudPersist *cloud)
 Sets the associated (source) cloud. More...
 
bool add (const ReferenceCloud &cloud)
 Add another reference cloud. More...
 
void invalidateBoundingBox ()
 Invalidates the bounding-box. More...
 
- Public Member Functions inherited from cloudViewer::GenericIndexedCloudPersist
 ~GenericIndexedCloudPersist () override=default
 Default destructor. More...
 
- Public Member Functions inherited from cloudViewer::GenericIndexedCloud
 ~GenericIndexedCloud () override=default
 Default destructor. More...
 
virtual bool normalsAvailable () const
 Returns whether normals are available. More...
 
virtual const CCVector3getNormal (unsigned index) const
 If per-point normals are available, returns the one at a specific index. More...
 
- Public Member Functions inherited from cloudViewer::GenericCloud
 GenericCloud ()=default
 Default constructor. More...
 
virtual ~GenericCloud ()=default
 Default destructor. More...
 
virtual bool hasPoints () const
 
- Public Member Functions inherited from ccShiftedObject
 ccShiftedObject (QString name=QString())
 Default constructor. More...
 
 ccShiftedObject (const ccShiftedObject &s)
 Copy constructor. More...
 
void copyGlobalShiftAndScale (const ccShiftedObject &s)
 Copies the Global Shift and Scale from another entity. More...
 
virtual void setGlobalShift (double x, double y, double z)
 Sets shift applied to original coordinates (information storage only) More...
 
virtual const CCVector3dgetGlobalShift () const
 Returns the shift applied to original coordinates. More...
 
virtual double getGlobalScale () const
 Returns the scale applied to original coordinates. More...
 
bool isShifted () const
 Returns whether the cloud is shifted or not. More...
 
template<typename T >
CCVector3d toGlobal3d (const Vector3Tpl< T > &Plocal) const
 Returns the point back-projected into the original coordinates system. More...
 
template<typename T >
CCVector3d toLocal3d (const Vector3Tpl< T > &Pglobal) const
 Returns the point projected into the local (shifted) coordinates system. More...
 
template<typename T >
CCVector3 toLocal3pc (const Vector3Tpl< T > &Pglobal) const
 Returns the point projected into the local (shifted) coordinates system. More...
 
bool getOwnGlobalBB (CCVector3d &minCorner, CCVector3d &maxCorner) override
 
GlobalBoundingBox getOwnGlobalBB (bool withGLFeatures=false) override
 
- Public Member Functions inherited from ccHObject
 ccHObject (QString name=QString())
 Default constructor. More...
 
 ccHObject (const ccHObject &object)
 Copy constructor. More...
 
virtual ~ccHObject () override
 Default destructor. More...
 
virtual Eigen::Vector2d GetMin2DBound () const
 
virtual Eigen::Vector2d GetMax2DBound () const
 
virtual ccHObjectScale (const double s)
 
virtual ccHObjectRotate (const Eigen::Matrix3d &R)
 
QString getViewId () const
 
bool isGroup () const
 Returns whether the instance is a group. More...
 
ccHObjectgetParent () const
 Returns parent object. More...
 
virtual QIcon getIcon () const
 Returns the icon associated to this entity. More...
 
void addDependency (ccHObject *otherObject, int flags, bool additive=true)
 Adds a new dependence (additive or not) More...
 
int getDependencyFlagsWith (const ccHObject *otherObject)
 Returns the dependency flags with a given object. More...
 
void removeDependencyWith (ccHObject *otherObject)
 Removes any dependency flags with a given object. More...
 
void removeDependencyFlag (ccHObject *otherObject, DEPENDENCY_FLAGS flag)
 Removes a given dependency flag. More...
 
virtual bool addChild (ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1)
 Adds a child. More...
 
unsigned getChildrenNumber () const
 Returns the number of children. More...
 
unsigned int getChildCountRecursive () const
 Returns the total number of children under this object recursively. More...
 
ccHObjectgetChild (unsigned childPos) const
 Returns the ith child. More...
 
ccHObjectfind (unsigned uniqueID)
 Finds an entity in this object hierarchy. More...
 
unsigned filterChildren (Container &filteredChildren, bool recursive=false, CV_CLASS_ENUM filter=CV_TYPES::OBJECT, bool strict=false) const
 Collects the children corresponding to a certain pattern. More...
 
void detachChild (ccHObject *child)
 Detaches a specific child. More...
 
void detachAllChildren ()
 Removes a specific child. More...
 
void getTypeID_recursive (std::vector< removeInfo > &rmInfos, bool relative)
 
void getTypeID_recursive (std::vector< hideInfo > &hdInfos, bool relative)
 
void removeChild (ccHObject *child)
 
void removeChild (int pos)
 Removes a specific child given its index. More...
 
void removeAllChildren ()
 Removes all children. More...
 
int getChildIndex (const ccHObject *aChild) const
 Returns child index. More...
 
void swapChildren (unsigned firstChildIndex, unsigned secondChildIndex)
 Swaps two children. More...
 
int getIndex () const
 Returns index relatively to its parent or -1 if no parent. More...
 
void transferChild (ccHObject *child, ccHObject &newParent)
 Transfer a given child to another parent. More...
 
void transferChildren (ccHObject &newParent, bool forceFatherDependent=false)
 Transfer all children to another parent. More...
 
ccHObjectgetFirstChild () const
 Shortcut: returns first child. More...
 
ccHObjectgetLastChild () const
 Shortcut: returns last child. More...
 
bool isAncestorOf (const ccHObject *anObject) const
 Returns true if the current object is an ancestor of the specified one. More...
 
void removeFromRenderScreen (bool recursive=true)
 
void hideObject_recursive (bool recursive)
 
void hideBB (CC_DRAW_CONTEXT context)
 
void showBB (CC_DRAW_CONTEXT context)
 
void setRedrawFlagRecursive (bool redraw=false)
 
void setForceRedrawRecursive (bool redraw=false)
 
void setPointSizeRecursive (int pSize)
 
void setLineWidthRecursive (PointCoordinateType width)
 
virtual ccBBox getBB_recursive (bool withGLFeatures=false, bool onlyEnabledChildren=true)
 Returns the bounding-box of this entity and it's children. More...
 
virtual GlobalBoundingBox getGlobalBB_recursive (bool withGLFeatures=false, bool onlyEnabledChildren=true)
 Returns the global bounding-box of this entity and it's children. More...
 
virtual ccBBox getDisplayBB_recursive (bool relative)
 Returns the bounding-box of this entity and it's children WHEN DISPLAYED. More...
 
virtual ccBBox getOwnFitBB (ccGLMatrix &trans)
 Returns best-fit bounding-box (if available) More...
 
void draw (CC_DRAW_CONTEXT &context) override
 Draws entity and its children. More...
 
void updateNameIn3DRecursive ()
 
void setHideShowType (CC_DRAW_CONTEXT &context)
 
void setRemoveType (CC_DRAW_CONTEXT &context)
 
ENTITY_TYPE getEntityType () const
 
virtual void redrawDisplay (bool forceRedraw=true, bool only2D=false)
 Redraws associated display. More...
 
bool getAbsoluteGLTransformation (ccGLMatrix &trans) const
 
virtual bool isDisplayed () const
 Returns whether the object is actually displayed (visible) or not. More...
 
virtual bool isBranchEnabled () const
 Returns whether the object and all its ancestors are enabled. More...
 
virtual void redrawDisplay_recursive (bool p)
 
virtual void refreshDisplay_recursive (bool p)
 
virtual void setSelected_recursive (bool p)
 
virtual void toggleActivation_recursive ()
 
virtual void toggleVisibility_recursive ()
 
virtual void toggleColors_recursive ()
 
virtual void resetGLTransformationHistory_recursive ()
 
virtual void toggleNormals_recursive ()
 
virtual void toggleSF_recursive ()
 
virtual void toggleShowName_recursive ()
 
unsigned findMaxUniqueID_recursive () const
 Returns the max 'unique ID' of this entity and its siblings. More...
 
void applyGLTransformation_recursive (const ccGLMatrix *trans=nullptr)
 Applies the active OpenGL transformation to the entity (recursive) More...
 
virtual void notifyGeometryUpdate ()
 
bool toFile (QFile &out, short dataVersion) const override
 Saves data to binary stream. More...
 
bool fromFile (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
 Loads data from binary stream. More...
 
short minimumFileVersion () const override
 Returns the minimum file version required to save this instance. More...
 
bool fromFileNoChildren (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap)
 Custom version of ccSerializableObject::fromFile. More...
 
virtual bool isShareable () const
 Returns whether object is shareable or not. More...
 
virtual void setSelectionBehavior (SelectionBehavior mode)
 Sets selection behavior (when displayed) More...
 
virtual SelectionBehavior getSelectionBehavior () const
 Returns selection behavior. More...
 
virtual const ccGLMatrixgetGLTransformationHistory () const
 Returns the transformation 'history' matrix. More...
 
virtual void setGLTransformationHistory (const ccGLMatrix &mat)
 Sets the transformation 'history' matrix (handle with care!) More...
 
virtual void resetGLTransformationHistory ()
 Resets the transformation 'history' matrix. More...
 
bool pushDisplayState () override
 Pushes the current display state (overridden) More...
 
void popDisplayState (bool apply=true) override
 Pops the last pushed display state (overridden) More...
 
- Public Member Functions inherited from ccObject
 ccObject (QString name=QString())
 Default constructor. More...
 
 ccObject (const ccObject &object)
 Copy constructor. More...
 
virtual QString getName () const
 Returns object name. More...
 
virtual void setName (const QString &name)
 Sets object name. More...
 
virtual void setRemoveFlag (bool removeFlag)
 Sets removeFlag. More...
 
virtual bool getRemoveFlag ()
 Returns removeFlag. More...
 
virtual unsigned getUniqueID () const
 Returns object unique ID. More...
 
virtual void setUniqueID (unsigned ID)
 Changes unique ID. More...
 
virtual bool isEnabled () const
 Returns whether the object is enabled or not. More...
 
virtual void setEnabled (bool state)
 Sets the "enabled" property. More...
 
virtual void toggleActivation ()
 Toggles the "enabled" property. More...
 
virtual bool isLocked () const
 Returns whether the object is locked or not. More...
 
virtual void setLocked (bool state)
 Sets the "enabled" property. More...
 
bool isLeaf () const
 
bool isCustom () const
 
bool isHierarchy () const
 
bool isKindOf (CV_CLASS_ENUM type) const
 
bool isA (CV_CLASS_ENUM type) const
 
QVariant getMetaData (const QString &key) const
 Returns a given associated meta data. More...
 
bool removeMetaData (const QString &key)
 Removes a given associated meta-data. More...
 
void setMetaData (const QString &key, const QVariant &data)
 Sets a meta-data element. More...
 
void setMetaData (const QVariantMap &dataset, bool overwrite=false)
 Sets several meta-data elements at a time. More...
 
bool hasMetaData (const QString &key) const
 Returns whether a meta-data element with the given key exists or not. More...
 
const QVariantMap & metaData () const
 Returns meta-data map (const only) More...
 
void setBaseName (const QString &baseName)
 
QString getBaseName () const
 
void setFullPath (const QString &fullPaht)
 
QString getFullPath () const
 
- Public Member Functions inherited from ccSerializableObject
virtual ~ccSerializableObject ()=default
 Destructor. More...
 
- Public Member Functions inherited from ccDrawableObject
 ccDrawableObject ()
 Default constructor. More...
 
 ccDrawableObject (const ccDrawableObject &object)
 Copy constructor. More...
 
virtual ~ccDrawableObject ()=default
 
virtual bool isVisible () const
 Returns whether entity is visible or not. More...
 
virtual void setVisible (bool state)
 Sets entity visibility. More...
 
virtual void toggleVisibility ()
 Toggles visibility. More...
 
virtual bool isRedraw () const
 Returns whether entity is to be redraw. More...
 
virtual void setRedraw (bool state)
 Sets entity redraw mode. More...
 
virtual void setForceRedraw (bool state)
 Sets force redraw. More...
 
virtual void setFixedId (bool state)
 
virtual bool isFixedId ()
 
virtual bool isVisibilityLocked () const
 Returns whether visibility is locked or not. More...
 
virtual void lockVisibility (bool state)
 Locks/unlocks visibility. More...
 
virtual bool isSelected () const
 Returns whether entity is selected or not. More...
 
virtual void setSelected (bool state)
 Selects/Unselects entity. More...
 
virtual void getDrawingParameters (glDrawParams &params) const
 Returns main OpenGL parameters for this entity. More...
 
virtual bool colorsShown () const
 Returns whether colors are shown or not. More...
 
virtual void showColors (bool state)
 Sets colors visibility. More...
 
virtual void toggleColors ()
 Toggles colors display state. More...
 
virtual bool hasNormals () const
 Returns whether normals are enabled or not. More...
 
virtual bool normalsShown () const
 Returns whether normals are shown or not. More...
 
virtual void showNormals (bool state)
 Sets normals visibility. More...
 
virtual void toggleNormals ()
 Toggles normals display state. More...
 
virtual bool hasDisplayedScalarField () const
 Returns whether an active scalar field is available or not. More...
 
virtual bool hasScalarFields () const
 Returns whether one or more scalar fields are instantiated. More...
 
virtual void showSF (bool state)
 Sets active scalarfield visibility. More...
 
virtual void toggleSF ()
 Toggles SF display state. More...
 
virtual bool sfShown () const
 Returns whether active scalar field is visible. More...
 
virtual void toggleMaterials ()
 Toggles material display state. More...
 
virtual void showNameIn3D (bool state)
 Sets whether name should be displayed in 3D. More...
 
virtual bool nameShownIn3D () const
 Returns whether name is displayed in 3D or not. More...
 
virtual void toggleShowName ()
 Toggles name in 3D display state. More...
 
virtual bool isColorOverridden () const
 
virtual const ecvColor::RgbgetTempColor () const
 Returns current temporary (unique) color. More...
 
virtual void setTempColor (const ecvColor::Rgb &col, bool autoActivate=true)
 Sets current temporary (unique) More...
 
virtual void enableTempColor (bool state)
 Set temporary color activation state. More...
 
virtual float getOpacity () const
 
virtual void setOpacity (float opacity)
 Set opacity activation state. More...
 
virtual void setGLTransformation (const ccGLMatrix &trans)
 Associates entity with a GL transformation (rotation + translation) More...
 
virtual void enableGLTransformation (bool state)
 Enables/disables associated GL transformation. More...
 
virtual bool isGLTransEnabled () const
 Returns whether a GL transformation is enabled or not. More...
 
virtual const ccGLMatrixgetGLTransformation () const
 Returns associated GL transformation. More...
 
virtual void resetGLTransformation ()
 Resets associated GL transformation. More...
 
virtual void rotateGL (const ccGLMatrix &rotMat)
 Multiplies (left) current GL transformation by a rotation matrix. More...
 
virtual void translateGL (const CCVector3 &trans)
 Translates current GL transformation by a rotation matrix. More...
 
virtual void removeAllClipPlanes ()
 Removes all clipping planes (if any) More...
 
virtual bool addClipPlanes (const ccClipPlane &plane)
 Registers a new clipping plane. More...
 
virtual void toggleClipPlanes (CC_DRAW_CONTEXT &context, bool enable)
 Enables or disables clipping planes (OpenGL) More...
 
virtual void applyDisplayState (const DisplayState &state)
 Applies a display state. More...
 

Static Public Member Functions

static bool IsCloudVerticesOfPolyline (ccGenericPointCloud *cloud, ccPolyline **polyline=nullptr)
 Helper to determine if the input cloud acts as vertices of a polyline. More...
 
static ccPolylineCircle (const CCVector3 &center, PointCoordinateType radius, unsigned resolution=48)
 Creates a circle as a polyline. More...
 
static QString MetaKeyUpDir ()
 
static QString MetaKeyConstAltitude ()
 Meta data key: contour plot constant altitude (for contour plots, etc.) More...
 
static QString MetaKeyAbscissa ()
 Meta data key: profile abscissa along generatrix. More...
 
static QString MetaKeyPrefixCenter ()
 
static QString MetaKeyPrefixDirection ()
 
- Static Public Member Functions inherited from ccHObject
static ccHObjectNew (CV_CLASS_ENUM objectType, const char *name=nullptr)
 Static factory. More...
 
static ccHObjectNew (const QString &pluginId, const QString &classId, const char *name=nullptr)
 Static factory (version to be used by external plugin factories) More...
 
static Eigen::Vector3d ComputeMinBound (const std::vector< Eigen::Vector3d > &points)
 Compute min bound of a list points. More...
 
static Eigen::Vector3d ComputeMaxBound (const std::vector< Eigen::Vector3d > &points)
 Compute max bound of a list points. More...
 
static Eigen::Vector3d ComputeCenter (const std::vector< Eigen::Vector3d > &points)
 Computer center of a list of points. More...
 
static void ResizeAndPaintUniformColor (std::vector< Eigen::Vector3d > &colors, std::size_t size, const Eigen::Vector3d &color)
 Resizes the colors vector and paints a uniform color. More...
 
static void TransformPoints (const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &points)
 Transforms all points with the transformation matrix. More...
 
static void TransformNormals (const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &normals)
 Transforms the normals with the transformation matrix. More...
 
static void TransformCovariances (const Eigen::Matrix4d &transformation, std::vector< Eigen::Matrix3d > &covariances)
 Transforms all covariance matrices with the transformation. More...
 
static void TranslatePoints (const Eigen::Vector3d &translation, std::vector< Eigen::Vector3d > &points, bool relative)
 Apply translation to the geometry coordinates. More...
 
static void ScalePoints (const double scale, std::vector< Eigen::Vector3d > &points, const Eigen::Vector3d &center)
 Scale the coordinates of all points by the scaling factor scale. More...
 
static void RotatePoints (const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &points, const Eigen::Vector3d &center)
 Rotate all points with the rotation matrix R. More...
 
static void RotateNormals (const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &normals)
 Rotate all normals with the rotation matrix R. More...
 
static void RotateCovariances (const Eigen::Matrix3d &R, std::vector< Eigen::Matrix3d > &covariances)
 Rotate all covariance matrices with the rotation matrix R. More...
 
static Eigen::Matrix3d GetRotationMatrixFromXYZ (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from XYZ RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromYZX (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from YZX RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromZXY (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from ZXY RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromXZY (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from XZY RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromZYX (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from ZYX RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromYXZ (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from YXZ RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromAxisAngle (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from AxisAngle RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromQuaternion (const Eigen::Vector4d &rotation)
 Get Rotation Matrix from Quaternion. More...
 
static Eigen::Matrix3d GetRotationMatrixFromEulerAngle (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from Euler angle. More...
 
- Static Public Member Functions inherited from ccObject
static unsigned GetCurrentDBVersion ()
 Returns current database version. More...
 
static void SetUniqueIDGenerator (ccUniqueIDGenerator::Shared generator)
 Sets the unique ID generator. More...
 
static ccUniqueIDGenerator::Shared GetUniqueIDGenerator ()
 Returns the unique ID generator. More...
 
static unsigned GetNextUniqueID ()
 Returns a new unassigned unique ID. More...
 
static unsigned GetLastUniqueID ()
 Returns last assigned unique ID. More...
 
static CV_CLASS_ENUM ReadClassIDFromFile (QFile &in, short dataVersion)
 Helper: reads out class ID from a binary stream. More...
 
- Static Public Member Functions inherited from ccSerializableObject
static bool WriteError ()
 Sends a custom error message (write error) and returns 'false'. More...
 
static bool ReadError ()
 Sends a custom error message (read error) and returns 'false'. More...
 
static bool MemoryError ()
 Sends a custom error message (not enough memory) and returns 'false'. More...
 
static bool CorruptError ()
 Sends a custom error message (corrupted file) and returns 'false'. More...
 

Protected Member Functions

bool toFile_MeOnly (QFile &out, short dataVersion) const override
 Save own object data. More...
 
short minimumFileVersion_MeOnly () const override
 
bool fromFile_MeOnly (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
 Loads own object data. More...
 
virtual void drawMeOnly (CC_DRAW_CONTEXT &context) override
 Draws the entity only (not its children) More...
 
- Protected Member Functions inherited from ccShiftedObject
bool saveShiftInfoToFile (QFile &out) const
 Serialization helper (output) More...
 
bool loadShiftInfoFromFile (QFile &in)
 Serialization helper (input) More...
 
- Protected Member Functions inherited from ccHObject
virtual void setParent (ccHObject *anObject)
 Sets parent object. More...
 
virtual void drawNameIn3D ()
 Draws the entity name in 3D. More...
 
virtual void onDeletionOf (const ccHObject *obj)
 This method is called when another object is deleted. More...
 
virtual void onUpdateOf (ccHObject *obj)
 This method is called when another object (geometry) is updated. More...
 
- Protected Member Functions inherited from ccObject
virtual bool getFlagState (CV_OBJECT_FLAG flag) const
 Returns flag state. More...
 
virtual void setFlagState (CV_OBJECT_FLAG flag, bool state)
 Sets flag state. More...
 
bool toFile (QFile &out, short dataVersion) const override
 Saves data to binary stream. More...
 
short minimumFileVersion () const override
 Returns the minimum file version required to save this instance. More...
 
bool fromFile (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
 Reimplemented from ccSerializableObject::fromFile. More...
 

Protected Attributes

ecvColor::Rgb m_rgbColor
 Unique RGB color. More...
 
PointCoordinateType m_width
 Width of the line. More...
 
bool m_mode2D
 Whether polyline should be considered as 2D (true) or 3D (false) More...
 
bool m_needTransform
 Whether polyline should be considered as processed polyline. More...
 
bool m_foreground
 
bool m_showVertices
 Whether vertices should be displayed or not. More...
 
int m_vertMarkWidth
 Vertex marker width. More...
 
bool m_showArrow
 Whether to show an arrow or not. More...
 
PointCoordinateType m_arrowLength
 Arrow length. More...
 
unsigned m_arrowIndex
 Arrow index. More...
 
- Protected Attributes inherited from cloudViewer::Polyline
bool m_isClosed
 Closing state. More...
 
- Protected Attributes inherited from cloudViewer::ReferenceCloud
ReferencesContainer m_theIndexes
 Indexes of (some of) the associated cloud points. More...
 
std::atomic< unsigned > m_globalIterator
 Iterator on the point references container. More...
 
BoundingBox m_bbox
 Bounding-box. More...
 
GenericIndexedCloudPersistm_theAssociatedCloud
 Associated cloud. More...
 
std::mutex m_mutex
 For concurrent access. More...
 
- Protected Attributes inherited from ccShiftedObject
CCVector3d m_globalShift
 Global shift (typically applied at loading time) More...
 
double m_globalScale
 Global scale (typically applied at loading time) More...
 
- Protected Attributes inherited from ccHObject
ccHObjectm_parent
 Parent. More...
 
Container m_children
 Children. More...
 
SelectionBehavior m_selectionBehavior
 Selection behavior. More...
 
std::map< ccHObject *, int > m_dependencies
 Dependencies map. More...
 
ccGLMatrix m_glTransHistory
 Cumulative GL transformation. More...
 
bool m_isDeleting
 Flag to safely handle dependencies when the object is being deleted. More...
 
- Protected Attributes inherited from ccObject
QString m_name
 Object name. More...
 
QString m_baseName
 
QString m_filePath
 
bool m_removeFlag
 
unsigned m_flags
 Object flags. More...
 
QVariantMap m_metaData
 Associated meta-data. More...
 
- Protected Attributes inherited from ccDrawableObject
bool m_fixedId
 
bool m_modelRedraw
 
bool m_forceRedraw
 
float m_opacity
 
bool m_visible
 Specifies whether the object is visible or not. More...
 
bool m_selected
 Specifies whether the object is selected or not. More...
 
bool m_lockedVisibility
 Specifies whether the visibility can be changed by user or not. More...
 
bool m_colorsDisplayed
 Specifies whether colors should be displayed. More...
 
bool m_normalsDisplayed
 Specifies whether normals should be displayed. More...
 
bool m_sfDisplayed
 Specifies whether scalar field should be displayed. More...
 
ecvColor::Rgb m_tempColor
 Temporary (unique) color. More...
 
bool m_colorIsOverridden
 Temporary (unique) color activation state. More...
 
ccGLMatrix m_glTrans
 Current GL transformation. More...
 
bool m_glTransEnabled
 Current GL transformation activation state. More...
 
bool m_showNameIn3D
 Whether name is displayed in 3D or not. More...
 
CCVector3d m_nameIn3DPos
 Last 2D position of the '3D' name. More...
 
ccClipPlaneSet m_clipPlanes
 Active clipping planes (used for display only) More...
 
std::vector< DisplayState::Sharedm_displayStateStack
 The stack of pushed display states. More...
 

Additional Inherited Members

- Public Types inherited from cloudViewer::GenericCloud
using genericPointAction = std::function< void(const CCVector3 &, ScalarType &)>
 Generic function applied to a point (used by foreach) More...
 
- Public Types inherited from ccHObject
enum  DEPENDENCY_FLAGS {
  DP_NONE = 0 , DP_NOTIFY_OTHER_ON_DELETE = 1 , DP_NOTIFY_OTHER_ON_UPDATE , DP_DELETE_OTHER = 8 ,
  DP_PARENT_OF_OTHER = 24
}
 Dependency flags. More...
 
enum  SelectionBehavior { SELECTION_AA_BBOX , SELECTION_FIT_BBOX , SELECTION_IGNORED }
 Behavior when selected. More...
 
using Container = std::vector< ccHObject * >
 Standard instances container (for children, etc.) More...
 
using Shared = QSharedPointer< ccHObject >
 Shared pointer. More...
 
using SharedContainer = std::vector< Shared >
 Shared instances container (for children, etc.) More...
 
using GlobalBoundingBox = cloudViewer::BoundingBoxTpl< double >
 Global (non-shifted) bounding-box. More...
 
- Public Types inherited from ccSerializableObject
enum  DeserializationFlags { DF_POINT_COORDS_64_BITS , DF_SCALAR_VAL_32_BITS = 2 }
 Deserialization flags (bit-field) More...
 
typedef QMultiMap< unsigned, unsigned > LoadedIDMap
 Map of loaded unique IDs (old ID --> new ID) More...
 
- Protected Types inherited from cloudViewer::ReferenceCloud
using ReferencesContainer = std::vector< unsigned int >
 Container of 3D point indexes. More...
 

Detailed Description

Colored polyline.

Extends the cloudViewer::Polyline class

Definition at line 23 of file ecvPolyline.h.

Constructor & Destructor Documentation

◆ ccPolyline() [1/3]

ccPolyline::ccPolyline ( GenericIndexedCloudPersist *  associatedCloud)
explicit

Default constructor.

Parameters
associatedCloudthe associated point cloud (i.e. the vertices)

◆ ccPolyline() [2/3]

ccPolyline::ccPolyline ( ccPointCloud associatedCloud)
explicit

◆ ccPolyline() [3/3]

ccPolyline::ccPolyline ( const ccPolyline poly)

Copy constructor.

Parameters
polypolyline to clone

◆ ~ccPolyline()

virtual ccPolyline::~ccPolyline ( )
overridevirtualdefault

Destructor.

Member Function Documentation

◆ add()

bool ccPolyline::add ( const ccPointCloud cloud)

Add another reference cloud.

Warning
Both clouds should have the same reference cloud!
No verification for duplicates! Thread safe.

Referenced by cloudViewer::geometry::pybind_polyline().

◆ applyGLTransformation()

virtual void ccPolyline::applyGLTransformation ( const ccGLMatrix trans)
overridevirtual

Applies a GL transformation to the entity.

this = rotMat*(this-rotCenter)+(rotCenter+trans)

Parameters
transa ccGLMatrix structure

Reimplemented from ccHObject.

Reimplemented in ccCircle.

◆ arrowShown()

bool ccPolyline::arrowShown ( ) const
inline

Definition at line 132 of file ecvPolyline.h.

◆ Circle()

static ccPolyline* ccPolyline::Circle ( const CCVector3 center,
PointCoordinateType  radius,
unsigned  resolution = 48 
)
static

Creates a circle as a polyline.

◆ computeLength()

◆ createNewPolylinesFromSelection()

bool ccPolyline::createNewPolylinesFromSelection ( std::vector< ccPolyline * > &  output)

Creates a polyline mesh with the selected vertices only.

This method is called after a graphical segmentation. It creates one or several new polylines with the segments having both vertices tagged as "visible" (see ccGenericPointCloud::visibilityArray).

Referenced by ccGraphicalSegmentationTool::applySegmentation().

◆ drawBB()

virtual void ccPolyline::drawBB ( CC_DRAW_CONTEXT context,
const ecvColor::Rgb col 
)
inlineoverridevirtual

Draws the entity (and its children) bounding-box.

Reimplemented from ccHObject.

Definition at line 103 of file ecvPolyline.h.

References context, and ccHObject::drawBB().

◆ drawMeOnly()

virtual void ccPolyline::drawMeOnly ( CC_DRAW_CONTEXT context)
overrideprotectedvirtual

Draws the entity only (not its children)

Reimplemented from ccHObject.

Reimplemented in ccTrace, and ccPointPair.

◆ fromFile_MeOnly()

bool ccPolyline::fromFile_MeOnly ( QFile &  in,
short  dataVersion,
int  flags,
LoadedIDMap oldToNewIDMap 
)
overrideprotectedvirtual

Loads own object data.

Called by 'fromFile' (recursive scheme) To be overloaded (but still called ;) by subclass.

Parameters
ininput file
dataVersionfile version
flagsdeserialization flags (see ccSerializableObject::DeserializationFlags)
oldToNewIDMapmap to link old IDs with new IDs

Reimplemented from ccHObject.

◆ getArrowIndex()

unsigned ccPolyline::getArrowIndex ( ) const
inline

Definition at line 133 of file ecvPolyline.h.

Referenced by cloudViewer::geometry::pybind_polyline().

◆ getArrowLength()

PointCoordinateType ccPolyline::getArrowLength ( ) const
inline

Definition at line 134 of file ecvPolyline.h.

Referenced by cloudViewer::geometry::pybind_polyline().

◆ GetAxisAlignedBoundingBox()

virtual ccBBox ccPolyline::GetAxisAlignedBoundingBox ( ) const
overridevirtual

Returns an axis-aligned bounding box of the geometry.

Reimplemented from ccHObject.

◆ GetCenter()

virtual Eigen::Vector3d ccPolyline::GetCenter ( ) const
overridevirtual

Returns the center of the geometry coordinates.

Reimplemented from ccHObject.

◆ getClassID()

virtual CV_CLASS_ENUM ccPolyline::getClassID ( ) const
inlineoverridevirtual

Returns class ID.

Reimplemented from ccHObject.

Reimplemented in ccTrace, and ccCircle.

Definition at line 41 of file ecvPolyline.h.

References CV_TYPES::POLY_LINE.

◆ getColor()

const ecvColor::Rgb& ccPolyline::getColor ( ) const
inline

Returns the polyline color.

Returns
a pointer to the polyline RGB color

Definition at line 99 of file ecvPolyline.h.

Referenced by define_ccPolyline(), and ccEntityAction::setColor().

◆ GetMaxBound()

virtual Eigen::Vector3d ccPolyline::GetMaxBound ( ) const
overridevirtual

Returns max bounds for geometry coordinates.

Reimplemented from ccHObject.

◆ GetMinBound()

virtual Eigen::Vector3d ccPolyline::GetMinBound ( ) const
overridevirtual

Returns min bounds for geometry coordinates.

Reimplemented from ccHObject.

◆ GetOrientedBoundingBox()

virtual ecvOrientedBBox ccPolyline::GetOrientedBoundingBox ( ) const
overridevirtual

Reimplemented from ccHObject.

◆ getOwnBB()

virtual ccBBox ccPolyline::getOwnBB ( bool  withGLFeatures = false)
overridevirtual

Returns the entity's own bounding-box.

Children bboxes are ignored.

Parameters
withGLFeatureswhether to take into account display-only elements (if any)
Returns
bounding-box

Reimplemented from ccHObject.

◆ getUniqueIDForDisplay()

virtual unsigned ccPolyline::getUniqueIDForDisplay ( ) const
overridevirtual

Returns object unqiue ID used for display.

Reimplemented from ccHObject.

◆ getVertexMarkerWidth()

int ccPolyline::getVertexMarkerWidth ( ) const
inline

Returns the width of vertex markers.

Definition at line 139 of file ecvPolyline.h.

Referenced by define_ccPolyline(), and cloudViewer::geometry::pybind_polyline().

◆ getWidth()

PointCoordinateType ccPolyline::getWidth ( ) const
inline

Returns the width of the line.

Returns
the width of the line in pixels

Definition at line 94 of file ecvPolyline.h.

Referenced by define_ccPolyline(), cloudViewer::geometry::pybind_polyline(), and ccPropertiesTreeDelegate::setEditorData().

◆ hasColors()

virtual bool ccPolyline::hasColors ( ) const
overridevirtual

Returns whether colors are enabled or not.

Reimplemented from ccDrawableObject.

◆ importParametersFrom()

void ccPolyline::importParametersFrom ( const ccPolyline poly)

Copy the parameters from another polyline.

Referenced by define_ccPolyline(), and ccTracePolylineTool::polylineOverSampling().

◆ initWith()

bool ccPolyline::initWith ( ccPointCloud vertices,
const ccPolyline poly 
)

Initializes the polyline with a given set of vertices and the parameters of another polyline

Warning
Even the 'closed' state is copied as is!
Parameters
verticesset of vertices (can be null, in which case the polyline vertices will be cloned)
polypolyline
Returns
success

◆ is2DMode()

bool ccPolyline::is2DMode ( ) const
inline

◆ IsCloudVerticesOfPolyline()

static bool ccPolyline::IsCloudVerticesOfPolyline ( ccGenericPointCloud cloud,
ccPolyline **  polyline = nullptr 
)
static

Helper to determine if the input cloud acts as vertices of a polyline.

Referenced by ccGraphicalSegmentationTool::addEntity(), ccGraphicalSegmentationTool::applySegmentation(), and ccGraphicalSegmentationTool::prepareEntityForRemoval().

◆ IsEmpty()

virtual bool ccPolyline::IsEmpty ( ) const
inlineoverridevirtual

Reimplemented from ccHObject.

Definition at line 188 of file ecvPolyline.h.

References cloudViewer::GenericCloud::hasPoints().

Referenced by cloudViewer::geometry::pybind_pointcloud().

◆ isSerializable()

virtual bool ccPolyline::isSerializable ( ) const
inlineoverridevirtual

Returns whether object is serializable of not.

Reimplemented from ccHObject.

Definition at line 46 of file ecvPolyline.h.

◆ MetaKeyAbscissa()

static QString ccPolyline::MetaKeyAbscissa ( )
inlinestatic

Meta data key: profile abscissa along generatrix.

Definition at line 226 of file ecvPolyline.h.

Referenced by MascaretFilter::saveToFile().

◆ MetaKeyConstAltitude()

static QString ccPolyline::MetaKeyConstAltitude ( )
inlinestatic

Meta data key: contour plot constant altitude (for contour plots, etc.)

Expected value: altitude as double

Definition at line 224 of file ecvPolyline.h.

Referenced by ccRasterizeTool::generateContours(), and SinusxFilter::loadFile().

◆ MetaKeyPrefixCenter()

static QString ccPolyline::MetaKeyPrefixCenter ( )
inlinestatic

Meta data key (prefix): intersection point between profile and its generatrix Expected value: 3D vector

Warning
: must be followed by '.x', '.y' or '.z'

Definition at line 232 of file ecvPolyline.h.

Referenced by MascaretFilter::saveToFile().

◆ MetaKeyPrefixDirection()

static QString ccPolyline::MetaKeyPrefixDirection ( )
inlinestatic

Meta data key (prefix): generatrix orientation at the point of intersection with the profile Expected value: 3D vector

Warning
: must be followed by '.x', '.y' or '.z'

Definition at line 238 of file ecvPolyline.h.

Referenced by MascaretFilter::saveToFile().

◆ MetaKeyUpDir()

static QString ccPolyline::MetaKeyUpDir ( )
inlinestatic

Meta data key: vertical direction (for 2D polylines, contour plots, etc.) Expected value: 0(=X), 1(=Y) or 2(=Z) as int

Definition at line 220 of file ecvPolyline.h.

Referenced by SinusxFilter::loadFile(), SinusxFilter::saveToFile(), and MascaretFilter::saveToFile().

◆ minimumFileVersion_MeOnly()

short ccPolyline::minimumFileVersion_MeOnly ( ) const
overrideprotectedvirtual

Returns the minimum file version required to save this instance's own data To be overloaded (but still called ;) by subclass. Used internally by minimumFileVersion() to compute the overall minimum.

Reimplemented from ccHObject.

◆ needTransform()

bool ccPolyline::needTransform ( ) const
inline

Returns whether the polyline is considered as 2D or 3D.

Definition at line 71 of file ecvPolyline.h.

Referenced by cloudViewer::geometry::pybind_polyline().

◆ operator+()

ccPolyline ccPolyline::operator+ ( const ccPolyline polyline) const

◆ operator+=()

ccPolyline& ccPolyline::operator+= ( const ccPolyline polyline)

◆ operator=()

ccPolyline& ccPolyline::operator= ( const ccPolyline polyline)

◆ PaintUniformColor()

ccPolyline& ccPolyline::PaintUniformColor ( const Eigen::Vector3d &  color)
inline

Assigns each line in the LineSet the same color.

Parameters
colorSpecifies the color to be applied.

Definition at line 210 of file ecvPolyline.h.

References color, ecvColor::RgbTpl< Type >::FromEigen(), and ccEntityAction::setColor().

Referenced by cloudViewer::geometry::pybind_polyline().

◆ Rotate()

virtual ccPolyline& ccPolyline::Rotate ( const Eigen::Matrix3d &  R,
const Eigen::Vector3d &  center 
)
overridevirtual

Apply rotation to the geometry coordinates and normals. Given a rotation matrix $R$, and center $c$, a given point $p$ is transformed according to $R (p - c) + c$.

Parameters
RA 3x3 rotation matrix
centerRotation center that is used for the rotation.

Reimplemented from ccHObject.

◆ samplePoints()

ccPointCloud* ccPolyline::samplePoints ( bool  densityBased,
double  samplingParameter,
bool  withRGB 
)

Samples points on the polyline.

Referenced by define_ccPolyline().

◆ Scale()

virtual ccPolyline& ccPolyline::Scale ( const double  s,
const Eigen::Vector3d &  center 
)
overridevirtual

Apply scaling to the geometry coordinates. Given a scaling factor $s$, and center $c$, a given point $p$ is transformed according to $s (p - c) + c$.

Parameters
scaleThe scale parameter that is multiplied to the points/vertices of the geometry.
centerScale center that is used to resize the geometry.

Reimplemented from ccHObject.

◆ segmentCount()

unsigned ccPolyline::segmentCount ( ) const

Returns the number of segments.

Referenced by define_ccPolyline(), and cloudViewer::geometry::pybind_polyline().

◆ set2DMode()

◆ setColor()

◆ setForeground()

void ccPolyline::setForeground ( bool  state)

Defines if the polyline is drawn in background or foreground.

Parameters
stateif true, the polyline is drawn in foreground

Referenced by ccGraphicalSegmentationTool::ccGraphicalSegmentationTool(), ccTracePolylineTool::ccTracePolylineTool(), and define_ccPolyline().

◆ setGlobalScale()

virtual void ccPolyline::setGlobalScale ( double  scale)
overridevirtual

◆ setGlobalShift()

virtual void ccPolyline::setGlobalShift ( const CCVector3d shift)
overridevirtual

Sets shift applied to original coordinates (information storage only)

Such a shift can typically be applied at loading time. Original coordinates are equal to '(P/scale - shift)'

Reimplemented from ccShiftedObject.

Referenced by ccRasterizeTool::addNewContour(), qFacets::createFacets(), ccGraphicalSegmentationTool::doExportSegmentationPolyline(), ccPointListPickingDlg::exportToNewPolyline(), SinusxFilter::loadFile(), and ccTracePolylineTool::onItemPicked().

◆ setTransformFlag()

void ccPolyline::setTransformFlag ( bool  state)
inline

Defines if the polyline is considered as processed polyline.

Parameters
stateif true, the polyline is 2D

Definition at line 68 of file ecvPolyline.h.

Referenced by cloudViewer::geometry::pybind_polyline().

◆ setVertexMarkerWidth()

void ccPolyline::setVertexMarkerWidth ( int  width)
inline

Sets the width of vertex markers.

Definition at line 137 of file ecvPolyline.h.

References width.

Referenced by define_ccPolyline(), cloudViewer::geometry::pybind_polyline(), and qCanupo2DViewDialog::resetBoundary().

◆ setWidth()

◆ showArrow()

void ccPolyline::showArrow ( bool  state,
unsigned  vertIndex,
PointCoordinateType  length 
)

Shows an arrow in place of a given vertex.

Referenced by define_ccPolyline(), and cloudViewer::geometry::pybind_polyline().

◆ showVertices()

void ccPolyline::showVertices ( bool  state)
inline

Sets whether to display or hide the polyline vertices.

Definition at line 129 of file ecvPolyline.h.

Referenced by contourPoly(), contourPoly2(), define_ccPolyline(), cloudViewer::geometry::pybind_polyline(), and qCanupo2DViewDialog::resetBoundary().

◆ smoothChaikin()

ccPolyline* ccPolyline::smoothChaikin ( PointCoordinateType  ratio,
unsigned  iterationCount 
) const

Smoothes the polyline (Chaikin algorithm)

Parameters
ratiobetween 0 and 0.5 (excluded)
iterationCountof iteration
Returns
smoothed polyline

Referenced by define_ccPolyline().

◆ split()

bool ccPolyline::split ( PointCoordinateType  maxEdgeLength,
std::vector< ccPolyline * > &  parts 
)

Splits the polyline into several parts based on a maximum edge length.

Warning
output polylines set (parts) may be empty if all the vertices are too far from each other!
Parameters
maxEdgeLengthmaximum edge length
[out]partsoutput polyline parts
Returns
success

Referenced by ccContourExtractor::ExtractFlatContour().

◆ toFile_MeOnly()

bool ccPolyline::toFile_MeOnly ( QFile &  out,
short  dataVersion 
) const
overrideprotectedvirtual

Save own object data.

Called by 'toFile' (recursive scheme) To be overloaded (but still called ;) by subclass.

Parameters
outoutput file
dataVersiontarget file version for compatibility control

Reimplemented from ccHObject.

◆ Transform()

virtual ccPolyline& ccPolyline::Transform ( const Eigen::Matrix4d &  transformation)
overridevirtual

Apply transformation (4x4 matrix) to the geometry coordinates.

Reimplemented from ccHObject.

◆ Translate()

virtual ccPolyline& ccPolyline::Translate ( const Eigen::Vector3d &  translation,
bool  relative = true 
)
overridevirtual

Apply translation to the geometry coordinates.

Parameters
translationA 3D vector to transform the geometry.
relativeIf true, the translation is directly applied to the geometry. Otherwise, the geometry center is moved to the translation.

Reimplemented from ccHObject.

◆ verticesShown()

bool ccPolyline::verticesShown ( ) const
inline

Whether the polyline vertices should be displayed or not.

Definition at line 131 of file ecvPolyline.h.

Referenced by define_ccPolyline(), and cloudViewer::geometry::pybind_polyline().

Member Data Documentation

◆ m_arrowIndex

unsigned ccPolyline::m_arrowIndex
protected

Arrow index.

Definition at line 279 of file ecvPolyline.h.

◆ m_arrowLength

PointCoordinateType ccPolyline::m_arrowLength
protected

Arrow length.

Definition at line 277 of file ecvPolyline.h.

◆ m_foreground

bool ccPolyline::m_foreground
protected

Whether polyline should draws itself in background (false) or foreground (true)

Definition at line 266 of file ecvPolyline.h.

◆ m_mode2D

bool ccPolyline::m_mode2D
protected

Whether polyline should be considered as 2D (true) or 3D (false)

Definition at line 259 of file ecvPolyline.h.

◆ m_needTransform

bool ccPolyline::m_needTransform
protected

Whether polyline should be considered as processed polyline.

Definition at line 262 of file ecvPolyline.h.

◆ m_rgbColor

ecvColor::Rgb ccPolyline::m_rgbColor
protected

Unique RGB color.

Definition at line 253 of file ecvPolyline.h.

◆ m_showArrow

bool ccPolyline::m_showArrow
protected

Whether to show an arrow or not.

Definition at line 275 of file ecvPolyline.h.

◆ m_showVertices

bool ccPolyline::m_showVertices
protected

Whether vertices should be displayed or not.

Definition at line 269 of file ecvPolyline.h.

◆ m_vertMarkWidth

int ccPolyline::m_vertMarkWidth
protected

Vertex marker width.

Definition at line 272 of file ecvPolyline.h.

◆ m_width

PointCoordinateType ccPolyline::m_width
protected

Width of the line.

Definition at line 256 of file ecvPolyline.h.

Referenced by ccTrace::drawMeOnly().


The documentation for this class was generated from the following file: