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. More...
 
void Store (JSON_SETTINGS *aSettings) const override
 Stores the value of this parameter to the given JSON_SETTINGS object. More...
 
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. More...
 
const std::string & GetJsonPath () const
 
bool ClearUnknownKeys () const
 

Protected Attributes

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

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 76 of file parameters.h.

References PARAM_BASE::m_clearUnknownKeys.

◆ GetDefault()

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

Definition at line 315 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 70 of file parameters.h.

References PARAM_BASE::m_path.

◆ 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
overridevirtualinherited

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 302 of file parameters.cpp.

◆ MatchesFile()

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

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 325 of file parameters.cpp.

◆ SetDefault()

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

Implements PARAM_BASE.

Definition at line 320 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 304 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 81 of file parameters.h.

Referenced by PARAM_BASE::ClearUnknownKeys(), and PARAM_WXSTRING_MAP::PARAM_WXSTRING_MAP().

◆ m_default

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

Definition at line 328 of file parameters.h.

◆ m_getter

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

Definition at line 329 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 330 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: