Class documentation of Concepts

Loading...
Searching...
No Matches
edgeTraceTypes.hh
Go to the documentation of this file.
1
6#ifndef edgeTracetypes_hh
7#define edgeTracetypes_hh
8
9#include <map>
10#include "geometry/semantics.hh"
13#include "toolbox/hashMap.hh"
14
15namespace concepts {
16
25 public:
26 enum traceTypes { FIRST, MEAN, JUMP, PLUS, MINUS };
27
28 //by default look outward first and use first trace only
29 EdgeTraceType(): type_(FIRST), normalVectorRule_(EdgeNormalVectorRule().clone()) {}
30
31 // Constructor that takes into account a give type
33 type_(ettype.type_), normalVectorRule_(ettype.normalVectorRule_->clone()) {}
34
35
37 type_(type), normalVectorRule_(normalVectorRule.clone()) {
38 }
39
40 virtual ~EdgeTraceType();
41
42 EdgeTraceType& operator=(const EdgeTraceType& ettype) {
43 if (&ettype != this) {
44 type_ = ettype.type_;
45 normalVectorRule_.reset(ettype.normalVectorRule_->clone());
46 }
47 return *this;
48 }
49
51 std::string typeStr() const;
52
53 enum traceTypes type() const { return type_; }
54
55 const EdgeNormalVectorRule& rule() const{return *normalVectorRule_;}
56
57 protected:
58 virtual std::ostream& info(std::ostream& os) const;
59 private :
60 //trace Type
61 enum traceTypes type_;
62 //normalvectorrule
63 std::unique_ptr< concepts::EdgeNormalVectorRule> normalVectorRule_;
64 };
65
66
80 class EdgeTraceTypes : public Semantics<EdgeTraceType> {
81 public:
82
86
90 virtual ~EdgeTraceTypes();
91
99 virtual EdgeTraceType operator()(Attribute attrib) const;
100
101
102
112 void add(const Attribute& attrib,const EdgeTraceType& ettObject){
113 edgeTraceTypes_[attrib.attrib()]= ettObject;
114 }
115
116 void add(const Set<Attribute>& attrib,const EdgeTraceType& ettObject){
117 Set<Attribute>::const_iterator iter = attrib.begin();
118 for( ; iter != attrib.end(); iter++){
119 edgeTraceTypes_[iter->attrib()]= ettObject;
120 }
121 }
122
128 std::map<uint, EdgeTraceType>::const_iterator iter = edgeTraceTypes_.begin();
129 for( ; iter!= edgeTraceTypes_.end();iter++){
130 domain.insert(iter->first);
131 }
132 return domain;
133 }
134
135 protected:
136 virtual std::ostream& info(std::ostream& os) const;
137 private:
141 mutable std::map<uint, EdgeTraceType> edgeTraceTypes_;
142 };
143
144
145
146} // namespace concepts
147
148#endif // edgeTracetypes_hh
uint attrib() const
Returns the attribute.
Definition connector.hh:38
std::string typeStr() const
Return the type of the edgeTraceType as output string.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
void add(const Attribute &attrib, const EdgeTraceType &ettObject)
Set< uint > domain() const
virtual EdgeTraceType operator()(Attribute attrib) const
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320