コード例 #1
0
ファイル: enginesettings.cpp プロジェクト: m64/PEG
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;
}
コード例 #2
0
static void ProcDSAllocate( const char *arg )
/*******************************************/
{
    /* unused parameters */ (void)arg;

    NotSupported( "dsallocate" );
}
コード例 #3
0
static void ProcWarnFixup( const char *arg )
/******************************************/
{
    /* unused parameters */ (void)arg;

    NotSupported( "warnfixup" );
}
コード例 #4
0
static void ProcExePack( const char *arg )
/****************************************/
{
    /* unused parameters */ (void)arg;

    NotSupported( "exepack" );
}
コード例 #5
0
static void ProcNoGroupAssoc( const char *arg )
/*********************************************/
{
    /* unused parameters */ (void)arg;

    NotSupported( "nogroupassociation" );
}
コード例 #6
0
static void ProcQuickLibrary( const char *arg )
/*********************************************/
{
    /* unused parameters */ (void)arg;

    NotSupported( "quicklibrary" );
}
コード例 #7
0
static void ProcNoNullsDosseg( const char *arg )
/**********************************************/
{
    /* unused parameters */ (void)arg;

    NotSupported( "nonullsdosseg" );
}
コード例 #8
0
static void ProcPause( const char *arg )
/**************************************/
{
    /* unused parameters */ (void)arg;

    NotSupported( "pause" );
}
コード例 #9
0
static void ProcLineNumbers( const char *arg )
/********************************************/
{
    /* unused parameters */ (void)arg;

    NotSupported( "linenumbers" );
}
コード例 #10
0
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;
        }
    }
}
コード例 #11
0
static void ProcHigh( const char *arg )
/*************************************/
{
    /* unused parameters */ (void)arg;

    NotSupported( "high" );
}
コード例 #12
0
static void ProcIncremental( const char *arg )
/********************************************/
{
    /* unused parameters */ (void)arg;

    NotSupported( "incremental" );
}
コード例 #13
0
ファイル: GillespieSimulator.cpp プロジェクト: kozo2/ecell4
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();
}
コード例 #14
0
	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;
	}
コード例 #15
0
static void ProcAppLoader( void )
/*******************************/
{
    NotSupported( "apploader" );
    if( !MakeToken( SEP_QUOTE, true ) ) {
        MakeToken( SEP_NO, true );
    }
}
コード例 #16
0
ファイル: enginesettings.cpp プロジェクト: m64/PEG
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");
}
コード例 #17
0
ファイル: enginesettings.cpp プロジェクト: m64/PEG
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");
}
コード例 #18
0
ファイル: Species.cpp プロジェクト: kozo2/ecell4
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);
}
コード例 #19
0
ファイル: StructureType.hpp プロジェクト: navoj/ecell4
    virtual void add_voxel_without_checking(const particle_info& info)
    {
        if (info.second != ParticleID())
        {
            throw NotSupported("No ParticleID is allowed.");
        }

        ; // do nothing
    }
コード例 #20
0
ファイル: GLSLInstance.cpp プロジェクト: 4og/avango
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();
}
コード例 #21
0
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.");
}
コード例 #22
0
ファイル: map.cpp プロジェクト: karottenreibe/FIFE
	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;
	}
コード例 #23
0
	Point LightRendererNode::getOffsetPoint() {
		if(m_instance == NULL && m_location == NULL) {
			throw NotSupported("No point as offset used.");
		}
		return m_point;
	}
コード例 #24
0
	Location LightRendererNode::getOffsetLocation() {
		if(m_instance == NULL || m_location == NULL) {
			throw NotSupported("No location as offset used.");
		}
		return m_location;
	}
コード例 #25
0
	Point LightRendererNode::getAttachedPoint() {
		if(m_instance != NULL || m_location != NULL) {
			throw NotSupported("No point attached.");
		}
		return m_point;
	}
コード例 #26
0
	Layer* LightRendererNode::getAttachedLayer() {
		if(m_layer == NULL) {
			throw NotSupported("No layer attached.");
		}
		return m_layer;
	}
コード例 #27
0
	Location LightRendererNode::getAttachedLocation() {
		if(m_instance != NULL || m_location == NULL) {
			throw NotSupported("No location attached.");
		}
		return m_location;
	}
コード例 #28
0
	Instance* LightRendererNode::getAttachedInstance() {
		if(m_instance == NULL) {
			throw NotSupported("No instance attached.");
		}
		return m_instance;
	}
コード例 #29
0
	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;
	}
コード例 #30
0
ファイル: CField.cpp プロジェクト: andrealani/coolfluid3
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;
  }
}