#include <AlSurface.h>
class AlSurface : public AlObject
AlSurface();
virtual ~AlSurface();
virtual statusCode deleteObject();
virtual AlObject* copyWrapper() const;
statusCode create( int, int, curveFormType, curveFormType, int, int,
const double[], const double[], int, int, const double[],
const int[], const int[] );
statusCode create( int, int, curveFormType, curveFormType, const
double[], const double[], int, int, const double[] );
statusCode createRevolvedSurface(const double[3], const double[3],
double, double, const AlCurve* );
virtual AlObjectType type() const;
virtual AlSurface* asSurfacePtr();
AlSurfaceNode* surfaceNode() const;
curveFormType uForm() const;
curveFormType vForm() const;
int uDegree() const;
int vDegree() const;
int uNumberOfSpans() const;
int vNumberOfSpans() const;
int uNumberOfCVs() const;
int vNumberOfCVs() const;
AlSurfaceCV* firstCV() const;
AlAttributes* firstAttribute() const;
boolean isAffectedByViewFrame() const;
// specific to AlSurface
statusCode setCVsUnaffectedPosition( const double[]);
statusCode setuKnotVector( const double[] );
statusCode setvKnotVector( const double[] );
statusCode setCVsUnaffectedPositionInclMultiples( const double[] );
statusCode setRealuKnotVector( const double[] );
statusCode setRealvKnotVector( const double[] );
statusCode unpileEndKnots( int, const double[] );
boolean isPointActive( double u, double v ) const;
// Common to AlSurface, AlTrimRegion
statusCode CVsWorldPosition( double[], int[], int[])const;
statusCode CVsAffectedPosition( const AlTM&, double[], int[], int[])
const;
statusCode CVsUnaffectedPosition( double[], int[], int[])const;
int uNumberOfKnots() const;
int vNumberOfKnots() const;
statusCode uKnotVector( double[] ) const;
statusCode vKnotVector( double[] ) const;
int uNumberOfCVsInclMultiples() const;
int vNumberOfCVsInclMultiples() const;
statusCode CVsWorldPositionInclMultiples( double[] ) const;
statusCode CVsAffectedPositionInclMultiples( const AlTM&, double[] )
const;
statusCode CVsUnaffectedPositionInclMultiples( double[] )const;
int realuNumberOfKnots() const;
int realvNumberOfKnots() const;
statusCode realuKnotVector( double[] ) const;
statusCode realvKnotVector( double[] ) const;
statusCode area( double& area, boolean worldCoords = TRUE, double
tolerance=0.001 );
statusCode circumference( double& circ, boolean worldCoords = TRUE,
double tolerance=0.001 );
statusCode eval(double,double,boolean,double P[3], double Pu[3]=NULL,
double Pv[3]=NULL, double
n[3]=NULL,boolean=FALSE,boolean=FALSE ) const;
// Specific to AlSurface
AlShader* firstShader() const;
AlShader* nextShader( const AlShader* ) const;
statusCode nextShaderD( AlShader* ) const;
statusCode assignShader( AlShader* );
statusCode layerShader( AlShader* );
statusCode renderInfo( AlRenderInfo& ) const;
statusCode setRenderInfo( const AlRenderInfo& ) const;
boolean trimmed() const;
boolean isTargetSurface() const;
statusCode project( AlCurveNode*, double[3], boolean );
statusCode trim( int, const double[], const double[] );
statusCode trim( int, const AlCurveOnSurface*[] );
statusCode uniformRebuild( AlSurfaceNode* &newSurfaceNode, int nu, int
nv, boolean inU, boolean inV, boolean=TRUE );
AlSurface* untrimmedToTrimmedSurface() const;
AlTrimRegion* trimSurfaceToRegion() const;
AlTrimRegion* firstTrimRegion() const;
AlCurve* localBoundary( int ) const;
AlCurve* getModelSpaceSurfaceBoundary() const;
AlCurve* parameterBoundary( int ) const;
AlCurve* getParamSpaceSurfaceBoundary() const;
AlCurveOnSurface* firstCurveOnSurface() const;
statusCode addCurveOnSurface( AlCurveOnSurface* );
statusCode removeCurveOnSurface( AlCurveOnSurface* );
boolean isDisplayModeSet( AlDisplayModeType ) const;
statusCode setDisplayMode( AlDisplayModeType, boolean );
statusCode doUpdates( boolean newState = TRUE );
statusCode insert( double, Direction );
For more information on how to create the surface geometry, see the description for the create() method.
NOTE: In V5.0 multifillet operations may be animated. This can cause geometry to be deleted and recreated during a viewframe operation. The method isAffectedByViewFrame() will return TRUE if the viewframe may delete the surface CVs, and FALSE if it will not. See the firstCV() method for additional information.
A NURBS surface is described as having two dimensions, u and v. Many of the surface properties (form, multiplicity, etc.) are the same as a NURBS curve but are expressed in both the u and v direction.
The form of a surface in the u or v direction can be one of three types: periodic, closed or open. If a surface is "kPeriodic" in u, then it is tangent continuous in u at all points in that direction. If a surface is "kClosed" in u, it is not periodic but its edges in the u direction are coincident. If the surface is neither closed nor periodic in u, it is considered to be "kOpen". The same applies in the v direction.
There are two ways to delete an AlSurface. If the AlSurface deleteObject() is called, the attached AlSurfaceNode is deleted. If the AlSurfaceNode deleteObject() is called, the attached AlSurface is deleted.
You should always create a surface node for a surface. If you create a surface with no surface node, then the surface is not added to the universe. If you should lose the pointer to the the surface, it will become lost memory.
There is one limitation to this class: you cannot add or remove individual CVs (except by changing multiplicity).
If an AlSurface has curves-on-surface, then you can get a pointer to the first curve-on-surface and then traverse the curves using methods in the class AlCurveOnSurface.
If an AlSurface is trimmed, the trim regions on the surface can be accessed using the firstTrimRegion() method and then traversed using methods in the class AlTrimRegion.
All AlSurface objects will have at least one shader attached to them. These can be accessed through the firstShader() and nextShader() methods.
All AlSurface objects have render information attached to them. The AlRenderInfo structure can be used to query the surface's render parameters.
Surfaces are made of surface control points (or CVs) which you traverse as a list by using the firstCV() in conjunction with the AlSurfaceCV methods. You can also pack the surface information into an array using methods in this class.
int numUCvs = surface->uNumberOfCVs();
int numVCvs = surface->vNumberOfCVs();
double *cvs = new double [numUCvs * numVCvs * 4];
int *uMult = new int [numUCvs];
int *vMult = new int [numVCvs];
int u, v, index;
surface->CVsWorldPosition( cvs, uMult, vMult );
for( index = 0, u = 0; u < numUCvs; u++ ) {
for( v = 0; v < numVCvs; v++, index+=4 ) {
printf(" %g, %g, %g, %g\n",
cvs[index], cvs[index+1], cvs[index+2], cvs[index+3] );
}
}
sFailure - the surface couldn't be deleted
sInvalidObject - the surface is invalid
Surfaces contain two one-dimensional arrays of knot values called knot vectors for each of the 'u' and 'v' parametric directions of the surface. The form and degree of the surface can be different in both the 'u' and 'v' direction. The control points are stored in a two-dimensional array of points so there are a total of uNumControlPts * vNumControlPts control points. The 'controlPoints' parameter must have the dimensions [uNumControlPts][vNumControlPts][4].
Arguments
< uDeg - The degree of the curve in 'u'. Return code
sSuccess - surface was created. statusCode AlSurface::create(int uDeg,int vDeg,curveFormType uForm,curveFormType vForm,const double uKnotVector[],const double vKnotVector[],int uNumControlPts,int vNumControlPts,const double controlPoints[] )
Description
This method is used to create the data used to represent a surface. See the AlCurve::create() method for a general desciption of how NURBS curves are represented with this interface. Surfaces are a natural extension of curves. Arguments
< uDeg - The degree of the curve in 'u'. Return code
sSuccess - surface was created. statusCode AlSurface::createRevolvedSurface( const double startPoint[3], const double endPoint[3], double startAngle, double endAngle, const AlCurve* generatrix )
Description
This method is used to create a surface of revolution. It is used instead of the more complex AlSurface::create() method. Arguments
< startPoint - one end of axis of revolution. Return code
sSuccess - the surface was created curveFormType AlSurface::uForm() const
Description
Returns the form of the surface in the 'u' direction, that is, kOpen, kClosed or kPeriodic. For more information on form, see the AlSurfaceclass description. kInvalidCurve is returned if the surface is invalid.
curveFormType AlSurface::vForm() const
Description
Returns the form of the surface in the 'v' direction, that is, kOpen, kClosed or kPeriodic. For more information on form, see the AlSurface class desription. kInvalidCurve is returned if the surface is invalid.
int AlSurface::uDegree() const
Description
Returns the degree of the surface in the 'u' direction. -1 is returned if the surface is not valid. int AlSurface::vDegree() const
Description
Returns the degree of the surface in the 'v' direction. -1 is returned if the surface is not valid. int AlSurface::uNumberOfSpans() const
Description
Returns the number of spans in the 'u' direction of the surface. If the surface is not valid -1 will be returned. int AlSurface::vNumberOfSpans() const
Description
Returns the number of spans in the 'v' direction of the surface. If the surface is not valid -1 will be returned. int AlSurface::uNumberOfCVs() const
Description
Returns the number of CVs in the 'u' direction of the surface. If the surface is not valid -1 will be returned. int AlSurface::vNumberOfCVs() const
Description
Returns the number of CVs in the 'v' direction of the surface. If the surface is not valid -1 will be returned. AlSurfaceCV* AlSurface::firstCV() const
Description
Returns a pointer to the first CV in this surface. To traverse the CVs of this surface, use the methods in the AlSurfaceCV class. With the 6.1 release of OpenModel it is no longer necessary to specify whether a permanent pointer is necessary as was done in earlier releases. AlAttributes* AlSurface::firstAttribute() const
Description
Returns the first attribute on this surface if any, otherwise NULL is returned. Note that if CV positions are modified through any of the AlSurface, AlSurfaceCV, AlCluster, AlSet, etc. methods then the attributes are removed from the surface. statusCode AlSurface::CVsWorldPosition(double CVList[], int uMultiplicity[], int vMultiplicity[] ) const
Description
Returns the world position of this surface's CVs in the given array and the multiplicity of each CV in the the multiplicity vector. The CV array must have the size [uNumberOfCVs * vNumberOfCVs * 4]. The multiplicity vector uMultiplicity must be of length uNumberOfCVs and the vector vMultiplicity must be of length vNumberOfCVs. Arguments
> CVList - contains all the CVs' world positions upon return Return codes
sSuccess - the CVs' world positions were retrieved statusCode AlSurface::CVsAffectedPosition( const AlTM& tm, double CVList[],int uMultiplicity[],int vMultiplicity[] ) const
Description
Returns the affected position of this surface's CVs in the given array and the multiplicity of each CV in the the multiplicity vector. The CV array must have the size [uNumberOfCVs * vNumberOfCVs * 4]. The multiplicity vector uMultiplicity must be of length uNumberOfCVs and the vector vMultiplicity must be of length vNumberOfCVs. The multiplicity vectors returned by this function are the same as the ones returned by CVsUnaffectedPosition(). Arguments
< tm - the transformation matrix generated while walking the dag. Return codes
sSuccess - the CVs' affected positions were retrieved statusCode AlSurface::CVsUnaffectedPosition( double CVList[],int uMultiplicity[],int vMultiplicity[] ) const
Description
Returns the unaffected positions of this surface's CVs in the given array and the multiplicity of each CV in the the multiplicity vector. The CV array must have the size [uNumberOfCVs * vNumberOfCVs * 4]. The multiplicity vector uMultiplicity must be of length uNumberOfCVs and the vector vMultiplicity must be of length vNumberOfCVs. The multiplicity vectors returned by this function are the same as the ones returned by CVsWorldPosition(). Arguments
> CVList - contains all the CVs' unaffected positions upon return Return codes
sSuccess - the CVs' unaffected positions were retrieved statusCode AlSurface::doUpdates( boolean newState )
Description
See AlDagNode for info
statusCode AlSurface::insert( double param, Direction dir )
Description
Insert an isoparam into the surface. Arguments
< param - parametric value of the new isoparam on the surface Return codes
sSuccess -normal completion statusCode AlSurface::setCVsUnaffectedPosition( const double CVList[] )
Description
Sets the unaffected positions of this surface's CVs to the given array. The passed-in CV array must have the size [uNumberOfCVs * vNumberOfCVs * 4]. Arguments
< CVList - contains all the CVs' unaffected positions upon return Return codes
sSuccess - the unaffected positions were set boolean AlSurface::isAffectedByViewFrame() const
Description
Returns TRUE if a viewframe operation might affect the CVs of this surface due to construction history on multifillets. (In future releases other operations may also affect geometry during a viewframe.) Return code
TRUE - if viewframe operations might affect the geometry boolean AlSurface::isPointActive( double u, double v ) const
Description
Determines the U,V coordinates of a point on a surface is in a trim region. Arguments
< u - the parametric u coordinate of the point on the surface Return codes
TRUE - the point is in a trimmed region statusCode AlSurface::area( double& area, boolean worldCoordinates, double tolerance )
Description
Determines the area of the surface Arguments
< worldCoordinates - the evaluation is to be in world coordinates Return codes
sSuccess - the coordinate was successfully determined statusCode AlSurface::circumference( double& circumference, boolean worldCoordinates, double tolerance )
Description
Determines the circumference of the surface Arguments
< worldCoordinates - the evaluation is to be in world coordinates Return codes
sSuccess - the coordinate was successfully determined statusCode AlSurface::eval(double u, double v, boolean worldCoordinates, double P[3], double Pu[3], double Pv[3], double n[3], boolean uLimitFromBelow, boolean vLimitFromBelow ) const
Description
Determines the 3D coordinate and partial derivatives of the parameter values on the surface. sSuccess will be returned if the evaluation succeeded. sFailure will be returned if the evaluation failed. Arguments
< u - the parametric u coordinate of the point on the surface Return codes
sSuccess - the coordinate was successfully determined int AlSurface::uNumberOfKnots() const
Description
Returns the number of knots in the 'u' direction of the surface. This method will not function properly on surfaces with unpiled end knots. Use realuNumberOfKnots() instead. This method will return -1 if the surface is invalid. int AlSurface::vNumberOfKnots() const
Description
Returns the number of knots in the 'v' direction of the surface. This method will not function properly on surfaces with unpiled end knots. Use realvNumberOfKnots() instead. This method will return -1 if the surface is invalid. statusCode AlSurface::uKnotVector( double knotVector[] ) const
Description
Returns this curve's knot vector in the given 'knotVector'. The parameter 'knotVector' must be of length 'uNumberOfKnots()'. This method will only function properly with surfaces with knots piled up on the ends. For surfaces with unpiled end knots use realuKnotVector() instead. Arguments
> knotVector - vector of length 'uNumberOfKnots()' that contains this curve's knot vector upon return Return codes
sSuccess - the curve's knot vector was returned statusCode AlSurface::vKnotVector( double knotVector[] ) const
Description
Returns this curve's knot vector in the given 'knotVector'. The parameter 'knotVector' must be of length 'vNumberOfKnots()'. This method will only function properly with surfaces with knots piled up on the ends. For surfaces with unpiled end knots use realvKnotVector() instead. Arguments
> knotVector - vector of length 'vNumberOfKnots()' that contains this curve's knot vector upon return Return codes
sSuccess - the v knot vector was returned statusCode AlSurface::setuKnotVector( const double uKnotVector[] )
Description
Sets this curve's knot vector to the given 'uKnotVector'. The parameter 'knotVector' must be of length 'uNumberOfKnots()'. If the surface is trimmed this method does nothing. This method will only function properly with surfaces with knots piled up on the ends. For surfaces with unpiled end knots use setRealuKnotVector() instead. Arguments
< uKnotVector - vector of length 'uNumberOfKnots()' to set this curve with Return codes
sSuccess - the u knot vector was set statusCode AlSurface::setvKnotVector( const double vKnotVector[] )
Description
Sets this curve's knot vector to the given 'vKnotVector'. The parameter 'knotVector' must be of length 'vNumberOfKnots()'. If the surface is trimmed this method does nothing. This method will only function properly with surfaces with knots piled up on the ends. For surfaces with unpiled end knots use setRealvKnotVector() instead. Arguments
< vKnotVector - vector of length 'vNumberOfKnots()' to set this curve with Return codes
sSuccess - the v knot vector was set int AlSurface::uNumberOfCVsInclMultiples() const
Description
Returns the number of control points in the 'u' direction (uDegree + uNumberOfSpans). For more information on multiplicity, see the AlSurface class description. This method returns -1 if the surface is invalid.
int AlSurface::vNumberOfCVsInclMultiples() const
Description
Returns the number of control points in the 'v' direction (vDegree + vNumberOfSpans). For more information on multiplicity, see the AlSurfaceclass description. This method returns -1 if the surface is invalid.
statusCode AlSurface::CVsWorldPositionInclMultiples( double CVList[] ) const
Description
Same as CVsWorldPosition() except that this method includes multiples. The parameter CVList must have dimensions [uNumberOfCVsInclMultiples * vNumberOfCVsInclMultiples * 4]. The surfaceNode must be set or sFailure will be returned For more information on multiplicity, see the AlSurfaceclass description.
NOTE: The data is arranged in the array as cv[u][v][4].
Arguments
> CVList - contains the world positions of all CVs upon return Return codes
sSuccess - the world positions of all CV was returned statusCode AlSurface::CVsAffectedPositionInclMultiples( const AlTM& tm, double CVList[] ) const
Description
Same as CVsAffectedPosition() except that this method includes multiples. The parameter CVList must have dimensions [uNumberOfCVsInclMultiples * vNumberOfCVsInclMultiples * 4]. For more information on multiplicity, see the AlSurface class description.
NOTE: The data is arranged in the array as cv[u][v][4].
Arguments
< tm - the transformation matrix generated while walking the dag. Return codes
sSuccess - the affected positions of all CVs were returned statusCode AlSurface::CVsUnaffectedPositionInclMultiples( double CVList[] ) const
Description
Same as CVsUnaffectedPosition() except that this method includes multiples. The parameter CVList must have dimensions [uNumberOfCVsInclMultiples * vNumberOfCVsInclMultiples * 4]. For more information on multiplicity, see the AlSurface class description. For more information on unaffected position, see the description in the AlSurfaceCV class, method unaffectedPosition().
NOTE: The data is arranged in the array as cv[u][v][4].
Arguments
> CVList - contains the unaffected positions of all CV's upon return Return codes
sSuccess - the unaffected positions of all CVs were returned statusCode AlSurface::setCVsUnaffectedPositionInclMultiples( const double CVList[] )
Description
Same as setCVsUnaffectedPosition() except that this method includes multiples. The parameter CVList must have dimensions [uNumberOfCVsInclMultiples * vNumberOfCVsInclMultiples * 4]. For more information on multiplicity, see the AlSurface class description. For more information on unaffected position, see the description in the AlSurfaceCV class, method unaffectedPosition(). You cannot give multiples different values. This is best explained in the examples in the AlCurve class description. Some of the values in the given CVList may be ignored, because they specify a redundant point due to multiplicity > 1 or due to periodicity.
NOTE: The data is arranged in the array as cv[u][v][4].
Arguments
< CVList - the new positions to set this surface's CVs to. Return codes
sSuccess - the unaffected positions of all CVs were set boolean AlSurface::isTargetSurface() const
Description
Returns TRUE if the surface is a target surface. If this node does not have a parent Dag node, then it is considered not to be a target surface. boolean AlSurface::trimmed() const
Description
Returns TRUE if the surface has been trimmed. A target surface (a surface with a curve-on-surface that has never been trimmed) is not considered to be a trimmed surface. statusCode AlSurface::project( AlCurveNode* curveNode, double vector[3], boolean keep_history )
Description
This method projects a 3D curve along the given vector onto the surface, creating 2D curves on the surface. Several curves can be projected onto the surface which can then be trimmed. Arguments
< curveNode - The curve to be projected onto the surface. Return codes
sSuccess - Successfully projected the curve. statusCode AlSurface::unpileEndKnots( int whichEnds, const double interval[] )
Description
NOTE: This operation generates prototype geometry that may not be compatible with all OpenModel or Alias operations. Operations on unpiled surfaces may result in unexpected results including fatal errors. Use unpiled surfaces at your own risk. Arguments
< whichEnds - one or more of AL_UNPILE_START_U, ..., AL_UNPILE_END_V or'ed together Return codes
sSuccess - the specified ends were unpiled. int AlSurface::realuNumberOfKnots() const
Description
Returns the actual number of u knots on the surface. That is uNumberOfSpans() + 2*uDegree() - 1. (Note that two additional knots are required to define a NURBS curve, but they have no effect on the curve so are not included in this count.) This method returns -1 if the surface is not valid. int AlSurface::realvNumberOfKnots() const
Description
Returns the actual number of v knots on the surface. That is vNumberOfSpans() + 2*vDegree() - 1. (Note that two additional knots are required to define a NURBS curve, but they have no effect on the curve so are not included in this count.) This method returns -1 if the surface is not valid. statusCode AlSurface::realuKnotVector( double knotVector[] ) const
Description
Returns realuNumberOfKnots() in 'knotVector' for the u direction of the surface. Arguments
> knotVector - array to place the knot vector into Return codes
sSuccess - successfully copied the surface's knot vector into knotVector statusCode AlSurface::realvKnotVector( double knotVector[] ) const
Description
Returns realvNumberOfKnots() in 'knotVector' for the v direction of the surface. Arguments
> knotVector - array to place the knot vector into Return codes
sSuccess - successfully copied the surface's knot vector into knotVector statusCode AlSurface::setRealuKnotVector( const double knotVector[] )
Description
Sets the knots in the u direction for this surface. The parameter 'knotVector' must be of 'realuNumberofKnots()'. Arguments
< knotVector - array of knots Return codes
sSuccess - the u knots were successfully set. statusCode AlSurface::setRealvKnotVector( const double knotVector[] )
Description
Sets the knots in the v direction for this surface. The parameter 'knotVector' must be of 'realvNumberofKnots()'. Arguments
< knotVector - array of knots Return codes
sSuccess - the v knots were successfully set. AlShader* AlSurface::firstShader() const
Description
Returns the first shader that this surface object references. Returns NULL if there are no shaders. AlShader* AlSurface::nextShader( const AlShader* last_shader ) const
Description
Returns the shader after the given shader in the object's shader list. Returns NULL if there isn't a next shader. Specifying NULL as parameter will return the first shader. Arguments
< last_shader - Shader from which to walk forward statusCode AlSurface::nextShaderD( AlShader* last_shader ) const
Description
Destructively points 'last_shader' to the shader after the given shader in the object's shader list. Arguments
< last_shader - Shader from which to walk forward Return codes
sSuccess - last_shader now points to the next shader statusCode AlSurface::assignShader( AlShader* shader )
Description
Assigns the given shader to the surface. If the surface already has shaders they will be removed from the surface. The surface must have a surface node for this method to succeed. Arguments
< shader - The shader which will be assigned to the surface. Return codes
sSuccess - the shader was successfully assigned to the surface. statusCode AlSurface::layerShader( AlShader* shader )
Description
Layers the given shader on the surface. The surface must have a surface node for this method to succeed. Arguments
< shader - The shader which will be layered on the surface. Return codes
sSuccess - the shader was successfully layered on the surface. statusCode AlSurface::renderInfo( AlRenderInfo &renderInfo ) const
Description
Fills in the renderInfo structure with the render info for this surface. Arguments
> renderInfo - the structure to fill in. Return codes
sSuccess - if getting the render information was successful. statusCode AlSurface::setRenderInfo( const AlRenderInfo &renderInfo ) const
Description
Sets the render info for this surface to the contents of the renderInfo structure. Arguments
< renderInfo - the structure to take the render information from. Return codes
sSuccess - if setting the render information was successful. AlCurveOnSurface* AlSurface::firstCurveOnSurface() const
Description
Returns the first curve on surface from the list of curves on this surface. Access the remainder of the curves on surfaces in the list with AlCurveOnSurface methods. This method returns NULL if there aren't any curves on this surface. statusCode AlSurface::addCurveOnSurface( AlCurveOnSurface* AlCos )
Description
Add a curve on surface to the list of curves on this surface. It is illegal to add a curve on surface that is already attached to another surface. It is also illegal to add a curve on surface to a surface that has been trimmed (ie. in trim). The surface must be attached to a surfaceNode or this routine will fail. Arguments
< AlCos - the curve-on-surface to add to the surface Return codes
sSuccess - the curve was added statusCode AlSurface::removeCurveOnSurface( AlCurveOnSurface* AlCos )
Description
Remove a curve on surface from the list of curves on this surface. It is illegal to attempt to remove a curve on surface from this surface if it is not attached to this surface. It is also illegal to remove a curve on surface from a surface that is trimmed. Arguments
< AlCos - the curve on surface to remove Return codes
sSuccess - the CoS was removed boolean AlSurface::isDisplayModeSet( AlDisplayModeType mode ) const
Description
Returns TRUE if the specified display mode is toggled on for the surface. Returns FALSE otherwise. Arguments
< mode - display mode of interest. statusCode AlSurface::setDisplayMode( AlDisplayModeType mode, boolean on_or_off )
Description
For the given display mode, if the flag is TRUE then the display mode for the surface is set, otherwise it is unset. Arguments
< mode - display mode of interest. Return values
sSuccess - if this operation was successful. AlTrimRegion* AlSurface::firstTrimRegion() const
Description
Returns the first trim region of a list if the surface has been trimmed. Returns NULL if there is no such trim region. Use the methods in the AlNewTrimRegion class to get trim region information. AlSurface* AlSurface::untrimmedToTrimmedSurface() const
Description
This method is used to convert an untrimmed surface to a trimmed surface. NULL is returned if the function fails. The surface is attached to face and therefore may not be separately deleted. A deletion of the face will also force the deletion of the surface. Use the methods in the AlNewTrimRegion class to get trim region information. AlTrimRegion* AlSurface::trimSurfaceToRegion() const
Description
This method is used to convert a trim surface to a trim region. NULL is returned on failure. The surface is attached to face and therefore may not be separately deleted. A deletion of the face will also force a deletion of the surface. Use the methods in the AlNewTrimRegion class to get trim region information. AlCurve* AlSurface::getModelSpaceSurfaceBoundary() const
Description
Returns the curve resulting from all of the edges of a surface. ne=0 at v=v0,
ne=1 at u=un,
ne=2 at v=vn,
ne=3 at u=u0.
The surface has multiple end knots in u and v. This method misses a bspline segment when an edge has no length (i.e. at a pole). This method builds and returns the true 3D boundary curve. For example, a cylinder would return a curve of 4 bsplines. a line, a circle, a line and a circle. AlCurve* AlSurface::getParamSpaceSurfaceBoundary() const
Description
Returns the parameter space curve of the edges of a surface. ne=0 at v=v0,
ne=1 at u=un,
ne=2 at v=vn,
ne=3 at u=u0.
The surface has multiple end knots in u and v. This method builds and returns the 2D boundary curve. AlCurve* AlSurface::localBoundary( int ne ) const
Description
Returns the bspline resulting from an edge of a surface. NULL is returned if the edge boundary cannot be found. The function extracts the surface 3D boundary bspline corresponding to the edge number ne (0-3). 0 = bottom edge (v = *srf->node0->v)
1 = right edge (u = *srf->noden->u)
2 = top edge (v = *srf->noden->v)
3 = left edge (u = *srf->node0->u)
edge 0 is at v0,
edge 1 is at un,
edge 2 is at un and
edge 3 is at u0.
ne=0 at v=v0,
ne=1 at u=un,
ne=2 at v=vn,
ne=3 at u=u0.
The surface has multiple end knots in u and v. This method handles a bspline segment when an edge has no length (i.e. at a pole). AlCurve* AlSurface::parameterBoundary( int ne ) const
Description
Returns the parameter space bspline of an edge of a surface. NULL is returned if the edge boundary cannot be found. The function extracts the surface 2D boundary bspline corresponding to the edge number ne (0-3). Edge 0 is at v0,
edge 1 is at un,
edge 2 is at un and
edge 3 is at u0.
ne=0 at v=v0,
ne=1 at u=un,
ne=2 at v=vn,
ne=3 at u=u0.
The surface has multiple end knots in u and v. This method builds and returns the 2D boundary curve. statusCode AlSurface::trim( int count, const double u[], const double v[] )
Description
This method applies the current curves on the surface to this (untrimmed) surface. See the descriptions for AlTrimRegion, AlTrimBoundary, and AlTrimCurve for a description of trim geometry. The surface must have a surface node for this method to succeed. A trim selector is a point in the region which is to be kept in the trim. The 'count' value must be greater than 1.
Arguments
< count - number of (u,v) trim selectors Return code
sSuccess - the trim region was successfully applied to the surface. statusCode AlSurface::trim( int count, const AlCurveOnSurface* uvTrimCurves[] )
Description
This method applies the passed curves on the surface to this (untrimmed) surface. Each curve on surface must be a closed curve. The first curve in the array must by the outer boundary of a trim region. All other curves in the array are disjoint closed inner boundaries that do not intersect the outer boundary. See the descriptions for AlTrimRegion, AlTrimBoundary, and AlTrimCurve for a description of trim geometry. The surface must have a surface node for this method to succeed.
Arguments
< count - number of AlCurveOnSurface curves (must be > 0) Return code
sSuccess - a trim region was successfully created. statusCode AlSurface::uniformRebuild( AlSurfaceNode* &newSurfaceNode, int requested_nu, int requested_nv, boolean inU, boolean inV, boolean matchParameterization )
Description
Approximate this rational surface with a uniform non-rational with a given number of spans. This is a "sample and fit" version of the reduction routine. Trim curves and curves on surface are copied and adjusted to the new surface. The parameters requested_nu/v specify the number of spans that are requested. Arguments
> newSurface - the rebuilt copy of the surface Return code
sSuccess - the surface was successfully rebuilt.