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
Thomas Pitiot
CGoGN
Commits
e4868c57
Commit
e4868c57
authored
Dec 20, 2012
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCHNApps: remove some warning + start compute normals
parent
aadb3d36
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
76 additions
and
18 deletions
+76
-18
SCHNApps/Plugins/differentialProperties/computeNormalsDialog.ui
...ps/Plugins/differentialProperties/computeNormalsDialog.ui
+10
-0
SCHNApps/Plugins/differentialProperties/differentialProperties.cpp
...Plugins/differentialProperties/differentialProperties.cpp
+51
-3
SCHNApps/Plugins/differentialProperties/differentialProperties.h
...s/Plugins/differentialProperties/differentialProperties.h
+10
-1
SCHNApps/Plugins/renderVector/renderVector.cpp
SCHNApps/Plugins/renderVector/renderVector.cpp
+2
-2
SCHNApps/include/camera.h
SCHNApps/include/camera.h
+1
-1
SCHNApps/include/mapHandler.h
SCHNApps/include/mapHandler.h
+0
-9
SCHNApps/include/types.h
SCHNApps/include/types.h
+1
-1
SCHNApps/include/viewButtonArea.h
SCHNApps/include/viewButtonArea.h
+1
-1
No files found.
SCHNApps/Plugins/differentialProperties/computeNormalsDialog.ui
View file @
e4868c57
...
@@ -17,6 +17,16 @@
...
@@ -17,6 +17,16 @@
<item>
<item>
<widget
class=
"QListWidget"
name=
"mapList"
/>
<widget
class=
"QListWidget"
name=
"mapList"
/>
</item>
</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>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item>
<item>
...
...
SCHNApps/Plugins/differentialProperties/differentialProperties.cpp
View file @
e4868c57
...
@@ -4,17 +4,47 @@
...
@@ -4,17 +4,47 @@
#include "Algo/Geometry/normal.h"
#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
()
bool
DifferentialPropertiesPlugin
::
enable
()
{
{
m_computeNormalsDialog
=
new
ComputeNormalsDialog
();
m_computeNormalsDialog
=
new
ComputeNormalsDialog
(
m_window
);
computeNormalsAction
=
new
QAction
(
"import"
,
this
);
computeNormalsAction
=
new
QAction
(
"import"
,
this
);
addMenuAction
(
"Surface;DifferentialProperties;Compute Normals"
,
computeNormalsAction
);
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
;
return
true
;
}
}
void
DifferentialPropertiesPlugin
::
cb_
computeNormals
()
void
DifferentialPropertiesPlugin
::
cb_
openComputeNormalsDialog
()
{
{
m_computeNormalsDialog
->
mapList
->
clear
();
m_computeNormalsDialog
->
mapList
->
clear
();
m_computeNormalsDialog
->
attributeName
->
setText
(
"normal"
);
m_computeNormalsDialog
->
attributeName
->
setText
(
"normal"
);
...
@@ -25,6 +55,24 @@ void DifferentialPropertiesPlugin::cb_computeNormals()
...
@@ -25,6 +55,24 @@ void DifferentialPropertiesPlugin::cb_computeNormals()
m_computeNormalsDialog
->
show
();
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
#ifndef DEBUG
Q_EXPORT_PLUGIN2
(
DifferentialPropertiesPlugin
,
DifferentialPropertiesPlugin
)
Q_EXPORT_PLUGIN2
(
DifferentialPropertiesPlugin
,
DifferentialPropertiesPlugin
)
#else
#else
...
...
SCHNApps/Plugins/differentialProperties/differentialProperties.h
View file @
e4868c57
...
@@ -25,8 +25,16 @@ typedef PFP::VEC3 VEC3;
...
@@ -25,8 +25,16 @@ typedef PFP::VEC3 VEC3;
class
ComputeNormalsDialog
:
public
QDialog
,
public
Ui
::
ComputeNormalsDialog
class
ComputeNormalsDialog
:
public
QDialog
,
public
Ui
::
ComputeNormalsDialog
{
{
Q_OBJECT
public:
public:
ComputeNormalsDialog
()
{
setupUi
(
this
);
}
ComputeNormalsDialog
(
Window
*
w
);
public
slots
:
void
cb_selectedMapChanged
();
private:
Window
*
m_window
;
};
};
...
@@ -64,6 +72,7 @@ public:
...
@@ -64,6 +72,7 @@ public:
virtual
void
mapUnlinked
(
View
*
view
,
MapHandlerGen
*
m
)
{}
virtual
void
mapUnlinked
(
View
*
view
,
MapHandlerGen
*
m
)
{}
public
slots
:
public
slots
:
void
cb_openComputeNormalsDialog
();
void
cb_computeNormals
();
void
cb_computeNormals
();
private:
private:
...
...
SCHNApps/Plugins/renderVector/renderVector.cpp
View file @
e4868c57
...
@@ -9,8 +9,8 @@ bool RenderVectorPlugin::enable()
...
@@ -9,8 +9,8 @@ bool RenderVectorPlugin::enable()
m_dockTab
=
new
RenderVectorDockTab
(
this
);
m_dockTab
=
new
RenderVectorDockTab
(
this
);
addTabInDock
(
m_dockTab
,
"RenderVector"
);
addTabInDock
(
m_dockTab
,
"RenderVector"
);
m_vectorShader
=
new
Utils
::
ShaderVectorPerVertex
()
;
m_vectorShader
=
new
Utils
::
ShaderVectorPerVertex
();
m_vectorShader
->
setColor
(
Geom
::
Vec4f
(
1.0
f
,
0.0
f
,
0.0
f
,
1.0
f
))
;
m_vectorShader
->
setColor
(
Geom
::
Vec4f
(
1.0
f
,
0.0
f
,
0.0
f
,
1.0
f
));
registerShader
(
m_vectorShader
);
registerShader
(
m_vectorShader
);
...
...
SCHNApps/include/camera.h
View file @
e4868c57
...
@@ -33,7 +33,7 @@ public:
...
@@ -33,7 +33,7 @@ public:
* CAMERA DRAWING
* CAMERA DRAWING
*********************************************************/
*********************************************************/
void
draw
();
v
irtual
v
oid
draw
();
bool
getDraw
()
const
{
return
m_draw
;
}
bool
getDraw
()
const
{
return
m_draw
;
}
void
setDraw
(
bool
b
=
true
)
{
m_draw
=
b
;
}
void
setDraw
(
bool
b
=
true
)
{
m_draw
=
b
;
}
...
...
SCHNApps/include/mapHandler.h
View file @
e4868c57
...
@@ -116,15 +116,6 @@ public:
...
@@ -116,15 +116,6 @@ public:
{
{
m_render
->
initPrimitives
<
PFP
>
(
*
(
reinterpret_cast
<
typename
PFP
::
MAP
*>
(
m_map
)),
good
,
primitive
)
;
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
}
// namespace SCHNApps
...
...
SCHNApps/include/types.h
View file @
e4868c57
...
@@ -21,7 +21,7 @@ class Plugin;
...
@@ -21,7 +21,7 @@ class Plugin;
class
View
;
class
View
;
class
Camera
;
class
Camera
;
class
MapHandlerGen
;
class
MapHandlerGen
;
class
Texture
;
struct
Texture
;
typedef
QHash
<
QString
,
Plugin
*>
PluginHash
;
typedef
QHash
<
QString
,
Plugin
*>
PluginHash
;
typedef
QHash
<
QString
,
View
*>
ViewHash
;
typedef
QHash
<
QString
,
View
*>
ViewHash
;
...
...
SCHNApps/include/viewButtonArea.h
View file @
e4868c57
...
@@ -16,7 +16,7 @@ namespace SCHNApps
...
@@ -16,7 +16,7 @@ namespace SCHNApps
{
{
class
View
;
class
View
;
class
Texture
;
struct
Texture
;
class
ViewButton
:
public
QObject
class
ViewButton
:
public
QObject
{
{
...
...
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