コード例 #1
0
ファイル: slickEnergy.C プロジェクト: HeyJJ/ball
	bool SLICKEnergy::setup()
	{
		setName("SLICKEnergy");

		options_.set(NonpolarSolvation::Option::NONPOLAR_METHOD, NonpolarSolvation::CALCULATION__PCM);
		options_.setInteger(PolarSolvation::Option::POLAR_METHOD, PolarSolvation::CALCULATION__FULL_CYCLE_FOCUSED);
		options_.setInteger(VanDerWaalsSlick::Option::VDW_METHOD, VanDerWaalsSlick::CALCULATION__SOFTENED_LJ_POTENTIAL_LOG);
		options_.setReal(VanDerWaalsSlick::Option::VDW_SOFTENING_LIMIT, 5.0f);

		float CONST = options_.setDefaultReal(SLICKEnergy::Option::CONST, SLICKEnergy::Default::CONST);
		setIntercept(CONST);

		// register all components of the force field
		registerComponents_();

		// check whether we know which molecule is the protein and which is the
		// ligand in this complex. In case we don't know, we have to guess.
		// This can be wrong if we got two PDB files which will both be tagged
		// as protein.
		if ((getReceptor() == 0) || (getLigand() == 0))
		{
			Log.error() << "I don't know what the protein and the ligand is." 
				<< std::endl;
			return false;
		}

		return true ;
	}
コード例 #2
0
ファイル: slickScore.C プロジェクト: HeyJJ/ball
	bool SLICKScore::setup()
	{
		setName("SLICKScore");

		// Set VDW to use a cut repulsive potential with a limit of 5 kJ/mol per interaction
		options_.setInteger(VanDerWaalsSlick::Option::VDW_METHOD, VanDerWaalsSlick::CALCULATION__SOFTENED_LJ_POTENTIAL_LOG);
		options_.setReal(VanDerWaalsSlick::Option::VDW_SOFTENING_LIMIT, 5.0f);

		// Use simple (and fast) Coulomb interactions for the scoring
		options_.setInteger(PolarSolvation::Option::POLAR_METHOD, PolarSolvation::CALCULATION__COULOMB);

		// Now extract options_ from options table and set the coefficients of
		// the components accordingly.
		float CONST = options_.setDefaultReal(SLICKScore::Option::CONST, SLICKScore::Default::CONST);
		setIntercept(CONST);

		// register all components of the force field
		registerComponents_();

		// check whether we know which molecule is the protein and which is the
		// ligand in this complex. In case we don't know, we have to guess.
		// This can be wrong if we got two PDB files which will both be tagged
		// as protein.
		if ((getReceptor() == 0) || (getLigand() == 0))
		{
			Log.error() << "I don't know what the protein and the ligand is." 
				<< std::endl;
			return false;
		}

		return true;
	}
コード例 #3
0
ファイル: VolumeModel.cpp プロジェクト: walk1ndude/visualizer
    void VolumeModel::init(const ModelInfo::Params & params) {
        AbstractModelWithPoints::init(params);

        VolumeInfo::PhysicalSize physicalSize = params["physicalSize"].value<VolumeInfo::PhysicalSize>();
        VolumeInfo::Size size = params["size"].value<VolumeInfo::Size>();
        VolumeInfo::Scaling scaling = params["scaling"].value<VolumeInfo::Scaling>();

        scale(scaling);

        setSlope(params["slope"].value<VolumeInfo::Slope>());
        setIntercept(params["intercept"].value<VolumeInfo::Intercept>());

        setWindowCenter(params["windowCenter"].value<VolumeInfo::WindowCenter>());
        setWindowWidth(params["windowWidth"].value<VolumeInfo::WindowWidth>());

        setHuRange(params["huRange"].value<VolumeInfo::HuRange>());
        setValueRange(params["valueRange"].value<VolumeInfo::ValueRange>());

        ModelInfo::VerticesVTPtr vertices = new ModelInfo::VerticesVT;
        ModelInfo::IndicesPtr indices = new ModelInfo::Indices;

        GLfloat scalingFactor = (GLfloat) scene()->scalingFactor();

        GLfloat zCurrent = - physicalSize.z() * scaling.z() / scalingFactor / 2.0f;
        
        GLfloat step = - (zCurrent * 2.0f) / size.z();
        GLfloat stepTexture = 1.0f / size.z();

        GLfloat zCurrentTexture = 0.0f;

        GLfloat w = physicalSize.x() / 2.0f * scaling.x() / scalingFactor;
        GLfloat h = physicalSize.y() / 2.0f * scaling.y() / scalingFactor;

        for (int i = 0; i != (int) size.z(); ++ i) {
            vertices->push_back(ModelInfo::VertexVT(- w, - h, zCurrent, 0.0f, 1.0f, zCurrentTexture));
            vertices->push_back(ModelInfo::VertexVT(- w, h, zCurrent, 0.0f, 0.0f, zCurrentTexture));
            vertices->push_back(ModelInfo::VertexVT(w, h, zCurrent, 1.0f, 0.0f, zCurrentTexture));
            vertices->push_back(ModelInfo::VertexVT(w, - h, zCurrent, 1.0f, 1.0f, zCurrentTexture));

            indices->push_back(4 * i);
            indices->push_back(4 * i + 2);
            indices->push_back(4 * i + 1);
            indices->push_back(4 * i);
            indices->push_back(4 * i + 3);
            indices->push_back(4 * i + 2);

            zCurrent += step;
            zCurrentTexture += stepTexture;
        };

        ModelInfo::BuffersVT buffers;

        buffers.vertices = ModelInfo::VerticesVTPointer(vertices);
        buffers.indices = ModelInfo::IndicesPointer(indices);
        
        fillBuffers<ModelInfo::BuffersVT>(buffers);
    }
コード例 #4
0
ファイル: Linear.cpp プロジェクト: danready/collsoft
Maths::Regression::Linear::Linear(double m_b_arg, double m_a_arg, double m_coeff_arg)
{
	//! Returns the slope of the regression line

	setSlope(m_b_arg);

	//! Returns the intercept on the Y axis of the regression line

	setIntercept(m_a_arg);

	//! Returns the linear regression coefficient

	setCoefficient(m_coeff_arg);
}