Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Andrew Bauer
VTK
Commits
840bdf69
Commit
840bdf69
authored
Mar 31, 1997
by
Bill Lorensen
Browse files
ERR: Contour was not consistent on edge interpolation.
parent
eed8737d
Changes
1
Hide whitespace changes
Inline
Side-by-side
common/vtkTriangle.cxx
View file @
840bdf69
...
...
@@ -312,7 +312,8 @@ void vtkTriangle::Contour(float value, vtkFloatScalars *cellScalars,
EDGE_LIST
*
edge
;
int
i
,
j
,
index
,
*
vert
;
int
pts
[
2
];
float
t
,
*
x1
,
*
x2
,
x
[
3
];
int
e1
,
e2
;
float
t
,
x1
[
3
],
x2
[
3
],
x
[
3
],
deltaScalar
;
// Build the case table
for
(
i
=
0
,
index
=
0
;
i
<
3
;
i
++
)
...
...
@@ -327,11 +328,25 @@ void vtkTriangle::Contour(float value, vtkFloatScalars *cellScalars,
for
(
i
=
0
;
i
<
2
;
i
++
)
// insert line
{
vert
=
edges
[
edge
[
i
]];
t
=
(
value
-
cellScalars
->
GetScalar
(
vert
[
0
]))
/
(
cellScalars
->
GetScalar
(
vert
[
1
])
-
cellScalars
->
GetScalar
(
vert
[
0
]));
// calculate a preferred interpolation direction
deltaScalar
=
(
cellScalars
->
GetScalar
(
vert
[
1
])
-
cellScalars
->
GetScalar
(
vert
[
0
]));
if
(
deltaScalar
>
0
)
{
e1
=
vert
[
0
];
e2
=
vert
[
1
];
}
else
{
e1
=
vert
[
1
];
e2
=
vert
[
0
];
deltaScalar
=
-
deltaScalar
;
}
// linear interpolation
if
(
deltaScalar
==
0.0
)
t
=
0.0
;
else
t
=
(
value
-
cellScalars
->
GetScalar
(
e1
))
/
deltaScalar
;
this
->
Points
.
GetPoint
(
e1
,
x1
);
this
->
Points
.
GetPoint
(
e2
,
x2
);
x1
=
this
->
Points
.
GetPoint
(
vert
[
0
]);
x2
=
this
->
Points
.
GetPoint
(
vert
[
1
]);
for
(
j
=
0
;
j
<
3
;
j
++
)
x
[
j
]
=
x1
[
j
]
+
t
*
(
x2
[
j
]
-
x1
[
j
]);
if
(
(
pts
[
i
]
=
locator
->
IsInsertedPoint
(
x
))
<
0
)
{
...
...
@@ -770,7 +785,6 @@ void vtkTriangle::Clip(float value, vtkFloatScalars *cellScalars,
this
->
Points
.
GetPoint
(
e2
,
x2
);
for
(
j
=
0
;
j
<
3
;
j
++
)
x
[
j
]
=
x1
[
j
]
+
t
*
(
x2
[
j
]
-
x1
[
j
]);
if
(
(
pts
[
i
]
=
locator
->
IsInsertedPoint
(
x
))
<
0
)
{
pts
[
i
]
=
locator
->
InsertNextPoint
(
x
);
...
...
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