|  | VTK
    9.0.1
    | 
 
 
 
Go to the documentation of this file.
   15 #ifndef vtkWordCloud_h 
   16 #define vtkWordCloud_h 
   20 #include "vtkInfovisCoreModule.h"  
  200   using PairType = std::tuple<std::string, std::string>;
 
  213 #define SetStdContainerMacro(name, container)                                                      \ 
  214   virtual void Set##name(container arg)                                                            \ 
  216     bool changed = false;                                                                          \ 
  217     if (arg.size() != name.size())                                                                 \ 
  223       auto a = arg.begin();                                                                        \ 
  224       for (auto r : name)                                                                          \ 
  247     if (arg != BackgroundColorName)
 
  250       BackgroundColorName = arg;
 
  281     if (ColorSchemeName != arg)
 
  284       ColorSchemeName = arg;
 
  297   vtkSetMacro(DPI, 
int);
 
  298   vtkGetMacro(DPI, 
int);
 
  325     if (FontFileName != arg)
 
  339   vtkSetMacro(Gap, 
int);
 
  340   vtkGetMacro(Gap, 
int);
 
  351     if (MaskColorName != arg)
 
  372     if (MaskFileName != arg)
 
  385   vtkSetMacro(MaxFontSize, 
int);
 
  386   vtkGetMacro(MaxFontSize, 
int);
 
  393   vtkSetMacro(MinFontSize, 
int);
 
  394   vtkGetMacro(MinFontSize, 
int);
 
  403   vtkSetMacro(MinFrequency, 
int);
 
  404   vtkGetMacro(MinFrequency, 
int);
 
  412   vtkSetMacro(FontMultiplier, 
int);
 
  413   vtkGetMacro(FontMultiplier, 
int);
 
  444     return OrientationDistribution;
 
  457     Orientations.push_back(arg);
 
  472     ReplacementPairs.push_back(arg);
 
  496     StopWords.insert(word);
 
  514     if (StopListFileName != arg)
 
  517       StopListFileName = arg;
 
  547     if (WordColorName != arg)
 
  621   typedef std::function<bool(std::pair<std::string, int>, std::pair<std::string, int>)> Comparator;
 
  623   std::multiset<std::pair<std::string, int>, Comparator> FindWordsSortedByFrequency(
 
  627     ExtentOffset(
int _x = 0.0, 
int _y = 0.0)
 
  
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called in response to a REQUEST_DATA request from the executive.
virtual std::vector< std::string > & GetKeptWords()
Get a vector of words that are kept in the final image.
std::string ColorSchemeName
OffsetDistributionContainer OffsetDistribution
std::array< int, 2 > OffsetDistributionContainer
std::tuple< std::string, std::string > PairType
ColorDistributionContainer ColorDistribution
std::array< double, 2 > ColorDistributionContainer
virtual void SetFontFileName(std::string arg)
Set/Get FontFileName, If empty, the built-in Arial font is used().
virtual StopWordsContainer GetStopWords()
virtual void Modified()
Update the modification time for this object.
virtual void SetMaskColorName(std::string arg)
Set/Get MaskColorName, the name of the color for the mask (black).
std::vector< double > OrientationsContainer
std::vector< std::string > StringContainer
Generic algorithm superclass for image algs.
OrientationsContainer Orientations
std::string MaskColorName
virtual void SetMaskFileName(std::string arg)
Set/Get MaskFileName, the mask file name().
virtual std::string GetTitle()
std::vector< std::string > SkippedWords
virtual void SetBWMask(bool arg)
Set/Get boolean that indicates the mask image is a single channel(false).
virtual SizesContainer GetSizes()
virtual std::string GetWordColorName()
std::vector< PairType > ReplacementPairsContainer
virtual void SetWordColorName(std::string arg)
Set/Get WordColorName, the name of the color for the words().
generate a word cloud visualization of a text document
std::string StopListFileName
SizesContainer AdjustedSizes
virtual OrientationDistributionContainer GetOrientationDistribution()
virtual std::string GetStopListFileName()
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 int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
virtual OffsetDistributionContainer GetOffsetDistribution()
vtkSmartPointer< vtkImageData > ImageData
virtual OrientationsContainer GetOrientations()
std::set< std::string > StopWordsContainer
void AddReplacementPair(PairType arg)
OrientationDistributionContainer OrientationDistribution
a simple class to control print indentation
virtual std::string GetFileName()
virtual std::string GetMaskFileName()
virtual std::string GetBackgroundColorName()
std::vector< std::string > KeptWords
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 void SetStopListFileName(std::string arg)
Set/Get StopListFileName, the name of the file that contains the stop words, one per line.
void AddOrientation(double arg)
StopWordsContainer StopWords
virtual std::string GetColorSchemeName()
#define SetStdContainerMacro(name, container)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkAlgorithm * New()
std::vector< std::string > StoppedWords
virtual ColorDistributionContainer GetColorDistribution()
virtual SizesContainer GetAdjustedSizes()
Return the AdjustedSizes of the resized mask file.
virtual std::vector< std::string > & GetSkippedWords()
Get a vector of words that are skipped.
std::string BackgroundColorName
virtual std::string GetMaskColorName()
void AddStopWord(std::string word)
virtual std::string GetFontFileName()
virtual ReplacementPairsContainer GetReplacementPairs()
std::string WordColorName
ReplacementPairsContainer ReplacementPairs
std::array< double, 2 > OrientationDistributionContainer
std::array< int, 2 > SizesContainer
virtual std::vector< std::string > & GetStoppedWords()
Get a vector of words that were stopped in the final image.
virtual void SetBackgroundColorName(std::string arg)
Set/Get the vtkNamedColors name for the background(MidNightBlue).
virtual void SetFileName(std::string arg)
Set/Get FileName, the name of the file that contains the text to be processed.