Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
VTK
VTK
Commits
88d64c0d
Commit
88d64c0d
authored
Apr 14, 2010
by
Dave Partyka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: Merge precision fixes from Marcus.
parent
c1ced314
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
4 deletions
+35
-4
Charts/vtkAxis.cxx
Charts/vtkAxis.cxx
+33
-2
Charts/vtkAxis.h
Charts/vtkAxis.h
+2
-2
No files found.
Charts/vtkAxis.cxx
View file @
88d64c0d
...
...
@@ -29,7 +29,7 @@
#include "math.h"
//-----------------------------------------------------------------------------
vtkCxxRevisionMacro
(
vtkAxis
,
"1.20.4.
3
"
);
vtkCxxRevisionMacro
(
vtkAxis
,
"1.20.4.
4
"
);
//-----------------------------------------------------------------------------
vtkStandardNewMacro
(
vtkAxis
);
...
...
@@ -62,7 +62,7 @@ vtkAxis::vtkAxis()
this
->
GridVisible
=
true
;
this
->
LabelsVisible
=
true
;
this
->
Precision
=
2
;
this
->
Notation
=
2
;
//
F
ixed - do the right thing...
this
->
Notation
=
0
;
//
M
ixed - do the right thing...
this
->
Behavior
=
0
;
this
->
Pen
=
vtkPen
::
New
();
this
->
Pen
->
SetColor
(
0
,
0
,
0
);
...
...
@@ -118,6 +118,7 @@ void vtkAxis::Update()
}
}
// Figure out the scaling and origin for the scene
double
scaling
=
0.0
;
double
origin
=
0.0
;
if
(
this
->
Point1
[
0
]
==
this
->
Point2
[
0
])
// x1 == x2, therefore vertical
...
...
@@ -332,6 +333,30 @@ void vtkAxis::SetRange(double minimum, double maximum)
this
->
SetMaximum
(
maximum
);
}
//-----------------------------------------------------------------------------
void
vtkAxis
::
SetPrecision
(
int
precision
)
{
if
(
this
->
Precision
==
precision
)
{
return
;
}
this
->
Precision
=
precision
;
this
->
TickMarksDirty
=
true
;
this
->
Modified
();
}
//-----------------------------------------------------------------------------
void
vtkAxis
::
SetNotation
(
int
notation
)
{
if
(
this
->
Notation
==
notation
)
{
return
;
}
this
->
Notation
=
notation
;
this
->
TickMarksDirty
=
true
;
this
->
Modified
();
}
//-----------------------------------------------------------------------------
void
vtkAxis
::
AutoScale
()
{
...
...
@@ -462,6 +487,12 @@ double vtkAxis::CalculateNiceMinMax(double &min, double &max)
this
->
Minimum
*=
0.95
;
this
->
Maximum
*=
1.05
;
}
else
if
((
this
->
Maximum
-
this
->
Minimum
)
<
1.0e-20
)
{
this
->
Minimum
*=
0.95
;
this
->
Maximum
*=
1.05
;
}
double
range
=
this
->
Maximum
-
this
->
Minimum
;
bool
isNegative
=
false
;
if
(
range
<
0.0
f
)
...
...
Charts/vtkAxis.h
View file @
88d64c0d
...
...
@@ -136,12 +136,12 @@ public:
// Description:
// Get/set the numerical precision to use, default is 2.
v
tkSetMacro
(
Precision
,
int
);
v
irtual
void
SetPrecision
(
int
precision
);
vtkGetMacro
(
Precision
,
int
);
// Description:
// Get/set the numerical notation, standard, scientific or mixed (0, 1, 2).
v
tkSetMacro
(
Notation
,
int
);
v
irtual
void
SetNotation
(
int
notation
);
vtkGetMacro
(
Notation
,
int
);
// Description:
...
...
Write
Preview
Markdown
is supported
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