Web Analytics Made Easy - Statcounter
Skip to content

Class SBDColorSchemeCPKConstantCarbons#

ClassList > SBDColorSchemeCPKConstantCarbons

This class describes a color scheme that sets a specified color for carbons and CPK colors for other atom element types. More...

  • #include <SBDColorSchemeCPKConstantCarbons.hpp>

Inherits the following classes: SBDDataGraphNodeColorScheme

Public Functions#

Type Name
SBDColorSchemeCPKConstantCarbons ()
Constructs a color scheme with the white color (1.0f, 1.0f, 1.0f, 1.0f)
SBDColorSchemeCPKConstantCarbons (float red, float green, float blue, float alpha=1.0f)
Constructs a color scheme with the given color (red, green, blue, alpha)
SBDColorSchemeCPKConstantCarbons (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha=255)
Constructs a color scheme with the given color (red, green, blue, alpha)
SBDColorSchemeCPKConstantCarbons (float * color)
Constructs a color scheme with the given color (color[0], color[1], color[2], color[3])
SBDColorSchemeCPKConstantCarbons (const SBColor & color)
Constructs a color scheme with the given color color .
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
Returns a color given a node and / or aposition .
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.
virtual void unserialize (SBCSerializer * serializer, const SBNodeIndexer & nodeIndexer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber & classVersionNumber=SBVersionNumber(1, 0, 0)) override
Unserializes the color scheme.
virtual ~SBDColorSchemeCPKConstantCarbons ()
Destructs the color scheme.

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

Color scheme that uses a constant color for carbon atoms and CPK colors for other atom types.

This class describes a color scheme that sets a specified color for carbons and CPK colors for other atom element types. Please refer to Color schemes for more information.

Short name: SBColorSchemeCPKConstantCarbons

See also: Color schemes

Public Functions Documentation#

function SBDColorSchemeCPKConstantCarbons [1/5]#

Constructs a color scheme with the white color (1.0f, 1.0f, 1.0f, 1.0f)

SBDColorSchemeCPKConstantCarbons::SBDColorSchemeCPKConstantCarbons () 

Constructs a color scheme with the default white color (1.0f, 1.0f, 1.0f, 1.0f).


function SBDColorSchemeCPKConstantCarbons [2/5]#

Constructs a color scheme with the given color (red, green, blue, alpha)

SBDColorSchemeCPKConstantCarbons::SBDColorSchemeCPKConstantCarbons (
    float red,
    float green,
    float blue,
    float alpha=1.0f
) 

Constructs a color scheme with the given RGBA color components.

Parameters:

  • red Red component in the range [0.0, 1.0].
  • green Green component in the range [0.0, 1.0].
  • blue Blue component in the range [0.0, 1.0].
  • alpha Alpha component in the range [0.0, 1.0]; defaults to 1.0.

function SBDColorSchemeCPKConstantCarbons [3/5]#

Constructs a color scheme with the given color (red, green, blue, alpha)

SBDColorSchemeCPKConstantCarbons::SBDColorSchemeCPKConstantCarbons (
    unsigned char red,
    unsigned char green,
    unsigned char blue,
    unsigned char alpha=255
) 

Constructs a color scheme with the given RGBA color components as unsigned bytes.

Parameters:

  • red Red component in the range [0, 255].
  • green Green component in the range [0, 255].
  • blue Blue component in the range [0, 255].
  • alpha Alpha component in the range [0, 255]; defaults to 255.

function SBDColorSchemeCPKConstantCarbons [4/5]#

Constructs a color scheme with the given color (color[0], color[1], color[2], color[3])

SBDColorSchemeCPKConstantCarbons::SBDColorSchemeCPKConstantCarbons (
    float * color
) 

Constructs a color scheme with the given RGBA color array.

Parameters:

  • color Pointer to an array of four floats representing red, green, blue, and alpha.

function SBDColorSchemeCPKConstantCarbons [5/5]#

Constructs a color scheme with the given color color .

SBDColorSchemeCPKConstantCarbons::SBDColorSchemeCPKConstantCarbons (
    const SBColor & color
) 

Constructs a color scheme with the given SBColor instance.

Parameters:

  • color SBColor object specifying the RGBA color.

function clone#

Returns a copy of the color scheme.

virtual SBDDataGraphNodeColorScheme * SBDColorSchemeCPKConstantCarbons::clone () override const

Creates a new instance of the color scheme with the same color settings.

Returns:

Pointer to a newly allocated copy of the color scheme.

Implements SBDDataGraphNodeColorScheme::clone


function getColor#

Returns a color given a node and / or aposition .

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

Retrieves the RGBA color for a given node and position.

Parameters:

  • color Output array of four floats that receives the color (red, green, blue, alpha).
  • node Node for which the color is requested; may be null.
  • position Position of the node; not used in this implementation.

Implements SBDDataGraphNodeColorScheme::getColor


function isSerializable#

Returns true __

virtual bool SBDColorSchemeCPKConstantCarbons::isSerializable () override const

Indicates whether the color scheme supports serialization.

Returns:

true, indicating the scheme can be serialized.

Implements SBDDataGraphNodeColorScheme::isSerializable


function serialize#

Serializes the color scheme.

virtual void SBDColorSchemeCPKConstantCarbons::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 RGBA color components.

Parameters:

  • serializer Serializer object used to write data.
  • nodeIndexer Indexer that maps nodes to identifiers (unused in this implementation).
  • sdkVersionNumber Version number of the SDK (unused in this implementation).
  • classVersionNumber Version number of the class (unused in this implementation).

Implements SBDDataGraphNodeColorScheme::serialize


function unserialize#

Unserializes the color scheme.

virtual void SBDColorSchemeCPKConstantCarbons::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 RGBA color components.

Parameters:

  • serializer Serializer object used to read data.
  • nodeIndexer Indexer that maps nodes to identifiers (unused in this implementation).
  • sdkVersionNumber Version number of the SDK (unused in this implementation).
  • classVersionNumber Version number of the class (unused in this implementation).

Implements SBDDataGraphNodeColorScheme::unserialize


function ~SBDColorSchemeCPKConstantCarbons#

Destructs the color scheme.

virtual SBDColorSchemeCPKConstantCarbons::~SBDColorSchemeCPKConstantCarbons () 

Destroys the color scheme and releases any allocated resources.