27 |
#include <Object.hpp> |
#include <Object.hpp> |
28 |
#include <TinyVector.hpp> |
#include <TinyVector.hpp> |
29 |
|
|
30 |
|
#include <map> |
31 |
|
|
32 |
/** |
/** |
33 |
* @file Domain.hpp |
* @file Domain.hpp |
34 |
* @author Stephane Del Pino |
* @author Stephane Del Pino |
49 |
*/ |
*/ |
50 |
bool __isR3; |
bool __isR3; |
51 |
|
|
52 |
ReferenceCounting<Object> __objects; /**< The shape of the domain */ |
ReferenceCounting<Object> |
53 |
|
__objects; /**< The shape of the domain */ |
54 |
|
|
55 |
|
const Scene& __scene; /**< The POV-Ray scene */ |
56 |
|
|
57 |
const Scene& __scene; |
std::map<TinyVector<3, real_t>, size_t> |
58 |
|
__povToReference; /**< The POV-Ray to internal |
59 |
|
references association*/ |
60 |
|
|
61 |
|
void __buildReferenceAssociation(const Object& o); |
62 |
|
|
63 |
const bool __inShape(const TinyVector<3>& X) const |
const bool __inShape(const TinyVector<3>& X) const |
64 |
{ |
{ |
66 |
} |
} |
67 |
|
|
68 |
public: |
public: |
69 |
|
size_t reference(const TinyVector<3, real_t>& ref) const |
70 |
|
{ |
71 |
|
std::map<TinyVector<3, real_t>, size_t>::const_iterator i |
72 |
|
= __povToReference.find(ref); |
73 |
|
if (i == __povToReference.end()) { |
74 |
|
fferr(0) << "Reference " << ref << " is not defined in the domain\n"; |
75 |
|
std::exit(1); |
76 |
|
} |
77 |
|
return (*i).second; |
78 |
|
} |
79 |
|
|
80 |
/** |
/** |
81 |
* Outputs the Domain \a D in the \p std::ostream \a os. |
* Outputs the Domain \a D in the \p std::ostream \a os. |
82 |
*/ |
*/ |
135 |
{ |
{ |
136 |
__isR3 = false; |
__isR3 = false; |
137 |
__objects = objects; |
__objects = objects; |
138 |
|
this->__buildReferenceAssociation(*__objects); |
139 |
} |
} |
140 |
|
|
141 |
/** |
/** |