API Reference > OdDb Classes > OdDb3dSolid Class > OdDb3dSolid Methods > getSlice Method > OdDb3dSolid::getSlice Method (OdDbSurface*, bool, OdDb3dSolidPtr &)
OdDb3dSolid::getSlice Method (OdDbSurface*, bool, OdDb3dSolidPtr &)
Syntax
C++
virtual OdResult getSlice(OdDbSurface* pSurface, bool bGetNegHalfToo, OdDb3dSolidPtr & pNegHalfSolid);
Parameters 
Description 
OdDbSurface* pSurface 
[in] A pointer to a slicing surface.  
bool bGetNegHalfToo 
[in] A flag determining whether the other (negative) part of the native solid should be created as a separate solid (when true).  
OdDb3dSolidPtr & pNegHalfSolid 
[out] A reference to a pointer to the created solid representing the negative half of the native solid. If bGetNegHalfToo is false, NULL value is returned.
 

Returns eOk if the native solid was successfully sliced or an appropriate error code in other case. If pSurface pointer is NULL or the solid is empty, returns eInvalidInput.

Slices the solid with a surface and transforms the native solid to be the portion remaining on the positive side of the slicing surface normal. 

 

The native solid will be transformed to a resulting body which is located in the negative side of the surface normal. 

The caller of this function is responsible for the memory used by the object pointed to by pNegHalfSolid (negative part of the sliced solid) when the function finishes. In the case when pNegHalfSolid is added to a database, the database takes responsibility for the memory. In the case when pNegHalfSolid is not added to a database, the caller must delete memory when it is no longer needed to avoid a memory leak. 

This method is implemented only for Spatial modeler and returns eNotImplementedYet status for other modelers.

Copyright © 2002–2020. Open Design Alliance. All rights reserved.