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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hurstel
CGoGN
Commits
222b9959
Commit
222b9959
authored
Jan 23, 2013
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCHNApps: new addMap method
parent
4b478c61
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
30 deletions
+27
-30
SCHNApps/Plugins/importSurface/importSurface.cpp
SCHNApps/Plugins/importSurface/importSurface.cpp
+18
-17
SCHNApps/include/window.h
SCHNApps/include/window.h
+1
-2
SCHNApps/src/window.cpp
SCHNApps/src/window.cpp
+8
-11
No files found.
SCHNApps/Plugins/importSurface/importSurface.cpp
View file @
222b9959
...
@@ -20,28 +20,29 @@ void ImportSurfacePlugin::importFromFile(const QString& fileName)
...
@@ -20,28 +20,29 @@ void ImportSurfacePlugin::importFromFile(const QString& fileName)
QFileInfo
fi
(
fileName
);
QFileInfo
fi
(
fileName
);
if
(
fi
.
exists
())
if
(
fi
.
exists
())
{
{
GenericMap
*
m
=
m_window
->
createMap
(
2
);
MapHandlerGen
*
mhg
=
m_window
->
addMap
(
fi
.
baseName
(),
2
);
PFP2
::
MAP
*
map
=
static_cast
<
PFP2
::
MAP
*>
(
m
);
if
(
mhg
)
MapHandler
<
PFP2
>*
h
=
new
MapHandler
<
PFP2
>
(
fi
.
baseName
(),
m_window
,
map
);
{
MapHandler
<
PFP2
>*
mh
=
static_cast
<
MapHandler
<
PFP2
>*>
(
mhg
);
PFP2
::
MAP
*
map
=
mh
->
getMap
();
std
::
vector
<
std
::
string
>
attrNames
;
std
::
vector
<
std
::
string
>
attrNames
;
Algo
::
Surface
::
Import
::
importMesh
<
PFP2
>
(
*
map
,
fileName
.
toUtf8
().
constData
(),
attrNames
);
Algo
::
Surface
::
Import
::
importMesh
<
PFP2
>
(
*
map
,
fileName
.
toUtf8
().
constData
(),
attrNames
);
// get vertex position attribute
// get vertex position attribute
VertexAttribute
<
PFP2
::
VEC3
>
position
=
map
->
getAttribute
<
PFP2
::
VEC3
,
CGoGN
::
VERTEX
>
(
attrNames
[
0
]);
VertexAttribute
<
PFP2
::
VEC3
>
position
=
map
->
getAttribute
<
PFP2
::
VEC3
,
CGoGN
::
VERTEX
>
(
attrNames
[
0
]);
// create VBO for vertex position attribute
// create VBO for vertex position attribute
h
->
createVBO
(
position
);
m
h
->
createVBO
(
position
);
// compute map bounding box
// compute map bounding box
h
->
updateBB
(
position
);
m
h
->
updateBB
(
position
);
// compute primitive connectivity VBOs
// compute primitive connectivity VBOs
h
->
updatePrimitives
(
Algo
::
Render
::
GL2
::
POINTS
);
mh
->
updatePrimitives
(
Algo
::
Render
::
GL2
::
POINTS
);
h
->
updatePrimitives
(
Algo
::
Render
::
GL2
::
LINES
);
mh
->
updatePrimitives
(
Algo
::
Render
::
GL2
::
LINES
);
h
->
updatePrimitives
(
Algo
::
Render
::
GL2
::
TRIANGLES
);
mh
->
updatePrimitives
(
Algo
::
Render
::
GL2
::
TRIANGLES
);
}
m_window
->
addMap
(
h
);
}
}
}
}
...
...
SCHNApps/include/window.h
View file @
222b9959
...
@@ -213,8 +213,7 @@ public:
...
@@ -213,8 +213,7 @@ public:
* MANAGE MAPS
* MANAGE MAPS
*********************************************************/
*********************************************************/
GenericMap
*
createMap
(
unsigned
int
dim
);
MapHandlerGen
*
addMap
(
const
QString
&
name
,
unsigned
int
dim
);
bool
addMap
(
MapHandlerGen
*
map
);
void
removeMap
(
const
QString
&
name
);
void
removeMap
(
const
QString
&
name
);
MapHandlerGen
*
getMap
(
const
QString
&
name
)
const
;
MapHandlerGen
*
getMap
(
const
QString
&
name
)
const
;
QList
<
MapHandlerGen
*>
getMapsList
()
const
{
return
h_maps
.
values
();
}
QList
<
MapHandlerGen
*>
getMapsList
()
const
{
return
h_maps
.
values
();
}
...
...
SCHNApps/src/window.cpp
View file @
222b9959
...
@@ -514,8 +514,11 @@ Plugin* Window::checkPluginDependencie(QString name, Plugin* dependantPlugin)
...
@@ -514,8 +514,11 @@ Plugin* Window::checkPluginDependencie(QString name, Plugin* dependantPlugin)
* MANAGE MAPS
* MANAGE MAPS
*********************************************************/
*********************************************************/
GenericMap
*
Window
::
createMap
(
unsigned
int
dim
)
MapHandlerGen
*
Window
::
addMap
(
const
QString
&
name
,
unsigned
int
dim
)
{
{
if
(
h_maps
.
contains
(
name
))
return
NULL
;
GenericMap
*
map
=
NULL
;
GenericMap
*
map
=
NULL
;
switch
(
dim
)
switch
(
dim
)
{
{
...
@@ -526,19 +529,13 @@ GenericMap* Window::createMap(unsigned int dim)
...
@@ -526,19 +529,13 @@ GenericMap* Window::createMap(unsigned int dim)
map
=
new
PFP3
::
MAP
();
map
=
new
PFP3
::
MAP
();
break
;
break
;
}
}
return
map
;
}
bool
Window
::
addMap
(
MapHandlerGen
*
map
)
MapHandlerGen
*
mh
=
new
MapHandlerGen
(
name
,
this
,
map
);
{
h_maps
.
insert
(
name
,
mh
);
if
(
h_maps
.
contains
(
map
->
getName
()))
return
false
;
h_maps
.
insert
(
map
->
getName
(),
map
);
emit
(
mapAdded
(
mh
)
);
emit
(
mapAdded
(
map
));
return
mh
;
return
true
;
}
}
void
Window
::
removeMap
(
const
QString
&
name
)
void
Window
::
removeMap
(
const
QString
&
name
)
...
...
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