Logo Search packages:      
Sourcecode: freecad version File versions  Download package

Base::Reference< ParameterGrp > Application::GetParameterGroupByPath ( const char *  sName  ) 

Gets a parameter group by a full qualified path It's an easy method to get a group:

 // geting standard parameter
 ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Raytracing");
 std::string cDir             = hGrp->GetASCII("ProjectPath", "");
 std::string cCameraName      = hGrp->GetASCII("CameraName", "TempCamera.inc");

Definition at line 511 of file Application.cpp.

Referenced by Gui::MacroCommand::activated(), Gui::Application::Application(), Gui::MacroCommand::load(), Gui::MacroCommand::save(), and Gui::WindowParameter::setGroupName().

    std::string cName = sName,cTemp;

    std::string::size_type pos = cName.find(':');

    // is there a path seperator ?
    if (pos == std::string::npos) {
        throw Base::Exception("Application::GetParameterGroupByPath() no parameter set name specified");
    // assigning the parameter set name

    // test if name is valid
    std::map<std::string,ParameterManager *>::iterator It = mpcPramManager.find(cTemp.c_str());
    if (It == mpcPramManager.end())
        throw Base::Exception("Application::GetParameterGroupByPath() unknown parameter set name specified");

    return It->second->GetGroup(cName.c_str());

Generated by  Doxygen 1.6.0   Back to index