Web Analytics Made Easy - Statcounter
Skip to content

Class SBDVisualPreset#

ClassList > SBDVisualPreset

The SBDVisualPreset class is a base class for visual preset.More...

  • #include <SBDVisualPreset.hpp>

Public Functions#

Type Name
SBDVisualPreset (const std::string & name, const std::vector< SBDVisualPresetStep * > & visualPresetSteps=std::vector< SBDVisualPresetStep * >())
Constructor that does a deep copy of the vector of visual preset steps, i.e. it clones visual preset steps.
SBDVisualPreset (const std::string & name, std::vector< SBDVisualPresetStep * > && visualPresetSteps) noexcept
Constructor taking the vector of visual preset steps by move.
SBDVisualPreset (const SBDVisualPreset & other)
Copy constructor.
SBDVisualPreset (SBDVisualPreset && other) noexcept
Move constructor.
void addVisualPresetStep (const SBDVisualPresetStep & visualPresetStep)
Adds the cloned visual preset step visualPresetStep to this visual preset.
void apply (SBNodeIndexer & nodeIndexer, SBFolder * preferredFolder=nullptr)
Applies the visual preset to nodes in nodeIndexer and adds the node groups and visual models (if any) topreferredFolder .
virtual SBDVisualPreset * clone () const
Clones the visual preset.
void deleteVisualPresetStep (int index)
Deletes the visual preset step with index index from the visual preset.
void deleteVisualPresetStep (SBDVisualPresetStep * visualPresetStep)
Removes the visual preset step visualPresetStep from the visual preset if it has any, and, if found, deletes the visual preset stepvisualPresetStep .
const std::string & getName () const
Returns the name of the visual preset.
unsigned int getNumberOfVisualPresetSteps () const
Returns the number of visual preset steps.
const std::vector< SBDVisualPresetStep * > & getVisualPresetSteps () const
Returns the vector of visual preset steps.
bool operator!= (const SBDVisualPreset & other) const
Inequality operator.
SBDVisualPreset & operator= (const SBDVisualPreset & other)
Copy assignment operator.
SBDVisualPreset & operator= (SBDVisualPreset && other) noexcept
Move assignment operator.
bool operator== (const SBDVisualPreset & other) const
Equality operator.
void setName (const std::string & name)
Sets the name of the visual preset to name .
void swap (int i, int j)
Swaps visual preset steps i andj .
virtual std::string toPythonCode () const
Returns the string representation of the object that can be used to reconstruct it in Python.
virtual ~SBDVisualPreset ()
Destructor.

Public Static Functions#

Type Name
const std::vector< const SBDVisualPreset * > * getDefaultVisualPresets ()
Returns a vector of the default visual presets.

Protected Attributes#

Type Name
SBDVisualPresetData * dataPointer
A pointer to the private data.

Detailed Description#

Short name: SBVisualPreset

Public Functions Documentation#

function SBDVisualPreset [1/4]#

Constructor that does a deep copy of the vector of visual preset steps, i.e. it clones visual preset steps.

SBDVisualPreset::SBDVisualPreset (
    const std::string & name,
    const std::vector< SBDVisualPresetStep * > & visualPresetSteps=std::vector< SBDVisualPresetStep * >()
) 

Constructs a visual preset with a name and a list of visual preset steps.

Parameters:

  • name The name of the visual preset.
  • visualPresetSteps The visual preset steps to include. The steps are copied.

function SBDVisualPreset [2/4]#

Constructor taking the vector of visual preset steps by move.

SBDVisualPreset::SBDVisualPreset (
    const std::string & name,
    std::vector< SBDVisualPresetStep * > && visualPresetSteps
) noexcept

Constructs a visual preset with a name and a list of visual preset steps, moving the steps into the preset.

Parameters:

  • name The name of the visual preset.
  • visualPresetSteps The visual preset steps to include. The steps are moved into the preset.

function SBDVisualPreset [3/4]#

Copy constructor.

SBDVisualPreset::SBDVisualPreset (
    const SBDVisualPreset & other
) 

Constructs a visual preset as a copy of another visual preset.

Parameters:

  • other The visual preset to copy.

function SBDVisualPreset [4/4]#

Move constructor.

SBDVisualPreset::SBDVisualPreset (
    SBDVisualPreset && other
) noexcept

Constructs a visual preset by moving the contents of another visual preset.

Parameters:

  • other The visual preset to move from.

function addVisualPresetStep#

Adds the cloned visual preset step visualPresetStep to this visual preset.

void SBDVisualPreset::addVisualPresetStep (
    const SBDVisualPresetStep & visualPresetStep
) 

Adds a visual preset step to the preset.

Parameters:

  • visualPresetStep The visual preset step to add. The step is cloned before being stored.

