Web Analytics Made Easy - Statcounter
Skip to content

Class SBDColorSchemeCPK#

ClassList > SBDColorSchemeCPK

This class describes a CPK color scheme. More...

  • #include <SBDColorSchemeCPK.hpp>

Inherits the following classes: SBDDataGraphNodeColorScheme

Public Functions#

Type Name
SBDColorSchemeCPK ()
Constructs a CPK color scheme.
SBDColorSchemeCPK (const SBNodeIndexer & nodeIndexer)
Constructs a CPK 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
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 ~SBDColorSchemeCPK ()
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#

Please refer to Color schemes for more information.

Short name: SBColorSchemeCPK

See also: Color schemes

Public Functions Documentation#

function SBDColorSchemeCPK [1/2]#

Constructs a CPK color scheme.

SBDColorSchemeCPK::SBDColorSchemeCPK () 

Initializes a new instance of the SBDColorSchemeCPK class with default settings.


function SBDColorSchemeCPK [2/2]#

Constructs a CPK color scheme.

SBDColorSchemeCPK::SBDColorSchemeCPK (
    const SBNodeIndexer & nodeIndexer
) 

Constructs a CPK color scheme with a node indexer.

Initializes a new instance of the SBDColorSchemeCPK class using the provided SBNodeIndexer.

Parameters:

  • nodeIndexer The node indexer to associate with the color scheme.

function clone#

Returns a copy of the color scheme.

virtual SBDDataGraphNodeColorScheme * SBDColorSchemeCPK::clone () override const

Creates a copy of the color scheme.

Returns a new instance that is a copy of this color scheme.

Returns:

A pointer to a new SBDDataGraphNodeColorScheme that is a copy of this instance.

Implements SBDDataGraphNodeColorScheme::clone


function getColor#

Returns a color given a node and / or aposition .

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

Retrieves the color for a given node and position.

Computes the color based on the provided node and position. If no node is supplied, the color is set to black.

Parameters:

  • color Output array of four floats (RGBA) to receive the color.
  • node The node for which to retrieve the color; may be null.
  • position The position associated with the node; defaults to zero if not used.

Implements SBDDataGraphNodeColorScheme::getColor


function isSerializable#

Returns true __

virtual bool SBDColorSchemeCPK::isSerializable () override const

Checks whether the color scheme supports serialization.

Returns true if the color scheme can be serialized, false otherwise.

Returns:

true if the color scheme is serializable; otherwise false.

Implements SBDDataGraphNodeColorScheme::isSerializable


function serialize#

Serializes the color scheme.

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

Writes the color scheme data to the provided serializer.

Parameters:

  • serializer The serializer used to write the data.
  • nodeIndexer The node indexer associated with the color scheme.
  • sdkVersionNumber The SDK version number.
  • classVersionNumber The class version number.

Implements SBDDataGraphNodeColorScheme::serialize


function unserialize#

Unserializes the color scheme.

virtual void SBDColorSchemeCPK::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.

Reads the color scheme data from the provided serializer.

Parameters:

  • serializer The serializer used to read the data.
  • nodeIndexer The node indexer associated with the color scheme.
  • sdkVersionNumber The SDK version number.
  • classVersionNumber The class version number.

Implements SBDDataGraphNodeColorScheme::unserialize


function ~SBDColorSchemeCPK#

Destructs the color scheme.

virtual SBDColorSchemeCPK::~SBDColorSchemeCPK () 

Destroys the CPK color scheme.

Releases any resources held by the SBDColorSchemeCPK instance.