Loading...
Searching...
No Matches
backboneModel.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: backboneModel.h,v 1.20.18.1 2007/03/25 21:26:05 oliver Exp $
//
#ifndef BALL_VIEW_MODELS_BACKBONEMODEL_H
#define BALL_VIEW_MODELS_BACKBONEMODEL_H
#ifndef BALL_VIEW_MODELS_MODELPROCESSOR_H
# include <BALL/VIEW/MODELS/modelProcessor.h>
#endif
#ifndef BALL_MATHS_VECTOR3_H
# include <BALL/MATHS/vector3.h>
#endif
#ifndef BALL_KERNEL_SECONDARYSTRUCTURE_H
#include <BALL/KERNEL/secondaryStructure.h>
#endif
#ifndef BALL_KERNEL_PROTEIN_H
#include <BALL/KERNEL/protein.h>
#endif
#ifndef BALL_MATHS_MATRIX44_H
#include <BALL/MATHS/matrix44.h>
#endif
namespace BALL
{
namespace VIEW
{
class BALL_VIEW_EXPORT AddBackboneModel: public ModelProcessor
{
//_
protected:
struct ModelPart
{
ModelPart();
ModelPart(const ModelPart& m);
const ModelPart& operator = (const ModelPart& p);
// residues for this ModelPart
vector<Residue*> residues;
// Model Type, e.g. Strand, Helix, Ribbon
Index type;
// start and end index in guide_points_
Position first_guide_point;
Position last_guide_point;
// start and end index in interpolated_points_
Position first_point;
Position last_point;
};
enum ModelTypes
{
TUBE,
RIBBON,
NUCLEIC_ACID
};
public:
BALL_CREATE(AddBackboneModel)
AddBackboneModel();
AddBackboneModel(const AddBackboneModel& add_Backbone_model);
virtual ~AddBackboneModel();
virtual void clear();
virtual bool start();
virtual Processor::Result operator() (Composite& composite);
virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
void setTubeRadius(float radius)
{ tube_radius_ = radius;}
float getTubeRadius() const
{ return tube_radius_;}
virtual bool createGeometricObjects();
void setRibbonMode(bool state)
{ribbon_mode_ = state;}
bool ribbonModeEnabled() const
{return ribbon_mode_;}
protected:
virtual void calculateModelParts(Protein& protein);
virtual bool collectPositions(vector<Residue*> residues);
virtual void calculateGuidePoints_();
virtual void assignModelType(ModelPart& part);
virtual void createModel_(Position set_pos, Position model_pos);
// build a tube model
virtual void createTube_(Position set_pos, Position model_pos);
// build a ribbon / helix
virtual void createRibbon_(Position set_pos, Position model_pos);
virtual void refineGuidePoints_() {};
virtual void interpolate_();
virtual void refineModelParts_();
virtual void clear_();
inline void evaluateBSpline(const Vector3& v1, const Vector3& v2,
const Vector3& v3, float x, Vector3& result);
inline bool residuesAreConnected_(Residue& residue1, Residue& residue2);
inline void calculateTubePoints_(Vector3 right, Vector3 dir, vector<Vector3>& points);
inline void calculateRibbonPoints_(Vector3 xn, Vector3 dir, vector<Vector3>& points);
inline void calculateRibbonEllipse_(float ribbon_width, float ribbon_height);
//_
float tube_radius_;
//_
Size interpolation_steps_;
// must be alwas uneven:
Size number_of_ribbons_;
float ribbon_width_;
float ribbon_height_;
bool care_for_SS_;
bool ribbon_mode_;
vector<vector<vector<Vector3> > > guide_points_;
vector<vector<vector<Vector3> > > interpolated_points_;
vector<vector<Vector3> > backbone_;
vector<vector<Vector3> > offsets_;
vector<vector<ModelPart> > model_parts_;
Protein dummy_protein_;
Chain dummy_chain_;
SecondaryStructure dummy_ss_;
HashSet<Residue*> residues_to_be_rendered_;
Protein* last_protein_;
vector<vector<Index> > ss_;
// temp variables for speedup:
Size slides_;
Position middle_slide_;
Position middle_ribbon_;
Angle slides_angle_;
Matrix4x4 temp_matrix_;
vector<float> xs_, ys_;
};
} // namespace VIEW
} // namespace BALL
#endif // BALL_VIEW_MODELS_BACKBONEMODEL_H
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
BALL::Chain
Definition chain.h:32
BALL::Composite
Definition composite.h:74
BALL::HashSet
Definition hashSet.h:46
BALL::Processor
Definition processor.h:32
BALL::Protein
Definition protein.h:30
BALL::Residue
Definition residue.h:38
BALL::Result
Definition result.h:22
BALL::SecondaryStructure
Definition secondaryStructure.h:31
BALL::VIEW::AddBackboneModel
Definition backboneModel.h:42
BALL::VIEW::AddBackboneModel::temp_matrix_
Matrix4x4 temp_matrix_
Definition backboneModel.h:188
BALL::VIEW::AddBackboneModel::AddBackboneModel
AddBackboneModel()
Default Constructor.
BALL::VIEW::AddBackboneModel::backbone_
vector< vector< Vector3 > > backbone_
Definition backboneModel.h:173
BALL::VIEW::AddBackboneModel::guide_points_
vector< vector< vector< Vector3 > > > guide_points_
Definition backboneModel.h:171
BALL::VIEW::AddBackboneModel::assignModelType
virtual void assignModelType(ModelPart &part)
BALL::VIEW::AddBackboneModel::dummy_protein_
Protein dummy_protein_
Definition backboneModel.h:177
BALL::VIEW::AddBackboneModel::slides_angle_
Angle slides_angle_
Definition backboneModel.h:187
BALL::VIEW::AddBackboneModel::collectPositions
virtual bool collectPositions(vector< Residue * > residues)
BALL::VIEW::AddBackboneModel::getTubeRadius
float getTubeRadius() const
Definition backboneModel.h:115
BALL::VIEW::AddBackboneModel::setRibbonMode
void setRibbonMode(bool state)
Definition backboneModel.h:122
BALL::VIEW::AddBackboneModel::last_protein_
Protein * last_protein_
Definition backboneModel.h:181
BALL::VIEW::AddBackboneModel::calculateRibbonPoints_
void calculateRibbonPoints_(Vector3 xn, Vector3 dir, vector< Vector3 > &points)
BALL::VIEW::AddBackboneModel::number_of_ribbons_
Size number_of_ribbons_
Definition backboneModel.h:165
BALL::VIEW::AddBackboneModel::refineGuidePoints_
virtual void refineGuidePoints_()
Definition backboneModel.h:144
BALL::VIEW::AddBackboneModel::offsets_
vector< vector< Vector3 > > offsets_
Definition backboneModel.h:174
BALL::VIEW::AddBackboneModel::createTube_
virtual void createTube_(Position set_pos, Position model_pos)
BALL::VIEW::AddBackboneModel::middle_ribbon_
Position middle_ribbon_
Definition backboneModel.h:186
BALL::VIEW::AddBackboneModel::createRibbon_
virtual void createRibbon_(Position set_pos, Position model_pos)
BALL::VIEW::AddBackboneModel::setTubeRadius
void setTubeRadius(float radius)
Definition backboneModel.h:111
BALL::VIEW::AddBackboneModel::middle_slide_
Position middle_slide_
Definition backboneModel.h:185
BALL::VIEW::AddBackboneModel::clear
virtual void clear()
BALL::VIEW::AddBackboneModel::care_for_SS_
bool care_for_SS_
Definition backboneModel.h:168
BALL::VIEW::AddBackboneModel::residues_to_be_rendered_
HashSet< Residue * > residues_to_be_rendered_
Definition backboneModel.h:180
BALL::VIEW::AddBackboneModel::ys_
vector< float > ys_
Definition backboneModel.h:189
BALL::VIEW::AddBackboneModel::interpolated_points_
vector< vector< vector< Vector3 > > > interpolated_points_
Definition backboneModel.h:172
BALL::VIEW::AddBackboneModel::start
virtual bool start()
BALL::VIEW::AddBackboneModel::calculateGuidePoints_
virtual void calculateGuidePoints_()
BALL::VIEW::AddBackboneModel::dummy_chain_
Chain dummy_chain_
Definition backboneModel.h:178
BALL::VIEW::AddBackboneModel::residuesAreConnected_
bool residuesAreConnected_(Residue &residue1, Residue &residue2)
BALL::VIEW::AddBackboneModel::dummy_ss_
SecondaryStructure dummy_ss_
Definition backboneModel.h:179
BALL::VIEW::AddBackboneModel::interpolate_
virtual void interpolate_()
BALL::VIEW::AddBackboneModel::interpolation_steps_
Size interpolation_steps_
Definition backboneModel.h:163
BALL::VIEW::AddBackboneModel::evaluateBSpline
void evaluateBSpline(const Vector3 &v1, const Vector3 &v2, const Vector3 &v3, float x, Vector3 &result)
BALL::VIEW::AddBackboneModel::calculateModelParts
virtual void calculateModelParts(Protein &protein)
BALL::VIEW::AddBackboneModel::calculateRibbonEllipse_
void calculateRibbonEllipse_(float ribbon_width, float ribbon_height)
BALL::VIEW::AddBackboneModel::ribbonModeEnabled
bool ribbonModeEnabled() const
Definition backboneModel.h:126
BALL::VIEW::AddBackboneModel::ribbon_width_
float ribbon_width_
Definition backboneModel.h:166
BALL::VIEW::AddBackboneModel::ribbon_mode_
bool ribbon_mode_
Definition backboneModel.h:169
BALL::VIEW::AddBackboneModel::dump
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
BALL::VIEW::AddBackboneModel::slides_
Size slides_
Definition backboneModel.h:184
BALL::VIEW::AddBackboneModel::xs_
vector< float > xs_
Definition backboneModel.h:189
BALL::VIEW::AddBackboneModel::createModel_
virtual void createModel_(Position set_pos, Position model_pos)
BALL::VIEW::AddBackboneModel::ribbon_height_
float ribbon_height_
Definition backboneModel.h:167
BALL::VIEW::AddBackboneModel::ModelTypes
ModelTypes
Definition backboneModel.h:65
BALL::VIEW::AddBackboneModel::TUBE
@ TUBE
Definition backboneModel.h:66
BALL::VIEW::AddBackboneModel::RIBBON
@ RIBBON
Definition backboneModel.h:67
BALL::VIEW::AddBackboneModel::NUCLEIC_ACID
@ NUCLEIC_ACID
Definition backboneModel.h:68
BALL::VIEW::AddBackboneModel::calculateTubePoints_
void calculateTubePoints_(Vector3 right, Vector3 dir, vector< Vector3 > &points)
BALL::VIEW::AddBackboneModel::model_parts_
vector< vector< ModelPart > > model_parts_
Definition backboneModel.h:175
BALL::VIEW::AddBackboneModel::clear_
virtual void clear_()
BALL::VIEW::AddBackboneModel::refineModelParts_
virtual void refineModelParts_()
BALL::VIEW::AddBackboneModel::ss_
vector< vector< Index > > ss_
Definition backboneModel.h:182
BALL::VIEW::AddBackboneModel::tube_radius_
float tube_radius_
Definition backboneModel.h:160
BALL::VIEW::AddBackboneModel::createGeometricObjects
virtual bool createGeometricObjects()
BALL::VIEW::ModelProcessor::ModelProcessor
ModelProcessor()
BALL_CREATE
#define BALL_CREATE(name)
Definition create.h:62
BALL::Matrix4x4
TMatrix4x4< float > Matrix4x4
Definition matrix44.h:2184
matrix44.h
modelProcessor.h
BALL::VIEW
Definition constraints.h:35
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
BALL::Position
BALL_SIZE_TYPE Position
Definition COMMON/global.h:140
BALL::Vector3
TVector3< float > Vector3
Definition vector3.h:1084
BALL::residues
BALL_EXPORT ResidueList residues(const AtomContainer &fragment, bool selected_only=false)
BALL::Angle
TAngle< float > Angle
Definition angle.h:697
BALL::Index
BALL_INDEX_TYPE Index
Definition COMMON/global.h:105
std
STL namespace.
protein.h
secondaryStructure.h
BALL::VIEW::AddBackboneModel::ModelPart
Definition backboneModel.h:47
BALL::VIEW::AddBackboneModel::ModelPart::first_point
Position first_point
Definition backboneModel.h:60
BALL::VIEW::AddBackboneModel::ModelPart::ModelPart
ModelPart()
BALL::VIEW::AddBackboneModel::ModelPart::type
Index type
Definition backboneModel.h:55
BALL::VIEW::AddBackboneModel::ModelPart::residues
vector< Residue * > residues
Definition backboneModel.h:53
BALL::VIEW::AddBackboneModel::ModelPart::last_point
Position last_point
Definition backboneModel.h:61
BALL::VIEW::AddBackboneModel::ModelPart::ModelPart
ModelPart(const ModelPart &m)
BALL::VIEW::AddBackboneModel::ModelPart::last_guide_point
Position last_guide_point
Definition backboneModel.h:58
BALL::VIEW::AddBackboneModel::ModelPart::first_guide_point
Position first_guide_point
Definition backboneModel.h:57
vector3.h