/usr/include/paraview/vtkSMTransferFunctionPresets.h is in paraview-dev 5.0.1+dfsg1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | /*=========================================================================
Program: ParaView
Module: vtkSMTransferFunctionPresets.h
Copyright (c) Kitware, Inc.
All rights reserved.
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 vtkSMTransferFunctionPresets - manages presets for color, opacity,
// and annotation presets.
// .SECTION Description
// vtkSMTransferFunctionPresets is a manager to manage all color, opacity, and
// annotation presets. It also uses vtkSMSettings to support persistent
// customizations besides hard-coded/builtin presets.
//
// vtkSMTransferFunctionPresets designed to be instantiated, used and then
// destroyed. While there is no explicit synchronization between multiple
// instances of vtkSMTransferFunctionPresets, there should not be any need to
// have multiple instances alive at the same time.
#ifndef vtkSMTransferFunctionPresets_h
#define vtkSMTransferFunctionPresets_h
#include "vtkPVServerManagerRenderingModule.h" // needed for exports
#include "vtkSMObject.h"
#include "vtkStdString.h" // needed for vtkStdString.
// forward declare Json::Value
namespace Json
{
class Value;
class ValueConstIterator;
}
class vtkPVXMLElement;
class VTKPVSERVERMANAGERRENDERING_EXPORT vtkSMTransferFunctionPresets : public vtkSMObject
{
public:
static vtkSMTransferFunctionPresets* New();
vtkTypeMacro(vtkSMTransferFunctionPresets, vtkSMObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Returns the number of presets current available (including builtin and
// custom).
unsigned int GetNumberOfPresets();
// Description:
// Gets the raw text for a preset given its index. The preset is provided as a JSON string.
// Returns an empty string when not available.
vtkStdString GetPresetAsString(unsigned int index);
// Description:
// Add a new preset. This will get saved across sessions using vtkSMSettings,
// as appropriate. If name provided already exists, this will override the
// existing preset (even for builtin presets).
// \c preset must be a valid JSON string. If not, this will return failure.
bool AddPreset(const char* name, const vtkStdString& preset);
// Description:
// Remove a preset. This has no effect for builtin presets.
bool RemovePreset(unsigned int index);
// Description:
// Returns a preset JSON given the name. Since multiple presets can have the
// same name, this returns the 'first' preset with the specified name.
const Json::Value& GetFirstPresetWithName(const char* name);
// Description:
// Returns a preset at a given index.
const Json::Value& GetPreset(unsigned int index);
// Description:
// Returns the name for a preset at the given index.
vtkStdString GetPresetName(unsigned int index);
// Description:
// Returns true if the preset has opacities i.e. values for a piecewise function.
bool GetPresetHasOpacities(const Json::Value& preset);
bool GetPresetHasOpacities(unsigned int index)
{ return this->GetPresetHasOpacities(this->GetPreset(index)); }
// Description:
// Returns true is the preset has indexed colors.
bool GetPresetHasIndexedColors(const Json::Value& preset);
bool GetPresetHasIndexedColors(unsigned int index)
{ return this->GetPresetHasIndexedColors(this->GetPreset(index)); }
// Description:
// Returns true is the preset has annotations.
bool GetPresetHasAnnotations(const Json::Value& preset);
bool GetPresetHasAnnotations(unsigned int index)
{ return this->GetPresetHasAnnotations(this->GetPreset(index)); }
// Description:
// Add a preset give the Json::Value object.
bool AddPreset(const char* name, const Json::Value& preset);
// Description:
// Same as AddPreset() expect it create a unique name using the prefix
// provided. If no prefix is specified, "Preset" will be used as the prefix.
vtkStdString AddUniquePreset(const Json::Value& preset, const char* prefix=NULL);
// Description:
// Returns true if the preset is a builtin preset.
// The preset is identified by its index.
bool IsPresetBuiltin(unsigned int index);
// Description:
// Rename a preset.
bool RenamePreset(unsigned int index, const char* newname);
// Description:
// Load presets from a file. All presets are added to "custom" presets list
// and are considered as non-builtin.
// If the filename ends with a .xml, it's assumed to be a legacy color map XML
// and will be converted to the new format before processing.
bool ImportPresets(const char* filename);
bool ImportPresets(const Json::Value& presets);
//BTX
protected:
vtkSMTransferFunctionPresets();
~vtkSMTransferFunctionPresets();
private:
vtkSMTransferFunctionPresets(const vtkSMTransferFunctionPresets&); // Not implemented
void operator=(const vtkSMTransferFunctionPresets&); // Not implemented
class vtkInternals;
vtkInternals* Internals;
//ETX
};
#endif
|