Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs-feliks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Feliks Kiszkurno
ogs-feliks
Commits
f1e348e7
Commit
f1e348e7
authored
12 years ago
by
Karsten Rink
Browse files
Options
Downloads
Patches
Plain Diff
included surface extraction from 3d meshes into gui
parent
146abb40
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Gui/DataView/MshView.cpp
+22
-17
22 additions, 17 deletions
Gui/DataView/MshView.cpp
Gui/DataView/MshView.h
+2
-3
2 additions, 3 deletions
Gui/DataView/MshView.h
with
24 additions
and
20 deletions
Gui/DataView/MshView.cpp
+
22
−
17
View file @
f1e348e7
...
@@ -15,6 +15,8 @@
...
@@ -15,6 +15,8 @@
#include
"MshItem.h"
#include
"MshItem.h"
#include
"MshModel.h"
#include
"MshModel.h"
#include
"OGSError.h"
#include
"OGSError.h"
#include
"MshEditor.h"
#include
"ImportFileTypes.h"
#include
"ImportFileTypes.h"
#include
<QHeaderView>
#include
<QHeaderView>
...
@@ -87,41 +89,33 @@ void MshView::removeMesh()
...
@@ -87,41 +89,33 @@ void MshView::removeMesh()
emit
requestMeshRemoval
(
index
);
emit
requestMeshRemoval
(
index
);
}
}
/*
// Removed functionality. Do we still need this?
void MshView::removeAllMeshes()
{
TreeItem* root = static_cast<MshModel*>(this->model())->getItem(QModelIndex());
int nChildren = root->childCount() - 1;
for (int i = nChildren; i >= 0; i--)
emit requestMeshRemoval(this->model()->index(i, 0, QModelIndex()));
}
*/
void
MshView
::
contextMenuEvent
(
QContextMenuEvent
*
event
)
void
MshView
::
contextMenuEvent
(
QContextMenuEvent
*
event
)
{
{
QModelIndex
index
=
this
->
selectionModel
()
->
currentIndex
();
QModelIndex
index
=
this
->
selectionModel
()
->
currentIndex
();
MshItem
*
item
=
dynamic_cast
<
MshItem
*>
(
static_cast
<
TreeItem
*>
(
index
.
internalPointer
()));
MshItem
*
item
=
dynamic_cast
<
MshItem
*>
(
static_cast
<
TreeItem
*>
(
index
.
internalPointer
()));
bool
is_3D_mesh
(
item
->
getMesh
()
->
getDimension
()
==
3
);
if
(
item
)
if
(
item
)
{
{
QMenu
menu
;
QMenu
menu
;
QAction
*
editMeshAction
=
menu
.
addAction
(
"Edit mesh..."
);
QAction
*
editMeshAction
=
menu
.
addAction
(
"Edit mesh..."
);
QAction
*
checkMeshAction
=
menu
.
addAction
(
"Check mesh quality..."
);
QAction
*
checkMeshAction
=
menu
.
addAction
(
"Check mesh quality..."
);
//QAction* saveMeshAction = menu.addAction("Save mesh...");
QAction
*
surfaceMeshAction
(
NULL
);
if
(
is_3D_mesh
)
surfaceMeshAction
=
menu
.
addAction
(
"Extract surface"
);
menu
.
addSeparator
();
menu
.
addSeparator
();
QMenu
direct_cond_menu
(
"DIRECT Conditions"
);
QMenu
direct_cond_menu
(
"DIRECT Conditions"
);
menu
.
addMenu
(
&
direct_cond_menu
);
menu
.
addMenu
(
&
direct_cond_menu
);
QAction
*
addDirectAction
=
direct_cond_menu
.
addAction
(
"Add..."
);
QAction
*
addDirectAction
=
direct_cond_menu
.
addAction
(
"Add..."
);
QAction
*
loadDirectAction
=
direct_cond_menu
.
addAction
(
"Load..."
);
QAction
*
loadDirectAction
=
direct_cond_menu
.
addAction
(
"Load..."
);
menu
.
addSeparator
();
//menu.addSeparator();
//QAction* removeMeshAction = menu.addAction("Remove mesh");
connect
(
editMeshAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
openMshEditDialog
()));
connect
(
editMeshAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
openMshEditDialog
()));
connect
(
checkMeshAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
checkMeshQuality
()));
connect
(
checkMeshAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
checkMeshQuality
()));
//connect(saveMeshAction, SIGNAL(triggered()), this, SLOT(writeMeshToFile()));
if
(
is_3D_mesh
)
connect
(
surfaceMeshAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
extractSurfaceMesh
()));
connect
(
addDirectAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
addDIRECTSourceTerms
()));
connect
(
addDirectAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
addDIRECTSourceTerms
()));
connect
(
loadDirectAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadDIRECTSourceTerms
()));
connect
(
loadDirectAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
loadDIRECTSourceTerms
()));
//connect(removeMeshAction, SIGNAL(triggered()), this, SLOT(removeMesh()));
menu
.
exec
(
event
->
globalPos
());
menu
.
exec
(
event
->
globalPos
());
}
}
}
}
...
@@ -139,6 +133,17 @@ void MshView::openMshEditDialog()
...
@@ -139,6 +133,17 @@ void MshView::openMshEditDialog()
meshEdit
.
exec
();
meshEdit
.
exec
();
}
}
void
MshView
::
extractSurfaceMesh
()
{
QModelIndex
index
=
this
->
selectionModel
()
->
currentIndex
();
if
(
!
index
.
isValid
())
return
;
const
MeshLib
::
Mesh
*
mesh
=
static_cast
<
MshModel
*>
(
this
->
model
())
->
getMesh
(
index
);
const
double
dir
[
3
]
=
{
0
,
0
,
1
};
static_cast
<
MshModel
*>
(
this
->
model
())
->
addMesh
(
MeshLib
::
MshEditor
::
getMeshSurface
(
*
mesh
,
dir
)
);
}
int
MshView
::
writeToFile
()
const
int
MshView
::
writeToFile
()
const
{
{
QModelIndex
index
=
this
->
selectionModel
()
->
currentIndex
();
QModelIndex
index
=
this
->
selectionModel
()
->
currentIndex
();
...
...
This diff is collapsed.
Click to expand it.
Gui/DataView/MshView.h
+
2
−
3
View file @
f1e348e7
...
@@ -64,14 +64,13 @@ private slots:
...
@@ -64,14 +64,13 @@ private slots:
void
addDIRECTSourceTerms
();
void
addDIRECTSourceTerms
();
void
extractSurfaceMesh
();
void
loadDIRECTSourceTerms
();
void
loadDIRECTSourceTerms
();
/// Remove the currently selected mesh.
/// Remove the currently selected mesh.
void
removeMesh
();
void
removeMesh
();
/// Remove all currently loaded meshes.
//void removeAllMeshes();
/// Calls the FileDialog to save a mesh to a file.
/// Calls the FileDialog to save a mesh to a file.
int
writeToFile
()
const
;
int
writeToFile
()
const
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment