OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::BundleMap Struct Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/ConfigWizard_private.hpp>

Inheritance diagram for Slic3r::GUI::BundleMap:
Collaboration diagram for Slic3r::GUI::BundleMap:

Public Member Functions

Bundle & bbl_bundle ()
const Bundle & bbl_bundle () const

Static Public Member Functions

static BundleMap load ()

Public Attributes

K keys
 STL member.
T elements
 STL member.

Detailed Description

Member Function Documentation

◆ bbl_bundle() [1/2]

Bundle & Slic3r::GUI::BundleMap::bbl_bundle ( )
189{
190 //Orca: add custom as default
192 if (it == end()) {
193 throw Slic3r::RuntimeError("ConfigWizard: Internal error in BundleMap: ORCA_DEFAULT_BUNDLE not loaded");
194 }
195
196 return it->second;
197}
static const char * ORCA_DEFAULT_BUNDLE
Definition PresetBundle.hpp:686
T * end(Slic3r::Mat< N, M, T > &mat)
Definition Point.hpp:841
RaycastManager::TrItems::iterator find(RaycastManager::TrItems &items, const RaycastManager::TrKey &key)
Definition RaycastManager.cpp:298

References Slic3r::PresetBundle::ORCA_DEFAULT_BUNDLE.

Referenced by bbl_bundle(), and load().

Here is the caller graph for this function:

◆ bbl_bundle() [2/2]

const Bundle & Slic3r::GUI::BundleMap::bbl_bundle ( ) const
200{
201 return const_cast<BundleMap*>(this)->bbl_bundle();
202}
Bundle & bbl_bundle()
Definition ConfigWizard.cpp:188

References bbl_bundle().

Here is the call graph for this function:

◆ load()

BundleMap Slic3r::GUI::BundleMap::load ( )
static
153{
154 BundleMap res;
155
156 //BBS: change directories by design
157 const auto vendor_dir = (boost::filesystem::path(Slic3r::data_dir()) / PRESET_SYSTEM_DIR).make_preferred();
158 const auto rsrc_vendor_dir = (boost::filesystem::path(resources_dir()) / "profiles").make_preferred();
159
160 //Orca: add custom as default
161 //Orca: add json logic for vendor bundle
162 {
164 Bundle bbl_bundle;
165 if (bbl_bundle.load(from_rsrc ? rsrc_vendor_dir : vendor_dir, PresetBundle::ORCA_DEFAULT_BUNDLE, from_rsrc, true))
166 res.emplace(PresetBundle::ORCA_DEFAULT_BUNDLE, std::move(bbl_bundle));
167 }
168
169 // Load the other bundles in the datadir/vendor directory
170 // and then additionally from resources/profiles.
171 bool is_in_resources = false;
172 for (auto dir : { &vendor_dir, &rsrc_vendor_dir }) {
173 for (const std::string &id : vendor_names_in(*dir)) {
174 // Don't load this bundle if we've already loaded it.
175 if (res.find(id) != res.end()) { continue; }
176
177 Bundle bundle;
178 if (bundle.load(*dir, id, is_in_resources))
179 res.emplace(id, std::move(bundle));
180 }
181
182 is_in_resources = true;
183 }
184
185 return res;
186}
#define PRESET_SYSTEM_DIR
Definition Preset.hpp:31
const std::string & data_dir()
Definition utils.cpp:365
const std::string & resources_dir()
Definition utils.cpp:296
bool is_vendor_installed(const std::string &vendor)
Definition utils.cpp:1973
std::set< std::string > vendor_names_in(const boost::filesystem::path &dir)
Definition utils.cpp:2005

References bbl_bundle(), Slic3r::data_dir(), Slic3r::is_vendor_installed(), Slic3r::GUI::Bundle::load(), Slic3r::PresetBundle::ORCA_DEFAULT_BUNDLE, PRESET_SYSTEM_DIR, Slic3r::resources_dir(), and Slic3r::vendor_names_in().

Referenced by Slic3r::GUI::ConfigWizard::priv::load_vendors().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ elements

T std::unordered_map< K, T >::elements
inherited

STL member.

◆ keys

K std::unordered_map< K, T >::keys
inherited

STL member.


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