Web Analytics Made Easy - Statcounter
Skip to content

Class SBDColorSchemeCPKPerChainCarbons#

ClassList > SBDColorSchemeCPKPerChainCarbons

This class describes a color scheme that sets colors for carbons based on their chain ID and CPK colors for other atom element types. More...

  • #include <SBDColorSchemeCPKPerChainCarbons.hpp>

Inherits the following classes: SBDColorSchemePerAttribute

Public Functions#

Type Name
SBDColorSchemeCPKPerChainCarbons ()
Constructs a color scheme.
SBDColorSchemeCPKPerChainCarbons (const SBNodeIndexer & nodeIndexer, const SBDPalette * palette=nullptr)
Constructs a color scheme.
virtual SBDDataGraphNodeColorScheme * clone () override const
Returns a copy of the color scheme.
virtual void getColor (float * color, SBDDataGraphNode * node=nullptr, const SBPosition3 & position=SBPosition3::zero) override const
Retrieves the color for a specified node.
virtual SBDPalette * getDefaultPalette () override const
Returns a clone of the default color palette for this color scheme.
virtual bool isSerializable () override const
Returns true __
virtual void serialize (SBCSerializer * serializer, const SBNodeIndexer & nodeIndexer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber & classVersionNumber=SBVersionNumber(1, 0, 0)) override const
Serializes the color scheme's state to the provided serializer.
virtual void unserialize (SBCSerializer * serializer, const SBNodeIndexer & nodeIndexer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber & classVersionNumber=SBVersionNumber(1, 0, 0)) override
Deserializes the color scheme's state from the provided serializer.
virtual ~SBDColorSchemeCPKPerChainCarbons ()
Destructs the color scheme.

Public Functions inherited from SBDColorSchemePerAttribute#

See SBDColorSchemePerAttribute

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 .
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#

See 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 inherited from SBDColorSchemePerAttribute#

See SBDColorSchemePerAttribute

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#

See 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#

See SBCReferenceTarget

Type Name
SBCReferenceTarget (SBCReferenceTargetData * dataPointer)
Protected constructor.
void removeAllReferenceOwners ()
Stops all the reference owners from referencing this reference target.

Detailed Description#

Please refer to Color schemes for more information.

Short name: SBColorSchemeCPKPerChainCarbons

See also: Color schemes

Public Functions Documentation#

function SBDColorSchemeCPKPerChainCarbons [1/2]#

Constructs a color scheme.

SBDColorSchemeCPKPerChainCarbons::SBDColorSchemeCPKPerChainCarbons () 

Constructs a default color scheme for CPK per chain carbons.

Initializes internal values, node predicate and getter, and sets the color palette to the default one.


function SBDColorSchemeCPKPerChainCarbons [2/2]#

Constructs a color scheme.

SBDColorSchemeCPKPerChainCarbons::SBDColorSchemeCPKPerChainCarbons (
    const SBNodeIndexer & nodeIndexer,
    const SBDPalette * palette=nullptr
) 

Constructs a color scheme with a specified node indexer and optional palette.

If the palette is null, the default palette is used.

Parameters:

  • nodeIndexer Indexer that identifies nodes for the color scheme.
  • palette Optional palette to use; when nullptr, the default palette is assigned.

function clone#

Returns a copy of the color scheme.

virtual SBDDataGraphNodeColorScheme * SBDColorSchemeCPKPerChainCarbons::clone () override const

Creates a copy of this color scheme.

The copy retains the same node indexer, palette, and value ranges.

Returns:

Pointer to a newly allocated clone of the color scheme.

Implements SBDDataGraphNodeColorScheme::clone


function getColor#

Retrieves the color for a specified node.

virtual void SBDColorSchemeCPKPerChainCarbons::getColor (
    float * color,
    SBDDataGraphNode * node=nullptr,
    const SBPosition3 & position=SBPosition3::zero
) override const

Determines the appropriate color based on the node's type and attributes, using CPK colors for non‑carbon atoms and a palette for carbon atoms.

Parameters:

  • color Output buffer (RGBA) where the resulting color will be stored.
  • node Node for which the color is requested; may be null.
  • position Position of the point (unused in this scheme).

Implements SBDColorSchemePerAttribute::getColor


function getDefaultPalette#

Returns a clone of the default color palette for this color scheme.

virtual SBDPalette * SBDColorSchemeCPKPerChainCarbons::getDefaultPalette () override const

Returns a clone of the default palette for this color scheme.

The default palette is a flexible diverging HCL spectral palette.

Returns:

Pointer to a new palette instance.

Implements SBDColorSchemePerAttribute::getDefaultPalette


function isSerializable#

Returns true __

virtual bool SBDColorSchemeCPKPerChainCarbons::isSerializable () override const

Indicates whether the color scheme supports serialization.

Returns:

Always true.

Implements SBDColorSchemePerAttribute::isSerializable


function serialize#

Serializes the color scheme's state to the provided serializer.

virtual void SBDColorSchemeCPKPerChainCarbons::serialize (
    SBCSerializer * serializer,
    const SBNodeIndexer & nodeIndexer,
    const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER,
    const SBVersionNumber & classVersionNumber=SBVersionNumber (1, 0, 0)
) override const

The serialization includes palette information and value ranges.

Parameters:

  • serializer Serializer object used to write data.
  • nodeIndexer Node indexer used for serialization context.
  • sdkVersionNumber SDK version number for compatibility handling.
  • classVersionNumber Class version number for compatibility handling.

Implements SBDColorSchemePerAttribute::serialize


function unserialize#

Deserializes the color scheme's state from the provided serializer.

virtual void SBDColorSchemeCPKPerChainCarbons::unserialize (
    SBCSerializer * serializer,
    const SBNodeIndexer & nodeIndexer,
    const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER,
    const SBVersionNumber & classVersionNumber=SBVersionNumber (1, 0, 0)
) override

Reads palette information and value ranges, restoring the object's state.

Parameters:

  • serializer Serializer object used to read data.
  • nodeIndexer Node indexer used for deserialization context.
  • sdkVersionNumber SDK version number for compatibility handling.
  • classVersionNumber Class version number for compatibility handling.

Implements SBDColorSchemePerAttribute::unserialize


function ~SBDColorSchemeCPKPerChainCarbons#

Destructs the color scheme.

virtual SBDColorSchemeCPKPerChainCarbons::~SBDColorSchemeCPKPerChainCarbons () 

Destroys the color scheme and releases resources.