Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VTK
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Michael Migliore
VTK
Commits
181138fb
Commit
181138fb
authored
Dec 16, 2003
by
Ken Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
double changes
parent
25d38506
Changes
87
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
87 changed files
with
1307 additions
and
1371 deletions
+1307
-1371
Common/vtkProp.h
Common/vtkProp.h
+13
-13
Common/vtkPropAssembly.cxx
Common/vtkPropAssembly.cxx
+23
-19
Common/vtkPropAssembly.h
Common/vtkPropAssembly.h
+2
-2
Common/vtkSystemIncludes.h
Common/vtkSystemIncludes.h
+6
-0
Common/vtkTransform.h
Common/vtkTransform.h
+5
-5
Graphics/vtkConeSource.cxx
Graphics/vtkConeSource.cxx
+7
-7
Graphics/vtkConeSource.h
Graphics/vtkConeSource.h
+14
-14
Graphics/vtkCursor3D.cxx
Graphics/vtkCursor3D.cxx
+8
-8
Graphics/vtkCursor3D.h
Graphics/vtkCursor3D.h
+10
-10
Graphics/vtkLineSource.cxx
Graphics/vtkLineSource.cxx
+3
-3
Graphics/vtkLineSource.h
Graphics/vtkLineSource.h
+6
-6
Graphics/vtkPlaneSource.cxx
Graphics/vtkPlaneSource.cxx
+23
-23
Graphics/vtkPlaneSource.h
Graphics/vtkPlaneSource.h
+21
-21
Graphics/vtkSphereSource.cxx
Graphics/vtkSphereSource.cxx
+7
-7
Graphics/vtkSphereSource.h
Graphics/vtkSphereSource.h
+18
-18
Hybrid/Testing/Cxx/ImagePlaneWidget.cxx
Hybrid/Testing/Cxx/ImagePlaneWidget.cxx
+1
-1
Hybrid/Testing/Cxx/TestSplineWidget.cxx
Hybrid/Testing/Cxx/TestSplineWidget.cxx
+1
-1
Hybrid/vtk3DWidget.cxx
Hybrid/vtk3DWidget.cxx
+11
-16
Hybrid/vtk3DWidget.h
Hybrid/vtk3DWidget.h
+13
-13
Hybrid/vtkBoxWidget.cxx
Hybrid/vtkBoxWidget.cxx
+8
-8
Hybrid/vtkBoxWidget.h
Hybrid/vtkBoxWidget.h
+3
-3
Hybrid/vtkCubeAxesActor2D.cxx
Hybrid/vtkCubeAxesActor2D.cxx
+26
-29
Hybrid/vtkCubeAxesActor2D.h
Hybrid/vtkCubeAxesActor2D.h
+16
-16
Hybrid/vtkImagePlaneWidget.cxx
Hybrid/vtkImagePlaneWidget.cxx
+184
-172
Hybrid/vtkImagePlaneWidget.h
Hybrid/vtkImagePlaneWidget.h
+34
-34
Hybrid/vtkImplicitPlaneWidget.cxx
Hybrid/vtkImplicitPlaneWidget.cxx
+8
-8
Hybrid/vtkImplicitPlaneWidget.h
Hybrid/vtkImplicitPlaneWidget.h
+4
-4
Hybrid/vtkLineWidget.cxx
Hybrid/vtkLineWidget.cxx
+38
-40
Hybrid/vtkLineWidget.h
Hybrid/vtkLineWidget.h
+15
-15
Hybrid/vtkPlaneWidget.cxx
Hybrid/vtkPlaneWidget.cxx
+122
-114
Hybrid/vtkPlaneWidget.h
Hybrid/vtkPlaneWidget.h
+24
-24
Hybrid/vtkPointWidget.cxx
Hybrid/vtkPointWidget.cxx
+14
-14
Hybrid/vtkPointWidget.h
Hybrid/vtkPointWidget.h
+10
-10
Hybrid/vtkPolyDataSourceWidget.cxx
Hybrid/vtkPolyDataSourceWidget.cxx
+3
-10
Hybrid/vtkPolyDataSourceWidget.h
Hybrid/vtkPolyDataSourceWidget.h
+3
-3
Hybrid/vtkSphereWidget.cxx
Hybrid/vtkSphereWidget.cxx
+17
-17
Hybrid/vtkSphereWidget.h
Hybrid/vtkSphereWidget.h
+15
-15
Hybrid/vtkSplineWidget.cxx
Hybrid/vtkSplineWidget.cxx
+67
-66
Hybrid/vtkSplineWidget.h
Hybrid/vtkSplineWidget.h
+14
-14
Parallel/vtkCompositeManager.cxx
Parallel/vtkCompositeManager.cxx
+9
-8
Parallel/vtkCompositeManager.h
Parallel/vtkCompositeManager.h
+2
-2
Parallel/vtkParallelRenderManager.cxx
Parallel/vtkParallelRenderManager.cxx
+19
-18
Parallel/vtkParallelRenderManager.h
Parallel/vtkParallelRenderManager.h
+3
-3
Rendering/vtkAbstractMapper3D.cxx
Rendering/vtkAbstractMapper3D.cxx
+7
-7
Rendering/vtkAbstractMapper3D.h
Rendering/vtkAbstractMapper3D.h
+7
-7
Rendering/vtkAbstractVolumeMapper.cxx
Rendering/vtkAbstractVolumeMapper.cxx
+6
-14
Rendering/vtkAbstractVolumeMapper.h
Rendering/vtkAbstractVolumeMapper.h
+3
-3
Rendering/vtkActor.cxx
Rendering/vtkActor.cxx
+12
-14
Rendering/vtkActor.h
Rendering/vtkActor.h
+4
-4
Rendering/vtkAssembly.cxx
Rendering/vtkAssembly.cxx
+15
-15
Rendering/vtkAssembly.h
Rendering/vtkAssembly.h
+2
-2
Rendering/vtkCamera.cxx
Rendering/vtkCamera.cxx
+3
-3
Rendering/vtkCamera.h
Rendering/vtkCamera.h
+2
-2
Rendering/vtkFrustumCoverageCuller.cxx
Rendering/vtkFrustumCoverageCuller.cxx
+2
-2
Rendering/vtkIVExporter.cxx
Rendering/vtkIVExporter.cxx
+12
-11
Rendering/vtkImageActor.cxx
Rendering/vtkImageActor.cxx
+6
-6
Rendering/vtkImageActor.h
Rendering/vtkImageActor.h
+3
-3
Rendering/vtkInteractorStyle.cxx
Rendering/vtkInteractorStyle.cxx
+2
-5
Rendering/vtkInteractorStyleFlight.cxx
Rendering/vtkInteractorStyleFlight.cxx
+3
-3
Rendering/vtkInteractorStyleJoystickActor.cxx
Rendering/vtkInteractorStyleJoystickActor.cxx
+7
-24
Rendering/vtkInteractorStyleJoystickActor.h
Rendering/vtkInteractorStyleJoystickActor.h
+1
-7
Rendering/vtkInteractorStyleTerrain.cxx
Rendering/vtkInteractorStyleTerrain.cxx
+5
-5
Rendering/vtkInteractorStyleTrackballActor.cxx
Rendering/vtkInteractorStyleTrackballActor.cxx
+8
-21
Rendering/vtkInteractorStyleTrackballActor.h
Rendering/vtkInteractorStyleTrackballActor.h
+2
-8
Rendering/vtkInteractorStyleUnicam.cxx
Rendering/vtkInteractorStyleUnicam.cxx
+3
-9
Rendering/vtkLODProp3D.cxx
Rendering/vtkLODProp3D.cxx
+28
-28
Rendering/vtkLODProp3D.h
Rendering/vtkLODProp3D.h
+32
-30
Rendering/vtkMapper.cxx
Rendering/vtkMapper.cxx
+12
-19
Rendering/vtkMapper.h
Rendering/vtkMapper.h
+10
-10
Rendering/vtkOOGLExporter.cxx
Rendering/vtkOOGLExporter.cxx
+2
-2
Rendering/vtkOpenGLImageActor.cxx
Rendering/vtkOpenGLImageActor.cxx
+2
-2
Rendering/vtkOpenGLPolyDataMapper.cxx
Rendering/vtkOpenGLPolyDataMapper.cxx
+2
-2
Rendering/vtkPicker.cxx
Rendering/vtkPicker.cxx
+4
-9
Rendering/vtkPolyDataMapper.cxx
Rendering/vtkPolyDataMapper.cxx
+7
-14
Rendering/vtkPolyDataMapper.h
Rendering/vtkPolyDataMapper.h
+3
-3
Rendering/vtkProp3D.cxx
Rendering/vtkProp3D.cxx
+49
-58
Rendering/vtkProp3D.h
Rendering/vtkProp3D.h
+36
-36
Rendering/vtkRenderer.cxx
Rendering/vtkRenderer.cxx
+32
-34
Rendering/vtkRenderer.h
Rendering/vtkRenderer.h
+28
-26
Rendering/vtkUnstructuredGridVolumeRayCastMapper.cxx
Rendering/vtkUnstructuredGridVolumeRayCastMapper.cxx
+8
-8
Rendering/vtkUnstructuredGridVolumeRayCastMapper.h
Rendering/vtkUnstructuredGridVolumeRayCastMapper.h
+2
-2
Rendering/vtkVRMLExporter.cxx
Rendering/vtkVRMLExporter.cxx
+14
-13
Rendering/vtkVolume.cxx
Rendering/vtkVolume.cxx
+17
-12
Rendering/vtkVolume.h
Rendering/vtkVolume.h
+8
-8
Rendering/vtkVolumeRayCastMapper.cxx
Rendering/vtkVolumeRayCastMapper.cxx
+4
-4
Rendering/vtkVolumeRayCastMapper.h
Rendering/vtkVolumeRayCastMapper.h
+1
-1
Wrapping/hints
Wrapping/hints
+41
-41
No files found.
Common/vtkProp.h
View file @
181138fb
...
...
@@ -86,7 +86,7 @@ public:
// Description:
// Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
// in world coordinates. NULL means that the bounds are not defined.
virtual
float
*
GetBounds
()
{
return
NULL
;}
virtual
double
*
GetBounds
()
{
return
NULL
;}
// Description:
// Shallow copy of this vtkProp.
...
...
@@ -150,9 +150,9 @@ public:
// the time. We need the viewport for viewing parameters that affect timing.
// The no-arguments version simply returns the value of the variable with
// no estimation.
virtual
float
GetEstimatedRenderTime
(
vtkViewport
*
)
virtual
double
GetEstimatedRenderTime
(
vtkViewport
*
)
{
return
this
->
EstimatedRenderTime
;
}
virtual
float
GetEstimatedRenderTime
(){
return
this
->
EstimatedRenderTime
;
}
virtual
double
GetEstimatedRenderTime
(){
return
this
->
EstimatedRenderTime
;
}
// Description:
// WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE
...
...
@@ -160,7 +160,7 @@ public:
// This method is used by, for example, the vtkLODProp3D in order to
// initialize the estimated render time at start-up to some user defined
// value.
virtual
void
SetEstimatedRenderTime
(
float
t
)
virtual
void
SetEstimatedRenderTime
(
double
t
)
{
this
->
EstimatedRenderTime
=
t
;
this
->
SavedEstimatedRenderTime
=
t
;}
// Description:
...
...
@@ -186,7 +186,7 @@ public:
// really a modification to the object. (For example, we don't want
// to rebuild matrices at every render because the estimated render time
// is changing)
virtual
void
AddEstimatedRenderTime
(
float
t
,
vtkViewport
*
vtkNotUsed
(
vp
))
virtual
void
AddEstimatedRenderTime
(
double
t
,
vtkViewport
*
vtkNotUsed
(
vp
))
{
this
->
EstimatedRenderTime
+=
t
;}
// Description:
...
...
@@ -198,7 +198,7 @@ public:
// A side effect of this method is to reset the EstimatedRenderTime to
// 0.0. This way, each of the ways that this prop may be rendered can
// be timed and added together into this value.
virtual
void
SetAllocatedRenderTime
(
float
t
,
vtkViewport
*
vtkNotUsed
(
v
))
virtual
void
SetAllocatedRenderTime
(
double
t
,
vtkViewport
*
vtkNotUsed
(
v
))
{
this
->
AllocatedRenderTime
=
t
;
this
->
SavedEstimatedRenderTime
=
this
->
EstimatedRenderTime
;
...
...
@@ -208,7 +208,7 @@ public:
// Description:
// WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE
// DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS
vtkGetMacro
(
AllocatedRenderTime
,
float
);
vtkGetMacro
(
AllocatedRenderTime
,
double
);
// Description:
// WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE
...
...
@@ -216,8 +216,8 @@ public:
// Get/Set the multiplier for the render time. This is used
// for culling and is a number between 0 and 1. It is used
// to create the allocated render time value.
void
SetRenderTimeMultiplier
(
float
t
)
{
this
->
RenderTimeMultiplier
=
t
;
}
vtkGetMacro
(
RenderTimeMultiplier
,
float
);
void
SetRenderTimeMultiplier
(
double
t
)
{
this
->
RenderTimeMultiplier
=
t
;
}
vtkGetMacro
(
RenderTimeMultiplier
,
double
);
// Description:
// WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE
...
...
@@ -246,10 +246,10 @@ protected:
int
Pickable
;
int
Dragable
;
float
AllocatedRenderTime
;
float
EstimatedRenderTime
;
float
SavedEstimatedRenderTime
;
float
RenderTimeMultiplier
;
double
AllocatedRenderTime
;
double
EstimatedRenderTime
;
double
SavedEstimatedRenderTime
;
double
RenderTimeMultiplier
;
// how many consumers does this object have
int
NumberOfConsumers
;
...
...
Common/vtkPropAssembly.cxx
View file @
181138fb
...
...
@@ -17,20 +17,20 @@
#include "vtkAssemblyNode.h"
#include "vtkAssemblyPath.h"
#include "vtkAssemblyPaths.h"
#include "vtkMath.h"
#include "vtkObjectFactory.h"
#include "vtkProp.h"
#include "vtkPropCollection.h"
#include "vtkViewport.h"
vtkCxxRevisionMacro
(
vtkPropAssembly
,
"1.2
2
"
);
vtkCxxRevisionMacro
(
vtkPropAssembly
,
"1.2
3
"
);
vtkStandardNewMacro
(
vtkPropAssembly
);
// Construct object with no children.
vtkPropAssembly
::
vtkPropAssembly
()
{
this
->
Parts
=
vtkPropCollection
::
New
();
this
->
Bounds
[
0
]
=
this
->
Bounds
[
2
]
=
this
->
Bounds
[
4
]
=
VTK_LARGE_FLOAT
;
this
->
Bounds
[
1
]
=
this
->
Bounds
[
3
]
=
this
->
Bounds
[
5
]
=
-
VTK_LARGE_FLOAT
;
vtkMath
::
UninitializeBounds
(
this
->
Bounds
);
}
vtkPropAssembly
::~
vtkPropAssembly
()
...
...
@@ -70,11 +70,11 @@ int vtkPropAssembly::RenderTranslucentGeometry(vtkViewport *ren)
{
vtkProp
*
prop
;
vtkAssemblyPath
*
path
;
float
fraction
;
double
fraction
;
int
renderedSomething
=
0
;
fraction
=
this
->
AllocatedRenderTime
/
(
float
)
this
->
Parts
->
GetNumberOfItems
();
(
double
)
this
->
Parts
->
GetNumberOfItems
();
// render the Paths
for
(
this
->
Paths
->
InitTraversal
();
(
path
=
this
->
Paths
->
GetNextItem
());
)
...
...
@@ -97,14 +97,14 @@ int vtkPropAssembly::RenderOpaqueGeometry(vtkViewport *ren)
{
vtkProp
*
prop
;
vtkAssemblyPath
*
path
;
float
fraction
;
double
fraction
;
int
renderedSomething
=
0
;
// Make sure the paths are up-to-date
this
->
UpdatePaths
();
fraction
=
this
->
AllocatedRenderTime
/
(
float
)
this
->
Parts
->
GetNumberOfItems
();
(
double
)
this
->
Parts
->
GetNumberOfItems
();
// render the Paths
for
(
this
->
Paths
->
InitTraversal
();
(
path
=
this
->
Paths
->
GetNextItem
());
)
...
...
@@ -127,14 +127,14 @@ int vtkPropAssembly::RenderOverlay(vtkViewport *ren)
{
vtkProp
*
prop
;
vtkAssemblyPath
*
path
;
float
fraction
;
double
fraction
;
int
renderedSomething
=
0
;
// Make sure the paths are up-to-date
this
->
UpdatePaths
();
fraction
=
this
->
AllocatedRenderTime
/
(
float
)
this
->
Parts
->
GetNumberOfItems
();
(
double
)
this
->
Parts
->
GetNumberOfItems
();
for
(
this
->
Paths
->
InitTraversal
();
(
path
=
this
->
Paths
->
GetNextItem
());
)
{
...
...
@@ -166,28 +166,32 @@ void vtkPropAssembly::ReleaseGraphicsResources(vtkWindow *renWin)
}
// Get the bounds for the assembly as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
float
*
vtkPropAssembly
::
GetBounds
()
double
*
vtkPropAssembly
::
GetBounds
()
{
vtkProp
*
part
;
int
i
,
n
;
float
*
bounds
,
bbox
[
24
];
double
*
bounds
,
bbox
[
24
];
int
partVisible
=
0
;
this
->
Bounds
[
0
]
=
this
->
Bounds
[
2
]
=
this
->
Bounds
[
4
]
=
VTK_LARGE_FLOAT
;
this
->
Bounds
[
1
]
=
this
->
Bounds
[
3
]
=
this
->
Bounds
[
5
]
=
-
VTK_LARGE_FLOAT
;
// carefully compute the bounds
for
(
this
->
Parts
->
InitTraversal
();
(
part
=
this
->
Parts
->
GetNextProp
());
)
{
if
(
part
->
GetVisibility
()
)
{
bounds
=
part
->
GetBounds
();
if
(
bounds
!=
NULL
)
{
// For the purposes of GetBounds, an object is visisble only if
// its visibility is on and it has visible parts.
partVisible
=
1
;
if
(
!
partVisible
)
{
// initialize the bounds
this
->
Bounds
[
0
]
=
this
->
Bounds
[
2
]
=
this
->
Bounds
[
4
]
=
VTK_DOUBLE_MAX
;
this
->
Bounds
[
1
]
=
this
->
Bounds
[
3
]
=
this
->
Bounds
[
5
]
=
-
VTK_DOUBLE_MAX
;
partVisible
=
1
;
}
// fill out vertices of a bounding box
bbox
[
0
]
=
bounds
[
1
];
bbox
[
1
]
=
bounds
[
3
];
bbox
[
2
]
=
bounds
[
5
];
bbox
[
3
]
=
bounds
[
1
];
bbox
[
4
]
=
bounds
[
2
];
bbox
[
5
]
=
bounds
[
5
];
...
...
@@ -197,7 +201,7 @@ float *vtkPropAssembly::GetBounds()
bbox
[
15
]
=
bounds
[
1
];
bbox
[
16
]
=
bounds
[
2
];
bbox
[
17
]
=
bounds
[
4
];
bbox
[
18
]
=
bounds
[
0
];
bbox
[
19
]
=
bounds
[
2
];
bbox
[
20
]
=
bounds
[
4
];
bbox
[
21
]
=
bounds
[
0
];
bbox
[
22
]
=
bounds
[
3
];
bbox
[
23
]
=
bounds
[
4
];
for
(
i
=
0
;
i
<
8
;
i
++
)
{
for
(
n
=
0
;
n
<
3
;
n
++
)
...
...
@@ -215,7 +219,7 @@ float *vtkPropAssembly::GetBounds()
}
//if bounds
}
//for each part
}
//for each part
if
(
!
partVisible
)
{
return
NULL
;
...
...
Common/vtkPropAssembly.h
View file @
181138fb
...
...
@@ -82,7 +82,7 @@ public:
// Description:
// Get the bounds for this prop assembly as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
// May return NULL in some cases (meaning the bounds is undefined).
float
*
GetBounds
();
double
*
GetBounds
();
// Description:
// Shallow copy of this vtkPropAssembly.
...
...
@@ -119,7 +119,7 @@ protected:
~
vtkPropAssembly
();
vtkPropCollection
*
Parts
;
float
Bounds
[
6
];
double
Bounds
[
6
];
// Support the BuildPaths() method,
vtkTimeStamp
PathTime
;
...
...
Common/vtkSystemIncludes.h
View file @
181138fb
...
...
@@ -40,6 +40,12 @@
# include "vtkIOStream.h" // Include the real C++ streams.
#endif
// define the type of floating point interface used for old and new versions
// of VTK VTK42 and older use float and VTK 44 and newer use double for most
// of the API calls
#define vtkFloatingPointType vtkFloatingPointType
typedef
double
vtkFloatingPointType
;
#define __VTK_SYSTEM_INCLUDES__INSIDE
#include "vtkIdType.h" // Define vtkIdType and its stream operators.
#include "vtkOStreamWrapper.h" // Include the ostream wrapper.
...
...
Common/vtkTransform.h
View file @
181138fb
...
...
@@ -181,7 +181,7 @@ class VTK_COMMON_EXPORT vtkTransform : public vtkLinearTransform
orient
[
0
]
=
static_cast
<
float
>
(
temp
[
0
]);
orient
[
1
]
=
static_cast
<
float
>
(
temp
[
1
]);
orient
[
2
]
=
static_cast
<
float
>
(
temp
[
2
]);
};
float
*
GetOrientation
()
{
double
*
GetOrientation
()
{
this
->
GetOrientation
(
this
->
ReturnValue
);
return
this
->
ReturnValue
;
};
// Description:
...
...
@@ -193,7 +193,7 @@ class VTK_COMMON_EXPORT vtkTransform : public vtkLinearTransform
wxyz
[
1
]
=
static_cast
<
float
>
(
temp
[
1
]);
wxyz
[
2
]
=
static_cast
<
float
>
(
temp
[
2
]);
wxyz
[
3
]
=
static_cast
<
float
>
(
temp
[
3
]);};
float
*
GetOrientationWXYZ
()
{
double
*
GetOrientationWXYZ
()
{
this
->
GetOrientationWXYZ
(
this
->
ReturnValue
);
return
this
->
ReturnValue
;
};
// Description:
...
...
@@ -206,7 +206,7 @@ class VTK_COMMON_EXPORT vtkTransform : public vtkLinearTransform
pos
[
0
]
=
static_cast
<
float
>
(
temp
[
0
]);
pos
[
1
]
=
static_cast
<
float
>
(
temp
[
1
]);
pos
[
2
]
=
static_cast
<
float
>
(
temp
[
2
]);
};
float
*
GetPosition
()
{
double
*
GetPosition
()
{
this
->
GetPosition
(
this
->
ReturnValue
);
return
this
->
ReturnValue
;
};
// Description:
...
...
@@ -220,7 +220,7 @@ class VTK_COMMON_EXPORT vtkTransform : public vtkLinearTransform
scale
[
0
]
=
static_cast
<
float
>
(
temp
[
0
]);
scale
[
1
]
=
static_cast
<
float
>
(
temp
[
1
]);
scale
[
2
]
=
static_cast
<
float
>
(
temp
[
2
]);
};
float
*
GetScale
()
{
double
*
GetScale
()
{
this
->
GetScale
(
this
->
ReturnValue
);
return
this
->
ReturnValue
;
};
// Description:
...
...
@@ -316,7 +316,7 @@ protected:
float
Point
[
4
];
double
DoublePoint
[
4
];
float
ReturnValue
[
4
];
double
ReturnValue
[
4
];
private:
vtkTransform
(
const
vtkTransform
&
);
// Not implemented
void
operator
=
(
const
vtkTransform
&
);
// Not implemented
...
...
Graphics/vtkConeSource.cxx
View file @
181138fb
...
...
@@ -23,7 +23,7 @@
#include <math.h>
vtkCxxRevisionMacro
(
vtkConeSource
,
"1.6
4
"
);
vtkCxxRevisionMacro
(
vtkConeSource
,
"1.6
5
"
);
vtkStandardNewMacro
(
vtkConeSource
);
//----------------------------------------------------------------------------
...
...
@@ -49,9 +49,9 @@ vtkConeSource::vtkConeSource(int res)
//----------------------------------------------------------------------------
void
vtkConeSource
::
Execute
()
{
float
angle
;
double
angle
;
int
numLines
,
numPolys
,
numPts
;
float
x
[
3
],
xbot
;
double
x
[
3
],
xbot
;
int
i
;
vtkIdType
pts
[
VTK_CELL_SIZE
];
vtkPoints
*
newPoints
;
...
...
@@ -230,8 +230,8 @@ void vtkConeSource::Execute()
{
vtkTransform
*
t
=
vtkTransform
::
New
();
t
->
Translate
(
this
->
Center
[
0
],
this
->
Center
[
1
],
this
->
Center
[
2
]);
float
vMag
=
vtkMath
::
Norm
(
this
->
Direction
);
t
->
RotateWXYZ
((
float
)
180.0
,
(
this
->
Direction
[
0
]
+
vMag
)
/
2.0
,
double
vMag
=
vtkMath
::
Norm
(
this
->
Direction
);
t
->
RotateWXYZ
((
double
)
180.0
,
(
this
->
Direction
[
0
]
+
vMag
)
/
2.0
,
this
->
Direction
[
1
]
/
2.0
,
this
->
Direction
[
2
]
/
2.0
);
float
*
ipts
=
((
vtkFloatArray
*
)
newPoints
->
GetData
())
->
GetPointer
(
0
);
for
(
i
=
0
;
i
<
numPts
;
i
++
,
ipts
+=
3
)
...
...
@@ -268,13 +268,13 @@ void vtkConeSource::ExecuteInformation()
//----------------------------------------------------------------------------
void
vtkConeSource
::
SetAngle
(
float
angle
)
void
vtkConeSource
::
SetAngle
(
double
angle
)
{
this
->
SetRadius
(
this
->
Height
*
tan
((
double
)
angle
*
vtkMath
::
DegreesToRadians
()));
}
//----------------------------------------------------------------------------
float
vtkConeSource
::
GetAngle
()
double
vtkConeSource
::
GetAngle
()
{
return
atan2
(
this
->
Radius
,
this
->
Height
)
/
vtkMath
::
DegreesToRadians
();
}
...
...
Graphics/vtkConeSource.h
View file @
181138fb
...
...
@@ -46,13 +46,13 @@ public:
// Description:
// Set the height of the cone. This is the height along the cone in
// its specified direction.
vtkSetClampMacro
(
Height
,
float
,
0.0
,
VTK_LARGE_FLOAT
)
vtkGetMacro
(
Height
,
float
);
vtkSetClampMacro
(
Height
,
double
,
0.0
,
VTK_DOUBLE_MAX
)
vtkGetMacro
(
Height
,
double
);
// Description:
// Set the base radius of the cone.
vtkSetClampMacro
(
Radius
,
float
,
0.0
,
VTK_LARGE_FLOAT
)
vtkGetMacro
(
Radius
,
float
);
vtkSetClampMacro
(
Radius
,
double
,
0.0
,
VTK_DOUBLE_MAX
)
vtkGetMacro
(
Radius
,
double
);
// Description:
// Set the number of facets used to represent the cone.
...
...
@@ -61,21 +61,21 @@ public:
// Description:
// Set the center of the cone. The default is 0,0,0.
vtkSetVector3Macro
(
Center
,
float
);
vtkGetVectorMacro
(
Center
,
float
,
3
);
vtkSetVector3Macro
(
Center
,
double
);
vtkGetVectorMacro
(
Center
,
double
,
3
);
// Description:
// Set the orientation vector of the cone. The vector does not have
// to be normalized. The cone will point in the Direction specified.
// The default is (1,0,0).
vtkSetVector3Macro
(
Direction
,
float
);
vtkGetVectorMacro
(
Direction
,
float
,
3
);
vtkSetVector3Macro
(
Direction
,
double
);
vtkGetVectorMacro
(
Direction
,
double
,
3
);
// Description:
// Set the angle of the cone. As a side effect, the angle plus height sets
// the base radius of the cone.
void
SetAngle
(
float
angle
);
float
GetAngle
();
void
SetAngle
(
double
angle
);
double
GetAngle
();
// Description:
// Turn on/off whether to cap the base of the cone with a polygon.
...
...
@@ -90,12 +90,12 @@ protected:
void
Execute
();
void
ExecuteInformation
();
float
Height
;
float
Radius
;
double
Height
;
double
Radius
;
int
Resolution
;
int
Capping
;
float
Center
[
3
];
float
Direction
[
3
];
double
Center
[
3
];
double
Direction
[
3
];
private:
vtkConeSource
(
const
vtkConeSource
&
);
// Not implemented.
...
...
Graphics/vtkCursor3D.cxx
View file @
181138fb
...
...
@@ -20,7 +20,7 @@
#include <math.h>
vtkCxxRevisionMacro
(
vtkCursor3D
,
"1.4
2
"
);
vtkCxxRevisionMacro
(
vtkCursor3D
,
"1.4
3
"
);
vtkStandardNewMacro
(
vtkCursor3D
);
// Construct with model bounds = (-1,1,-1,1,-1,1), focal point = (0,0,0),
...
...
@@ -67,7 +67,7 @@ void vtkCursor3D::Execute()
int
numPts
=
0
,
numLines
=
0
;
vtkPoints
*
newPts
;
vtkCellArray
*
newLines
;
float
x
[
3
];
double
x
[
3
];
vtkIdType
ptIds
[
2
];
vtkPolyData
*
output
=
this
->
GetOutput
();
...
...
@@ -389,9 +389,9 @@ void vtkCursor3D::Execute()
}
// Set the boundary of the 3D cursor.
void
vtkCursor3D
::
SetModelBounds
(
float
xmin
,
float
xmax
,
float
ymin
,
float
ymax
,
float
zmin
,
float
zmax
)
void
vtkCursor3D
::
SetModelBounds
(
double
xmin
,
double
xmax
,
double
ymin
,
double
ymax
,
double
zmin
,
double
zmax
)
{
if
(
xmin
!=
this
->
ModelBounds
[
0
]
||
xmax
!=
this
->
ModelBounds
[
1
]
||
ymin
!=
this
->
ModelBounds
[
2
]
||
ymax
!=
this
->
ModelBounds
[
3
]
||
...
...
@@ -413,7 +413,7 @@ void vtkCursor3D::SetModelBounds(float xmin, float xmax,
}
}
void
vtkCursor3D
::
SetFocalPoint
(
float
x
[
3
])
void
vtkCursor3D
::
SetFocalPoint
(
double
x
[
3
])
{
if
(
x
[
0
]
==
this
->
FocalPoint
[
0
]
&&
x
[
1
]
==
this
->
FocalPoint
[
1
]
&&
x
[
2
]
==
this
->
FocalPoint
[
2
]
)
...
...
@@ -423,7 +423,7 @@ void vtkCursor3D::SetFocalPoint(float x[3])
this
->
Modified
();
float
v
[
3
];
double
v
[
3
];
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
v
[
i
]
=
x
[
i
]
-
this
->
FocalPoint
[
i
];
...
...
@@ -454,7 +454,7 @@ void vtkCursor3D::SetFocalPoint(float x[3])
}
}
void
vtkCursor3D
::
SetModelBounds
(
float
bounds
[
6
])
void
vtkCursor3D
::
SetModelBounds
(
double
bounds
[
6
])
{
this
->
SetModelBounds
(
bounds
[
0
],
bounds
[
1
],
bounds
[
2
],
bounds
[
3
],
bounds
[
4
],
bounds
[
5
]);
...
...
Graphics/vtkCursor3D.h
View file @
181138fb
...
...
@@ -42,10 +42,10 @@ public:
// Description:
// Set / get the boundary of the 3D cursor.
void
SetModelBounds
(
float
xmin
,
float
xmax
,
float
ymin
,
float
ymax
,
float
zmin
,
float
zmax
);
void
SetModelBounds
(
float
bounds
[
6
]);
vtkGetVectorMacro
(
ModelBounds
,
float
,
6
);
void
SetModelBounds
(
double
xmin
,
double
xmax
,
double
ymin
,
double
ymax
,
double
zmin
,
double
zmax
);
void
SetModelBounds
(
double
bounds
[
6
]);
vtkGetVectorMacro
(
ModelBounds
,
double
,
6
);
// Description:
// Set/Get the position of cursor focus. If translation mode is on,
...
...
@@ -53,14 +53,14 @@ public:
// is translated. Otherwise, the focal point will either be clamped to the
// bounding box, or wrapped, if Wrap is on. (Note: this behavior requires
// that the bounding box is set prior to the focal point.)
void
SetFocalPoint
(
float
x
[
3
]);
void
SetFocalPoint
(
float
x
,
float
y
,
float
z
)
void
SetFocalPoint
(
double
x
[
3
]);
void
SetFocalPoint
(
double
x
,
double
y
,
double
z
)
{
float
xyz
[
3
];
double
xyz
[
3
];
xyz
[
0
]
=
x
;
xyz
[
1
]
=
y
;
xyz
[
2
]
=
z
;
this
->
SetFocalPoint
(
xyz
);
}
vtkGetVectorMacro
(
FocalPoint
,
float
,
3
);
vtkGetVectorMacro
(
FocalPoint
,
double
,
3
);
// Description:
// Turn on/off the wireframe bounding box.
...
...
@@ -124,8 +124,8 @@ protected:
void
Execute
();
vtkPolyData
*
Focus
;
float
ModelBounds
[
6
];
float
FocalPoint
[
3
];
double
ModelBounds
[
6
];
double
FocalPoint
[
3
];
int
Outline
;
int
Axes
;
int
XShadows
;
...
...
Graphics/vtkLineSource.cxx
View file @
181138fb
...
...
@@ -22,7 +22,7 @@
#include "vtkPolyData.h"
#include <math.h>
vtkCxxRevisionMacro
(
vtkLineSource
,
"1.4
3
"
);
vtkCxxRevisionMacro
(
vtkLineSource
,
"1.4
4
"
);
vtkStandardNewMacro
(
vtkLineSource
);
vtkLineSource
::
vtkLineSource
(
int
res
)
...
...
@@ -42,7 +42,7 @@ void vtkLineSource::Execute()
{
int
numLines
=
this
->
Resolution
;
int
numPts
=
this
->
Resolution
+
1
;
float
x
[
3
],
tc
[
3
],
v
[
3
];
double
x
[
3
],
tc
[
3
],
v
[
3
];
int
i
,
j
;
vtkPoints
*
newPoints
;
vtkFloatArray
*
newTCoords
;
...
...
@@ -71,7 +71,7 @@ void vtkLineSource::Execute()
tc
[
2
]
=
0.0
;
for
(
i
=
0
;
i
<
numPts
;
i
++
)
{
tc
[
0
]
=
((
float
)
i
/
this
->
Resolution
);
tc
[
0
]
=
((
double
)
i
/
this
->
Resolution
);
for
(
j
=
0
;
j
<
3
;
j
++
)
{
x
[
j
]
=
this
->
Point1
[
j
]
+
tc
[
0
]
*
v
[
j
];
...
...
Graphics/vtkLineSource.h
View file @
181138fb
...
...
@@ -32,13 +32,13 @@ public:
// Description:
// Set position of first end point.
vtkSetVector3Macro
(
Point1
,
float
);
vtkGetVectorMacro
(
Point1
,
float
,
3
);
vtkSetVector3Macro
(
Point1
,
double
);
vtkGetVectorMacro
(
Point1
,
double
,
3
);
// Description:
// Set position of other end point.
vtkSetVector3Macro
(
Point2
,
float
);
vtkGetVectorMacro
(
Point2
,
float
,
3
);
vtkSetVector3Macro
(
Point2
,
double
);
vtkGetVectorMacro
(
Point2
,
double
,
3
);
// Description:
// Divide line into resolution number of pieces.
...
...
@@ -50,8 +50,8 @@ protected:
~
vtkLineSource
()
{};
void
Execute
();
float
Point1
[
3
];
float
Point2
[
3
];
double
Point1
[
3
];
double
Point2
[
3
];
int
Resolution
;
private:
vtkLineSource
(
const
vtkLineSource
&
);
// Not implemented.
...
...
Graphics/vtkPlaneSource.cxx
View file @
181138fb
...
...
@@ -23,7 +23,7 @@
#include "vtkPolyData.h"
#include "vtkTransform.h"
vtkCxxRevisionMacro
(
vtkPlaneSource
,
"1.6
0
"
);
vtkCxxRevisionMacro
(
vtkPlaneSource
,
"1.6
1
"
);
vtkStandardNewMacro
(
vtkPlaneSource
);
// Construct plane perpendicular to z-axis, resolution 1x1, width and height
...
...
@@ -67,7 +67,7 @@ void vtkPlaneSource::SetResolution(const int xR, const int yR)
void
vtkPlaneSource
::
Execute
()
{
float
x
[
3
],
tc
[
2
],
v1
[
3
],
v2
[
3
];
double
x
[
3
],
tc
[
2
],
v1
[
3
],
v2
[
3
];
vtkIdType
pts
[
4
];
int
i
,
j
,
ii
;
int
numPts
;
...
...
@@ -110,10 +110,10 @@ void vtkPlaneSource::Execute()
//
for
(
numPts
=
0
,
i
=
0
;
i
<
(
this
->
YResolution
+
1
);
i
++
)
{
tc
[
1
]
=
(
float
)
i
/
this
->
YResolution
;
tc
[
1
]
=
(
double
)
i
/
this
->
YResolution
;
for
(
j
=
0
;
j
<
(
this
->
XResolution
+
1
);
j
++
)
{
tc
[
0
]
=
(
float
)
j
/
this
->
XResolution
;
tc
[
0
]
=
(
double
)
j
/
this
->
XResolution
;
for
(
ii
=
0
;
ii
<
3
;
ii
++
)
{
...
...
@@ -157,9 +157,9 @@ void vtkPlaneSource::Execute()
// Set the normal to the plane. Will modify the Origin, Point1, and Point2
// instance variables as necessary (i.e., rotate the plane around its center).
void
vtkPlaneSource
::
SetNormal
(
float
N
[
3
])
void
vtkPlaneSource
::
SetNormal
(
double
N
[
3
])
{
float
n
[
3
],
rotVector
[
3
],
theta
;
double
n
[
3
],
rotVector
[
3
],
theta
;
//make sure input is decent
n
[
0
]
=
N
[
0
];
...
...
@@ -174,7 +174,7 @@ void vtkPlaneSource::SetNormal(float N[3])
// Compute rotation vector using a transformation matrix.
// Note that if normals are parallel then the rotation is either
// 0 or 180 degrees.
float
dp
=
vtkMath
::
Dot
(
this
->
Normal
,
n
);
double
dp
=
vtkMath
::
Dot
(
this
->
Normal
,
n
);
if
(
dp
>=
1.0
)
{
return
;
//zero rotation
...
...
@@ -213,9 +213,9 @@ void vtkPlaneSource::SetNormal(float N[3])
// Set the normal to the plane. Will modify the Origin, Point1, and Point2
// instance variables as necessary (i.e., rotate the plane around its center).
void
vtkPlaneSource
::
SetNormal
(
float
nx
,
float
ny
,
float
nz
)
void
vtkPlaneSource
::
SetNormal
(
double
nx
,
double
ny
,
double
nz
)
{
float
n
[
3
];
double
n
[
3
];