36 #include <sidl_cxx.hh>
42 #include "MsqDebug.hpp"
44 #include "MsqError.hpp"
75 void normal (
void* geom_handle,
Vector3D& coord )
const throw( TSTTB::Error );
82 void normal (
void* geom_handle,
Vector3D coords[],
unsigned count )
const
83 throw( TSTTB::Error );
113 TSTTR::Relate& relate )
throw( TSTTB::Error );
164 void* geom_ent_handle )
throw( TSTTB::Error );
200 TSTTR::Relate& relate,
206 catch (TSTTB::Error& tstt_err ) {
213 void* geom_ent_handle,
219 catch (TSTTB::Error& tstt_err ) {
235 TSTTR::Relate& relate )
236 throw ( TSTTB::Error )
240 relateIface( relate ),
241 oneMeshHandle( alloc_sidl_vector<void*>(1) ),
242 oneTypeOut( alloc_sidl_vector<TSTTG::GentityType>(1) )
260 catch (TSTTB::Error& tstt_err ) {
271 normal( geom, coordinate );
273 catch (TSTTB::Error& tstt_err ) {
290 normal( geom, coordinates, count );
292 catch (TSTTB::Error& tstt_err ) {
312 catch (TSTTB::Error& tstt_err ) {
319 throw ( TSTTB::Error )
322 oneMeshHandle.set( 0, mesh_ent_handle );
323 relateIface.getMeshRelatedEntities( &geomIface,
329 topoIface.gentityGetType( geomHandles, 1, oneTypeOut, junk );
331 return oneTypeOut[0] == TSTTG::GentityType_GREGION ? 0 : geomHandles.get(0);
340 throw ( TSTTB::Error )
342 geomEntHandle( geom_ent_handle )
358 catch (TSTTB::Error& tstt_err ) {
369 catch (TSTTB::Error& tstt_err ) {
383 catch (TSTTB::Error& tstt_err ) {
397 catch (TSTTB::Error& tstt_err ) {
409 geomHandles( alloc_sidl_vector<void*>(1) ),
410 positionsIn( alloc_sidl_vector<double>(3) )
419 throw ( TSTTB::Error )
423 assert(
sizeof(
Vector3D) == 3*
sizeof(
double) );
430 geomIface.gentityClosestPoint( geomHandles, 1,
432 positionsOut, junk );
438 throw ( TSTTB::Error )
442 assert(
sizeof(
Vector3D) == 3*
sizeof(
double) );
449 geomIface.gentityNormal( geomHandles, 1,
455 throw ( TSTTB::Error )
459 assert(
sizeof(
Vector3D) == 3*
sizeof(
double) );
461 if (positionsIn.upper(0)+1 < 3*(int)count)
462 positionsIn = positionsIn.create1d( 3*count );
467 if (geomHandles.upper(0)+1 < (int)count)
468 geomHandles = geomHandles.create1d( count );
470 for (
void** end = ptr + count; ptr != end; ++ptr)
474 geomIface.gentityNormal( geomHandles, count,
475 positionsIn, 3*count,
487 assert(
sizeof(
Vector3D) == 3*
sizeof(
double) );
495 geomIface.gentityClosestPointAndNormal( geomHandles, 1,
sidl::array< double > normalsOut
void move_to(void *geom_handle, Vector3D &coord) const
Evaluate the closest point to the input position on the specified geometric entity and return the res...
TSTTG::Topology topoIface
TSTT interface implementation used to get dimension of geometric entities.
DomainHint hint() const
Give a hint about the nature of the domain for better performance.
sidl::array< void * > geomHandles
Temporary storage for geometry entity handles.
void normal(void *geom_handle, Vector3D &coord) const
Given a geometric entity and a position, evaluate the normal on the geometric entity at the closest p...
void normal_at(Mesh::EntityHandle entity_handle, Vector3D &coordinate) const
Returns the normal of the domain to which "entity_handle" is constrained.
void snap_to(Mesh::EntityHandle entity_handle, Vector3D &coordinat) const
Modifies "coordinate" so that it lies on the domain to which "entity_handle" is constrained.
TSTTM::Mesh meshIface
TSTT interface used to query mesh entity properties.
Used to hold the error state and return it to the application.
void normal_at(Mesh::EntityHandle entity_handle, Vector3D &coordinate) const
Returns the normal of the domain to which "entity_handle" is constrained.
DomainHint
A hint on the characteristics of the domain that Mesquite may use to determine what, if any, scheme to use to cache characteristics of the geometric domain.
void * geomEntHandle
A handle for the geometry entity to evaluate.
Vector3D is the object that effeciently stores information about about three-deminsional vectors...
void * EntityHandle
Opaque EntityHandle type and tag type.
int coord[NPANE][NROW *NCOL][3]
sidl::array< double > positionsOut
static GeomTSTT * create(TSTTG::Geometry &geom, TSTTM::Mesh &mesh, TSTTR::Relate &assoc, MsqError &err)
Create MeshDommain from TSTT classification and geometry interfaces.
void closest_and_normal(void *geom_handle, const Vector3D &position, Vector3D &closest, Vector3D &normal) const
Given a geometric entity and a position, get point on the geometric entity closest to the input posit...
TSTTG::Shape geomIface
TSTT geometry interface implementation to query.
void snap_to(Mesh::EntityHandle entity_handle, Vector3D &coordinat) const
Modifies "coordinate" so that it lies on the domain to which "entity_handle" is constrained.
Common code for specific implementations of MeshDomain on TSTT interfaces.
static T * convert_from_sidl_vector(sidl::array< T > &array)
static sidl::array< T > convert_to_sidl_vector(T *array, size_t size)
DomainTSTT(TSTTG::Geometry &geom, TSTTM::Mesh &mesh, TSTTR::Relate &relate)
invalid function argument passed
void closest_point(Mesh::EntityHandle handle, const Vector3D &position, Vector3D &closest, Vector3D &normal, MsqError &err) const
evaluate closest point and normal
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
A base class describing a Mesquite::MeshDomain implemented on top of the TSTT geometry and classifica...
DomainHint hint() const
Give a hint about the nature of the domain for better performance.
virtual ~GeomTSTTCommon()
sidl::array< TSTTG::GentityType > oneTypeOut
Temporary storage for geometry entity type.
TSTTR::Relate relateIface
TSTT interface implementation for mesh->geometry association.
void closest_point(Mesh::EntityHandle handle, const Vector3D &position, Vector3D &closest, Vector3D &normal, MsqError &err) const
evaluate closest point and normal
void * geom_from_mesh(void *handle) const
Get geometric entity owning a mesh entity.
sidl::array< double > positionsIn
Temporary storate for input and output vectors.
sidl::array< void * > oneMeshHandle
Temporary storage for mesh entity handles.
static msq_std::string process_tstt_error(TSTTB::Error &tstt_err)
GeomEntTSTT(TSTTG::Geometry &geom, void *geom_ent_handle)
GeomTSTTCommon(TSTTG::Geometry &geom)