ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccMapWindow.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // CV_DB_LIB
11 #include <ecvDisplayTools.h>
12 #include <ecvScalarField.h>
13 
15 class ccMapWindow : public QWidget {
16 public:
18  explicit ccMapWindow(QWidget* parent = 0)
19  : QWidget(parent), m_sfForRampDisplay(0), m_showSF(true) {}
20 
23 
25 
28  if (m_sfForRampDisplay != sf) {
30 
31  m_sfForRampDisplay = sf;
32 
34  }
35  }
36 
38  void showSF(bool state) { m_showSF = state; }
39 
41  bool sfShown() const { return m_showSF; }
42 
45  return m_sfForRampDisplay;
46  }
47 
48  // inherited fro ecvDisplayTools
51 
52  if (m_showSF) {
53  // override sf that will be used for color ramp display
54  context.sfColorScaleToDisplay = m_sfForRampDisplay;
55  }
56  }
57 
58 protected:
61 
63  bool m_showSF;
64 };
ccMapWindow::getContext
virtual void getContext(CC_DRAW_CONTEXT &context)
Definition: ccMapWindow.h:49
ccMapWindow::m_showSF
bool m_showSF
Whether to show or not the associated SF.
Definition: ccMapWindow.h:63
M_PI
constexpr double M_PI
Pi.
Definition: CVConst.h:19
ccDefaultPluginInterface::getDescription
virtual QString getDescription() const override
Returns long name/description (for tooltip, etc.)
Definition: ecvDefaultPluginInterface.cpp:104
ccDrawableObject::showNormals
virtual void showNormals(bool state)
Sets normals visibility.
Definition: ecvDrawableObject.h:93
Vector3Tpl::normalize
void normalize()
Sets vector norm to unity.
Definition: CVGeom.h:428
ccDefaultPluginInterface::getName
virtual QString getName() const override
Returns (short) name (for menu entry, etc.)
Definition: ecvDefaultPluginInterface.cpp:100
Tuple3Tpl::x
Type x
Definition: CVGeom.h:137
s_proba
static double s_proba
Definition: qRANSAC_SD.cpp:111
s_maxNormalDev_deg
static double s_maxNormalDev_deg
Definition: qRANSAC_SD.cpp:109
ccMapWindow::showSF
void showSF(bool state)
Whether to show associated SF or not.
Definition: ccMapWindow.h:38
CVPlatform.h
s_primEnabled
static bool s_primEnabled[5]
Definition: qRANSAC_SD.cpp:113
ccGenericPrimitive::setColor
virtual void setColor(const ecvColor::Rgb &col)
Sets primitive color (shortcut)
Definition: ecvGenericPrimitive.cpp:30
normal
double normal[3]
Definition: FileIOFactory.cpp:53
s_app
static ecvMainAppInterface * s_app
Definition: qRANSAC_SD.cpp:57
ecvMainAppInterface::getMainWindow
virtual QMainWindow * getMainWindow()=0
Returns main window.
ccHObject::setRedrawFlagRecursive
void setRedrawFlagRecursive(bool redraw=false)
Definition: ecvHObject.cpp:772
ccObject::setName
virtual void setName(const QString &name)
Sets object name.
Definition: ecvObject.h:75
ccObject::isA
bool isA(CV_CLASS_ENUM type) const
Definition: ecvObject.h:131
ecvCone.h
ccPointCloud::getPointNormal
const CCVector3 & getPointNormal(unsigned pointIndex) const override
Returns normal corresponding to a given point.
Definition: ecvPointCloud.cpp:1555
ccShiftedObject::setGlobalScale
virtual void setGlobalScale(double scale)
Definition: ecvShiftedObject.cpp:33
ccGLMatrixTpl::setTranslation
void setTranslation(const Vector3Tpl< float > &Tr)
Sets translation (float version)
Definition: ecvGLMatrixTpl.h:836
CV_TYPES::POINT_CLOUD
@ POINT_CLOUD
Definition: CVTypes.h:104
cloudViewer::PointCloudTpl::getPoint
const CCVector3 * getPoint(unsigned index) const override
Definition: PointCloudTpl.h:143
ecvDisplayTools.h
ScalarField.h
s_detector
static RansacShapeDetector * s_detector
Definition: qRANSAC_SD.cpp:97
cloudViewer::PointCloudTpl::size
unsigned size() const override
Definition: PointCloudTpl.h:38
ccPointCloud
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Definition: ecvPointCloud.h:146
ccMapWindow::getAssociatedScalarField
ccScalarField * getAssociatedScalarField() const
Returns associated scalar field.
Definition: ccMapWindow.h:44
ccNormalVectors::ConvertNormalToDipAndDipDir
static void ConvertNormalToDipAndDipDir(const CCVector3 &N, PointCoordinateType &dip_deg, PointCoordinateType &dipDir_deg)
Converts a normal vector to geological 'dip direction & dip' parameters.
Definition: ecvNormalVectors.cpp:848
ccRansacSDDlg.h
s_cloud
static ransac::RansacPointCloud * s_cloud
Definition: qRANSAC_SD.cpp:98
ecvSphere.h
ccSphere
Sphere (primitive)
Definition: ecvSphere.h:16
ecvPlane.h
ccHObject::Container
std::vector< ccHObject * > Container
Standard instances container (for children, etc.)
Definition: ecvHObject.h:337
ecvGenericMesh.h
ccPointCloud::WRN_OUT_OF_MEM_FOR_NORMALS
@ WRN_OUT_OF_MEM_FOR_NORMALS
Definition: ecvPointCloud.h:210
ecvTorus.h
CVLog::Error
static bool Error(const char *format,...)
Display an error dialog with formatted message.
Definition: CVLog.cpp:143
s_maxNormalDev_deg
static double s_maxNormalDev_deg
Definition: ccRansacSDDlg.cpp:14
context
ImGuiContext * context
Definition: Window.cpp:76
ccHObject::SELECTION_FIT_BBOX
@ SELECTION_FIT_BBOX
Definition: ecvHObject.h:607
ccDrawableObject::showColors
virtual void showColors(bool state)
Sets colors visibility.
Definition: ecvDrawableObject.h:84
doDetection
void doDetection()
Definition: qRANSAC_SD.cpp:99
ccShiftedObject::getGlobalShift
virtual const CCVector3d & getGlobalShift() const
Returns the shift applied to original coordinates.
Definition: ecvShiftedObject.h:46
ccMapWindow::ccMapWindow
ccMapWindow(QWidget *parent=0)
Default constructor.
Definition: ccMapWindow.h:18
ecvMainAppInterface
Main application interface (for plugins)
Definition: ecvMainAppInterface.h:24
s_minRadius
static float s_minRadius
Definition: qRANSAC_SD.cpp:115
s_supportPoints
static unsigned s_supportPoints
Definition: qRANSAC_SD.cpp:107
Vector3Tpl< PointCoordinateType >
ccPointCloud::reserveTheNormsTable
bool reserveTheNormsTable()
Reserves memory to store the compressed normals.
Definition: ecvPointCloud.cpp:1253
ccCone
Cone (primitive)
Definition: ecvCone.h:16
ccRansacSDDlg
Dialog for qRansacSD plugin.
Definition: ccRansacSDDlg.h:13
qRansacSD::m_action
QAction * m_action
Associated action.
Definition: qRANSAC_SD.h:99
ccPointCloud::addNorm
void addNorm(const CCVector3 &N)
Pushes a normal vector on stack (shortcut)
Definition: ecvPointCloud.cpp:1754
ccCommandLineInterface::Command::Shared
QSharedPointer< Command > Shared
Shared type.
Definition: ecvCommandLineInterface.h:132
ecvGenericPointCloud.h
ccPointCloud::partialClone
ccPointCloud * partialClone(const cloudViewer::ReferenceCloud *selection, int *warnings=nullptr, bool withChildEntities=true) const
Creates a new point cloud object from a ReferenceCloud (selection)
Definition: ecvPointCloud.cpp:290
Ui
Definition: sfEditDlg.h:16
ccHObject::applyGLTransformation_recursive
void applyGLTransformation_recursive(const ccGLMatrix *trans=nullptr)
Applies the active OpenGL transformation to the entity (recursive)
Definition: ecvHObject.cpp:948
ccNormalVectors::ConvertDipAndDipDirToString
static QString ConvertDipAndDipDirToString(PointCoordinateType dip_deg, PointCoordinateType dipDir_deg)
Converts geological 'dip direction & dip' parameters to a string.
Definition: ecvNormalVectors.cpp:815
ccMapWindow::setAssociatedScalarField
void setAssociatedScalarField(ccScalarField *sf)
Sets associated scalar-field.
Definition: ccMapWindow.h:27
ccPointCloud::reserve
bool reserve(unsigned numberOfPoints) override
Reserves memory for all the active features.
Definition: ecvPointCloud.cpp:1452
CCShareable::link
virtual void link()
Increase counter.
Definition: CVShareable.cpp:33
ccStdPluginInterface::m_app
ecvMainAppInterface * m_app
Main application interface.
Definition: ecvStdPluginInterface.h:85
CCShareable::release
virtual void release()
Decrease counter and deletes object when 0.
Definition: CVShareable.cpp:35
ccMapWindow::m_sfForRampDisplay
ccScalarField * m_sfForRampDisplay
Associated scalar field.
Definition: ccMapWindow.h:60
ecvMainAppInterface::getActiveWindow
virtual QWidget * getActiveWindow()=0
s_remainingPoints
static size_t s_remainingPoints
Definition: qRANSAC_SD.cpp:96
ccPointCloud::hasNormals
bool hasNormals() const override
Returns whether normals are enabled or not.
Definition: ecvPointCloud.cpp:1693
ecvScalarField.h
ccTorus
Torus (primitive)
Definition: ecvTorus.h:16
s_shapes
static MiscLib::Vector< std::pair< MiscLib::RefCountPtr< PrimitiveShape >, size_t > > * s_shapes
Definition: qRANSAC_SD.cpp:95
ccDrawableObject::showSF
virtual void showSF(bool state)
Sets active scalarfield visibility.
Definition: ecvDrawableObject.h:108
s_randomColor
static bool s_randomColor
Definition: qRANSAC_SD.cpp:119
cloudViewer::PointCloudTpl::getBoundingBox
void getBoundingBox(CCVector3 &bbMin, CCVector3 &bbMax) override
Definition: PointCloudTpl.h:57
ccDrawableObject::setVisible
virtual void setVisible(bool state)
Sets entity visibility.
Definition: ecvDrawableObject.h:40
ccMapWindow::sfShown
bool sfShown() const
Returns whether associated SF should be shown or not.
Definition: ccMapWindow.h:41
Tuple3Tpl::z
Type z
Definition: CVGeom.h:137
ccMapWindow
2D map display window
Definition: ccMapWindow.h:15
ccCylinder
Cylinder (primitive)
Definition: ecvCylinder.h:16
qRansacSD::doAction
void doAction()
Slot called when associated ation is triggered.
Definition: qRANSAC_SD.cpp:121
cloudViewer::DegreesToRadians
float DegreesToRadians(int degrees)
Convert degrees to radians.
Definition: CVMath.h:98
ecvMainAppInterface::addToDB
virtual void addToDB(ccHObject *obj, bool updateZoom=false, bool autoExpandDBTree=true, bool checkDimensions=false, bool autoRedraw=true)=0
ccCommandLineInterface
Command line interface.
Definition: ecvCommandLineInterface.h:112
ccHObject::getChildrenNumber
unsigned getChildrenNumber() const
Returns the number of children.
Definition: ecvHObject.h:312
ccGLMatrix
Float version of ccGLMatrixTpl.
Definition: ecvGLMatrix.h:19
ccDefaultPluginInterface::getIcon
virtual QIcon getIcon() const override
Returns icon.
Definition: ecvDefaultPluginInterface.cpp:108
ecvDisplayTools::GetContext
static void GetContext(CC_DRAW_CONTEXT &CONTEXT)
Returns context information.
Definition: ecvDisplayTools.cpp:2398
count
int count
Definition: FileIOFactory.cpp:132
ecvCylinder.h
CVLog::Warning
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
Definition: CVLog.cpp:133
ccPointCloud::setRGBColor
bool setRGBColor(ColorCompType r, ColorCompType g, ColorCompType b)
Set a unique color for the whole cloud (shortcut)
Definition: ecvPointCloud.h:778
ecvMainAppInterface::getSelectedEntities
virtual const ccHObject::Container & getSelectedEntities() const =0
Returns currently selected entities ("read only")
cloudViewer::ReferenceCloud
A very simple point cloud (no point duplication)
Definition: ReferenceCloud.h:29
ecvColor::RgbTpl
RGB color structure.
Definition: ecvColorTypes.h:49
ccMapWindow::~ccMapWindow
virtual ~ccMapWindow()
Destructor.
Definition: ccMapWindow.h:22
ccHObject::setSelectionBehavior
virtual void setSelectionBehavior(SelectionBehavior mode)
Sets selection behavior (when displayed)
Definition: ecvHObject.h:616
ccShiftedObject::getGlobalScale
virtual double getGlobalScale() const
Returns the scale applied to original coordinates.
Definition: ecvShiftedObject.h:53
qRANSAC_SD.h
cloudViewer::utility::Sleep
void Sleep(int milliseconds)
Definition: Helper.cpp:278
ccShiftedObject::setGlobalShift
virtual void setGlobalShift(double x, double y, double z)
Sets shift applied to original coordinates (information storage only)
Definition: ecvShiftedObject.h:33
ccHObject
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
Tuple3Tpl::y
Type y
Definition: CVGeom.h:137
ccObject::getName
virtual QString getName() const
Returns object name.
Definition: ecvObject.h:72
Vector3Tpl::orthogonal
Vector3Tpl orthogonal() const
Returns a normalized vector which is orthogonal to this one.
Definition: CVGeom.h:433
cloudViewer::PointCloudTpl::addPoint
void addPoint(const CCVector3 &P)
Adds a 3D point to the database.
Definition: PointCloudTpl.h:246
ecvColor::Generator::Random
static Rgb Random(bool lightOnly=true)
Generates a random color.
Definition: ecvColorTypes.cpp:84
ccGLDrawContext
Display context.
Definition: ecvDrawContext.h:365
X
void * X
Definition: SmallVector.cpp:45
ccGenericPrimitive
Generic primitive interface.
Definition: ecvGenericPrimitive.h:16
PointCoordinateType
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
ccCommandLineInterface::registerCommand
virtual bool registerCommand(Command::Shared command)=0
Registers a new command.
ccStdPluginInterface
Standard ECV plugin interface.
Definition: ecvStdPluginInterface.h:31
ccRansacSDDlg::ccRansacSDDlg
ccRansacSDDlg(QWidget *parent=0)
Default constructor.
Definition: ccRansacSDDlg.cpp:19
ccRansacSDDlg::saveSettings
void saveSettings()
Saves (temporarily) the dialog parameters on acceptation.
Definition: ccRansacSDDlg.cpp:31
ccHObject::addChild
virtual bool addChild(ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1)
Adds a child.
Definition: ecvHObject.cpp:534
CommandRANSAC
Definition: qRANSAC_SD_Commands.h:49
ccObject::setEnabled
virtual void setEnabled(bool state)
Sets the "enabled" property.
Definition: ecvObject.h:102
Vector3Tpl< PointCoordinateType >::fromArray
static Vector3Tpl fromArray(const int a[3])
Constructor from an int array.
Definition: CVGeom.h:268
ecvOctree.h
qRANSAC_SD_Commands.h
ccPlane
Plane (primitive)
Definition: ecvPlane.h:17
ecvPointCloud.h
s_maxRadius
static float s_maxRadius
Definition: qRANSAC_SD.cpp:117
ccScalarField
A scalar field associated to display-related parameters.
Definition: ecvScalarField.h:19
s_minSupport
static int s_minSupport
Definition: ccRansacSDDlg.cpp:12
s_probability
static double s_probability
Definition: ccRansacSDDlg.cpp:16
ccGenericMesh::enableStippling
void enableStippling(bool state)
Enables polygon stippling.
Definition: ecvGenericMesh.h:207