function apply#

Applies the visual preset to nodes in nodeIndexer and adds the node groups and visual models (if any) topreferredFolder .

void SBDVisualPreset::apply (
    SBNodeIndexer & nodeIndexer,
    SBFolder * preferredFolder=nullptr
) 

Applies the visual preset to the specified nodes and optionally adds visual groups and models to a folder.

Parameters:

  • nodeIndexer The node indexer containing the nodes to which the preset will be applied.
  • preferredFolder Optional folder to receive created visual groups and models. If null, a new folder is created.

function clone#

Clones the visual preset.

virtual SBDVisualPreset * SBDVisualPreset::clone () const

Creates a deep copy of this visual preset.

Returns:

A pointer to a new visual preset that is a copy of this object.


function deleteVisualPresetStep [1/2]#

Deletes the visual preset step with index index from the visual preset.

void SBDVisualPreset::deleteVisualPresetStep (
    int index
) 

Removes the visual preset step at the specified index.

Parameters:

  • index The index of the visual preset step to remove.

function deleteVisualPresetStep [2/2]#

Removes the visual preset step visualPresetStep from the visual preset if it has any, and, if found, deletes the visual preset stepvisualPresetStep .

void SBDVisualPreset::deleteVisualPresetStep (
    SBDVisualPresetStep * visualPresetStep
) 

Removes the specified visual preset step from the preset and deletes it.

Parameters:

  • visualPresetStep Pointer to the visual preset step to remove. If the step is not part of the preset, the function does nothing.

function getName#

Returns the name of the visual preset.

const std::string & SBDVisualPreset::getName () const

Retrieves the name of the visual preset.

Returns:

A reference to the preset's name.


function getNumberOfVisualPresetSteps#

Returns the number of visual preset steps.

unsigned int SBDVisualPreset::getNumberOfVisualPresetSteps () const

Returns the number of visual preset steps in the preset.

Returns:

The number of visual preset steps.


function getVisualPresetSteps#

Returns the vector of visual preset steps.

const std::vector< SBDVisualPresetStep * > & SBDVisualPreset::getVisualPresetSteps () const

Retrieves the visual preset steps contained in the preset.

Returns:

A reference to the vector of visual preset step pointers.


function operator!=#

Inequality operator.

bool SBDVisualPreset::operator!= (
    const SBDVisualPreset & other
) const

Checks whether this visual preset is not equal to another.

Parameters:

  • other The visual preset to compare with.

Returns:

true if the presets are not equal, false otherwise.


function operator=#

Copy assignment operator.

SBDVisualPreset & SBDVisualPreset::operator= (
    const SBDVisualPreset & other
) 

Assigns the contents of another visual preset to this one (copy assignment).

Parameters:

  • other The visual preset to copy from.

Returns:

Reference to this visual preset.


function operator=#

Move assignment operator.

SBDVisualPreset & SBDVisualPreset::operator= (
    SBDVisualPreset && other
) noexcept

Assigns the contents of another visual preset to this one (move assignment).

Parameters:

  • other The visual preset to move from.

Returns:

Reference to this visual preset.


function operator==#

Equality operator.

bool SBDVisualPreset::operator== (
    const SBDVisualPreset & other
) const

Checks whether this visual preset is equal to another.

Parameters:

  • other The visual preset to compare with.

Returns:

true if the presets are equal, false otherwise.


function setName#

Sets the name of the visual preset to name .

void SBDVisualPreset::setName (
    const std::string & name
) 

Sets the name of the visual preset.

Parameters:

  • name The new name to assign.

function swap#

Swaps visual preset steps i andj .

void SBDVisualPreset::swap (
    int i,
    int j
) 

Swaps the positions of two visual preset steps.

Parameters:

  • i The index of the first visual preset step.
  • j The index of the second visual preset step.

function toPythonCode#

Returns the string representation of the object that can be used to reconstruct it in Python.

virtual std::string SBDVisualPreset::toPythonCode () const

Generates a Python code representation of this visual preset.

Returns:

A string containing Python code that can recreate the visual preset.


function ~SBDVisualPreset#

Destructor.

virtual SBDVisualPreset::~SBDVisualPreset () 

Destroys the visual preset and releases associated resources.


Public Static Functions Documentation#

function getDefaultVisualPresets#

Returns a vector of the default visual presets.

static const std::vector< const SBDVisualPreset * > * SBDVisualPreset::getDefaultVisualPresets () 

Retrieves the default visual presets provided by the application.

Returns:

A pointer to a vector of default visual preset pointers, or nullptr if unavailable.


Protected Attributes Documentation#

variable dataPointer#

A pointer to the private data.

SBDVisualPresetData* SBDVisualPreset::dataPointer;