本文整理汇总了C++中Geostat_grid::add_group方法的典型用法代码示例。如果您正苦于以下问题:C++ Geostat_grid::add_group方法的具体用法?C++ Geostat_grid::add_group怎么用?C++ Geostat_grid::add_group使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Geostat_grid
的用法示例。
在下文中一共展示了Geostat_grid::add_group方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
bool New_property_group::init( std::string& parameters, GsTL_project* proj,
Error_messages_handler* errors ){
std::vector< std::string > params =
String_Op::decompose_string( parameters, Actions::separator,
Actions::unique );
if( params.size() < 2 ) {
errors->report( "Must have at least 2 parameters, name of the grid and name the group" );
return false;
}
// Get the grid
std::string grid_name = params[0];
SmartPtr<Named_interface> ni = Root::instance()->interface( gridModels_manager + "/" + grid_name);
Geostat_grid* grid = dynamic_cast<Geostat_grid*>( ni.raw_ptr() );
if(!grid) {
errors->report( "The grid "+params[0]+" does not exist" );
return false;
}
GsTLGridPropertyGroup* group = grid->get_group(params[1]);
if(group) {
errors->report( "The goup "+params[1]+" already exist; hence cannot be created" );
return false;
}
std::string type = "";
if( params.size() == 3 ) {
if( params[2] == "General" ) type = "";
else type = params[2];
}
group = grid->add_group(params[1],type);
if(!group) {
errors->report( "The goup "+params[1]+" could no be created; possibly type undefined" );
return false;
}
for(int i=3; i< params.size(); i++) {
Grid_continuous_property* prop = grid->property(params[i]);
if(prop == NULL) {
errors->report( "The property "+params[i]+" does not exist" );
return false;
}
}
for(int i=3; i< params.size(); i++) {
group->add_property(grid->property(params[i]));
}
proj->update();
return true;
}