KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PARAM_VIEWPORT3D Class Reference

#include <board_project_settings.h>

Inheritance diagram for PARAM_VIEWPORT3D:
PARAM_LAMBDA< nlohmann::json > PARAM_BASE

Public Member Functions

 PARAM_VIEWPORT3D (const std::string &aPath, std::vector< VIEWPORT3D > *aViewportList)
 
void Load (JSON_SETTINGS *aSettings, bool aResetIfMissing=true) const override
 Loads the value of this parameter from JSON to the underlying storage.
 
void Store (JSON_SETTINGS *aSettings) const override
 Stores the value of this parameter to the given JSON_SETTINGS object.
 
nlohmann::json GetDefault () const
 
void SetDefault () override
 
bool MatchesFile (JSON_SETTINGS *aSettings) const override
 Checks whether the parameter in memory matches the one in a given JSON file.
 
const std::string & GetJsonPath () const
 
bool ClearUnknownKeys () const
 

Protected Attributes

std::string m_path
 Address of the param in the json files.
 
bool m_readOnly
 Indicates param pointer should never be overwritten.
 
bool m_clearUnknownKeys
 Keys should be cleared from source rather than merged.
 

Private Member Functions

nlohmann::json viewportsToJson ()
 
void jsonToViewports (const nlohmann::json &aJson)
 

Private Attributes

std::vector< VIEWPORT3D > * m_viewports
 
nlohmann::json m_default
 
std::function< nlohmann::json()> m_getter
 
std::function< void(nlohmann::json)> m_setter
 

Detailed Description

Definition at line 247 of file board_project_settings.h.

Constructor & Destructor Documentation

◆ PARAM_VIEWPORT3D()

PARAM_VIEWPORT3D::PARAM_VIEWPORT3D ( const std::string &  aPath,
std::vector< VIEWPORT3D > *  aViewportList 
)

Definition at line 196 of file board_project_settings.cpp.

Member Function Documentation

◆ ClearUnknownKeys()

bool PARAM_BASE::ClearUnknownKeys ( ) const
inlineinherited
Returns
true if keys should be cleared from source file rather than merged. Useful for things such as text variables that are semantically an array but stored as a map.

Definition at line 78 of file parameters.h.

◆ GetDefault()

nlohmann::json PARAM_LAMBDA< nlohmann::json >::GetDefault ( ) const
inlineinherited

Definition at line 337 of file parameters.h.

◆ GetJsonPath()

const std::string & PARAM_BASE::GetJsonPath ( ) const
inlineinherited
Returns
the path name of the parameter used to store it in the json file mainly useful in error messages

Definition at line 72 of file parameters.h.

◆ jsonToViewports()

void PARAM_VIEWPORT3D::jsonToViewports ( const nlohmann::json &  aJson)
private

Definition at line 241 of file board_project_settings.cpp.

References m_viewports, and VIEWPORT3D::matrix.

◆ Load()

void PARAM_LAMBDA< nlohmann::json >::Load ( JSON_SETTINGS aSettings,
bool  aResetIfMissing = true 
) const
inlineoverridevirtualinherited

Loads the value of this parameter from JSON to the underlying storage.

Parameters
aSettingsis the JSON_SETTINGS object to load from.
aResetIfMissingif true will set the parameter to its default value if load fails

Implements PARAM_BASE.

Definition at line 305 of file parameters.h.

◆ MatchesFile()

bool PARAM_LAMBDA< nlohmann::json >::MatchesFile ( JSON_SETTINGS aSettings) const
inlineoverridevirtualinherited

Checks whether the parameter in memory matches the one in a given JSON file.

Parameters
aSettingsis a JSON_SETTINGS to check the JSON file contents of
Returns
true if the parameter in memory matches its value in the file

Implements PARAM_BASE.

Definition at line 347 of file parameters.h.

◆ SetDefault()

void PARAM_LAMBDA< nlohmann::json >::SetDefault ( )
inlineoverridevirtualinherited

Implements PARAM_BASE.

Definition at line 342 of file parameters.h.

◆ Store()

void PARAM_LAMBDA< nlohmann::json >::Store ( JSON_SETTINGS aSettings) const
inlineoverridevirtualinherited

Stores the value of this parameter to the given JSON_SETTINGS object.

Parameters
aSettingsis the JSON_SETTINGS object to store into.

Implements PARAM_BASE.

Definition at line 326 of file parameters.h.

◆ viewportsToJson()

nlohmann::json PARAM_VIEWPORT3D::viewportsToJson ( )
private

Definition at line 208 of file board_project_settings.cpp.

References m_viewports.

Member Data Documentation

◆ m_clearUnknownKeys

bool PARAM_BASE::m_clearUnknownKeys
protectedinherited

Keys should be cleared from source rather than merged.

This is useful for things that are semantically an array but stored as a map, such as textVars.

Definition at line 83 of file parameters.h.

◆ m_default

nlohmann::json PARAM_LAMBDA< nlohmann::json >::m_default
privateinherited

Definition at line 365 of file parameters.h.

◆ m_getter

std::function<nlohmann::json ()> PARAM_LAMBDA< nlohmann::json >::m_getter
privateinherited

Definition at line 366 of file parameters.h.

◆ m_path

◆ m_readOnly

bool PARAM_BASE::m_readOnly
protectedinherited

◆ m_setter

std::function<void( nlohmann::json )> PARAM_LAMBDA< nlohmann::json >::m_setter
privateinherited

Definition at line 367 of file parameters.h.

◆ m_viewports

std::vector<VIEWPORT3D>* PARAM_VIEWPORT3D::m_viewports
private

Definition at line 257 of file board_project_settings.h.

Referenced by jsonToViewports(), and viewportsToJson().


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