Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CommonGUI
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Frédéric Larue
CommonGUI
Commits
e38d3668
Commit
e38d3668
authored
Apr 06, 2018
by
Frédéric Larue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial commit from a clean version of ASTexGUI.
parents
Changes
156
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
156 changed files
with
2641 additions
and
0 deletions
+2641
-0
CMakeLists.txt
CMakeLists.txt
+156
-0
GLViewer/Box.h
GLViewer/Box.h
+625
-0
GLViewer/CMakeLists.txt
GLViewer/CMakeLists.txt
+22
-0
GLViewer/GLViewer.cpp
GLViewer/GLViewer.cpp
+0
-0
GLViewer/GLViewer.h
GLViewer/GLViewer.h
+304
-0
GLViewer/InfoBar.cpp
GLViewer/InfoBar.cpp
+265
-0
GLViewer/InfoBar.h
GLViewer/InfoBar.h
+125
-0
GLViewer/InfoBarManager.cpp
GLViewer/InfoBarManager.cpp
+121
-0
GLViewer/InfoBarManager.h
GLViewer/InfoBarManager.h
+60
-0
GLViewer/Label.cpp
GLViewer/Label.cpp
+49
-0
GLViewer/Label.h
GLViewer/Label.h
+68
-0
GLViewer/MetricGrid.cpp
GLViewer/MetricGrid.cpp
+232
-0
GLViewer/MetricGrid.h
GLViewer/MetricGrid.h
+90
-0
GLViewer/Panel.cpp
GLViewer/Panel.cpp
+255
-0
GLViewer/Panel.h
GLViewer/Panel.h
+140
-0
GLViewer/PickedPoint.h
GLViewer/PickedPoint.h
+29
-0
GLViewer/SelectionManager.h
GLViewer/SelectionManager.h
+47
-0
GLViewer/SelectionManagerImageTexels.cpp
GLViewer/SelectionManagerImageTexels.cpp
+0
-0
GLViewer/SelectionManagerImageTexels.h
GLViewer/SelectionManagerImageTexels.h
+53
-0
GLViewer/SelectionManagerMeshTexels.cpp
GLViewer/SelectionManagerMeshTexels.cpp
+0
-0
GLViewer/SelectionManagerMeshTexels.h
GLViewer/SelectionManagerMeshTexels.h
+0
-0
GLViewer/SelectionTool.cpp
GLViewer/SelectionTool.cpp
+0
-0
GLViewer/SelectionTool.h
GLViewer/SelectionTool.h
+0
-0
GLViewer/SelectionToolBox.cpp
GLViewer/SelectionToolBox.cpp
+0
-0
GLViewer/SelectionToolBox.h
GLViewer/SelectionToolBox.h
+0
-0
GLViewer/SelectionToolDisk.cpp
GLViewer/SelectionToolDisk.cpp
+0
-0
GLViewer/SelectionToolDisk.h
GLViewer/SelectionToolDisk.h
+0
-0
GLViewer/SelectionToolLasso.cpp
GLViewer/SelectionToolLasso.cpp
+0
-0
GLViewer/SelectionToolLasso.h
GLViewer/SelectionToolLasso.h
+0
-0
GPU/CMakeLists.txt
GPU/CMakeLists.txt
+0
-0
GPU/FrameBuffer.cpp
GPU/FrameBuffer.cpp
+0
-0
GPU/FrameBuffer.h
GPU/FrameBuffer.h
+0
-0
GPU/GPU.h
GPU/GPU.h
+0
-0
GPU/GPUdefs.h
GPU/GPUdefs.h
+0
-0
GPU/InstantiatedObject.h
GPU/InstantiatedObject.h
+0
-0
GPU/OpenGLVersion.cpp
GPU/OpenGLVersion.cpp
+0
-0
GPU/OpenGLVersion.h
GPU/OpenGLVersion.h
+0
-0
GPU/Shader.cpp
GPU/Shader.cpp
+0
-0
GPU/Shader.h
GPU/Shader.h
+0
-0
GPU/Texture2D.cpp
GPU/Texture2D.cpp
+0
-0
GPU/Texture2D.h
GPU/Texture2D.h
+0
-0
GPU/Texture3D.cpp
GPU/Texture3D.cpp
+0
-0
GPU/Texture3D.h
GPU/Texture3D.h
+0
-0
GPU/TextureCube.cpp
GPU/TextureCube.cpp
+0
-0
GPU/TextureCube.h
GPU/TextureCube.h
+0
-0
GPU/VBO.h
GPU/VBO.h
+0
-0
GUI_main/AlgorithmSelector.cpp
GUI_main/AlgorithmSelector.cpp
+0
-0
GUI_main/AlgorithmSelector.h
GUI_main/AlgorithmSelector.h
+0
-0
GUI_main/AlgorithmSelector.ui
GUI_main/AlgorithmSelector.ui
+0
-0
GUI_main/CMakeLists.txt
GUI_main/CMakeLists.txt
+0
-0
GUI_main/Context.h
GUI_main/Context.h
+0
-0
GUI_main/ToolCategory.cpp
GUI_main/ToolCategory.cpp
+0
-0
GUI_main/ToolCategory.h
GUI_main/ToolCategory.h
+0
-0
GUI_main/UIDataWidget.cpp
GUI_main/UIDataWidget.cpp
+0
-0
GUI_main/UIDataWidget.h
GUI_main/UIDataWidget.h
+0
-0
GUI_main/UIDataWidgetItem.h
GUI_main/UIDataWidgetItem.h
+0
-0
GUI_main/main.cpp
GUI_main/main.cpp
+0
-0
GUI_main/mainapp.qrc
GUI_main/mainapp.qrc
+0
-0
GUI_main/mainwindow.cpp
GUI_main/mainwindow.cpp
+0
-0
GUI_main/mainwindow.h
GUI_main/mainwindow.h
+0
-0
GUI_main/mainwindow.ui
GUI_main/mainwindow.ui
+0
-0
GUI_main/resources/AboutLicences/ArrowLeft.png
GUI_main/resources/AboutLicences/ArrowLeft.png
+0
-0
GUI_main/resources/AboutLicences/CNRS.png
GUI_main/resources/AboutLicences/CNRS.png
+0
-0
GUI_main/resources/AboutLicences/ICube.png
GUI_main/resources/AboutLicences/ICube.png
+0
-0
GUI_main/resources/AboutLicences/IGG.png
GUI_main/resources/AboutLicences/IGG.png
+0
-0
GUI_main/resources/AboutLicences/Licence.OpenEXR.html
GUI_main/resources/AboutLicences/Licence.OpenEXR.html
+0
-0
GUI_main/resources/AboutLicences/Licence.QT.html
GUI_main/resources/AboutLicences/Licence.QT.html
+0
-0
GUI_main/resources/AboutLicences/Licence.ZLib.html
GUI_main/resources/AboutLicences/Licence.ZLib.html
+0
-0
GUI_main/resources/AboutLicences/Unistra.png
GUI_main/resources/AboutLicences/Unistra.png
+0
-0
GUI_main/resources/AboutLicences/main.html
GUI_main/resources/AboutLicences/main.html
+0
-0
GUI_main/resources/AboutLicences/master.css
GUI_main/resources/AboutLicences/master.css
+0
-0
GUI_main/resources/IconsAnimation.svg
GUI_main/resources/IconsAnimation.svg
+0
-0
GUI_main/resources/animationPause.png
GUI_main/resources/animationPause.png
+0
-0
GUI_main/resources/animationStart.png
GUI_main/resources/animationStart.png
+0
-0
GUI_main/resources/animationStepBwd.png
GUI_main/resources/animationStepBwd.png
+0
-0
GUI_main/resources/animationStepFwd.png
GUI_main/resources/animationStepFwd.png
+0
-0
GUI_main/resources/animationStop.png
GUI_main/resources/animationStop.png
+0
-0
GUI_main/resources/categories/Experimental.png
GUI_main/resources/categories/Experimental.png
+0
-0
GUI_main/resources/categories/Fourier.png
GUI_main/resources/categories/Fourier.png
+0
-0
GUI_main/resources/categories/Fourier4.png
GUI_main/resources/categories/Fourier4.png
+0
-0
GUI_main/resources/icon2DViewer.png
GUI_main/resources/icon2DViewer.png
+0
-0
GUI_main/resources/icon3DViewer.png
GUI_main/resources/icon3DViewer.png
+0
-0
GUI_main/resources/iconClone.png
GUI_main/resources/iconClone.png
+0
-0
GUI_main/resources/iconDecreasePointSize.png
GUI_main/resources/iconDecreasePointSize.png
+0
-0
GUI_main/resources/iconIncreasePointSize.png
GUI_main/resources/iconIncreasePointSize.png
+0
-0
GUI_main/resources/iconShading.png
GUI_main/resources/iconShading.png
+0
-0
GUI_main/resources/iconSolid.png
GUI_main/resources/iconSolid.png
+0
-0
GUI_main/resources/iconWireframe.png
GUI_main/resources/iconWireframe.png
+0
-0
Interfaces/CMakeLists.txt
Interfaces/CMakeLists.txt
+0
-0
Interfaces/DisplayableInterface.h
Interfaces/DisplayableInterface.h
+0
-0
Interfaces/ExportInterface.h
Interfaces/ExportInterface.h
+0
-0
Interfaces/ImportInterface.h
Interfaces/ImportInterface.h
+0
-0
Interfaces/Interfaces.h
Interfaces/Interfaces.h
+0
-0
Interfaces/ToolInterface.h
Interfaces/ToolInterface.h
+0
-0
NodeEditor/CMakeLists.txt
NodeEditor/CMakeLists.txt
+0
-0
NodeEditor/GLSLHighlighter.cpp
NodeEditor/GLSLHighlighter.cpp
+0
-0
NodeEditor/GLSLHighlighter.h
NodeEditor/GLSLHighlighter.h
+0
-0
NodeEditor/GenericNode.cpp
NodeEditor/GenericNode.cpp
+0
-0
NodeEditor/GenericNode.h
NodeEditor/GenericNode.h
+0
-0
NodeEditor/LineNumberWidget.cpp
NodeEditor/LineNumberWidget.cpp
+0
-0
NodeEditor/LineNumberWidget.h
NodeEditor/LineNumberWidget.h
+0
-0
NodeEditor/LogErrorWidget.cpp
NodeEditor/LogErrorWidget.cpp
+0
-0
NodeEditor/LogErrorWidget.h
NodeEditor/LogErrorWidget.h
+0
-0
NodeEditor/NodeEditor.h
NodeEditor/NodeEditor.h
+0
-0
NodeEditor/NodeGraph.cpp
NodeEditor/NodeGraph.cpp
+0
-0
NodeEditor/NodeGraph.h
NodeEditor/NodeGraph.h
+0
-0
NodeEditor/NodeGraphView.cpp
NodeEditor/NodeGraphView.cpp
+0
-0
NodeEditor/NodeGraphView.h
NodeEditor/NodeGraphView.h
+0
-0
NodeEditor/NodeIOSlot.cpp
NodeEditor/NodeIOSlot.cpp
+0
-0
NodeEditor/NodeIOSlot.h
NodeEditor/NodeIOSlot.h
+0
-0
NodeEditor/NodeLink.cpp
NodeEditor/NodeLink.cpp
+0
-0
NodeEditor/NodeLink.h
NodeEditor/NodeLink.h
+0
-0
NodeEditor/ShaderEditor.cpp
NodeEditor/ShaderEditor.cpp
+0
-0
NodeEditor/ShaderEditor.h
NodeEditor/ShaderEditor.h
+0
-0
NodeEditor/ShaderSourceEdit.cpp
NodeEditor/ShaderSourceEdit.cpp
+0
-0
NodeEditor/ShaderSourceEdit.h
NodeEditor/ShaderSourceEdit.h
+0
-0
NodeEditor/XMLParser.cpp
NodeEditor/XMLParser.cpp
+0
-0
NodeEditor/XMLParser.h
NodeEditor/XMLParser.h
+0
-0
UIData/CMakeLists.txt
UIData/CMakeLists.txt
+0
-0
UIData/Project.cpp
UIData/Project.cpp
+0
-0
UIData/Project.h
UIData/Project.h
+0
-0
UIData/UIData.h
UIData/UIData.h
+0
-0
UIData/UIDataDefs.h
UIData/UIDataDefs.h
+0
-0
UIParam/CMakeLists.txt
UIParam/CMakeLists.txt
+0
-0
UIParam/FunctionGraphWidget.cpp
UIParam/FunctionGraphWidget.cpp
+0
-0
UIParam/FunctionGraphWidget.h
UIParam/FunctionGraphWidget.h
+0
-0
UIParam/UIParam.h
UIParam/UIParam.h
+0
-0
UIParam/UIParamAction.h
UIParam/UIParamAction.h
+0
-0
UIParam/UIParamAnimation.cpp
UIParam/UIParamAnimation.cpp
+0
-0
UIParam/UIParamAnimation.h
UIParam/UIParamAnimation.h
+0
-0
UIParam/UIParamBoolean.h
UIParam/UIParamBoolean.h
+0
-0
UIParam/UIParamBufferSize1D.cpp
UIParam/UIParamBufferSize1D.cpp
+0
-0
UIParam/UIParamBufferSize1D.h
UIParam/UIParamBufferSize1D.h
+0
-0
UIParam/UIParamBufferSize2D.cpp
UIParam/UIParamBufferSize2D.cpp
+0
-0
UIParam/UIParamBufferSize2D.h
UIParam/UIParamBufferSize2D.h
+0
-0
UIParam/UIParamChildren.cpp
UIParam/UIParamChildren.cpp
+0
-0
UIParam/UIParamChildren.h
UIParam/UIParamChildren.h
+0
-0
UIParam/UIParamChoice.cpp
UIParam/UIParamChoice.cpp
+0
-0
UIParam/UIParamChoice.h
UIParam/UIParamChoice.h
+0
-0
UIParam/UIParamColorRGB.cpp
UIParam/UIParamColorRGB.cpp
+0
-0
UIParam/UIParamColorRGB.h
UIParam/UIParamColorRGB.h
+0
-0
UIParam/UIParamDouble.h
UIParam/UIParamDouble.h
+0
-0
UIParam/UIParamFloat.h
UIParam/UIParamFloat.h
+0
-0
UIParam/UIParamFunction.h
UIParam/UIParamFunction.h
+0
-0
UIParam/UIParamInteger.h
UIParam/UIParamInteger.h
+0
-0
UIParam/UIParamList.cpp
UIParam/UIParamList.cpp
+0
-0
UIParam/UIParamList.h
UIParam/UIParamList.h
+0
-0
UIParam/UIParamSet.cpp
UIParam/UIParamSet.cpp
+0
-0
UIParam/UIParamSet.h
UIParam/UIParamSet.h
+0
-0
UIParam/UIParamString.h
UIParam/UIParamString.h
+0
-0
UIParam/UIParamTable.cpp
UIParam/UIParamTable.cpp
+0
-0
UIParam/UIParamTable.h
UIParam/UIParamTable.h
+0
-0
cmake/FindASSIMP.cmake
cmake/FindASSIMP.cmake
+0
-0
script_windows/installvars.bat
script_windows/installvars.bat
+0
-0
script_windows/win_install_debug.bat
script_windows/win_install_debug.bat
+0
-0
script_windows/win_install_release.bat
script_windows/win_install_release.bat
+0
-0
No files found.
CMakeLists.txt
0 → 100644
View file @
e38d3668
get_filename_component
(
CURRENT_TARGET
${
CMAKE_SOURCE_DIR
}
NAME
)
message
(
STATUS
"Creating solution "
${
CURRENT_TARGET
}
)
project
(
${
CURRENT_TARGET
}
)
# Look for required packages.
if
(
WIN32
)
set
(
CMAKE_PREFIX_PATH
D:/Programs/Qt5.6.0/5.6/msvc2015_64
)
set
(
GLEW_LIBRARIES glew32.lib
)
set
(
GL_LIBRARIES opengl32.lib
)
endif
()
if
(
UNIX
)
set
(
CMAKE_PREFIX_PATH
/opt/Qt/5.6/gcc_64/lib/cmake
)
set
(
GL_LIBRARIES GL
)
find_package
(
GLEW REQUIRED
)
endif
()
find_package
(
Qt5 COMPONENTS Widgets REQUIRED
)
# OS dependent definitions.
if
(
WIN32
)
add_definitions
(
-D_USE_MATH_DEFINES -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -DUNICODE
)
# Detect platform.
if
(
CMAKE_SHARED_LINKER_FLAGS MATCHES
".+x64"
)
set
(
PLATFORM
"x64"
)
else
()
set
(
PLATFORM
"Win32"
)
endif
()
message
(
STATUS
"Detected platform: "
${
PLATFORM
}
)
# Set output directories.
#set( CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/install/${PLATFORM} )
endif
()
if
(
UNIX
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-fPIC -std=c++11"
)
endif
()
set
(
CMAKE_RUNTIME_OUTPUT_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
set
(
CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG
${
CMAKE_RUNTIME_OUTPUT_DIRECTORY
}
/Debug
)
set
(
CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE
${
CMAKE_RUNTIME_OUTPUT_DIRECTORY
}
/Release
)
set
(
PLUGINS_OUTPUT_DIRECTORY_DEBUG
${
CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG
}
/plugins
)
set
(
PLUGINS_OUTPUT_DIRECTORY_RELEASE
${
CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE
}
/plugins
)
message
(
STATUS
${
CMAKE_RUNTIME_OUTPUT_DIRECTORY
}
)
set
(
ENABLE_SOLUTION_FOLDERS
(
MSVC_IDE OR CMAKE_GENERATOR MATCHES Xcode
)
)
if
(
ENABLE_SOLUTION_FOLDERS
)
set_property
(
GLOBAL PROPERTY USE_FOLDERS ON
)
endif
()
# Set default include directories.
include_directories
(
${
CMAKE_SOURCE_DIR
}
${
CMAKE_SOURCE_DIR
}
/GLViewer
${
CMAKE_SOURCE_DIR
}
/GPU
${
CMAKE_SOURCE_DIR
}
/GUI_main
${
CMAKE_SOURCE_DIR
}
/Interfaces
${
CMAKE_SOURCE_DIR
}
/UIData
${
CMAKE_SOURCE_DIR
}
/UIParam
${
CMAKE_SOURCE_DIR
}
/NodeEditor
${
Qt5Widgets_INCLUDE_DIRS
}
${
GLEW_DIR
}
/include
)
# Add projects required for the ASTexGUI's minimal application.
set
(
UI_CORE_COMPONENTS
GLViewer
GPU
Interfaces
NodeEditor
UIData
UIParam
)
set
(
UI_ALL_COMPONENTS
${
UI_CORE_COMPONENTS
}
${
UI_ADDITIONAL_COMPONENTS
}
)
message
(
STATUS
"Adding core components:"
)
add_subdirectory
(
GUI_main
)
foreach
(
a IN ITEMS
${
UI_ALL_COMPONENTS
}
)
add_subdirectory
(
${
a
}
)
endforeach
()
# Add additional plug-in projects.
message
(
STATUS
"Looking for plugins:"
)
file
(
GLOB PLUGINS_DIR LIST_DIRECTORIES true
${
CMAKE_SOURCE_DIR
}
/plugins/*
)
foreach
(
PLUGIN_PATH IN ITEMS
${
PLUGINS_DIR
}
)
if
(
IS_DIRECTORY
${
PLUGIN_PATH
}
AND EXISTS
${
PLUGIN_PATH
}
/CMakeLists.txt
)
get_filename_component
(
PLUGIN_NAME
${
PLUGIN_PATH
}
NAME
)
message
(
STATUS
" - "
${
PLUGIN_NAME
}
)
add_subdirectory
(
${
PLUGIN_PATH
}
)
endif
()
endforeach
(
PLUGIN_PATH
)
# Install required external dependencies.
message
(
STATUS
${
ASTEX_ROOT_DIR
}
)
if
(
WIN32
)
# TODO: install QT image format DLLs.
install
(
FILES
"
${
GLEW_DIR
}
/bin/Release/x64/glew32.dll"
DESTINATION ./Release CONFIGURATIONS Release
)
install
(
FILES
"
${
GLEW_DIR
}
/bin/Release/x64/glew32.dll"
DESTINATION ./Debug CONFIGURATIONS Debug
)
install
(
FILES
"
${
_qt5Core_install_prefix
}
/bin/Qt5Cored.dll"
DESTINATION ./Debug CONFIGURATIONS Debug
)
install
(
FILES
"
${
_qt5Core_install_prefix
}
/bin/Qt5Guid.dll"
DESTINATION ./Debug CONFIGURATIONS Debug
)
install
(
FILES
"
${
_qt5Core_install_prefix
}
/bin/Qt5Widgetsd.dll"
DESTINATION ./Debug CONFIGURATIONS Debug
)
install
(
FILES
"
${
_qt5Core_install_prefix
}
/plugins/platforms/qwindowsd.dll"
DESTINATION ./Debug/platforms CONFIGURATIONS Debug
)
install
(
FILES
"
${
_qt5Core_install_prefix
}
/bin/Qt5Core.dll"
DESTINATION ./Release CONFIGURATIONS Release
)
install
(
FILES
"
${
_qt5Core_install_prefix
}
/bin/Qt5Gui.dll"
DESTINATION ./Release CONFIGURATIONS Release
)
install
(
FILES
"
${
_qt5Core_install_prefix
}
/bin/Qt5Widgets.dll"
DESTINATION ./Release CONFIGURATIONS Release
)
install
(
FILES
"
${
_qt5Core_install_prefix
}
/plugins/platforms/qwindows.dll"
DESTINATION ./Release/platforms CONFIGURATIONS Release
)
file
(
GLOB QT_IMG_FORMAT_PLUGINS
${
_qt5Core_install_prefix
}
/plugins/imageformats/*.dll
)
foreach
(
PLUGIN_PATH IN ITEMS
${
QT_IMG_FORMAT_PLUGINS
}
)
if
(
PLUGIN_PATH MATCHES
".+d
\\
.dll"
)
install
(
FILES
${
PLUGIN_PATH
}
DESTINATION ./Debug/imageformats CONFIGURATIONS Debug
)
else
()
install
(
FILES
${
PLUGIN_PATH
}
DESTINATION ./Release/imageformats CONFIGURATIONS Release
)
endif
()
endforeach
(
PLUGIN_PATH
)
endif
()
GLViewer/Box.h
0 → 100644
View file @
e38d3668
/*
* (c) LSIIT, UMR CNRS/UdS
* Authors: O. Génevaux, F. Larue.
*
* See licence.txt for additional information.
*/
#ifndef __BOX_H__
#define __BOX_H__
#include <QVector2D>
#include <QVector3D>
/*
*
* CLASSES DECLARATIONS.
*
*/
/** Axis-aligned bounding box in 2D.
* \ingroup Acquisition
*/
class
Box2f
{
/******************\
| Internal type(s) |
\******************/
public:
/** Set of 2D coordinates representing the corners of a bounding box.
*
* Provided by the BoundingBox::GetCorners function.
*/
class
CornerSet
{
public:
typedef
QVector2D
*
iterator
;
typedef
const
QVector2D
*
const_iterator
;
QVector2D
xy
;
/**< Corner on ( X_min, Y_min ). */
QVector2D
Xy
;
/**< Corner on ( X_max, Y_min ). */
QVector2D
xY
;
/**< Corner on ( X_min, Y_max ). */
QVector2D
XY
;
/**< Corner on ( X_max, Y_max ). */
/** Indexed access to the box corners. */
inline
QVector2D
&
operator
[](
const
unsigned
int
i
)
{
return
(
&
xy
)[
i
];
}
/** Indexed access to the box corners (read-only version). */
inline
const
QVector2D
&
operator
[](
const
unsigned
int
i
)
const
{
return
(
&
xy
)[
i
];
}
inline
iterator
begin
()
{
return
&
xy
;
}
inline
const_iterator
begin
()
const
{
return
&
xy
;
}
inline
iterator
end
()
{
return
(
&
XY
)
+
1
;
}
inline
const_iterator
end
()
const
{
return
(
&
XY
)
+
1
;
}
};
/********************\
| Member variable(s) |
\********************/
private:
#ifdef _WIN32
#pragma warning(disable: 4251)
#endif
QVector2D
m_Min
,
m_Max
;
/*****************************\
| Constructor(s) / destructor |
\*****************************/
public:
inline
Box2f
()
{
SetNull
();
}
inline
~
Box2f
()
{
}
/********************\
| Member function(s) |
\********************/
public:
/** Initialization to an "unbounding box". */
inline
void
SetNull
();
/** Check if the bounding box has been initialized. */
inline
bool
IsNull
()
const
{
return
m_Min
.
x
()
>
m_Max
.
x
();
}
/** Box boundaries extension so as to bound the specified 3D point.
*
* \param[in] v Coordinates of the 2D point to bound.
*/
inline
void
Add
(
const
QVector2D
&
v
);
/** Box boundaries extension so as to bound the specified 3D point.
*
* \param[in] v Pointer to the coordinates of the 2D point to bound.
*/
inline
void
Add
(
const
QVector2D
*
v
);
/** Box boundaries extension so as to bound the specified box.
*
* \param[in] b Bounding box to bound.
*/
inline
void
Add
(
const
Box2f
&
b
);
/** Box boundaries extension so as to bound the specified box.
*
* \param[in] b Pointer to the bounding box to bound.
*/
inline
void
Add
(
const
Box2f
*
b
);
/** Check if a point is included in the box.
*
* \param[in] v Coordinates of the 2D point to check.
* \return True if the point is included in the box, false otherwise.
*/
inline
bool
Contains
(
const
QVector2D
&
v
)
const
;
/** Check if a box is included in the box.
*
* \param[in] b Bounding box to check.
* \return True if the query box is included in the current one, false otherwise.
*/
inline
bool
Contains
(
const
Box2f
&
b
)
const
;
/** Check if a box intersects the box.
*
* \param[in] b Bounding box to check.
* \return True if the query box intersects the current one, false otherwise.
*/
inline
bool
Intersects
(
const
Box2f
&
b
)
const
;
/** Access to the lower boundaries of the box.
*
* \return Box lower boundaries.
*/
inline
QVector2D
&
Min
()
{
return
m_Min
;
}
/** Access to the lower boundaries of the box (read only version).
*
* \return Box lower boundaries.
*/
inline
const
QVector2D
&
Min
()
const
{
return
m_Min
;
}
/** Access to the upper boundaries of the box.
*
* \return Box upper boundaries.
*/
inline
QVector2D
&
Max
()
{
return
m_Max
;
}
/** Access to the upper boundaries of the box (read only version).
*
* \return Box upper boundaries.
*/
inline
const
QVector2D
&
Max
()
const
{
return
m_Max
;
}
/** Recovery of the dimensions of the box.
*
* \return Box dimensions.
*/
inline
QVector2D
Dimensions
()
const
{
return
m_Max
-
m_Min
;
}
/** Recovery of diagonal length of the box.
*
* \return Diagonal length.
*/
inline
float
Diagonal
()
const
{
return
Dimensions
().
length
();
}
/** Recovery of the center point of the box.
*
* \return Box center.
*/
inline
QVector2D
Center
()
const
{
return
0.5
f
*
(
m_Min
+
m_Max
);
}
/** Recovery of the height points representing the corners of the box.
*
* \return Set of corner points.
*/
inline
void
Corners
(
CornerSet
&
corners
)
const
;
/** Explicit specification of the box boundaries.
*
* \param[in] min Lower boundary.
* \param[in] max Upper boundary.
*/
inline
void
SetBoundaries
(
const
QVector2D
&
min
,
const
QVector2D
&
max
);
/** Explicit specification of the box boundaries.
*
* \param[in] xMin Lower boundary along axis X.
* \param[in] xMax Upper boundary along axis X.
* \param[in] yMin Lower boundary along axis Y.
* \param[in] yMax Upper boundary along axis Y.
*/
inline
void
SetBoundaries
(
const
float
xMin
,
const
float
xMax
,
const
float
yMin
,
const
float
yMax
);
/** Recovery of the area of the box.
*
* \return Box area.
*/
inline
float
Area
()
const
;
};
/*
*
* INLINE MEMBER FUNCTIONS DEFINITIONS.
*
*/
inline
void
Box2f
::
SetNull
()
{
m_Min
.
setX
(
std
::
numeric_limits
<
float
>::
max
()
);
m_Min
.
setY
(
std
::
numeric_limits
<
float
>::
max
()
);
m_Max
.
setX
(
-
std
::
numeric_limits
<
float
>::
max
()
);
m_Max
.
setY
(
-
std
::
numeric_limits
<
float
>::
max
()
);
}
inline
void
Box2f
::
Add
(
const
QVector2D
&
v
)
{
if
(
v
.
x
()
<
m_Min
.
x
()
)
m_Min
.
setX
(
v
.
x
()
);
if
(
v
.
x
()
>
m_Max
.
x
()
)
m_Max
.
setX
(
v
.
x
()
);
if
(
v
.
y
()
<
m_Min
.
y
()
)
m_Min
.
setY
(
v
.
y
()
);
if
(
v
.
y
()
>
m_Max
.
y
()
)
m_Max
.
setY
(
v
.
y
()
);
}
inline
void
Box2f
::
Add
(
const
QVector2D
*
v
)
{
Add
(
*
v
);
}
inline
void
Box2f
::
Add
(
const
Box2f
&
b
)
{
if
(
b
.
m_Min
.
x
()
<
m_Min
.
x
()
)
m_Min
.
setX
(
b
.
m_Min
.
x
()
);
if
(
b
.
m_Max
.
x
()
>
m_Max
.
x
()
)
m_Max
.
setX
(
b
.
m_Max
.
x
()
);
if
(
b
.
m_Min
.
y
()
<
m_Min
.
y
()
)
m_Min
.
setY
(
b
.
m_Min
.
y
()
);
if
(
b
.
m_Max
.
y
()
>
m_Max
.
y
()
)
m_Max
.
setY
(
b
.
m_Max
.
y
()
);
}
inline
void
Box2f
::
Add
(
const
Box2f
*
b
)
{
Add
(
*
b
);
}
inline
bool
Box2f
::
Contains
(
const
QVector2D
&
v
)
const
{
return
v
.
x
()
>=
m_Min
.
x
()
&&
v
.
x
()
<=
m_Max
.
x
()
&&
v
.
y
()
>=
m_Min
.
y
()
&&
v
.
y
()
<=
m_Max
.
y
();
}
inline
bool
Box2f
::
Contains
(
const
Box2f
&
b
)
const
{
return
b
.
m_Min
.
x
()
>=
m_Min
.
x
()
&&
b
.
m_Max
.
x
()
<=
m_Max
.
x
()
&&
b
.
m_Min
.
y
()
>=
m_Min
.
y
()
&&
b
.
m_Max
.
y
()
<=
m_Max
.
y
();
}
inline
bool
Box2f
::
Intersects
(
const
Box2f
&
b
)
const
{
return
b
.
m_Min
.
x
()
<
m_Max
.
x
()
&&
b
.
m_Max
.
x
()
>
m_Min
.
x
()
&&
b
.
m_Min
.
y
()
<
m_Max
.
y
()
&&
b
.
m_Max
.
y
()
>
m_Min
.
y
();
}
inline
void
Box2f
::
SetBoundaries
(
const
QVector2D
&
min
,
const
QVector2D
&
max
)
{
m_Min
=
min
;
m_Max
=
max
;
}
inline
void
Box2f
::
SetBoundaries
(
const
float
xMin
,
const
float
xMax
,
const
float
yMin
,
const
float
yMax
)
{
m_Min
=
QVector2D
(
xMin
,
yMin
);
m_Max
=
QVector2D
(
xMax
,
yMax
);
}
inline
void
Box2f
::
Corners
(
CornerSet
&
corners
)
const
{
corners
.
xy
=
m_Min
;
corners
.
Xy
=
QVector2D
(
m_Max
.
x
(),
m_Min
.
y
()
);
corners
.
xY
=
QVector2D
(
m_Min
.
x
(),
m_Max
.
y
()
);
corners
.
XY
=
m_Max
;
}
inline
float
Box2f
::
Area
()
const
{
return
IsNull
()
?
0.0
f
:
(
m_Max
.
x
()
-
m_Min
.
x
())
*
(
m_Max
.
y
()
-
m_Min
.
y
());
}
/*
*
* CLASSES DECLARATIONS.
*
*/
/** Axis-aligned bounding box in 3D.
* \ingroup Acquisition
*/
class
Box3f
{
/******************\
| Internal type(s) |
\******************/
public:
/** Set of 3D coordinates representing the corners of a bounding box.
*
* Provided by the BoundingBox::GetCorners function.
*/
class
CornerSet
{
public:
typedef
QVector3D
*
iterator
;
typedef
const
QVector3D
*
const_iterator
;
QVector3D
xyz
;
/**< Corner on ( X_min, Y_min, Z_min ). */
QVector3D
xyZ
;
/**< Corner on ( X_min, Y_min, Z_max ). */
QVector3D
xYz
;
/**< Corner on ( X_min, Y_max, Z_min ). */
QVector3D
xYZ
;
/**< Corner on ( X_min, Y_max, Z_max ). */
QVector3D
Xyz
;
/**< Corner on ( X_max, Y_min, Z_min ). */
QVector3D
XyZ
;
/**< Corner on ( X_max, Y_min, Z_max ). */
QVector3D
XYz
;
/**< Corner on ( X_max, Y_max, Z_min ). */
QVector3D
XYZ
;
/**< Corner on ( X_max, Y_max, Z_max ). */
/** Indexed access to the box corners. */
inline
QVector3D
&
operator
[](
const
unsigned
int
i
)
{
return
(
&
xyz
)[
i
];
}
/** Indexed access to the box corners (read-only version). */
inline
const
QVector3D
&
operator
[](
const
unsigned
int
i
)
const
{
return
(
&
xyz
)[
i
];
}
inline
iterator
begin
()
{
return
&
xyz
;
}
inline
const_iterator
begin
()
const
{
return
&
xyz
;
}
inline
iterator
end
()
{
return
(
&
XYZ
)
+
1
;
}
inline
const_iterator
end
()
const
{
return
(
&
XYZ
)
+
1
;
}
};
/********************\
| Member variable(s) |
\********************/
private:
#ifdef _WIN32
#pragma warning(disable: 4251)
#endif
QVector3D
m_Min
,
m_Max
;
/*****************************\
| Constructor(s) / destructor |
\*****************************/
public:
inline
Box3f
()
{
SetNull
();
}
inline
~
Box3f
()
{
}
/********************\
| Member function(s) |
\********************/
public:
/** Initialization to an "unbounding box". */
inline
void
SetNull
();
/** Check if the bounding box has been initialized. */
inline
bool
IsNull
()
const
{
return
m_Min
.
x
()
>
m_Max
.
x
();
}
/** Box boundaries extension so as to bound the specified 3D point.
*
* \param[in] v Coordinates of the 3D point to bound.
*/
inline
void
Add
(
const
QVector3D
&
v
);
/** Box boundaries extension so as to bound the specified 3D point.
*
* \param[in] v Pointer to the coordinates of the 3D point to bound.
*/
inline
void
Add
(
const
QVector3D
*
v
);
/** Box boundaries extension so as to bound the specified box.
*
* \param[in] b Bounding box to bound.
*/
inline
void
Add
(
const
Box3f
&
b
);
/** Box boundaries extension so as to bound the specified box.
*
* \param[in] b Pointer to the bounding box to bound.
*/
inline
void
Add
(
const
Box3f
*
b
);
/** Check if a point is included in the box.
*
* \param[in] v Coordinates of the 3D point to check.
* \return True if the point is included in the box, false otherwise.
*/
inline
bool
Contains
(
const
QVector3D
&
v
)
const
;
/** Check if a box is included in the box.