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
VTK
VTK
Commits
1fb8f93c
Commit
1fb8f93c
authored
Jul 17, 1995
by
Will Schroeder
Browse files
ENH: Started to implement.
parent
e22407dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/HyperStr.hh
View file @
1fb8f93c
...
...
@@ -29,7 +29,7 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
#define START_FROM_POSITION 0
#define START_FROM_LOCATION 1
typedef
struct
_vtk
Stream
Point
{
typedef
struct
_vtk
Hyper
Point
{
float
x
[
3
];
// position
int
cellId
;
// cell
int
subId
;
// cell sub id
...
...
@@ -39,28 +39,28 @@ typedef struct _vtkStreamPoint {
float
s
;
// scalar value
float
t
;
// time travelled so far
float
d
;
// distance travelled so far
}
vtk
Stream
Point
;
}
vtk
Hyper
Point
;
//
// Special classes for manipulating data
//
//BTX - begin tcl exclude
//
class
vtk
Stream
Array
{
//;prevent man page generation
class
vtk
Hyper
Array
{
//;prevent man page generation
public:
vtk
Stream
Array
();
~
vtk
Stream
Array
()
{
if
(
this
->
Array
)
delete
[]
this
->
Array
;};
vtk
Hyper
Array
();
~
vtk
Hyper
Array
()
{
if
(
this
->
Array
)
delete
[]
this
->
Array
;};
int
GetNumberOfPoints
()
{
return
this
->
MaxId
+
1
;};
vtk
Stream
Point
*
Get
Stream
Point
(
int
i
)
{
return
this
->
Array
+
i
;};
vtk
Stream
Point
*
InsertNext
Stream
Point
()
vtk
Hyper
Point
*
Get
Hyper
Point
(
int
i
)
{
return
this
->
Array
+
i
;};
vtk
Hyper
Point
*
InsertNext
Hyper
Point
()
{
if
(
++
this
->
MaxId
>=
this
->
Size
)
this
->
Resize
(
this
->
MaxId
);
return
this
->
Array
+
this
->
MaxId
;
}
vtk
Stream
Point
*
Resize
(
int
sz
);
//reallocates data
vtk
Hyper
Point
*
Resize
(
int
sz
);
//reallocates data
void
Reset
()
{
this
->
MaxId
=
-
1
;};
vtk
Stream
Point
*
Array
;
// pointer to data
vtk
Hyper
Point
*
Array
;
// pointer to data
int
MaxId
;
// maximum index inserted thus far
int
Size
;
// allocated size of data
int
Extend
;
// grow array by this amount
...
...
@@ -128,7 +128,7 @@ protected:
float
StartPosition
[
3
];
//array of streamers
vtk
Stream
Array
*
Streamers
;
vtk
Hyper
Array
*
Streamers
;
int
NumberOfStreamers
;
// length of Streamer is generated by time, or by MaximumSteps
...
...
src/HyperStr.cc
View file @
1fb8f93c
...
...
@@ -16,28 +16,28 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
#include "HyperStr.hh"
#include "vtkMath.hh"
vtk
Stream
Array
::
vtk
Stream
Array
()
vtk
Hyper
Array
::
vtk
Hyper
Array
()
{
this
->
MaxId
=
-
1
;
this
->
Array
=
new
vtk
Stream
Point
[
1000
];
this
->
Array
=
new
vtk
Hyper
Point
[
1000
];
this
->
Size
=
1000
;
this
->
Extend
=
5000
;
this
->
Direction
=
INTEGRATE_FORWARD
;
}
vtk
Stream
Point
*
vtk
Stream
Array
::
Resize
(
int
sz
)
vtk
Hyper
Point
*
vtk
Hyper
Array
::
Resize
(
int
sz
)
{
vtk
Stream
Point
*
newArray
;
vtk
Hyper
Point
*
newArray
;
int
newSize
;
if
(
sz
>=
this
->
Size
)
newSize
=
this
->
Size
+
this
->
Extend
*
(((
sz
-
this
->
Size
)
/
this
->
Extend
)
+
1
);
else
newSize
=
sz
;
newArray
=
new
vtk
Stream
Point
[
newSize
];
newArray
=
new
vtk
Hyper
Point
[
newSize
];
memcpy
(
newArray
,
this
->
Array
,
(
sz
<
this
->
Size
?
sz
:
this
->
Size
)
*
sizeof
(
vtk
Stream
Point
));
(
sz
<
this
->
Size
?
sz
:
this
->
Size
)
*
sizeof
(
vtk
Hyper
Point
));
this
->
Size
=
newSize
;
delete
[]
this
->
Array
;
...
...
@@ -150,7 +150,7 @@ void vtkHyperStreamline::Execute()
vtkPointData
*
pd
=
input
->
GetPointData
();
vtkScalars
*
inScalars
;
vtkVectors
*
inVectors
;
vtk
Stream
Point
*
sNext
,
*
sPtr
;
vtk
Hyper
Point
*
sNext
,
*
sPtr
;
int
i
,
j
,
ptId
,
offset
,
numSteps
,
subId
;
vtkCell
*
cell
;
vtkFloatVectors
cellVectors
(
MAX_CELL_SIZE
);
...
...
@@ -184,11 +184,11 @@ void vtkHyperStreamline::Execute()
this
->
NumberOfStreamers
*=
2
;
}
this
->
Streamers
=
new
vtk
Stream
Array
[
this
->
NumberOfStreamers
];
this
->
Streamers
=
new
vtk
Hyper
Array
[
this
->
NumberOfStreamers
];
if
(
this
->
StartFrom
==
START_FROM_POSITION
)
{
sPtr
=
this
->
Streamers
[
0
].
InsertNext
Stream
Point
();
sPtr
=
this
->
Streamers
[
0
].
InsertNext
Hyper
Point
();
for
(
i
=
0
;
i
<
3
;
i
++
)
sPtr
->
x
[
i
]
=
this
->
StartPosition
[
i
];
sPtr
->
cellId
=
input
->
FindCell
(
this
->
StartPosition
,
NULL
,
0.0
,
sPtr
->
subId
,
sPtr
->
p
,
w
);
...
...
@@ -196,7 +196,7 @@ void vtkHyperStreamline::Execute()
else
//START_FROM_LOCATION
{
sPtr
=
this
->
Streamers
[
0
].
InsertNext
Stream
Point
();
sPtr
=
this
->
Streamers
[
0
].
InsertNext
Hyper
Point
();
cell
=
input
->
GetCell
(
sPtr
->
cellId
);
cell
->
EvaluateLocation
(
sPtr
->
subId
,
sPtr
->
p
,
sPtr
->
x
,
w
);
}
...
...
@@ -204,7 +204,7 @@ void vtkHyperStreamline::Execute()
// Finish initializing each streamer
//
this
->
Streamers
[
0
].
Direction
=
1.0
;
sPtr
=
this
->
Streamers
[
0
].
Get
Stream
Point
(
0
);
sPtr
=
this
->
Streamers
[
0
].
Get
Hyper
Point
(
0
);
sPtr
->
d
=
0.0
;
sPtr
->
t
=
0.0
;
if
(
sPtr
->
cellId
>=
0
)
//starting point in dataset
...
...
@@ -224,7 +224,7 @@ void vtkHyperStreamline::Execute()
if
(
this
->
IntegrationDirection
==
INTEGRATE_BOTH_DIRECTIONS
)
{
this
->
Streamers
[
1
].
Direction
=
-
1.0
;
sNext
=
this
->
Streamers
[
1
].
InsertNext
Stream
Point
();
sNext
=
this
->
Streamers
[
1
].
InsertNext
Hyper
Point
();
*
sNext
=
*
sPtr
;
}
}
//for each streamer
...
...
@@ -234,7 +234,7 @@ void vtkHyperStreamline::Execute()
for
(
ptId
=
0
;
ptId
<
this
->
NumberOfStreamers
;
ptId
++
)
{
//get starting step
sPtr
=
this
->
Streamers
[
ptId
].
Get
Stream
Point
(
0
);
sPtr
=
this
->
Streamers
[
ptId
].
Get
Hyper
Point
(
0
);
if
(
sPtr
->
cellId
<
0
)
continue
;
dir
=
this
->
Streamers
[
ptId
].
Direction
;
...
...
@@ -270,7 +270,7 @@ void vtkHyperStreamline::Execute()
xNext
[
i
]
=
sPtr
->
x
[
i
]
+
dir
*
(
step
/
2.0
)
*
(
sPtr
->
v
[
i
]
+
vNext
[
i
])
/
sPtr
->
speed
;
sNext
=
this
->
Streamers
[
ptId
].
InsertNext
Stream
Point
();
sNext
=
this
->
Streamers
[
ptId
].
InsertNext
Hyper
Point
();
if
(
cell
->
EvaluatePosition
(
xNext
,
closestPoint
,
sNext
->
subId
,
sNext
->
p
,
dist2
,
w
)
)
...
...
Write
Preview
Supports
Markdown
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