Class SBDColorSchemePerAttribute#
template <typename Output>
ClassList > SBDColorSchemePerAttribute
This class describes a color scheme based on node attributes. More...
#include "SBDColorSchemePerAttribute.hpp"
Inherits the following classes: SBDDataGraphNodeColorScheme
Public Functions#
Type | Name |
---|---|
SBDColorSchemePerAttribute () Default constructor. |
|
SBDColorSchemePerAttribute (const SBNodeIndexer & nodeIndexer, const SBDDataGraphNodePredicate & nodePredicate, const SBDDataGraphNodeGetter< Output > & nodeGetter) Constructs a color scheme based on node attributes. |
|
virtual bool | canHavePalette () override const Returns whether the color scheme requires and therefore can have a color palette. |
virtual void | getColor (float * color, SBDDataGraphNode * node=nullptr, const SBPosition3 & position=SBPosition3::zero) override const Returns a color given a node and / or aposition . |
Output | getDefaultMaximumValue () const Returns the default maximum value for the attribute bounds used for colorization. It is computed during the color scheme construction based on the given node indexer and predicates. |
Output | getDefaultMinimumValue () const Returns the default minimum value for the attribute bounds used for colorization. It is computed during the color scheme construction based on the given node indexer and predicates. |
virtual SBDPalette * | getDefaultPalette () override const Returns a clone of the default color palette for this color scheme. |
Output | getMaximumValue () const Returns the maximum value for the attribute bounds used for colorization. |
Output | getMinimumValue () const Returns the minimum value for the attribute bounds used for colorization. |
virtual bool | isSerializable () override const Returns false - this base class is not serializable and the serialization should be implemented in the derived classes. |
virtual void | serialize (SBCSerializer * serializer, const SBNodeIndexer & nodeIndexer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber & classVersionNumber=SBVersionNumber(1, 0, 0)) override const A virtual function function for the serialization - should be implemented in the derived classes. |
void | setMaximumValue (Output value) Sets the maximum value for the attribute bounds used for colorization. |
void | setMinimumValue (Output value) Sets the minimum value for the attribute bounds used for colorization. |
virtual void | unserialize (SBCSerializer * serializer, const SBNodeIndexer & nodeIndexer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber & classVersionNumber=SBVersionNumber(1, 0, 0)) override A virtual function function for the unserialization - should be implemented in the derived classes. |
virtual | ~SBDColorSchemePerAttribute () Destructor. |
Public Functions inherited from SBDDataGraphNodeColorScheme#
See SBDDataGraphNodeColorScheme
Type | Name |
---|---|
SBDDataGraphNodeColorScheme () Constructs a color scheme. |
|
virtual bool | canHavePalette () const Returns whether the color scheme requires and therefore can have a color palette. |
virtual SBDDataGraphNodeColorScheme * | clone () const Returns a copy of the color scheme. |
virtual void | getColor (float * color, SBDDataGraphNode * node=nullptr, const SBPosition3 & position=SBPosition3::zero) const Returns a color given a node and / or aposition . |
SBDDataGraphNodeColorSchemeData * | getDataPointer () |
const SBDDataGraphNodeColorSchemeData * | getDataPointer () const |
virtual SBDPalette * | getDefaultPalette () const Returns a clone of the default color palette for this color scheme. |
const SBDPalette * | getPalette () const Returns a pointer to a color palette owned by the color scheme. |
bool | hasPalette () const Returns whether the color scheme has a color palette defined. |
virtual bool | isSerializable () const Returns true when the class is serializable. |
void | requestUpdate () Requests a material update for a node to which the material that owns this color scheme is applied. |
void | resetPalette () Resets the color palette to the default one for color schemes that can have it. |
virtual void | serialize (SBCSerializer * serializer, const SBNodeIndexer & nodeIndexer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber & classVersionNumber=SBVersionNumber(1, 0, 0)) const Serializes the color scheme. |
void | setPalette (SBDPalette * palette) Sets the color palette for color schemes that can have it. The color scheme takes ownership of the color palette. If NULL is supplied then it will reset to the default color palette. |
virtual void | unserialize (SBCSerializer * serializer, const SBNodeIndexer & nodeIndexer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber & classVersionNumber=SBVersionNumber(1, 0, 0)) Unserializes the color scheme. |
virtual | ~SBDDataGraphNodeColorScheme () Destructs the color scheme. |
Public Functions inherited from SBCReferenceTarget#
Type | Name |
---|---|
SBCReferenceTarget () Builds the reference target. |
|
unsigned int | getMemoryFootprint () const Returns the memory footprint. |
void | printReferencesToOwners () const Prints the references to the owners of this reference target. |
virtual | ~SBCReferenceTarget () Destructor. |
Protected Attributes#
Type | Name |
---|---|
Output * | defaultMaxValue The default maximum value for the attribute bounds determined when constructing the color scheme based on the input node indexer. |
Output * | defaultMinValue The default minimum value for the attribute bounds determined when constructing the color scheme based on the input node indexer. |
Output * | maxValue The current maximum value for the attribute bounds used for colorization. |
Output * | minValue The current minimum value for the attribute bounds used for colorization. |
SBDDataGraphNodeGetter< Output > * | nodeGetter The node getter. |
SBNodeIndexer | nodeIndexer The node indexer. |
SBDDataGraphNodePredicate * | nodePredicate The node predicate. |
Protected Attributes inherited from SBCReferenceTarget#
Type | Name |
---|---|
SBCReferenceTargetData * | dataPointer A pointer to the private data. |
Protected Functions inherited from SBDDataGraphNodeColorScheme#
See SBDDataGraphNodeColorScheme
Type | Name |
---|---|
SBDDataGraphNodeColorScheme (SBDDataGraphNodeColorSchemeData * dataPointer) Protected constructor. |
Protected Functions inherited from SBCReferenceTarget#
Type | Name |
---|---|
SBCReferenceTarget (SBCReferenceTargetData * dataPointer) Protected constructor. |
|
void | removeAllReferenceOwners () Stops all the reference owners from referencing this reference target. |
Detailed Description#
Short name: SBColorSchemePerAttribute
Public Functions Documentation#
function SBDColorSchemePerAttribute [1/2]#
Default constructor.
function SBDColorSchemePerAttribute [2/2]#
Constructs a color scheme based on node attributes.
inline SBDColorSchemePerAttribute::SBDColorSchemePerAttribute (
const SBNodeIndexer & nodeIndexer,
const SBDDataGraphNodePredicate & nodePredicate,
const SBDDataGraphNodeGetter < Output > & nodeGetter
)
Parameters:
nodeIndexer
An indexer of nodes based on which the color scheme is constructed. The color scheme stores a copy of this node indexer.nodePredicate
A predicate based on which nodes will be collected fromnodeIndexer
. The color scheme stores a copy of this node predicate.nodeGetter
A predicate that returns the attribute for nodes obtained fromnodeIndexer
using the give node predicatenodePredicate
. The color scheme stores a copy of this node getter.
For example, to colorize atoms per chain ID the node predicate can be set to SBNode::IsAtom() && SBAtom::HasChainID()
and the node getter to SBAtom::GetChainID()
.
function canHavePalette#
Returns whether the color scheme requires and therefore can have a color palette.
Implements SBDDataGraphNodeColorScheme::canHavePalette
function getColor#
Returns a color given a node
and / or aposition
.
inline virtual void SBDColorSchemePerAttribute::getColor (
float * color,
SBDDataGraphNode * node=nullptr,
const SBPosition3 & position=SBPosition3::zero
) override const
The latter one is usually not used in the per attribute color schemes, since the color is determined based on some attribute of the given node node
.
Parameters:
color
The output color. It should be a pointer to an array of floats of size 4.node
The node for which color should be returned.position
The position for which color should be returned. Usually, not used in the per attribute color schemes.
Implements SBDDataGraphNodeColorScheme::getColor
function getDefaultMaximumValue#
Returns the default maximum value for the attribute bounds used for colorization. It is computed during the color scheme construction based on the given node indexer and predicates.
function getDefaultMinimumValue#
Returns the default minimum value for the attribute bounds used for colorization. It is computed during the color scheme construction based on the given node indexer and predicates.
function getDefaultPalette#
Returns a clone of the default color palette for this color scheme.
Implements SBDDataGraphNodeColorScheme::getDefaultPalette
function getMaximumValue#
Returns the maximum value for the attribute bounds used for colorization.
function getMinimumValue#
Returns the minimum value for the attribute bounds used for colorization.
function isSerializable#
Returns false - this base class is not serializable and the serialization should be implemented in the derived classes.
Implements SBDDataGraphNodeColorScheme::isSerializable
function serialize#
A virtual function function for the serialization - should be implemented in the derived classes.
inline virtual void SBDColorSchemePerAttribute::serialize (
SBCSerializer * serializer,
const SBNodeIndexer & nodeIndexer,
const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER,
const SBVersionNumber & classVersionNumber=SBVersionNumber (1, 0, 0)
) override const
Implements SBDDataGraphNodeColorScheme::serialize
function setMaximumValue#
Sets the maximum value for the attribute bounds used for colorization.
Parameters:
value
The new maximum value
function setMinimumValue#
Sets the minimum value for the attribute bounds used for colorization.
Parameters:
value
The new minimum value
function unserialize#
A virtual function function for the unserialization - should be implemented in the derived classes.
inline virtual void SBDColorSchemePerAttribute::unserialize (
SBCSerializer * serializer,
const SBNodeIndexer & nodeIndexer,
const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER,
const SBVersionNumber & classVersionNumber=SBVersionNumber (1, 0, 0)
) override
Implements SBDDataGraphNodeColorScheme::unserialize
function ~SBDColorSchemePerAttribute#
Destructor.
Protected Attributes Documentation#
variable defaultMaxValue#
The default maximum value for the attribute bounds determined when constructing the color scheme based on the input node indexer.
variable defaultMinValue#
The default minimum value for the attribute bounds determined when constructing the color scheme based on the input node indexer.
variable maxValue#
The current maximum value for the attribute bounds used for colorization.
variable minValue#
The current minimum value for the attribute bounds used for colorization.
variable nodeGetter#
The node getter.
variable nodeIndexer#
The node indexer.
variable nodePredicate#
The node predicate.