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
3b837b58
Commit
3b837b58
authored
Mar 01, 1994
by
Will Schroeder
Browse files
Initial revision
parent
f319095c
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/Glyph3D.hh
0 → 100644
View file @
3b837b58
/*=========================================================================
Program: Visualization Library
Module: Glyph3D.hh
Language: C++
Date: $Date$
Version: $Revision$
Description:
---------------------------------------------------------------------------
This file is part of the Visualization Library. No part of this file
or its contents may be copied, reproduced or altered in any way
without the express written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
//
// Copy PolyData at every input point.
//
#ifndef __vlGlyph3D_h
#define __vlGlyph3D_h
#include "DS2PolyF.hh"
#define SCALE_BY_SCALAR 0
#define SCALE_BY_VECTOR 1
class
vlGlyph3D
:
public
vlDataSetToPolyFilter
{
public:
vlGlyph3D
();
~
vlGlyph3D
()
{};
char
*
GetClassName
()
{
return
"vlGlyph3D"
;};
void
PrintSelf
(
ostream
&
os
,
vlIndent
indent
);
vlSetMacro
(
Source
,
vlPolyData
*
);
vlGetMacro
(
Source
,
vlPolyData
*
);
vlBooleanMacro
(
Scaling
,
int
);
vlSetMacro
(
Scaling
,
int
);
vlGetMacro
(
Scaling
,
int
);
vlSetMacro
(
ScaleMode
,
int
);
vlGetMacro
(
ScaleMode
,
int
);
void
ScaleByScalar
()
{
this
->
SetScaleMode
(
SCALE_BY_SCALAR
);};
void
ScaleByVector
()
{
this
->
SetScaleMode
(
SCALE_BY_VECTOR
);};
vlSetMacro
(
ScaleFactor
,
float
);
vlGetMacro
(
ScaleFactor
,
float
);
vlSetVector2Macro
(
Range
,
float
);
vlGetVectorMacro
(
Range
,
float
);
protected:
void
Execute
();
vlPolyData
*
Source
;
int
Scaling
;
int
ScaleMode
;
float
ScaleFactor
;
float
Range
[
2
];
};
#endif
src/Glyph3D.cc
0 → 100644
View file @
3b837b58
/*=========================================================================
Program: Visualization Library
Module: Glyph3D.cc
Language: C++
Date: $Date$
Version: $Revision$
Description:
---------------------------------------------------------------------------
This file is part of the Visualization Library. No part of this file
or its contents may be copied, reproduced or altered in any way
without the express written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
#include "Glyph3D.hh"
vlGlyph3D
::
vlGlyph3D
()
{
this
->
Source
=
0
;
this
->
Scaling
=
1
;
this
->
ScaleMode
=
SCALE_BY_SCALAR
;
this
->
ScaleFactor
=
1.0
;
this
->
Range
[
0
]
=
0.0
;
this
->
Range
[
0
]
=
1.0
;
}
void
vlGlyph3D
::
PrintSelf
(
ostream
&
os
,
vlIndent
indent
)
{
}
void
vlGlyph3D
::
Execute
()
{
vlPointData
*
pd
;
vlScalars
*
inScalars
;
vlVectors
*
inVectors
;
int
numPts
;
int
i
;
vlPoints
*
sourcePts
;
vlCellArray
*
sourceVerts
;
vlCellArray
*
sourceLines
;
vlCellArray
*
sourcePolys
;
vlCellArray
*
sourceStrips
;
vlFloatPoints
*
newPts
;
vlCellArray
*
newVerts
;
vlCellArray
*
newLines
;
vlCellArray
*
newPolys
;
vlCellArray
*
newStrips
;
float
*
x
,
s
,
*
v
;
//
// Initialize
//
this
->
Initialize
();
pd
=
this
->
Input
->
GetPointData
();
inScalars
=
pd
->
GetScalars
();
inVectors
=
pd
->
GetVectors
();
numPts
=
this
->
Input
->
NumberOfPoints
();
if
(
!
this
->
Source
)
{
vlErrorMacro
(
<<
"No data to copy
\n
"
);
return
;
}
else
{
this
->
Source
->
Update
();
}
//
// Allocate storage for output PolyData
//
sourcePts
=
this
->
Source
->
GetPoints
();
sourceVerts
=
this
->
Source
->
GetVerts
();
sourceLines
=
this
->
Source
->
GetLines
();
sourcePolys
=
this
->
Source
->
GetPolys
();
sourceStrips
=
this
->
Source
->
GetStrips
();
newPts
=
new
vlFloatPoints
(
numPts
*
sourcePts
->
NumberOfPoints
());
newVerts
=
new
vlCellArray
(
numPts
*
sourceVerts
->
GetSize
());
newLines
=
new
vlCellArray
(
numPts
*
sourceLines
->
GetSize
());
newPolys
=
new
vlCellArray
(
numPts
*
sourcePolys
->
GetSize
());
newStrips
=
new
vlCellArray
(
numPts
*
sourceStrips
->
GetSize
());
//
// Traverse all points, copying data to point
//
for
(
i
=
0
;
i
<
numPts
;
i
++
)
{
x
=
this
->
Input
->
GetPoint
(
i
);
if
(
inScalars
)
s
=
inScalars
->
GetScalar
(
i
);
if
(
inVectors
)
v
=
inVectors
->
GetVector
(
i
);
}
//
// Update ourselves
//
this
->
SetPoints
(
newPts
);
this
->
SetVerts
(
newVerts
);
this
->
SetLines
(
newLines
);
this
->
SetPolys
(
newPolys
);
this
->
SetStrips
(
newStrips
);
}
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