216 |
} |
} |
217 |
} |
} |
218 |
|
|
|
//! Generates references using the domain \a D. |
|
|
void Structured3DMesh::createReferences(const Domain& D) |
|
|
{ |
|
|
for (size_t i=0; i<this->numberOfVertices(); ++i) { |
|
|
/// Reference used for vertex inside Objects. |
|
|
vertex(i).Ref().insideDomain() = D.inside(vertex(i)); |
|
|
} |
|
|
} |
|
|
|
|
219 |
//! Generates references associated to a POVRef ... |
//! Generates references associated to a POVRef ... |
220 |
void Structured3DMesh::createReferences(const Domain& D, |
void Structured3DMesh::createReferences(const Shape& S) |
|
const TinyVector<3,real_t>& aReference) |
|
221 |
{ |
{ |
|
const Scene& S = D.scene(); |
|
|
|
|
222 |
for (size_t i=0; i<this->numberOfVertices(); ++i) { |
for (size_t i=0; i<this->numberOfVertices(); ++i) { |
223 |
Vertex& V = vertex(i); |
Vertex& V = vertex(i); |
|
V.Ref().resize(S.nbObjects()); |
|
|
for (size_t j=0; j<S.nbObjects(); ++j) { |
|
|
if (S.object(j).inside(V)) { |
|
|
V.Ref() = j;//static_cast<int>(listobj[j]-&S.object(0) + 1); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
for (size_t i=0; i<__cells.size(); ++i) { |
|
|
Cell& C = cell(i); |
|
224 |
|
|
225 |
C.reference() = 1; // Cell's ref is set to 1 |
V.Ref() = S.inside(V); |
|
|
|
|
for (int l=0; l<8; l++) // if one of the vertices is inside the cell is inside |
|
|
if (!C(l).Ref().isSet()) { |
|
|
C.reference() = 0; |
|
|
break; |
|
|
} |
|
226 |
} |
} |
227 |
} |
} |
228 |
|
|