Woolz Image Processing
Version 1.8.3
|
Files | |
file | Wlz3DSection.c |
Functions for cutting 2D sections from 3D objects. | |
file | Wlz3DSectionFromGeoModel.c |
Functions to cut a 2D geometric model from a 3D geometric model. | |
file | Wlz3DSectionSegmentObject.c |
Segments a 3D object into 2 parts determined by the input section plane. The parts are the domains on either side of the plane. | |
file | Wlz3DSubSection.c |
Return a sub-region of a 3D section via a 3D section transform. | |
file | Wlz3DViewStructUtils.c |
Utility functions associated with 3D views. | |
file | WlzExplode3D.c |
Explodes a 3D domain object into 2D domain objects. | |
Data Structures | |
struct | _WlzThreeDViewStruct |
Defines a planar section through a 3D volume. Typedef: WlzThreeDViewStruct. More... | |
Enumerations | |
enum | _WlzThreeDStdViews { WLZ_X_Y_VIEW, WLZ_Y_Z_VIEW, WLZ_Z_X_VIEW, WLZ_ARBITRARY_VIEW } |
Standard 3D views. Typedef: WlzThreeDStdViews. More... | |
enum | _WlzThreeDViewMode { WLZ_STATUE_MODE, WLZ_UP_IS_UP_MODE, WLZ_FIXED_LINE_MODE, WLZ_ZERO_ZETA_MODE, WLZ_ZETA_MODE } |
3D viewing modes which determine the angle at which the plane is cut through a 3D volume. Typedef: WlzThreeDViewMode. More... | |
Functions | |
WlzObject * | WlzGetSectionFromObject (WlzObject *obj, WlzThreeDViewStruct *view, WlzInterpolationType interp, WlzErrorNum *dstErr) |
Cuts the 2D object which lies on the plane specified by the given view structure from the given 3D object. If the given object is a 3D domain object with grey values then a new 2D object is created with the same grey-type as the given object. Only grey values within the area defined by the view structure reference object are extracted. Returns a rectangular object and value table with size determined by the bounding box which encloses the bounding box of the original but in the viewing direction. More... | |
WlzObject * | WlzGetMaskedSectionFromObject (WlzObject *obj, WlzThreeDViewStruct *view, WlzInterpolationType interp, WlzErrorNum *dstErr) |
Cuts the 2D object which lies on the plane specified by the given view structure from the given 3D object. If the given object is a 3D domain object with grey values then a new 2D object is created with the same grey-type as the given object. Only grey values within the area defined by the view structure reference object are extracted. Returns an object with domain defined by the section cut through the reference object. The value table is rectangular and the same size as from WlzGetSectionFromObject. More... | |
WlzGMModel * | WlzGetSectionFromGMModel (WlzGMModel *gModel, WlzThreeDViewStruct *view, WlzErrorNum *dstErr) |
Get a 2D geometric model which is the intersection a plane, specified by the 3D view structure, and the given 3D geometric model. More... | |
WlzErrorNum | Wlz3DSectionSegmentObject (WlzObject *obj, WlzThreeDViewStruct *viewStr, int *numObjs, WlzObject ***rtnObjs) |
Segment a given 3D object into 2 parts determined by the input section plane. The parts are the domains on either side of the plane. More... | |
WlzObject * | WlzGetSubSectionFromObject (WlzObject *obj, WlzObject *subDomain, WlzThreeDViewStruct *view, WlzInterpolationType interp, WlzObject **maskRtn, WlzErrorNum *dstErr) |
Computes a section through the given 3D object. More... | |
WlzThreeDViewStruct * | WlzMake3DViewStructCopy (WlzThreeDViewStruct *given, WlzErrorNum *dstErr) |
Allocates and intialises a new 3D view and sets it's parameters to those of the given view. The new transform's look up tables are not allocated. More... | |
WlzThreeDViewStruct * | WlzMake3DViewStruct (WlzObjectType type, WlzErrorNum *dstErr) |
Allocates and intialises a 3D view. The transform look up tables are not allocated. More... | |
WlzErrorNum | WlzFree3DViewStruct (WlzThreeDViewStruct *viewStr) |
Frees a view. More... | |
WlzErrorNum | WlzInit3DViewStructAffineTransform (WlzThreeDViewStruct *viewStr) |
Sets up the affine transform of the given view including scale. This does not require any initialisation. The intialisation mask will have the WLZ_3DVIEWSTRUCT_INIT_TRANS bit set. By default the scale parameters are not used. Scaling is enabled by setting bits in the voxelRescaleFlg: setting bit 1 will switch on voxel-size rescaling; setting bit 2 will enable global scaling. More... | |
WlzErrorNum | Wlz3DViewStructSetupTransformLuts (WlzThreeDViewStruct *viewStr) |
Sets up the transformation look up tables of the given view. More... | |
WlzErrorNum | Wlz3DViewStructTransformBB (WlzObject *obj, WlzThreeDViewStruct *viewStr) |
Set up the min and max vertex values for the transformed space. If the input object is a WLZ_3D_DOMAINOBJ then the bounding box will enclose the transformed bounding box of the input object. If the input object is a WLZ_2D_DOMAINOBJ then it is assumed that this is the transformed section and the min and max valuesa are those of the object itself. These values are padded to account for round-off errors. More... | |
WlzErrorNum | WlzInit3DViewStruct (WlzThreeDViewStruct *viewStr, WlzObject *obj) |
Initialises a 3D view with respect to the given view parameters and a 3D object. More... | |
WlzErrorNum | Wlz3DSectionTransformVtx (WlzDVertex3 *vtx, WlzThreeDViewStruct *viewStr) |
Transforms a 3D vertex using the section transform overwriting the vertex values. More... | |
WlzErrorNum | Wlz3DSectionTransformVtxR (WlzThreeDViewStruct *viewStr, WlzDVertex3 vtx, WlzDVertex3 *dstVtx) |
Transforms a 3D vertex using the section transform. More... | |
WlzErrorNum | Wlz3DSectionTransformInvVtx (WlzDVertex3 *vtx, WlzThreeDViewStruct *viewStr) |
Inverse transforms a 3D vertex using the section transform, overwriting the vertex values. More... | |
WlzErrorNum | Wlz3DSectionTransformInvVtxR (WlzThreeDViewStruct *viewStr, WlzDVertex3 vtx, WlzDVertex3 *dstVtx) |
Inverse transforms a 3D vertex using the section transform. More... | |
WlzErrorNum | Wlz3DSectionIncrementDistance (WlzThreeDViewStruct *viewStr, double incr) |
Increments the distance parameter of a 3D view resetting the look up tables as required. This is provided because changing the distance does not require the rotation matrix and all the look up tables only a single multiply and add per look up table entry instead of 2 multiplies and three adds plus all the y look up tables and the rotation matrix with many trigonometry calculations. More... | |
WlzDVertex2 | Wlz3DViewGetIntersectionPoint (WlzThreeDViewStruct *v1, WlzThreeDViewStruct *v2, WlzErrorNum *dstErr) |
Finds a point on the line of intersection of two 3D views. The point is returned in the coordinate system of the first view. This function together with Wlz3DViewGetIntersectionAngle() is useful for finding the line of intersection within one of the planes. More... | |
double | Wlz3DViewGetIntersectionAngle (WlzThreeDViewStruct *v1, WlzThreeDViewStruct *v2, WlzErrorNum *dstErr) |
Finds the angle of the ine of intersection of two views. More... | |
int | Wlz3DViewGetBoundingBoxIntersection (WlzThreeDViewStruct *viewStr, WlzDVertex3 *rtnVtxs, WlzErrorNum *dstErr) |
Gets the vertices of intersection between a section and the bounding box of the reference object. The vertices are returned in order to be used for display etc.. More... | |
int | Wlz3DViewGetBoundingBoxIntersectionA (WlzThreeDViewStruct *viewStr, int *dstSizeArrayVtxs, WlzDVertex3 **dstArrayVtxs, WlzErrorNum *dstErr) |
Gets the vertices of intersection between a section and the given bounding box. The vertices are returned in order to be used for display etc. More... | |
int | Wlz3DViewGetGivenBBIntersection (WlzThreeDViewStruct *viewStr, WlzDVertex3 bbMin, WlzDVertex3 bbMax, WlzDVertex3 *rtnVtxs, WlzErrorNum *dstErr) |
get the vertices of intersection between a section and the given bounding box. The vertices are returned in order to be used for display etc. More... | |
WlzErrorNum | Wlz3DViewGetFixed (WlzThreeDViewStruct *vs, double *dstX, double *dstY, double *dstZ) |
Gets the fixed point coordinates from a 3D view. More... | |
WlzErrorNum | Wlz3DViewSetFixed (WlzThreeDViewStruct *vs, double x, double y, double z) |
Sets the fixed point coordinates in a 3D view. More... | |
WlzErrorNum | Wlz3DViewGetTheta (WlzThreeDViewStruct *vs, double *dstVal) |
Gets the angle theta from the 3D view. More... | |
WlzErrorNum | Wlz3DViewSetTheta (WlzThreeDViewStruct *vs, double val) |
Sets the angle theta from the 3D view. More... | |
WlzErrorNum | Wlz3DViewGetPhi (WlzThreeDViewStruct *vs, double *dstVal) |
Gets the angle phi from the 3D view. More... | |
WlzErrorNum | Wlz3DViewSetPhi (WlzThreeDViewStruct *vs, double val) |
Sets the angle phi from the 3D view. More... | |
WlzErrorNum | Wlz3DViewGetZeta (WlzThreeDViewStruct *vs, double *dstVal) |
Gets the angle zeta from the 3D view. More... | |
WlzErrorNum | Wlz3DViewSetZeta (WlzThreeDViewStruct *vs, double val) |
Sets the angle zeta from the 3D view. More... | |
WlzErrorNum | Wlz3DViewGetDist (WlzThreeDViewStruct *vs, double *dstVal) |
Gets the increment distance from the 3D view. More... | |
WlzErrorNum | Wlz3DViewSetDist (WlzThreeDViewStruct *vs, double val) |
Sets the increment distance in the 3D view. More... | |
WlzErrorNum | Wlz3DViewGetScale (WlzThreeDViewStruct *vs, double *dstVal) |
Gets the scale from the 3D view. More... | |
WlzErrorNum | Wlz3DViewSetScale (WlzThreeDViewStruct *vs, double val) |
Sets the scale in the 3D view. More... | |
WlzErrorNum | Wlz3DViewGetViewMode (WlzThreeDViewStruct *vs, WlzThreeDViewMode *dstVal) |
Gets the view mode from the 3D view. More... | |
WlzErrorNum | Wlz3DViewSetViewMode (WlzThreeDViewStruct *vs, WlzThreeDViewMode val) |
Sets the view mode in the 3D view. More... | |
WlzErrorNum | Wlz3DViewGetUp (WlzThreeDViewStruct *vs, double *dstX, double *dstY, double *dstZ) |
Gets the up vector from the 3D view. More... | |
WlzErrorNum | Wlz3DViewSetUp (WlzThreeDViewStruct *vs, double x, double y, double z) |
Sets the up vector in the 3D view. More... | |
WlzErrorNum | Wlz3DViewGetFixed2 (WlzThreeDViewStruct *vs, double *dstX, double *dstY, double *dstZ) |
Gets the coordinates of the second fixed point from the 3D view. More... | |
WlzErrorNum | Wlz3DViewSetFixed2 (WlzThreeDViewStruct *vs, double x, double y, double z) |
Sets the coordinates of the second fixed point in the 3D view. More... | |
WlzErrorNum | Wlz3DViewGetFixedLineAngle (WlzThreeDViewStruct *vs, double *dstVal) |
Gets the fixed line angle from the 3D view. More... | |
WlzErrorNum | Wlz3DViewSetFixedLineAngle (WlzThreeDViewStruct *vs, double val) |
Sets the fixed line angle in the 3D view. More... | |
WlzErrorNum | Wlz3DViewGetMaxvals (WlzThreeDViewStruct *vs, double *dstX, double *dstY, double *dstZ) |
Gets the section maximum values from the 3D view. More... | |
WlzErrorNum | Wlz3DViewGetMinvals (WlzThreeDViewStruct *vs, double *dstX, double *dstY, double *dstZ) |
Gets the section minimum values from the 3D view. More... | |
void | Wlz3DViewGetPlaneEqn (WlzThreeDViewStruct *view, double *dstA, double *dstB, double *dstC, double *dstD) |
Computes the parameters of the equation of the plane defined by the given 3D view. More... | |
int | Wlz3DViewIntersectAABB (WlzThreeDViewStruct *view, WlzDBox3 box) |
Tests for an intersection between the plane defined by the given 3D view and the given axis aligned bounding box (AABB). More... | |
WlzThreeDViewStruct * | Wlz3DViewStructFromNormal (WlzDVertex3 nrm, WlzDVertex3 org, WlzDVertex3 up, WlzErrorNum *dstErr) |
Creates a new 3D view structure with angles and fixed point set. More... | |
WlzErrorNum | WlzExplode3D (int *dstExpObjCount, WlzObject ***dstExpObjVecP, WlzObject *srcObj) |
Explodes the given 3D domain object into 2D domain objects. More... | |
enum _WlzThreeDStdViews |
Standard 3D views. Typedef: WlzThreeDStdViews.
Enumerator | |
---|---|
WLZ_X_Y_VIEW | |
WLZ_Y_Z_VIEW | |
WLZ_Z_X_VIEW | |
WLZ_ARBITRARY_VIEW |
enum _WlzThreeDViewMode |
3D viewing modes which determine the angle at which the plane is cut through a 3D volume. Typedef: WlzThreeDViewMode.
WlzObject* WlzGetSectionFromObject | ( | WlzObject * | obj, |
WlzThreeDViewStruct * | view, | ||
WlzInterpolationType | interp, | ||
WlzErrorNum * | dstErr | ||
) |
Cuts the 2D object which lies on the plane specified by the given view structure from the given 3D object. If the given object is a 3D domain object with grey values then a new 2D object is created with the same grey-type as the given object. Only grey values within the area defined by the view structure reference object are extracted. Returns a rectangular object and value table with size determined by the bounding box which encloses the bounding box of the original but in the viewing direction.
obj | Given 3D object. |
view | The given view structure. |
interp | Interpolation type - nearest neighbour or linear |
dstErr | Destination pointer for error code, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzDomain::ctr, _WlzObject::domain, _WlzObject::type, WLZ_3D_DOMAINOBJ, WLZ_CONTOUR, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, and WlzGetSubSectionFromObject().
Referenced by WlzGetMaskedSectionFromObject().
WlzObject* WlzGetMaskedSectionFromObject | ( | WlzObject * | obj, |
WlzThreeDViewStruct * | view, | ||
WlzInterpolationType | interp, | ||
WlzErrorNum * | dstErr | ||
) |
Cuts the 2D object which lies on the plane specified by the given view structure from the given 3D object. If the given object is a 3D domain object with grey values then a new 2D object is created with the same grey-type as the given object. Only grey values within the area defined by the view structure reference object are extracted. Returns an object with domain defined by the section cut through the reference object. The value table is rectangular and the same size as from WlzGetSectionFromObject.
obj | Given 3D object. |
view | The given view structure. |
interp | Interpolation type - nearest neighbour or linear |
dstErr | Destination pointer for error code, may be NULL. |
References _WlzDomain::core, _WlzObject::domain, _WlzObject::type, _WlzObject::values, WLZ_3D_DOMAINOBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WlzFreeObj(), WlzGetSectionFromObject(), WlzGetSubSectionFromObject(), and WlzMakeMain().
WlzGMModel* WlzGetSectionFromGMModel | ( | WlzGMModel * | gModel, |
WlzThreeDViewStruct * | view, | ||
WlzErrorNum * | dstErr | ||
) |
Get a 2D geometric model which is the intersection a plane, specified by the 3D view structure, and the given 3D geometric model.
gModel | Given 3D geometric model. |
view | Given view structure which specifies the plane. |
dstErr | Destination pointer for an error code, may be NULL. |
References _WlzGMShell::child, _WlzGMModel::child, _WlzGMVertexT::diskT, _WlzGMLoopT::edgeT, _WlzGMLoopT::face, _WlzGMFace::loopT, _WlzGMEdgeT::next, _WlzGMLoopT::next, _WlzGMShell::next, _WlzGMEdgeT::prev, _WlzGMDiskT::vertex, _WlzGMEdgeT::vertexT, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzDVertex2::vtY, _WlzDVertex3::vtY, Wlz3DViewGetPlaneEqn(), Wlz3DViewIntersectAABB(), WLZ_ERR_DOMAIN_DATA, WLZ_ERR_NONE, WLZ_GMMOD_2D, WlzGeomPlaneTriangleIntersect(), WlzGMModelConstructSimplex2D(), WlzGMModelFree(), WlzGMModelNew(), WlzGMShellGetGBB3D(), and WlzGMVertexGetG3D().
WlzErrorNum Wlz3DSectionSegmentObject | ( | WlzObject * | obj, |
WlzThreeDViewStruct * | viewStr, | ||
int * | numObjs, | ||
WlzObject *** | rtnObjs | ||
) |
Segment a given 3D object into 2 parts determined by the input section plane. The parts are the domains on either side of the plane.
obj | Input object to be segmented. |
viewStr | 3D view structure defining the cut plane. |
numObjs | Number of objects returned. |
rtnObjs | Array of object pointers, space is allocated for the returned object pointers and will need to be freed by the calling rountine. |
References AlcFree(), AlcFreeStackPush(), AlcMalloc(), _WlzIntervalWSpace::colpos, _WlzIntervalWSpace::colrmn, _WlzValues::core, _WlzDomain::core, _WlzThreeDViewStruct::dist, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzIntervalDomain::freeptr, _WlzDomain::i, _WlzInterval::ileft, _WlzThreeDViewStruct::initialised, _WlzIntervalWSpace::intpos, _WlzIntervalWSpace::intrmn, _WlzInterval::iright, _WlzIntervalDomain::kol1, _WlzPlaneDomain::kol1, _WlzIntervalDomain::lastkl, _WlzPlaneDomain::lastkl, _WlzIntervalDomain::lastln, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzIntervalDomain::line1, _WlzPlaneDomain::line1, _WlzIntervalWSpace::linpos, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzObject::type, _WlzCoreDomain::type, _WlzPlaneDomain::type, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, Wlz3DSectionTransformVtx(), WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_EMPTY_DOMAIN, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_EOO, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_DATA, WLZ_ERR_VALUES_NULL, WLZ_INTERVALDOMAIN_INTVL, WLZ_NINT, WLZ_PLANEDOMAIN_DOMAIN, WLZ_RASTERDIR_ILIC, WlzAssignDomain(), WlzAssignObject(), WlzFreeIntervalDomain(), WlzFreeObj(), WlzFreePlaneDomain(), WlzInitRasterScan(), WlzIntervalCount(), WlzIsEmpty(), WlzMakeEmpty(), WlzMakeInterval(), WlzMakeIntervalDomain(), WlzMakeMain(), WlzMakePlaneDomain(), WlzNextInterval(), WlzStandardIntervalDomain(), and WlzStandardPlaneDomain().
WlzObject* WlzGetSubSectionFromObject | ( | WlzObject * | obj, |
WlzObject * | subDomain, | ||
WlzThreeDViewStruct * | view, | ||
WlzInterpolationType | interp, | ||
WlzObject ** | maskRtn, | ||
WlzErrorNum * | dstErr | ||
) |
Computes a section through the given 3D object.
obj | Given 3D object. |
subDomain | Given 2D domain within which to restrict the section. If NULL returned section will be have a rectangular domain which is the maximum for the given object and view transform when the given 3D object is a spatial domain object. |
view | Given view transform. |
interp | Interpolation, should be either WLZ_INTERPOLATION_NEAREST or WLZ_INTERPOLATION_LINEAR. |
maskRtn | Destination pointer for returned domain mask. |
dstErr | Destination error pointer, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzTiledValues::original_table, _WlzValues::t, _WlzTiledValues::tileWidth, _WlzObject::type, _WlzCoreValues::type, _WlzObject::values, WLZ_3D_DOMAINOBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_INTERPOLATION_NEAREST, and WlzGreyTableIsTiled().
Referenced by Wlz3DSectionOcc(), WlzGetMaskedSectionFromObject(), and WlzGetSectionFromObject().
WlzThreeDViewStruct* WlzMake3DViewStructCopy | ( | WlzThreeDViewStruct * | given, |
WlzErrorNum * | dstErr | ||
) |
Allocates and intialises a new 3D view and sets it's parameters to those of the given view. The new transform's look up tables are not allocated.
given | Given view transform. |
dstErr | Destination error pointer, may be NULL. |
References AlcCalloc(), AlcFree(), _WlzThreeDViewStruct::dist, _WlzThreeDViewStruct::fixed, _WlzThreeDViewStruct::fixed_2, _WlzThreeDViewStruct::fixed_line_angle, _WlzThreeDViewStruct::freeptr, _WlzThreeDViewStruct::initialised, _WlzThreeDViewStruct::interp, _WlzThreeDViewStruct::linkcount, _WlzThreeDViewStruct::phi, _WlzThreeDViewStruct::ref_obj, _WlzThreeDViewStruct::scale, _WlzThreeDViewStruct::theta, _WlzThreeDViewStruct::trans, _WlzThreeDViewStruct::type, _WlzThreeDViewStruct::up, _WlzThreeDViewStruct::view_mode, _WlzThreeDViewStruct::voxelRescaleFlg, _WlzThreeDViewStruct::voxelSize, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_3D_VIEW_STRUCT, WLZ_3DVIEWSTRUCT_INIT_NONE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_TRANSFORM_3D_AFFINE, WlzAssignAffineTransform(), WlzMakeAffineTransform(), and _WlzThreeDViewStruct::zeta.
Referenced by Wlz3DSectionOcc(), WlzCopyDomain(), and WlzProj3DToSection().
WlzThreeDViewStruct* WlzMake3DViewStruct | ( | WlzObjectType | type, |
WlzErrorNum * | dstErr | ||
) |
Allocates and intialises a 3D view. The transform look up tables are not allocated.
type | Only WLZ_3D_VIEW_STRUCT is currently allowed. |
dstErr | Destination pointer for an error code, may be NULL. |
References AlcCalloc(), _WlzThreeDViewStruct::dist, _WlzThreeDViewStruct::fixed, _WlzThreeDViewStruct::freeptr, _WlzThreeDViewStruct::initialised, _WlzThreeDViewStruct::interp, _WlzThreeDViewStruct::linkcount, _WlzThreeDViewStruct::phi, _WlzThreeDViewStruct::ref_obj, _WlzThreeDViewStruct::scale, _WlzThreeDViewStruct::theta, _WlzThreeDViewStruct::trans, _WlzThreeDViewStruct::type, _WlzThreeDViewStruct::up, _WlzThreeDViewStruct::view_mode, _WlzThreeDViewStruct::voxelRescaleFlg, _WlzThreeDViewStruct::voxelSize, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_3D_VIEW_STRUCT, WLZ_3DVIEWSTRUCT_INIT_NONE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_TYPE, WLZ_INTERPOLATION_NEAREST, WLZ_STATUE_MODE, WLZ_TRANSFORM_3D_AFFINE, WlzAssignAffineTransform(), WlzMakeAffineTransform(), and _WlzThreeDViewStruct::zeta.
Referenced by Wlz3DViewStructFromNormal(), Wlz3DViewTransformBitmap(), WlzEffBibRead3DView(), WlzGetProjectionFromObject(), and WlzProjectObjToPlane().
WlzErrorNum WlzFree3DViewStruct | ( | WlzThreeDViewStruct * | viewStr | ) |
Frees a view.
viewStr | Given view to free. |
References AlcFree(), AlcFreeStackFree(), _WlzThreeDViewStruct::freeptr, _WlzThreeDViewStruct::initialised, _WlzThreeDViewStruct::linkcount, _WlzThreeDViewStruct::ref_obj, _WlzThreeDViewStruct::trans, WLZ_3DVIEWSTRUCT_INIT_LUT, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WlzFreeAffineTransform(), WlzFreeObj(), and WlzUnlink().
Referenced by Wlz3DSectionOcc(), Wlz3DViewTransformBitmap(), WlzFreeDomain(), WlzGetProjectionFromObject(), WlzProj3DToSection(), and WlzProjectObjToPlane().
WlzErrorNum WlzInit3DViewStructAffineTransform | ( | WlzThreeDViewStruct * | viewStr | ) |
Sets up the affine transform of the given view including scale. This does not require any initialisation. The intialisation mask will have the WLZ_3DVIEWSTRUCT_INIT_TRANS bit set. By default the scale parameters are not used. Scaling is enabled by setting bits in the voxelRescaleFlg: setting bit 1 will switch on voxel-size rescaling; setting bit 2 will enable global scaling.
viewStr | Given view. |
References _WlzThreeDViewStruct::phi, _WlzThreeDViewStruct::theta, _WlzThreeDViewStruct::up, _WlzThreeDViewStruct::view_mode, _WlzThreeDViewStruct::voxelRescaleFlg, _WlzThreeDViewStruct::voxelSize, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_STATUE_MODE, and WLZ_UP_IS_UP_MODE.
Referenced by WlzInit3DViewStruct(), and WlzProjectObjToPlane().
WlzErrorNum Wlz3DViewStructSetupTransformLuts | ( | WlzThreeDViewStruct * | viewStr | ) |
Sets up the transformation look up tables of the given view.
viewStr | Given view. |
References AlcDouble1Malloc(), AlcFreeStackPush(), _WlzThreeDViewStruct::dist, _WlzThreeDViewStruct::freeptr, _WlzThreeDViewStruct::initialised, _WlzAffineTransform::mat, _WlzThreeDViewStruct::maxvals, _WlzThreeDViewStruct::minvals, _WlzThreeDViewStruct::trans, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_3DVIEWSTRUCT_INIT_LUT, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_NINT, WlzAffineTransformInverse(), WlzAffineTransformVertexD3(), WlzFreeAffineTransform(), _WlzThreeDViewStruct::xp_to_x, _WlzThreeDViewStruct::xp_to_y, _WlzThreeDViewStruct::xp_to_z, _WlzThreeDViewStruct::yp_to_x, _WlzThreeDViewStruct::yp_to_y, and _WlzThreeDViewStruct::yp_to_z.
Referenced by WlzInit3DViewStruct().
WlzErrorNum Wlz3DViewStructTransformBB | ( | WlzObject * | obj, |
WlzThreeDViewStruct * | viewStr | ||
) |
Set up the min and max vertex values for the transformed space. If the input object is a WLZ_3D_DOMAINOBJ then the bounding box will enclose the transformed bounding box of the input object. If the input object is a WLZ_2D_DOMAINOBJ then it is assumed that this is the transformed section and the min and max valuesa are those of the object itself. These values are padded to account for round-off errors.
obj | Input object to define the required bounding box of transform range. |
viewStr | 3D view structure with the transform initialised. |
References AlgSort(), _WlzObject::domain, _WlzThreeDViewStruct::initialised, _WlzPlaneDomain::kol1, _WlzPlaneDomain::lastkl, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzPlaneDomain::line1, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzThreeDViewStruct::trans, _WlzObject::type, _WlzPlaneDomain::type, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, Wlz3DSectionTransformVtx(), WLZ_3D_DOMAINOBJ, WLZ_3DVIEWSTRUCT_INIT_TRANS, WLZ_ERR_NONE, WLZ_ERR_OBJECT_DATA, WLZ_ERR_OBJECT_NULL, and WLZ_PLANEDOMAIN_DOMAIN.
Referenced by WlzInit3DViewStruct(), and WlzProjectObjToPlane().
WlzErrorNum WlzInit3DViewStruct | ( | WlzThreeDViewStruct * | viewStr, |
WlzObject * | obj | ||
) |
Initialises a 3D view with respect to the given view parameters and a 3D object.
Initialises a 3D view with respect to the given view parameters and a 3D object. Initialisation involves calculating the bounds of the section, setting up the look up tables to calculate the section image, setting up the rotation matrix and attaching the object as the reference object for this view. This view structure can be reused for simple changes of the view parameter "dist" but otherwise must be re-initialised. This is a convenience rountine which checks previous memory allocation then calls in turn WlzInit3DViewStructAffineTransform(), Wlz3DViewStructTransformBB() and Wlz3DViewStructSetupTransformLuts() and finally adds a link to the reference object.
viewStr | View to be intialised. |
obj | The 3D object to be sectioned. |
References AlcFreeStackFree(), _WlzThreeDViewStruct::freeptr, _WlzThreeDViewStruct::initialised, _WlzThreeDViewStruct::ref_obj, Wlz3DViewStructSetupTransformLuts(), Wlz3DViewStructTransformBB(), WLZ_3DVIEWSTRUCT_INIT_NONE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WlzAssignObject(), WlzFreeObj(), and WlzInit3DViewStructAffineTransform().
Referenced by Wlz3DSectionOcc(), Wlz3DViewTransformBitmap(), WlzGetProjectionFromObject(), and WlzProj3DToSection().
WlzErrorNum Wlz3DSectionTransformVtx | ( | WlzDVertex3 * | vtx, |
WlzThreeDViewStruct * | viewStr | ||
) |
Transforms a 3D vertex using the section transform overwriting the vertex values.
vtx | Given vertex, values are overwritten. |
viewStr | Given view. |
References _WlzThreeDViewStruct::trans, WLZ_ERR_NONE, and WlzAffineTransformVertexD3().
Referenced by Wlz3DSectionSegmentObject(), Wlz3DSectionTransformVtxR(), and Wlz3DViewStructTransformBB().
WlzErrorNum Wlz3DSectionTransformVtxR | ( | WlzThreeDViewStruct * | viewStr, |
WlzDVertex3 | vtx, | ||
WlzDVertex3 * | dstVtx | ||
) |
Transforms a 3D vertex using the section transform.
viewStr | Given view. |
vtx | Vertex to be transformed. |
dstVtx | destination pointer for the transformed vertex. |
References _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, Wlz3DSectionTransformVtx(), WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.
WlzErrorNum Wlz3DSectionTransformInvVtx | ( | WlzDVertex3 * | vtx, |
WlzThreeDViewStruct * | viewStr | ||
) |
Inverse transforms a 3D vertex using the section transform, overwriting the vertex values.
vtx | Given 3D vertex, values are overwritten. |
viewStr | Given view. |
References _WlzThreeDViewStruct::trans, WLZ_ERR_NONE, WlzAffineTransformInverse(), WlzAffineTransformVertexD3(), and WlzFreeAffineTransform().
Referenced by Wlz3DSectionTransformInvVtxR(), and WlzGetProjectionFromObject().
WlzErrorNum Wlz3DSectionTransformInvVtxR | ( | WlzThreeDViewStruct * | viewStr, |
WlzDVertex3 | vtx, | ||
WlzDVertex3 * | dstVtx | ||
) |
Inverse transforms a 3D vertex using the section transform.
viewStr | Given view. |
vtx | Vertex to be transformed. |
dstVtx | Destination pointer for the transformed vertex. |
References _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, Wlz3DSectionTransformInvVtx(), and WLZ_ERR_PARAM_NULL.
WlzErrorNum Wlz3DSectionIncrementDistance | ( | WlzThreeDViewStruct * | viewStr, |
double | incr | ||
) |
Increments the distance parameter of a 3D view resetting the look up tables as required. This is provided because changing the distance does not require the rotation matrix and all the look up tables only a single multiply and add per look up table entry instead of 2 multiplies and three adds plus all the y look up tables and the rotation matrix with many trigonometry calculations.
viewStr | Given view. |
incr | The increment distance. |
References _WlzThreeDViewStruct::dist, _WlzAffineTransform::mat, _WlzThreeDViewStruct::maxvals, _WlzThreeDViewStruct::minvals, _WlzThreeDViewStruct::trans, _WlzDVertex3::vtX, WLZ_ERR_NONE, WLZ_NINT, WlzAffineTransformInverse(), WlzFreeAffineTransform(), _WlzThreeDViewStruct::xp_to_x, _WlzThreeDViewStruct::xp_to_y, and _WlzThreeDViewStruct::xp_to_z.
WlzDVertex2 Wlz3DViewGetIntersectionPoint | ( | WlzThreeDViewStruct * | v1, |
WlzThreeDViewStruct * | v2, | ||
WlzErrorNum * | dstErr | ||
) |
Finds a point on the line of intersection of two 3D views. The point is returned in the coordinate system of the first view. This function together with Wlz3DViewGetIntersectionAngle() is useful for finding the line of intersection within one of the planes.
v1 | First view. |
v2 | Second view. |
dstErr | Destination pointer for an error code, may be NULL. |
References AlgMatrixLUSolveRaw3(), _WlzThreeDViewStruct::dist, _WlzThreeDViewStruct::initialised, _WlzAffineTransform::mat, _WlzThreeDViewStruct::trans, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_ERR_ALG, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WlzAffineTransformInverse(), and WlzFreeAffineTransform().
double Wlz3DViewGetIntersectionAngle | ( | WlzThreeDViewStruct * | v1, |
WlzThreeDViewStruct * | v2, | ||
WlzErrorNum * | dstErr | ||
) |
Finds the angle of the ine of intersection of two views.
v1 | First view. |
v2 | Second view. |
dstErr | Destination pointer for an error code, may be NULL. |
References _WlzThreeDViewStruct::initialised, _WlzAffineTransform::mat, _WlzThreeDViewStruct::trans, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, and WlzAffineTransformInverse().
int Wlz3DViewGetBoundingBoxIntersection | ( | WlzThreeDViewStruct * | viewStr, |
WlzDVertex3 * | rtnVtxs, | ||
WlzErrorNum * | dstErr | ||
) |
Gets the vertices of intersection between a section and the bounding box of the reference object. The vertices are returned in order to be used for display etc..
viewStr | The section view. |
rtnVtxs | Array of 12 vertices to return values. |
dstErr | Destination pointer for an error code, may be NULL. |
References _WlzObject::domain, _WlzPlaneDomain::kol1, _WlzPlaneDomain::lastkl, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzPlaneDomain::line1, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzThreeDViewStruct::ref_obj, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, and Wlz3DViewGetGivenBBIntersection().
Referenced by Wlz3DViewGetBoundingBoxIntersectionA().
int Wlz3DViewGetBoundingBoxIntersectionA | ( | WlzThreeDViewStruct * | viewStr, |
int * | dstSizeArrayVtxs, | ||
WlzDVertex3 ** | dstArrayVtxs, | ||
WlzErrorNum * | dstErr | ||
) |
Gets the vertices of intersection between a section and the given bounding box. The vertices are returned in order to be used for display etc.
viewStr | The section View. |
dstSizeArrayVtxs | Number of intersection verticies allocated, always 12 unless an error occurs. |
dstArrayVtxs | Destination pointer for the array for computed vertices. The array will have 12 verticies allocated by AlcMalloc(). |
dstErr | Destination pointer for error code, may be NULL. |
References AlcMalloc(), _WlzThreeDViewStruct::ref_obj, Wlz3DViewGetBoundingBoxIntersection(), WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, and WLZ_ERR_PARAM_NULL.
int Wlz3DViewGetGivenBBIntersection | ( | WlzThreeDViewStruct * | viewStr, |
WlzDVertex3 | bbMin, | ||
WlzDVertex3 | bbMax, | ||
WlzDVertex3 * | rtnVtxs, | ||
WlzErrorNum * | dstErr | ||
) |
get the vertices of intersection between a section and the given bounding box. The vertices are returned in order to be used for display etc.
viewStr | The section View |
bbMin | Vertex defining the minimum values of the bounding box |
bbMax | Vertex defining the maximum values of the bounding box |
rtnVtxs | Array of returned vertices, must be an array of at least 12 |
dstErr | error return |
References _WlzThreeDViewStruct::initialised, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, Wlz3DViewGetPlaneEqn(), WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, and WLZ_ERR_PARAM_NULL.
Referenced by Wlz3DViewGetBoundingBoxIntersection().
WlzErrorNum Wlz3DViewGetFixed | ( | WlzThreeDViewStruct * | vs, |
double * | dstX, | ||
double * | dstY, | ||
double * | dstZ | ||
) |
Gets the fixed point coordinates from a 3D view.
vs | Given view. |
dstX | Destination pointer for the fixed point X coordinate. |
dstY | Destination pointer for the fixed point Y coordinate. |
dstZ | Destination pointer for the fixed point Z coordinate. |
References _WlzThreeDViewStruct::fixed, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.
WlzErrorNum Wlz3DViewSetFixed | ( | WlzThreeDViewStruct * | vs, |
double | x, | ||
double | y, | ||
double | z | ||
) |
Sets the fixed point coordinates in a 3D view.
vs | Given view. |
x | Fixed point X coordinate. |
y | Fixed point Y coordinate. |
z | Fixed point Z coordinate. |
References _WlzThreeDViewStruct::fixed, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.
WlzErrorNum Wlz3DViewGetTheta | ( | WlzThreeDViewStruct * | vs, |
double * | dstVal | ||
) |
Gets the angle theta from the 3D view.
vs | Given view. |
dstVal | Destination pointer for theta. |
References _WlzThreeDViewStruct::theta, WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.
WlzErrorNum Wlz3DViewSetTheta | ( | WlzThreeDViewStruct * | vs, |
double | val | ||
) |
Sets the angle theta from the 3D view.
vs | Given view. |
val | Value of theta. |
References _WlzThreeDViewStruct::theta, WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.
WlzErrorNum Wlz3DViewGetPhi | ( | WlzThreeDViewStruct * | vs, |
double * | dstVal | ||
) |
Gets the angle phi from the 3D view.
vs | Given view. |
dstVal | Destination pointer for phi. |
References _WlzThreeDViewStruct::phi, WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.
WlzErrorNum Wlz3DViewSetPhi | ( | WlzThreeDViewStruct * | vs, |
double | val | ||
) |
Sets the angle phi from the 3D view.
vs | Given view. |
val | Value of phi. |
References _WlzThreeDViewStruct::phi, WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.
WlzErrorNum Wlz3DViewGetZeta | ( | WlzThreeDViewStruct * | vs, |
double * | dstVal | ||
) |
Gets the angle zeta from the 3D view.
vs | Given view. |
dstVal | Destination pointer for zeta. |
References WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, and _WlzThreeDViewStruct::zeta.
WlzErrorNum Wlz3DViewSetZeta | ( | WlzThreeDViewStruct * | vs, |
double | val | ||
) |
Sets the angle zeta from the 3D view.
vs | Given view. |
val | Value of zeta. |
References WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, and _WlzThreeDViewStruct::zeta.
WlzErrorNum Wlz3DViewGetDist | ( | WlzThreeDViewStruct * | vs, |
double * | dstVal | ||
) |
Gets the increment distance from the 3D view.
vs | Given view. |
dstVal | Destination pointer for the increment distance. |
References _WlzThreeDViewStruct::dist, WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.
WlzErrorNum Wlz3DViewSetDist | ( | WlzThreeDViewStruct * | vs, |
double | val | ||
) |
Sets the increment distance in the 3D view.
vs | Given view. |
val | Value of the increment distance. |
References _WlzThreeDViewStruct::dist, WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.
WlzErrorNum Wlz3DViewGetScale | ( | WlzThreeDViewStruct * | vs, |
double * | dstVal | ||
) |
Gets the scale from the 3D view.
vs | Given view. |
dstVal | Destination pointer for the scale. |
References _WlzThreeDViewStruct::scale, WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.
WlzErrorNum Wlz3DViewSetScale | ( | WlzThreeDViewStruct * | vs, |
double | val | ||
) |
Sets the scale in the 3D view.
vs | Given view. |
val | Value of the scale. |
References _WlzThreeDViewStruct::scale, WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.
WlzErrorNum Wlz3DViewGetViewMode | ( | WlzThreeDViewStruct * | vs, |
WlzThreeDViewMode * | dstVal | ||
) |
Gets the view mode from the 3D view.
vs | Given view. |
dstVal | Destination pointer for the view mode. |
References _WlzThreeDViewStruct::view_mode, WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.
WlzErrorNum Wlz3DViewSetViewMode | ( | WlzThreeDViewStruct * | vs, |
WlzThreeDViewMode | val | ||
) |
Sets the view mode in the 3D view.
vs | Given view. |
val | Value of the view mode. |
References _WlzThreeDViewStruct::view_mode, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WLZ_FIXED_LINE_MODE, WLZ_STATUE_MODE, WLZ_UP_IS_UP_MODE, WLZ_ZERO_ZETA_MODE, and WLZ_ZETA_MODE.
WlzErrorNum Wlz3DViewGetUp | ( | WlzThreeDViewStruct * | vs, |
double * | dstX, | ||
double * | dstY, | ||
double * | dstZ | ||
) |
Gets the up vector from the 3D view.
vs | Given view. |
dstX | Destination pointer for the X coordinate of the up vector. |
dstY | Destination pointer for the Y coordinate of the up vector. |
dstZ | Destination pointer for the Z coordinate of the up vector. |
References _WlzThreeDViewStruct::up, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.
WlzErrorNum Wlz3DViewSetUp | ( | WlzThreeDViewStruct * | vs, |
double | x, | ||
double | y, | ||
double | z | ||
) |
Sets the up vector in the 3D view.
vs | Given view. |
x | X coordinate of the up vector. |
y | Y coordinate of the up vector. |
z | Z coordinate of the up vector. |
References _WlzThreeDViewStruct::up, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.
WlzErrorNum Wlz3DViewGetFixed2 | ( | WlzThreeDViewStruct * | vs, |
double * | dstX, | ||
double * | dstY, | ||
double * | dstZ | ||
) |
Gets the coordinates of the second fixed point from the 3D view.
vs | Given view. |
dstX | Destination pointer for the X coordinate of the second fixed point. |
dstY | Destination pointer for the Y coordinate of the second fixed point. |
dstZ | Destination pointer for the Z coordinate of the second fixed point. |
References _WlzThreeDViewStruct::fixed_2, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.
WlzErrorNum Wlz3DViewSetFixed2 | ( | WlzThreeDViewStruct * | vs, |
double | x, | ||
double | y, | ||
double | z | ||
) |
Sets the coordinates of the second fixed point in the 3D view.
vs | Given view. |
x | X coordinate of the second fixed point. |
y | Y coordinate of the second fixed point. |
z | Z coordinate of the second fixed point. |
References _WlzThreeDViewStruct::fixed_2, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.
WlzErrorNum Wlz3DViewGetFixedLineAngle | ( | WlzThreeDViewStruct * | vs, |
double * | dstVal | ||
) |
Gets the fixed line angle from the 3D view.
vs | Given view. |
dstVal | Destination pointer for the fixed line angle. |
References _WlzThreeDViewStruct::fixed_line_angle, WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.
WlzErrorNum Wlz3DViewSetFixedLineAngle | ( | WlzThreeDViewStruct * | vs, |
double | val | ||
) |
Sets the fixed line angle in the 3D view.
vs | Given view. |
val | The fixed line angle. |
References _WlzThreeDViewStruct::fixed_line_angle, WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.
WlzErrorNum Wlz3DViewGetMaxvals | ( | WlzThreeDViewStruct * | vs, |
double * | dstX, | ||
double * | dstY, | ||
double * | dstZ | ||
) |
Gets the section maximum values from the 3D view.
vs | Given view. |
dstX | Destination pointer for the X section maximum coordinate. |
dstY | Destination pointer for the Y section maximum coordinate. |
dstZ | Destination pointer for the Z section maximum coordinate. |
References _WlzThreeDViewStruct::maxvals, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.
WlzErrorNum Wlz3DViewGetMinvals | ( | WlzThreeDViewStruct * | vs, |
double * | dstX, | ||
double * | dstY, | ||
double * | dstZ | ||
) |
Gets the section minimum values from the 3D view.
vs | Given view. |
dstX | Destination pointer for the X section maximum coordinate. |
dstY | Destination pointer for the Y section maximum coordinate. |
dstZ | Destination pointer for the Z section maximum coordinate. |
References _WlzThreeDViewStruct::minvals, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.
void Wlz3DViewGetPlaneEqn | ( | WlzThreeDViewStruct * | view, |
double * | dstA, | ||
double * | dstB, | ||
double * | dstC, | ||
double * | dstD | ||
) |
Computes the parameters of the equation of the plane defined by the given 3D view.
Computes the parameters of the equation of the plane
\[ax + by + cz + d = 0\]
defined by the given 3D view. None of the destination pointers may be NULL and the 3D view is assumed valid although only its theta, phi distance increment and fixed point are used.view | Given view. |
dstA | Destination pointer for the X parameter. |
dstB | Destination pointer for the Y parameter. |
dstC | Destination pointer for the Z parameter. |
dstD | Destination pointer for the other parameter. |
References _WlzThreeDViewStruct::dist, _WlzThreeDViewStruct::fixed, _WlzThreeDViewStruct::phi, _WlzThreeDViewStruct::theta, _WlzDVertex3::vtX, _WlzDVertex3::vtY, and _WlzDVertex3::vtZ.
Referenced by Wlz3DViewGetGivenBBIntersection(), Wlz3DViewIntersectAABB(), WlzGetSectionFromGMModel(), and WlzProjectObjToPlane().
int Wlz3DViewIntersectAABB | ( | WlzThreeDViewStruct * | view, |
WlzDBox3 | box | ||
) |
Tests for an intersection between the plane defined by the given 3D view and the given axis aligned bounding box (AABB).
view | Given view which defines a plane. |
box | Given axis aligned bounding box. |
References Wlz3DViewGetPlaneEqn(), and WlzGeomPlaneAABBIntersect().
Referenced by WlzGetSectionFromGMModel().
WlzThreeDViewStruct* Wlz3DViewStructFromNormal | ( | WlzDVertex3 | nrm, |
WlzDVertex3 | org, | ||
WlzDVertex3 | up, | ||
WlzErrorNum * | dstErr | ||
) |
Creates a new 3D view structure with angles and fixed point set.
Given normal \(\vec{n}\) with \(\vec{n} = (n_x,n_y,n_z)\), then:
\begin{eqnarray*} \cos(\phi) = \frac{n_z}{|\vec{n}|} \\ \tan(\theta) = \frac{n_y}{n_x} \end{eqnarray*}
nrm | Normal to the view plane (need not be a unit normal). |
org | Fixed point origin for the view structure. |
up | Up vector which is only used if the length of the up vector is not close to zero ( \(|\vec{u}|^2 > 1.0e-06\) ). When the up vector is used then the mode of the view structure is set to up-is-up. |
dstErr | Destination error pointer, may be NULL. |
References _WlzThreeDViewStruct::fixed, _WlzThreeDViewStruct::phi, _WlzThreeDViewStruct::theta, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_3D_VIEW_STRUCT, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_VTX_3_LENGTH, and WlzMake3DViewStruct().
WlzErrorNum WlzExplode3D | ( | int * | dstExpObjCount, |
WlzObject *** | dstExpObjVecP, | ||
WlzObject * | srcObj | ||
) |
Explodes the given 3D domain object into 2D domain objects.
dstExpObjCount | Destination pointer for number of exploded Woolz objects. |
dstExpObjVecP | Destination pointer for vector of exploded objects. |
srcObj | Given woolz object. |
References AlcFree(), AlcMalloc(), _WlzValues::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzPlaneDomain::lastpl, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzObject::type, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_DBG, WLZ_DBG_LVL_1, WLZ_DBG_LVL_FN, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WlzFreeObj(), and WlzMakeMain().