iVS3D v2.0.9
Loading...
Searching...
No Matches
MaskStack Class Reference

Manages a stack of mask generation records for later export. More...

#include <maskstack.h>

Inheritance diagram for MaskStack:

Signals

void sig_recordAdded (const MaskRecord &record)
 Emitted when a new record is added to the stack.
 
void sig_recordRemoved (const MaskRecord &record)
 Emitted when a record is removed from the stack.
 
void sig_stackCleared ()
 Emitted when the entire stack is cleared.
 
void sig_stackChanged ()
 Emitted whenever the stack contents change (after add, remove, or clear operations)
 

Public Member Functions

 MaskStack (QObject *parent=nullptr)
 Construct an empty mask stack.
 
void addRecord (const MaskRecord &record)
 Add a new mask record to the stack.
 
bool removeRecord (int index)
 Remove a record at the given index.
 
bool removeRecordById (int id)
 Remove a record by its ID.
 
void clear ()
 Clear all records from the stack.
 
int size () const
 Get the number of records in the stack.
 
bool isEmpty () const
 Check if the stack is empty.
 
const MaskRecordgetRecord (int index) const
 Get a record by index.
 
QVector< MaskRecordgetAllRecords () const
 Get all records in the stack.
 
const MaskRecordgetRecordById (int id) const
 Get a record by its ID.
 

Detailed Description

Manages a stack of mask generation records for later export.

This class maintains a list of mask generation configurations. Each entry represents a call to "Add Mask" by the user with specific plugin settings. At export time, the application will iterate through this stack and generate masks for each image using the stored configurations.

Features:

  • Add new mask records when user clicks "Add Mask"
  • Remove individual records
  • Clear entire stack
  • Retrieve records by index
  • Query size and empty status
  • Emits signals when stack changes (for UI synchronization)
Author
Dominik Wüst
Date
January 2026

Constructor & Destructor Documentation

◆ MaskStack()

MaskStack::MaskStack ( QObject *  parent = nullptr)
explicit

Construct an empty mask stack.

Parameters
parentThe parent QObject

Member Function Documentation

◆ addRecord()

void MaskStack::addRecord ( const MaskRecord record)

Add a new mask record to the stack.

Parameters
recordThe MaskRecord to add
Note
Emits sig_recordAdded with the new record
Emits sig_stackChanged

◆ clear()

void MaskStack::clear ( )

Clear all records from the stack.

Note
Emits sig_stackCleared
Emits sig_stackChanged

◆ getAllRecords()

QVector< MaskRecord > MaskStack::getAllRecords ( ) const

Get all records in the stack.

Returns
A copy of the internal records vector

◆ getRecord()

const MaskRecord * MaskStack::getRecord ( int  index) const

Get a record by index.

Parameters
indexThe index of the record (0-based)
Returns
Pointer to the record, or nullptr if index is out of range

◆ getRecordById()

const MaskRecord * MaskStack::getRecordById ( int  id) const

Get a record by its ID.

Parameters
idThe ID of the record
Returns
Pointer to the record, or nullptr if ID not found

◆ isEmpty()

bool MaskStack::isEmpty ( ) const

Check if the stack is empty.

Returns
true if stack contains no records, false otherwise

◆ removeRecord()

bool MaskStack::removeRecord ( int  index)

Remove a record at the given index.

Parameters
indexThe index of the record to remove (0-based)
Returns
true if removal was successful, false if index is out of range
Note
Emits sig_recordRemoved with the removed record if successful
Emits sig_stackChanged if successful

◆ removeRecordById()

bool MaskStack::removeRecordById ( int  id)

Remove a record by its ID.

Parameters
idThe ID of the record to remove
Returns
true if removal was successful, false if ID not found
Note
Emits sig_recordRemoved with the removed record if successful
Emits sig_stackChanged if successful

◆ sig_recordAdded

void MaskStack::sig_recordAdded ( const MaskRecord record)
signal

Emitted when a new record is added to the stack.

Parameters
recordThe newly added record

◆ sig_recordRemoved

void MaskStack::sig_recordRemoved ( const MaskRecord record)
signal

Emitted when a record is removed from the stack.

Parameters
recordThe removed record

◆ size()

int MaskStack::size ( ) const

Get the number of records in the stack.

Returns
Number of records

The documentation for this class was generated from the following files: