8#include "vtkInfovisCoreModule.h"
191VTK_ABI_NAMESPACE_BEGIN
208 using PairType = std::tuple<std::string, std::string>;
221#define SetStdContainerMacro(name, container) \
222 virtual void Set##name(container arg) \
224 bool changed = false; \
225 if (arg.size() != name.size()) \
231 auto a = arg.begin(); \
232 for (auto r : name) \
255 if (arg != BackgroundColorName)
258 BackgroundColorName = arg;
289 if (ColorSchemeName != arg)
292 ColorSchemeName = arg;
305 vtkSetMacro(DPI,
int);
306 vtkGetMacro(DPI,
int);
322 virtual std::string
GetFileName() VTK_FUTURE_CONST {
return FileName; }
333 if (FontFileName != arg)
347 vtkSetMacro(Gap,
int);
348 vtkGetMacro(Gap,
int);
359 if (MaskColorName != arg)
380 if (MaskFileName != arg)
393 vtkSetMacro(MaxFontSize,
int);
394 vtkGetMacro(MaxFontSize,
int);
401 vtkSetMacro(MinFontSize,
int);
402 vtkGetMacro(MinFontSize,
int);
411 vtkSetMacro(MinFrequency,
int);
412 vtkGetMacro(MinFrequency,
int);
420 vtkSetMacro(FontMultiplier,
int);
421 vtkGetMacro(FontMultiplier,
int);
452 return OrientationDistribution;
465 Orientations.push_back(arg);
480 ReplacementPairs.push_back(arg);
504 StopWords.insert(word);
522 if (StopListFileName != arg)
525 StopListFileName = arg;
555 if (WordColorName != arg)
629 typedef std::function<bool(std::pair<std::string, int>, std::pair<std::string, int>)> Comparator;
631 std::multiset<std::pair<std::string, int>, Comparator> FindWordsSortedByFrequency(
635 ExtentOffset(
int _x = 0.0,
int _y = 0.0)
Generic algorithm superclass for image algs.
a simple class to control print indentation
virtual void Modified()
Update the modification time for this object.
Hold a reference to a vtkObjectBase instance.
generate a word cloud visualization of a text document
virtual OrientationsContainer GetOrientations()
virtual OffsetDistributionContainer GetOffsetDistribution()
virtual void SetWordColorName(std::string arg)
Set/Get WordColorName, the name of the color for the words().
virtual std::string GetMaskFileName() VTK_FUTURE_CONST
virtual void SetBackgroundColorName(std::string arg)
Set/Get the vtkNamedColors name for the background(MidNightBlue).
virtual SizesContainer GetAdjustedSizes()
Return the AdjustedSizes of the resized mask file.
static vtkWordCloud * New()
Construct object with vertex cell generation turned off.
virtual void SetFileName(VTK_FILEPATH std::string arg)
Set/Get FileName, the name of the file that contains the text to be processed.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called in response to a REQUEST_DATA request from the executive.
std::vector< PairType > ReplacementPairsContainer
virtual void SetTitle(std::string arg)
Set/Get Title, add this word to the document's words and set a high frequency, so that is will be ren...
virtual std::string GetFontFileName() VTK_FUTURE_CONST
std::string StopListFileName
vtkSmartPointer< vtkImageData > ImageData
std::array< int, 2 > OffsetDistributionContainer
std::string ColorSchemeName
SetStdContainerMacro(Orientations, OrientationsContainer)
Set/Add/Get Orientations, a vector of discrete orientations ().
virtual std::vector< std::string > & GetKeptWords()
Get a vector of words that are kept in the final image.
virtual void SetColorSchemeName(std::string arg)
Set/Get ColorSchemeName, the name of a color scheme from vtkColorScheme to be used to select colors f...
virtual std::string GetWordColorName()
virtual void SetMaskColorName(std::string arg)
Set/Get MaskColorName, the name of the color for the mask (black).
std::tuple< std::string, std::string > PairType
SetStdContainerMacro(StopWords, StopWordsContainer)
Set/Add/Get StopWords, a set of user provided stop words().
std::string WordColorName
std::string BackgroundColorName
SetStdContainerMacro(ColorDistribution, ColorDistributionContainer)
Set/Get ColorDistribution, the distribution of random colors(.6 1.0), if WordColorName is empty.
std::array< double, 2 > ColorDistributionContainer
virtual std::vector< std::string > & GetStoppedWords()
Get a vector of words that were stopped in the final image.
std::set< std::string > StopWordsContainer
ReplacementPairsContainer ReplacementPairs
virtual std::string GetStopListFileName() VTK_FUTURE_CONST
virtual void SetStopListFileName(VTK_FILEPATH VTK_FUTURE_CONST std::string arg)
Set/Get StopListFileName, the name of the file that contains the stop words, one per line.
std::array< double, 2 > OrientationDistributionContainer
std::vector< std::string > StringContainer
SizesContainer AdjustedSizes
virtual std::vector< std::string > & GetSkippedWords()
Get a vector of words that are skipped.
virtual std::string GetFileName() VTK_FUTURE_CONST
virtual void SetMaskFileName(VTK_FILEPATH VTK_FUTURE_CONST std::string arg)
Set/Get MaskFileName, the mask file name().
SetStdContainerMacro(Sizes, SizesContainer)
Set/Get Sizes, the size of the output image(640 480).
OrientationsContainer Orientations
virtual std::string GetTitle()
virtual SizesContainer GetSizes()
OrientationDistributionContainer OrientationDistribution
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
virtual StopWordsContainer GetStopWords()
SetStdContainerMacro(OffsetDistribution, OffsetDistributionContainer)
Set/Get OffsetDistribution, the range of uniform random offsets(-size[0]/100.0 -size{1]/100....
virtual std::string GetMaskColorName()
std::vector< std::string > SkippedWords
std::vector< std::string > KeptWords
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
ColorDistributionContainer ColorDistribution
SetStdContainerMacro(OrientationDistribution, OrientationDistributionContainer)
Set/Get OrientationDistribution, ranges of random orientations(-20 20).
virtual ColorDistributionContainer GetColorDistribution()
virtual std::string GetBackgroundColorName()
virtual ReplacementPairsContainer GetReplacementPairs()
virtual std::string GetColorSchemeName()
StopWordsContainer StopWords
~vtkWordCloud() override=default
virtual OrientationDistributionContainer GetOrientationDistribution()
std::vector< double > OrientationsContainer
void AddReplacementPair(PairType arg)
std::vector< std::string > StoppedWords
void AddStopWord(std::string word)
OffsetDistributionContainer OffsetDistribution
virtual void SetBWMask(bool arg)
Set/Get boolean that indicates the mask image is a single channel(false).
virtual void SetFontFileName(VTK_FILEPATH VTK_FUTURE_CONST std::string arg)
Set/Get FontFileName, If empty, the built-in Arial font is used().
SetStdContainerMacro(ReplacementPairs, ReplacementPairsContainer)
Set/Add/Get ReplacementPairs, a vector of words that replace the first word with another second word ...
std::string MaskColorName
std::array< int, 2 > SizesContainer
void AddOrientation(double arg)