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
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
David Cazier
CGoGN
Commits
3ac5a5a6
Commit
3ac5a5a6
authored
Dec 11, 2012
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCHNApps: added orbits&cells info in maps dialog
parent
7a3c137f
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
250 additions
and
97 deletions
+250
-97
SCHNApps/forms/mapsDialog.ui
SCHNApps/forms/mapsDialog.ui
+126
-6
SCHNApps/include/dialogs/mapsDialog.h
SCHNApps/include/dialogs/mapsDialog.h
+2
-0
SCHNApps/include/dialogs/pluginsDialog.h
SCHNApps/include/dialogs/pluginsDialog.h
+2
-0
SCHNApps/include/window.h
SCHNApps/include/window.h
+1
-2
SCHNApps/src/dialogs/mapsDialog.cpp
SCHNApps/src/dialogs/mapsDialog.cpp
+59
-34
SCHNApps/src/dialogs/pluginsDialog.cpp
SCHNApps/src/dialogs/pluginsDialog.cpp
+46
-41
SCHNApps/src/main.cpp
SCHNApps/src/main.cpp
+1
-2
SCHNApps/src/window.cpp
SCHNApps/src/window.cpp
+2
-1
include/Topology/generic/attribmap.h
include/Topology/generic/attribmap.h
+0
-6
include/Topology/generic/attribmap.hpp
include/Topology/generic/attribmap.hpp
+0
-5
include/Topology/generic/genericmap.h
include/Topology/generic/genericmap.h
+6
-0
include/Topology/generic/genericmap.hpp
include/Topology/generic/genericmap.hpp
+5
-0
No files found.
SCHNApps/forms/mapsDialog.ui
View file @
3ac5a5a6
...
...
@@ -6,8 +6,8 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
683
</width>
<height>
659
</height>
<width>
457
</width>
<height>
374
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
...
...
@@ -19,7 +19,7 @@
<item>
<widget
class=
"QListWidget"
name=
"mapList"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"
Minimum
"
vsizetype=
"Expanding"
>
<sizepolicy
hsizetype=
"
Preferred
"
vsizetype=
"Expanding"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
...
...
@@ -38,13 +38,37 @@
<item>
<widget
class=
"QTabWidget"
name=
"tabWidget"
>
<property
name=
"currentIndex"
>
<number>
0
</number>
<number>
4
</number>
</property>
<widget
class=
"QWidget"
name=
"dartTab"
>
<attribute
name=
"title"
>
<string>
DART
</string>
</attribute>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_2"
>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_2"
>
<item>
<widget
class=
"QLabel"
name=
"label_dart_orbits"
>
<property
name=
"text"
>
<string>
Nb orbits :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_dart_orbits"
/>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_dart_cells"
>
<property
name=
"text"
>
<string>
Nb cells :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_dart_cells"
/>
</item>
</layout>
</item>
<item>
<widget
class=
"QListWidget"
name=
"dartAttributes"
/>
</item>
...
...
@@ -54,7 +78,31 @@
<attribute
name=
"title"
>
<string>
VERTEX
</string>
</attribute>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_2"
>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_3"
>
<item>
<widget
class=
"QLabel"
name=
"label_vertex_orbits"
>
<property
name=
"text"
>
<string>
Nb orbits :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_vertex_orbits"
/>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_vertex_cells"
>
<property
name=
"text"
>
<string>
Nb cells :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_vertex_cells"
/>
</item>
</layout>
</item>
<item>
<widget
class=
"QListWidget"
name=
"vertexAttributes"
/>
</item>
...
...
@@ -65,6 +113,30 @@
<string>
EDGE
</string>
</attribute>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_3"
>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_4"
>
<item>
<widget
class=
"QLabel"
name=
"label_edge_orbits"
>
<property
name=
"text"
>
<string>
Nb orbits :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_edge_orbits"
/>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_edge_cells"
>
<property
name=
"text"
>
<string>
Nb cells :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_edge_cells"
/>
</item>
</layout>
</item>
<item>
<widget
class=
"QListWidget"
name=
"edgeAttributes"
/>
</item>
...
...
@@ -75,6 +147,30 @@
<string>
FACE
</string>
</attribute>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_4"
>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_5"
>
<item>
<widget
class=
"QLabel"
name=
"label_face_orbits"
>
<property
name=
"text"
>
<string>
Nb orbits :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_face_orbits"
/>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_face_cells"
>
<property
name=
"text"
>
<string>
Nb cells :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_face_cells"
/>
</item>
</layout>
</item>
<item>
<widget
class=
"QListWidget"
name=
"faceAttributes"
/>
</item>
...
...
@@ -85,6 +181,30 @@
<string>
VOLUME
</string>
</attribute>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_5"
>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_6"
>
<item>
<widget
class=
"QLabel"
name=
"label_volume_orbits"
>
<property
name=
"text"
>
<string>
Nb orbits :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_volume_orbits"
/>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_volume_cells"
>
<property
name=
"text"
>
<string>
Nb cells :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_volume_cells"
/>
</item>
</layout>
</item>
<item>
<widget
class=
"QListWidget"
name=
"volumeAttributes"
/>
</item>
...
...
SCHNApps/include/dialogs/mapsDialog.h
View file @
3ac5a5a6
...
...
@@ -23,6 +23,8 @@ public:
private:
Window
*
m_window
;
void
clearInfo
();
public
slots
:
void
cb_removeMap
();
void
cb_selectedMapChanged
();
...
...
SCHNApps/include/dialogs/pluginsDialog.h
View file @
3ac5a5a6
...
...
@@ -40,6 +40,8 @@ protected:
// bool restoreState();
void
addPluginsDirectory
(
const
QString
&
dir
);
private:
bool
init
;
...
...
SCHNApps/include/window.h
View file @
3ac5a5a6
...
...
@@ -31,7 +31,7 @@ public:
*
* \param parent the parent of the window
*/
Window
(
QWidget
*
parent
=
NULL
);
Window
(
const
QString
&
appPath
,
QWidget
*
parent
=
NULL
);
/**
* \fn ~Window()
...
...
@@ -40,7 +40,6 @@ public:
~
Window
();
const
QString
&
getAppPath
()
{
return
m_appPath
;
}
void
setAppPath
(
const
QString
&
path
)
{
m_appPath
=
path
;
}
/*********************************************************
* MANAGE DOCK
...
...
SCHNApps/src/dialogs/mapsDialog.cpp
View file @
3ac5a5a6
...
...
@@ -30,6 +30,23 @@ MapsDialog::MapsDialog(Window* window) :
MapsDialog
::~
MapsDialog
()
{}
void
MapsDialog
::
clearInfo
()
{
dartAttributes
->
clear
();
vertexAttributes
->
clear
();
edgeAttributes
->
clear
();
faceAttributes
->
clear
();
volumeAttributes
->
clear
();
lineEdit_dart_orbits
->
setText
(
""
);
lineEdit_dart_cells
->
setText
(
""
);
lineEdit_vertex_orbits
->
setText
(
""
);
lineEdit_vertex_cells
->
setText
(
""
);
lineEdit_edge_orbits
->
setText
(
""
);
lineEdit_edge_cells
->
setText
(
""
);
lineEdit_face_orbits
->
setText
(
""
);
lineEdit_face_cells
->
setText
(
""
);
}
void
MapsDialog
::
cb_removeMap
()
{
QList
<
QListWidgetItem
*>
currentItems
=
mapList
->
selectedItems
();
...
...
@@ -38,7 +55,10 @@ void MapsDialog::cb_removeMap()
const
QString
&
name
=
currentItems
[
0
]
->
text
();
MapHandlerGen
*
m
=
m_window
->
getMap
(
name
);
if
(
!
m
->
isUsed
())
{
m_window
->
removeMap
(
name
);
cb_selectedMapChanged
();
}
else
QMessageBox
::
warning
(
this
,
tr
(
"Warning"
),
"Map is currently used"
);
}
...
...
@@ -46,45 +66,50 @@ void MapsDialog::cb_removeMap()
void
MapsDialog
::
cb_selectedMapChanged
()
{
clearInfo
();
QList
<
QListWidgetItem
*>
currentItems
=
mapList
->
selectedItems
();
if
(
!
currentItems
.
empty
())
{
QListWidgetItem
*
current
=
currentItems
[
0
];
dartAttributes
->
clear
();
vertexAttributes
->
clear
();
edgeAttributes
->
clear
();
faceAttributes
->
clear
();
volumeAttributes
->
clear
();
const
QString
&
name
=
current
->
text
();
MapHandlerGen
*
mh
=
m_window
->
getMap
(
name
);
CGoGN
::
GenericMap
*
m
=
mh
->
getGenericMap
();
for
(
unsigned
int
orbit
=
CGoGN
::
DART
;
orbit
<=
CGoGN
::
VOLUM
E
;
++
orbit
)
GenericMap
*
m
=
mh
->
getGenericMap
();
for
(
unsigned
int
orbit
=
DART
;
orbit
<=
FAC
E
;
++
orbit
)
{
unsigned
int
nbc
=
m
->
getNbCells
(
orbit
);
switch
(
orbit
)
{
case
DART
:
{
unsigned
int
nb
=
m
->
getNbDarts
();
lineEdit_dart_orbits
->
setText
(
QString
::
number
(
nb
));
lineEdit_dart_cells
->
setText
(
QString
::
number
(
nbc
));
break
;
}
case
VERTEX
:
{
unsigned
int
nb
=
m
->
getNbOrbits
<
VERTEX
>
();
lineEdit_vertex_orbits
->
setText
(
QString
::
number
(
nb
));
lineEdit_vertex_cells
->
setText
(
QString
::
number
(
nbc
));
break
;
}
case
EDGE
:
{
unsigned
int
nb
=
m
->
getNbOrbits
<
EDGE
>
();
lineEdit_edge_orbits
->
setText
(
QString
::
number
(
nb
));
lineEdit_edge_cells
->
setText
(
QString
::
number
(
nbc
));
break
;
}
case
FACE
:
{
unsigned
int
nb
=
m
->
getNbOrbits
<
FACE
>
();
lineEdit_face_orbits
->
setText
(
QString
::
number
(
nb
));
lineEdit_face_cells
->
setText
(
QString
::
number
(
nbc
));
break
;
}
}
if
(
m
->
isOrbitEmbedded
(
orbit
))
{
// unsigned int nb = 0;
// switch(orbit)
// {
// case CGoGN::DART :
// nb = m->getNbOrbits<CGoGN::DART>();
// break;
// case CGoGN::VERTEX :
// nb = m->getNbOrbits<CGoGN::VERTEX>();
// break;
// case CGoGN::EDGE :
// nb = m->getNbOrbits<CGoGN::EDGE>();
// break;
// case CGoGN::FACE :
// nb = m->getNbOrbits<CGoGN::FACE>();
// break;
// case CGoGN::VOLUME :
// nb = m->getNbOrbits<CGoGN::VOLUME>();
// break;
// }
CGoGN
::
AttributeContainer
&
cont
=
m
->
getAttributeContainer
(
orbit
);
AttributeContainer
&
cont
=
m
->
getAttributeContainer
(
orbit
);
std
::
vector
<
std
::
string
>
names
;
std
::
vector
<
std
::
string
>
types
;
cont
.
getAttributesNames
(
names
);
...
...
@@ -95,11 +120,11 @@ void MapsDialog::cb_selectedMapChanged()
QString
type
=
QString
::
fromStdString
(
types
[
i
]);
switch
(
orbit
)
{
case
CGoGN
::
DART
:
dartAttributes
->
addItem
(
name
+
"
("
+
type
+
")"
);
break
;
case
CGoGN
::
VERTEX
:
vertexAttributes
->
addItem
(
name
+
"
("
+
type
+
")"
);
break
;
case
CGoGN
::
EDGE
:
edgeAttributes
->
addItem
(
name
+
"
("
+
type
+
")"
);
break
;
case
CGoGN
::
FACE
:
faceAttributes
->
addItem
(
name
+
"
("
+
type
+
")"
);
break
;
case
CGoGN
::
VOLUME
:
volumeAttributes
->
addItem
(
name
+
"
("
+
type
+
")"
);
break
;
case
DART
:
dartAttributes
->
addItem
(
name
+
"
("
+
type
+
")"
);
break
;
case
VERTEX
:
vertexAttributes
->
addItem
(
name
+
"
("
+
type
+
")"
);
break
;
case
EDGE
:
edgeAttributes
->
addItem
(
name
+
"
("
+
type
+
")"
);
break
;
case
FACE
:
faceAttributes
->
addItem
(
name
+
"
("
+
type
+
")"
);
break
;
case
VOLUME
:
volumeAttributes
->
addItem
(
name
+
"
("
+
type
+
")"
);
break
;
}
}
...
...
SCHNApps/src/dialogs/pluginsDialog.cpp
View file @
3ac5a5a6
...
...
@@ -44,6 +44,8 @@ PluginsDialog::PluginsDialog(Window* window) :
// restoreState();
addPluginsDirectory
(
m_window
->
getAppPath
()
+
QString
(
"/../Plugins/"
));
if
(
System
::
Error
::
code
!=
System
::
Error
::
SUCCESS
)
System
::
Error
::
showError
(
this
);
...
...
@@ -156,6 +158,48 @@ PluginsDialog::~PluginsDialog()
// return true;
//}
void
PluginsDialog
::
addPluginsDirectory
(
const
QString
&
dir
)
{
QDir
directory
(
dir
);
if
(
!
directory
.
exists
())
System
::
Error
::
code
=
System
::
Error
::
BAD_PLUGIN_PATH_IN_FILE_f
(
directory
.
absolutePath
());
QTreeWidgetItem
*
dirItem
=
new
QTreeWidgetItem
(
treeWidget
,
DIR
);
dirItem
->
setText
(
1
,
directory
.
path
());
QStringList
filters
;
filters
<<
"lib*.so"
;
filters
<<
"lib*.dylib"
;
QStringList
dirFiles
;
dirFiles
=
directory
.
entryList
(
filters
,
QDir
::
Files
);
const
PluginHash
&
activePlugins
=
m_window
->
getPluginsHash
();
foreach
(
QString
pluginPath
,
dirFiles
)
{
QFileInfo
pfi
(
pluginPath
);
QString
pluginName
=
pfi
.
baseName
().
remove
(
0
,
3
);
PluginInfo
pinfo
(
directory
.
absoluteFilePath
(
pluginPath
),
pluginName
);
QTreeWidgetItem
*
item
=
new
QTreeWidgetItem
(
dirItem
,
FILE_DIR
);
item
->
setFlags
(
item
->
flags
()
|
Qt
::
ItemIsUserCheckable
);
if
(
activePlugins
.
contains
(
pluginName
))
item
->
setCheckState
(
0
,
Qt
::
Checked
);
else
item
->
setCheckState
(
0
,
Qt
::
Unchecked
);
item
->
setText
(
1
,
pluginName
);
m_listedPlugins
[
item
]
=
pinfo
;
}
if
(
dirFiles
.
isEmpty
())
System
::
Error
::
code
=
System
::
Error
::
NO_PLUGIN_IN_DIR_f
(
directory
.
absolutePath
());
}
void
PluginsDialog
::
cb_addPlugins
()
{
init
=
true
;
...
...
@@ -163,7 +207,7 @@ void PluginsDialog::cb_addPlugins()
QStringList
files
=
QFileDialog
::
getOpenFileNames
(
this
,
"Select one or more plugins"
,
m_window
->
getAppPath
()
+
QString
(
"/../Plugins/"
)
,
m_window
->
getAppPath
(),
"Plugins (lib*.so lib*.dylib)"
);
...
...
@@ -202,46 +246,7 @@ void PluginsDialog::cb_addPluginsDirectory()
);
if
(
!
dir
.
isEmpty
())
{
QDir
directory
(
dir
);
if
(
!
directory
.
exists
())
System
::
Error
::
code
=
System
::
Error
::
BAD_PLUGIN_PATH_IN_FILE_f
(
directory
.
absolutePath
());
QTreeWidgetItem
*
dirItem
=
new
QTreeWidgetItem
(
treeWidget
,
DIR
);
dirItem
->
setText
(
1
,
directory
.
path
());
QStringList
filters
;
filters
<<
"lib*.so"
;
filters
<<
"lib*.dylib"
;
QStringList
dirFiles
;
dirFiles
=
directory
.
entryList
(
filters
,
QDir
::
Files
);
const
PluginHash
&
activePlugins
=
m_window
->
getPluginsHash
();
foreach
(
QString
pluginPath
,
dirFiles
)
{
QFileInfo
pfi
(
pluginPath
);
QString
pluginName
=
pfi
.
baseName
().
remove
(
0
,
3
);
PluginInfo
pinfo
(
directory
.
absoluteFilePath
(
pluginPath
),
pluginName
);
QTreeWidgetItem
*
item
=
new
QTreeWidgetItem
(
dirItem
,
FILE_DIR
);
item
->
setFlags
(
item
->
flags
()
|
Qt
::
ItemIsUserCheckable
);
if
(
activePlugins
.
contains
(
pluginName
))
item
->
setCheckState
(
0
,
Qt
::
Checked
);
else
item
->
setCheckState
(
0
,
Qt
::
Unchecked
);
item
->
setText
(
1
,
pluginName
);
m_listedPlugins
[
item
]
=
pinfo
;
}
if
(
dirFiles
.
isEmpty
())
System
::
Error
::
code
=
System
::
Error
::
NO_PLUGIN_IN_DIR_f
(
directory
.
absolutePath
());
}
addPluginsDirectory
(
dir
);
if
(
System
::
Error
::
code
!=
System
::
Error
::
SUCCESS
)
System
::
Error
::
showError
(
this
);
...
...
SCHNApps/src/main.cpp
View file @
3ac5a5a6
...
...
@@ -9,8 +9,7 @@ int main(int argc, char* argv[])
splash
->
show
();
splash
->
showMessage
(
"Welcome to SCHNApps"
,
Qt
::
AlignBottom
|
Qt
::
AlignCenter
);
CGoGN
::
SCHNApps
::
Window
window
;
window
.
setAppPath
(
app
.
applicationDirPath
());
CGoGN
::
SCHNApps
::
Window
window
(
app
.
applicationDirPath
());
window
.
show
();
splash
->
finish
(
&
window
);
...
...
SCHNApps/src/window.cpp
View file @
3ac5a5a6
...
...
@@ -24,8 +24,9 @@ namespace CGoGN
namespace
SCHNApps
{
Window
::
Window
(
QWidget
*
parent
)
:
Window
::
Window
(
const
QString
&
appPath
,
QWidget
*
parent
)
:
QMainWindow
(
parent
),
m_appPath
(
appPath
),
m_firstView
(
NULL
),
m_currentView
(
NULL
)
{
...
...
include/Topology/generic/attribmap.h
View file @
3ac5a5a6
...
...
@@ -84,12 +84,6 @@ public:
template
<
typename
T
,
unsigned
int
ORBIT
>
bool
copyAttribute
(
AttributeHandler
<
T
,
ORBIT
>&
dst
,
AttributeHandler
<
T
,
ORBIT
>&
src
)
;
/**
* get the number of cell in the attribute container of an orbit
* @param orb the orbit to get number of cells
*/
unsigned
int
getNbCells
(
unsigned
int
orbit
);
/****************************************
* UTILITIES *
...
...
include/Topology/generic/attribmap.hpp
View file @
3ac5a5a6
...
...
@@ -83,11 +83,6 @@ inline bool AttribMap::copyAttribute(AttributeHandler<T, ORBIT>& dst, AttributeH
return
false
;
}
inline
unsigned
int
AttribMap
::
getNbCells
(
unsigned
int
orbit
)
{
return
this
->
m_attribs
[
orbit
].
size
()
;
}
/****************************************
* UTILITIES *
****************************************/
...
...
include/Topology/generic/genericmap.h
View file @
3ac5a5a6
...
...
@@ -466,6 +466,12 @@ public:
* ATTRIBUTES MANAGEMENT *
****************************************/
/**
* get the number of cell in the attribute container of an orbit
* @param orb the orbit to get number of cells
*/
unsigned
int
getNbCells
(
unsigned
int
orbit
);
/**
* get the attrib container of a given orbit
* @param orbit the orbit !!! (bilbo the orbit !)
...
...
include/Topology/generic/genericmap.hpp
View file @
3ac5a5a6
...
...
@@ -489,6 +489,11 @@ inline void GenericMap::disableQuickTraversal()
* ATTRIBUTES MANAGEMENT *
****************************************/
inline
unsigned
int
GenericMap
::
getNbCells
(
unsigned
int
orbit
)
{
return
m_attribs
[
orbit
].
size
()
;
}
template
<
unsigned
int
ORBIT
>
inline
AttributeContainer
&
GenericMap
::
getAttributeContainer
()
{
...
...
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