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
2f262846
Commit
2f262846
authored
12 years ago
by
Karsten Rink
Browse files
Options
Downloads
Patches
Plain Diff
resolved index error for triangle elements in legacy mesh import
parent
df1eab70
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
FileIO/Legacy/MeshIO.cpp
+6
-6
6 additions, 6 deletions
FileIO/Legacy/MeshIO.cpp
Gui/VtkAct/VtkCustomInteractorStyle.cpp
+7
-5
7 additions, 5 deletions
Gui/VtkAct/VtkCustomInteractorStyle.cpp
with
13 additions
and
11 deletions
FileIO/Legacy/MeshIO.cpp
+
6
−
6
View file @
2f262846
...
...
@@ -158,7 +158,7 @@ MeshLib::Element* MeshIO::readElement(const std::string& line, const std::vector
ss
>>
idx
[
i
];
MeshLib
::
Node
**
tri_nodes
=
new
MeshLib
::
Node
*
[
3
];
for
(
unsigned
k
(
0
);
k
<
3
;
k
++
)
tri_nodes
[
k
]
=
nodes
[
idx
[
k
]];
tri_nodes
[
k
]
=
nodes
[
idx
[
2
-
k
]];
elem
=
new
MeshLib
::
Tri
(
tri_nodes
,
patch_index
);
break
;
}
...
...
@@ -167,7 +167,7 @@ MeshLib::Element* MeshIO::readElement(const std::string& line, const std::vector
ss
>>
idx
[
i
];
MeshLib
::
Node
**
quad_nodes
=
new
MeshLib
::
Node
*
[
4
];
for
(
unsigned
k
(
0
);
k
<
4
;
k
++
)
quad_nodes
[
k
]
=
nodes
[
idx
[
4
-
(
k
+
1
)
]];
quad_nodes
[
k
]
=
nodes
[
idx
[
3
-
k
]];
elem
=
new
MeshLib
::
Quad
(
quad_nodes
,
patch_index
);
break
;
}
...
...
@@ -176,7 +176,7 @@ MeshLib::Element* MeshIO::readElement(const std::string& line, const std::vector
ss
>>
idx
[
i
];
MeshLib
::
Node
**
tet_nodes
=
new
MeshLib
::
Node
*
[
4
];
for
(
unsigned
k
(
0
);
k
<
4
;
k
++
)
tet_nodes
[
k
]
=
nodes
[
idx
[
4
-
(
k
+
1
)
]];
tet_nodes
[
k
]
=
nodes
[
idx
[
3
-
k
]];
elem
=
new
MeshLib
::
Tet
(
tet_nodes
,
patch_index
);
break
;
}
...
...
@@ -185,7 +185,7 @@ MeshLib::Element* MeshIO::readElement(const std::string& line, const std::vector
ss
>>
idx
[
i
];
MeshLib
::
Node
**
hex_nodes
=
new
MeshLib
::
Node
*
[
8
];
for
(
unsigned
k
(
0
);
k
<
8
;
k
++
)
hex_nodes
[
k
]
=
nodes
[
idx
[
8
-
(
k
+
1
)
]];
hex_nodes
[
k
]
=
nodes
[
idx
[
7
-
k
]];
elem
=
new
MeshLib
::
Hex
(
hex_nodes
,
patch_index
);
break
;
}
...
...
@@ -194,7 +194,7 @@ MeshLib::Element* MeshIO::readElement(const std::string& line, const std::vector
ss
>>
idx
[
i
];
MeshLib
::
Node
**
pyramid_nodes
=
new
MeshLib
::
Node
*
[
5
];
for
(
unsigned
k
(
0
);
k
<
5
;
k
++
)
pyramid_nodes
[
k
]
=
nodes
[
idx
[
5
-
(
k
+
1
)
]];
pyramid_nodes
[
k
]
=
nodes
[
idx
[
4
-
k
]];
elem
=
new
MeshLib
::
Pyramid
(
pyramid_nodes
,
patch_index
);
break
;
}
...
...
@@ -203,7 +203,7 @@ MeshLib::Element* MeshIO::readElement(const std::string& line, const std::vector
ss
>>
idx
[
i
];
MeshLib
::
Node
**
prism_nodes
=
new
MeshLib
::
Node
*
[
6
];
for
(
unsigned
k
(
0
);
k
<
6
;
k
++
)
prism_nodes
[
k
]
=
nodes
[
idx
[
6
-
(
k
+
1
)
]];
prism_nodes
[
k
]
=
nodes
[
idx
[
5
-
k
]];
elem
=
new
MeshLib
::
Prism
(
prism_nodes
,
patch_index
);
break
;
}
...
...
This diff is collapsed.
Click to expand it.
Gui/VtkAct/VtkCustomInteractorStyle.cpp
+
7
−
5
View file @
2f262846
...
...
@@ -34,6 +34,7 @@
#include
<string>
#include
"VtkMeshSource.h"
#include
"VtkCompositeSelectionFilter.h"
vtkStandardNewMacro
(
VtkCustomInteractorStyle
);
...
...
@@ -182,24 +183,25 @@ void VtkCustomInteractorStyle::OnLeftButtonDown()
VtkMeshSource
*
source
=
dynamic_cast
<
VtkMeshSource
*>
(
data_set
);
if
(
source
)
emit
elementPicked
(
source
->
GetMesh
(),
picker
->
GetCellId
());
/* test for picking on selection filters
/* test for picking on selection filters
else
{
vtkAlgorithm* data_set = picker->GetActor()->GetMapper()->GetInputConnection(0,0)->GetProducer()
/*
vtkAlgorithm* data_set
2
= picker->GetActor()->GetMapper()->GetInputConnection(0,0)->GetProducer()
->GetInputConnection(0,0)->GetProducer()
->GetInputConnection(0,0)->GetProducer()
->GetInputConnection(0,0)->GetProducer()
->GetInputConnection(0,0)->GetProducer()
->GetInputConnection(0,0)->GetProducer();
VtkMeshSource* source = dynamic_cast<VtkMeshSource*>(data_set);
VtkCompositeSelectionFilter* source = dynamic_cast<VtkCompositeSelectionFilter*>(data_set->GetInputConnection(0,0)->GetProducer()->GetInputConnection(0,0)->GetProducer()->GetInputConnection(0,0)->GetProducer());
if (source)
{
vtkUnstructuredGridAlgorithm* data_set = vtkUnstructuredGridAlgorithm::SafeDownCast(picker->GetActor()->GetMapper()->GetInputConnection(0,0)->GetProducer());
vtkUnstructuredGrid* grid = vtkUnstructuredGrid::SafeDownCast(data_set->GetOutputDataObject(0));
vtkDataArray* scalar_array = grid->GetCellData()->GetArray("vtkIdFilter_Ids");
double test = scalar_array->GetTuple1(picker->GetCellId());
emit elementPicked(source->GetMesh(), test);
//
emit elementPicked(source->GetMesh(), test);
}
}
*/
...
...
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