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
3dbe5b78
Commit
3dbe5b78
authored
Jan 21, 2013
by
untereiner
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of cgogn:~/CGoGN
parents
d08027e1
e22e5a64
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
294 additions
and
211 deletions
+294
-211
Apps/Examples/volumeExplorer.cpp
Apps/Examples/volumeExplorer.cpp
+14
-61
Apps/Tuto/tuto_dual3.cpp
Apps/Tuto/tuto_dual3.cpp
+1
-1
Apps/Tuto/tuto_oper3.cpp
Apps/Tuto/tuto_oper3.cpp
+4
-31
SCHNApps/Plugins/CMakeLists.txt
SCHNApps/Plugins/CMakeLists.txt
+1
-0
SCHNApps/Plugins/differentialProperties/include/differentialProperties.h
...s/differentialProperties/include/differentialProperties.h
+0
-15
SCHNApps/Plugins/differentialProperties/src/computeCurvatureDialog.cpp
...ins/differentialProperties/src/computeCurvatureDialog.cpp
+2
-2
SCHNApps/Plugins/differentialProperties/src/computeNormalDialog.cpp
...lugins/differentialProperties/src/computeNormalDialog.cpp
+1
-1
SCHNApps/Plugins/differentialProperties/src/differentialProperties.cpp
...ins/differentialProperties/src/differentialProperties.cpp
+28
-34
SCHNApps/Plugins/importSurface/importSurface.cpp
SCHNApps/Plugins/importSurface/importSurface.cpp
+5
-4
SCHNApps/Plugins/importSurface/importSurface.h
SCHNApps/Plugins/importSurface/importSurface.h
+0
-12
SCHNApps/Plugins/importVolume/CMakeLists.txt
SCHNApps/Plugins/importVolume/CMakeLists.txt
+71
-0
SCHNApps/Plugins/importVolume/importVolume.cpp
SCHNApps/Plugins/importVolume/importVolume.cpp
+54
-0
SCHNApps/Plugins/importVolume/importVolume.h
SCHNApps/Plugins/importVolume/importVolume.h
+51
-0
SCHNApps/Plugins/renderVector/renderVector.cpp
SCHNApps/Plugins/renderVector/renderVector.cpp
+8
-3
SCHNApps/Plugins/subdivideSurface/subdivideSurface.cpp
SCHNApps/Plugins/subdivideSurface/subdivideSurface.cpp
+19
-28
SCHNApps/Plugins/subdivideSurface/subdivideSurface.h
SCHNApps/Plugins/subdivideSurface/subdivideSurface.h
+0
-14
SCHNApps/include/mapHandler.h
SCHNApps/include/mapHandler.h
+3
-3
SCHNApps/include/types.h
SCHNApps/include/types.h
+14
-0
SCHNApps/include/window.h
SCHNApps/include/window.h
+1
-0
SCHNApps/src/window.cpp
SCHNApps/src/window.cpp
+15
-0
include/Algo/Import/import.h
include/Algo/Import/import.h
+1
-1
include/Algo/Import/importMesh.hpp
include/Algo/Import/importMesh.hpp
+1
-1
No files found.
Apps/Examples/volumeExplorer.cpp
View file @
3dbe5b78
...
...
@@ -144,52 +144,28 @@ void MyQT::cb_Open()
size_t
pos
=
filename
.
rfind
(
"."
);
// position of "." in filename
std
::
string
extension
=
filename
.
substr
(
pos
);
if
(
extension
==
std
::
string
(
".tet"
))
{
if
(
!
Algo
::
Volume
::
Import
::
importTet
<
PFP
>
(
myMap
,
filename
,
attrNames
))
{
CGoGNerr
<<
"could not import "
<<
filename
<<
CGoGNendl
;
return
;
}
else
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
}
if
(
extension
==
std
::
string
(
".node"
))
if
(
extension
==
std
::
string
(
".off"
))
{
if
(
!
Algo
::
Volume
::
Import
::
importMesh
V
<
PFP
>
(
myMap
,
filename
,
attrNames
,
Algo
::
Volume
::
Import
::
NODE
))
if
(
!
Algo
::
Volume
::
Import
::
importMesh
ToExtrude
<
PFP
>
(
myMap
,
filename
,
attrNames
))
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
;
}
else
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
}
if
(
extension
==
std
::
string
(
".ts"
))
{
if
(
!
Algo
::
Volume
::
Import
::
importMeshV
<
PFP
>
(
myMap
,
filename
,
attrNames
,
Algo
::
Volume
::
Import
::
TS
))
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
;
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
myMap
.
closeMap
()
;
}
else
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
}
if
(
extension
==
std
::
string
(
".off"
))
else
{
if
(
!
Algo
::
Volume
::
Import
::
importMesh
ToExtrude
<
PFP
>
(
myMap
,
filename
,
attrNames
))
if
(
!
Algo
::
Volume
::
Import
::
importMesh
<
PFP
>
(
myMap
,
filename
,
attrNames
))
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
;
}
else
{
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
myMap
.
closeMap
();
}
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
}
color
=
myMap
.
addAttribute
<
PFP
::
VEC3
,
VOLUME
>
(
"color"
);
...
...
@@ -397,31 +373,22 @@ int main(int argc, char **argv)
size_t
pos
=
filename
.
rfind
(
"."
);
// position of "." in filename
std
::
string
extension
=
filename
.
substr
(
pos
);
if
(
extension
==
std
::
string
(
".
tet
"
))
if
(
extension
==
std
::
string
(
".
off
"
))
{
if
(
!
Algo
::
Volume
::
Import
::
import
Tet
<
PFP
>
(
myMap
,
argv
[
1
],
attrNames
))
if
(
!
Algo
::
Volume
::
Import
::
import
MeshToExtrude
<
PFP
>
(
myMap
,
filename
,
attrNames
))
{
CGoGNerr
<<
"could not import "
<<
argv
[
1
]
<<
CGoGN
endl
;
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
1
;
}
else
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
}
if
(
extension
==
std
::
string
(
".node"
))
{
if
(
!
Algo
::
Volume
::
Import
::
importMeshV
<
PFP
>
(
myMap
,
argv
[
1
],
attrNames
,
Algo
::
Volume
::
Import
::
NODE
))
{
std
::
cerr
<<
"could not import "
<<
argv
[
1
]
<<
std
::
endl
;
return
1
;
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
myMap
.
closeMap
()
;
}
else
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
}
if
(
extension
==
std
::
string
(
".ts"
))
else
{
if
(
!
Algo
::
Volume
::
Import
::
importMesh
V
<
PFP
>
(
myMap
,
filename
,
attrNames
,
Algo
::
Volume
::
Import
::
TS
))
if
(
!
Algo
::
Volume
::
Import
::
importMesh
<
PFP
>
(
myMap
,
filename
,
attrNames
))
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
1
;
...
...
@@ -430,20 +397,6 @@ int main(int argc, char **argv)
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
}
if
(
extension
==
std
::
string
(
".off"
))
{
if
(
!
Algo
::
Volume
::
Import
::
importMeshToExtrude
<
PFP
>
(
myMap
,
argv
[
1
],
attrNames
))
{
std
::
cerr
<<
"could not import "
<<
std
::
endl
;
return
1
;
}
else
{
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
myMap
.
closeMap
();
}
}
color
=
myMap
.
addAttribute
<
PFP
::
VEC3
,
VOLUME
>
(
"color"
);
TraversorCell
<
PFP
::
MAP
,
VOLUME
>
tra
(
myMap
);
...
...
Apps/Tuto/tuto_dual3.cpp
View file @
3dbe5b78
...
...
@@ -61,7 +61,7 @@ int main(int argc, char **argv)
PFP
::
MAP
myMap
;
std
::
vector
<
std
::
string
>
attrNames
;
Algo
::
Volume
::
Import
::
importMesh
V
<
PFP
>
(
myMap
,
argv
[
1
],
attrNames
,
Algo
::
Volume
::
Import
::
NODE
);
Algo
::
Volume
::
Import
::
importMesh
<
PFP
>
(
myMap
,
argv
[
1
],
attrNames
);
// get a handler to the 3D vector attribute created by the import
VertexAttribute
<
PFP
::
VEC3
>
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
]);
...
...
Apps/Tuto/tuto_oper3.cpp
View file @
3dbe5b78
...
...
@@ -612,47 +612,20 @@ void MyQT::importMesh(std::string& filename)
size_t
pos
=
filename
.
rfind
(
"."
);
// position of "." in filename
std
::
string
extension
=
filename
.
substr
(
pos
);
std
::
vector
<
std
::
string
>
attrNames
;
if
(
extension
==
std
::
string
(
".map"
))
{
myMap
.
loadMapBin
(
filename
);
position
=
myMap
.
getAttribute
<
VEC3
,
VERTEX
>
(
"position"
)
;
}
else
if
(
extension
==
std
::
string
(
".node"
))
{
std
::
vector
<
std
::
string
>
attrNames
;
if
(
!
Algo
::
Volume
::
Import
::
importMeshV
<
PFP
>
(
myMap
,
filename
,
attrNames
,
Algo
::
Volume
::
Import
::
NODE
))
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
;
}
position
=
myMap
.
getAttribute
<
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
}
else
if
(
extension
==
std
::
string
(
".tet"
))
{
std
::
vector
<
std
::
string
>
attrNames
;
if
(
!
Algo
::
Volume
::
Import
::
importMeshV
<
PFP
>
(
myMap
,
filename
,
attrNames
,
Algo
::
Volume
::
Import
::
TET
))
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
;
}
position
=
myMap
.
getAttribute
<
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
}
else
if
(
extension
==
std
::
string
(
".off"
))
{
std
::
vector
<
std
::
string
>
attrNames
;
if
(
!
Algo
::
Volume
::
Import
::
importMeshV
<
PFP
>
(
myMap
,
filename
,
attrNames
,
Algo
::
Volume
::
Import
::
OFF
))
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
;
}
position
=
myMap
.
getAttribute
<
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
}
else
else
if
(
!
Algo
::
Volume
::
Import
::
importMesh
<
PFP
>
(
myMap
,
filename
,
attrNames
))
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
;
}
else
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
m_selected
=
NIL
;
m_selected2
=
NIL
;
...
...
SCHNApps/Plugins/CMakeLists.txt
View file @
3dbe5b78
cmake_minimum_required
(
VERSION 2.8
)
ADD_SUBDIRECTORY
(
importSurface
)
ADD_SUBDIRECTORY
(
importVolume
)
ADD_SUBDIRECTORY
(
differentialProperties
)
ADD_SUBDIRECTORY
(
render
)
ADD_SUBDIRECTORY
(
renderVector
)
...
...
SCHNApps/Plugins/differentialProperties/include/differentialProperties.h
View file @
3dbe5b78
...
...
@@ -6,26 +6,11 @@
#include "computeNormalDialog.h"
#include "computeCurvatureDialog.h"
#include "Topology/generic/functor.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#include "Topology/generic/attributeHandler.h"
using
namespace
CGoGN
;
using
namespace
SCHNApps
;
struct
PFP
:
public
PFP_STANDARD
{
typedef
EmbeddedMap2
MAP
;
};
typedef
PFP
::
MAP
MAP
;
typedef
PFP
::
REAL
REAL
;
typedef
PFP
::
VEC3
VEC3
;
class
DifferentialPropertiesPlugin
:
public
Plugin
{
Q_OBJECT
...
...
SCHNApps/Plugins/differentialProperties/src/computeCurvatureDialog.cpp
View file @
3dbe5b78
...
...
@@ -52,8 +52,8 @@ void ComputeCurvatureDialog::cb_selectedMapChanged()
std
::
vector
<
std
::
string
>
types
;
cont
.
getAttributesNames
(
names
);
cont
.
getAttributesTypes
(
types
);
std
::
string
vec3TypeName
=
nameOfType
(
VEC3
());
std
::
string
realTypeName
=
nameOfType
(
REAL
());
std
::
string
vec3TypeName
=
nameOfType
(
PFP2
::
VEC3
());
std
::
string
realTypeName
=
nameOfType
(
PFP2
::
REAL
());
unsigned
int
j
=
0
;
unsigned
int
k
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
names
.
size
();
++
i
)
...
...
SCHNApps/Plugins/differentialProperties/src/computeNormalDialog.cpp
View file @
3dbe5b78
...
...
@@ -43,7 +43,7 @@ void ComputeNormalDialog::cb_selectedMapChanged()
std
::
vector
<
std
::
string
>
types
;
cont
.
getAttributesNames
(
names
);
cont
.
getAttributesTypes
(
types
);
std
::
string
vec3TypeName
=
nameOfType
(
VEC3
());
std
::
string
vec3TypeName
=
nameOfType
(
PFP2
::
VEC3
());
unsigned
int
j
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
names
.
size
();
++
i
)
{
...
...
SCHNApps/Plugins/differentialProperties/src/differentialProperties.cpp
View file @
3dbe5b78
...
...
@@ -47,8 +47,8 @@ void DifferentialPropertiesPlugin::cb_computeNormal()
if
(
!
currentItems
.
empty
())
{
const
QString
&
mapname
=
currentItems
[
0
]
->
text
();
MapHandler
<
PFP
>*
mh
=
reinterpret_cast
<
MapHandler
<
PFP
>*>
(
m_window
->
getMap
(
mapname
));
MAP
*
map
=
mh
->
getMap
();
MapHandler
<
PFP
2
>*
mh
=
static_cast
<
MapHandler
<
PFP2
>*>
(
m_window
->
getMap
(
mapname
));
PFP2
::
MAP
*
map
=
mh
->
getMap
();
std
::
string
positionName
=
m_computeNormalDialog
->
combo_positionAttribute
->
currentText
().
toUtf8
().
constData
();
std
::
string
normalName
;
...
...
@@ -56,22 +56,19 @@ void DifferentialPropertiesPlugin::cb_computeNormal()
normalName
=
m_computeNormalDialog
->
combo_normalAttribute
->
currentText
().
toUtf8
().
constData
();
else
normalName
=
m_computeNormalDialog
->
normalAttributeName
->
text
().
toUtf8
().
constData
();
VertexAttribute
<
VEC3
>
position
=
map
->
getAttribute
<
VEC3
,
VERTEX
>
(
positionName
);
VertexAttribute
<
VEC3
>
normal
=
map
->
getAttribute
<
VEC3
,
VERTEX
>
(
normalName
);
VertexAttribute
<
PFP2
::
VEC3
>
position
=
map
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
positionName
);
VertexAttribute
<
PFP2
::
VEC3
>
normal
=
map
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
normalName
);
if
(
!
normal
.
isValid
())
normal
=
map
->
addAttribute
<
VEC3
,
VERTEX
>
(
normalName
);
normal
=
map
->
addAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
normalName
);
Algo
::
Surface
::
Geometry
::
computeNormalVertices
<
PFP
>
(
*
map
,
position
,
normal
);
Algo
::
Surface
::
Geometry
::
computeNormalVertices
<
PFP
2
>
(
*
map
,
position
,
normal
);
if
(
m_computeNormalDialog
->
check_createVBO
->
checkState
()
==
Qt
::
Checked
)
mh
->
createVBO
(
normal
);
QList
<
View
*>
views
=
m
_window
->
getViewsList
();
QList
<
View
*>
views
=
m
h
->
getLinkedViews
();
foreach
(
View
*
view
,
views
)
{
if
(
view
->
isLinkedToMap
(
mh
))
view
->
updateGL
();
}
view
->
updateGL
();
}
}
...
...
@@ -81,66 +78,66 @@ void DifferentialPropertiesPlugin::cb_computeCurvature()
if
(
!
currentItems
.
empty
())
{
const
QString
&
mapname
=
currentItems
[
0
]
->
text
();
MapHandler
<
PFP
>*
mh
=
reinterpret_cast
<
MapHandler
<
PFP
>*>
(
m_window
->
getMap
(
mapname
));
MAP
*
map
=
mh
->
getMap
();
MapHandler
<
PFP
2
>*
mh
=
static_cast
<
MapHandler
<
PFP2
>*>
(
m_window
->
getMap
(
mapname
));
PFP2
::
MAP
*
map
=
mh
->
getMap
();
std
::
string
positionName
=
m_computeCurvatureDialog
->
combo_positionAttribute
->
currentText
().
toUtf8
().
constData
();
std
::
string
normalName
=
m_computeCurvatureDialog
->
combo_normalAttribute
->
currentText
().
toUtf8
().
constData
();
VertexAttribute
<
VEC3
>
position
=
map
->
getAttribute
<
VEC3
,
VERTEX
>
(
positionName
);
VertexAttribute
<
VEC3
>
normal
=
map
->
getAttribute
<
VEC3
,
VERTEX
>
(
normalName
);
VertexAttribute
<
PFP2
::
VEC3
>
position
=
map
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
positionName
);
VertexAttribute
<
PFP2
::
VEC3
>
normal
=
map
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
normalName
);
std
::
string
KmaxName
;
if
(
m_computeCurvatureDialog
->
KmaxAttributeName
->
text
().
isEmpty
())
KmaxName
=
m_computeCurvatureDialog
->
combo_KmaxAttribute
->
currentText
().
toUtf8
().
constData
();
else
KmaxName
=
m_computeCurvatureDialog
->
KmaxAttributeName
->
text
().
toUtf8
().
constData
();
VertexAttribute
<
VEC3
>
Kmax
=
map
->
getAttribute
<
VEC3
,
VERTEX
>
(
KmaxName
);
VertexAttribute
<
PFP2
::
VEC3
>
Kmax
=
map
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
KmaxName
);
if
(
!
Kmax
.
isValid
())
Kmax
=
map
->
addAttribute
<
VEC3
,
VERTEX
>
(
KmaxName
);
Kmax
=
map
->
addAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
KmaxName
);
std
::
string
kmaxName
;
if
(
m_computeCurvatureDialog
->
kmaxAttributeName
->
text
().
isEmpty
())
kmaxName
=
m_computeCurvatureDialog
->
combo_kmaxAttribute
->
currentText
().
toUtf8
().
constData
();
else
kmaxName
=
m_computeCurvatureDialog
->
kmaxAttributeName
->
text
().
toUtf8
().
constData
();
VertexAttribute
<
REAL
>
kmax
=
map
->
getAttribute
<
REAL
,
VERTEX
>
(
kmaxName
);
VertexAttribute
<
PFP2
::
REAL
>
kmax
=
map
->
getAttribute
<
PFP2
::
REAL
,
VERTEX
>
(
kmaxName
);
if
(
!
kmax
.
isValid
())
kmax
=
map
->
addAttribute
<
REAL
,
VERTEX
>
(
kmaxName
);
kmax
=
map
->
addAttribute
<
PFP2
::
REAL
,
VERTEX
>
(
kmaxName
);
std
::
string
KminName
;
if
(
m_computeCurvatureDialog
->
KminAttributeName
->
text
().
isEmpty
())
KminName
=
m_computeCurvatureDialog
->
combo_KminAttribute
->
currentText
().
toUtf8
().
constData
();
else
KminName
=
m_computeCurvatureDialog
->
KminAttributeName
->
text
().
toUtf8
().
constData
();
VertexAttribute
<
VEC3
>
Kmin
=
map
->
getAttribute
<
VEC3
,
VERTEX
>
(
KminName
);
VertexAttribute
<
PFP2
::
VEC3
>
Kmin
=
map
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
KminName
);
if
(
!
Kmin
.
isValid
())
Kmin
=
map
->
addAttribute
<
VEC3
,
VERTEX
>
(
KminName
);
Kmin
=
map
->
addAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
KminName
);
std
::
string
kminName
;
if
(
m_computeCurvatureDialog
->
kminAttributeName
->
text
().
isEmpty
())
kminName
=
m_computeCurvatureDialog
->
combo_kminAttribute
->
currentText
().
toUtf8
().
constData
();
else
kminName
=
m_computeCurvatureDialog
->
kminAttributeName
->
text
().
toUtf8
().
constData
();
VertexAttribute
<
REAL
>
kmin
=
map
->
getAttribute
<
REAL
,
VERTEX
>
(
kminName
);
VertexAttribute
<
PFP2
::
REAL
>
kmin
=
map
->
getAttribute
<
PFP2
::
REAL
,
VERTEX
>
(
kminName
);
if
(
!
kmin
.
isValid
())
kmin
=
map
->
addAttribute
<
REAL
,
VERTEX
>
(
kminName
);
kmin
=
map
->
addAttribute
<
PFP2
::
REAL
,
VERTEX
>
(
kminName
);
std
::
string
KnormalName
;
if
(
m_computeCurvatureDialog
->
KnormalAttributeName
->
text
().
isEmpty
())
KnormalName
=
m_computeCurvatureDialog
->
combo_KnormalAttribute
->
currentText
().
toUtf8
().
constData
();
else
KnormalName
=
m_computeCurvatureDialog
->
KnormalAttributeName
->
text
().
toUtf8
().
constData
();
VertexAttribute
<
VEC3
>
Knormal
=
map
->
getAttribute
<
VEC3
,
VERTEX
>
(
KnormalName
);
VertexAttribute
<
PFP2
::
VEC3
>
Knormal
=
map
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
KnormalName
);
if
(
!
Knormal
.
isValid
())
Knormal
=
map
->
addAttribute
<
VEC3
,
VERTEX
>
(
KnormalName
);
Knormal
=
map
->
addAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
KnormalName
);
EdgeAttribute
<
REAL
>
edgeAngle
=
map
->
getAttribute
<
REAL
,
EDGE
>
(
"edgeAngle"
);
EdgeAttribute
<
PFP2
::
REAL
>
edgeAngle
=
map
->
getAttribute
<
PFP2
::
REAL
,
EDGE
>
(
"edgeAngle"
);
if
(
!
edgeAngle
.
isValid
())
edgeAngle
=
map
->
addAttribute
<
REAL
,
EDGE
>
(
"edgeAngle"
);
Algo
::
Surface
::
Geometry
::
computeAnglesBetweenNormalsOnEdges
<
PFP
>
(
*
map
,
position
,
edgeAngle
);
edgeAngle
=
map
->
addAttribute
<
PFP2
::
REAL
,
EDGE
>
(
"edgeAngle"
);
Algo
::
Surface
::
Geometry
::
computeAnglesBetweenNormalsOnEdges
<
PFP
2
>
(
*
map
,
position
,
edgeAngle
);
Algo
::
Surface
::
Geometry
::
computeCurvatureVertices_NormalCycles_Projected
<
PFP
>
(
*
map
,
0.01
f
*
mh
->
getBBdiagSize
(),
position
,
normal
,
edgeAngle
,
kmax
,
kmin
,
Kmax
,
Kmin
,
Knormal
);
Algo
::
Surface
::
Geometry
::
computeCurvatureVertices_NormalCycles_Projected
<
PFP
2
>
(
*
map
,
0.01
f
*
mh
->
getBBdiagSize
(),
position
,
normal
,
edgeAngle
,
kmax
,
kmin
,
Kmax
,
Kmin
,
Knormal
);
if
(
m_computeCurvatureDialog
->
check_KmaxCreateVBO
->
checkState
()
==
Qt
::
Checked
)
mh
->
createVBO
(
Kmax
);
...
...
@@ -157,12 +154,9 @@ void DifferentialPropertiesPlugin::cb_computeCurvature()
if
(
m_computeCurvatureDialog
->
check_KnormalCreateVBO
->
checkState
()
==
Qt
::
Checked
)
mh
->
createVBO
(
Knormal
);
QList
<
View
*>
views
=
m
_window
->
getViewsList
();
QList
<
View
*>
views
=
m
h
->
getLinkedViews
();
foreach
(
View
*
view
,
views
)
{
if
(
view
->
isLinkedToMap
(
mh
))
view
->
updateGL
();
}
view
->
updateGL
();
}
}
...
...
SCHNApps/Plugins/importSurface/importSurface.cpp
View file @
3dbe5b78
...
...
@@ -22,14 +22,15 @@ void ImportSurfacePlugin::cb_import()
if
(
fi
.
exists
())
{
MAP
*
m
=
new
MAP
();
MapHandler
<
PFP
>*
h
=
new
MapHandler
<
PFP
>
(
fi
.
baseName
(),
m_window
,
m
);
GenericMap
*
m
=
m_window
->
createMap
(
2
);
PFP2
::
MAP
*
map
=
static_cast
<
PFP2
::
MAP
*>
(
m
);
MapHandler
<
PFP2
>*
h
=
new
MapHandler
<
PFP2
>
(
fi
.
baseName
(),
m_window
,
map
);
std
::
vector
<
std
::
string
>
attrNames
;
Algo
::
Surface
::
Import
::
importMesh
<
PFP
>
(
*
m
,
fileName
.
toUtf8
().
constData
(),
attrNames
);
Algo
::
Surface
::
Import
::
importMesh
<
PFP
2
>
(
*
map
,
fileName
.
toUtf8
().
constData
(),
attrNames
);
// get vertex position attribute
VertexAttribute
<
VEC3
>
position
=
m
->
getAttribute
<
VEC3
,
CGoGN
::
VERTEX
>
(
attrNames
[
0
]);
VertexAttribute
<
PFP2
::
VEC3
>
position
=
map
->
getAttribute
<
PFP2
::
VEC3
,
CGoGN
::
VERTEX
>
(
attrNames
[
0
]);
// create VBO for vertex position attribute
h
->
createVBO
(
position
);
...
...
SCHNApps/Plugins/importSurface/importSurface.h
View file @
3dbe5b78
...
...
@@ -3,23 +3,11 @@
#include "plugin.h"
#include "Topology/generic/functor.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
using
namespace
CGoGN
;
using
namespace
SCHNApps
;
struct
PFP
:
public
PFP_STANDARD
{
typedef
EmbeddedMap2
MAP
;
};
typedef
PFP
::
MAP
MAP
;
typedef
PFP
::
VEC3
VEC3
;
class
ImportSurfacePlugin
:
public
Plugin
{
Q_OBJECT
...
...
SCHNApps/Plugins/importVolume/CMakeLists.txt
0 → 100644
View file @
3dbe5b78
cmake_minimum_required
(
VERSION 2.8
)
INCLUDE_DIRECTORIES
(
${
SCHNApps_ROOT_DIR
}
/include
${
SCHNApps_ROOT_DIR
}
/Plugins/importVolume
${
CMAKE_CURRENT_BINARY_DIR
}
)
SET
(
PLUGIN_SRC
${
SCHNApps_ROOT_DIR
}
/Plugins/importVolume/importVolume.cpp
)
SET
(
PLUGIN_H
${
SCHNApps_ROOT_DIR
}
/Plugins/importVolume/importVolume.h
)
IF
(
${
CMAKE_BUILD_TYPE
}
STREQUAL Debug
)
ADD_DEFINITIONS
(
-DDEBUG
)
IF
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Release
)
ELSE
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Debug
${
CGoGN_ROOT_DIR
}
/lib/Release
)
ENDIF
(
WIN32
)
# QT4_WRAP_UI( PLUGIN_UI ${PLUGIN_FORM} )
QT4_WRAP_CPP
(
PLUGIN_MOC
${
PLUGIN_H
}
)
ADD_LIBRARY
(
ImportVolumePluginD SHARED
${
PLUGIN_SRC
}
${
PLUGIN_UI
}
${
PLUGIN_MOC
}
)
TARGET_LINK_LIBRARIES
(
ImportVolumePluginD
${
CGoGN_LIBS_D
}
${
COMMON_LIBS
}
${
QGLVIEWER_LIBRARIES
}
)
ADD_DEPENDENCIES
(
ImportVolumePluginD SCHNAppsD
)
SET_TARGET_PROPERTIES
(
ImportVolumePluginD PROPERTIES COMPILE_DEFINITIONS
"DEBUG"
)
ELSE
(
${
CMAKE_BUILD_TYPE
}
STREQUAL Debug
)
IF
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Release
)
ELSE
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Release
)
ENDIF
(
WIN32
)
# QT4_WRAP_UI( PLUGIN_UI ${PLUGIN_FORM} )
QT4_WRAP_CPP
(
PLUGIN_MOC
${
PLUGIN_H
}
)
ADD_LIBRARY
(
ImportVolumePlugin SHARED
${
PLUGIN_SRC
}
${
PLUGIN_UI
}
${
PLUGIN_MOC
}
)
TARGET_LINK_LIBRARIES
(
ImportVolumePlugin
${
CGoGN_LIBS_R
}
${
COMMON_LIBS
}
${
QGLVIEWER_LIBRARIES
}
)
ADD_DEPENDENCIES
(
ImportVolumePlugin SCHNApps
)
ENDIF
(
${
CMAKE_BUILD_TYPE
}
STREQUAL Debug
)
SCHNApps/Plugins/importVolume/importVolume.cpp
0 → 100644
View file @
3dbe5b78
#include "importVolume.h"
#include "mapHandler.h"
#include "Algo/Import/import.h"
#include <QFileDialog>
#include <QFileInfo>
bool
ImportVolumePlugin
::
enable
()
{
importAction
=
new
QAction
(
"import"
,
this
);
addMenuAction
(
"Volume;Import"
,
importAction
);
connect
(
importAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
cb_import
()));
return
true
;
}
void
ImportVolumePlugin
::
cb_import
()
{
QString
fileName
=
QFileDialog
::
getOpenFileName
(
m_window
,
"Import file"
,
m_window
->
getAppPath
(),
"Mesh Files (*.node *.ts *.off *.tet)"
);
QFileInfo
fi
(
fileName
);
if
(
fi
.
exists
())
{
GenericMap
*
m
=
m_window
->
createMap
(
3
);
PFP3
::
MAP
*
map
=
static_cast
<
PFP3
::
MAP
*>
(
m
);
MapHandler
<
PFP3
>*
h
=
new
MapHandler
<
PFP3
>
(
fi
.
baseName
(),
m_window
,
map
);
std
::
vector
<
std
::
string
>
attrNames
;
Algo
::
Volume
::
Import
::
importMesh
<
PFP3
>
(
*
map
,
fileName
.
toUtf8
().
constData
(),
attrNames
);
// get vertex position attribute
VertexAttribute
<
PFP2
::
VEC3
>
position
=
map
->
getAttribute
<
PFP2
::
VEC3
,
CGoGN
::
VERTEX
>
(
attrNames
[
0
]);
// create VBO for vertex position attribute
h
->
createVBO
(
position
);
// compute map bounding box
h
->
updateBB
(
position
);
// compute primitive connectivity VBOs
h
->
updatePrimitives
(
Algo
::
Render
::
GL2
::
POINTS
);
h
->
updatePrimitives
(
Algo
::
Render
::
GL2
::
LINES
);
h
->
updatePrimitives
(
Algo
::
Render
::
GL2
::
TRIANGLES
);
m_window
->
addMap
(
h
);
}
}
#ifndef DEBUG
Q_EXPORT_PLUGIN2
(
ImportVolumePlugin
,
ImportVolumePlugin
)
#else
Q_EXPORT_PLUGIN2
(
ImportVolumePluginD
,
ImportVolumePlugin
)
#endif
SCHNApps/Plugins/importVolume/importVolume.h
0 → 100644
View file @
3dbe5b78
#ifndef _IMPORTSURFACE_PLUGIN_H_
#define _IMPORTSURFACE_PLUGIN_H_
#include "plugin.h"
using
namespace
CGoGN
;
using
namespace
SCHNApps
;
class
ImportVolumePlugin
:
public
Plugin
{
Q_OBJECT
Q_INTERFACES
(
CGoGN
::
SCHNApps
::
Plugin
)
<