Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Thomas Pitiot
CGoGN
Commits
94cddb13
Commit
94cddb13
authored
Jan 28, 2011
by
Pierre Kraemer
Browse files
miniTest compile..
parent
498e5870
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Apps/Examples/miniTest.cpp
View file @
94cddb13
...
...
@@ -627,8 +627,6 @@ int main(int argc, char** argv)
{
MyGlutWin
*
mgw
=
new
MyGlutWin
(
&
argc
,
argv
,
1200
,
800
)
;
mgw
->
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
"position"
)
;
if
(
argc
<
2
)
{
Dart
d1
=
myMap
.
newFace
(
3
)
;
...
...
@@ -641,12 +639,13 @@ int main(int argc, char** argv)
char
*
filename
=
argv
[
1
]
;
GLint
t1
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
bool
success
=
Algo
::
Import
::
importMesh
<
PFP
>
(
myMap
,
filename
,
mgw
->
position
,
Algo
::
Import
::
ImportSurfacique
::
UNKNOWNSURFACE
)
;
if
(
!
succes
s
)
std
::
vector
<
std
::
string
>
attrNames
;
if
(
!
Algo
::
Import
::
importMesh
<
PFP
>
(
myMap
,
filename
,
attrName
s
)
)
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
1
;
}
mgw
->
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX_ORBIT
,
attrNames
[
0
])
;
GLint
t2
=
glutGet
(
GLUT_ELAPSED_TIME
)
;
GLfloat
seconds
=
(
t2
-
t1
)
/
1000.0
f
;
std
::
cout
<<
"import: "
<<
seconds
<<
" sec"
<<
std
::
endl
;
...
...
include/Algo/Import/import.h
View file @
94cddb13
...
...
@@ -47,7 +47,7 @@ namespace Import
* @return a boolean indicating if import was successfull
*/
template
<
typename
PFP
>
bool
importMesh
(
typename
PFP
::
MAP
&
map
,
const
std
::
string
&
filename
,
typename
PFP
::
TVEC3
&
position
s
,
ImportSurfacique
::
ImportType
kind
=
ImportSurfacique
::
UNKNOWNSURFACE
);
bool
importMesh
(
typename
PFP
::
MAP
&
map
,
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrName
s
,
ImportSurfacique
::
ImportType
kind
=
ImportSurfacique
::
UNKNOWNSURFACE
);
template
<
typename
PFP
>
bool
importPLYPTM
(
typename
PFP
::
MAP
&
map
,
const
std
::
string
&
filename
,
typename
PFP
::
TVEC3
&
positions
,
ImportSurfacique
::
ImportType
kind
,
...
...
@@ -57,7 +57,7 @@ bool importPLYPTM(typename PFP::MAP& map, const std::string& filename, typename
* import a volumic mesh
*/
template
<
typename
PFP
>
bool
importMesh
(
typename
PFP
::
MAP
&
map
,
const
std
::
string
&
filename
,
typename
PFP
::
TVEC3
&
positions
,
ImportVolumique
::
ImportType
kind
=
ImportVolumique
::
UNKNOWNVOLUME
);
bool
importMesh
(
typename
PFP
::
MAP
&
map
,
const
std
::
string
&
filename
,
typename
PFP
::
TVEC3
&
positions
,
ImportVolumique
::
ImportType
kind
=
ImportVolumique
::
UNKNOWNVOLUME
);
//template <typename PFP>
//bool importObjWithTex(typename PFP::MAP& map, const std::string& filename);
...
...
include/Algo/Import/import2tables.h
View file @
94cddb13
...
...
@@ -63,11 +63,14 @@ template <typename PFP>
class
MeshTablesSurface
{
protected:
typename
PFP
::
MAP
&
m_map
;
unsigned
m_nbVertices
;
unsigned
m_nbFaces
;
unsigned
int
m_lab
;
/**
* number of edges per face
*/
...
...
@@ -78,65 +81,49 @@ protected:
*/
std
::
vector
<
unsigned
int
>
m_emb
;
/**
* we need direct access to container itself to insert new lines while reading points
*/
AttribContainer
&
m_container
;
/**
* table of positions
*/
typename
PFP
::
TVEC3
&
m_positions
;
static
ImportSurfacique
::
ImportType
getFileType
(
const
std
::
string
&
filename
);
void
extractMeshRec
(
const
struct
aiScene
*
scene
,
const
struct
aiNode
*
nd
,
struct
aiMatrix4x4
*
trafo
);
void
extractMeshRec
(
AttribContainer
&
container
,
AttributeHandler
<
typename
PFP
::
VEC3
>&
positions
,
const
struct
aiScene
*
scene
,
const
struct
aiNode
*
nd
,
struct
aiMatrix4x4
*
trafo
);
public:
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
VEC3
::
DATA_TYPE
DATA_TYPE
;
inline
unsigned
getNbFaces
()
const
{
return
m_nbFaces
;}
inline
unsigned
getNbFaces
()
const
{
return
m_nbFaces
;
}
inline
unsigned
getNbVertices
()
const
{
return
m_nbVertices
;}
inline
unsigned
getNbVertices
()
const
{
return
m_nbVertices
;
}
inline
short
getNbEdgesFace
(
int
i
)
const
{
return
m_nbEdges
[
i
];}
inline
short
getNbEdgesFace
(
int
i
)
const
{
return
m_nbEdges
[
i
];
}
inline
unsigned
int
getEmbIdx
(
int
i
)
{
return
m_emb
[
i
];}
inline
unsigned
int
getEmbIdx
(
int
i
)
{
return
m_emb
[
i
];
}
bool
import
Trian
(
const
std
::
string
&
filename
);
bool
import
Mesh
(
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
,
ImportSurfacique
::
ImportType
kind
);
bool
importTrian
BinGz
(
const
std
::
string
&
filename
);
bool
importTrian
(
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
);
bool
import
Off
(
const
std
::
string
&
filename
);
bool
import
TrianBinGz
(
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
);
bool
importO
bj
(
const
std
::
string
&
filename
);
bool
importO
ff
(
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
);
bool
import
Ply
(
const
std
::
string
&
filename
);
bool
import
Obj
(
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
);
bool
import
Mesh
(
const
std
::
string
&
filename
,
ImportSurfacique
::
ImportType
kind
);
bool
import
Ply
(
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
);
bool
importPlyPTM
(
const
std
::
string
&
filename
,
typename
PFP
::
TFRAME
&
Frame
,
typename
PFP
::
TRGBFUNCS
&
RGBfunction
s
);
bool
importPlyPTM
(
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrName
s
);
bool
importCTM
(
const
std
::
string
&
filename
);
bool
importCTM
(
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
);
bool
importASSIMP
(
const
std
::
string
&
filename
);
bool
importASSIMP
(
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
);
/**
* @param container container of vertex orbite
* @param idPositions id of position attribute in the container
* @param idLabels id of label attribute in the container
*/
MeshTablesSurface
(
AttribContainer
&
container
,
typename
PFP
::
TVEC3
&
positions
)
:
m_
container
(
container
),
m_positions
(
positions
)
MeshTablesSurface
(
typename
PFP
::
MAP
&
map
)
:
m_
map
(
map
)
{
}
MeshTablesSurface
(
AttribContainer
&
container
,
typename
PFP
::
TVEC3
&
positions
,
const
std
::
string
&
filename
)
:
m_container
(
container
),
m_positions
(
positions
)
{
importMesh
(
filename
);
}
};
...
...
include/Algo/Import/import2tablesSurface.hpp
View file @
94cddb13
This diff is collapsed.
Click to expand it.
include/Algo/Import/importMesh.hpp
View file @
94cddb13
...
...
@@ -428,13 +428,13 @@ bool importMesh(typename PFP::MAP& map, MeshTablesVolume<PFP>& mtv)
}
template
<
typename
PFP
>
bool
importMesh
(
typename
PFP
::
MAP
&
map
,
const
std
::
string
&
filename
,
typename
PFP
::
TVEC3
&
position
s
,
ImportSurfacique
::
ImportType
kind
)
bool
importMesh
(
typename
PFP
::
MAP
&
map
,
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrName
s
,
ImportSurfacique
::
ImportType
kind
)
{
AttribContainer
&
vertexContainer
=
map
.
getAttributeContainer
(
VERTEX_ORBIT
);
//
AttribContainer& vertexContainer = map.getAttributeContainer(VERTEX_ORBIT);
MeshTablesSurface
<
PFP
>
mts
(
vertexContainer
,
positions
);
MeshTablesSurface
<
PFP
>
mts
(
map
);
if
(
!
mts
.
importMesh
(
filename
,
kind
))
if
(
!
mts
.
importMesh
(
filename
,
attrNames
,
kind
))
return
false
;
return
importMesh
<
PFP
>
(
map
,
mts
);
...
...
include/Container/attrib_container.h
View file @
94cddb13
...
...
@@ -246,7 +246,7 @@ public:
* @param strings (OUT) tableau des noms d'attributs
* @return le nombre d'attributs
*/
unsigned
int
getAttributesStrings
(
std
::
vector
<
std
::
string
>&
strings
);
unsigned
int
getAttributesStrings
(
std
::
vector
<
std
::
string
>&
strings
);
/**
* get the name of an attribute, given its index in the container
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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