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
6ea76b1b
Commit
6ea76b1b
authored
Jul 09, 1994
by
Will Schroeder
Browse files
ERR: Misc bug fixes.
parent
f9cc3f08
Changes
5
Hide whitespace changes
Inline
Side-by-side
include/DS2DSF.hh
View file @
6ea76b1b
...
...
@@ -47,7 +47,7 @@ public:
int
FindCell
(
float
x
[
3
],
vlCell
*
cell
,
float
tol2
,
int
&
subId
,
float
pc
[
3
])
{
return
this
->
DataSet
->
FindCell
(
x
,
cell
,
tol2
,
subId
,
pc
);};
void
ComputeBounds
()
{
this
->
DataSet
->
ComputeBounds
();}
;
void
ComputeBounds
();
void
Update
();
protected:
...
...
include/WarpVect.hh
View file @
6ea76b1b
...
...
@@ -16,18 +16,17 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
//
//
Class to transform point
s
//
Warp geometry in direction of vector
s
//
#ifndef __vlWarpVector_h
#define __vlWarpVector_h
#include
"PtS2PtSF.hh"
#include
"Trans.hh"
class
vlWarpVector
:
public
vlPointSetToPointSetFilter
{
public:
vlWarpVector
()
:
ScaleFactor
(
0
.0
)
{};
vlWarpVector
()
:
ScaleFactor
(
1
.0
)
{};
~
vlWarpVector
()
{};
char
*
GetClassName
()
{
return
"vlWarpVector"
;};
void
PrintSelf
(
ostream
&
os
,
vlIndent
indent
);
...
...
src/DS2DSF.cc
View file @
6ea76b1b
...
...
@@ -53,6 +53,12 @@ void vlDataSetToDataSetFilter::Initialize()
}
}
void
vlDataSetToDataSetFilter
::
ComputeBounds
()
{
float
*
bounds
=
this
->
DataSet
->
GetBounds
();
for
(
int
i
=
0
;
i
<
6
;
i
++
)
this
->
Bounds
[
i
]
=
bounds
[
i
];
}
void
vlDataSetToDataSetFilter
::
PrintSelf
(
ostream
&
os
,
vlIndent
indent
)
{
if
(
this
->
ShouldIPrint
(
vlDataSetToDataSetFilter
::
GetClassName
()))
...
...
src/GeomF.cc
View file @
6ea76b1b
...
...
@@ -141,7 +141,7 @@ void vlGeometryFilter::Execute()
for
(
i
=
0
;
i
<
numPts
;
i
++
)
{
ptId
=
cell
->
GetPointId
(
i
);
x
=
this
->
GetPoint
(
ptId
);
x
=
this
->
Input
->
GetPoint
(
ptId
);
pts
[
i
]
=
newPts
->
InsertNextPoint
(
x
);
this
->
PointData
.
CopyData
(
pd
,
ptId
,
pts
[
i
]);
}
...
...
@@ -175,9 +175,8 @@ void vlGeometryFilter::Execute()
//
// Update ourselves
//
newPts
->
Squeeze
();
this
->
SetPoints
(
newPts
);
this
->
PointData
.
Squeeze
();
this
->
Squeeze
();
delete
[]
cellVis
;
...
...
src/TransF.cc
View file @
6ea76b1b
...
...
@@ -55,58 +55,19 @@ void vlTransformFilter::Execute()
//
// Loop over all points, updating position
//
newX
[
3
]
=
1.0
;
// Vector is in homogeneous coordinates
for
(
ptId
=
0
;
ptId
<
numPts
;
ptId
++
)
{
x
=
inPts
->
GetPoint
(
ptId
);
for
(
i
=
0
;
i
<
3
;
i
++
)
newX
[
i
]
=
x
[
i
];
trans
.
VectorMultiply
(
newX
,
newX
);
for
(
i
=
0
;
i
<
3
;
i
++
)
newX
[
i
]
/=
newX
[
3
];
//normalize
newPts
->
SetPoint
(
ptId
,
newX
);
}
trans
.
MultiplyPoints
(
inPts
,
newPts
);
//
// Push the matrix on the stack so we can take inverse/transpose. This
// matrix is used to transform vectors/normals.
//
this
->
Transform
->
Push
();
this
->
Transform
->
Inverse
();
this
->
Transform
->
Transpose
();
//
// Loop over all vectors
// Ditto for vectors and normals
//
if
(
inVectors
)
{
for
(
ptId
=
0
;
ptId
<
numPts
;
ptId
++
)
{
x
=
inVectors
->
GetVector
(
ptId
);
for
(
i
=
0
;
i
<
3
;
i
++
)
newX
[
i
]
=
x
[
i
];
trans
.
VectorMultiply
(
newX
,
newX
);
for
(
i
=
0
;
i
<
3
;
i
++
)
newX
[
i
]
/=
newX
[
3
];
//normalize
newVectors
->
SetVector
(
ptId
,
newX
);
}
trans
.
MultiplyVectors
(
inVectors
,
newVectors
);
}
//
// Loop over all normals
//
if
(
inNormals
)
{
for
(
ptId
=
0
;
ptId
<
numPts
;
ptId
++
)
{
x
=
inNormals
->
GetNormal
(
ptId
);
for
(
i
=
0
;
i
<
3
;
i
++
)
newX
[
i
]
=
x
[
i
];
trans
.
VectorMultiply
(
newX
,
newX
);
for
(
i
=
0
;
i
<
3
;
i
++
)
newX
[
i
]
/=
newX
[
3
];
//normalize
newNormals
->
SetNormal
(
ptId
,
newX
);
}
trans
.
MultiplyNormals
(
inNormals
,
newNormals
);
}
// restore transform
this
->
Transform
->
Push
();
//
// Update ourselves
//
...
...
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