Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VTK
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
430
Issues
430
List
Boards
Labels
Milestones
Merge Requests
109
Merge Requests
109
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
VTK
VTK
Commits
1ee2b684
Commit
1ee2b684
authored
Dec 04, 2019
by
Dan Lipsa
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address review suggestions.
parent
72ad0c0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
8 deletions
+35
-8
IO/CityGML/vtkCityGMLReader.cxx
IO/CityGML/vtkCityGMLReader.cxx
+35
-8
No files found.
IO/CityGML/vtkCityGMLReader.cxx
View file @
1ee2b684
...
...
@@ -24,6 +24,7 @@
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkLine.h"
#include "vtkMathUtilities.h"
#include "vtkMatrix4x4.h"
#include "vtkMultiBlockDataSet.h"
#include "vtkObjectFactory.h"
...
...
@@ -365,20 +366,46 @@ public:
if
(
posList
)
{
std
::
istringstream
iss
(
posList
.
child_value
());
while
(
1
)
bool
validPoint
=
true
;
do
{
double
p
[
3
]
=
{
0
,
0
,
0
};
double
p
[
3
]
=
{
0
.
,
0.
,
0.
};
for
(
vtkIdType
j
=
0
;
j
<
3
;
++
j
)
{
iss
>>
p
[
j
];
if
(
!
iss
.
good
())
goto
no_more_values
;
{
if
(
j
)
{
vtkWarningWithObjectMacro
(
this
->
Reader
,
<<
"Number of points have to be multiple of three. "
<<
"See point in gml:posList after "
<<
p
[
0
]
<<
" point value"
);
}
else
{
double
*
pFirst
=
points
->
GetPoint
(
0
);
double
*
pLast
=
points
->
GetPoint
(
polyPointIds
->
GetNumberOfIds
()
-
1
);
if
(
!
vtkMathUtilities
::
FuzzyCompare
(
pFirst
[
0
],
pLast
[
0
])
||
!
vtkMathUtilities
::
FuzzyCompare
(
pFirst
[
1
],
pLast
[
1
])
||
!
vtkMathUtilities
::
FuzzyCompare
(
pFirst
[
2
],
pLast
[
2
]))
{
vtkWarningWithObjectMacro
(
this
->
Reader
,
<<
"gml:posList: First point ("
<<
pFirst
[
0
]
<<
", "
<<
pFirst
[
1
]
<<
", "
<<
pFirst
[
2
]
<<
") is not equal with last point ("
<<
pLast
[
0
]
<<
", "
<<
pLast
[
1
]
<<
", "
<<
pLast
[
2
]
<<
"). File may be corrupted."
);
}
}
validPoint
=
false
;
break
;
}
}
points
->
InsertNextPoint
(
p
);
polyPointIds
->
InsertId
(
i
,
points
->
GetNumberOfPoints
()
-
1
);
++
i
;
}
no_more_values:
if
(
validPoint
)
{
points
->
InsertNextPoint
(
p
);
polyPointIds
->
InsertId
(
i
,
points
->
GetNumberOfPoints
()
-
1
);
++
i
;
}
}
while
(
validPoint
);
// gml:posList repeates the last point in a
// polygon (there are n points). We only need the first n - 1.
polyPointIds
->
SetNumberOfIds
(
polyPointIds
->
GetNumberOfIds
()
-
1
);
...
...
Dan Lipsa
@danlipsa
mentioned in commit
fe7d4666
·
Dec 04, 2019
mentioned in commit
fe7d4666
mentioned in commit fe7d466643f3da1bc9081432e16131371b6731aa
Toggle commit list
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