RDKit: FreeChemicalFeature.h Source File

| RDKit Open-source cheminformatics and machine learning.

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

FreeChemicalFeature.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2008 Greg Landrum and Rational Discovery LLC
3 //
4 // @@ All Rights Reserved @@
5 // This file is part of the RDKit.
6 // The contents are covered by the terms of the BSD license
7 // which is included in the file license.txt, found at the root
8 // of the RDKit source tree.
9 //
10 #ifndef __FREECHEMICALFEATURE_H_13012005_1023__
11 #define __FREECHEMICALFEATURE_H_13012005_1023__
12
13 #include <Geometry/point.h>
14 #include <ChemicalFeatures/ChemicalFeature.h>
15
16 namespace ChemicalFeatures {
17
18 //------------------------------------------------------
19 //! Class for chemical features that do not orignate from molecules
20 // e.g. pharamcophores, site-maps etc.
21 class FreeChemicalFeature : public ChemicalFeature {
22 public:
23 //! start with everything specified
24 FreeChemicalFeature(const std::string &family, std::string type,
25 const RDGeom::Point3D &loc, int id = -1)
26 : d_id(id), d_family(family), d_type(type), d_position(loc) {}
27
28 //! start with family and location specified, leave the type blank
29 FreeChemicalFeature(const std::string &family, const RDGeom::Point3D &loc)
30 : d_id(-1), d_family(family), d_type(""), d_position(loc) {}
31
32 //! start with everything blank
33 FreeChemicalFeature()
34 : d_id(-1),
35 d_family(""),
36 d_type(""),
37 d_position(RDGeom::Point3D(0.0, 0.0, 0.0)) {}
38
39 explicit FreeChemicalFeature(const std::string &pickle) {
40 this->initFromString(pickle);
41 }
42
43 FreeChemicalFeature(const FreeChemicalFeature &other)
44 : d_id(other.getId()),
45 d_family(other.getFamily()),
46 d_type(other.getType()),
47 d_position(other.getPos()) {}
48
49 ~FreeChemicalFeature() {}
50
51 //! return our id
52 int getId() const { return d_id; }
53
54 //! return our family
55 const std::string &getFamily() const { return d_family; }
56
57 //! return our type
58 const std::string &getType() const { return d_type; }
59
60 //! return our position
61 RDGeom::Point3D getPos() const { return d_position; }
62
63 //! set our id
64 void setId(const int id) { d_id = id; }
65
66 //! set our family
67 void setFamily(const std::string &family) { d_family = family; }
68
69 //! set our type
70 void setType(const std::string &type) { d_type = type; }
71
72 //! set our position
73 void setPos(const RDGeom::Point3D &loc) {
74 // std::cout << loc.x << " " << loc.y << " " << loc.z << "\n";
75 d_position = loc;
76 // std::cout << d_position.x << " " << d_position.y << " " << d_position.z
77 // << "\n";
78 }
79
80 //! returns a serialized form of the feature (a pickle)
81 std::string toString() const;
82 //! initialize from a pickle string
83 void initFromString(const std::string &pickle);
84
85 private:
86 int d_id;
87 std::string d_family;
88 std::string d_type;
89 RDGeom::Point3D d_position;
90 };
91 }
92
93 #endif
ChemicalFeatures::FreeChemicalFeature::getPos
RDGeom::Point3D getPos() const
return our position
Definition: FreeChemicalFeature.h:61
ChemicalFeatures::FreeChemicalFeature::getType
const std::string & getType() const
return our type
Definition: FreeChemicalFeature.h:58
point.h
ChemicalFeatures::FreeChemicalFeature
Class for chemical features that do not orignate from molecules.
Definition: FreeChemicalFeature.h:21
ChemicalFeatures::FreeChemicalFeature::FreeChemicalFeature
FreeChemicalFeature(const std::string &family, std::string type, const RDGeom::Point3D &loc, int id=-1)
start with everything specified
Definition: FreeChemicalFeature.h:24
ChemicalFeature.h
ChemicalFeatures::FreeChemicalFeature::FreeChemicalFeature
FreeChemicalFeature(const std::string &pickle)
Definition: FreeChemicalFeature.h:39
ChemicalFeatures::FreeChemicalFeature::setFamily
void setFamily(const std::string &family)
set our family
Definition: FreeChemicalFeature.h:67
ChemicalFeatures::FreeChemicalFeature::initFromString
void initFromString(const std::string &pickle)
initialize from a pickle string
ChemicalFeatures::ChemicalFeature
abstract base class for chemical feature
Definition: ChemicalFeature.h:18
ChemicalFeatures::FreeChemicalFeature::getFamily
const std::string & getFamily() const
return our family
Definition: FreeChemicalFeature.h:55
ChemicalFeatures::FreeChemicalFeature::getId
int getId() const
return our id
Definition: FreeChemicalFeature.h:52
ChemicalFeatures::FreeChemicalFeature::~FreeChemicalFeature
~FreeChemicalFeature()
Definition: FreeChemicalFeature.h:49
ChemicalFeatures::FreeChemicalFeature::setId
void setId(const int id)
set our id
Definition: FreeChemicalFeature.h:64
RDGeom::Point3D
Definition: point.h:45
ChemicalFeatures::FreeChemicalFeature::setPos
void setPos(const RDGeom::Point3D &loc)
set our position
Definition: FreeChemicalFeature.h:73
ChemicalFeatures::FreeChemicalFeature::toString
std::string toString() const
returns a serialized form of the feature (a pickle)
ChemicalFeatures::FreeChemicalFeature::setType
void setType(const std::string &type)
set our type
Definition: FreeChemicalFeature.h:70
ChemicalFeatures::FreeChemicalFeature::FreeChemicalFeature
FreeChemicalFeature(const FreeChemicalFeature &other)
Definition: FreeChemicalFeature.h:43
ChemicalFeatures
Definition: ChemicalFeature.h:14
ChemicalFeatures::FreeChemicalFeature::FreeChemicalFeature
FreeChemicalFeature(const std::string &family, const RDGeom::Point3D &loc)
start with family and location specified, leave the type blank
Definition: FreeChemicalFeature.h:29
RDGeom
Definition: TorsionAngleM6.h:19
ChemicalFeatures::FreeChemicalFeature::FreeChemicalFeature
FreeChemicalFeature()
start with everything blank
Definition: FreeChemicalFeature.h:33