Woolz Image Processing Version 1.4.0
WlzSectionTransform

Data Structures

struct  _WlzThreeDViewStruct
 Defines a planar section through a 3D volume. Typedef: WlzThreeDViewStruct. More...

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.


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

WlzObjectWlzGetSectionFromObject (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.
WlzObjectWlzGetMaskedSectionFromObject (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.
WlzGMModelWlzGetSectionFromGMModel (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.
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.
WlzThreeDViewStructWlzMake3DViewStructCopy (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.
WlzThreeDViewStructWlzMake3DViewStruct (WlzObjectType type, WlzErrorNum *dstErr)
 Allocates and intialises a 3D view. The transform look up tables are not allocated.
WlzErrorNum WlzFree3DViewStruct (WlzThreeDViewStruct *viewStr)
 Frees a view.
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.
WlzErrorNum Wlz3DViewStructSetupTransformLuts (WlzThreeDViewStruct *viewStr)
 Sets up the transformation look up tables of the given view.
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.
WlzErrorNum WlzInit3DViewStruct (WlzThreeDViewStruct *viewStr, WlzObject *obj)
 Initialises a 3D view with respect to the given view parameters and a 3D object.
WlzErrorNum Wlz3DSectionTransformVtx (WlzDVertex3 *vtx, WlzThreeDViewStruct *viewStr)
 Transforms a 3D vertex using the section transform overwriting the vertex values.
WlzErrorNum Wlz3DSectionTransformVtxR (WlzThreeDViewStruct *viewStr, WlzDVertex3 vtx, WlzDVertex3 *dstVtx)
 Transforms a 3D vertex using the section transform.
WlzErrorNum Wlz3DSectionTransformInvVtx (WlzDVertex3 *vtx, WlzThreeDViewStruct *viewStr)
 Inverse transforms a 3D vertex using the section transform, overwriting the vertex values.
WlzErrorNum Wlz3DSectionTransformInvVtxR (WlzThreeDViewStruct *viewStr, WlzDVertex3 vtx, WlzDVertex3 *dstVtx)
 Inverse transforms a 3D vertex using the section transform.
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.
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.
double Wlz3DViewGetIntersectionAngle (WlzThreeDViewStruct *v1, WlzThreeDViewStruct *v2, WlzErrorNum *dstErr)
 Finds the angle of the ine of intersection of two views.
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..
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.
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.
WlzErrorNum Wlz3DViewGetFixed (WlzThreeDViewStruct *vs, double *dstX, double *dstY, double *dstZ)
 Gets the fixed point coordinates from a 3D view.
WlzErrorNum Wlz3DViewSetFixed (WlzThreeDViewStruct *vs, double x, double y, double z)
 Sets the fixed point coordinates in a 3D view.
WlzErrorNum Wlz3DViewGetTheta (WlzThreeDViewStruct *vs, double *dstVal)
 Gets the angle theta from the 3D view.
WlzErrorNum Wlz3DViewSetTheta (WlzThreeDViewStruct *vs, double val)
 Sets the angle theta from the 3D view.
WlzErrorNum Wlz3DViewGetPhi (WlzThreeDViewStruct *vs, double *dstVal)
 Gets the angle phi from the 3D view.
WlzErrorNum Wlz3DViewSetPhi (WlzThreeDViewStruct *vs, double val)
 Sets the angle phi from the 3D view.
WlzErrorNum Wlz3DViewGetZeta (WlzThreeDViewStruct *vs, double *dstVal)
 Gets the angle zeta from the 3D view.
WlzErrorNum Wlz3DViewSetZeta (WlzThreeDViewStruct *vs, double val)
 Sets the angle zeta from the 3D view.
WlzErrorNum Wlz3DViewGetDist (WlzThreeDViewStruct *vs, double *dstVal)
 Gets the increment distance from the 3D view.
WlzErrorNum Wlz3DViewSetDist (WlzThreeDViewStruct *vs, double val)
 Sets the increment distance in the 3D view.
WlzErrorNum Wlz3DViewGetScale (WlzThreeDViewStruct *vs, double *dstVal)
 Gets the scale from the 3D view.
WlzErrorNum Wlz3DViewSetScale (WlzThreeDViewStruct *vs, double val)
 Sets the scale in the 3D view.
WlzErrorNum Wlz3DViewGetViewMode (WlzThreeDViewStruct *vs, WlzThreeDViewMode *dstVal)
 Gets the view mode from the 3D view.
WlzErrorNum Wlz3DViewSetViewMode (WlzThreeDViewStruct *vs, WlzThreeDViewMode val)
 Sets the view mode in the 3D view.
WlzErrorNum Wlz3DViewGetUp (WlzThreeDViewStruct *vs, double *dstX, double *dstY, double *dstZ)
 Gets the up vector from the 3D view.
WlzErrorNum Wlz3DViewSetUp (WlzThreeDViewStruct *vs, double x, double y, double z)
 Sets the up vector in the 3D view.
WlzErrorNum Wlz3DViewGetFixed2 (WlzThreeDViewStruct *vs, double *dstX, double *dstY, double *dstZ)
 Gets the coordinates of the second fixed point from the 3D view.
WlzErrorNum Wlz3DViewSetFixed2 (WlzThreeDViewStruct *vs, double x, double y, double z)
 Sets the coordinates of the second fixed point in the 3D view.
WlzErrorNum Wlz3DViewGetFixedLineAngle (WlzThreeDViewStruct *vs, double *dstVal)
 Gets the fixed line angle from the 3D view.
WlzErrorNum Wlz3DViewSetFixedLineAngle (WlzThreeDViewStruct *vs, double val)
 Sets the fixed line angle in the 3D view.
WlzErrorNum Wlz3DViewGetMaxvals (WlzThreeDViewStruct *vs, double *dstX, double *dstY, double *dstZ)
 Gets the section maximum values from the 3D view.
WlzErrorNum Wlz3DViewGetMinvals (WlzThreeDViewStruct *vs, double *dstX, double *dstY, double *dstZ)
 Gets the section minimum values from the 3D view.
WlzErrorNum WlzExplode3D (int *dstExpObjCount, WlzObject ***dstExpObjVecP, WlzObject *srcObj)
 Explodes the given 3D domain object into 2D domain objects.

Enumeration Type Documentation

Standard 3D views. Typedef: WlzThreeDStdViews.

Enumerator:
WLZ_X_Y_VIEW 
WLZ_Y_Z_VIEW 
WLZ_Z_X_VIEW 
WLZ_ARBITRARY_VIEW 

3D viewing modes which determine the angle at which the plane is cut through a 3D volume. Typedef: WlzThreeDViewMode.

Enumerator:
WLZ_STATUE_MODE 

Corresponds to "walking around a statue" so that if the view is say from the left-hand side then the section will have the top of the statue to the left.

WLZ_UP_IS_UP_MODE 

The projection of the vector up onto the section image will be "up". This is ill-defined if the viewing direction is very close to "up".

WLZ_FIXED_LINE_MODE 
WLZ_ZERO_ZETA_MODE 
WLZ_ZETA_MODE 

Function Documentation

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.

Returns:
A new 2D object cut from the given 3D object.
Parameters:
objGiven 3D object.
viewThe given view structure.
interpInterpolation type - nearest neighbour or linear
dstErrDestination 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, WLZ_ERR_OBJECT_TYPE, WlzFreeContour(), WlzGetSubSectionFromObject(), and WlzMakeMain().

Referenced by WlzEMAPDomainTransform(), WlzGetMaskedSectionFromObject(), and WlzGetSubSectionFromObject().

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.

Returns:
A new 2D object cut from the given 3D object.
Parameters:
objGiven 3D object.
viewThe given view structure.
interpInterpolation type - nearest neighbour or linear
dstErrDestination 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.

Returns:
New 2D geometric model or NULL on error.
Parameters:
gModelGiven 3D geometric model.
viewGiven view structure which specifies the plane.
dstErrDestination pointer for an error code, may be NULL.

References _WlzGMShell::child, _WlzGMModel::child, _WlzGMVertexT::diskT, _WlzGMLoopT::edgeT, _WlzGMLoopT::face, _WlzGMFace::loopT, _WlzGMShell::next, _WlzGMLoopT::next, _WlzGMEdgeT::next, _WlzGMEdgeT::prev, _WlzGMDiskT::vertex, _WlzGMEdgeT::vertexT, _WlzDVertex3::vtX, _WlzDVertex2::vtX, _WlzDVertex3::vtY, _WlzDVertex2::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.

Returns:
Error value.
Parameters:
objInput object to be segmented.
viewStr3D view structure defining the cut plane.
numObjsNumber of objects returned.
rtnObjsArray of object pointers, space is allocated for the returned object pointers and will need to be freed by the calling rountine.
Source:
Wlz3DSectionSegmentObject.c

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, _WlzPlaneDomain::type, _WlzCoreDomain::type, _WlzObject::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().

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.

Returns:
WlzErrorNum
Parameters:
objInput object to define the required bounding box of transform range.
viewStr3D view structure with the transform initialised.
Source:
Wlz3DViewStructUtils.c

References _WlzThreeDViewStruct::dist, _WlzObject::domain, _WlzDomain::i, _WlzThreeDViewStruct::initialised, _WlzIntervalDomain::kol1, _WlzPlaneDomain::kol1, _WlzIntervalDomain::lastkl, _WlzPlaneDomain::lastkl, _WlzIntervalDomain::lastln, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzIntervalDomain::line1, _WlzPlaneDomain::line1, _WlzThreeDViewStruct::maxvals, _WlzThreeDViewStruct::minvals, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzThreeDViewStruct::trans, _WlzPlaneDomain::type, _WlzObject::type, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, Wlz3DSectionTransformVtx(), WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_3DVIEWSTRUCT_INIT_BB, WLZ_3DVIEWSTRUCT_INIT_TRANS, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_DATA, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, 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.

Returns:
Woolz error code.

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.

Parameters:
viewStrView to be intialised.
objThe 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 main(), Wlz3DSectionOcc(), Wlz3DViewTransformBitmap(), WlzDrawDomainObj(), WlzEMAPDomainTransform(), WlzGetProjectionFromObject(), and WlzProj3DToSection().

WlzErrorNum Wlz3DSectionTransformVtx ( WlzDVertex3 vtx,
WlzThreeDViewStruct viewStr 
)

Transforms a 3D vertex using the section transform overwriting the vertex values.

Returns:
Parameters:
vtxGiven vertex, values are overwritten.
viewStrGiven view.

References _WlzThreeDViewStruct::trans, WLZ_ERR_NONE, and WlzAffineTransformVertexD3().

Referenced by Wlz3DSectionSegmentObject(), Wlz3DSectionTransformVtxR(), Wlz3DViewStructTransformBB(), and Wlz3DViewTransformObj().

WlzErrorNum Wlz3DSectionTransformVtxR ( WlzThreeDViewStruct viewStr,
WlzDVertex3  vtx,
WlzDVertex3 dstVtx 
)

Transforms a 3D vertex using the section transform.

Returns:
Woolz error code.
Parameters:
viewStrGiven view.
vtxVertex to be transformed.
dstVtxdestination pointer for the transformed vertex.

References _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, Wlz3DSectionTransformVtx(), WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.

Referenced by main().

WlzErrorNum Wlz3DSectionTransformInvVtx ( WlzDVertex3 vtx,
WlzThreeDViewStruct viewStr 
)

Inverse transforms a 3D vertex using the section transform, overwriting the vertex values.

Returns:
Woolz error code.
Parameters:
vtxGiven 3D vertex, values are overwritten.
viewStrGiven 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.

Returns:
Woolz error code.
Parameters:
viewStrGiven view.
vtxVertex to be transformed.
dstVtxDestination pointer for the transformed vertex.

References _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, Wlz3DSectionTransformInvVtx(), and WLZ_ERR_PARAM_NULL.

Referenced by main().

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.

Returns:
Always returns WLZ_ERR_NONE because this fuction does no error checking!
Parameters:
viewStrGiven view.
incrThe 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.

Returns:
The point of intersection.
Parameters:
v1First view.
v2Second view.
dstErrDestination 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.

Returns:
The angle of intersection in radians.
Parameters:
v1First view.
v2Second view.
dstErrDestination 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, WlzAffineTransformInverse(), and WlzFreeAffineTransform().

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..

Returns:
The number of vertices.
Parameters:
viewStrThe section view.
rtnVtxsArray of 12 vertices to return values.
dstErrDestination 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.

Returns:
The number of vertices in the intersection.
Parameters:
viewStrThe section View.
dstSizeArrayVtxsNumber of intersection verticies allocated, always 12 unless an error occurs.
dstArrayVtxsDestination pointer for the array for computed vertices. The array will have 12 verticies allocated by AlcMalloc().
dstErrDestination 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.

Returns:
The number of vertices in the intersection
Parameters:
viewStrThe section View
bbMinVertex defining the minimum values of the bounding box
bbMaxVertex defining the maximum values of the bounding box
rtnVtxsArray of returned vertices, must be an array of at least 12
dstErrerror return
Source:
Wlz3DViewStructUtils.c

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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
dstXDestination pointer for the fixed point X coordinate.
dstYDestination pointer for the fixed point Y coordinate.
dstZDestination 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
xFixed point X coordinate.
yFixed point Y coordinate.
zFixed 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
dstValDestination 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
valValue 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
dstValDestination 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
valValue 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
dstValDestination 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
valValue 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
dstValDestination 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
valValue 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
dstValDestination 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
valValue 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
dstValDestination 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
valValue 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
dstXDestination pointer for the X coordinate of the up vector.
dstYDestination pointer for the Y coordinate of the up vector.
dstZDestination 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
xX coordinate of the up vector.
yY coordinate of the up vector.
zZ 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
dstXDestination pointer for the X coordinate of the second fixed point.
dstYDestination pointer for the Y coordinate of the second fixed point.
dstZDestination 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
xX coordinate of the second fixed point.
yY coordinate of the second fixed point.
zZ 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
dstValDestination 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
valThe 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
dstXDestination pointer for the X section maximum coordinate.
dstYDestination pointer for the Y section maximum coordinate.
dstZDestination 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.

Returns:
Woolz error code.
Parameters:
vsGiven view.
dstXDestination pointer for the X section maximum coordinate.
dstYDestination pointer for the Y section maximum coordinate.
dstZDestination pointer for the Z section maximum coordinate.

References _WlzThreeDViewStruct::minvals, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.

WlzErrorNum WlzExplode3D ( int *  dstExpObjCount,
WlzObject ***  dstExpObjVecP,
WlzObject srcObj 
)

Explodes the given 3D domain object into 2D domain objects.

Returns:
Error number.
Parameters:
dstExpObjCountDestination pointer for number of exploded Woolz objects.
dstExpObjVecPDestination pointer for vector of exploded objects.
srcObjGiven woolz object.

References AlcFree(), AlcMalloc(), _WlzValues::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzPlaneDomain::lastpl, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzObject::type, _WlzVoxelValues::values, _WlzObject::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().