Commit 8e5b3e79 authored by Julien Finet's avatar Julien Finet Committed by Marcus D. Hanwell

Add point edition in vtkControlPointsItems

-You can edit control points in 2 fashions:
 If vtkControlPointsItem::StrokeMode is true, you can "draw" points while
the left mouse button is down, it will add control points under the mouse
cursor.
 If vtkControlPointsItem::StrokeMode is false, you can drag&drop existing
points. SwitchPointsMode control the behavior to follow when a point
crosses another.
In both modes, if you click the left button mouse not on a point, a point is
created under the mouse cursor.
-Add vtkCompositeControlPointsItem to mix ct function and opacity function.
It creates points for Color Transfer and Opacity
functions.Both functions will share the same control points.
-Add vtkControlPointsItem::EditPoint to control midpoint and sharpness
-Support null transfer functions in the ScalarsToColors items
parent 094b1cf6
......@@ -29,6 +29,8 @@ SET(Kit_SRCS
vtkColor.h
vtkColorSeries.cxx
vtkColorTransferFunctionItem.cxx
vtkColorTransferControlPointsItem.cxx
vtkCompositeControlPointsItem.cxx
vtkCompositeTransferFunctionItem.cxx
vtkContext2D.cxx
vtkContextActor.cxx
......
......@@ -14,6 +14,7 @@ IF(VTK_USE_RENDERING AND VTK_USE_VIEWS)
#TestContextUnicode.cxx # Disabled until Freetype unicode works
TestBarGraph.cxx
TestBarGraphHorizontal.cxx
TestColorTransferFunction.cxx
TestContext.cxx
TestContextImage.cxx
TestDiagram.cxx
......
/*=========================================================================
Program: Visualization Toolkit
Module: TestLinePlot.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkChartXY.h"
#include "vtkColorTransferControlPointsItem.h"
#include "vtkColorTransferFunction.h"
#include "vtkColorTransferFunctionItem.h"
#include "vtkContextScene.h"
#include "vtkContextView.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderer.h"
#include "vtkSmartPointer.h"
//----------------------------------------------------------------------------
int TestColorTransferFunction(int , char * [])
{
// Set up a 2D scene, add an XY chart to it
vtkSmartPointer<vtkContextView> view =
vtkSmartPointer<vtkContextView>::New();
view->GetRenderer()->SetBackground(1.0, 1.0, 1.0);
view->GetRenderWindow()->SetSize(400, 300);
vtkSmartPointer<vtkChartXY> chart = vtkSmartPointer<vtkChartXY>::New();
chart->SetTitle("Chart");
view->GetScene()->AddItem(chart);
vtkSmartPointer<vtkColorTransferFunction> colorTransferFunction =
vtkSmartPointer<vtkColorTransferFunction>::New();
colorTransferFunction->AddHSVSegment(0.,0.,1.,1.,0.3333,0.3333,1.,1.);
colorTransferFunction->AddHSVSegment(0.3333,0.3333,1.,1.,0.6666,0.6666,1.,1.);
colorTransferFunction->AddHSVSegment(0.6666,0.6666,1.,1.,1.,0.,1.,1.);
colorTransferFunction->Build();
vtkSmartPointer<vtkColorTransferFunctionItem> colorTransferItem =
vtkSmartPointer<vtkColorTransferFunctionItem>::New();
colorTransferItem->SetColorTransferFunction(colorTransferFunction);
chart->AddPlot(colorTransferItem);
vtkSmartPointer<vtkColorTransferControlPointsItem> controlPointsItem =
vtkSmartPointer<vtkColorTransferControlPointsItem>::New();
controlPointsItem->SetColorTransferFunction(colorTransferFunction);
chart->AddPlot(controlPointsItem);
//Finally render the scene and compare the image to a reference image
// view->GetRenderWindow()->SetMultiSamples(1);
view->GetInteractor()->Initialize();
view->GetInteractor()->Start();
return EXIT_SUCCESS;
}
......@@ -13,27 +13,19 @@
=========================================================================*/
#include "vtkAxis.h"
#include "vtkPlot.h"
#include "vtkTable.h"
#include "vtkChartXY.h"
#include "vtkColorTransferFunction.h"
#include "vtkColorTransferFunctionItem.h"
#include "vtkCompositeControlPointsItem.h"
#include "vtkCompositeTransferFunctionItem.h"
#include "vtkContextScene.h"
#include "vtkContextView.h"
#include "vtkFloatArray.h"
#include "vtkLookupTable.h"
#include "vtkLookupTableItem.h"
#include "vtkPiecewiseControlPointsItem.h"
#include "vtkPiecewiseFunction.h"
#include "vtkPiecewiseFunctionItem.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderer.h"
#include "vtkSmartPointer.h"
#include "vtkTextProperty.h"
#include "vtkIntArray.h"
//----------------------------------------------------------------------------
int TestScalarsToColors(int , char * [])
......@@ -72,18 +64,11 @@ int TestScalarsToColors(int , char * [])
item3->SetOpacityFunction(opacityFunction);
item3->SetMaskAboveCurve(true);
chart->AddPlot(item3);
/*
vtkSmartPointer<vtkPiecewiseFunctionItem> item3 =
vtkSmartPointer<vtkPiecewiseFunctionItem>::New();
item3->SetPiecewiseFunction(opacityFunction);
item3->SetColor(247,180,0,255);
item3->SetMaskAboveCurve(true);
chart->AddPlot(item3);
*/
vtkSmartPointer<vtkPiecewiseControlPointsItem> item5 =
vtkSmartPointer<vtkPiecewiseControlPointsItem>::New();
item5->SetPiecewiseFunction(opacityFunction);
vtkSmartPointer<vtkCompositeControlPointsItem> item5 =
vtkSmartPointer<vtkCompositeControlPointsItem>::New();
item5->SetOpacityFunction(opacityFunction);
item5->SetColorTransferFunction(colorTransferFunction);
chart->AddPlot(item5);
//Finally render the scene and compare the image to a reference image
......
/*=========================================================================
Program: Visualization Toolkit
Module: vtkColorTransferControlPointsItem.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkBrush.h"
#include "vtkCallbackCommand.h"
#include "vtkContext2D.h"
#include "vtkIdTypeArray.h"
#include "vtkColorTransferFunction.h"
#include "vtkColorTransferControlPointsItem.h"
#include "vtkObjectFactory.h"
#include "vtkPen.h"
#include "vtkPoints2D.h"
#include "vtkContextScene.h"
// to handle mouse.GetButton
#include "vtkContextMouseEvent.h"
#include <cassert>
#include <limits>
#include <algorithm>
//-----------------------------------------------------------------------------
vtkStandardNewMacro(vtkColorTransferControlPointsItem);
//-----------------------------------------------------------------------------
vtkColorTransferControlPointsItem::vtkColorTransferControlPointsItem()
{
this->ColorTransferFunction = 0;
this->ColorFill = false;
}
//-----------------------------------------------------------------------------
vtkColorTransferControlPointsItem::~vtkColorTransferControlPointsItem()
{
if (this->ColorTransferFunction)
{
this->ColorTransferFunction->Delete();
this->ColorTransferFunction = 0;
}
}
//-----------------------------------------------------------------------------
void vtkColorTransferControlPointsItem::PrintSelf(ostream &os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
os << indent << "ColorTransferFunction: ";
if (this->ColorTransferFunction)
{
os << endl;
this->ColorTransferFunction->PrintSelf(os, indent.GetNextIndent());
}
else
{
os << "(none)" << endl;
}
}
//-----------------------------------------------------------------------------
unsigned long int vtkColorTransferControlPointsItem::GetControlPointsMTime()
{
if (this->ColorTransferFunction)
{
return this->ColorTransferFunction->GetMTime();
}
return this->GetMTime();
}
//-----------------------------------------------------------------------------
void vtkColorTransferControlPointsItem::SetColorTransferFunction(vtkColorTransferFunction* t)
{
vtkSetObjectBodyMacro(ColorTransferFunction, vtkColorTransferFunction, t);
if (this->ColorTransferFunction)
{
this->ColorTransferFunction->AddObserver(vtkCommand::ModifiedEvent, this->Callback);
}
this->ComputePoints();
}
//-----------------------------------------------------------------------------
void vtkColorTransferControlPointsItem::DrawPoint(vtkContext2D* painter, vtkIdType index)
{
if (this->ColorFill)
{
double xrgbms[6];
this->ColorTransferFunction->GetNodeValue(index, xrgbms);
painter->GetBrush()->SetColorF(xrgbms[1], xrgbms[2], xrgbms[3], 0.55);
}
this->vtkControlPointsItem::DrawPoint(painter, index);
}
//-----------------------------------------------------------------------------
int vtkColorTransferControlPointsItem::GetNumberOfPoints()const
{
return this->ColorTransferFunction ? this->ColorTransferFunction->GetSize() : 0;
}
//-----------------------------------------------------------------------------
void vtkColorTransferControlPointsItem::GetControlPoint(vtkIdType index, double* pos)
{
double xrgbms[6];
this->ColorTransferFunction->GetNodeValue(index, xrgbms);
pos[0] = xrgbms[0];
pos[1] = 0.5;
pos[2] = xrgbms[4];
pos[3] = xrgbms[5];
}
//-----------------------------------------------------------------------------
void vtkColorTransferControlPointsItem::SetControlPoint(vtkIdType index, double* newPos)
{
double xrgbms[6];
this->ColorTransferFunction->GetNodeValue(index, xrgbms);
if (newPos[0] != xrgbms[0] ||
newPos[2] != xrgbms[1] ||
newPos[3] != xrgbms[2])
{
xrgbms[0] = newPos[0];
xrgbms[4] = newPos[2];
xrgbms[5] = newPos[3];
this->ColorTransferFunction->SetNodeValue(index, xrgbms);
}
}
//-----------------------------------------------------------------------------
void vtkColorTransferControlPointsItem::EditPoint(float tX, float tY)
{
if (!this->ColorTransferFunction)
{
return;
}
double xrgbms[6];
this->ColorTransferFunction->GetNodeValue(this->CurrentPoint, xrgbms);
xrgbms[4] += tX;
xrgbms[5] += tY;
this->ColorTransferFunction->SetNodeValue(this->CurrentPoint, xrgbms);
if (this->CurrentPoint > 0)
{
this->ColorTransferFunction->GetNodeValue(this->CurrentPoint - 1, xrgbms);
xrgbms[4] += tX;
xrgbms[5] += tY;
this->ColorTransferFunction->SetNodeValue(this->CurrentPoint - 1, xrgbms);
}
}
//-----------------------------------------------------------------------------
vtkIdType vtkColorTransferControlPointsItem::AddPoint(double* newPos)
{
if (!this->ColorTransferFunction)
{
return -1;
}
vtkIdType expectedPoint = this->vtkControlPointsItem::AddPoint(newPos);
double rgb[3] = {0., 0., 0.};
this->ColorTransferFunction->GetColor(newPos[0], rgb);
vtkIdType addedPoint = this->ColorTransferFunction->AddRGBPoint(newPos[0], rgb[0], rgb[1], rgb[2]);
assert(addedPoint == expectedPoint);
return addedPoint;
}
//-----------------------------------------------------------------------------
vtkIdType vtkColorTransferControlPointsItem::RemovePoint(double* currentPoint)
{
if (!this->ColorTransferFunction)
{
return -1;
}
vtkIdType expectedPoint = this->vtkControlPointsItem::RemovePoint(currentPoint);
vtkIdType removedPoint = this->ColorTransferFunction->RemovePoint(currentPoint[0]);
assert(removedPoint == expectedPoint);
return removedPoint;
}
/*=========================================================================
Program: Visualization Toolkit
Module: vtkColorTransferControlPointsItem.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkColorTransferControlPointsItem - Control points for
// vtkColorTransferFunction.
// .SECTION Description
// vtkColorTransferControlPointsItem draws the control points of a vtkColorTransferFunction.
// .SECTION See Also
// vtkControlPointsItem
// vtkColorTransferFunctionItem
// vtkCompositeTransferFunctionItem
#ifndef __vtkColorTransferControlPointsItem_h
#define __vtkColorTransferControlPointsItem_h
#include "vtkControlPointsItem.h"
class vtkColorTransferFunction;
class VTK_CHARTS_EXPORT vtkColorTransferControlPointsItem: public vtkControlPointsItem
{
public:
vtkTypeMacro(vtkColorTransferControlPointsItem, vtkControlPointsItem);
virtual void PrintSelf(ostream &os, vtkIndent indent);
// Description:
// Creates a piecewise control points object
static vtkColorTransferControlPointsItem* New();
// Description:
// Set the piecewise function to draw its points
void SetColorTransferFunction(vtkColorTransferFunction* function);
// Description
// Get the piecewise function
vtkGetObjectMacro(ColorTransferFunction, vtkColorTransferFunction);
// Description:
// Add a point to the function. Returns the index of the point (0 based),
// or -1 on error.
// Subclasses should reimplement this function to do the actual work.
virtual vtkIdType AddPoint(double* newPos);
// Description:
// Remove a point of the function. Returns the index of the point (0 based),
// or -1 on error.
// Subclasses should reimplement this function to do the actual work.
virtual vtkIdType RemovePoint(double* pos);
// Description:
// If ColorFill is true, the control point brush color is set with the
// matching color in the color transfer function.
// False by default.
vtkSetMacro(ColorFill, bool);
vtkGetMacro(ColorFill, bool);
protected:
vtkColorTransferControlPointsItem();
virtual ~vtkColorTransferControlPointsItem();
virtual unsigned long int GetControlPointsMTime();
virtual void DrawPoint(vtkContext2D* painter, vtkIdType index);
virtual int GetNumberOfPoints()const;
virtual void GetControlPoint(vtkIdType index, double *point);
virtual void SetControlPoint(vtkIdType index, double *point);
virtual void EditPoint(float tX, float tY);
vtkColorTransferFunction* ColorTransferFunction;
bool ColorFill;
private:
vtkColorTransferControlPointsItem(const vtkColorTransferControlPointsItem &); // Not implemented.
void operator=(const vtkColorTransferControlPointsItem &); // Not implemented.
};
#endif
......@@ -87,18 +87,18 @@ void vtkColorTransferFunctionItem::SetColorTransferFunction(vtkColorTransferFunc
//-----------------------------------------------------------------------------
void vtkColorTransferFunctionItem::ComputeTexture()
{
if (this->Texture == 0)
{
this->Texture = vtkImageData::New();
}
double bounds[4];
this->GetBounds(bounds);
if (bounds[0] == bounds[1])
if (bounds[0] == bounds[1]
|| !this->ColorTransferFunction)
{
vtkWarningMacro(<< "The color transfer function seems empty");
return;
}
if (this->Texture == 0)
{
this->Texture = vtkImageData::New();
}
// Could depend of the screen resolution
const int dimension = 256;
double* values = new double[dimension];
......@@ -127,4 +127,5 @@ void vtkColorTransferFunctionItem::ComputeTexture()
}
}
delete [] values;
return;
}
/*=========================================================================
Program: Visualization Toolkit
Module: vtkCompositeControlPointsItem.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkBrush.h"
#include "vtkCallbackCommand.h"
#include "vtkContext2D.h"
#include "vtkIdTypeArray.h"
#include "vtkColorTransferFunction.h"
#include "vtkCompositeControlPointsItem.h"
#include "vtkObjectFactory.h"
#include "vtkPen.h"
#include "vtkPiecewiseFunction.h"
#include "vtkPoints2D.h"
#include "vtkContextScene.h"
// to handle mouse.GetButton
#include "vtkContextMouseEvent.h"
#include <cassert>
#include <limits>
#include <algorithm>
//-----------------------------------------------------------------------------
vtkStandardNewMacro(vtkCompositeControlPointsItem);
//-----------------------------------------------------------------------------
vtkCompositeControlPointsItem::vtkCompositeControlPointsItem()
{
this->OpacityFunction = 0;
this->Updating = false;
this->ColorFill = true;
}
//-----------------------------------------------------------------------------
vtkCompositeControlPointsItem::~vtkCompositeControlPointsItem()
{
if (this->OpacityFunction)
{
this->OpacityFunction->Delete();
this->OpacityFunction = 0;
}
}
//-----------------------------------------------------------------------------
void vtkCompositeControlPointsItem::PrintSelf(ostream &os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
os << indent << "OpacityFunction: ";
if (this->OpacityFunction)
{
os << endl;
this->OpacityFunction->PrintSelf(os, indent.GetNextIndent());
}
else
{
os << "(none)" << endl;
}
}
//-----------------------------------------------------------------------------
unsigned long int vtkCompositeControlPointsItem::GetControlPointsMTime()
{
if (this->OpacityFunction)
{
return this->OpacityFunction->GetMTime();
}
return this->Superclass::GetControlPointsMTime();
}
//-----------------------------------------------------------------------------
void vtkCompositeControlPointsItem::SetOpacityFunction(vtkPiecewiseFunction* function)
{
vtkSetObjectBodyMacro(OpacityFunction, vtkPiecewiseFunction, function);
this->MergeColorTransferFunction();
if (this->OpacityFunction)
{
this->OpacityFunction->AddObserver(vtkCommand::ModifiedEvent, this->Callback);
}
this->ComputePoints();
}
//-----------------------------------------------------------------------------
void vtkCompositeControlPointsItem::SetColorTransferFunction(vtkColorTransferFunction* c)
{
// We need to set the color transfer function here (before
// Superclass::SetPiecewiseFunction) to be able to have a valid
// color transfer function for MergeColorTransferFunction().
vtkSetObjectBodyMacro(ColorTransferFunction, vtkColorTransferFunction, c);
this->MergeColorTransferFunction();
this->Superclass::SetColorTransferFunction(c);
}
//-----------------------------------------------------------------------------
void vtkCompositeControlPointsItem::ComputePoints()
{
if (this->Updating)
{
return;
}
this->Superclass::ComputePoints();
}
//-----------------------------------------------------------------------------
void vtkCompositeControlPointsItem::SetControlPoint(vtkIdType index, double* newPos)
{
this->Superclass::SetControlPoint(index, newPos);
this->OpacityFunction->SetNodeValue(index, newPos);
}
//-----------------------------------------------------------------------------
void vtkCompositeControlPointsItem::GetControlPoint(vtkIdType index, double* pos)
{
if (!this->OpacityFunction)
{
this->Superclass::GetControlPoint(index, pos);
return;
}
this->OpacityFunction->GetNodeValue(index, pos);
}
//-----------------------------------------------------------------------------
void vtkCompositeControlPointsItem::EditPoint(float tX, float tY)
{
this->Superclass::EditPoint(tX, tY);
if (!this->OpacityFunction)
{
return;
}
double xvms[4];
this->OpacityFunction->GetNodeValue(this->CurrentPoint, xvms);
xvms[2] += tX;
xvms[3] += tY;
this->OpacityFunction->SetNodeValue(this->CurrentPoint, xvms);
if (this->CurrentPoint > 0)
{
this->OpacityFunction->GetNodeValue(this->CurrentPoint - 1, xvms);
xvms[2] += tX;
xvms[3] += tY;
this->ColorTransferFunction->SetNodeValue(this->CurrentPoint - 1, xvms);
}
}
//-----------------------------------------------------------------------------
vtkIdType vtkCompositeControlPointsItem::AddPoint(double* newPos)
{
bool oldUpdating = this->Updating;
this->Updating = true;
vtkIdType addedPoint = this->Superclass::AddPoint(newPos);
this->Updating = oldUpdating;
if (!this->OpacityFunction)
{
return addedPoint;
}
return this->OpacityFunction->AddPoint(newPos[0], newPos[1]);
}
//-----------------------------------------------------------------------------
vtkIdType vtkCompositeControlPointsItem::RemovePoint(double* currentPoint)
{
bool oldUpdating = this->Updating;
this->Updating = true;
vtkIdType removedPoint = this->Superclass::RemovePoint(currentPoint);
this->Updating = oldUpdating;
if (!this->OpacityFunction)
{
return removedPoint;
}
return this->OpacityFunction->RemovePoint(currentPoint[0]);
}
//-----------------------------------------------------------------------------
void vtkCompositeControlPointsItem::MergeColorTransferFunction()
{
if (!this->ColorTransferFunction || !this->OpacityFunction)
{
return;
}
// Naive implementation that does the work but can be a bit slow
// Copy OpacityFunction points into the ColorTransferFunction
const int piecewiseFunctionCount = this->OpacityFunction->GetSize();
for (int i = 0; i < piecewiseFunctionCount; ++i)
{
double piecewisePoint[4];
this->OpacityFunction->GetNodeValue(i, piecewisePoint);
double rgb[3];
this->ColorTransferFunction->GetColor(piecewisePoint[0], rgb);
// note that we might loose the midpoint/sharpness of the point if any
this->ColorTransferFunction->RemovePoint(piecewisePoint[0]);
this->ColorTransferFunction->AddRGBPoint(piecewisePoint[0], rgb[0], rgb[1], rgb[2], piecewisePoint[2], piecewisePoint[3]);
}
// Copy ColorTransferFunction points into the OpacityFunction
const int colorFunctionCount = this->ColorTransferFunction->GetSize();
for (int i = 0; i < colorFunctionCount; ++i)
{
double xrgbms[6];
this->ColorTransferFunction->GetNodeValue(i, xrgbms);
double value = this->OpacityFunction->GetValue(xrgbms[0]);
// note that we might loose the midpoint/sharpness of the point if any
this->OpacityFunction->RemovePoint(xrgbms[0]);
this->OpacityFunction->AddPoint(xrgbms[0], value, xrgbms[4], xrgbms[5]);
}
}
/*=========================================================================
Program: Visualization Toolkit
Module: vtkCompositeControlPointsItem.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkCompositeControlPointsItem - Control points for
// vtkCompositeFunction.
// .SECTION Description
// vtkCompositeControlPointsItem draws the control points of a vtkPiecewiseFunction
// and a vtkColorTransferFunction.
// .SECTION See Also
// vtkControlPointsItem
// vtkColorTransferControlPointsItem
// vtkCompositeTransferFunctionItem
#ifndef __vtkCompositeControlPointsItem_h
#define __vtkCompositeControlPointsItem_h
#include "vtkColorTransferControlPointsItem.h"
class vtkPiecewiseFunction;
class VTK_CHARTS_EXPORT vtkCompositeControlPointsItem:
public vtkColorTransferControlPointsItem
{
public:
vtkTypeMacro(vtkCompositeControlPointsItem, vtkColorTransferControlPointsItem);
virtual void PrintSelf(ostream &os, vtkIndent indent);
// Description:
// Creates a piecewise control points object
static vtkCompositeControlPointsItem* New();
// Description:
// Set the color transfer function to draw its points
virtual void SetColorTransferFunction(vtkColorTransferFunction* function);
// Description
// Utility function that calls SetPiecewiseFunction()
void SetOpacityFunction(vtkPiecewiseFunction* opacity);
vtkGetObjectMacro(OpacityFunction, vtkPiecewiseFunction);
// Description:
// Add a point to the function. Returns the index of the point (0 based),
// or -1 on error.
// Subclasses should reimplement this function to do the actual work.
virtual vtkIdType AddPoint(double* newPos);
// Description:
// Remove a point of the function. Returns the index of the point (0 based),
// or -1 on error.
// Subclasses should reimplement this function to do the actual work.
virtual vtkIdType RemovePoint(double* pos);
protected:
vtkCompositeControlPointsItem();