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
CGoGN
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
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
David Cazier
CGoGN
Commits
cf2b7944
Commit
cf2b7944
authored
Jan 17, 2013
by
untereiner
Browse files
Options
Browse Files
Download
Plain Diff
Merge cgogn:~kraemer/CGoGN
parents
ce1186a4
d4217e84
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
418 additions
and
873 deletions
+418
-873
SCHNApps/Debug/CMakeLists.txt
SCHNApps/Debug/CMakeLists.txt
+0
-2
SCHNApps/Plugins/differentialProperties/CMakeLists.txt
SCHNApps/Plugins/differentialProperties/CMakeLists.txt
+6
-3
SCHNApps/Plugins/differentialProperties/forms/computeNormalDialog.ui
...ugins/differentialProperties/forms/computeNormalDialog.ui
+55
-29
SCHNApps/Plugins/differentialProperties/include/computeNormalDialog.h
...gins/differentialProperties/include/computeNormalDialog.h
+5
-5
SCHNApps/Plugins/differentialProperties/include/differentialProperties.h
...s/differentialProperties/include/differentialProperties.h
+11
-5
SCHNApps/Plugins/differentialProperties/src/computeNormalDialog.cpp
...lugins/differentialProperties/src/computeNormalDialog.cpp
+13
-6
SCHNApps/Plugins/differentialProperties/src/differentialProperties.cpp
...ins/differentialProperties/src/differentialProperties.cpp
+121
-15
SCHNApps/Plugins/renderVector/renderVector.cpp
SCHNApps/Plugins/renderVector/renderVector.cpp
+22
-20
SCHNApps/Plugins/renderVector/renderVector.h
SCHNApps/Plugins/renderVector/renderVector.h
+2
-3
SCHNApps/Plugins/renderVector/renderVector.ui
SCHNApps/Plugins/renderVector/renderVector.ui
+34
-40
SCHNApps/Release/CMakeLists.txt
SCHNApps/Release/CMakeLists.txt
+0
-2
SCHNApps/deprecated/system.cpp
SCHNApps/deprecated/system.cpp
+25
-0
SCHNApps/deprecated/system.h
SCHNApps/deprecated/system.h
+29
-0
SCHNApps/deprecated/vboHandler.cpp
SCHNApps/deprecated/vboHandler.cpp
+0
-0
SCHNApps/deprecated/vboHandler.h
SCHNApps/deprecated/vboHandler.h
+0
-0
SCHNApps/include/mapHandler.h
SCHNApps/include/mapHandler.h
+1
-0
SCHNApps/include/stateHandler.h
SCHNApps/include/stateHandler.h
+2
-2
SCHNApps/include/system.h
SCHNApps/include/system.h
+0
-160
SCHNApps/include/window.h
SCHNApps/include/window.h
+1
-1
SCHNApps/src/dialogs/pluginsDialog.cpp
SCHNApps/src/dialogs/pluginsDialog.cpp
+1
-22
SCHNApps/src/main.cpp
SCHNApps/src/main.cpp
+1
-1
SCHNApps/src/mapHandler.cpp
SCHNApps/src/mapHandler.cpp
+13
-2
SCHNApps/src/system.cpp
SCHNApps/src/system.cpp
+0
-459
SCHNApps/src/window.cpp
SCHNApps/src/window.cpp
+1
-39
include/Algo/Selection/collector.hpp
include/Algo/Selection/collector.hpp
+38
-0
include/Topology/generic/attributeHandler.h
include/Topology/generic/attributeHandler.h
+6
-0
include/Topology/generic/attributeHandler.hpp
include/Topology/generic/attributeHandler.hpp
+6
-0
include/Topology/generic/functor.h
include/Topology/generic/functor.h
+0
-45
include/Utils/nameTypes.h
include/Utils/nameTypes.h
+6
-6
include/Utils/vbo.hpp
include/Utils/vbo.hpp
+2
-0
include/Utils/vbo_base.h
include/Utils/vbo_base.h
+8
-0
src/Topology/generic/genericmap.cpp
src/Topology/generic/genericmap.cpp
+9
-6
No files found.
SCHNApps/Debug/CMakeLists.txt
View file @
cf2b7944
...
...
@@ -21,11 +21,9 @@ file(
GLOB
SCHNApps_SRC_FILES
${
SCHNApps_ROOT_DIR
}
/src/camera.cpp
${
SCHNApps_ROOT_DIR
}
/src/context.cpp
${
SCHNApps_ROOT_DIR
}
/src/main.cpp
${
SCHNApps_ROOT_DIR
}
/src/mapHandler.cpp
${
SCHNApps_ROOT_DIR
}
/src/plugin.cpp
${
SCHNApps_ROOT_DIR
}
/src/system.cpp
${
SCHNApps_ROOT_DIR
}
/src/view.cpp
${
SCHNApps_ROOT_DIR
}
/src/window.cpp
${
SCHNApps_ROOT_DIR
}
/src/viewButtonArea.cpp
...
...
SCHNApps/Plugins/differentialProperties/CMakeLists.txt
View file @
cf2b7944
...
...
@@ -8,16 +8,19 @@ INCLUDE_DIRECTORIES(
SET
(
PLUGIN_SRC
${
SCHNApps_ROOT_DIR
}
/Plugins/differentialProperties/src/differentialProperties.cpp
${
SCHNApps_ROOT_DIR
}
/Plugins/differentialProperties/src/computeNormalsDialog.cpp
${
SCHNApps_ROOT_DIR
}
/Plugins/differentialProperties/src/computeNormalDialog.cpp
${
SCHNApps_ROOT_DIR
}
/Plugins/differentialProperties/src/computeCurvatureDialog.cpp
)
SET
(
PLUGIN_H
${
SCHNApps_ROOT_DIR
}
/Plugins/differentialProperties/include/differentialProperties.h
${
SCHNApps_ROOT_DIR
}
/Plugins/differentialProperties/include/computeNormalsDialog.h
${
SCHNApps_ROOT_DIR
}
/Plugins/differentialProperties/include/computeNormalDialog.h
${
SCHNApps_ROOT_DIR
}
/Plugins/differentialProperties/include/computeCurvatureDialog.h
)
SET
(
PLUGIN_FORM
${
SCHNApps_ROOT_DIR
}
/Plugins/differentialProperties/forms/computeNormalsDialog.ui
${
SCHNApps_ROOT_DIR
}
/Plugins/differentialProperties/forms/computeNormalDialog.ui
${
SCHNApps_ROOT_DIR
}
/Plugins/differentialProperties/forms/computeCurvatureDialog.ui
)
IF
(
${
CMAKE_BUILD_TYPE
}
STREQUAL Debug
)
...
...
SCHNApps/Plugins/differentialProperties/forms/computeNormal
s
Dialog.ui
→
SCHNApps/Plugins/differentialProperties/forms/computeNormalDialog.ui
View file @
cf2b7944
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
ComputeNormal
s
Dialog
</class>
<widget
class=
"QDialog"
name=
"ComputeNormal
s
Dialog"
>
<class>
ComputeNormalDialog
</class>
<widget
class=
"QDialog"
name=
"ComputeNormalDialog"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
28
7
</width>
<height>
228
</height>
<width>
44
7
</width>
<height>
311
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Compute Normal
s
</string>
<string>
Compute Normal
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout
_2
"
>
<item>
<widget
class=
"QListWidget"
name=
"mapList"
/>
</item>
...
...
@@ -29,7 +29,7 @@
<item>
<widget
class=
"QComboBox"
name=
"combo_positionAttribute"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"
MinimumExpanding
"
vsizetype=
"Fixed"
>
<sizepolicy
hsizetype=
"
Preferred
"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
...
...
@@ -39,27 +39,53 @@
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
Normal attribute name :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"attributeName"
/>
</item>
</layout>
</item>
<item>
<widget
class=
"QCheckBox"
name=
"check_createVBO"
>
<property
name=
"text"
>
<string>
create VBO
</string>
</property>
<property
name=
"checked"
>
<bool>
true
</bool>
<widget
class=
"QGroupBox"
name=
"groupBox"
>
<property
name=
"title"
>
<string>
Normal attribute
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item>
<widget
class=
"QLabel"
name=
"label_3"
>
<property
name=
"text"
>
<string>
Existing attribute :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QComboBox"
name=
"combo_normalAttribute"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
New attribute :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"normalAttributeName"
/>
</item>
</layout>
</item>
<item>
<widget
class=
"QCheckBox"
name=
"check_createVBO"
>
<property
name=
"text"
>
<string>
create VBO
</string>
</property>
<property
name=
"checked"
>
<bool>
true
</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
...
...
@@ -94,7 +120,7 @@
<connection>
<sender>
button_ok
</sender>
<signal>
clicked()
</signal>
<receiver>
ComputeNormal
s
Dialog
</receiver>
<receiver>
ComputeNormalDialog
</receiver>
<slot>
accept()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
...
...
@@ -110,7 +136,7 @@
<connection>
<sender>
button_cancel
</sender>
<signal>
clicked()
</signal>
<receiver>
ComputeNormal
s
Dialog
</receiver>
<receiver>
ComputeNormalDialog
</receiver>
<slot>
reject()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
...
...
SCHNApps/Plugins/differentialProperties/include/computeNormal
s
Dialog.h
→
SCHNApps/Plugins/differentialProperties/include/computeNormalDialog.h
View file @
cf2b7944
#ifndef _COMPUTENORMAL
S
_DIALOG_H_
#define _COMPUTENORMAL
S
_DIALOG_H_
#ifndef _COMPUTENORMAL_DIALOG_H_
#define _COMPUTENORMAL_DIALOG_H_
#include "ui_computeNormal
s
Dialog.h"
#include "ui_computeNormalDialog.h"
namespace
CGoGN
{
...
...
@@ -11,12 +11,12 @@ namespace SCHNApps
class
Window
;
class
ComputeNormal
sDialog
:
public
QDialog
,
public
Ui
::
ComputeNormals
Dialog
class
ComputeNormal
Dialog
:
public
QDialog
,
public
Ui
::
ComputeNormal
Dialog
{
Q_OBJECT
public:
ComputeNormal
s
Dialog
(
Window
*
w
);
ComputeNormalDialog
(
Window
*
w
);
void
init
();
public
slots
:
...
...
SCHNApps/Plugins/differentialProperties/include/differentialProperties.h
View file @
cf2b7944
...
...
@@ -3,7 +3,8 @@
#include "plugin.h"
#include "computeNormalsDialog.h"
#include "computeNormalDialog.h"
#include "computeCurvatureDialog.h"
#include "Topology/generic/functor.h"
#include "Topology/generic/parameters.h"
...
...
@@ -21,6 +22,7 @@ struct PFP: public PFP_STANDARD
};
typedef
PFP
::
MAP
MAP
;
typedef
PFP
::
REAL
REAL
;
typedef
PFP
::
VEC3
VEC3
;
...
...
@@ -58,13 +60,17 @@ public:
virtual
void
mapUnlinked
(
View
*
view
,
MapHandlerGen
*
m
)
{}
public
slots
:
void
cb_openComputeNormalsDialog
();
void
cb_computeNormals
();
void
cb_openComputeNormalDialog
();
void
cb_openComputeCurvatureDialog
();
void
cb_computeNormal
();
void
cb_computeCurvature
();
private:
ComputeNormalsDialog
*
m_computeNormalsDialog
;
ComputeNormalDialog
*
m_computeNormalDialog
;
ComputeCurvatureDialog
*
m_computeCurvatureDialog
;
QAction
*
computeNormal
s
Action
;
QAction
*
computeNormalAction
;
QAction
*
computeCurvatureAction
;
};
...
...
SCHNApps/Plugins/differentialProperties/src/computeNormal
s
Dialog.cpp
→
SCHNApps/Plugins/differentialProperties/src/computeNormalDialog.cpp
View file @
cf2b7944
#include "computeNormal
s
Dialog.h"
#include "computeNormalDialog.h"
#include "differentialProperties.h"
#include "window.h"
...
...
@@ -10,28 +10,30 @@ namespace CGoGN
namespace
SCHNApps
{
ComputeNormal
sDialog
::
ComputeNormals
Dialog
(
Window
*
w
)
:
m_window
(
w
)
ComputeNormal
Dialog
::
ComputeNormal
Dialog
(
Window
*
w
)
:
m_window
(
w
)
{
setupUi
(
this
);
connect
(
mapList
,
SIGNAL
(
itemSelectionChanged
()),
this
,
SLOT
(
cb_selectedMapChanged
()));
}
void
ComputeNormal
s
Dialog
::
init
()
void
ComputeNormalDialog
::
init
()
{
mapList
->
clear
();
combo_positionAttribute
->
clear
();
attributeName
->
setText
(
"normal"
);
combo_normalAttribute
->
clear
();
normalAttributeName
->
setText
(
"normal"
);
const
QList
<
MapHandlerGen
*>&
maps
=
m_window
->
getMapsList
();
foreach
(
MapHandlerGen
*
map
,
maps
)
mapList
->
addItem
(
map
->
getName
());
}
void
ComputeNormal
s
Dialog
::
cb_selectedMapChanged
()
void
ComputeNormalDialog
::
cb_selectedMapChanged
()
{
QList
<
QListWidgetItem
*>
currentItems
=
mapList
->
selectedItems
();
if
(
!
currentItems
.
empty
())
{
combo_positionAttribute
->
clear
();
combo_normalAttribute
->
clear
();
const
QString
&
mapname
=
currentItems
[
0
]
->
text
();
MapHandlerGen
*
mh
=
m_window
->
getMap
(
mapname
);
GenericMap
*
map
=
mh
->
getGenericMap
();
...
...
@@ -48,8 +50,13 @@ void ComputeNormalsDialog::cb_selectedMapChanged()
if
(
types
[
i
]
==
vec3TypeName
)
{
combo_positionAttribute
->
addItem
(
QString
::
fromStdString
(
names
[
i
]));
if
(
names
[
i
]
==
"position"
)
// try to select an attribute named "position"
if
(
names
[
i
]
==
"position"
)
// try to select a
positio
n attribute named "position"
combo_positionAttribute
->
setCurrentIndex
(
j
);
combo_normalAttribute
->
addItem
(
QString
::
fromStdString
(
names
[
i
]));
if
(
names
[
i
]
==
"normal"
)
// try to select a normal attribute named "normal"
combo_normalAttribute
->
setCurrentIndex
(
j
);
++
j
;
}
}
...
...
SCHNApps/Plugins/differentialProperties/src/differentialProperties.cpp
View file @
cf2b7944
...
...
@@ -3,44 +3,59 @@
#include "mapHandler.h"
#include "Algo/Geometry/normal.h"
#include "Algo/Geometry/curvature.h"
bool
DifferentialPropertiesPlugin
::
enable
()
{
m_computeNormalsDialog
=
new
ComputeNormalsDialog
(
m_window
);
m_computeNormalDialog
=
new
ComputeNormalDialog
(
m_window
);
m_computeCurvatureDialog
=
new
ComputeCurvatureDialog
(
m_window
);
computeNormal
sAction
=
new
QAction
(
"Compute Normals
"
,
this
);
computeNormal
Action
=
new
QAction
(
"Compute Normal
"
,
this
);
computeCurvatureAction
=
new
QAction
(
"Compute Curvature"
,
this
);
addMenuAction
(
"Surface;Differential Properties;Compute Normal
s"
,
computeNormals
Action
);
addMenuAction
(
"Surface;Differential Properties;Compute Normal
"
,
computeNormal
Action
);
addMenuAction
(
"Surface;Differential Properties;Compute Curvature"
,
computeCurvatureAction
);
connect
(
computeNormal
sAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
cb_openComputeNormals
Dialog
()));
connect
(
computeCurvatureAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
cb_openCompute
Normals
Dialog
()));
connect
(
computeNormal
Action
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
cb_openComputeNormal
Dialog
()));
connect
(
computeCurvatureAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
cb_openCompute
Curvature
Dialog
()));
connect
(
m_computeNormalsDialog
,
SIGNAL
(
accepted
()),
this
,
SLOT
(
cb_computeNormals
()));
connect
(
m_computeNormalsDialog
->
button_apply
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
cb_computeNormals
()));
connect
(
m_computeNormalDialog
,
SIGNAL
(
accepted
()),
this
,
SLOT
(
cb_computeNormal
()));
connect
(
m_computeNormalDialog
->
button_apply
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
cb_computeNormal
()));
connect
(
m_computeCurvatureDialog
,
SIGNAL
(
accepted
()),
this
,
SLOT
(
cb_computeCurvature
()));
connect
(
m_computeCurvatureDialog
->
button_apply
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
cb_computeCurvature
()));
return
true
;
}
void
DifferentialPropertiesPlugin
::
cb_openComputeNormalsDialog
()
void
DifferentialPropertiesPlugin
::
cb_openComputeNormalDialog
()
{
m_computeNormalDialog
->
init
();
m_computeNormalDialog
->
show
();
}
void
DifferentialPropertiesPlugin
::
cb_openComputeCurvatureDialog
()
{
m_compute
Normals
Dialog
->
init
();
m_compute
Normals
Dialog
->
show
();
m_compute
Curvature
Dialog
->
init
();
m_compute
Curvature
Dialog
->
show
();
}
void
DifferentialPropertiesPlugin
::
cb_computeNormal
s
()
void
DifferentialPropertiesPlugin
::
cb_computeNormal
()
{
QList
<
QListWidgetItem
*>
currentItems
=
m_computeNormal
s
Dialog
->
mapList
->
selectedItems
();
QList
<
QListWidgetItem
*>
currentItems
=
m_computeNormalDialog
->
mapList
->
selectedItems
();
if
(
!
currentItems
.
empty
())
{
const
QString
&
mapname
=
currentItems
[
0
]
->
text
();
MapHandler
<
PFP
>*
mh
=
reinterpret_cast
<
MapHandler
<
PFP
>*>
(
m_window
->
getMap
(
mapname
));
MAP
*
map
=
mh
->
getMap
();
std
::
string
positionName
=
m_computeNormalsDialog
->
combo_positionAttribute
->
currentText
().
toUtf8
().
constData
();
std
::
string
normalName
=
m_computeNormalsDialog
->
attributeName
->
text
().
toUtf8
().
constData
();
std
::
string
positionName
=
m_computeNormalDialog
->
combo_positionAttribute
->
currentText
().
toUtf8
().
constData
();
std
::
string
normalName
;
if
(
m_computeNormalDialog
->
normalAttributeName
->
text
().
isEmpty
())
normalName
=
m_computeNormalDialog
->
combo_normalAttribute
->
currentText
().
toUtf8
().
constData
();
else
normalName
=
m_computeNormalDialog
->
normalAttributeName
->
text
().
toUtf8
().
constData
();
VertexAttribute
<
VEC3
>
position
=
map
->
getAttribute
<
VEC3
,
VERTEX
>
(
positionName
);
VertexAttribute
<
VEC3
>
normal
=
map
->
getAttribute
<
VEC3
,
VERTEX
>
(
normalName
);
if
(
!
normal
.
isValid
())
...
...
@@ -48,7 +63,7 @@ void DifferentialPropertiesPlugin::cb_computeNormals()
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
*
map
,
position
,
normal
);
if
(
m_computeNormal
s
Dialog
->
check_createVBO
->
checkState
()
==
Qt
::
Checked
)
if
(
m_computeNormalDialog
->
check_createVBO
->
checkState
()
==
Qt
::
Checked
)
mh
->
createVBO
(
normal
);
QList
<
View
*>
views
=
m_window
->
getViewsList
();
...
...
@@ -60,6 +75,97 @@ void DifferentialPropertiesPlugin::cb_computeNormals()
}
}
void
DifferentialPropertiesPlugin
::
cb_computeCurvature
()
{
QList
<
QListWidgetItem
*>
currentItems
=
m_computeCurvatureDialog
->
mapList
->
selectedItems
();
if
(
!
currentItems
.
empty
())
{
const
QString
&
mapname
=
currentItems
[
0
]
->
text
();
MapHandler
<
PFP
>*
mh
=
reinterpret_cast
<
MapHandler
<
PFP
>*>
(
m_window
->
getMap
(
mapname
));
MAP
*
map
=
mh
->
getMap
();
std
::
string
positionName
=
m_computeCurvatureDialog
->
combo_positionAttribute
->
currentText
().
toUtf8
().
constData
();
std
::
string
normalName
=
m_computeCurvatureDialog
->
combo_normalAttribute
->
currentText
().
toUtf8
().
constData
();
VertexAttribute
<
VEC3
>
position
=
map
->
getAttribute
<
VEC3
,
VERTEX
>
(
positionName
);
VertexAttribute
<
VEC3
>
normal
=
map
->
getAttribute
<
VEC3
,
VERTEX
>
(
normalName
);
std
::
string
KmaxName
;
if
(
m_computeCurvatureDialog
->
KmaxAttributeName
->
text
().
isEmpty
())
KmaxName
=
m_computeCurvatureDialog
->
combo_KmaxAttribute
->
currentText
().
toUtf8
().
constData
();
else
KmaxName
=
m_computeCurvatureDialog
->
KmaxAttributeName
->
text
().
toUtf8
().
constData
();
VertexAttribute
<
VEC3
>
Kmax
=
map
->
getAttribute
<
VEC3
,
VERTEX
>
(
KmaxName
);
if
(
!
Kmax
.
isValid
())
Kmax
=
map
->
addAttribute
<
VEC3
,
VERTEX
>
(
KmaxName
);
std
::
string
kmaxName
;
if
(
m_computeCurvatureDialog
->
kmaxAttributeName
->
text
().
isEmpty
())
kmaxName
=
m_computeCurvatureDialog
->
combo_kmaxAttribute
->
currentText
().
toUtf8
().
constData
();
else
kmaxName
=
m_computeCurvatureDialog
->
kmaxAttributeName
->
text
().
toUtf8
().
constData
();
VertexAttribute
<
REAL
>
kmax
=
map
->
getAttribute
<
REAL
,
VERTEX
>
(
kmaxName
);
if
(
!
kmax
.
isValid
())
kmax
=
map
->
addAttribute
<
REAL
,
VERTEX
>
(
kmaxName
);
std
::
string
KminName
;
if
(
m_computeCurvatureDialog
->
KminAttributeName
->
text
().
isEmpty
())
KminName
=
m_computeCurvatureDialog
->
combo_KminAttribute
->
currentText
().
toUtf8
().
constData
();
else
KminName
=
m_computeCurvatureDialog
->
KminAttributeName
->
text
().
toUtf8
().
constData
();
VertexAttribute
<
VEC3
>
Kmin
=
map
->
getAttribute
<
VEC3
,
VERTEX
>
(
KminName
);
if
(
!
Kmin
.
isValid
())
Kmin
=
map
->
addAttribute
<
VEC3
,
VERTEX
>
(
KminName
);
std
::
string
kminName
;
if
(
m_computeCurvatureDialog
->
kminAttributeName
->
text
().
isEmpty
())
kminName
=
m_computeCurvatureDialog
->
combo_kminAttribute
->
currentText
().
toUtf8
().
constData
();
else
kminName
=
m_computeCurvatureDialog
->
kminAttributeName
->
text
().
toUtf8
().
constData
();
VertexAttribute
<
REAL
>
kmin
=
map
->
getAttribute
<
REAL
,
VERTEX
>
(
kminName
);
if
(
!
kmin
.
isValid
())
kmin
=
map
->
addAttribute
<
REAL
,
VERTEX
>
(
kminName
);
std
::
string
KnormalName
;
if
(
m_computeCurvatureDialog
->
KnormalAttributeName
->
text
().
isEmpty
())
KnormalName
=
m_computeCurvatureDialog
->
combo_KnormalAttribute
->
currentText
().
toUtf8
().
constData
();
else
KnormalName
=
m_computeCurvatureDialog
->
KnormalAttributeName
->
text
().
toUtf8
().
constData
();
VertexAttribute
<
VEC3
>
Knormal
=
map
->
getAttribute
<
VEC3
,
VERTEX
>
(
KnormalName
);
if
(
!
Knormal
.
isValid
())
Knormal
=
map
->
addAttribute
<
VEC3
,
VERTEX
>
(
KnormalName
);
EdgeAttribute
<
REAL
>
edgeAngle
=
map
->
getAttribute
<
REAL
,
EDGE
>
(
"edgeAngle"
);
if
(
!
edgeAngle
.
isValid
())
edgeAngle
=
map
->
addAttribute
<
REAL
,
EDGE
>
(
"edgeAngle"
);
Algo
::
Geometry
::
computeAnglesBetweenNormalsOnEdges
<
PFP
>
(
*
map
,
position
,
edgeAngle
);
Algo
::
Geometry
::
computeCurvatureVertices_NormalCycles_Projected
<
PFP
>
(
*
map
,
0.01
f
*
mh
->
getBBdiagSize
(),
position
,
normal
,
edgeAngle
,
kmax
,
kmin
,
Kmax
,
Kmin
,
Knormal
);
if
(
m_computeCurvatureDialog
->
check_KmaxCreateVBO
->
checkState
()
==
Qt
::
Checked
)
mh
->
createVBO
(
Kmax
);
if
(
m_computeCurvatureDialog
->
check_kmaxCreateVBO
->
checkState
()
==
Qt
::
Checked
)
mh
->
createVBO
(
kmax
);
if
(
m_computeCurvatureDialog
->
check_KminCreateVBO
->
checkState
()
==
Qt
::
Checked
)
mh
->
createVBO
(
Kmin
);
if
(
m_computeCurvatureDialog
->
check_kminCreateVBO
->
checkState
()
==
Qt
::
Checked
)
mh
->
createVBO
(
kmin
);
if
(
m_computeCurvatureDialog
->
check_KnormalCreateVBO
->
checkState
()
==
Qt
::
Checked
)
mh
->
createVBO
(
Knormal
);
QList
<
View
*>
views
=
m_window
->
getViewsList
();
foreach
(
View
*
view
,
views
)
{
if
(
view
->
isLinkedToMap
(
mh
))
view
->
updateGL
();
}
}
}
#ifndef DEBUG
Q_EXPORT_PLUGIN2
(
DifferentialPropertiesPlugin
,
DifferentialPropertiesPlugin
)
#else
...
...
SCHNApps/Plugins/renderVector/renderVector.cpp
View file @
cf2b7944
...
...
@@ -7,7 +7,6 @@
PerMapParameterSet
::
PerMapParameterSet
(
MapHandlerGen
*
map
)
:
positionVBO
(
NULL
),
vectorVBO
(
NULL
),
vectorsScaleFactor
(
1.0
f
)
{
QList
<
Utils
::
VBO
*>
vbos
=
map
->
getVBOList
();
...
...
@@ -19,8 +18,6 @@ PerMapParameterSet::PerMapParameterSet(MapHandlerGen* map) :
if
(
positionVBO
==
NULL
&&
vbos
.
count
()
>
0
)
positionVBO
=
vbos
[
0
];
if
(
vectorVBO
==
NULL
&&
vbos
.
count
()
>
0
)
vectorVBO
=
vbos
[
0
];
}
...
...
@@ -36,7 +33,7 @@ bool RenderVectorPlugin::enable()
connect
(
m_dockTab
->
mapList
,
SIGNAL
(
itemSelectionChanged
()),
this
,
SLOT
(
cb_selectedMapChanged
()));
connect
(
m_dockTab
->
combo_positionVBO
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
cb_positionVBOChanged
(
int
)));
connect
(
m_dockTab
->
combo_vectorVBO
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
cb_vectorVBOChanged
(
int
)));
connect
(
m_dockTab
->
list_vectorVBO
,
SIGNAL
(
itemSelectionChanged
()),
this
,
SLOT
(
cb_selectedVectorVBOChanged
(
)));
connect
(
m_dockTab
->
button_refreshVBOs
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
cb_refreshVBOs
()));
connect
(
m_dockTab
->
slider_vectorsScaleFactor
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
cb_vectorsScaleFactorChanged
(
int
)));
...
...
@@ -56,13 +53,16 @@ void RenderVectorPlugin::redraw(View* view)
foreach
(
MapHandlerGen
*
m
,
maps
)
{
const
PerMapParameterSet
&
p
=
params
->
perMap
[
m
->
getName
()];
if
(
p
.
positionVBO
!=
NULL
&&
p
.
vectorVBO
!=
NULL
)
m_vectorShader
->
setScale
(
m
->
getBBdiagSize
()
/
100.0
f
*
p
.
vectorsScaleFactor
)
;
if
(
p
.
positionVBO
!=
NULL
)
{
m_vectorShader
->
setScale
(
m
->
getBBdiagSize
()
/
100.0
f
*
p
.
vectorsScaleFactor
)
;
m_vectorShader
->
setAttributePosition
(
p
.
positionVBO
)
;
m_vectorShader
->
setAttributeVector
(
p
.
vectorVBO
)
;
glLineWidth
(
1.0
f
)
;
m
->
draw
(
m_vectorShader
,
Algo
::
Render
::
GL2
::
POINTS
)
;
for
(
std
::
vector
<
Utils
::
VBO
*>::
const_iterator
it
=
p
.
vectorVBO
.
begin
();
it
!=
p
.
vectorVBO
.
end
();
++
it
)
{
m_vectorShader
->
setAttributeVector
(
*
it
)
;
glLineWidth
(
1.0
f
)
;
m
->
draw
(
m_vectorShader
,
Algo
::
Render
::
GL2
::
POINTS
)
;
}
}
}
}
...
...
@@ -155,14 +155,20 @@ void RenderVectorPlugin::cb_positionVBOChanged(int index)
}
}
void
RenderVectorPlugin
::
cb_
vectorVBOChanged
(
int
index
)
void
RenderVectorPlugin
::
cb_
selectedVectorVBOChanged
(
)
{
if
(
!
b_refreshingUI
)
{
View
*
current
=
m_window
->
getCurrentView
();
ParameterSet
*
params
=
h_viewParams
[
current
];
MapHandlerGen
*
map
=
params
->
selectedMap
;
params
->
perMap
[
map
->
getName
()].
vectorVBO
=
map
->
getVBO
(
m_dockTab
->
combo_vectorVBO
->
currentText
());
PerMapParameterSet
&
mapParam
=
params
->
perMap
[
map
->
getName
()];
mapParam
.
vectorVBO
.
clear
();
QList
<
QListWidgetItem
*>
currentItems
=
m_dockTab
->
list_vectorVBO
->
selectedItems
();
foreach
(
QListWidgetItem
*
item
,
currentItems
)
mapParam
.
vectorVBO
.
push_back
(
map
->
getVBO
(
item
->
text
()));
current
->
updateGL
();
}
}
...
...
@@ -194,7 +200,7 @@ void RenderVectorDockTab::refreshUI(ParameterSet* params)
mapList
->
clear
();
combo_positionVBO
->
clear
();
combo
_vectorVBO
->
clear
();
list
_vectorVBO
->
clear
();
MapHandlerGen
*
map
=
params
->
selectedMap
;
...
...
@@ -209,6 +215,7 @@ void RenderVectorDockTab::refreshUI(ParameterSet* params)
PerMapParameterSet
&
p
=
params
->
perMap
[
map
->
getName
()];
// QList<Utils::VBO*> vbos = map->getVBOList(nameOfType(VEC3()));
QList
<
Utils
::
VBO
*>
vbos
=
map
->
getVBOList
();
for
(
int
i
=
0
;
i
<
vbos
.
count
();
++
i
)
{
...
...
@@ -224,9 +231,9 @@ void RenderVectorDockTab::refreshUI(ParameterSet* params)
else
if
(
vbos
[
i
]
==
p
.
positionVBO
)
combo_positionVBO
->
setCurrentIndex
(
i
);
combo
_vectorVBO
->
addItem
(
QString
::
fromStdString
(
vbos
[
i
]
->
name
()));
if
(
vbos
[
i
]
==
p
.
vectorVBO
)
combo_vectorVBO
->
setCurrentIndex
(
i
);
list
_vectorVBO
->
addItem
(
QString
::
fromStdString
(
vbos
[
i
]
->
name
()));
if
(
std
::
find
(
p
.
vectorVBO
.
begin
(),
p
.
vectorVBO
.
end
(),
vbos
[
i
])
!=
p
.
vectorVBO
.
end
()
)
list_vectorVBO
->
item
(
i
)
->
setSelected
(
true
);
}
if
(
p
.
positionVBO
==
NULL
&&
vbos
.
count
()
>
0
)
...
...
@@ -234,11 +241,6 @@ void RenderVectorDockTab::refreshUI(ParameterSet* params)
p
.
positionVBO
=
vbos
[
0
];
combo_positionVBO
->
setCurrentIndex
(
0
);
}
if
(
p
.
vectorVBO
==
NULL
&&
vbos
.
count
()
>
0
)
{
p
.
vectorVBO
=
vbos
[
0
];
combo_vectorVBO
->
setCurrentIndex
(
0
);
}
slider_vectorsScaleFactor
->
setSliderPosition
(
p
.
vectorsScaleFactor
*
50.0
);
}
...
...
SCHNApps/Plugins/renderVector/renderVector.h
View file @
cf2b7944
...
...
@@ -15,14 +15,13 @@ struct PerMapParameterSet
{
PerMapParameterSet
()
: