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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
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
Sauvage
CGoGN
Commits
e6fb3a99
Commit
e6fb3a99
authored
Mar 12, 2013
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add option to compute kmean & kgaussian from compute curvature function
parent
31961900
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
190 additions
and
179 deletions
+190
-179
SCHNApps/Plugins/differentialProperties/forms/computeCurvatureDialog.ui
...ns/differentialProperties/forms/computeCurvatureDialog.ui
+148
-174
SCHNApps/Plugins/differentialProperties/include/differentialProperties.h
...s/differentialProperties/include/differentialProperties.h
+6
-2
SCHNApps/Plugins/differentialProperties/src/differentialProperties.cpp
...ins/differentialProperties/src/differentialProperties.cpp
+29
-1
SCHNApps/Plugins/renderScalar/src/renderScalar.cpp
SCHNApps/Plugins/renderScalar/src/renderScalar.cpp
+7
-2
No files found.
SCHNApps/Plugins/differentialProperties/forms/computeCurvatureDialog.ui
View file @
e6fb3a99
...
...
@@ -6,19 +6,19 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
5
70
</width>
<height>
4
5
2
</height>
<width>
5
68
</width>
<height>
4
4
2
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Compute Curvature
</string>
</property>
<layout
class=
"Q
VBoxLayout"
name=
"verticalLayout
"
>
<item>
<layout
class=
"Q
GridLayout"
name=
"gridLayout_2
"
>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QListWidget"
name=
"mapList"
/>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout
_2
"
>
<item
row=
"1"
column=
"0"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
...
...
@@ -61,25 +61,52 @@
</item>
</layout>
</item>
<item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QGroupBox"
name=
"groupBox"
>
<property
name=
"title"
>
<string>
Computed attributes
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_4"
>
<property
name=
"font"
>
<font>
<weight>
75
</weight>
<italic>
true
</italic>
<bold>
true
</bold>
</font>
</property>
<property
name=
"text"
>
<string>
Kmax :
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QLabel"
name=
"label_3"
>
<property
name=
"text"
>
<string>
Existing attribute :
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"2"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_4"
>
<item>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
New attribute :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"KmaxAttributeName"
/>
</item>
</layout>
<widget
class=
"QComboBox"
name=
"combo_KmaxAttribute"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item
row=
"0"
column=
"3"
>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
New attribute :
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"4"
>
<widget
class=
"QLineEdit"
name=
"KmaxAttributeName"
/>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_10"
>
...
...
@@ -96,39 +123,31 @@
</widget>
</item>
<item
row=
"1"
column=
"1"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_8"
>
<item>
<widget
class=
"QLabel"
name=
"label_9"
>
<property
name=
"text"
>
<string>
Existing attribute :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QComboBox"
name=
"combo_kmaxAttribute"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
<widget
class=
"QLabel"
name=
"label_9"
>
<property
name=
"text"
>
<string>
Existing attribute :
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"2"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_7"
>
<item>
<widget
class=
"QLabel"
name=
"label_8"
>
<property
name=
"text"
>
<string>
New attribute :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"kmaxAttributeName"
/>
</item>
</layout>
<widget
class=
"QComboBox"
name=
"combo_kmaxAttribute"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item
row=
"1"
column=
"3"
>
<widget
class=
"QLabel"
name=
"label_8"
>
<property
name=
"text"
>
<string>
New attribute :
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"4"
>
<widget
class=
"QLineEdit"
name=
"kmaxAttributeName"
/>
</item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_7"
>
...
...
@@ -145,39 +164,31 @@
</widget>
</item>
<item
row=
"2"
column=
"1"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_6"
>
<item>
<widget
class=
"QLabel"
name=
"label_6"
>
<property
name=
"text"
>
<string>
Existing attribute :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QComboBox"
name=
"combo_KminAttribute"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
<widget
class=
"QLabel"
name=
"label_6"
>
<property
name=
"text"
>
<string>
Existing attribute :
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"2"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_5"
>
<item>
<widget
class=
"QLabel"
name=
"label_5"
>
<property
name=
"text"
>
<string>
New attribute :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"KminAttributeName"
/>
</item>
</layout>
<widget
class=
"QComboBox"
name=
"combo_KminAttribute"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item
row=
"2"
column=
"3"
>
<widget
class=
"QLabel"
name=
"label_5"
>
<property
name=
"text"
>
<string>
New attribute :
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"4"
>
<widget
class=
"QLineEdit"
name=
"KminAttributeName"
/>
</item>
<item
row=
"3"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_13"
>
...
...
@@ -194,39 +205,31 @@
</widget>
</item>
<item
row=
"3"
column=
"1"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_10"
>
<item>
<widget
class=
"QLabel"
name=
"label_12"
>
<property
name=
"text"
>
<string>
Existing attribute :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QComboBox"
name=
"combo_kminAttribute"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
<widget
class=
"QLabel"
name=
"label_12"
>
<property
name=
"text"
>
<string>
Existing attribute :
</string>
</property>
</widget>
</item>
<item
row=
"3"
column=
"2"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_9"
>
<item>
<widget
class=
"QLabel"
name=
"label_11"
>
<property
name=
"text"
>
<string>
New attribute :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"kminAttributeName"
/>
</item>
</layout>
<widget
class=
"QComboBox"
name=
"combo_kminAttribute"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item
row=
"3"
column=
"3"
>
<widget
class=
"QLabel"
name=
"label_11"
>
<property
name=
"text"
>
<string>
New attribute :
</string>
</property>
</widget>
</item>
<item
row=
"3"
column=
"4"
>
<widget
class=
"QLineEdit"
name=
"kminAttributeName"
/>
</item>
<item
row=
"4"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_15"
>
...
...
@@ -243,80 +246,51 @@
</widget>
</item>
<item
row=
"4"
column=
"1"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_12"
>
<item>
<widget
class=
"QLabel"
name=
"label_17"
>
<property
name=
"text"
>
<string>
Existing attribute :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QComboBox"
name=
"combo_KnormalAttribute"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
<widget
class=
"QLabel"
name=
"label_17"
>
<property
name=
"text"
>
<string>
Existing attribute :
</string>
</property>
</widget>
</item>
<item
row=
"4"
column=
"2"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_11"
>
<item>
<widget
class=
"QLabel"
name=
"label_16"
>
<property
name=
"text"
>
<string>
New attribute :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"KnormalAttributeName"
/>
</item>
</layout>
<widget
class=
"QComboBox"
name=
"combo_KnormalAttribute"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_4"
>
<property
name=
"font"
>
<font>
<weight>
75
</weight>
<italic>
true
</italic>
<bold>
true
</bold>
</font>
<item
row=
"4"
column=
"3"
>
<widget
class=
"QLabel"
name=
"label_16"
>
<property
name=
"text"
>
<string>
New attribute :
</string>
</property>
</widget>
</item>
<item
row=
"4"
column=
"4"
>
<widget
class=
"QLineEdit"
name=
"KnormalAttributeName"
/>
</item>
<item
row=
"5"
column=
"0"
colspan=
"2"
>
<widget
class=
"QCheckBox"
name=
"check_computeKmean"
>
<property
name=
"text"
>
<string>
Kmax :
</string>
<string>
compute kmean
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<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_KmaxAttribute"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
<item
row=
"5"
column=
"2"
colspan=
"2"
>
<widget
class=
"QCheckBox"
name=
"check_computeKgaussian"
>
<property
name=
"text"
>
<string>
compute kgaussian
</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_
3
"
>
<item
row=
"3"
column=
"0"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_
2
"
>
<item>
<widget
class=
"QPushButton"
name=
"button_cancel"
>
<property
name=
"text"
>
...
...
SCHNApps/Plugins/differentialProperties/include/differentialProperties.h
View file @
e6fb3a99
...
...
@@ -62,6 +62,8 @@ public slots:
const
QString
&
KminAttributeName
=
"Kmin"
,
const
QString
&
kminAttributeName
=
"kmin"
,
const
QString
&
KnormalAttributeName
=
"Knormal"
,
bool
compute_kmean
=
true
,
bool
compute_kgaussian
=
true
,
bool
autoUpdate
=
true
);
...
...
@@ -90,10 +92,10 @@ private:
ComputeCurvatureParameters
(
const
QString
&
p
,
const
QString
&
n
,
const
QString
&
Kmax
,
const
QString
&
kmax
,
const
QString
&
Kmin
,
const
QString
&
kmin
,
const
QString
&
Knormal
,
bool
update
)
:
bool
kmean
,
bool
kgaussian
,
bool
update
)
:
positionName
(
p
),
normalName
(
n
),
KmaxName
(
Kmax
),
kmaxName
(
kmax
),
KminName
(
Kmin
),
kminName
(
kmin
),
KnormalName
(
Knormal
),
autoUpdate
(
update
)
compute_kmean
(
kmean
),
compute_kgaussian
(
kgaussian
),
autoUpdate
(
update
)
{}
QString
positionName
;
QString
normalName
;
...
...
@@ -102,6 +104,8 @@ private:
QString
KminName
;
QString
kminName
;
QString
KnormalName
;
bool
compute_kmean
;
bool
compute_kgaussian
;
bool
autoUpdate
;
};
QHash
<
QString
,
ComputeCurvatureParameters
>
computeCurvatureLastParameters
;
...
...
SCHNApps/Plugins/differentialProperties/src/differentialProperties.cpp
View file @
e6fb3a99
...
...
@@ -186,6 +186,8 @@ void DifferentialPropertiesPlugin::computeCurvature(
const
QString
&
KminAttributeName
,
const
QString
&
kminAttributeName
,
const
QString
&
KnormalAttributeName
,
bool
compute_kmean
,
bool
compute_kgaussian
,
bool
autoUpdate
)
{
MapHandler
<
PFP2
>*
mh
=
static_cast
<
MapHandler
<
PFP2
>*>
(
m_window
->
getMap
(
mapName
));
...
...
@@ -232,7 +234,7 @@ void DifferentialPropertiesPlugin::computeCurvature(
ComputeCurvatureParameters
(
positionAttributeName
,
normalAttributeName
,
KmaxAttributeName
,
kmaxAttributeName
,
KminAttributeName
,
kminAttributeName
,
KnormalAttributeName
,
autoUpdate
);
compute_kmean
,
compute_kgaussian
,
autoUpdate
);
mh
->
createVBO
(
Kmax
);
mh
->
createVBO
(
kmax
);
...
...
@@ -245,6 +247,32 @@ void DifferentialPropertiesPlugin::computeCurvature(
mh
->
notifyAttributeModification
(
Kmin
);
mh
->
notifyAttributeModification
(
kmin
);
mh
->
notifyAttributeModification
(
Knormal
);
if
(
compute_kmean
)
{
VertexAttribute
<
PFP2
::
REAL
>
kmean
=
mh
->
getAttribute
<
PFP2
::
REAL
,
VERTEX
>
(
"kmean"
);
if
(
!
kmean
.
isValid
())
kmean
=
mh
->
addAttribute
<
PFP2
::
REAL
,
VERTEX
>
(
"kmean"
);
for
(
unsigned
int
i
=
kmin
.
begin
();
i
!=
kmin
.
end
();
kmin
.
next
(
i
))
kmean
[
i
]
=
(
kmin
[
i
]
+
kmax
[
i
])
/
2.0
;
mh
->
createVBO
(
kmean
);
mh
->
notifyAttributeModification
(
kmean
);
}
if
(
compute_kgaussian
)
{
VertexAttribute
<
PFP2
::
REAL
>
kgaussian
=
mh
->
getAttribute
<
PFP2
::
REAL
,
VERTEX
>
(
"kgaussian"
);
if
(
!
kgaussian
.
isValid
())
kgaussian
=
mh
->
addAttribute
<
PFP2
::
REAL
,
VERTEX
>
(
"kgaussian"
);
for
(
unsigned
int
i
=
kmin
.
begin
();
i
!=
kmin
.
end
();
kmin
.
next
(
i
))
kgaussian
[
i
]
=
kmin
[
i
]
*
kmax
[
i
];
mh
->
createVBO
(
kgaussian
);
mh
->
notifyAttributeModification
(
kgaussian
);
}
}
#ifndef DEBUG
...
...
SCHNApps/Plugins/renderScalar/src/renderScalar.cpp
View file @
e6fb3a99
...
...
@@ -67,7 +67,12 @@ void RenderScalarPlugin::redraw(View* view)
m_scalarShader
->
setMinValue
(
p
->
scalarMin
);
m_scalarShader
->
setMaxValue
(
p
->
scalarMax
);
m_scalarShader
->
setExpansion
(
p
->
expansion
);
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_FILL
);
glEnable
(
GL_POLYGON_OFFSET_FILL
);
glPolygonOffset
(
1.0
f
,
1.0
f
);
m
->
draw
(
m_scalarShader
,
Algo
::
Render
::
GL2
::
TRIANGLES
);
glDisable
(
GL_POLYGON_OFFSET_FILL
);
}
}
}
...
...
@@ -251,8 +256,8 @@ void RenderScalarPlugin::attributeModified(unsigned int orbit, QString nameAttr)
if
(
perMap
->
scalarVBO
&&
nameAttr
==
QString
::
fromStdString
(
perMap
->
scalarVBO
->
name
()))
{
const
VertexAttribute
<
PFP2
::
REAL
>&
attr
=
map
->
getAttribute
<
PFP2
::
REAL
,
VERTEX
>
(
nameAttr
);
perMap
->
scalarMin
=
1e20
;
perMap
->
scalarMax
=
-
1e20
;
perMap
->
scalarMin
=
std
::
numeric_limits
<
float
>::
max
()
;
perMap
->
scalarMax
=
std
::
numeric_limits
<
float
>::
min
()
;
for
(
unsigned
int
i
=
attr
.
begin
();
i
!=
attr
.
end
();
attr
.
next
(
i
))
{
perMap
->
scalarMin
=
attr
[
i
]
<
perMap
->
scalarMin
?
attr
[
i
]
:
perMap
->
scalarMin
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment