21 #include "SheafSystem/line_surface_intersecter.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/base_space_poset.h" 25 #include "SheafSystem/e3.h" 26 #include "SheafSystem/sec_at1_space.h" 27 #include "SheafSystem/sec_e3.h" 28 #include "SheafSystem/section_space_schema_poset.h" 56 _host = &(_coords->schema().host()->base_space());
57 _surface_id_space = &_host->blocks().id_space();
58 _eval_id_space = &_coords->schema().evaluation().id_space();
61 _coords->release_access();
134 require(unexecutable(
"temporarily only implemented for lines parallel to z axis"));
135 require(xp0[0] == xp1[0]);
136 require(xp0[1] == xp1[1]);
137 require(xp0[0] <= _locator->ub()[0]);
138 require(xp0[1] <= _locator->ub()[1]);
139 require(xp0[0] >= _locator->lb()[0]);
140 require(xp0[1] >= _locator->lb()[1]);
162 _locator->relative_position_pa(gbl_pos, 3, rel_pos);
173 _locator->relative_position_pa(gbl_pos, 3, rel_pos);
174 rel_pos[2] = (_locator->bin_ub()[2])-1;
188 _locator->box_list(&lbox, lboxes);
193 box_set_type::iterator lbox_itr = lboxes.begin();
194 while(lbox_itr != lboxes.end())
198 if(intersect(xp0, xp1, **lbox_itr, lintersection))
212 intersection_set_type::value_type lval(lintersection[2],(*lbox_itr)->branch_id().pod());
213 xresult.insert(lval);
315 bool same_sign = ((u < 0) == (v < 0)) || (u == 0) || (v == 0);
319 if(!same_sign)
return false;
327 same_sign = ((u < 0) == (w < 0)) || (u == 0) || (w == 0);
331 if(!same_sign)
return false;
336 bool all_zero = (u == 0) && (v == 0) && (w == 0) ;
338 if(all_zero)
return false;
351 xr[0] = u*ax + v*bx + w*cx;
352 xr[1] = u*ay + v*by + w*cy;
353 xr[2] = u*az + v*bz + w*cz;
407 ensure(is_same_type(result));
441 if(invariant_check())
445 disable_invariant_check();
449 invariance(any::invariant());
455 enable_invariant_check();
477 xos << *(xp.
_host) << endl;
std::map< sec_vd_value_type, pod_index_type, really_less_than > intersection_set_type
The type of intersetion set, a map from z coordinate to surface id; sorted by z coordinate.
Namespace containing the Euclidean vector algebra functions for the fiber_bundles component of the sh...
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
Euclidean vector space of dimension 3 (volatile version).
search_structure_type::box_set_type box_set_type
The type of search structure box set.
void put_lb(const d_bin_coordinates< DC, DB > &xlb)
Copies the contents of xlb to lb().
base_space_poset * _host
The base space.
virtual line_surface_intersecter * clone() const
Virtual constructor, makes a new instance of the same type as this.
virtual void get_read_access() const
Get read access to the state associated with this.
host_type * host() const
The poset this is a member of.
const sec_e3 & coords() const
The section space containing the surfaces.
virtual bool invariant() const
Class invariant.
SHEAF_DLL_SPEC vd_value_type dot(const ed &x0, const ed &x1, bool xauto_access)
The Euclidean "dot" product of x0 with x1 (version for persistent types).
Fixed point relative coordinates for a tree domain.
sec_e3 * _coords
The coordinate section for lines.
Abstract base class with useful features for all objects.
void intersect(const e3_lite &xp0, const e3_lite &xp1, intersection_set_type &xresult) const
Computes the intersections of the line passing through points xp0 and xp1 with the surfaces defined b...
Namespace containing the 3D Euclidean vector algebra functions for the fiber_bundles component of the...
size_type dofs_index() const
Index into the gathered dofs array for the evaluation member this bounds.
line_surface_intersecter()
Default constructor; disabled.
A line-surface intersection query.
A bounding box that can be strung together into a list.
SHEAF_DLL_SPEC double same_sign(double xa, double xb)
Convert xa to have the same sign as xb.
A section of a fiber bundle with a 3-dimensional Euclidean vector space fiber.
void SHEAF_DLL_SPEC cross(const e3 &x0, const e3 &x1, e3 &xresult, bool xauto_access)
The 3D Euclidean vector "cross" product of x0 with x1 (pre-allocated version).
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &xos, const array_cylindrical_point_locator &xpl)
Insert array_cylindrical_point_locator xpl into ostream xos.
void put_ub(const d_bin_coordinates< DC, DB > &xub)
Copies the contents of xub to ub().
search_structure_type * _locator
The intersection search structure.
virtual ~line_surface_intersecter()
Destructor.
double sec_vd_dof_type
The type of degree of freedom in the section space.
Namespace containing the vector algrebra functions for the fiber_bundles component of the sheaf syste...
Namespace for geometry component of sheaf system.
vd_value_type sec_vd_value_type
The type of component in the value of a section at a point.
line_surface_intersecter & operator=(const line_surface_intersecter &xother)
Assignment operator.
double vd_value_type
The type of component in the fiber; the scalar type in the fiber vector space.
A point location query in domains with global coordinate dimension DC and local coordinate dimension ...