37#ifndef vtkCompositeDataDisplayAttributes_h
38#define vtkCompositeDataDisplayAttributes_h
43#include "vtkRenderingCoreModule.h"
49#include <unordered_map>
52#include "vtk_nlohmannjson.h"
53#include VTK_NLOHMANN_JSON(json.hpp)
56VTK_ABI_NAMESPACE_BEGIN
374 unsigned int flat_index,
vtkDataObject* parent_obj,
unsigned int current_flat_index = 0);
378 for (
auto entry : this->BlockVisibilities)
380 if (visitor(entry.first, entry.second))
409 using BoolMap = std::unordered_map<vtkDataObject*, bool>;
410 using DoubleMap = std::unordered_map<vtkDataObject*, double>;
411 using IntMap = std::unordered_map<vtkDataObject*, int>;
412 using VtkIdTypeMap = std::unordered_map<vtkDataObject*, vtkIdType>;
413 using ColorMap = std::unordered_map<vtkDataObject*, vtkColor3d>;
414 using RangeMap = std::unordered_map<vtkDataObject*, vtkVector2d>;
415 using StringMap = std::unordered_map<vtkDataObject*, std::string>;
416 using LookupTableMap = std::unordered_map<vtkDataObject*, vtkSmartPointer<vtkScalarsToColors>>;
418 BoolMap BlockVisibilities;
419 ColorMap BlockColors;
420 DoubleMap BlockOpacities;
421 StringMap BlockMaterials;
422 BoolMap BlockPickabilities;
423 BoolMap BlockScalarVisibilities;
424 BoolMap BlockUseLookupTableScalarRanges;
425 BoolMap BlockInterpolateScalarsBeforeMappings;
426 IntMap BlockColorModes;
427 IntMap BlockScalarModes;
428 IntMap BlockArrayAccessModes;
429 IntMap BlockArrayComponents;
430 IntMap BlockArrayIds;
431 RangeMap BlockScalarRanges;
432 StringMap BlockArrayNames;
433 LookupTableMap BlockLookupTables;
434 VtkIdTypeMap BlockFieldDataTupleIds;
Fast, simple class for representing and operating on 3D bounds.
Rendering attributes for a multi-block dataset.
void SetBlockColorMode(vtkDataObject *data_object, int value)
bool GetBlockPickability(vtkDataObject *data_object) const
Set/get the pickability for the block with data_object.
void RemoveBlockScalarRanges()
void SetBlockMaterial(vtkDataObject *data_object, const std::string &material)
Set/get the material for the block with data_object.
void SetBlockScalarVisibility(vtkDataObject *data_object, bool value)
bool HasBlockOpacities() const
Returns true if any block has an opacity set.
bool HasBlockColorModes() const
vtkCompositeDataDisplayAttributes()
void RemoveBlockFieldDataTupleIds()
bool HasBlockLookupTables() const
int GetBlockArrayId(vtkDataObject *data_object) const
bool HasBlockVisibilities() const
Returns true if any block has any block visibility is set.
bool HasBlockMaterials() const
Returns true if any block has an material set.
void RemoveBlockArrayId(vtkDataObject *data_object)
~vtkCompositeDataDisplayAttributes() override
void RemoveBlockFieldDataTupleId(vtkDataObject *data_object)
bool HasBlockScalarRange(vtkDataObject *data_object) const
bool HasBlockFieldDataTupleIds() const
vtkIdType GetBlockFieldDataTupleId(vtkDataObject *data_object) const
void SetBlockOpacity(vtkDataObject *data_object, double opacity)
Set/get the opacity for the block with data_object.
void SetBlockUseLookupTableScalarRange(vtkDataObject *data_object, bool value)
void RemoveBlockArrayName(vtkDataObject *data_object)
void RemoveBlockScalarVisibilities()
void SetBlockColor(vtkDataObject *data_object, const double color[3])
Set/get the color for the block with data_object.
void RemoveBlockArrayComponents()
bool HasBlockArrayName(vtkDataObject *data_object) const
void SetBlockScalarMode(vtkDataObject *data_object, int value)
void SetBlockVisibility(vtkDataObject *data_object, bool visible)
Set/get the visibility for the block with data_object.
void RemoveBlockLookupTable(vtkDataObject *data_object)
bool GetBlockVisibility(vtkDataObject *data_object) const
Set/get the visibility for the block with data_object.
void SetBlockPickability(vtkDataObject *data_object, bool visible)
Set/get the pickability for the block with data_object.
void RemoveBlockLookupTables()
void SetBlockArrayComponent(vtkDataObject *data_object, int value)
void RemoveBlockVisibilities()
Removes all block visibility flags.
bool HasBlockArrayId(vtkDataObject *data_object) const
bool HasBlockOpacity(vtkDataObject *data_object) const
Returns true if the block with data_object has an opacity set.
bool HasBlockPickability(vtkDataObject *data_object) const
Returns true if the block with the given data_object has a pickability set.
static vtkCompositeDataDisplayAttributes * New()
bool HasBlockArrayAccessModes() const
void RemoveBlockOpacities()
Removes all block opacities.
void RemoveBlockColor(vtkDataObject *data_object)
Removes the block color for the block with data_object.
void RemoveBlockScalarVisibility(vtkDataObject *data_object)
void GetBlockColor(vtkDataObject *data_object, double color[3]) const
Set/get the color for the block with data_object.
std::string GetBlockArrayName(vtkDataObject *data_object) const
void VisitVisibilities(std::function< bool(vtkDataObject *, bool)> visitor)
bool GetBlockScalarVisibility(vtkDataObject *data_object) const
void RemoveBlockInterpolateScalarsBeforeMappings()
void RemoveBlockInterpolateScalarsBeforeMapping(vtkDataObject *data_object)
void RemoveBlockColorModes()
void RemoveBlockArrayAccessModes()
void RemoveBlockArrayIds()
void SetBlockArrayName(vtkDataObject *data_object, const std::string &value)
double GetBlockOpacity(vtkDataObject *data_object) const
Set/get the opacity for the block with data_object.
bool HasBlockInterpolateScalarsBeforeMapping(vtkDataObject *data_object) const
nlohmann::json Serialize(vtkSerializer *serializer)
void SetBlockFieldDataTupleId(vtkDataObject *data_object, vtkIdType value)
bool HasBlockArrayIds() const
bool HasBlockUseLookupTableScalarRange(vtkDataObject *data_object) const
bool HasBlockUseLookupTableScalarRanges() const
bool HasBlockColor(vtkDataObject *data_object) const
Returns true if the block with the given data_object has a color.
void Deserialize(const nlohmann::json &state, vtkDeserializer *deserializer)
void SetBlockArrayAccessMode(vtkDataObject *data_object, int value)
bool GetBlockUseLookupTableScalarRange(vtkDataObject *data_object) const
void SetBlockLookupTable(vtkDataObject *data_object, vtkSmartPointer< vtkScalarsToColors > lut)
bool HasBlockInterpolateScalarsBeforeMappings() const
void RemoveBlockMaterial(vtkDataObject *data_object)
Removes the set material for the block with data_object.
bool HasBlockArrayNames() const
const std::string & GetBlockMaterial(vtkDataObject *data_object) const
Set/get the material for the block with data_object.
void RemoveBlockUseLookupTableScalarRange(vtkDataObject *data_object)
void RemoveBlockScalarRange(vtkDataObject *data_object)
bool HasBlockLookupTable(vtkDataObject *data_object) const
void RemoveBlockOpacity(vtkDataObject *data_object)
Removes the set opacity for the block with data_object.
bool HasBlockVisibility(vtkDataObject *data_object) const
Returns true if the block with the given data_object has a visibility set.
int GetBlockColorMode(vtkDataObject *data_object) const
int GetBlockArrayAccessMode(vtkDataObject *data_object) const
void RemoveBlockMaterials()
Removes all block materialss.
vtkVector2d GetBlockScalarRange(vtkDataObject *data_object) const
bool HasBlockArrayComponents() const
bool HasBlockFieldDataTupleId(vtkDataObject *data_object) const
bool HasBlockScalarModes() const
bool HasBlockPickabilities() const
Returns true if any block has any block pickability is set.
bool HasBlockScalarRanges() const
bool HasBlockArrayAccessMode(vtkDataObject *data_object) const
int GetBlockScalarMode(vtkDataObject *data_object) const
bool GetBlockInterpolateScalarsBeforeMapping(vtkDataObject *data_object) const
void SetBlockScalarRange(vtkDataObject *data_object, const vtkVector2d &value)
void RemoveBlockScalarMode(vtkDataObject *data_object)
void RemoveBlockColorMode(vtkDataObject *data_object)
bool HasBlockColors() const
Returns true if any block has any block color is set.
bool HasBlockScalarVisibility(vtkDataObject *data_object) const
void RemoveBlockPickabilities()
Removes all block pickability flags.
bool HasBlockScalarMode(vtkDataObject *data_object) const
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void RemoveBlockVisibility(vtkDataObject *data_object)
Removes the block visibility flag for the block with data_object.
static void ComputeVisibleBounds(vtkCompositeDataDisplayAttributes *cda, vtkDataObject *dobj, double bounds[6])
If the input dobj is a vtkCompositeDataSet, we will loop over the hierarchy recursively starting from...
static vtkDataObject * DataObjectFromIndex(unsigned int flat_index, vtkDataObject *parent_obj, unsigned int current_flat_index=0)
Get the DataObject corresponding to the node with index flat_index under parent_obj.
void SetBlockInterpolateScalarsBeforeMapping(vtkDataObject *data_object, bool value)
void RemoveBlockUseLookupTableScalarRanges()
bool HasBlockColorMode(vtkDataObject *data_object) const
bool HasBlockMaterial(vtkDataObject *data_object) const
Returns true if the block with data_object has an material set.
int GetBlockArrayComponent(vtkDataObject *data_object) const
bool HasBlockScalarVisibilities() const
void RemoveBlockArrayComponent(vtkDataObject *data_object)
void SetBlockArrayId(vtkDataObject *data_object, int value)
void RemoveBlockPickability(vtkDataObject *data_object)
Removes the block pickability flag for the block with data_object.
vtkSmartPointer< vtkScalarsToColors > GetBlockLookupTable(vtkDataObject *data_object) const
void RemoveBlockArrayNames()
void RemoveBlockArrayAccessMode(vtkDataObject *data_object)
bool HasBlockArrayComponent(vtkDataObject *data_object) const
vtkColor3d GetBlockColor(vtkDataObject *data_object) const
Set/get the color for the block with data_object.
void RemoveBlockColors()
Removes all block colors.
void RemoveBlockScalarModes()
general representation of visualization data
Deserialize VTK objects from JSON.
a simple class to control print indentation
abstract base class for most VTK objects
Superclass for mapping scalar values to colors.
Serialize VTK objects to JSON.
Hold a reference to a vtkObjectBase instance.
#define VTK_MARSHALMANUAL