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
a75d3772
Commit
a75d3772
authored
Feb 13, 2013
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCHNApps: several bug fixes + plugins UI code reorganization
parent
240da51a
Changes
43
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
1277 additions
and
1064 deletions
+1277
-1064
SCHNApps/Plugins/differentialProperties/include/computeCurvatureDialog.h
...s/differentialProperties/include/computeCurvatureDialog.h
+2
-1
SCHNApps/Plugins/differentialProperties/include/computeNormalDialog.h
...gins/differentialProperties/include/computeNormalDialog.h
+2
-1
SCHNApps/Plugins/differentialProperties/src/computeCurvatureDialog.cpp
...ins/differentialProperties/src/computeCurvatureDialog.cpp
+50
-31
SCHNApps/Plugins/differentialProperties/src/computeNormalDialog.cpp
...lugins/differentialProperties/src/computeNormalDialog.cpp
+29
-19
SCHNApps/Plugins/importSurface/src/importSurface.cpp
SCHNApps/Plugins/importSurface/src/importSurface.cpp
+2
-1
SCHNApps/Plugins/importVolume/src/importVolume.cpp
SCHNApps/Plugins/importVolume/src/importVolume.cpp
+2
-1
SCHNApps/Plugins/render/CMakeLists.txt
SCHNApps/Plugins/render/CMakeLists.txt
+1
-0
SCHNApps/Plugins/render/forms/render.ui
SCHNApps/Plugins/render/forms/render.ui
+2
-2
SCHNApps/Plugins/render/include/render.h
SCHNApps/Plugins/render/include/render.h
+10
-35
SCHNApps/Plugins/render/include/renderDockTab.h
SCHNApps/Plugins/render/include/renderDockTab.h
+46
-0
SCHNApps/Plugins/render/src/render.cpp
SCHNApps/Plugins/render/src/render.cpp
+33
-207
SCHNApps/Plugins/render/src/renderDockTab.cpp
SCHNApps/Plugins/render/src/renderDockTab.cpp
+169
-0
SCHNApps/Plugins/renderExplod/CMakeLists.txt
SCHNApps/Plugins/renderExplod/CMakeLists.txt
+1
-0
SCHNApps/Plugins/renderExplod/forms/renderExplod.ui
SCHNApps/Plugins/renderExplod/forms/renderExplod.ui
+2
-2
SCHNApps/Plugins/renderExplod/include/renderExplod.h
SCHNApps/Plugins/renderExplod/include/renderExplod.h
+10
-33
SCHNApps/Plugins/renderExplod/include/renderExplodDockTab.h
SCHNApps/Plugins/renderExplod/include/renderExplodDockTab.h
+45
-0
SCHNApps/Plugins/renderExplod/src/renderExplod.cpp
SCHNApps/Plugins/renderExplod/src/renderExplod.cpp
+31
-191
SCHNApps/Plugins/renderExplod/src/renderExplodDockTab.cpp
SCHNApps/Plugins/renderExplod/src/renderExplodDockTab.cpp
+153
-0
SCHNApps/Plugins/renderVector/CMakeLists.txt
SCHNApps/Plugins/renderVector/CMakeLists.txt
+1
-0
SCHNApps/Plugins/renderVector/forms/renderVector.ui
SCHNApps/Plugins/renderVector/forms/renderVector.ui
+2
-8
SCHNApps/Plugins/renderVector/include/renderVector.h
SCHNApps/Plugins/renderVector/include/renderVector.h
+10
-31
SCHNApps/Plugins/renderVector/include/renderVectorDockTab.h
SCHNApps/Plugins/renderVector/include/renderVectorDockTab.h
+42
-0
SCHNApps/Plugins/renderVector/src/renderVector.cpp
SCHNApps/Plugins/renderVector/src/renderVector.cpp
+23
-122
SCHNApps/Plugins/renderVector/src/renderVectorDockTab.cpp
SCHNApps/Plugins/renderVector/src/renderVectorDockTab.cpp
+121
-0
SCHNApps/Plugins/subdivideSurface/include/subdivideSurface.h
SCHNApps/Plugins/subdivideSurface/include/subdivideSurface.h
+8
-4
SCHNApps/Plugins/subdivideSurface/include/subdivideSurfaceDialog.h
...Plugins/subdivideSurface/include/subdivideSurfaceDialog.h
+2
-1
SCHNApps/Plugins/subdivideSurface/src/subdivideSurface.cpp
SCHNApps/Plugins/subdivideSurface/src/subdivideSurface.cpp
+11
-1
SCHNApps/Plugins/subdivideSurface/src/subdivideSurfaceDialog.cpp
...s/Plugins/subdivideSurface/src/subdivideSurfaceDialog.cpp
+26
-17
SCHNApps/Plugins/surfaceDeformation/CMakeLists.txt
SCHNApps/Plugins/surfaceDeformation/CMakeLists.txt
+1
-0
SCHNApps/Plugins/surfaceDeformation/include/surfaceDeformation.h
...s/Plugins/surfaceDeformation/include/surfaceDeformation.h
+29
-48
SCHNApps/Plugins/surfaceDeformation/include/surfaceDeformationDockTab.h
...ns/surfaceDeformation/include/surfaceDeformationDockTab.h
+43
-0
SCHNApps/Plugins/surfaceDeformation/src/surfaceDeformation.cpp
...pps/Plugins/surfaceDeformation/src/surfaceDeformation.cpp
+167
-274
SCHNApps/Plugins/surfaceDeformation/src/surfaceDeformationDockTab.cpp
...gins/surfaceDeformation/src/surfaceDeformationDockTab.cpp
+126
-0
SCHNApps/bin/init.py
SCHNApps/bin/init.py
+4
-4
SCHNApps/include/camera.h
SCHNApps/include/camera.h
+2
-1
SCHNApps/include/dialogs/mapsViewDialog.h
SCHNApps/include/dialogs/mapsViewDialog.h
+2
-2
SCHNApps/include/mapHandler.h
SCHNApps/include/mapHandler.h
+44
-17
SCHNApps/include/types.h
SCHNApps/include/types.h
+2
-1
SCHNApps/src/dialogs/mapsViewDialog.cpp
SCHNApps/src/dialogs/mapsViewDialog.cpp
+4
-4
SCHNApps/src/mapHandler.cpp
SCHNApps/src/mapHandler.cpp
+2
-2
SCHNApps/src/window.cpp
SCHNApps/src/window.cpp
+4
-2
ThirdParty/OpenNL/src/NL/nl_context.c
ThirdParty/OpenNL/src/NL/nl_context.c
+8
-0
ThirdParty/OpenNL/src/NL/nl_superlu.h
ThirdParty/OpenNL/src/NL/nl_superlu.h
+3
-1
No files found.
SCHNApps/Plugins/differentialProperties/include/computeCurvatureDialog.h
View file @
a75d3772
...
...
@@ -24,9 +24,10 @@ private:
MapHandlerGen
*
m_selectedMap
;
public
slots
:
void
refreshUI
();
void
selectedMapChanged
();
void
addMapToList
(
MapHandlerGen
*
m
);
void
removeMapFromList
(
MapHandlerGen
*
m
);
void
addAttributeToList
(
unsigned
int
orbit
,
const
QString
&
nameAttr
);
};
}
// namespace SCHNApps
...
...
SCHNApps/Plugins/differentialProperties/include/computeNormalDialog.h
View file @
a75d3772
...
...
@@ -24,9 +24,10 @@ private:
MapHandlerGen
*
m_selectedMap
;
public
slots
:
void
refreshUI
();
void
selectedMapChanged
();
void
addMapToList
(
MapHandlerGen
*
m
);
void
removeMapFromList
(
MapHandlerGen
*
m
);
void
addAttributeToList
(
unsigned
int
orbit
,
const
QString
&
nameAttr
);
};
}
// namespace SCHNApps
...
...
SCHNApps/Plugins/differentialProperties/src/computeCurvatureDialog.cpp
View file @
a75d3772
...
...
@@ -25,17 +25,17 @@ ComputeCurvatureDialog::ComputeCurvatureDialog(Window* w) :
connect
(
m_window
,
SIGNAL
(
mapAdded
(
MapHandlerGen
*
)),
this
,
SLOT
(
addMapToList
(
MapHandlerGen
*
)));
connect
(
m_window
,
SIGNAL
(
mapRemoved
(
MapHandlerGen
*
)),
this
,
SLOT
(
removeMapFromList
(
MapHandlerGen
*
)));
connect
(
mapList
,
SIGNAL
(
itemSelectionChanged
()),
this
,
SLOT
(
refreshUI
()));
connect
(
mapList
,
SIGNAL
(
itemSelectionChanged
()),
this
,
SLOT
(
selectedMapChanged
()));
const
QList
<
MapHandlerGen
*>&
maps
=
m_window
->
getMapsList
();
foreach
(
MapHandlerGen
*
map
,
maps
)
mapList
->
addItem
(
map
->
getName
());
}
void
ComputeCurvatureDialog
::
refreshUI
()
void
ComputeCurvatureDialog
::
selectedMapChanged
()
{
if
(
m_selectedMap
)
disconnect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
(
)),
this
,
SLOT
(
refreshUI
(
)));
disconnect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
addAttributeToList
(
unsigned
int
,
const
QString
&
)));
QList
<
QListWidgetItem
*>
currentItems
=
mapList
->
selectedItems
();
if
(
!
currentItems
.
empty
())
...
...
@@ -47,53 +47,50 @@ void ComputeCurvatureDialog::refreshUI()
combo_KnormalAttribute
->
clear
();
combo_kmaxAttribute
->
clear
();
combo_kminAttribute
->
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
;
std
::
vector
<
std
::
string
>
types
;
cont
.
getAttributesNames
(
names
);
cont
.
getAttributesTypes
(
types
);
std
::
string
vec3TypeName
=
nameOfType
(
PFP2
::
VEC3
());
std
::
string
realTypeName
=
nameOfType
(
PFP2
::
REAL
());
QString
vec3TypeName
=
QString
::
fromStdString
(
nameOfType
(
PFP2
::
VEC3
()));
QString
realTypeName
=
QString
::
fromStdString
(
nameOfType
(
PFP2
::
REAL
()));
unsigned
int
j
=
0
;
unsigned
int
k
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
names
.
size
();
++
i
)
const
AttributeHash
&
attribs
=
mh
->
getAttributesList
(
VERTEX
);
for
(
AttributeHash
::
const_iterator
i
=
attribs
.
constBegin
();
i
!=
attribs
.
constEnd
();
++
i
)
{
if
(
types
[
i
]
==
vec3TypeName
)
if
(
i
.
value
()
==
vec3TypeName
)
{
combo_positionAttribute
->
addItem
(
QString
::
fromStdString
(
names
[
i
]
));
if
(
names
[
i
]
==
"position"
)
// try to select a position attribute named "position"
combo_positionAttribute
->
addItem
(
i
.
key
(
));
if
(
i
.
key
()
==
"position"
)
// try to select a position 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
->
addItem
(
i
.
key
(
));
if
(
i
.
key
()
==
"normal"
)
// try to select a normal attribute named "normal"
combo_normalAttribute
->
setCurrentIndex
(
j
);
combo_KmaxAttribute
->
addItem
(
QString
::
fromStdString
(
names
[
i
]
));
if
(
names
[
i
]
==
"Kmax"
)
// try to select a normal attribute named "Kmax"
combo_KmaxAttribute
->
addItem
(
i
.
key
(
));
if
(
i
.
key
()
==
"Kmax"
)
// try to select a normal attribute named "Kmax"
combo_KmaxAttribute
->
setCurrentIndex
(
j
);
combo_KminAttribute
->
addItem
(
QString
::
fromStdString
(
names
[
i
]
));
if
(
names
[
i
]
==
"Kmin"
)
// try to select a normal attribute named "Kmin"
combo_KminAttribute
->
addItem
(
i
.
key
(
));
if
(
i
.
key
()
==
"Kmin"
)
// try to select a normal attribute named "Kmin"
combo_KminAttribute
->
setCurrentIndex
(
j
);
combo_KnormalAttribute
->
addItem
(
QString
::
fromStdString
(
names
[
i
]
));
if
(
names
[
i
]
==
"Knormal"
)
// try to select a normal attribute named "Knormal"
combo_KnormalAttribute
->
addItem
(
i
.
key
(
));
if
(
i
.
key
()
==
"Knormal"
)
// try to select a normal attribute named "Knormal"
combo_KnormalAttribute
->
setCurrentIndex
(
j
);
++
j
;
}
else
if
(
types
[
i
]
==
realTypeName
)
else
if
(
i
.
value
()
==
realTypeName
)
{
combo_kmaxAttribute
->
addItem
(
QString
::
fromStdString
(
names
[
i
]
));
if
(
names
[
i
]
==
"kmax"
)
// try to select a normal attribute named "kmax"
combo_kmaxAttribute
->
addItem
(
i
.
key
(
));
if
(
i
.
key
()
==
"kmax"
)
// try to select a normal attribute named "kmax"
combo_kmaxAttribute
->
setCurrentIndex
(
k
);
combo_kminAttribute
->
addItem
(
QString
::
fromStdString
(
names
[
i
]
));
if
(
names
[
i
]
==
"kmin"
)
// try to select a normal attribute named "kmin"
combo_kminAttribute
->
addItem
(
i
.
key
(
));
if
(
i
.
key
()
==
"kmin"
)
// try to select a normal attribute named "kmin"
combo_kminAttribute
->
setCurrentIndex
(
k
);
++
k
;
...
...
@@ -101,7 +98,7 @@ void ComputeCurvatureDialog::refreshUI()
}
m_selectedMap
=
mh
;
connect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
(
)),
this
,
SLOT
(
refreshUI
(
)));
connect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
addAttributeToList
(
unsigned
int
,
const
QString
&
)));
}
else
m_selectedMap
=
NULL
;
...
...
@@ -120,11 +117,33 @@ void ComputeCurvatureDialog::removeMapFromList(MapHandlerGen* m)
if
(
m_selectedMap
==
m
)
{
disconnect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
(
)),
this
,
SLOT
(
refreshUI
(
)));
disconnect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
addAttributeToList
(
unsigned
int
,
const
QString
&
)));
m_selectedMap
=
NULL
;
}
}
void
ComputeCurvatureDialog
::
addAttributeToList
(
unsigned
int
orbit
,
const
QString
&
nameAttr
)
{
QString
vec3TypeName
=
QString
::
fromStdString
(
nameOfType
(
PFP2
::
VEC3
()));
QString
realTypeName
=
QString
::
fromStdString
(
nameOfType
(
PFP2
::
REAL
()));
const
QString
&
typeAttr
=
m_selectedMap
->
getAttributeTypeName
(
orbit
,
nameAttr
);
if
(
typeAttr
==
vec3TypeName
)
{
combo_positionAttribute
->
addItem
(
nameAttr
);
combo_normalAttribute
->
addItem
(
nameAttr
);
combo_KmaxAttribute
->
addItem
(
nameAttr
);
combo_KminAttribute
->
addItem
(
nameAttr
);
combo_KnormalAttribute
->
addItem
(
nameAttr
);
}
else
if
(
typeAttr
==
realTypeName
)
{
combo_kmaxAttribute
->
addItem
(
nameAttr
);
combo_kminAttribute
->
addItem
(
nameAttr
);
}
}
}
// namespace SCHNApps
}
// namespace CGoGN
SCHNApps/Plugins/differentialProperties/src/computeNormalDialog.cpp
View file @
a75d3772
...
...
@@ -21,44 +21,41 @@ ComputeNormalDialog::ComputeNormalDialog(Window* w) :
connect
(
m_window
,
SIGNAL
(
mapAdded
(
MapHandlerGen
*
)),
this
,
SLOT
(
addMapToList
(
MapHandlerGen
*
)));
connect
(
m_window
,
SIGNAL
(
mapRemoved
(
MapHandlerGen
*
)),
this
,
SLOT
(
removeMapFromList
(
MapHandlerGen
*
)));
connect
(
mapList
,
SIGNAL
(
itemSelectionChanged
()),
this
,
SLOT
(
refreshUI
()));
connect
(
mapList
,
SIGNAL
(
itemSelectionChanged
()),
this
,
SLOT
(
selectedMapChanged
()));
const
QList
<
MapHandlerGen
*>&
maps
=
m_window
->
getMapsList
();
foreach
(
MapHandlerGen
*
map
,
maps
)
mapList
->
addItem
(
map
->
getName
());
}
void
ComputeNormalDialog
::
refreshUI
()
void
ComputeNormalDialog
::
selectedMapChanged
()
{
if
(
m_selectedMap
)
disconnect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
(
)),
this
,
SLOT
(
refreshUI
(
)));
disconnect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
addAttributeToList
(
unsigned
int
,
const
QString
&
)));
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
();
AttributeContainer
&
cont
=
map
->
getAttributeContainer
<
VERTEX
>
();
std
::
vector
<
std
::
string
>
names
;
std
::
vector
<
std
::
string
>
types
;
cont
.
getAttributesNames
(
names
);
cont
.
getAttributesTypes
(
types
);
std
::
string
vec3TypeName
=
nameOfType
(
PFP2
::
VEC3
());
QString
vec3TypeName
=
QString
::
fromStdString
(
nameOfType
(
PFP2
::
VEC3
()));
unsigned
int
j
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
names
.
size
();
++
i
)
const
AttributeHash
&
attribs
=
mh
->
getAttributesList
(
VERTEX
);
for
(
AttributeHash
::
const_iterator
i
=
attribs
.
constBegin
();
i
!=
attribs
.
constEnd
();
++
i
)
{
if
(
types
[
i
]
==
vec3TypeName
)
if
(
i
.
value
()
==
vec3TypeName
)
{
combo_positionAttribute
->
addItem
(
QString
::
fromStdString
(
names
[
i
]
));
if
(
names
[
i
]
==
"position"
)
// try to select a position attribute named "position"
combo_positionAttribute
->
addItem
(
i
.
key
(
));
if
(
i
.
key
()
==
"position"
)
// try to select a position 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
->
addItem
(
i
.
key
(
));
if
(
i
.
key
()
==
"normal"
)
// try to select a normal attribute named "normal"
combo_normalAttribute
->
setCurrentIndex
(
j
);
++
j
;
...
...
@@ -66,7 +63,7 @@ void ComputeNormalDialog::refreshUI()
}
m_selectedMap
=
mh
;
connect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
(
)),
this
,
SLOT
(
refreshUI
(
)));
connect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
addAttributeToList
(
unsigned
int
,
const
QString
&
)));
}
else
m_selectedMap
=
NULL
;
...
...
@@ -85,11 +82,24 @@ void ComputeNormalDialog::removeMapFromList(MapHandlerGen* m)
if
(
m_selectedMap
==
m
)
{
disconnect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
(
)),
this
,
SLOT
(
refreshUI
(
)));
disconnect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
addAttributeToList
(
unsigned
int
,
const
QString
&
)));
m_selectedMap
=
NULL
;
}
}
void
ComputeNormalDialog
::
addAttributeToList
(
unsigned
int
orbit
,
const
QString
&
nameAttr
)
{
QString
vec3TypeName
=
QString
::
fromStdString
(
nameOfType
(
PFP2
::
VEC3
()));
const
QString
&
typeAttr
=
m_selectedMap
->
getAttributeTypeName
(
orbit
,
nameAttr
);
if
(
typeAttr
==
vec3TypeName
)
{
combo_positionAttribute
->
addItem
(
nameAttr
);
combo_normalAttribute
->
addItem
(
nameAttr
);
}
}
}
// namespace SCHNApps
}
// namespace CGoGN
SCHNApps/Plugins/importSurface/src/importSurface.cpp
View file @
a75d3772
...
...
@@ -27,10 +27,11 @@ MapHandlerGen* ImportSurfacePlugin::importFromFile(const QString& fileName)
PFP2
::
MAP
*
map
=
mh
->
getMap
();
std
::
vector
<
std
::
string
>
attrNames
;
Algo
::
Surface
::
Import
::
importMesh
<
PFP2
>
(
*
map
,
fileName
.
to
Utf8
().
constData
(),
attrNames
);
Algo
::
Surface
::
Import
::
importMesh
<
PFP2
>
(
*
map
,
fileName
.
to
StdString
(),
attrNames
);
// get vertex position attribute
VertexAttribute
<
PFP2
::
VEC3
>
position
=
map
->
getAttribute
<
PFP2
::
VEC3
,
CGoGN
::
VERTEX
>
(
attrNames
[
0
]);
mh
->
registerAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
position
);
// create VBO for vertex position attribute
mh
->
createVBO
(
position
);
...
...
SCHNApps/Plugins/importVolume/src/importVolume.cpp
View file @
a75d3772
...
...
@@ -27,10 +27,11 @@ MapHandlerGen* ImportVolumePlugin::importFromFile(const QString& fileName)
PFP3
::
MAP
*
map
=
mh
->
getMap
();
std
::
vector
<
std
::
string
>
attrNames
;
Algo
::
Volume
::
Import
::
importMesh
<
PFP3
>
(
*
map
,
fileName
.
to
Utf8
().
constData
(),
attrNames
);
Algo
::
Volume
::
Import
::
importMesh
<
PFP3
>
(
*
map
,
fileName
.
to
StdString
(),
attrNames
);
// get vertex position attribute
VertexAttribute
<
PFP3
::
VEC3
>
position
=
map
->
getAttribute
<
PFP3
::
VEC3
,
CGoGN
::
VERTEX
>
(
attrNames
[
0
]);
mh
->
registerAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
position
);
// create VBO for vertex position attribute
mh
->
createVBO
(
position
);
...
...
SCHNApps/Plugins/render/CMakeLists.txt
View file @
a75d3772
...
...
@@ -26,6 +26,7 @@ file(
SET
(
PLUGIN_QOBJECT_FILES
${
PLUGIN_ROOT_DIR
}
/include/render.h
${
PLUGIN_ROOT_DIR
}
/include/renderDockTab.h
)
include
(
${
SCHNApps_ROOT_DIR
}
/Plugins/plugins_cmake.txt
)
SCHNApps/Plugins/render/forms/render.ui
View file @
a75d3772
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
RenderWidget
</class>
<widget
class=
"QWidget"
name=
"RenderWidget"
>
<class>
Render
Dock
Widget
</class>
<widget
class=
"QWidget"
name=
"Render
Dock
Widget"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
...
...
SCHNApps/Plugins/render/include/render.h
View file @
a75d3772
...
...
@@ -2,17 +2,18 @@
#define _RENDER_PLUGIN_H_
#include "plugin.h"
#include "
ui_render
.h"
#include "
renderDockTab
.h"
#include "Utils/Shaders/shaderFlat.h"
#include "Utils/Shaders/shaderPhong.h"
#include "Utils/Shaders/shaderSimpleColor.h"
#include "Utils/pointSprite.h"
namespace
CGoGN
{
using
namespace
CGoGN
;
using
namespace
SCHNApps
;
namespace
SCHNApps
{
enum
FaceShadingStyle
{
...
...
@@ -53,30 +54,13 @@ struct ParameterSet
};
class
RenderPlugin
;
class
RenderDockTab
:
public
QWidget
,
public
Ui
::
RenderWidget
{
public:
RenderDockTab
(
RenderPlugin
*
p
)
:
plugin
(
p
)
{
setupUi
(
this
);
}
void
refreshUI
(
ParameterSet
*
params
);
private:
RenderPlugin
*
plugin
;
};
class
RenderPlugin
:
public
Plugin
{
Q_OBJECT
Q_INTERFACES
(
CGoGN
::
SCHNApps
::
Plugin
)
public:
RenderPlugin
()
:
b_refreshingUI
(
false
)
RenderPlugin
()
{
setProvidesRendering
(
true
);
}
...
...
@@ -96,8 +80,6 @@ public:
virtual
void
mouseMove
(
View
*
view
,
QMouseEvent
*
event
)
{}
virtual
void
wheelEvent
(
View
*
view
,
QWheelEvent
*
event
)
{}
void
setRefreshingUI
(
bool
b
)
{
b_refreshingUI
=
b
;
}
protected:
RenderDockTab
*
m_dockTab
;
QHash
<
View
*
,
ParameterSet
*>
h_viewParams
;
...
...
@@ -107,8 +89,6 @@ protected:
CGoGN
::
Utils
::
ShaderSimpleColor
*
m_simpleColorShader
;
CGoGN
::
Utils
::
PointSprite
*
m_pointSprite
;
bool
b_refreshingUI
;
public
slots
:
void
viewLinked
(
View
*
view
,
Plugin
*
plugin
);
void
viewUnlinked
(
View
*
view
,
Plugin
*
plugin
);
...
...
@@ -128,15 +108,10 @@ public slots:
void
changeRenderEdges
(
View
*
view
,
MapHandlerGen
*
map
,
bool
b
);
void
changeRenderFaces
(
View
*
view
,
MapHandlerGen
*
map
,
bool
b
);
void
changeFacesStyle
(
View
*
view
,
MapHandlerGen
*
map
,
FaceShadingStyle
style
);
void
cb_selectedMapChanged
();
void
cb_positionVBOChanged
(
int
index
);
void
cb_normalVBOChanged
(
int
index
);
void
cb_renderVerticesChanged
(
bool
b
);
void
cb_verticesScaleFactorChanged
(
int
i
);
void
cb_renderEdgesChanged
(
bool
b
);
void
cb_renderFacesChanged
(
bool
b
);
void
cb_faceStyleChanged
(
QAbstractButton
*
b
);
};
}
// namespace SCHNApps
}
// namespace CGoGN
#endif
SCHNApps/Plugins/render/include/renderDockTab.h
0 → 100644
View file @
a75d3772
#ifndef _RENDER_DOCK_TAB_H_
#define _RENDER_DOCK_TAB_H_
#include "ui_render.h"
namespace
CGoGN
{
namespace
SCHNApps
{
class
Window
;
class
RenderPlugin
;
class
ParameterSet
;
class
RenderDockTab
:
public
QWidget
,
public
Ui
::
RenderDockWidget
{
Q_OBJECT
public:
RenderDockTab
(
Window
*
w
,
RenderPlugin
*
p
);
private:
Window
*
m_window
;
RenderPlugin
*
m_plugin
;
ParameterSet
*
m_currentParams
;
bool
b_refreshingUI
;
public
slots
:
void
refreshUI
(
ParameterSet
*
params
);
void
selectedMapChanged
();
void
positionVBOChanged
(
int
index
);
void
normalVBOChanged
(
int
index
);
void
renderVerticesChanged
(
bool
b
);
void
verticesScaleFactorChanged
(
int
i
);
void
renderEdgesChanged
(
bool
b
);
void
renderFacesChanged
(
bool
b
);
void
faceStyleChanged
(
QAbstractButton
*
b
);
};
}
// namespace SCHNApps
}
// namespace CGoGN
#endif
SCHNApps/Plugins/render/src/render.cpp
View file @
a75d3772
...
...
@@ -2,8 +2,11 @@
#include "mapHandler.h"
#include "Algo/Import/import.h"
namespace
CGoGN
{
namespace
SCHNApps
{
PerMapParameterSet
::
PerMapParameterSet
(
MapHandlerGen
*
map
)
:
positionVBO
(
NULL
),
...
...
@@ -14,25 +17,35 @@ PerMapParameterSet::PerMapParameterSet(MapHandlerGen* map) :
renderFaces
(
true
),
faceStyle
(
FLAT
)
{
bool
positionFound
=
false
;
bool
normalFound
=
false
;
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
(
vbos
[
i
]
->
dataSize
()
==
3
)
{
if
(
!
positionFound
)
positionVBO
=
vbos
[
i
];
if
(
vbos
[
i
]
->
name
()
==
"position"
)
// try to select a VBO named "position"
{
positionVBO
=
vbos
[
i
];
positionFound
=
true
;
}
if
(
positionVBO
==
NULL
&&
vbos
.
count
()
>
0
)
positionVBO
=
vbos
[
0
];
if
(
normalVBO
==
NULL
&&
vbos
.
count
()
>
0
)
normalVBO
=
vbos
[
0
];
if
(
!
normalFound
)
normalVBO
=
vbos
[
i
];
if
(
vbos
[
i
]
->
name
()
==
"normal"
)
// try to select a VBO named "normal"
{
normalVBO
=
vbos
[
i
];
normalFound
=
true
;
}
}
}
}
bool
RenderPlugin
::
enable
()
{
m_dockTab
=
new
RenderDockTab
(
this
);
m_dockTab
=
new
RenderDockTab
(
m_window
,
this
);
addTabInDock
(
m_dockTab
,
"Render"
);
m_flatShader
=
new
CGoGN
::
Utils
::
ShaderFlat
();
...
...
@@ -57,15 +70,6 @@ bool RenderPlugin::enable()
registerShader
(
m_simpleColorShader
);
registerShader
(
m_pointSprite
);
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_normalVBO
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
cb_normalVBOChanged
(
int
)));
connect
(
m_dockTab
->
check_renderVertices
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
cb_renderVerticesChanged
(
bool
)));
connect
(
m_dockTab
->
slider_verticesScaleFactor
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
cb_verticesScaleFactorChanged
(
int
)));
connect
(
m_dockTab
->
check_renderEdges
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
cb_renderEdgesChanged
(
bool
)));
connect
(
m_dockTab
->
check_renderFaces
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
cb_renderFacesChanged
(
bool
)));
connect
(
m_dockTab
->
group_faceShading
,
SIGNAL
(
buttonClicked
(
QAbstractButton
*
)),
this
,
SLOT
(
cb_faceStyleChanged
(
QAbstractButton
*
)));
connect
(
m_window
,
SIGNAL
(
viewAndPluginLinked
(
View
*
,
Plugin
*
)),
this
,
SLOT
(
viewLinked
(
View
*
,
Plugin
*
)));
connect
(
m_window
,
SIGNAL
(
viewAndPluginUnlinked
(
View
*
,
Plugin
*
)),
this
,
SLOT
(
viewUnlinked
(
View
*
,
Plugin
*
)));
connect
(
m_window
,
SIGNAL
(
currentViewChanged
(
View
*
)),
this
,
SLOT
(
currentViewChanged
(
View
*
)));
...
...
@@ -169,7 +173,11 @@ void RenderPlugin::viewUnlinked(View* view, Plugin* plugin)
void
RenderPlugin
::
currentViewChanged
(
View
*
view
)
{
if
(
isLinkedToView
(
view
))
{
ParameterSet
*
params
=
h_viewParams
[
view
];
changeSelectedMap
(
view
,
params
->
selectedMap
);
m_dockTab
->
refreshUI
(
h_viewParams
[
view
]);
}
}
void
RenderPlugin
::
mapLinked
(
MapHandlerGen
*
m
)
...
...
@@ -234,7 +242,7 @@ void RenderPlugin::changeSelectedMap(View* view, MapHandlerGen* map)
if
(
view
->
isCurrentView
())
{
if
(
prev
)
disconnect
(
map
,
SIGNAL
(
vboAdded
(
Utils
::
VBO
*
)),
this
,
SLOT
(
vboAdded
(
Utils
::
VBO
*
)));
disconnect
(
prev
,
SIGNAL
(
vboAdded
(
Utils
::
VBO
*
)),
this
,
SLOT
(
vboAdded
(
Utils
::
VBO
*
)));
if
(
map
)
connect
(
map
,
SIGNAL
(
vboAdded
(
Utils
::
VBO
*
)),
this
,
SLOT
(
vboAdded
(
Utils
::
VBO
*
)));
...
...
@@ -327,194 +335,12 @@ void RenderPlugin::changeFacesStyle(View* view, MapHandlerGen* map, FaceShadingS
}
}
void
RenderPlugin
::
cb_selectedMapChanged
()
{
if
(
!
b_refreshingUI
)
{
QList
<
QListWidgetItem
*>
currentItems
=
m_dockTab
->
mapList
->
selectedItems
();
if
(
!
currentItems
.
empty
())
changeSelectedMap
(
m_window
->
getCurrentView
(),
m_window
->
getMap
(
currentItems
[
0
]
->
text
()));
}
}
void
RenderPlugin
::
cb_positionVBOChanged
(
int
index
)
{
if
(
!
b_refreshingUI
)
{
View
*
view
=
m_window
->
getCurrentView
();
MapHandlerGen
*
map
=
h_viewParams
[
view
]
->
selectedMap
;
changePositionVBO
(
view
,
map
,
map
->
getVBO
(
m_dockTab
->
combo_positionVBO
->
currentText
()));
}
}
void
RenderPlugin
::
cb_normalVBOChanged
(
int
index
)
{
if
(
!
b_refreshingUI
)
{
View
*
view
=
m_window
->
getCurrentView
();
MapHandlerGen
*
map
=
h_viewParams
[
view
]
->
selectedMap
;
changeNormalVBO
(
view
,
map
,
map
->
getVBO
(
m_dockTab
->
combo_normalVBO
->
currentText
()));
}
}
void
RenderPlugin
::
cb_renderVerticesChanged
(
bool
b
)
{
if
(
!
b_refreshingUI
)
{
View
*
view
=
m_window
->
getCurrentView
();
MapHandlerGen
*
map
=
h_viewParams
[
view
]
->
selectedMap
;
changeRenderVertices
(
view
,
map
,
b
);
}
}
void
RenderPlugin
::
cb_verticesScaleFactorChanged
(
int
i
)
{
if
(
!
b_refreshingUI
)
{
View
*
view
=
m_window
->
getCurrentView
();
MapHandlerGen
*
map
=
h_viewParams
[
view
]
->
selectedMap
;