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
2cb734d8
Commit
2cb734d8
authored
Jan 19, 2012
by
untereiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new Polyhedra creation functions (createPrism, createPyramid, createDiamond)
parent
26eef763
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
835 additions
and
770 deletions
+835
-770
Apps/Examples/simpleGMap2.cpp
Apps/Examples/simpleGMap2.cpp
+1
-1
Apps/Tuto/tuto3.cpp
Apps/Tuto/tuto3.cpp
+1
-1
Apps/Tuto/tuto4.cpp
Apps/Tuto/tuto4.cpp
+1
-1
include/Algo/ImplicitHierarchicalMesh/ihm3.h
include/Algo/ImplicitHierarchicalMesh/ihm3.h
+2
-0
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
+10
-0
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
+446
-444
include/Algo/Import/import2tables.h
include/Algo/Import/import2tables.h
+1
-1
include/Algo/Import/importMesh.hpp
include/Algo/Import/importMesh.hpp
+129
-162
include/Algo/Import/importTet.hpp
include/Algo/Import/importTet.hpp
+1
-1
include/Algo/Import/importTs.hpp
include/Algo/Import/importTs.hpp
+1
-1
include/Algo/Modelisation/polyhedron.h
include/Algo/Modelisation/polyhedron.h
+59
-26
include/Algo/Modelisation/polyhedron.hpp
include/Algo/Modelisation/polyhedron.hpp
+164
-119
include/Algo/Modelisation/subdivision.hpp
include/Algo/Modelisation/subdivision.hpp
+4
-0
src/Topology/map/embeddedMap3.cpp
src/Topology/map/embeddedMap3.cpp
+13
-12
src/Topology/map/map3.cpp
src/Topology/map/map3.cpp
+2
-1
No files found.
Apps/Examples/simpleGMap2.cpp
View file @
2cb734d8
...
@@ -31,7 +31,7 @@ SimpleGMap2::SimpleGMap2()
...
@@ -31,7 +31,7 @@ SimpleGMap2::SimpleGMap2()
{
{
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
Dart
d
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
createTetra
(
myMap
);
Dart
d
=
Algo
::
Modelisation
::
createTetrahedron
<
PFP
>
(
myMap
);
position
[
d
]
=
VEC3
(
0
,
0
,
0
);
position
[
d
]
=
VEC3
(
0
,
0
,
0
);
position
[
myMap
.
phi1
(
d
)]
=
VEC3
(
10
,
0
,
15
);
position
[
myMap
.
phi1
(
d
)]
=
VEC3
(
10
,
0
,
15
);
position
[
myMap
.
phi_1
(
d
)]
=
VEC3
(
10
,
20
,
15
);
position
[
myMap
.
phi_1
(
d
)]
=
VEC3
(
10
,
20
,
15
);
...
...
Apps/Tuto/tuto3.cpp
View file @
2cb734d8
...
@@ -123,7 +123,7 @@ void MyQT::traverseMap()
...
@@ -123,7 +123,7 @@ void MyQT::traverseMap()
void
MyQT
::
createMap
()
void
MyQT
::
createMap
()
{
{
Dart
d1
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
createTetra
(
myMap
);
Dart
d1
=
Algo
::
Modelisation
::
createTetrahedron
<
PFP
>
(
myMap
);
Dart
d2
=
d1
;
Dart
d2
=
d1
;
...
...
Apps/Tuto/tuto4.cpp
View file @
2cb734d8
...
@@ -126,7 +126,7 @@ void MyQT::traverseMap()
...
@@ -126,7 +126,7 @@ void MyQT::traverseMap()
void
MyQT
::
createMap
()
void
MyQT
::
createMap
()
{
{
Dart
d1
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
createHexa
(
myMap
);
Dart
d1
=
Algo
::
Modelisation
::
createHexahedron
<
PFP
>
(
myMap
);
Dart
d2
=
d1
;
Dart
d2
=
d1
;
...
...
include/Algo/ImplicitHierarchicalMesh/ihm3.h
View file @
2cb734d8
...
@@ -59,6 +59,8 @@ public:
...
@@ -59,6 +59,8 @@ public:
~
ImplicitHierarchicalMap3
()
;
~
ImplicitHierarchicalMap3
()
;
void
update_topo_shortcuts
();
//!
//!
/*!
/*!
*
*
...
...
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
View file @
2cb734d8
...
@@ -63,6 +63,16 @@ AttributeHandler_IHM<T> ImplicitHierarchicalMap3::getAttribute(unsigned int orbi
...
@@ -63,6 +63,16 @@ AttributeHandler_IHM<T> ImplicitHierarchicalMap3::getAttribute(unsigned int orbi
return
AttributeHandler_IHM
<
T
>
(
this
,
h
.
getDataVector
())
;
return
AttributeHandler_IHM
<
T
>
(
this
,
h
.
getDataVector
())
;
}
}
inline
void
ImplicitHierarchicalMap3
::
update_topo_shortcuts
()
{
Map3
::
update_topo_shortcuts
();
m_dartLevel
=
Map3
::
getAttribute
<
unsigned
int
>
(
DART
,
"dartLevel"
)
;
m_faceId
=
Map3
::
getAttribute
<
unsigned
int
>
(
DART
,
"faceId"
)
;
m_edgeId
=
Map3
::
getAttribute
<
unsigned
int
>
(
DART
,
"edgeId"
)
;
}
/***************************************************
/***************************************************
* MAP TRAVERSAL *
* MAP TRAVERSAL *
***************************************************/
***************************************************/
...
...
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
View file @
2cb734d8
This diff is collapsed.
Click to expand it.
include/Algo/Import/import2tables.h
View file @
2cb734d8
...
@@ -57,7 +57,7 @@ namespace Import
...
@@ -57,7 +57,7 @@ namespace Import
namespace
ImportVolumique
namespace
ImportVolumique
{
{
enum
ImportType
{
UNKNOWNVOLUME
,
TET
,
TRIANBGZ
,
PLY
};
enum
ImportType
{
UNKNOWNVOLUME
,
TET
,
TRIANBGZ
,
PLY
,
OFF
,
OBJ
};
}
}
...
...
include/Algo/Import/importMesh.hpp
View file @
2cb734d8
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#include "Topology/generic/attributeHandler.h"
#include "Topology/generic/attributeHandler.h"
#include "Topology/generic/autoAttributeHandler.h"
#include "Topology/generic/autoAttributeHandler.h"
#include "Container/fakeAttribute.h"
#include "Container/fakeAttribute.h"
#include "Algo/Modelisation/polyhedron.h"
namespace
CGoGN
namespace
CGoGN
{
{
...
@@ -128,6 +129,111 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
...
@@ -128,6 +129,111 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
return
true
;
return
true
;
}
}
template
<
typename
PFP
>
bool
importMeshSToV
(
typename
PFP
::
MAP
&
map
,
MeshTablesSurface
<
PFP
>&
mts
,
float
dist
)
{
AutoAttributeHandler
<
NoMathIONameAttribute
<
std
::
vector
<
Dart
>
>
>
vecDartsPerVertex
(
map
,
VERTEX
,
"incidents"
);
unsigned
nbf
=
mts
.
getNbFaces
();
int
index
=
0
;
// buffer for tempo faces (used to remove degenerated edges)
std
::
vector
<
unsigned
int
>
edgesBuffer
;
edgesBuffer
.
reserve
(
16
);
DartMarkerNoUnmark
m
(
map
)
;
AttributeHandler
<
typename
PFP
::
VEC3
>
position
=
map
.
template
getAttribute
<
typename
PFP
::
VEC3
>(
VERTEX
,
"position"
);
std
::
vector
<
unsigned
int
>
backEdgesBuffer
(
mts
.
getNbVertices
(),
EMBNULL
);
// for each face of table -> create a prism
for
(
unsigned
int
i
=
0
;
i
<
nbf
;
++
i
)
{
// store face in buffer, removing degenerated edges
unsigned
int
nbe
=
mts
.
getNbEdgesFace
(
i
);
edgesBuffer
.
clear
();
unsigned
int
prec
=
EMBNULL
;
for
(
unsigned
int
j
=
0
;
j
<
nbe
;
++
j
)
{
unsigned
int
em
=
mts
.
getEmbIdx
(
index
++
);
if
(
em
!=
prec
)
{
prec
=
em
;
edgesBuffer
.
push_back
(
em
);
}
}
// check first/last vertices
if
(
edgesBuffer
.
front
()
==
edgesBuffer
.
back
())
edgesBuffer
.
pop_back
();
// create only non degenerated faces
nbe
=
edgesBuffer
.
size
();
if
(
nbe
>
2
)
{
Dart
d
=
Algo
::
Modelisation
::
createPrism
<
PFP
>
(
map
,
nbe
);
//Embed the base faces
for
(
unsigned
int
j
=
0
;
j
<
nbe
;
++
j
)
{
unsigned
int
em
=
edgesBuffer
[
j
];
// get embedding
if
(
backEdgesBuffer
[
em
]
==
EMBNULL
)
{
unsigned
int
emn
=
map
.
newCell
(
VERTEX
);
map
.
copyCell
(
VERTEX
,
emn
,
em
);
backEdgesBuffer
[
em
]
=
emn
;
position
[
emn
]
+=
typename
PFP
::
VEC3
(
0
,
0
,
dist
);
}
FunctorSetEmb
<
typename
PFP
::
MAP
>
fsetemb
(
map
,
VERTEX
,
em
);
foreach_dart_of_orbit_in_parent
<
typename
PFP
::
MAP
>
(
&
map
,
VERTEX
,
d
,
fsetemb
)
;
//Embed the other base face
Dart
d2
=
map
.
phi1
(
map
.
phi1
(
map
.
phi2
(
d
)));
unsigned
int
em2
=
backEdgesBuffer
[
em
];
FunctorSetEmb
<
typename
PFP
::
MAP
>
fsetemb2
(
map
,
VERTEX
,
em2
);
foreach_dart_of_orbit_in_parent
<
typename
PFP
::
MAP
>
(
&
map
,
VERTEX
,
d2
,
fsetemb2
)
;
m
.
mark
(
d
)
;
// mark on the fly to unmark on second loop
vecDartsPerVertex
[
em
].
push_back
(
d
);
// store incident darts for fast adjacency reconstruction
d
=
map
.
phi1
(
d
);
}
}
}
// reconstruct neighbourhood
unsigned
int
nbBoundaryEdges
=
0
;
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
{
if
(
m
.
isMarked
(
d
))
{
// darts incident to end vertex of edge
std
::
vector
<
Dart
>&
vec
=
vecDartsPerVertex
[
map
.
phi1
(
d
)];
unsigned
int
embd
=
map
.
getEmbedding
(
VERTEX
,
d
);
Dart
good_dart
=
NIL
;
for
(
typename
std
::
vector
<
Dart
>::
iterator
it
=
vec
.
begin
();
it
!=
vec
.
end
()
&&
good_dart
==
NIL
;
++
it
)
{
if
(
map
.
getEmbedding
(
VERTEX
,
map
.
phi1
(
*
it
))
==
embd
)
good_dart
=
*
it
;
}
if
(
good_dart
!=
NIL
)
{
map
.
sewVolumes
(
map
.
phi2
(
d
),
map
.
phi2
(
good_dart
),
false
);
m
.
unmarkOrbit
(
EDGE
,
d
);
}
else
{
m
.
unmark
(
d
);
++
nbBoundaryEdges
;
}
}
}
return
true
;
}
template
<
typename
PFP
>
template
<
typename
PFP
>
bool
importMesh
(
typename
PFP
::
MAP
&
map
,
MeshTablesVolume
<
PFP
>&
mtv
)
bool
importMesh
(
typename
PFP
::
MAP
&
map
,
MeshTablesVolume
<
PFP
>&
mtv
)
{
{
...
@@ -441,179 +547,40 @@ bool importMesh(typename PFP::MAP& map, const std::string& filename, std::vector
...
@@ -441,179 +547,40 @@ bool importMesh(typename PFP::MAP& map, const std::string& filename, std::vector
return
importMesh
<
PFP
>
(
map
,
mts
);
return
importMesh
<
PFP
>
(
map
,
mts
);
}
}
/*
template
<
typename
PFP
>
template
<
typename
PFP
>
bool
importMesh
(
typename
PFP
::
MAP
&
map
,
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
,
ImportVolumique
::
ImportType
kind
)
bool
importMesh
(
typename
PFP
::
MAP
&
map
,
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
,
ImportVolumique
::
ImportType
kind
)
{
{
MeshTablesVolume<PFP> mtv(map)
;
float
dist
=
5.0
f
;
if(!mtv.importMesh(filename, attrNames, kind))
if
(
kind
==
ImportVolumique
::
OBJ
)
return false;
{
MeshTablesSurface
<
PFP
>
mts
(
map
);
return importMesh<PFP>(map, mtv);
}
*/
//
if
(
!
mts
.
importMesh
(
filename
,
attrNames
,
ImportSurfacique
::
OBJ
))
//
return
false
;
//
// AutoAttributeHandler< NoMathIONameAttribute< std::vector<Dart> > > vecDartsPerVertex(map, VERTEX, "incidents");
//if (mergeCloseVertices)
//
// mts.mergeCloseVertices();
//
// // Attributes container for vertex orbit
return
importMeshSToV
<
PFP
>
(
map
,
mts
,
dist
);
// AttributeContainer& vertexContainer = map.getAttributeContainer(VERTEX);
//
}
// AttributeHandler<VEC3> positions(idPositions,map);
else
//
return
false
;
// MeshTablesSurface<VEC3> mts(vertexContainer, positions);
// else
//
// if (!mts.importMesh(filename,kind))
// return false;
//
// // marker for phi2 reconstruction
// m = map.getNewMarker();
//
// unsigned nbf = mts.getNbFaces();
// int index = 0;
// // buffer for tempo faces (used to remove degenerated edges)
// std::vector<unsigned int> edgesBuffer;
// edgesBuffer.reserve(8);
//
// // for each face of table
// for(unsigned int i = 0; i < nbf; ++i)
// {
// // store face in buffer, removing degenerated edges
// unsigned int nbe = mts.getNbEdgesFace(i);
// edgesBuffer.clear();
// unsigned int prec=EMBNULL;
// for (unsigned int j=0; j<nbe; ++j)
// {
// unsigned int em = mts.getEmbIdx(index++);
// if (em!=prec)
// {
// prec = em;
// edgesBuffer.push_back(em);
// }
// }
// // check first/last vertices
// if (edgesBuffer.front() == edgesBuffer.back())
// edgesBuffer.pop_back();
//
// // create only non degenerated faces
// nbe = edgesBuffer.size();
// if (nbe >2)
// {
// Dart d = map.newFace(nbe);
// for (unsigned int j=0; j<nbe; ++j)
// {
// unsigned int em = edgesBuffer[j]; // get embedding
// map.setDartEmbedding(VERTEX, d, em); // associate to dart
// vecDartsPerVertex[em].push_back(d); // store incident darts for fast phi2 reconstruction
// d = map.phi1(d);
// }
// map.markOrbit(FACE,d,m);// mark on the fly to unmark on second loop
// }
// }
//
// unsigned nbnm=0;
// // reconstruct neighbourhood
//
// for (Dart d = map.begin(); d != map.end(); map.next(d))
// {
// {
// if (map.isMarkedDart(d, m))
// MeshTablesVolume<PFP> mtv(map);
// {
// // darts incident to end vertex of edge
// std::vector<Dart>& vec = vecDartsPerVertex[map.phi1(d)];
//
//
// unsigned int embd = map.getEmbedding(VERTEX, d);
// unsigned int nbf=0;
// Dart good_dart;
// for (typename std::vector<Dart>::iterator it = vec.begin(); it != vec.end(); ++it)
// {
// if ( map.getEmbedding(VERTEX,map.phi1(*it))==embd)
// {
// good_dart = *it;
// nbf++;
// }
// }
//
//
// if (nbf==1)
// if(!mtv.importMesh(filename, attrNames, kind))
// {
// return false;
// if (good_dart == map.phi2(good_dart))
// {
// map.sewFaces(d, good_dart);
// map.unmarkOrbit(EDGE, d, m);
// }
// }
// else
// {
// ++nbnm;
// }
// }
// }
//
//
//// return true;
//
//
// if (nbnm > 0)
// return importMesh<PFP>(map, mtv);
// {
// if (closeObject)
// {
// Marker mb = map.closeMap(true);
//// // for all vertices
//// for (unsigned int index = 0; index < vecDartsEmb.size(); ++index)
//// {
//// // if vertex is on boundary
//// if (vecEmbNbFp[index] > 0)
//// {
//// // find first dart that is sewed to boundary
//// std::vector<Dart>& vd = vecDartsEmb[index];
//// typename std::vector<Dart>::iterator jt = vd.begin();
//// while (!map.isMarkedDart(*jt, m))
//// jt++;
//// unsigned int P = map.getEmbedding(VERTEX, *jt);
//// // while vertex if a "non manifold point"
//// while (vecEmbNbFp[index] > 1)
//// {
//// Dart e = map.phi2(*jt);
//// // turn in boundary until we find same embedding
//// do
//// {
//// e = map.phi1(e);
//// // embedding of boundary darts on the fly
//// unsigned int emb = map.getEmbedding(VERTEX, map.phi1(map.phi2(e)));
//// map.setDartEmbedding(VERTEX, e, emb);
//// } while (map.getEmbedding(VERTEX, map.phi2(e)) != P);
//// // separate the face
//// map.phi1sew(map.phi2(*jt), e);
//// vecEmbNbFp[index]--;
//// }
//// // copy embedding of vertex of boundary of last face
//// Dart e = map.phi2(*jt);
//// Dart d = e;
//// if (map.getEmbedding(VERTEX, d) == EMBNULL)
//// {
//// do
//// {
//// unsigned int emb = map.getEmbedding(VERTEX, map.phi1(map.phi2(d)));
//// map.setDartEmbedding(VERTEX, d, emb);
//// d = map.phi1(d);
//// } while (d != e);
//// }
//// }
//// }
// map.unmarkAll(m);
// map.releaseMarker(m);
// m = mb;
// }
// else
// {
// CGoGNout << "Warning " << nbnm << " darts with phi2 fix points" << CGoGNendl;
// }
// }
// }
//
}
// return true;
//}
}
// namespace Import
}
// namespace Import
...
...
include/Algo/Import/importTet.hpp
View file @
2cb734d8
...
@@ -114,7 +114,7 @@ bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector<
...
@@ -114,7 +114,7 @@ bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector<
oss
>>
nbe
;
//number of vertices = 4
oss
>>
nbe
;
//number of vertices = 4
assert
(
nbe
==
4
);
assert
(
nbe
==
4
);
Dart
d
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
createPolyhedron
(
map
,
4
);
Dart
d
=
Algo
::
Modelisation
::
createTetrahedron
<
PFP
>
(
map
);
Geom
::
Vec4ui
pt
;
Geom
::
Vec4ui
pt
;
oss
>>
pt
[
0
];
oss
>>
pt
[
0
];
...
...
include/Algo/Import/importTs.hpp
View file @
2cb734d8
...
@@ -132,7 +132,7 @@ bool importTs(typename PFP::MAP& map, const std::string& filename, std::vector<s
...
@@ -132,7 +132,7 @@ bool importTs(typename PFP::MAP& map, const std::string& filename, std::vector<s
// CGoGNout << "tetra number : " << nbe << CGoGNendl;
// CGoGNout << "tetra number : " << nbe << CGoGNendl;
//Algo::Modelisation::Polyhedron<PFP>::createTetra(map);
//Algo::Modelisation::Polyhedron<PFP>::createTetra(map);
Dart
d
=
Algo
::
Modelisation
::
Polyhedron
<
PFP
>::
createPolyhedron
(
map
,
4
);
Dart
d
=
Algo
::
Modelisation
::
createTetrahedron
<
PFP
>
(
map
);
Geom
::
Vec4ui
pt
;
Geom
::
Vec4ui
pt
;
oss
>>
pt
[
0
];
oss
>>
pt
[
0
];
oss
>>
pt
[
1
];
oss
>>
pt
[
1
];
...
...
include/Algo/Modelisation/polyhedron.h
View file @
2cb734d8
...
@@ -42,7 +42,7 @@ namespace Algo
...
@@ -42,7 +42,7 @@ namespace Algo
namespace
Modelisation
namespace
Modelisation
{
{
enum
{
NONE
,
GRID
,
CUBE
,
CYLINDER
,
CONE
,
SPHERE
,
TORE
,
COMPOSED
};
enum
{
NONE
,
GRID
,
CUBE
,
CYLINDER
,
CONE
,
SPHERE
,
TORE
,
COMPOSED
};
/**
/**
* sudivide the all quads of primtive into 2 triangles
* sudivide the all quads of primtive into 2 triangles
...
@@ -70,6 +70,64 @@ enum { NONE,GRID, CUBE, CYLINDER, CONE, SPHERE, TORE, COMPOSED };
...
@@ -70,6 +70,64 @@ enum { NONE,GRID, CUBE, CYLINDER, CONE, SPHERE, TORE, COMPOSED };
template
<
typename
PFP
>
template
<
typename
PFP
>
void
explodPolyhedron
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
position
);
void
explodPolyhedron
(
typename
PFP
::
MAP
&
map
,
Dart
d
,
typename
PFP
::
TVEC3
position
);
/**
* create a n-sided pyramid
*/
template
<
typename
PFP
>
Dart
createPyramid
(
typename
PFP
::
MAP
&
map
,
unsigned
int
nbSides
);
/**
* create a n-sided prism
*/
template
<
typename
PFP
>
Dart
createPrism
(
typename
PFP
::
MAP
&
map
,
unsigned
int
nbSides
);
/**
* create a n-sided diamond
*/
template
<
typename
PFP
>
Dart
createDiamond
(
typename
PFP
::
MAP
&
map
,
unsigned
int
nbSides
);
/**
* create a tetrahedron
*/
template
<
typename
PFP
>
Dart
createTetrahedron
(
typename
PFP
::
MAP
&
map
);
/**
* create a hexahedron
*/
template
<
typename
PFP
>
Dart
createHexahedron
(
typename
PFP
::
MAP
&
map
);
/**
* create a 3-sided prism
*/
template
<
typename
PFP
>
Dart
createTriangularPrism
(
typename
PFP
::
MAP
&
map
);
/**
* create a 3-sided pyramid
*/
template
<
typename
PFP
>
Dart
createQuadrangularPyramid
(
typename
PFP
::
MAP
&
map
);
/**
* create 4-sided diamond (i.e. an octahedron)
*/
template
<
typename
PFP
>
Dart
createOctahedron
(
typename
PFP
::
MAP
&
map
);
/**
/**
* class of geometric Polyhedron
* class of geometric Polyhedron
* It alloaw the creation of:
* It alloaw the creation of:
...
@@ -82,7 +140,6 @@ void explodPolyhedron(typename PFP::MAP& map, Dart d, typename PFP::TVEC3 positi
...
@@ -82,7 +140,6 @@ void explodPolyhedron(typename PFP::MAP& map, Dart d, typename PFP::TVEC3 positi
*
*
* Topological creation methods are separated from embedding to
* Topological creation methods are separated from embedding to
* easily allow specific embedding.
* easily allow specific embedding.
*/
*/
template
<
typename
PFP
>
template
<
typename
PFP
>
class
Polyhedron
class
Polyhedron
...
@@ -167,30 +224,6 @@ public:
...
@@ -167,30 +224,6 @@ public:
*/
*/
Polyhedron
(
const
Polyhedron
<
PFP
>&
p1
,
const
Polyhedron
<
PFP
>&
p2
);
Polyhedron
(
const
Polyhedron
<
PFP
>&
p1
,
const
Polyhedron
<
PFP
>&
p2
);
/**
* create simple simple polyhedron (not handled by Polyhedron object)
*/
static
Dart
createPolyhedron
(
typename
PFP
::
MAP
&
the_map
,
unsigned
int
nbFaces
);
/**
* create simple simple tetrahedron (not handled by Polyhedron object)
*/
static
Dart
createTetra
(
typename
PFP
::
MAP
&
the_map
);
/**
* create simple simple pyramid (not handled by Polyhedron object)
*/
static
Dart
createPyra
(
typename
PFP
::
MAP
&
the_map
);
/**
* create simple simple hexaedron (not handled by Polyhedron object)
*/
static
Dart
createHexa
(
typename
PFP
::
MAP
&
the_map
);
/**
* create simple simple prism (not handled by Polyhedron object)
*/
static
Dart
createPrism
(
typename
PFP
::
MAP
&
the_map
);
/*
/*
* get the reference dart
* get the reference dart
...
...
include/Algo/Modelisation/polyhedron.hpp
View file @
2cb734d8
...
@@ -31,6 +31,170 @@ namespace Algo
...
@@ -31,6 +31,170 @@ namespace Algo
namespace
Modelisation
namespace
Modelisation
{
{
/**
* create a n-sided pyramid
*/
template
<
typename
PFP
>
Dart
createPyramid
(
typename
PFP
::
MAP
&
map
,
unsigned
int
n
)
{
Dart
dres
=
Dart
::
nil
();
std
::
vector
<
Dart
>
m_tableVertDarts
;
m_tableVertDarts
.
reserve
(
n
);
// creation of triangles around circunference and storing vertices
for
(
unsigned
int
i
=
0
;
i
<
n
;
++
i
)
{