21 m_DisplayScale(displayScale),
23 m_showAxisPlanes(true),
24 m_showAxisLines(true) {
33 m_DisplayScale(DEFAULT_DISPLAY_SCALE),
34 m_width(AXIS_DEFAULT_WIDTH),
35 m_showAxisPlanes(true),
36 m_showAxisLines(true) {
44 m_DisplayScale(DEFAULT_DISPLAY_SCALE),
45 m_width(AXIS_DEFAULT_WIDTH),
46 m_showAxisPlanes(true),
47 m_showAxisLines(true) {
75 plane->clearTriNormals();
76 plane->ComputeTriangleNormals();
81 plane->clearTriNormals();
82 plane->ComputeTriangleNormals();
87 plane->clearTriNormals();
88 plane->ComputeTriangleNormals();
110 xyPlane_mtrx = *transMat * xyPlane_mtrx;
125 yzPlane_mtrx = *transMat * yzPlane_mtrx;
140 zxPlane_mtrx = *transMat * zxPlane_mtrx;
178 assert(out.isOpen() && (out.openMode() & QIODevice::WriteOnly));
179 if (dataVersion < 52) {
187 QDataStream outStream(&out);
195 return std::max(
static_cast<short>(52),
208 QDataStream inStream(&in);
233 static_cast<unsigned char>(
m_width);
261 Eigen::Matrix4d transformation =
Vector3Tpl< PointCoordinateType > CCVector3
Default 3D Vector.
float PointCoordinateType
Type of the coordinates of a (N-D) point.
void clear(bool releaseMemory=false)
PointCoordinateType m_DisplayScale
CoordinateSystem options.
static constexpr float MIN_DISPLAY_SCALE_F
Minimum Display scale.
cloudViewer::geometry::LineSet m_axis
PointCoordinateType m_width
ccPlane createZXplane(const ccGLMatrix *transMat=nullptr) const
static constexpr float MIN_AXIS_WIDTH_F
Minimum Axis line width.
void ShowAxisLines(bool show)
short minimumFileVersion_MeOnly() const override
void ShowAxisPlanes(bool show)
static constexpr PointCoordinateType AXIS_DEFAULT_WIDTH
Default Axis line width.
std::shared_ptr< ccPlane > getXYplane() const
ccPlane createYZplane(const ccGLMatrix *transMat=nullptr) const
virtual ccGenericPrimitive * clone() const override
Clones primitive.
virtual void hideShowDrawings(CC_DRAW_CONTEXT &context) override
static constexpr float MAX_AXIS_WIDTH_F
Maximum Axis line width.
void setDisplayScale(PointCoordinateType scale)
bool fromFile_MeOnly(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
Loads own object data.
ccPlane createXYplane(const ccGLMatrix *transMat=nullptr) const
bool toFile_MeOnly(QFile &out, short dataVersion) const override
Save own object data.
std::shared_ptr< ccPlane > getZXplane() const
virtual void clearDrawings() override
ccCoordinateSystem(PointCoordinateType displayScale, PointCoordinateType axisWidth, const ccGLMatrix *transMat=nullptr, QString name=QString("CoordinateSystem"))
Default constructor.
void drawMeOnly(CC_DRAW_CONTEXT &context) override
Draws the entity only (not its children)
std::shared_ptr< ccPlane > getYZplane() const
void setAxisWidth(PointCoordinateType width)
virtual bool buildUp() override
Builds primitive.
virtual void showColors(bool state)
Sets colors visibility.
void setTranslation(const Vector3Tpl< float > &Tr)
Sets translation (float version)
void initFromParameters(T alpha_rad, const Vector3Tpl< T > &axis3D, const Vector3Tpl< T > &t3D)
Inits transformation from a rotation axis, an angle and a translation.
virtual void toIdentity()
Sets matrix to identity.
static Eigen::Matrix< double, 4, 4 > ToEigenMatrix4(const ccGLMatrixTpl< float > &mat)
Float version of ccGLMatrixTpl.
Generic primitive interface.
virtual void setColor(const ecvColor::Rgb &col)
Sets primitive color (shortcut)
virtual bool updateRepresentation()
Updates internal representation (as a mesh)
ccGenericPrimitive * finishCloneJob(ccGenericPrimitive *primitive) const
Finished 'clone' job (vertices color, etc.)
ccPointCloud * vertices()
Returns vertices.
virtual void clearDrawings()
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.
ccGLMatrix m_transformation
Associated transformation (applied to vertices)
short minimumFileVersion_MeOnly() const override
QString getViewId() const
void setRedrawFlagRecursive(bool redraw=false)
void drawMeOnly(CC_DRAW_CONTEXT &context) override
Enables (OpenGL) stipple mask.
void removePerTriangleNormalIndexes()
Removes any per-triangle triplets of normal indexes.
virtual unsigned size() const override
Returns the number of triangles.
NormsIndexesTableType * m_triNormals
Per-triangle normals.
triangleIndexesContainer * m_triVertIndexes
Triangles' vertices indexes (3 per triangle)
virtual QString getName() const
Returns object name.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
void clear() override
Clears the entity from all its points and features.
QMultiMap< unsigned, unsigned > LoadedIDMap
Map of loaded unique IDs (old ID --> new ID)
static void CoordsFromDataStream(QDataStream &stream, int flags, PointCoordinateType *out, unsigned count=1)
std::vector< Eigen::Vector3d > points_
Points coordinates.
std::vector< Eigen::Vector3d > colors_
RGB colors of lines.
std::vector< Eigen::Vector2i > lines_
Lines denoted by the index of points forming the line.
virtual LineSet & Transform(const Eigen::Matrix4d &transformation) override
Apply transformation (4x4 matrix) to the geometry coordinates.
#define MACRO_Draw3D(context)
constexpr Rgb red(MAX, 0, 0)
constexpr Rgb green(0, MAX, 0)
constexpr Rgb yellow(MAX, MAX, 0)
Eigen::Matrix< Index, 2, 1 > Vector2i
unsigned char currentLineWidth