Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LEFEBVREJP email
radix
Commits
abaf373c
Commit
abaf373c
authored
Sep 11, 2018
by
Purves, Murray
Browse files
#20
Renaming class to differentiate
parent
4b1e6445
Changes
2
Hide whitespace changes
Inline
Side-by-side
radixwidgets/vtkPlotPointsErrorBars.cc
View file @
abaf373c
...
...
@@ -13,7 +13,7 @@
=========================================================================*/
#include
"vtkPlotPoints
.
h"
#include
"
radixwidgets/
vtkPlotPoints
ErrorBars.h
h"
#include
"vtkAxis.h"
#include
"vtkBrush.h"
...
...
@@ -44,7 +44,8 @@ struct vtkIndexedVector2f
vtkVector2f
pos
;
};
class
vtkPlotPoints
::
VectorPIMPL
:
public
std
::
vector
<
vtkIndexedVector2f
>
class
vtkPlotPointsErrorBars
::
VectorPIMPL
:
public
std
::
vector
<
vtkIndexedVector2f
>
{
public:
VectorPIMPL
(
vtkVector2f
*
array
,
size_t
n
)
...
...
@@ -62,16 +63,16 @@ class vtkPlotPoints::VectorPIMPL : public std::vector<vtkIndexedVector2f>
};
//-----------------------------------------------------------------------------
vtkStandardNewMacro
(
vtkPlotPoints
)
vtkStandardNewMacro
(
vtkPlotPoints
ErrorBars
)
//-----------------------------------------------------------------------------
vtkPlotPoints
::
vtkPlotPoints
()
vtkPlotPoints
ErrorBars
::
vtkPlotPoints
ErrorBars
()
{
this
->
Points
=
nullptr
;
this
->
Sorted
=
nullptr
;
this
->
BadPoints
=
nullptr
;
this
->
ValidPointMask
=
nullptr
;
this
->
MarkerStyle
=
vtkPlotPoints
::
CIRCLE
;
this
->
MarkerStyle
=
vtkPlotPoints
ErrorBars
::
CIRCLE
;
this
->
MarkerSize
=
-
1.0
;
this
->
LogX
=
false
;
this
->
LogY
=
false
;
...
...
@@ -85,7 +86,7 @@ vtkStandardNewMacro(vtkPlotPoints)
}
//-----------------------------------------------------------------------------
vtkPlotPoints
::~
vtkPlotPoints
()
vtkPlotPoints
ErrorBars
::~
vtkPlotPoints
ErrorBars
()
{
if
(
this
->
Points
)
{
...
...
@@ -109,7 +110,7 @@ vtkPlotPoints::~vtkPlotPoints()
}
//-----------------------------------------------------------------------------
void
vtkPlotPoints
::
Update
()
void
vtkPlotPoints
ErrorBars
::
Update
()
{
if
(
!
this
->
Visible
)
{
...
...
@@ -156,10 +157,10 @@ void vtkPlotPoints::Update()
}
//-----------------------------------------------------------------------------
bool
vtkPlotPoints
::
Paint
(
vtkContext2D
*
painter
)
bool
vtkPlotPoints
ErrorBars
::
Paint
(
vtkContext2D
*
painter
)
{
// This is where everything should be drawn, or dispatched to other methods.
vtkDebugMacro
(
<<
"Paint event called in vtkPlotPoints."
);
vtkDebugMacro
(
<<
"Paint event called in vtkPlotPoints
ErrorBars
."
);
if
(
!
this
->
Visible
||
!
this
->
Points
||
this
->
Points
->
GetNumberOfPoints
()
==
0
)
{
...
...
@@ -270,8 +271,8 @@ bool vtkPlotPoints::Paint(vtkContext2D *painter)
}
//-----------------------------------------------------------------------------
bool
vtkPlotPoints
::
PaintLegend
(
vtkContext2D
*
painter
,
const
vtkRectf
&
rect
,
int
)
bool
vtkPlotPoints
ErrorBars
::
PaintLegend
(
vtkContext2D
*
painter
,
const
vtkRectf
&
rect
,
int
)
{
if
(
this
->
MarkerStyle
)
{
...
...
@@ -291,7 +292,7 @@ bool vtkPlotPoints::PaintLegend(vtkContext2D *painter, const vtkRectf &rect,
}
//-----------------------------------------------------------------------------
void
vtkPlotPoints
::
GetBounds
(
double
bounds
[
4
])
void
vtkPlotPoints
ErrorBars
::
GetBounds
(
double
bounds
[
4
])
{
if
(
this
->
Points
)
{
...
...
@@ -303,7 +304,7 @@ void vtkPlotPoints::GetBounds(double bounds[4])
}
//-----------------------------------------------------------------------------
void
vtkPlotPoints
::
GetUnscaledInputBounds
(
double
bounds
[
4
])
void
vtkPlotPoints
ErrorBars
::
GetUnscaledInputBounds
(
double
bounds
[
4
])
{
this
->
CalculateUnscaledInputBounds
();
for
(
int
i
=
0
;
i
<
4
;
++
i
)
...
...
@@ -348,7 +349,7 @@ bool inRange(const vtkVector2f &point, const vtkVector2f &tol,
}
// namespace
//-----------------------------------------------------------------------------
void
vtkPlotPoints
::
CreateSortedPoints
()
void
vtkPlotPoints
ErrorBars
::
CreateSortedPoints
()
{
// Sort the data if it has not been done already...
if
(
!
this
->
Sorted
)
...
...
@@ -362,9 +363,9 @@ void vtkPlotPoints::CreateSortedPoints()
}
//-----------------------------------------------------------------------------
vtkIdType
vtkPlotPoints
::
GetNearestPoint
(
const
vtkVector2f
&
point
,
const
vtkVector2f
&
tol
,
vtkVector2f
*
location
)
vtkIdType
vtkPlotPoints
ErrorBars
::
GetNearestPoint
(
const
vtkVector2f
&
point
,
const
vtkVector2f
&
tol
,
vtkVector2f
*
location
)
{
// Right now doing a simple bisector search of the array.
if
(
!
this
->
Points
)
...
...
@@ -402,7 +403,8 @@ vtkIdType vtkPlotPoints::GetNearestPoint(const vtkVector2f &point,
}
//-----------------------------------------------------------------------------
bool
vtkPlotPoints
::
SelectPoints
(
const
vtkVector2f
&
min
,
const
vtkVector2f
&
max
)
bool
vtkPlotPointsErrorBars
::
SelectPoints
(
const
vtkVector2f
&
min
,
const
vtkVector2f
&
max
)
{
if
(
!
this
->
Points
)
{
...
...
@@ -454,7 +456,8 @@ bool vtkPlotPoints::SelectPoints(const vtkVector2f &min, const vtkVector2f &max)
}
//-----------------------------------------------------------------------------
bool
vtkPlotPoints
::
SelectPointsInPolygon
(
const
vtkContextPolygon
&
polygon
)
bool
vtkPlotPointsErrorBars
::
SelectPointsInPolygon
(
const
vtkContextPolygon
&
polygon
)
{
if
(
!
this
->
Points
)
{
...
...
@@ -642,7 +645,8 @@ void CopyToPointsSwitch(vtkPoints2D *points, A *a, vtkDataArray *b, int n,
}
// namespace
//-----------------------------------------------------------------------------
bool
vtkPlotPoints
::
GetDataArrays
(
vtkTable
*
table
,
vtkDataArray
*
array
[
2
])
bool
vtkPlotPointsErrorBars
::
GetDataArrays
(
vtkTable
*
table
,
vtkDataArray
*
array
[
2
])
{
if
(
!
table
)
{
...
...
@@ -677,7 +681,7 @@ bool vtkPlotPoints::GetDataArrays(vtkTable *table, vtkDataArray *array[2])
}
//-----------------------------------------------------------------------------
bool
vtkPlotPoints
::
UpdateTableCache
(
vtkTable
*
table
)
bool
vtkPlotPoints
ErrorBars
::
UpdateTableCache
(
vtkTable
*
table
)
{
vtkDataArray
*
array
[
2
]
=
{
nullptr
,
nullptr
};
if
(
!
this
->
GetDataArrays
(
table
,
array
))
...
...
@@ -753,7 +757,7 @@ bool vtkPlotPoints::UpdateTableCache(vtkTable *table)
}
//-----------------------------------------------------------------------------
void
vtkPlotPoints
::
CalculateUnscaledInputBounds
()
void
vtkPlotPoints
ErrorBars
::
CalculateUnscaledInputBounds
()
{
vtkTable
*
table
=
this
->
Data
->
GetInput
();
vtkDataArray
*
array
[
2
]
=
{
nullptr
,
nullptr
};
...
...
@@ -787,7 +791,7 @@ void vtkPlotPoints::CalculateUnscaledInputBounds()
}
//-----------------------------------------------------------------------------
void
vtkPlotPoints
::
CalculateLogSeries
()
void
vtkPlotPoints
ErrorBars
::
CalculateLogSeries
()
{
if
(
!
this
->
XAxis
||
!
this
->
YAxis
)
{
...
...
@@ -834,7 +838,7 @@ void vtkPlotPoints::CalculateLogSeries()
}
//-----------------------------------------------------------------------------
void
vtkPlotPoints
::
FindBadPoints
()
void
vtkPlotPoints
ErrorBars
::
FindBadPoints
()
{
// This should be run after CalculateLogSeries as a final step.
vtkIdType
n
=
this
->
Points
->
GetNumberOfPoints
();
...
...
@@ -898,7 +902,7 @@ void vtkPlotPoints::FindBadPoints()
}
//-----------------------------------------------------------------------------
void
vtkPlotPoints
::
CalculateBounds
(
double
bounds
[
4
])
void
vtkPlotPoints
ErrorBars
::
CalculateBounds
(
double
bounds
[
4
])
{
// We can use the BadPoints array to skip the bad points
if
(
!
this
->
Points
)
...
...
@@ -923,7 +927,7 @@ void vtkPlotPoints::CalculateBounds(double bounds[4])
}
//-----------------------------------------------------------------------------
void
vtkPlotPoints
::
SetLookupTable
(
vtkScalarsToColors
*
lut
)
void
vtkPlotPoints
ErrorBars
::
SetLookupTable
(
vtkScalarsToColors
*
lut
)
{
if
(
this
->
LookupTable
!=
lut
)
{
...
...
@@ -941,7 +945,7 @@ void vtkPlotPoints::SetLookupTable(vtkScalarsToColors *lut)
}
//-----------------------------------------------------------------------------
vtkScalarsToColors
*
vtkPlotPoints
::
GetLookupTable
()
vtkScalarsToColors
*
vtkPlotPoints
ErrorBars
::
GetLookupTable
()
{
if
(
this
->
LookupTable
==
nullptr
)
{
...
...
@@ -951,7 +955,7 @@ vtkScalarsToColors *vtkPlotPoints::GetLookupTable()
}
//-----------------------------------------------------------------------------
void
vtkPlotPoints
::
CreateDefaultLookupTable
()
void
vtkPlotPoints
ErrorBars
::
CreateDefaultLookupTable
()
{
if
(
this
->
LookupTable
)
{
...
...
@@ -964,7 +968,7 @@ void vtkPlotPoints::CreateDefaultLookupTable()
}
//-----------------------------------------------------------------------------
void
vtkPlotPoints
::
SelectColorArray
(
const
vtkStdString
&
arrayName
)
void
vtkPlotPoints
ErrorBars
::
SelectColorArray
(
const
vtkStdString
&
arrayName
)
{
vtkTable
*
table
=
this
->
Data
->
GetInput
();
if
(
!
table
)
...
...
@@ -991,7 +995,7 @@ void vtkPlotPoints::SelectColorArray(const vtkStdString &arrayName)
}
//-----------------------------------------------------------------------------
void
vtkPlotPoints
::
SelectColorArray
(
vtkIdType
arrayNum
)
void
vtkPlotPoints
ErrorBars
::
SelectColorArray
(
vtkIdType
arrayNum
)
{
vtkTable
*
table
=
this
->
Data
->
GetInput
();
if
(
!
table
)
...
...
@@ -1023,10 +1027,13 @@ void vtkPlotPoints::SelectColorArray(vtkIdType arrayNum)
}
//-----------------------------------------------------------------------------
vtkStdString
vtkPlotPoints
::
GetColorArrayName
()
{
return
this
->
ColorArrayName
;
}
vtkStdString
vtkPlotPointsErrorBars
::
GetColorArrayName
()
{
return
this
->
ColorArrayName
;
}
//-----------------------------------------------------------------------------
void
vtkPlotPoints
::
PrintSelf
(
ostream
&
os
,
vtkIndent
indent
)
void
vtkPlotPoints
ErrorBars
::
PrintSelf
(
ostream
&
os
,
vtkIndent
indent
)
{
this
->
Superclass
::
PrintSelf
(
os
,
indent
);
}
radixwidgets/vtkPlotPointsErrorBars.hh
View file @
abaf373c
...
...
@@ -49,16 +49,16 @@ class vtkImageData;
class
vtkScalarsToColors
;
class
vtkUnsignedCharArray
;
class
VTKCHARTSCORE_EXPORT
vtkPlotPoints
:
public
vtkPlot
class
VTKCHARTSCORE_EXPORT
vtkPlotPoints
ErrorBars
:
public
vtkPlot
{
public:
vtkTypeMacro
(
vtkPlotPoints
,
vtkPlot
);
vtkTypeMacro
(
vtkPlotPoints
ErrorBars
,
vtkPlot
);
void
PrintSelf
(
ostream
&
os
,
vtkIndent
indent
)
override
;
/**
* Creates a 2D Chart object.
*/
static
vtkPlotPoints
*
New
();
static
vtkPlotPoints
ErrorBars
*
New
();
/**
* Perform any updates to the item that may be necessary before rendering.
...
...
@@ -188,8 +188,8 @@ class VTKCHARTSCORE_EXPORT vtkPlotPoints : public vtkPlot
vtkSetMacro
(
ValidPointMaskName
,
vtkStdString
)
//@}
protected
:
vtkPlotPoints
();
~
vtkPlotPoints
()
override
;
protected
:
vtkPlotPoints
ErrorBars
();
~
vtkPlotPoints
ErrorBars
()
override
;
/**
* Populate the data arrays ready to operate on input data.
...
...
@@ -293,8 +293,8 @@ class VTKCHARTSCORE_EXPORT vtkPlotPoints : public vtkPlot
double
UnscaledInputBounds
[
4
];
private:
vtkPlotPoints
(
const
vtkPlotPoints
&
)
=
delete
;
void
operator
=
(
const
vtkPlotPoints
&
)
=
delete
;
vtkPlotPoints
ErrorBars
(
const
vtkPlotPoints
ErrorBars
&
)
=
delete
;
void
operator
=
(
const
vtkPlotPoints
ErrorBars
&
)
=
delete
;
};
#endif // RADIX_RADIXWIDGETS_VTKPLOTPOINTSERRORBARS_HH_
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