 |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Go to the documentation of this file.
52 static ccHObject* New(
const QString& pluginId,
53 const QString& classId,
54 const char*
name =
nullptr);
59 static Eigen::Vector3d ComputeMinBound(
60 const std::vector<Eigen::Vector3d>&
points);
62 static Eigen::Vector3d ComputeMaxBound(
63 const std::vector<Eigen::Vector3d>&
points);
65 static Eigen::Vector3d ComputeCenter(
66 const std::vector<Eigen::Vector3d>&
points);
73 static void ResizeAndPaintUniformColor(std::vector<Eigen::Vector3d>&
colors,
75 const Eigen::Vector3d&
color);
82 std::vector<Eigen::Vector3d>&
points);
88 std::vector<Eigen::Vector3d>&
normals);
94 static void TransformCovariances(
const Eigen::Matrix4d& transformation,
95 std::vector<Eigen::Matrix3d>& covariances);
104 static void TranslatePoints(
const Eigen::Vector3d& translation,
105 std::vector<Eigen::Vector3d>&
points,
115 static void ScalePoints(
const double scale,
116 std::vector<Eigen::Vector3d>&
points,
117 const Eigen::Vector3d& center);
125 std::vector<Eigen::Vector3d>&
points,
126 const Eigen::Vector3d& center);
132 std::vector<Eigen::Vector3d>&
normals);
138 static void RotateCovariances(
const Eigen::Matrix3d& R,
139 std::vector<Eigen::Matrix3d>& covariances);
144 virtual Eigen::Vector3d
GetMinBound()
const {
return Eigen::Vector3d(); }
147 virtual Eigen::Vector3d
GetMaxBound()
const {
return Eigen::Vector3d(); }
150 virtual Eigen::Vector3d
GetCenter()
const {
return Eigen::Vector3d(); }
153 virtual ccBBox GetAxisAlignedBoundingBox()
const;
166 bool relative =
true) {
187 const Eigen::Vector3d& center) {
191 return Rotate(R, GetCenter());
195 static Eigen::Matrix3d GetRotationMatrixFromXYZ(
198 static Eigen::Matrix3d GetRotationMatrixFromYZX(
201 static Eigen::Matrix3d GetRotationMatrixFromZXY(
204 static Eigen::Matrix3d GetRotationMatrixFromXZY(
207 static Eigen::Matrix3d GetRotationMatrixFromZYX(
210 static Eigen::Matrix3d GetRotationMatrixFromYXZ(
213 static Eigen::Matrix3d GetRotationMatrixFromAxisAngle(
216 static Eigen::Matrix3d GetRotationMatrixFromQuaternion(
219 static Eigen::Matrix3d GetRotationMatrixFromEulerAngle(
253 virtual QIcon getIcon()
const;
259 DP_NOTIFY_OTHER_ON_DELETE = 1,
261 DP_NOTIFY_OTHER_ON_UPDATE =
266 DP_PARENT_OF_OTHER = 24,
276 void addDependency(
ccHObject* otherObject,
int flags,
bool additive =
true);
281 int getDependencyFlagsWith(
const ccHObject* otherObject);
286 void removeDependencyWith(
ccHObject* otherObject);
292 void removeDependencyFlag(
ccHObject* otherObject, DEPENDENCY_FLAGS flag);
306 int dependencyFlags = DP_PARENT_OF_OTHER,
307 int insertIndex = -1);
313 return static_cast<unsigned>(m_children.size());
319 unsigned int getChildCountRecursive()
const;
326 return (childPos < getChildrenNumber() ? m_children[childPos]
340 using Shared = QSharedPointer<ccHObject>;
352 unsigned filterChildren(
Container& filteredChildren,
353 bool recursive =
false,
355 bool strict =
false)
const;
367 void detachAllChildren();
370 void getTypeID_recursive(std::vector<removeInfo>& rmInfos,
bool relative);
371 void getTypeID_recursive(std::vector<hideInfo>& hdInfos,
bool relative);
379 void removeChild(
int pos);
381 void removeAllChildren();
383 int getChildIndex(
const ccHObject* aChild)
const;
385 void swapChildren(
unsigned firstChildIndex,
unsigned secondChildIndex);
387 int getIndex()
const;
392 void transferChildren(
ccHObject& newParent,
393 bool forceFatherDependent =
false);
397 return (m_children.empty() ?
nullptr : m_children.front());
401 return (m_children.empty() ?
nullptr : m_children.back());
405 bool isAncestorOf(
const ccHObject* anObject)
const;
407 void removeFromRenderScreen(
bool recursive =
true);
410 void hideObject_recursive(
bool recursive);
419 virtual ccBBox getOwnBB(
bool withGLFeatures =
false);
421 void setRedrawFlagRecursive(
bool redraw =
false);
422 void setForceRedrawRecursive(
bool redraw =
false);
424 void setPointSizeRecursive(
int pSize);
432 virtual ccBBox getBB_recursive(
bool withGLFeatures =
false,
433 bool onlyEnabledChildren =
true);
464 bool withGLFeatures =
false,
bool onlyEnabledChildren =
true);
474 virtual ccBBox getDisplayBB_recursive(
bool relative);
494 void updateNameIn3DRecursive();
501 virtual void redrawDisplay(
bool forceRedraw =
true,
bool only2D =
false);
508 bool getAbsoluteGLTransformation(
ccGLMatrix& trans)
const;
511 virtual bool isDisplayed()
const;
514 virtual bool isBranchEnabled()
const;
519 #define ccHObject_recursive_call0(baseName, recursiveName) \
520 inline virtual void recursiveName() { \
522 for (Container::iterator it = m_children.begin(); \
523 it != m_children.end(); ++it) \
524 (*it)->recursiveName(); \
528 #define ccHObject_recursive_call1(baseName, param1Type, recursiveName) \
529 inline virtual void recursiveName(param1Type p) { \
531 for (Container::iterator it = m_children.begin(); \
532 it != m_children.end(); ++it) \
533 (*it)->recursiveName(p); \
541 setSelected_recursive)
543 toggleActivation_recursive)
545 toggleVisibility_recursive)
547 toggleColors_recursive)
549 resetGLTransformationHistory,
550 resetGLTransformationHistory_recursive)
553 toggleNormals_recursive)
559 toggleShowName_recursive);
562 unsigned findMaxUniqueID_recursive()
const;
569 void applyGLTransformation_recursive(
const ccGLMatrix* trans =
nullptr);
573 virtual void notifyGeometryUpdate();
577 bool toFile(QFile& out,
short dataVersion)
const override;
593 bool fromFileNoChildren(QFile& in,
617 m_selectionBehavior = mode;
622 return m_selectionBehavior;
632 return m_glTransHistory;
636 m_glTransHistory = mat;
640 m_glTransHistory.toIdentity();
662 virtual void applyGLTransformation(
const ccGLMatrix& trans);
670 virtual bool toFile_MeOnly(QFile& out,
short dataVersion)
const;
681 virtual bool fromFile_MeOnly(QFile& in,
684 LoadedIDMap& oldToNewIDMap);
691 virtual short minimumFileVersion_MeOnly()
const;
696 virtual void drawNameIn3D();
701 virtual void onDeletionOf(
const ccHObject* obj);
746 for (
size_t i = 0; i <
count; ++i) {
748 bool isSiblingOfAnotherOne =
false;
749 for (
size_t j = 0; j <
count; ++j) {
751 isSiblingOfAnotherOne =
true;
756 if (!isSiblingOfAnotherOne) {
double colors[3]
Definition: TriangleMeshIO.cpp:53
bool fromFile(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
Reimplemented from ccSerializableObject::fromFile.
Definition: ecvObject.cpp:234
QMultiMap< unsigned, unsigned > LoadedIDMap
Map of loaded unique IDs (old ID --> new ID)
Definition: ecvSerializableObject.h:61
virtual void setParent(ccHObject *anObject)
Sets parent object.
Definition: ecvHObject.h:652
std::map< ccHObject *, int > m_dependencies
Dependencies map.
Definition: ecvHObject.h:721
virtual void onUpdateOf(ccHObject *obj)
This method is called when another object (geometry) is updated.
Definition: ecvHObject.h:706
ccHObject * getParent() const
Returns parent object.
Definition: ecvHObject.h:245
virtual Eigen::Vector2d GetMax2DBound() const
Definition: ecvHObject.h:148
virtual bool pushDisplayState()
Pushes the current display state.
Definition: ecvDrawableObject.cpp:154
bool isGroup() const
Returns whether the instance is a group.
Definition: ecvHObject.h:237
virtual SelectionBehavior getSelectionBehavior() const
Returns selection behavior.
Definition: ecvHObject.h:621
Bounding box structure.
Definition: ecvBBox.h:25
virtual Eigen::Vector3d GetCenter() const
Returns the center of the geometry coordinates.
Definition: ecvHObject.h:150
math::float4 color
Definition: LineSetBuffers.cpp:46
DEPENDENCY_FLAGS
Dependency flags.
Definition: ecvHObject.h:257
virtual void draw(CC_DRAW_CONTEXT &context)=0
Draws entity and its children.
virtual bool isSerializable() const
Returns whether object is serializable of not.
Definition: ecvSerializableObject.h:31
std::vector< ccHObject * > Container
Standard instances container (for children, etc.)
Definition: ecvHObject.h:337
virtual ccHObject & Rotate(const Eigen::Matrix3d &R, const Eigen::Vector3d ¢er)
Apply rotation to the geometry coordinates and normals. Given a rotation matrix , and center ,...
Definition: ecvHObject.h:186
double normals[3]
Definition: TriangleMeshIO.cpp:54
SelectionBehavior m_selectionBehavior
Selection behavior.
Definition: ecvHObject.h:715
Generic "CLOUDVIEWER Object" template.
Definition: ecvObject.h:49
virtual ccHObject & Rotate(const Eigen::Matrix3d &R)
Definition: ecvHObject.h:190
int width
Definition: FileIOFactory.cpp:142
CV_CLASS_ENUM getClassID() const override
Returns class ID.
Definition: ecvHObject.h:232
int64_t CV_CLASS_ENUM
Type of object type flags (64 bits)
Definition: CVTypes.h:97
short minimumFileVersion() const override
Returns the minimum file version required to save this instance.
Definition: ecvObject.cpp:187
ImGuiContext * context
Definition: Window.cpp:76
@ SELECTION_FIT_BBOX
Definition: ecvHObject.h:607
int size
Definition: FileIOFactory.cpp:130
virtual ccHObject & Scale(const double s)
Definition: ecvHObject.h:179
bool m_isDeleting
Flag to safely handle dependencies when the object is being deleted.
Definition: ecvHObject.h:730
QSharedPointer< ccHObject > Shared
Shared pointer.
Definition: ecvHObject.h:340
bool toFile(QFile &out, short dataVersion) const override
Saves data to binary stream.
Definition: ecvObject.cpp:127
virtual Eigen::Vector3d GetMaxBound() const
Returns max bounds for geometry coordinates.
Definition: ecvHObject.h:147
ENTITY_TYPE
Definition: ecvDrawContext.h:50
Generic interface for (3D) drawable entities.
Definition: ecvDrawableObject.h:24
static void TransformPoints(fgr::Points &points, const Eigen::Matrix4f &Trans)
Definition: FastGlobalRegistration.cpp:78
virtual ccHObject & Transform(const Eigen::Matrix4d &transformation)
Apply transformation (4x4 matrix) to the geometry coordinates.
Definition: ecvHObject.h:157
int points
Definition: FileIOFactory.cpp:144
#define ccHObject_recursive_call1(baseName, param1Type, recursiveName)
Definition: ecvHObject.h:528
virtual unsigned getUniqueIDForDisplay() const
Returns object unqiue ID used for display.
Definition: ecvHObject.h:626
#define ccHObject_recursive_call0(baseName, recursiveName)
Definition: ecvHObject.h:519
Eigen::Vector3d origin
Definition: VoxelGridIO.cpp:26
std::vector< Shared > SharedContainer
Shared instances container (for children, etc.)
Definition: ecvHObject.h:343
unsigned getChildrenNumber() const
Returns the number of children.
Definition: ecvHObject.h:312
virtual Eigen::Vector2d GetMin2DBound() const
Definition: ecvHObject.h:145
Float version of ccGLMatrixTpl.
Definition: ecvGLMatrix.h:19
ccGLMatrix m_glTransHistory
Cumulative GL transformation.
Definition: ecvHObject.h:727
virtual unsigned getUniqueID() const
Returns object unique ID.
Definition: ecvObject.h:86
int count
Definition: FileIOFactory.cpp:132
@ HIERARCHY_OBJECT
Definition: CVTypes.h:103
SelectionBehavior
Behavior when selected.
Definition: ecvHObject.h:605
RGB color structure.
Definition: ecvColorTypes.h:49
ccHObject * getChild(unsigned childPos) const
Returns the ith child.
Definition: ecvHObject.h:325
virtual void setSelectionBehavior(SelectionBehavior mode)
Sets selection behavior (when displayed)
Definition: ecvHObject.h:616
virtual Eigen::Vector3d GetMinBound() const
Returns min bounds for geometry coordinates.
Definition: ecvHObject.h:144
Definition: ecvOrientedBBox.h:29
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
ccHObject * getFirstChild() const
Shortcut: returns first child.
Definition: ecvHObject.h:396
Bounding box structure.
Definition: BoundingBox.h:25
virtual void popDisplayState(bool apply=true)
Pops the last pushed display state.
Definition: ecvDrawableObject.cpp:165
virtual void resetGLTransformationHistory()
Resets the transformation 'history' matrix.
Definition: ecvHObject.h:639
@ DP_NONE
Definition: ecvHObject.h:258
#define CV_DB_LIB_API
Definition: CV_db.h:15
Display context.
Definition: ecvDrawContext.h:365
Eigen::Matrix3d rotation
Definition: VoxelGridIO.cpp:27
virtual ccHObject & Translate(const Eigen::Vector3d &translation, bool relative=true)
Apply translation to the geometry coordinates.
Definition: ecvHObject.h:165
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
virtual bool isShareable() const
Returns whether object is shareable or not.
Definition: ecvHObject.h:602
virtual const ccGLMatrix & getGLTransformationHistory() const
Returns the transformation 'history' matrix.
Definition: ecvHObject.h:631
ccHObject * m_parent
Parent.
Definition: ecvHObject.h:709
virtual bool IsEmpty() const
Definition: ecvHObject.h:142
virtual ccHObject & Scale(const double s, const Eigen::Vector3d ¢er)
Apply scaling to the geometry coordinates. Given a scaling factor , and center , a given point is tr...
Definition: ecvHObject.h:176
virtual void setGLTransformationHistory(const ccGLMatrix &mat)
Sets the transformation 'history' matrix (handle with care!)
Definition: ecvHObject.h:635
ccHObject * getLastChild() const
Shortcut: returns last child.
Definition: ecvHObject.h:400
virtual bool addChild(ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1)
Adds a child.
Definition: ecvHObject.cpp:534
@ OBJECT
Definition: CVTypes.h:102
Container m_children
Children.
Definition: ecvHObject.h:712
void ConvertToGroup(const ccHObject::Container &origin, ccHObject &dest, int dependencyFlags=ccHObject::DP_NONE)
Puts all entities inside a container in a group.
Definition: ecvHObject.h:742
virtual void drawMeOnly(CC_DRAW_CONTEXT &context)
Draws the entity only (not its children)
Definition: ecvHObject.h:655
virtual CV_CLASS_ENUM getClassID() const =0
Returns class ID.
std::string name
Definition: FileIOFactory.cpp:129
@ SELECTION_AA_BBOX
Definition: ecvHObject.h:606
QString getViewId() const
Definition: ecvHObject.h:225