Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
KennethVanhoey
CGoGN
Commits
e4868c57
Commit
e4868c57
authored
Dec 20, 2012
by
Pierre Kraemer
Browse files
SCHNApps: remove some warning + start compute normals
parent
aadb3d36
Changes
8
Hide whitespace changes
Inline
Side-by-side
SCHNApps/Plugins/differentialProperties/computeNormalsDialog.ui
View file @
e4868c57
...
...
@@ -17,6 +17,16 @@
<item>
<widget
class=
"QListWidget"
name=
"mapList"
/>
</item>
<item>
<widget
class=
"QComboBox"
name=
"combo_positionAttribute"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"MinimumExpanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item>
...
...
SCHNApps/Plugins/differentialProperties/differentialProperties.cpp
View file @
e4868c57
...
...
@@ -4,17 +4,47 @@
#include
"Algo/Geometry/normal.h"
ComputeNormalsDialog
::
ComputeNormalsDialog
(
Window
*
w
)
:
m_window
(
w
)
{
setupUi
(
this
);
connect
(
mapList
,
SIGNAL
(
itemSelectionChanged
()),
this
,
SLOT
(
cb_selectedMapChanged
()));
}
void
ComputeNormalsDialog
::
cb_selectedMapChanged
()
{
QList
<
QListWidgetItem
*>
currentItems
=
mapList
->
selectedItems
();
if
(
!
currentItems
.
empty
())
{
combo_positionAttribute
->
clear
();
const
QString
&
mapname
=
currentItems
[
0
]
->
text
();
MapHandlerGen
*
mh
=
m_window
->
getMap
(
mapname
);
GenericMap
*
map
=
mh
->
getGenericMap
();
AttributeContainer
&
cont
=
map
->
getAttributeContainer
<
VERTEX
>
();
std
::
vector
<
std
::
string
>
names
;
cont
.
getAttributesNames
(
names
);
for
(
unsigned
int
i
=
0
;
i
<
names
.
size
();
++
i
)
combo_positionAttribute
->
addItem
(
QString
::
fromStdString
(
names
[
i
]));
}
}
bool
DifferentialPropertiesPlugin
::
enable
()
{
m_computeNormalsDialog
=
new
ComputeNormalsDialog
();
m_computeNormalsDialog
=
new
ComputeNormalsDialog
(
m_window
);
computeNormalsAction
=
new
QAction
(
"import"
,
this
);
addMenuAction
(
"Surface;DifferentialProperties;Compute Normals"
,
computeNormalsAction
);
connect
(
computeNormalsAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
cb_computeNormals
()));
connect
(
computeNormalsAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
cb_openComputeNormalsDialog
()));
connect
(
m_computeNormalsDialog
,
SIGNAL
(
accepted
()),
this
,
SLOT
(
cb_computeNormals
()));
return
true
;
}
void
DifferentialPropertiesPlugin
::
cb_
c
omputeNormals
()
void
DifferentialPropertiesPlugin
::
cb_
openC
omputeNormals
Dialog
()
{
m_computeNormalsDialog
->
mapList
->
clear
();
m_computeNormalsDialog
->
attributeName
->
setText
(
"normal"
);
...
...
@@ -25,6 +55,24 @@ void DifferentialPropertiesPlugin::cb_computeNormals()
m_computeNormalsDialog
->
show
();
}
void
DifferentialPropertiesPlugin
::
cb_computeNormals
()
{
QList
<
QListWidgetItem
*>
currentItems
=
m_computeNormalsDialog
->
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
();
VertexAttribute
<
VEC3
>
position
=
map
->
getAttribute
<
VEC3
,
VERTEX
>
(
positionName
);
VertexAttribute
<
VEC3
>
normal
=
map
->
getAttribute
<
VEC3
,
VERTEX
>
(
normalName
);
if
(
!
normal
.
isValid
())
normal
=
map
->
addAttribute
<
VEC3
,
VERTEX
>
(
normalName
);
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
*
map
,
position
,
normal
);
}
}
#ifndef DEBUG
Q_EXPORT_PLUGIN2
(
DifferentialPropertiesPlugin
,
DifferentialPropertiesPlugin
)
#else
...
...
SCHNApps/Plugins/differentialProperties/differentialProperties.h
View file @
e4868c57
...
...
@@ -25,8 +25,16 @@ typedef PFP::VEC3 VEC3;
class
ComputeNormalsDialog
:
public
QDialog
,
public
Ui
::
ComputeNormalsDialog
{
Q_OBJECT
public:
ComputeNormalsDialog
()
{
setupUi
(
this
);
}
ComputeNormalsDialog
(
Window
*
w
);
public
slots
:
void
cb_selectedMapChanged
();
private:
Window
*
m_window
;
};
...
...
@@ -64,6 +72,7 @@ public:
virtual
void
mapUnlinked
(
View
*
view
,
MapHandlerGen
*
m
)
{}
public
slots
:
void
cb_openComputeNormalsDialog
();
void
cb_computeNormals
();
private:
...
...
SCHNApps/Plugins/renderVector/renderVector.cpp
View file @
e4868c57
...
...
@@ -9,8 +9,8 @@ bool RenderVectorPlugin::enable()
m_dockTab
=
new
RenderVectorDockTab
(
this
);
addTabInDock
(
m_dockTab
,
"RenderVector"
);
m_vectorShader
=
new
Utils
::
ShaderVectorPerVertex
()
;
m_vectorShader
->
setColor
(
Geom
::
Vec4f
(
1.0
f
,
0.0
f
,
0.0
f
,
1.0
f
))
;
m_vectorShader
=
new
Utils
::
ShaderVectorPerVertex
();
m_vectorShader
->
setColor
(
Geom
::
Vec4f
(
1.0
f
,
0.0
f
,
0.0
f
,
1.0
f
));
registerShader
(
m_vectorShader
);
...
...
SCHNApps/include/camera.h
View file @
e4868c57
...
...
@@ -33,7 +33,7 @@ public:
* CAMERA DRAWING
*********************************************************/
void
draw
();
virtual
void
draw
();
bool
getDraw
()
const
{
return
m_draw
;
}
void
setDraw
(
bool
b
=
true
)
{
m_draw
=
b
;
}
...
...
SCHNApps/include/mapHandler.h
View file @
e4868c57
...
...
@@ -116,15 +116,6 @@ public:
{
m_render
->
initPrimitives
<
PFP
>
(
*
(
reinterpret_cast
<
typename
PFP
::
MAP
*>
(
m_map
)),
good
,
primitive
)
;
}
void
updateVBOs
()
{
QList
<
Utils
::
VBO
*>
vbos
=
getVBOList
();
foreach
(
Utils
::
VBO
*
vbo
,
vbos
)
{
}
}
};
}
// namespace SCHNApps
...
...
SCHNApps/include/types.h
View file @
e4868c57
...
...
@@ -21,7 +21,7 @@ class Plugin;
class
View
;
class
Camera
;
class
MapHandlerGen
;
class
Texture
;
struct
Texture
;
typedef
QHash
<
QString
,
Plugin
*>
PluginHash
;
typedef
QHash
<
QString
,
View
*>
ViewHash
;
...
...
SCHNApps/include/viewButtonArea.h
View file @
e4868c57
...
...
@@ -16,7 +16,7 @@ namespace SCHNApps
{
class
View
;
class
Texture
;
struct
Texture
;
class
ViewButton
:
public
QObject
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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