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
c8558691
Commit
c8558691
authored
Nov 22, 2014
by
Lionel Untereiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some changes
parent
38233cd7
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
223 additions
and
50 deletions
+223
-50
Apps/Examples/mcmesh.cpp
Apps/Examples/mcmesh.cpp
+2
-1
Apps/Tuto/Modelling/tuto_oper2.cpp
Apps/Tuto/Modelling/tuto_oper2.cpp
+28
-0
Apps/Tuto/Modelling/tuto_oper2.h
Apps/Tuto/Modelling/tuto_oper2.h
+1
-0
Apps/Tuto/Modelling/tuto_oper2.ui
Apps/Tuto/Modelling/tuto_oper2.ui
+15
-1
Apps/Tuto/Modelling/tuto_oper3.cpp
Apps/Tuto/Modelling/tuto_oper3.cpp
+24
-8
Apps/Tuto/Modelling/tuto_oper3.ui
Apps/Tuto/Modelling/tuto_oper3.ui
+10
-0
SCHNApps/Plugins/CMakeLists.txt
SCHNApps/Plugins/CMakeLists.txt
+2
-0
SCHNApps/include/texture.h
SCHNApps/include/texture.h
+3
-0
SCHNApps/include/types.h
SCHNApps/include/types.h
+3
-0
apps_cmake.txt
apps_cmake.txt
+0
-5
include/Algo/MC/image.h
include/Algo/MC/image.h
+2
-2
include/Algo/MC/image.hpp
include/Algo/MC/image.hpp
+2
-2
include/Algo/Multiresolution/IHM2/ihm2_PrimalAdapt.hpp
include/Algo/Multiresolution/IHM2/ihm2_PrimalAdapt.hpp
+3
-3
include/Topology/ihmap/ihm2.h
include/Topology/ihmap/ihm2.h
+1
-1
include/Topology/ihmap/ihm3.h
include/Topology/ihmap/ihm3.h
+4
-3
include/Topology/ihmap/ihm3.hpp
include/Topology/ihmap/ihm3.hpp
+5
-5
include/Topology/map/embeddedMap3.h
include/Topology/map/embeddedMap3.h
+5
-0
include/Topology/map/map2.hpp
include/Topology/map/map2.hpp
+1
-1
include/Topology/map/map3.h
include/Topology/map/map3.h
+5
-0
include/Topology/map/map3.hpp
include/Topology/map/map3.hpp
+47
-1
src/Topology/ihmap/ihm3.cpp
src/Topology/ihmap/ihm3.cpp
+2
-17
src/Topology/map/embeddedMap3.cpp
src/Topology/map/embeddedMap3.cpp
+58
-0
No files found.
Apps/Examples/mcmesh.cpp
View file @
c8558691
...
...
@@ -170,7 +170,8 @@ void MCMesh::updateRender()
void
MCMesh
::
fromFile
(
char
*
fname
)
{
myImg
=
new
SAlgo
::
MC
::
Image
<
DATATYPE
>
();
myImg
->
loadInrgz
(
fname
);
//myImg->loadInrgz(fname);
myImg
->
loadVox
(
fname
);
CGoGNout
<<
"Image chargee"
<<
CGoGNendl
;
CGoGNout
<<
myImg
->
getWidthX
()
<<
"x"
<<
myImg
->
getWidthY
()
<<
"x"
<<
myImg
->
getWidthZ
()
<<
"voxels"
<<
CGoGNendl
;
}
...
...
Apps/Tuto/Modelling/tuto_oper2.cpp
View file @
c8558691
...
...
@@ -157,6 +157,17 @@ void MyQT::operation(int x)
m_selected2
=
NIL
;
}
break
;
case
10
:
CGoGNout
<<
"split surface"
<<
CGoGNendl
;
if
(
!
m_selecteds
.
empty
())
{
myMap
.
splitSurface
(
m_selecteds
);
updateMap
();
m_selected
=
NIL
;
m_selected2
=
NIL
;
m_selecteds
.
clear
();
}
break
;
default:
break
;
...
...
@@ -256,6 +267,12 @@ void MyQT::cb_redraw()
if
(
m_selected2
!=
NIL
)
m_render_topo
->
overdrawDart
(
m_selected2
,
11
,
0.0
f
,
1.0
f
,
0.0
f
);
if
(
!
m_selecteds
.
empty
())
{
for
(
std
::
vector
<
Dart
>::
iterator
it
=
m_selecteds
.
begin
()
;
it
!=
m_selecteds
.
end
()
;
++
it
)
m_render_topo
->
overdrawDart
(
*
it
,
11
,
0.0
f
,
0.0
f
,
1.0
f
);
}
}
void
MyQT
::
cb_mousePress
(
int
button
,
int
x
,
int
y
)
...
...
@@ -275,6 +292,17 @@ void MyQT::cb_mousePress(int button, int x, int y)
}
updateGL
();
}
if
(
Control
())
{
Dart
d
=
m_render_topo
->
picking
(
myMap
,
x
,
y
);
// nb
if
(
button
==
Qt
::
LeftButton
)
{
if
(
d
==
Dart
::
nil
())
m_selecteds
.
clear
();
else
m_selecteds
.
push_back
(
d
);
}
}
}
void
MyQT
::
cb_keyPress
(
int
keycode
)
...
...
Apps/Tuto/Modelling/tuto_oper2.h
View file @
c8558691
...
...
@@ -94,6 +94,7 @@ protected:
#endif
Dart
m_selected
;
Dart
m_selected2
;
std
::
vector
<
Dart
>
m_selecteds
;
DartMarker
<
MAP
>
dm
;
float
m_shift
;
...
...
Apps/Tuto/Modelling/tuto_oper2.ui
View file @
c8558691
...
...
@@ -36,7 +36,16 @@
</size>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<property
name=
"margin"
>
<property
name=
"leftMargin"
>
<number>
2
</number>
</property>
<property
name=
"topMargin"
>
<number>
2
</number>
</property>
<property
name=
"rightMargin"
>
<number>
2
</number>
</property>
<property
name=
"bottomMargin"
>
<number>
2
</number>
</property>
<property
name=
"spacing"
>
...
...
@@ -99,6 +108,11 @@
<string>
deleteFace
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
splitSurface
</string>
</property>
</item>
</widget>
</item>
<item>
...
...
Apps/Tuto/Modelling/tuto_oper3.cpp
View file @
c8558691
...
...
@@ -248,6 +248,24 @@ void MyQT::operation(int x)
updateMap
();
}
break
;
case
13
:
CGoGNout
<<
"split volume"
<<
CGoGNendl
;
if
(
!
m_selecteds
.
empty
())
{
myMap
.
splitVolume
(
m_selecteds
);
m_selecteds
.
clear
();
updateMap
();
}
break
;
case
14
:
CGoGNout
<<
"cut volume"
<<
CGoGNendl
;
if
(
!
m_selecteds
.
empty
())
{
myMap
.
cutVolume
(
m_selecteds
);
m_selecteds
.
clear
();
updateMap
();
}
break
;
default:
break
;
}
...
...
@@ -470,12 +488,12 @@ void MyQT::cb_mousePress(int button, int x, int y)
{
if
(
button
==
Qt
::
LeftButton
)
{
Dart
d
=
m_render_topo_boundary
->
picking
(
myMap
,
x
,
y
,
true
);
if
(
d
!=
Dart
::
nil
())
{
Dart
e
=
myMap
.
phi2
(
d
);
std
::
cout
<<
"Dart "
<<
d
.
index
<<
" / phi2:"
<<
e
.
index
<<
std
::
endl
;
}
m_selecteds
.
push_back
(
Dart
(
173
)
);
m_selecteds
.
push_back
(
Dart
(
186
));
m_selecteds
.
push_back
(
Dart
(
185
));
m_selecteds
.
push_back
(
Dart
(
171
)
);
m_selecteds
.
push_back
(
Dart
(
170
))
;
m_selecteds
.
push_back
(
Dart
(
174
));
}
if
(
button
==
Qt
::
RightButton
)
{
...
...
@@ -483,8 +501,6 @@ void MyQT::cb_mousePress(int button, int x, int y)
if
(
d
!=
Dart
::
nil
())
{
m_selecteds
.
push_back
(
d
);
Dart
e
=
myMap
.
phi2
(
d
);
std
::
cout
<<
"Dart "
<<
d
.
index
<<
" / phi2:"
<<
e
.
index
<<
std
::
endl
;
}
}
...
...
Apps/Tuto/Modelling/tuto_oper3.ui
View file @
c8558691
...
...
@@ -155,6 +155,16 @@
<string>
deleteVolume
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
splitVolume
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
cutVolume
</string>
</property>
</item>
</widget>
</item>
<item
row=
"6"
column=
"0"
>
...
...
SCHNApps/Plugins/CMakeLists.txt
View file @
c8558691
...
...
@@ -14,3 +14,5 @@ ADD_SUBDIRECTORY(surface_modelisation)
ADD_SUBDIRECTORY
(
volume_import
)
#ADD_SUBDIRECTORY(volume_render)
ADD_SUBDIRECTORY
(
volumetric
)
SCHNApps/include/texture.h
View file @
c8558691
#ifndef _TEXTURE_H_
#define _TEXTURE_H_
#include "Utils/gl_def.h"
#include <QSize>
namespace
CGoGN
{
...
...
SCHNApps/include/types.h
View file @
c8558691
...
...
@@ -39,6 +39,7 @@ class Camera;
class
MapHandlerGen
;
class
CellSelectorGen
;
struct
Texture
;
class
ObjectHandlerGen
;
typedef
QMap
<
QString
,
Plugin
*>
PluginSet
;
typedef
QMap
<
QString
,
View
*>
ViewSet
;
...
...
@@ -51,6 +52,8 @@ typedef QMap<QString, Utils::GLSLShader*> ShaderSet;
typedef
QMap
<
QString
,
Texture
*>
TextureSet
;
typedef
QMap
<
QString
,
ObjectHandlerGen
*>
ObjectSet
;
}
// namespace SCHNApps
}
// namespace CGoGN
...
...
apps_cmake.txt
View file @
c8558691
...
...
@@ -78,12 +78,7 @@ IF(WIN32)
ELSE(WIN32)
find_package(SuiteSparse REQUIRED)
SET (COMMON_INCLUDES ${COMMON_INCLUDES} ${SUITESPARSE_INCLUDE_DIRS})
<<<<<<< HEAD
SET (COMMON_LIBS ${SUITESPARSE_LIBRARIES} lapack blas ${COMMON_LIBS})
=======
SET (COMMON_LIBS ${SUITESPARSE_LIBRARIES} lapack blas ${COMMON_LIBS} )
>>>>>>> c2fbbbce446c3f437c531debda00b48f13f29790
ENDIF(WIN32)
#optionnal libs
...
...
include/Algo/MC/image.h
View file @
c8558691
...
...
@@ -195,12 +195,12 @@ public:
/**
* Load a raw image
*/
void
loadRaw
(
char
*
filename
);
void
loadRaw
(
c
onst
c
har
*
filename
);
/**
* Load a vox file
*/
void
loadVox
(
char
*
filename
);
void
loadVox
(
c
onst
c
har
*
filename
);
/**
* save current image into file
...
...
include/Algo/MC/image.hpp
View file @
c8558691
...
...
@@ -115,7 +115,7 @@ void Image<DataType>::createMask(const Image<DataTypeIn>& img )
template
<
typename
DataType
>
void
Image
<
DataType
>::
loadRaw
(
char
*
filename
)
void
Image
<
DataType
>::
loadRaw
(
c
onst
c
har
*
filename
)
{
std
::
ifstream
fp
(
filename
,
std
::
ios
::
in
|
std
::
ios
::
binary
);
if
(
!
fp
.
good
())
...
...
@@ -147,7 +147,7 @@ void Image<DataType>::loadRaw(char *filename)
template
<
typename
DataType
>
void
Image
<
DataType
>::
loadVox
(
char
*
filename
)
void
Image
<
DataType
>::
loadVox
(
c
onst
c
har
*
filename
)
{
std
::
ifstream
in
(
filename
);
if
(
!
in
)
...
...
include/Algo/Multiresolution/IHM2/ihm2_PrimalAdapt.hpp
View file @
c8558691
...
...
@@ -312,14 +312,14 @@ void IHM2<PFP>::subdivideEdge(Dart d)
unsigned
int
cur
=
m_map
.
getCurrentLevel
()
;
m_map
.
setCurrentLevel
(
eLevel
)
;
Dart
dd
=
m_map
.
phi2
(
d
)
;
Dart
dd
=
m_map
.
phi2
(
d
)
;
m_map
.
setCurrentLevel
(
eLevel
+
1
)
;
m_map
.
cutEdge
(
d
)
;
unsigned
int
eId
=
m_map
.
getEdgeId
(
d
)
;
m_map
.
setEdgeId
(
m_map
.
phi1
(
d
),
eId
)
;
m_map
.
setEdgeId
(
m_map
.
phi1
(
dd
),
eId
)
;
m_map
.
setEdgeId
(
m_map
.
phi1
(
d
),
eId
)
;
m_map
.
setEdgeId
(
m_map
.
phi1
(
dd
),
eId
)
;
(
*
edgeVertexFunctor
)(
m_map
.
phi1
(
d
))
;
m_map
.
setCurrentLevel
(
cur
)
;
...
...
include/Topology/ihmap/ihm2.h
View file @
c8558691
...
...
@@ -143,7 +143,7 @@ public:
void
splitFace
(
Dart
d
,
Dart
e
)
;
unsigned
int
vertexDegree
(
Dart
d
);
unsigned
int
vertexDegree
(
Dart
d
);
/***************************************************
* LEVELS MANAGEMENT *
...
...
include/Topology/ihmap/ihm3.h
View file @
c8558691
...
...
@@ -163,7 +163,6 @@ public:
* MAP MANIPULATION *
***************************************************/
Dart
cutEdge
(
Dart
d
);
/***************************************************
* LEVELS MANAGEMENT *
...
...
@@ -206,9 +205,9 @@ public:
void
setEdgeId
(
Dart
d
,
unsigned
int
i
);
//TODO a virer
void
setDartEdgeId
(
Dart
d
,
unsigned
int
i
);
unsigned
int
getT
riRefinementEdgeId
(
Dart
d
);
unsigned
int
t
riRefinementEdgeId
(
Dart
d
);
unsigned
int
getQ
uadRefinementEdgeId
(
Dart
d
);
unsigned
int
q
uadRefinementEdgeId
(
Dart
d
);
...
...
@@ -228,6 +227,8 @@ public:
*/
unsigned
int
getFaceId
(
Dart
d
)
;
unsigned
int
faceId
(
Dart
d
);
//! Set a face id to all darts from an orbit of d
/*!
*/
...
...
include/Topology/ihmap/ihm3.hpp
View file @
c8558691
...
...
@@ -575,14 +575,14 @@ inline unsigned int ImplicitHierarchicalMap3::faceId(Dart d)
if
(
fId
==
0
)
return
1
;
else
if
(
i
d
==
1
)
else
if
(
fI
d
==
1
)
return
2
;
else
if
(
i
d
==
2
)
else
if
(
fI
d
==
2
)
{
if
(
dId
==
eId
)
//
if(dId == eId)
return
0
;
else
return
1
;
//
else
//
return 1;
}
//else if(id == 3)
...
...
include/Topology/map/embeddedMap3.h
View file @
c8558691
...
...
@@ -122,6 +122,11 @@ public:
*/
virtual
void
splitVolume
(
std
::
vector
<
Dart
>&
vd
);
//!
/*!
*/
virtual
void
cutVolume
(
std
::
vector
<
Dart
>&
vd
);
//!
virtual
void
splitVolumeWithFace
(
std
::
vector
<
Dart
>&
vd
,
Dart
d
);
...
...
include/Topology/map/map2.hpp
View file @
c8558691
...
...
@@ -694,7 +694,7 @@ void Map2<MAP_IMPL>::splitSurface(std::vector<Dart>& vd, bool firstSideClosed, b
//unsew the edge path
for
(
std
::
vector
<
Dart
>::
iterator
it
=
vd
.
begin
()
;
it
!=
vd
.
end
()
;
++
it
)
{
//
if(!Map2<MAP_IMPL>::isBoundaryEdge(*it))
if
(
!
Map2
<
MAP_IMPL
>::
isBoundaryEdge
(
*
it
))
unsewFaces
(
*
it
)
;
}
...
...
include/Topology/map/map3.h
View file @
c8558691
...
...
@@ -272,6 +272,11 @@ public:
*/
virtual
void
splitVolume
(
std
::
vector
<
Dart
>&
vd
);
//! Split a volume into two volumes along a edge path by creating a hole between them
/*! @param vd a vector of darts
*/
virtual
void
cutVolume
(
std
::
vector
<
Dart
>&
vd
);
//! Split a volume into two volumes along a edge path and add the given face between
virtual
void
splitVolumeWithFace
(
std
::
vector
<
Dart
>&
vd
,
Dart
d
);
...
...
include/Topology/map/map3.hpp
View file @
c8558691
...
...
@@ -775,6 +775,52 @@ void Map3<MAP_IMPL>::splitVolume(std::vector<Dart>& vd)
Map3<MAP_IMPL>::sewVolumes(this->phi2(e), this->phi2(e2), false);
}
template <typename MAP_IMPL>
void Map3<MAP_IMPL>::cutVolume(std::vector<Dart>& vd)
{
//assert(checkSimpleOrientedPath(vd));
Dart e = vd.front();
Dart e2 = this->phi2(e);
//cut the volume following the path
ParentMap::splitSurface(vd, true, true);
//create the boundary
Dart b1 = newBoundaryCycle(vd.size());
Dart b2 = newBoundaryCycle(vd.size());
Dart fit1 = this->phi2(e);
Dart fit2 = this->phi2(e2);
Dart fitB1 = b1;
Dart fitB2 = b2;
do
{
Dart f = findBoundaryFaceOfEdge(fit1) ;
if(f != NIL)
{
Dart f2 = this->phi2(f) ;
this->phi2unsew(f) ;
this->phi2sew(fitB1, f) ;
this->phi2sew(fitB2, f2) ;
}
else
this->phi2sew(fitB1, fitB2) ;
//no phi3unsew for fit1 : already unsewed
phi3unsew(fit1) ;
phi3sew(fit1, fitB1);
phi3sew(fit2, fitB2);
fit1 = this->phi1(fit1);
fit2 = this->phi_1(fit2);
fitB1 = this->phi_1(fitB1);
fitB2 = this->phi1(fitB2);
} while(fitB1 != b1);
}
template <typename MAP_IMPL>
void Map3<MAP_IMPL>::splitVolumeWithFace(std::vector<Dart>& vd, Dart d)
{
...
...
@@ -1428,7 +1474,7 @@ unsigned int Map3<MAP_IMPL>::closeMap()
if (phi3(d) == d)
{
++nb ;
closeHole
(
d
,
true
);
closeHole(d);
}
}
return nb ;
...
...
src/Topology/ihmap/ihm3.cpp
View file @
c8558691
...
...
@@ -62,12 +62,12 @@ void ImplicitHierarchicalMap3::clear(bool removeAttrib)
void
ImplicitHierarchicalMap3
::
initImplicitProperties
()
{
//initEdgeId() ;
initFaceId
();
//
initFaceId();
for
(
Dart
d
=
Map3
::
begin
();
d
!=
Map3
::
end
();
Map3
::
next
(
d
))
{
m_edgeId
[
d
]
=
0
;
//
m_faceId[d] = 0;
m_faceId
[
d
]
=
0
;
}
for
(
unsigned
int
orbit
=
0
;
orbit
<
NB_ORBITS
;
++
orbit
)
...
...
@@ -130,19 +130,4 @@ void ImplicitHierarchicalMap3::initFaceId()
}
}
Dart
ImplicitHierarchicalMap3
::
cutEdge
(
Dart
d
)
{
Dart
nd
=
EmbeddedMap3
::
cutEdge
(
d
);
// unsigned int id = getEdgeId(d);
// setEdgeId(nd, id);
// setEdgeId(phi2(d), id);
// setFaceId(EDGE, nd);
// m_faceId[]
return
nd
;
}
}
//namespace CGoGN
src/Topology/map/embeddedMap3.cpp
View file @
c8558691
...
...
@@ -488,6 +488,64 @@ void EmbeddedMap3::splitVolume(std::vector<Dart>& vd)
}
}
void
EmbeddedMap3
::
cutVolume
(
std
::
vector
<
Dart
>&
vd
)
{
Map3
::
cutVolume
(
vd
);
// follow the edge path a second time to embed the vertex, edge and volume orbits
for
(
std
::
vector
<
Dart
>::
iterator
it
=
vd
.
begin
()
;
it
!=
vd
.
end
()
;
++
it
)
{
Dart
dit
=
*
it
;
Dart
dit23
=
phi3
(
phi2
(
dit
));
// embed the vertex embedded from the origin volume to the new darts
if
(
isOrbitEmbedded
<
VERTEX
>
())
{
// if(!sameVertex(dit, dd))
// {
// Algo::Topo::setOrbitEmbedding<VERTEX>(*this, dit, getEmbedding<VERTEX>(dit)) ;
// Algo::Topo::setOrbitEmbeddingOnNewCell<VERTEX>(*this, dit23);
// Algo::Topo::copyCellAttributes<VERTEX>(*this, dit23, dit);
// }
// else
// {
// Algo::Topo::setOrbitEmbedding<VERTEX>(*this, dit, getEmbedding<VERTEX>(dit)) ;
// }
}
// embed the edge embedded from the origin volume to the new darts
if
(
isOrbitEmbedded
<
EDGE
>
())
{
if
(
!
sameEdge
(
dit
,
dit23
))
{
Algo
::
Topo
::
setOrbitEmbeddingOnNewCell
<
EDGE
>
(
*
this
,
dit23
);
Algo
::
Topo
::
copyCellAttributes
<
EDGE
>
(
*
this
,
dit23
,
dit
);
copyDartEmbedding
<
EDGE
>
(
phi3
(
dit
),
dit
)
;
}
else
{
unsigned
int
eEmb
=
getEmbedding
<
EDGE
>
(
dit
)
;
setDartEmbedding
<
EDGE
>
(
phi3
(
dit
),
eEmb
)
;
setDartEmbedding
<
EDGE
>
(
alpha_2
(
dit
),
eEmb
)
;
}
}
// embed the volume embedded from the origin volume to the new darts
if
(
isOrbitEmbedded
<
VOLUME
>
())
{
copyDartEmbedding
<
VOLUME
>
(
phi2
(
dit
),
dit
);
}
}
if
(
isOrbitEmbedded
<
VOLUME
>
())
{
Dart
v
=
vd
.
front
()
;
Dart
v23
=
phi3
(
phi2
(
v
));
Algo
::
Topo
::
setOrbitEmbeddingOnNewCell
<
VOLUME
>
(
*
this
,
v23
)
;
Algo
::
Topo
::
copyCellAttributes
<
VOLUME
>
(
*
this
,
v23
,
v
)
;
}
}
//! Split a volume into two volumes along a edge path and add the given face between
void
EmbeddedMap3
::
splitVolumeWithFace
(
std
::
vector
<
Dart
>&
vd
,
Dart
d
)
{
...
...
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