10 #ifndef __FEATURE_H_30112004_1121__ 11 #define __FEATURE_H_30112004_1121__ 17 template <
typename FAMILYMARKER,
typename TYPEMARKER=FAMILYMARKER,
typename LOCTYPE=RDGeom::Po
int3D>
22 d_family(f), d_type(t) {};
24 d_family(f), d_type(t), d_loc(loc){};
26 const FAMILYMARKER &
getFamily()
const {
return d_family; };
27 void setFamily(
const FAMILYMARKER &f) { d_family=f; };
29 const TYPEMARKER &
getType()
const {
return d_type; };
30 void setType(
const TYPEMARKER &t) { d_type=t; };
32 const LOCTYPE &
getLoc()
const {
return d_loc; };
33 void setLoc(
const LOCTYPE &loc) { d_loc=loc; };
35 const std::vector<LOCTYPE> &
getDirs()
const {
return d_dirs; };
36 std::vector<LOCTYPE> &
getDirs() {
return d_dirs; };
39 FAMILYMARKER d_family;
42 std::vector<LOCTYPE> d_dirs;
46 template <
typename FAMILYMARKER,
typename TYPEMARKER=FAMILYMARKER,
typename LOCTYPE=RDGeom::Po
int3D>
51 d_weightSum(0.0), d_family(f), d_type(t) {};
53 const FAMILYMARKER &
getFamily()
const {
return d_family; };
54 void setFamily(
const FAMILYMARKER &f) { d_family=f; };
56 const TYPEMARKER &
getType()
const {
return d_type; };
57 void setType(
const TYPEMARKER &t) { d_type=t; };
60 PRECONDITION(d_weights.size()==d_locs.size(),
"weight/locs mismatch");
62 for(
unsigned int i=0;i<d_weights.size();i++){
63 LOCTYPE tmp=*d_locs[i];
64 tmp *= d_weights[i]/d_weightSum;
69 void addPoint(
const LOCTYPE *p,
double weight=1.0){
71 d_weights.push_back(weight);
72 d_weightSum += weight;
80 const std::vector<LOCTYPE> &
getDirs()
const {
return d_dirs; };
81 std::vector<LOCTYPE> &
getDirs() {
return d_dirs; };
86 FAMILYMARKER d_family;
88 std::vector<double> d_weights;
89 std::vector<const LOCTYPE *> d_locs;
91 std::vector<LOCTYPE> d_dirs;
void setFamily(const FAMILYMARKER &f)
ImplicitFeature(const FAMILYMARKER &f, const TYPEMARKER &t)
void setFamily(const FAMILYMARKER &f)
const LOCTYPE & getLoc() const
const std::vector< LOCTYPE > & getDirs() const
const FAMILYMARKER & getFamily() const
const TYPEMARKER & getType() const
std::vector< LOCTYPE > & getDirs()
ExplicitFeature(const FAMILYMARKER &f, const TYPEMARKER &t, const LOCTYPE &loc)
void setType(const TYPEMARKER &t)
const TYPEMARKER & getType() const
std::vector< LOCTYPE > & getDirs()
const FAMILYMARKER & getFamily() const
ExplicitFeature(const FAMILYMARKER &f, const TYPEMARKER &t)
#define PRECONDITION(expr, mess)
void addPoint(const LOCTYPE *p, double weight=1.0)
void setLoc(const LOCTYPE &loc)
const std::vector< LOCTYPE > & getDirs() const
void setType(const TYPEMARKER &t)