Skip to content
GitLab
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
b43b1ce7
Commit
b43b1ce7
authored
Jul 09, 1994
by
Will Schroeder
Browse files
ERR: Misc bug fixes.
parent
a9a2e294
Changes
4
Hide whitespace changes
Inline
Side-by-side
include/DSMapper.hh
View file @
b43b1ce7
...
...
@@ -19,7 +19,8 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
#ifndef __vlDataSetMapper_h
#define __vlDataSetMapper_h
#include
"Mapper.hh"
#include
"GeomF.hh"
#include
"PolyMap.hh"
#include
"DataSet.hh"
#include
"Renderer.hh"
...
...
@@ -36,9 +37,9 @@ public:
virtual
vlDataSet
*
GetInput
();
protected:
int
CreateMapper
();
vlDataSet
*
Input
;
vlMapper
*
Mapper
;
vlGeometryFilter
*
GeometryExtractor
;
vlPolyMapper
*
PolyMapper
;
};
#endif
...
...
src/DSMapper.cc
View file @
b43b1ce7
...
...
@@ -14,17 +14,16 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
//
// Methods
for polygon
mapper
// Methods
to map abstract DataSet through concrete
mapper
s.
//
#include
"DSMapper.hh"
#include
"PolyMap.hh"
#include
"UGridMap.hh"
#include
"UPtsMap.hh"
vlDataSetMapper
::
vlDataSetMapper
()
{
this
->
Input
=
NULL
;
this
->
Mapper
=
NULL
;
this
->
GeometryExtractor
=
NULL
;
this
->
PolyMapper
=
NULL
;
}
vlDataSetMapper
::~
vlDataSetMapper
()
...
...
@@ -34,9 +33,14 @@ vlDataSetMapper::~vlDataSetMapper()
this
->
Input
->
UnRegister
(
this
);
}
if
(
this
->
Mappe
r
)
if
(
this
->
GeometryExtracto
r
)
{
this
->
Mapper
->
UnRegister
(
this
);
this
->
GeometryExtractor
->
UnRegister
(
this
);
}
if
(
this
->
PolyMapper
)
{
this
->
PolyMapper
->
UnRegister
(
this
);
}
}
...
...
@@ -82,76 +86,31 @@ void vlDataSetMapper::Render(vlRenderer *ren)
vlErrorMacro
(
<<
"No input!
\n
"
);
return
;
}
else
{
//
// Now can create appropriate mapper
//
if
(
this
->
CreateMapper
()
)
this
->
Mapper
->
Render
(
ren
);
}
}
int
vlDataSetMapper
::
CreateMapper
()
{
vlMapper
*
mapper
;
char
*
InputType
;
char
*
OldMapperType
=
NULL
;
InputType
=
this
->
Input
->
GetDataType
();
// if we have an old mapper get its type otherwise set it to none
if
(
this
->
Mapper
)
{
OldMapperType
=
this
->
Mapper
->
GetClassName
();
}
else
{
OldMapperType
=
"none"
;
}
if
(
!
strcmp
(
"vlPolyData"
,
InputType
))
{
if
(
strcmp
(
OldMapperType
,
"vlPolyMapper"
))
{
if
(
this
->
Mapper
)
this
->
Mapper
->
UnRegister
(
this
);
this
->
Mapper
=
new
vlPolyMapper
;
this
->
Mapper
->
Register
(
this
);
}
}
if
(
!
strcmp
(
"vlStructuredPoints"
,
InputType
))
if
(
this
->
PolyMapper
==
NULL
)
{
vlErrorMacro
(
<<
"Structured Points Mapper not supported"
);
}
vlGeometryFilter
*
gf
=
new
vlGeometryFilter
();
vlPolyMapper
*
pm
=
new
vlPolyMapper
;
pm
->
SetInput
(
gf
);
if
(
!
strcmp
(
"vlStructuredGrid"
,
InputType
))
{
vlErrorMacro
(
<<
"Structured Grid Mapper not supported"
);
}
this
->
GeometryExtractor
=
gf
;
this
->
GeometryExtractor
->
Register
(
this
);
if
(
!
strcmp
(
"vlUnstructuredGrid"
,
InputType
))
{
if
(
strcmp
(
OldMapperType
,
"vlUnstructuredGridMapper"
))
{
if
(
this
->
Mapper
)
this
->
Mapper
->
UnRegister
(
this
);
this
->
Mapper
=
new
vlUnstructuredGridMapper
;
this
->
Mapper
->
Register
(
this
);
}
this
->
PolyMapper
=
pm
;
this
->
PolyMapper
->
Register
(
this
);
}
// update ourselves in case something has changed
this
->
PolyMapper
->
SetLookupTable
(
this
->
GetLookupTable
());
this
->
PolyMapper
->
SetScalarsVisible
(
this
->
GetScalarsVisible
());
this
->
PolyMapper
->
SetScalarRange
(
this
->
GetScalarRange
());
if
(
!
strcmp
(
"vlUnstructuredPoints"
,
InputType
))
{
if
(
strcmp
(
OldMapperType
,
"vlUnstructuredPointsMapper"
))
{
if
(
this
->
Mapper
)
this
->
Mapper
->
UnRegister
(
this
);
this
->
Mapper
=
new
vlUnstructuredPointsMapper
;
this
->
Mapper
->
Register
(
this
);
}
}
this
->
GeometryExtractor
->
SetInput
(
this
->
Input
);
this
->
PolyMapper
->
Render
(
ren
);
return
1
;
}
}
void
vlDataSetMapper
::
PrintSelf
(
ostream
&
os
,
vlIndent
indent
)
{
...
...
@@ -168,14 +127,22 @@ void vlDataSetMapper::PrintSelf(ostream& os, vlIndent indent)
os
<<
indent
<<
"Input: (none)
\n
"
;
}
if
(
this
->
Mapper
)
if
(
this
->
PolyMapper
)
{
os
<<
indent
<<
"Poly Mapper: ("
<<
this
->
PolyMapper
<<
")
\n
"
;
}
else
{
os
<<
indent
<<
"Poly Mapper: (none)
\n
"
;
}
if
(
this
->
GeometryExtractor
)
{
os
<<
indent
<<
"Mapper: ("
<<
this
->
Mapper
<<
")
\n
"
;
os
<<
indent
<<
"Mapper type: "
<<
this
->
Mapper
->
GetClassName
()
<<
"
\n
"
;
os
<<
indent
<<
"Geometry Extractor: ("
<<
this
->
GeometryExtractor
<<
")
\n
"
;
}
else
{
os
<<
indent
<<
"
Mappe
r: (none)
\n
"
;
os
<<
indent
<<
"
Geometry Extracto
r: (none)
\n
"
;
}
}
}
src/Mapper.cc
View file @
b43b1ce7
...
...
@@ -37,18 +37,13 @@ vlMapper::~vlMapper()
void
vlMapper
::
operator
=
(
const
vlMapper
&
m
)
{
if
(
this
->
LookupTable
)
this
->
LookupTable
->
UnRegister
(
this
);
this
->
LookupTable
=
m
.
LookupTable
;
if
(
this
->
LookupTable
)
this
->
LookupTable
->
Register
(
this
);
this
->
SetLookupTable
(
m
.
LookupTable
);
this
->
ScalarsVisible
=
m
.
ScalarsVisible
;
this
->
ScalarRange
[
0
]
=
m
.
ScalarRange
[
0
];
this
->
ScalarRange
[
1
]
=
m
.
ScalarRange
[
1
];
this
->
SetScalarsVisible
(
m
.
ScalarsVisible
);
this
->
SetScalarRange
(
m
.
ScalarRange
[
0
],
m
.
ScalarRange
[
1
]);
this
->
StartRender
=
m
.
StartRender
;
this
->
EndRender
=
m
.
EndRender
;
this
->
Modified
();
this
->
SetStartRender
(
m
.
StartRender
);
this
->
SetEndRender
(
m
.
EndRender
);
}
void
vlMapper
::
SetStartRender
(
void
(
*
f
)())
...
...
src/PolyMap.cc
View file @
b43b1ce7
...
...
@@ -89,7 +89,7 @@ void vlPolyMapper::Render(vlRenderer *ren)
else
this
->
Input
->
Update
();
if
(
!
this
->
LookupTable
)
this
->
LookupTable
=
new
vlLookupTable
;
if
(
!
this
->
LookupTable
)
this
->
Set
LookupTable
(
new
vlLookupTable
)
;
this
->
LookupTable
->
Build
();
//
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment