Class SBDColorSchemePerStructuralModel#
ClassList > SBDColorSchemePerStructuralModel
This class describes a per structural model color scheme. More...
#include <SBDColorSchemePerStructuralModel.hpp>
Inherits the following classes: SBDDataGraphNodeColorScheme
Inherited by the following classes: SBDColorSchemeCPKPerStructuralModelCarbons, SBDColorSchemePerStructuralModelIllustrate
Public Functions#
| Type | Name |
|---|---|
| SBDColorSchemePerStructuralModel () Constructs a color scheme. |
|
| SBDColorSchemePerStructuralModel (const SBNodeIndexer & nodeIndexer, const SBDPalette * palette=nullptr) Constructs a color scheme. |
|
| virtual bool | canHavePalette () override const Returns whether the color scheme requires and therefore can have a color palette. |
| 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 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 document. |
| 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 document. |
| virtual | ~SBDColorSchemePerStructuralModel () 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#
| 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#
| 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#
Please refer to Color schemes for more information.
Short name: SBColorSchemePerStructuralModel
See also: Color schemes
Public Functions Documentation#
function SBDColorSchemePerStructuralModel [1/2]#
Constructs a color scheme.
Constructs a per structural model color scheme with default settings.
Initializes the color scheme and sets the color palette to the default palette.
function SBDColorSchemePerStructuralModel [2/2]#
Constructs a color scheme.
SBDColorSchemePerStructuralModel::SBDColorSchemePerStructuralModel (
const SBNodeIndexer & nodeIndexer,
const SBDPalette * palette=nullptr
)
Constructs a per structural model color scheme with a specific node indexer and optional palette.
Initializes the color scheme, sets the provided palette if non-null, otherwise uses the default palette, and stores structural models from the given node indexer.
Parameters:
nodeIndexerThe node indexer containing nodes to be considered for the color scheme.paletteOptional pointer to a palette to use; if nullptr, the default palette is used.
function canHavePalette#
Returns whether the color scheme requires and therefore can have a color palette.
Indicates whether the color scheme can have a color palette.
Returns:
true indicating that the color scheme can have a palette.
Implements SBDDataGraphNodeColorScheme::canHavePalette
function clone#
Returns a copy of the color scheme.
Creates a copy of the color scheme.
Returns:
A pointer to a new SBDDataGraphNodeColorScheme instance that is a copy of this color scheme.
Implements SBDDataGraphNodeColorScheme::clone
function getColor#
Returns a color given a node and / or aposition .
virtual void SBDColorSchemePerStructuralModel::getColor (
float * color,
SBDDataGraphNode * node=nullptr,
const SBPosition3 & position=SBPosition3::zero
) override const
Retrieves the color for a given data graph node and position.
Computes the color based on the structural model associated with the node or returns the atom's element color if applicable.
Parameters:
colorOutput array of four floats (RGBA) to receive the color.nodeOptional pointer to a data graph node; may benullptr.positionThe position in 3D space; currently not used for color computation.
Implements SBDDataGraphNodeColorScheme::getColor
function getDefaultPalette#
Returns a clone of the default color palette for this color scheme.
Retrieves the default color palette for the color scheme.
Returns:
A pointer to a new SBPalette instance representing the default palette.
Implements SBDDataGraphNodeColorScheme::getDefaultPalette
function isSerializable#
Returns true __
Indicates whether the color scheme can be serialized.
Returns:
true indicating that the color scheme supports serialization.
Implements SBDDataGraphNodeColorScheme::isSerializable
function serialize#
Serializes the document.
virtual void SBDColorSchemePerStructuralModel::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 to the given serializer.
Writes the color palette and structural model indexer information to the serializer.
Parameters:
serializerThe serializer to write the data to.nodeIndexerThe node indexer used to map nodes to indices during serialization.sdkVersionNumberThe SDK version number for compatibility.classVersionNumberThe class version number for compatibility.
Implements SBDDataGraphNodeColorScheme::serialize
function unserialize#
Unserializes the document.
virtual void SBDColorSchemePerStructuralModel::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 from the given serializer.
Restores the color palette and structural model indexer information from the serializer.
Parameters:
serializerThe serializer to read the data from.nodeIndexerThe node indexer used to map indices back to nodes during deserialization.sdkVersionNumberThe SDK version number for compatibility.classVersionNumberThe class version number for compatibility.
Implements SBDDataGraphNodeColorScheme::unserialize
function ~SBDColorSchemePerStructuralModel#
Destructs the color scheme.
Destructs the per structural model color scheme.