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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CGoGN
CGoGN
Commits
0a2944b2
Commit
0a2944b2
authored
Dec 21, 2012
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCHNApps: select default attributes in some plugins
parent
6026763c
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
112 additions
and
24 deletions
+112
-24
SCHNApps/Plugins/differentialProperties/src/computeNormalsDialog.cpp
...ugins/differentialProperties/src/computeNormalsDialog.cpp
+6
-0
SCHNApps/Plugins/render/render.cpp
SCHNApps/Plugins/render/render.cpp
+48
-4
SCHNApps/Plugins/render/render.h
SCHNApps/Plugins/render/render.h
+2
-0
SCHNApps/Plugins/renderVector/renderVector.cpp
SCHNApps/Plugins/renderVector/renderVector.cpp
+33
-3
SCHNApps/Plugins/renderVector/renderVector.h
SCHNApps/Plugins/renderVector/renderVector.h
+2
-0
SCHNApps/Plugins/subdivideSurface/subdivideSurface.cpp
SCHNApps/Plugins/subdivideSurface/subdivideSurface.cpp
+6
-0
SCHNApps/include/plugin.h
SCHNApps/include/plugin.h
+1
-0
SCHNApps/src/dialogs/pluginsViewDialog.cpp
SCHNApps/src/dialogs/pluginsViewDialog.cpp
+0
-2
SCHNApps/src/plugin.cpp
SCHNApps/src/plugin.cpp
+0
-6
SCHNApps/src/view.cpp
SCHNApps/src/view.cpp
+4
-5
SCHNApps/src/window.cpp
SCHNApps/src/window.cpp
+10
-4
No files found.
SCHNApps/Plugins/differentialProperties/src/computeNormalsDialog.cpp
View file @
0a2944b2
...
...
@@ -42,10 +42,16 @@ void ComputeNormalsDialog::cb_selectedMapChanged()
cont
.
getAttributesNames
(
names
);
cont
.
getAttributesTypes
(
types
);
std
::
string
vec3TypeName
=
VEC3
::
CGoGNnameOfType
();
unsigned
int
j
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
names
.
size
();
++
i
)
{
if
(
types
[
i
]
==
vec3TypeName
)
{
combo_positionAttribute
->
addItem
(
QString
::
fromStdString
(
names
[
i
]));
if
(
names
[
i
]
==
"position"
)
// try to select an attribute named "position"
combo_positionAttribute
->
setCurrentIndex
(
j
);
++
j
;
}
}
}
}
...
...
SCHNApps/Plugins/render/render.cpp
View file @
0a2944b2
...
...
@@ -4,6 +4,32 @@
#include "Algo/Import/import.h"
PerMapParameterSet
::
PerMapParameterSet
(
MapHandlerGen
*
map
)
:
positionVBO
(
NULL
),
normalVBO
(
NULL
),
verticesScaleFactor
(
1.0
f
),
renderVertices
(
false
),
renderEdges
(
false
),
renderFaces
(
true
),
faceStyle
(
FLAT
)
{
QList
<
Utils
::
VBO
*>
vbos
=
map
->
getVBOList
();
for
(
int
i
=
0
;
i
<
vbos
.
count
();
++
i
)
{
if
(
vbos
[
i
]
->
name
()
==
"position"
)
// try to select a VBO named "position"
positionVBO
=
vbos
[
i
];
if
(
vbos
[
i
]
->
name
()
==
"normal"
)
// try to select a VBO named "normal"
normalVBO
=
vbos
[
i
];
}
if
(
positionVBO
==
NULL
&&
vbos
.
count
()
>
0
)
positionVBO
=
vbos
[
0
];
if
(
normalVBO
==
NULL
&&
vbos
.
count
()
>
0
)
normalVBO
=
vbos
[
0
];
}
bool
RenderPlugin
::
enable
()
{
m_dockTab
=
new
RenderDockTab
(
this
);
...
...
@@ -110,7 +136,7 @@ void RenderPlugin::viewLinked(View* view)
const
QList
<
MapHandlerGen
*>&
maps
=
view
->
getLinkedMaps
();
foreach
(
MapHandlerGen
*
map
,
maps
)
{
PerMapParameterSet
p
;
PerMapParameterSet
p
(
map
)
;
params
->
perMap
.
insert
(
map
->
getName
(),
p
);
}
...
...
@@ -136,7 +162,7 @@ void RenderPlugin::mapLinked(View* view, MapHandlerGen* m)
{
assert
(
isLinkedToView
(
view
));
ParameterSet
*
params
=
h_viewParams
[
view
];
PerMapParameterSet
p
;
PerMapParameterSet
p
(
m
)
;
params
->
perMap
.
insert
(
m
->
getName
(),
p
);
m_dockTab
->
refreshUI
(
params
);
...
...
@@ -293,12 +319,30 @@ void RenderDockTab::refreshUI(ParameterSet* params)
for
(
int
i
=
0
;
i
<
vbos
.
count
();
++
i
)
{
combo_positionVBO
->
addItem
(
QString
::
fromStdString
(
vbos
[
i
]
->
name
()));
if
(
vbos
[
i
]
==
p
.
positionVBO
)
if
(
p
.
positionVBO
==
NULL
)
{
// if nothing is specified in the parameter set
if
(
vbos
[
i
]
->
name
()
==
"position"
)
// try to select a VBO named "position"
{
p
.
positionVBO
=
vbos
[
i
];
combo_positionVBO
->
setCurrentIndex
(
i
);
}
}
else
if
(
vbos
[
i
]
==
p
.
positionVBO
)
combo_positionVBO
->
setCurrentIndex
(
i
);
combo_normalVBO
->
addItem
(
QString
::
fromStdString
(
vbos
[
i
]
->
name
()));
if
(
vbos
[
i
]
==
p
.
normalVBO
)
if
(
p
.
normalVBO
==
NULL
)
{
// if nothing is specified in the parameter set
if
(
vbos
[
i
]
->
name
()
==
"normal"
)
// try to select a VBO named "normal"
{
p
.
normalVBO
=
vbos
[
i
];
combo_normalVBO
->
setCurrentIndex
(
i
);
}
}
else
if
(
vbos
[
i
]
==
p
.
normalVBO
)
combo_normalVBO
->
setCurrentIndex
(
i
);
}
if
(
p
.
positionVBO
==
NULL
&&
vbos
.
count
()
>
0
)
{
p
.
positionVBO
=
vbos
[
0
];
...
...
SCHNApps/Plugins/render/render.h
View file @
0a2944b2
...
...
@@ -32,6 +32,8 @@ struct PerMapParameterSet
faceStyle
(
FLAT
)
{}
PerMapParameterSet
(
MapHandlerGen
*
map
);
Utils
::
VBO
*
positionVBO
;
Utils
::
VBO
*
normalVBO
;
float
verticesScaleFactor
;
...
...
SCHNApps/Plugins/renderVector/renderVector.cpp
View file @
0a2944b2
...
...
@@ -4,6 +4,26 @@
#include "Algo/Import/import.h"
PerMapParameterSet
::
PerMapParameterSet
(
MapHandlerGen
*
map
)
:
positionVBO
(
NULL
),
vectorVBO
(
NULL
),
vectorsScaleFactor
(
1.0
f
)
{
QList
<
Utils
::
VBO
*>
vbos
=
map
->
getVBOList
();
for
(
int
i
=
0
;
i
<
vbos
.
count
();
++
i
)
{
if
(
vbos
[
i
]
->
name
()
==
"position"
)
// try to select a VBO named "position"
positionVBO
=
vbos
[
i
];
}
if
(
positionVBO
==
NULL
&&
vbos
.
count
()
>
0
)
positionVBO
=
vbos
[
0
];
if
(
vectorVBO
==
NULL
&&
vbos
.
count
()
>
0
)
vectorVBO
=
vbos
[
0
];
}
bool
RenderVectorPlugin
::
enable
()
{
m_dockTab
=
new
RenderVectorDockTab
(
this
);
...
...
@@ -54,7 +74,7 @@ void RenderVectorPlugin::viewLinked(View* view)
const
QList
<
MapHandlerGen
*>&
maps
=
view
->
getLinkedMaps
();
foreach
(
MapHandlerGen
*
map
,
maps
)
{
PerMapParameterSet
p
;
PerMapParameterSet
p
(
map
)
;
params
->
perMap
.
insert
(
map
->
getName
(),
p
);
}
...
...
@@ -80,7 +100,7 @@ void RenderVectorPlugin::mapLinked(View* view, MapHandlerGen* m)
{
assert
(
isLinkedToView
(
view
));
ParameterSet
*
params
=
h_viewParams
[
view
];
PerMapParameterSet
p
;
PerMapParameterSet
p
(
m
)
;
params
->
perMap
.
insert
(
m
->
getName
(),
p
);
m_dockTab
->
refreshUI
(
params
);
...
...
@@ -186,12 +206,22 @@ void RenderVectorDockTab::refreshUI(ParameterSet* params)
for
(
int
i
=
0
;
i
<
vbos
.
count
();
++
i
)
{
combo_positionVBO
->
addItem
(
QString
::
fromStdString
(
vbos
[
i
]
->
name
()));
if
(
vbos
[
i
]
==
p
.
positionVBO
)
if
(
p
.
positionVBO
==
NULL
)
{
// if nothing is specified in the parameter set
if
(
vbos
[
i
]
->
name
()
==
"position"
)
// try to select a VBO named "position"
{
p
.
positionVBO
=
vbos
[
i
];
combo_positionVBO
->
setCurrentIndex
(
i
);
}
}
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
);
}
if
(
p
.
positionVBO
==
NULL
&&
vbos
.
count
()
>
0
)
{
p
.
positionVBO
=
vbos
[
0
];
...
...
SCHNApps/Plugins/renderVector/renderVector.h
View file @
0a2944b2
...
...
@@ -19,6 +19,8 @@ struct PerMapParameterSet
vectorsScaleFactor
(
1.0
f
)
{}
PerMapParameterSet
(
MapHandlerGen
*
map
);
Utils
::
VBO
*
positionVBO
;
Utils
::
VBO
*
vectorVBO
;
float
vectorsScaleFactor
;
...
...
SCHNApps/Plugins/subdivideSurface/subdivideSurface.cpp
View file @
0a2944b2
...
...
@@ -54,10 +54,16 @@ void SubdivideSurfacePlugin::cb_selectedMapChanged()
cont
.
getAttributesNames
(
names
);
cont
.
getAttributesTypes
(
types
);
std
::
string
vec3TypeName
=
VEC3
::
CGoGNnameOfType
();
unsigned
int
j
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
names
.
size
();
++
i
)
{
if
(
types
[
i
]
==
vec3TypeName
)
{
m_dockTab
->
combo_positionAttribute
->
addItem
(
QString
::
fromStdString
(
names
[
i
]));
if
(
names
[
i
]
==
"position"
)
// try to select an attribute named "position"
m_dockTab
->
combo_positionAttribute
->
setCurrentIndex
(
j
);
++
j
;
}
}
}
}
...
...
SCHNApps/include/plugin.h
View file @
0a2944b2
...
...
@@ -68,6 +68,7 @@ public:
void
registerShader
(
Utils
::
GLSLShader
*
shader
);
void
unregisterShader
(
Utils
::
GLSLShader
*
shader
);
const
QList
<
Utils
::
GLSLShader
*>
getShaders
()
const
{
return
l_shaders
;
}
/*********************************************************
* MANAGE DOCK TABS
...
...
SCHNApps/src/dialogs/pluginsViewDialog.cpp
View file @
0a2944b2
...
...
@@ -46,14 +46,12 @@ void PluginsViewDialog::cb_selectedPluginsChanged()
if
(
pluginList
->
item
(
i
)
->
isSelected
()
&&
!
m_view
->
isLinkedToPlugin
(
plugin
))
{
assert
(
!
plugin
->
isLinkedToView
(
m_view
));
std
::
cout
<<
"link view : "
<<
m_view
->
getName
().
toUtf8
().
constData
()
<<
" to plugin : "
<<
plugin
->
getName
().
toUtf8
().
constData
()
<<
std
::
endl
;
m_view
->
linkPlugin
(
plugin
);
plugin
->
linkView
(
m_view
);
}
else
if
(
!
pluginList
->
item
(
i
)
->
isSelected
()
&&
m_view
->
isLinkedToPlugin
(
plugin
))
{
assert
(
plugin
->
isLinkedToView
(
m_view
));
std
::
cout
<<
"unlink view : "
<<
m_view
->
getName
().
toUtf8
().
constData
()
<<
" from plugin : "
<<
plugin
->
getName
().
toUtf8
().
constData
()
<<
std
::
endl
;
m_view
->
unlinkPlugin
(
plugin
);
plugin
->
unlinkView
(
m_view
);
}
...
...
SCHNApps/src/plugin.cpp
View file @
0a2944b2
...
...
@@ -45,8 +45,6 @@ bool Plugin::linkView(View* view)
if
(
view
&&
!
l_views
.
contains
(
view
))
{
l_views
.
push_back
(
view
);
foreach
(
Utils
::
GLSLShader
*
shader
,
l_shaders
)
Utils
::
GLSLShader
::
registerShader
(
view
,
shader
);
viewLinked
(
view
);
return
true
;
}
...
...
@@ -57,11 +55,7 @@ bool Plugin::linkView(View* view)
void
Plugin
::
unlinkView
(
View
*
view
)
{
if
(
l_views
.
removeOne
(
view
))
{
foreach
(
Utils
::
GLSLShader
*
shader
,
l_shaders
)
Utils
::
GLSLShader
::
unregisterShader
(
view
,
shader
);
viewUnlinked
(
view
);
}
}
/*********************************************************
...
...
SCHNApps/src/view.cpp
View file @
0a2944b2
...
...
@@ -106,12 +106,11 @@ void View::preDraw()
glm
::
mat4
mm
=
getCurrentModelViewMatrix
();
glm
::
mat4
pm
=
getCurrentProjectionMatrix
();
for
(
std
::
set
<
std
::
pair
<
void
*
,
CGoGN
::
Utils
::
GLSLShader
*>
>::
iterator
it
=
CGoGN
::
Utils
::
GLSLShader
::
m_registeredShaders
.
begin
();
it
!=
CGoGN
::
Utils
::
GLSLShader
::
m_registeredShaders
.
end
();
++
it
)
foreach
(
Plugin
*
plugin
,
l_plugins
)
{
if
(
it
->
first
==
this
||
it
->
first
==
NULL
)
it
->
second
->
updateMatrices
(
pm
,
mm
);
const
QList
<
CGoGN
::
Utils
::
GLSLShader
*>&
shaders
=
plugin
->
getShaders
();
foreach
(
CGoGN
::
Utils
::
GLSLShader
*
shader
,
shaders
)
shader
->
updateMatrices
(
pm
,
mm
);
}
QGLViewer
::
preDraw
();
...
...
SCHNApps/src/window.cpp
View file @
0a2944b2
...
...
@@ -163,7 +163,6 @@ bool Window::addMenuAction(const QString& menuPath, QAction* action)
return
false
;
}
// for every extracted substring
unsigned
int
i
=
0
;
QMenu
*
lastMenu
=
NULL
;
foreach
(
QString
step
,
stepNames
)
...
...
@@ -189,9 +188,16 @@ bool Window::addMenuAction(const QString& menuPath, QAction* action)
if
(
!
found
)
{
QMenu
*
newMenu
;
if
(
i
==
1
)
newMenu
=
menubar
->
addMenu
(
step
);
else
newMenu
=
lastMenu
->
addMenu
(
step
);
newMenu
->
setParent
(
lastMenu
);
if
(
i
==
1
)
{
newMenu
=
menubar
->
addMenu
(
step
);
newMenu
->
setParent
(
menubar
);
}
else
{
newMenu
=
lastMenu
->
addMenu
(
step
);
newMenu
->
setParent
(
lastMenu
);
}
lastMenu
=
newMenu
;
}
}
...
...
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