void EngineSettings::setInitialVolume(float volume) { if (volume > getMaxVolume()) { throw NotSupported("Given volume exceeds maximum volume"); } if (volume < 0) { throw NotSupported("Given volume is below 0"); } m_initialvolume = volume; }
static void ProcDSAllocate( const char *arg ) /*******************************************/ { /* unused parameters */ (void)arg; NotSupported( "dsallocate" ); }
static void ProcWarnFixup( const char *arg ) /******************************************/ { /* unused parameters */ (void)arg; NotSupported( "warnfixup" ); }
static void ProcExePack( const char *arg ) /****************************************/ { /* unused parameters */ (void)arg; NotSupported( "exepack" ); }
static void ProcNoGroupAssoc( const char *arg ) /*********************************************/ { /* unused parameters */ (void)arg; NotSupported( "nogroupassociation" ); }
static void ProcQuickLibrary( const char *arg ) /*********************************************/ { /* unused parameters */ (void)arg; NotSupported( "quicklibrary" ); }
static void ProcNoNullsDosseg( const char *arg ) /**********************************************/ { /* unused parameters */ (void)arg; NotSupported( "nonullsdosseg" ); }
static void ProcPause( const char *arg ) /**************************************/ { /* unused parameters */ (void)arg; NotSupported( "pause" ); }
static void ProcLineNumbers( const char *arg ) /********************************************/ { /* unused parameters */ (void)arg; NotSupported( "linenumbers" ); }
void SpatiocyteWorld::remove_molecules(const Species& sp, const Integer& num) { if (num < 0) { throw std::invalid_argument("The number of molecules must be positive."); } MolecularTypeBase* mtype(find_molecular_type(sp)); if (!mtype->with_voxels()) { throw NotSupported( "remove_molecuels for MolecularType with no voxel is not supported now"); } else if (mtype->size() < num) { throw std::invalid_argument( "The number of molecules cannot be negative."); } Integer count(0); while (count < num) { const Integer idx(rng_->uniform_int(0, mtype->size() - 1)); if (remove_voxel_private(mtype->at(idx).first)) { ++count; } } }
static void ProcHigh( const char *arg ) /*************************************/ { /* unused parameters */ (void)arg; NotSupported( "high" ); }
static void ProcIncremental( const char *arg ) /********************************************/ { /* unused parameters */ (void)arg; NotSupported( "incremental" ); }
void GillespieSimulator::initialize(void) { const Model::reaction_rule_container_type& reaction_rules(model_->reaction_rules()); events_.clear(); for (Model::reaction_rule_container_type::const_iterator i(reaction_rules.begin()); i != reaction_rules.end(); ++i) { const ReactionRule& rr(*i); if (rr.reactants().size() == 0) { events_.push_back(new ZerothOrderReactionRuleEvent(this, rr)); } else if (rr.reactants().size() == 1) { events_.push_back(new FirstOrderReactionRuleEvent(this, rr)); } else if (rr.reactants().size() == 2) { events_.push_back(new SecondOrderReactionRuleEvent(this, rr)); } else { throw NotSupported("not supported yet."); } events_.back().initialize(); } this->draw_next_reaction(); }
void LightRendererNode::setRelative(const Location &relative_location, Point relative_point) { if(m_instance == NULL) { throw NotSupported("No instance attached."); } m_location = relative_location; m_point = relative_point; }
static void ProcAppLoader( void ) /*******************************/ { NotSupported( "apploader" ); if( !MakeToken( SEP_QUOTE, true ) ) { MakeToken( SEP_NO, true ); } }
void EngineSettings::setRenderBackend(const std::string& renderbackend) { std::vector<std::string> pv = getPossibleRenderBackends(); std::vector<std::string>::iterator i = std::find(pv.begin(), pv.end(), renderbackend); if (i != pv.end()) { m_renderbackend = renderbackend; return; } throw NotSupported("Given render backend is not supported"); }
void EngineSettings::setBitsPerPixel(unsigned int bitsperpixel) { std::vector<unsigned int> pv = getPossibleBitsPerPixel(); std::vector<unsigned int>::iterator i = std::find(pv.begin(), pv.end(), bitsperpixel); if (i != pv.end()) { m_bitsperpixel = bitsperpixel; return; } throw NotSupported("Given bits per pixel value is not supported"); }
void Species::add_unit(const UnitSpecies& usp) { if (usp.name() == "") { throw NotSupported("UnitSpecies must have a name."); } units_.push_back(usp); // units_.insert(std::lower_bound(units_.begin(), units_.end(), usp), usp); }
virtual void add_voxel_without_checking(const particle_info& info) { if (info.second != ParticleID()) { throw NotSupported("No ParticleID is allowed."); } ; // do nothing }
boost::shared_ptr<shade::GLSLWrapper> shade::create_GLSL_wrapper(void) { if (GLEW_VERSION_2_0) { return boost::shared_ptr<GLSLWrapper>(new GLSLGL2Wrapper); } if (glewIsSupported("GL_ARB_shader_objects GL_ARB_vertex_shader GL_ARB_fragment_shader GL_ARB_shading_language_100")) { return boost::shared_ptr<GLSLWrapper>(new GLSLARBWrapper); } throw NotSupported(); }
Integer SpatiocyteWorld::add_structure( const Species& sp, const boost::shared_ptr<const Shape> shape) { const SpatiocyteWorld::molecule_info_type info(get_molecule_info(sp)); (*space_).make_structure_type(sp, shape->dimension(), info.loc); switch (shape->dimension()) { case Shape::THREE: return add_structure3(sp, shape); case Shape::TWO: return add_structure2(sp, shape); case Shape::ONE: case Shape::UNDEF: break; } throw NotSupported("The dimension of a shape must be two or three."); }
Camera* Map::addCamera(const std::string &id, Layer *layer, const Rect& viewport) { if (layer == NULL) { throw NotSupported("Must have valid layer for camera"); } if (getCamera(id)) { std::string errorStr = "Camera: " + id + " already exists"; throw NameClash(errorStr); } // create new camera and add to list of cameras Camera* camera = new Camera(id, layer, viewport, m_renderbackend); m_cameras.push_back(camera); std::vector<RendererBase*>::iterator iter = m_renderers.begin(); for ( ; iter != m_renderers.end(); ++iter) { camera->addRenderer((*iter)->clone()); } return camera; }
Point LightRendererNode::getOffsetPoint() { if(m_instance == NULL && m_location == NULL) { throw NotSupported("No point as offset used."); } return m_point; }
Location LightRendererNode::getOffsetLocation() { if(m_instance == NULL || m_location == NULL) { throw NotSupported("No location as offset used."); } return m_location; }
Point LightRendererNode::getAttachedPoint() { if(m_instance != NULL || m_location != NULL) { throw NotSupported("No point attached."); } return m_point; }
Layer* LightRendererNode::getAttachedLayer() { if(m_layer == NULL) { throw NotSupported("No layer attached."); } return m_layer; }
Location LightRendererNode::getAttachedLocation() { if(m_instance != NULL || m_location == NULL) { throw NotSupported("No location attached."); } return m_location; }
Instance* LightRendererNode::getAttachedInstance() { if(m_instance == NULL) { throw NotSupported("No instance attached."); } return m_instance; }
void LightRendererNode::setRelative(const Point &relative_point) { if(m_instance == NULL || m_location == NULL) { throw NotSupported("No instance or location attached."); } m_point = relative_point; }
void CField::create_data_storage() { cf_assert( m_var_types.size()!=0 ); cf_assert( is_not_null(m_topology->follow()) ); // Check if there are coordinates in this field, and add to map m_coords = find_parent_component<CMesh>(topology()).nodes().coordinates().as_ptr<CTable<Real> >(); Uint row_size(0); boost_foreach(const VarType var_size, m_var_types) row_size += Uint(var_size); m_data->set_row_size(row_size); switch (m_basis) { case Basis::POINT_BASED: { m_used_nodes = CElements::used_nodes(topology()).as_ptr<CList<Uint> >(); m_data->resize(m_used_nodes->size()); break; } case Basis::ELEMENT_BASED: { Uint data_size = 0; boost_foreach(CEntities& field_elements, find_components_recursively<CEntities>(topology())) { if (field_elements.exists_space(m_space_name) == false) throw ValueNotFound(FromHere(),"space \""+m_space_name+"\" does not exist in "+field_elements.uri().path()); m_elements_start_idx[field_elements.as_ptr<CEntities>()] = data_size; CFieldView field_view("tmp_field_view"); data_size = field_view.initialize(*this,field_elements.as_ptr<CEntities>()); } m_data->resize(data_size); break; } case Basis::CELL_BASED: { Uint data_size = 0; boost_foreach(CEntities& field_elements, find_components_recursively<CCells>(topology())) { //CFinfo << name() << ": creating cellbased field storage in " << field_elements.uri().path() << CFendl; if (field_elements.exists_space(m_space_name) == false) throw ValueNotFound(FromHere(),"space \""+m_space_name+"\" does not exist in "+field_elements.uri().path()); m_elements_start_idx[field_elements.as_ptr<CEntities>()] = data_size; CFieldView field_view("tmp_field_view"); data_size = field_view.initialize(*this,field_elements.as_ptr<CEntities>()); } m_data->resize(data_size); break; } case Basis::FACE_BASED: { Uint data_size = 0; boost_foreach(CEntities& field_elements, find_components_recursively_with_tag<CEntities>(topology(),Mesh::Tags::face_entity())) { if (field_elements.exists_space(m_space_name) == false) throw ValueNotFound(FromHere(),"space \""+m_space_name+"\" does not exist in "+field_elements.uri().path()); m_elements_start_idx[field_elements.as_ptr<CEntities>()] = data_size; CFieldView field_view("tmp_field_view"); data_size = field_view.initialize(*this,field_elements.as_ptr<CEntities>()); } m_data->resize(data_size); break; } default: throw NotSupported(FromHere() , "Basis can only be ELEMENT_BASED or NODE_BASED"); break; } }