00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef OST_ENTITY_HANDLE_HH
00020 #define OST_ENTITY_HANDLE_HH
00021
00022 #include <ost/mol/module_config.hh>
00023 #include <ost/mol/transform.hh>
00024
00025 #include "impl/entity_impl_fw.hh"
00026 #include "entity_visitor_fw.hh"
00027 #include "query.hh"
00028 #include "entity_observer_fw.hh"
00029 #include "residue_prop.hh"
00030 #include "entity_view.hh"
00031 #include "chain_handle.hh"
00032 #include "handle_type_fw.hh"
00033 #include "iterator_fw.hh"
00034
00035
00036 #include "editor_type_fw.hh"
00037
00038 namespace ost { namespace mol {
00039
00042 DLLEXPORT_OST_MOL EntityHandle CreateEntity();
00043
00056 class DLLEXPORT_OST_MOL EntityHandle : public EntityBase {
00057 public:
00058 friend class XCSEditor;
00059 friend class ICSEditor;
00060
00062 EntityHandle(const impl::EntityImplPtr&);
00063
00065 EntityHandle();
00066
00070 EntityHandle Copy() const;
00071
00072
00073
00075
00076
00077
00078
00079
00080 geom::Vec3 GetCenterOfAtoms() const;
00081
00083 Real GetMass() const;
00084
00086 geom::Vec3 GetCenterOfMass() const;
00091 geom::Vec3 GetGeometricCenter() const;
00092
00094 geom::Vec3 GetGeometricStart() const;
00095
00097 geom::Vec3 GetGeometricEnd() const;
00098
00100 geom::Vec3 GetBoundarySize() const;
00102
00105 void Swap(EntityHandle& eh);
00106
00109 void DeepSwap(EntityHandle& eh);
00110
00112
00113
00114 void AttachObserver(const EntityObserverPtr&);
00115
00116
00118 void DetachObserver(const EntityObserverPtr&);
00120
00121
00123 void Apply(EntityVisitor& v);
00124
00125
00133 TorsionHandle FindTorsion(const AtomHandle& a1, const AtomHandle& a2,
00134 const AtomHandle& a3, const AtomHandle& a4) const;
00135
00137 ChainHandleList GetChainList() const;
00138
00144 ResidueHandleIter ResiduesBegin() const;
00145
00157 ResidueHandleIter ResiduesEnd() const;
00158
00160 ChainHandleIter ChainsBegin() const;
00161
00163 ChainHandleIter ChainsEnd() const;
00164
00166 AtomHandleIter AtomsBegin() const;
00167
00169 AtomHandleIter AtomsEnd() const;
00170
00172
00173
00174
00175
00176
00177
00178
00179 ChainHandle FindChain(const String& name) const;
00180
00196 ResidueHandle FindResidue(const String& chain_name,
00197 const ResNum& number) const;
00198
00206 AtomHandle FindAtom(const String& chain_name,
00207 const ResNum& number,
00208 const String& atom_name) const;
00210
00212 AtomHandleList FindWithin(const geom::Vec3& pos, Real radius) const;
00213
00216 EntityView Select(const Query& q, QueryFlags flags=0) const;
00217
00220 EntityView Select(const String& query_string, QueryFlags flags=0) const;
00221
00223 EntityView CreateFullView() const;
00224
00226 EntityView CreateEmptyView() const;
00227
00233 int GetAtomCount() const;
00234
00240 int GetResidueCount() const;
00241
00243 int GetChainCount() const;
00244
00246 int GetBondCount() const;
00247
00249 mol::BondHandleList GetBondList() const;
00250
00251
00253 Real GetAngle(const AtomHandle& a1, const AtomHandle& a2,
00254 const AtomHandle& a3) const;
00255
00257 Real GetAngle(const AtomView& a1, const AtomView& a2,
00258 const AtomView& a3) const;
00259
00260 const geom::Mat4& GetTransformationMatrix() const;
00261
00262
00263 const geom::Mat4& GetInvTransformationMatrix() const;
00264
00265 bool IsTransformationIdentity() const;
00266
00269 ResidueHandleList GetResidueList() const;
00270
00273 AtomHandleList GetAtomList() const;
00274
00278 XCSEditor RequestXCSEditor(EditMode mode=UNBUFFERED_EDIT) const;
00279
00283 ICSEditor RequestICSEditor(EditMode mode=UNBUFFERED_EDIT) const;
00284
00288 EntityHandle GetHandle() const;
00289 bool operator==(const EntityHandle& ref) const;
00290 bool operator!=(const EntityHandle& ref) const;
00291 };
00292
00293 }}
00294
00295 #endif // OST_ENTITY_HANDLE_HH
00296