1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkPolyDataItem.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.
=========================================================================*/
/**
* @class vtkPolyDataItem
* @brief Filter that translate a vtkPolyData 2D mesh into vtkContextItems.
*
* @warning
* The input vtkPolyData should be a 2D mesh.
*
*/
#ifndef vtkPolyDataItem_h
#define vtkPolyDataItem_h
#include "vtkContextItem.h"
#include "vtkRenderingContext2DModule.h" // For export macro
VTK_ABI_NAMESPACE_BEGIN
class vtkPolyData;
class vtkUnsignedCharArray;
class VTKRENDERINGCONTEXT2D_EXPORT vtkPolyDataItem : public vtkContextItem
{
public:
vtkTypeMacro(vtkPolyDataItem, vtkContextItem);
void PrintSelf(ostream& os, vtkIndent indent) override;
static vtkPolyDataItem* New();
/**
* Paint event for the item.
*/
bool Paint(vtkContext2D* painter) override;
/**
* Set the PolyData of the item.
*/
void SetPolyData(vtkPolyData* polyData);
/**
* Set mapped colors. User-selected scalars are mapped to a color lookup
* table externally.
*/
void SetMappedColors(vtkUnsignedCharArray* colors);
/**
* Get the image of the item.
*/
vtkGetObjectMacro(PolyData, vtkPolyData);
/**
* Set the position of the bottom corner of the image.
*/
vtkSetVector2Macro(Position, float);
/**
* Set the data scalar mode.
*/
vtkSetMacro(ScalarMode, int);
protected:
vtkPolyDataItem();
~vtkPolyDataItem() override;
class DrawHintsHelper;
DrawHintsHelper* HintHelper;
float Position[2];
vtkPolyData* PolyData;
vtkUnsignedCharArray* MappedColors;
int ScalarMode;
private:
vtkPolyDataItem(const vtkPolyDataItem&) = delete;
void operator=(const vtkPolyDataItem&) = delete;
};
VTK_ABI_NAMESPACE_END
#endif
|